/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  font-family: system-ui, sans-serif;
  background-color: #1a1a1a;
  padding: 0;
}

main {
  flex: 1;
  background: white;
  border-radius: 0.5rem;
}

.main-work-list {
  padding-bottom: 1rem;
}

.container {
  margin: 0 auto;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.about-section {
  background-color: #fff;
  color: #000;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  overflow: visible;
  border-left: 4px solid #64baae;
}

.more-text[hidden] {
  display: none !important;
}

.description .more-text {
  display: block;
}

.description .teaser {
  display: -webkit-box;
  line-clamp: 1;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.description.expanded .teaser {
  line-clamp: unset;
  -webkit-line-clamp: unset;
  overflow: visible;
}

/* När sektionen är expanderad: stäng av clamp */
.description.expanded .teaser {
  line-clamp: unset;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.read-more-btn {
  background-color: transparent;
  color: #1d4ed8;
  border: none;
  font-size: 0.95rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  display: inline-block;
  margin-top: 0.5rem;
  transition: color 0.2s ease;
  align-self: end;
}

.read-more-btn:hover {
  color: #2a2a2a;
}

.read-more-btn:focus {
  outline: 2px solid #2a2a2a;
  outline-offset: 2px;
  border-radius: 2px;
}

.about p,
.add p {
  color: rgb(30, 30, 30);
  line-height: 1.4;
}

body {
  font-family: Arial, sans-serif;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* Navbar */
.navbar {
  display: flex;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  align-items: center;
  background: #1a1a1a;
  color: rgb(131, 131, 131);
  position: relative;
}

.logo-container {
  display: flex;
  align-items: center;
}

.logo {
  height: 13px;
  margin-right: 0.8rem;
}

.site-name {
  font-size: 1rem;
  font-weight: bold;
  max-width: 180px;
}

.hamburger {
  font-size: 1.8rem;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  display: block;
}

.nav-links {
  display: none;
  flex-direction: column;
  background-color: #3d3d3d;
  position: absolute;
  top: 60px;
  right: 10px;
  width: 100px;
  list-style: none;
  padding: 0.5rem;
  box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
  border-radius: 0.5rem;
  text-align: center;
}

.nav-links.active {
  display: flex;
}

.nav-links li {
  margin-bottom: 0.5rem;
}

.nav-links li a {
  color: white;
  text-decoration: none;
  font-size: 1rem;
}

.nav-links a.active {
  border-bottom: 2px solid #fec654;
  font-weight: bold;
}

nav[aria-label='breadcrumb'] ol {
  list-style: none;
  display: flex;
  padding-bottom: 0.8rem;
  margin: 1rem;
  font-size: normal;
}

nav[aria-label='breadcrumb'] li + li::before {
  content: '>';
  padding: 0 0.5em;
  color: #424242;
}

nav[aria-label='breadcrumb'] [aria-current='page'] {
  color: #424242;
  font-weight: bold;
  cursor: default;
  text-decoration: none;
}

nav[aria-label='breadcrumb'] a {
  text-decoration: none;
  color: #fa8d56;
  font-weight: bold;
}

nav[aria-label='breadcrumb'] a:hover {
  text-decoration: underline !important;
  color: #424242 !important;
}

.cv-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2rem;
  padding: 2rem;
  background-color: #f8f8f8;
  margin-bottom: 2rem;
  border-radius: 0.5rem;
  border-left: 4px solid #fec654;
}

.cv-image img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.7));
}

.cv-info {
  display: block;
}

.cv-info h1 {
  margin: 0;
  font-size: 2rem;
  color: #333;
}

.cv-info p {
  margin: 0.2rem 0;
  color: #666;
}

.about h2 {
  margin: 1rem 0 0.5rem;
  font-size: 1.7rem;
  color: #333;
}
.about h3 {
  margin: 0.8rem 0 0.3rem;
  font-size: 1.2rem;
  color: #64baae;
  text-transform: uppercase;
}

/* Footer */
.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 0.5rem;
  gap: 2rem;
  color: white;
  border-radius: 0.5rem 0.5rem 0 0;
}

.breadcrumb {
  padding: 1.5rem 3rem 0;
  font-size: 1rem;
}

.site-footer a,
.breadcrumb a {
  color: #fec654;
}

.breadcrumb span {
  margin: 0 0.3rem;
  color: #888;
}

.site-footer a:hover,
.breadcrumb a:hover {
  color: #fa8d56;
}

.site-footer h2 {
  color: #fedd49;
}

.site-footer ul {
  list-style: none;
}

.footer-column {
  width: 100%;
  max-width: 320px;
  text-align: left;
  justify-content: center;
}

.app-wrapper {
  padding: 0.8rem clamp(1.2rem, 4vw + 1rem, 5rem) 3rem;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.75);
}

.app-wrapper h2 {
  color: rgb(55, 55, 55);
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.modal h2 {
  color: black;
  padding: 0;
}

.modal-content {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  max-width: 600px;
  text-align: left;
}

.modal-content p {
  padding: 1rem 3rem;
  line-height: 1.4;
}

.modal-button {
  background-color: #2e7d32;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.modal-button:hover {
  background-color: #1b5e20;
  transform: translateY(-1px);
}

.modal-button:active {
  transform: scale(0.98);
}

.modal-button:focus {
  outline: 3px solid #81c784;
  outline-offset: 2px;
}

.modal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

.modal-actions label {
  flex: 1;
  min-width: 200px;
}

.button-container {
  flex-shrink: 0;
}

#be-aware {
  border-left: 5px solid rgba(244, 67, 54, 0.8);
  background-color: rgb(231, 239, 233);
  margin: 1rem 0 0.5rem 0;
  border-radius: 0.5rem;
}

#check-it-out {
  border-left: 5px solid rgb(40, 167, 69);
  background-color: rgb(231, 239, 233);
  margin-bottom: 1.5rem;
  border-radius: 0.5rem;
}

#be-aware > p,
#check-it-out > p {
  font-size: 0.85rem;
}

.index .experience-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding-top: 1rem;
}

.index .description {
  display: -webkit-box;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Öppnat läge */
.index .description.expanded {
  display: block;
  line-clamp: unset;
  -webkit-line-clamp: unset;
  overflow: visible;
}

/* Card style */
.card {
  word-wrap: break-word; /* för äldre stöd */
  overflow-wrap: anywhere; /* för moderna webbläsare */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: rgb(243, 243, 243);
  padding: 1.2rem;
  border-radius: 0.5rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
  overflow: hidden;
  border-left: 4px solid #64baae;
  min-width: 0;
  min-height: 230px;
}

.card h3 {
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.index .card .location-date {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.about .card p.description {
  font-size: 0.95rem;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  white-space: normal;
  overflow: visible;
}

.index .card-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.add .form-actions {
  grid-column: 1 / -1;
  justify-self: stretch;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  width: 100%;
}

.index .card-actions button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

.index #experience-list .edit-btn {
  font-size: 1rem;
  border: 2px solid #c3e6cb;
  color: #155724;
  background-color: white;
}

.index #experience-list .edit-btn:hover {
  background-color: #a5dcb2;
}

.index #experience-list .remove-btn {
  font-size: 1rem;
  color: #222;
  border: 2px solid #fad07d;
  background-color: white;
}

.index #experience-list .remove-btn:hover {
  background-color: #fac660;
}

.cancel-btn {
  background-color: #f59e0b;
  color: white;
}

.submit-btn {
  background-color: #d32f2f;
  color: white;
}

.button-container {
  text-align: right;
  margin-top: 1.5rem;
}

.index button:not(.modal button),
.add button {
  width: 120px;
}

/* Submit button */
.add #experience-form button[type='submit'] {
  align-self: flex-end;
  font-size: 1rem;
  color: #222;
  cursor: pointer;
  transition: background-color 0.3s ease;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  border: 2px solid #c3e6cb;
  color: #155724;
  background-color: white;
}

.cancel-btn {
  align-self: flex-end;
  font-size: 1rem;
  color: #222;
  cursor: pointer;
  transition: background-color 0.3s ease;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  border: 2px solid #fad07d;
  background-color: white;
}

.add #experience-form button[type='submit']:hover {
  background-color: #a5dcb2;
}

.add #experience-form .cancel-btn:hover {
  background-color: #fac660;
}

.add #experience-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 0;
  justify-content: flex-end;
}

.add #experience-form input,
.add #experience-form textarea {
  font-size: 1rem;
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 0.5rem;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
}

.add #experience-form textarea {
  resize: vertical;
  min-height: 120px;
}

.add section {
  background-color: #f3f3f3;
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  margin: 1rem auto;
  max-width: 900px;
}

.description.expanded {
  overflow: visible !important;
  max-height: none !important;
  line-clamp: unset !important;
  -webkit-line-clamp: unset !important;
  display: block;
}

.description .more-text {
  display: block;
}

/* Bas...och visa bara när de finns */
.status-message {
  display: none;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 1rem;
}
.status-message:not(:empty) {
  display: block;
}

/* Varianter ska stå EFTER basregeln */
.status-message.info {
  background-color: #e7f3ff;
  border: 1px solid #b6dcff;
}
.status-message.success {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}
.status-message.error {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #ae3d1b;
}
.status-message.warning {
  background: #fff3cd;
  border: 1px solid #ffeeba;
  color: #6b5206;
}

.read-more-btn {
  color: #457f77;
  text-decoration: underline;
  font-size: 1rem;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s ease;
  border: none;
}

.read-more-btn:hover {
  color: #64baae;
  text-decoration: none;
  border: none;
}

.about-section.experience-list {
  padding: 2rem clamp(1.2rem, 4vw + 2rem, 5rem) 3rem;
}

/* Tablet (min-width: 600px) */
@media (min-width: 600px) {
  .navbar {
    display: flex;
    justify-content: space-evenly;
  }

  .logo {
    height: 16px;
    margin-right: 0.8rem;
  }

  .site-name {
    font-size: 1.3rem;
    font-weight: bold;
    max-width: 250px;
  }

  .nav-links {
    display: flex;
    flex-direction: row;
    position: static;
    width: auto;
    border: none;
    background-color: transparent;
    gap: 1rem;
    box-shadow: none;
  }

  .nav-links li {
    margin: 0;
  }

  .hamburger {
    display: none;
  }

  .site-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
    gap: 2rem;
    color: white;
    border-radius: 0.5rem 0.5rem 0 0;
  }

  .index .experience-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    padding-top: 1rem;
  }
}

@media (min-width: 700px) {
  .add #experience-form {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    align-items: start;
  }

  .add #experience-form textarea {
    grid-column: span 3;
  }

  .add #experience-form button[type='submit'] {
    grid-column: 3;
    justify-self: end;
  }

  .site-footer {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 2rem 2rem;
    gap: 2rem;
    color: white;
    border-radius: 0.5rem 0.5rem 0 0;
    justify-content: center;
    align-items: flex-start;
  }
}

/* Desktop (min-width: 1024px) */
@media (min-width: 600px) and (max-width: 1024px) {
  .site-footer {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 2rem 2rem;
    gap: 2rem;
    color: white;
    border-radius: 0.5rem 0.5rem 0 0;
    justify-content: center;
  }
}
