/* ======== CSS Index ======== */
/* 1) Base reset and typography */
/* 2) Header, logo, nav, hamburger */
/* 3) Hero */
/* 4) Sections: About, Services, Contact */
/* 5) Services list styling */
/* 6) Footer */
/* 7) Responsive: mobile/desktop */
/* 8) Dark mode overrides */
/* ======== Reset ======== */
html {
  scroll-behavior: smooth;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: 'Montserrat', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  line-height: 1.6;
  background: #f5f5f5;
  color: #333;
}

/* Serif headings for a trustworthy, legal feel */
h1 {
  font-weight: 100;
  font-family: 'GFS Didot', Georgia, 'Times New Roman', serif;
  font-size: 2rem; /* explicit size to satisfy Lighthouse */
}
h1:where(:is(article, aside, nav, section) *) {
  font-size: 2rem; /* ensure consistent size when nested in sectioning elements */
}
h3 {
  font-weight: 400;
  font-family: 'Montserrat', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* Base nav link styles */
nav a {
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
  font-size: 20px; /* larger nav text on desktop */
}
nav a:link,
nav a:visited {
  color: #333; /* standardfärg för länkar */
  text-decoration: none;
}
/* Active link underline (light mode/default) */
nav a.active {
  border-bottom: 2px solid #000;
}

/* ======== Header (restored) ======== */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 90px; /* se till att headern alltid har höjd */
  padding: 1rem 2rem;
  display: flex;
  background-color: #f9f9f9;
  justify-content: center; /* behåll för desktop */
  align-items: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

header .logo {
  position: absolute;
  left: 2rem;
  font-weight: bold;
}

/* Logo image sizing */
header .logo img {
  height: 60px;
  width: auto;
  display: block;
}

/* Base navigation list and container */
nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  font-family: 'Montserrat', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* Center the nav list within the nav/header */
nav {
  display: flex;
  justify-content: center;
}

/* Hamburger */
.hamburger {
  display: none; /* hidden on desktop */
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 22px;
  cursor: pointer;
  position: absolute;
  right: 2rem;
}
/* Visible bars for the hamburger */
.hamburger span {
  display: block;
  height: 3px;
  width: 100%;
  background: #333; /* light mode */
  border-radius: 2px;
  transition: all 0.3s ease-in-out;
}
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}
h2,
h4,
h5,
h6 {
  font-family: 'GFS Didot', Georgia, 'Times New Roman', serif;
  font-weight: 700;
  line-height: 1.25;
}
#hero {
  position: relative;
  width: 100%;
  height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: zoomIn 4s ease-out forwards;
}
@keyframes zoomIn {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.1);
  }
}
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 20px;
  text-align: center;
  color: #fff;
}
.hero-content h1 {
  font-size: 55px;
  font-weight: 400;
  text-shadow: 2px 2px 4px rgba(50, 50, 50, 0.6);
  margin-bottom: 20px;
}
.hero-content h2 {
  font-family: 'Montserrat', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 18px;
  margin-bottom: 30px;
  text-shadow: 2px 2px 3px rgba(50, 50, 50, 0.9);
}
.hero-btn {
  display: inline-block;
  background: #fff;
  color: #000;
  padding: 12px 30px;
  border-radius: 4px;
  font-weight: bold;
  transition: 0.3s;
}
.hero-btn:hover {
  background: #f0f0f0;
}

/* ======== Sektioner ======== */
section {
  min-height: 50vh;
  padding: 4rem 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center; /* default for non-wrapped content */
}
#about .section-inner,
#services .section-inner,
#contact .section-inner {
  max-width: 600px;
  width: 100%;
  margin: 0; /* base, overridden per-section below */
  text-align: left; /* left-align text inside */
  display: grid;
  gap: 1rem; /* space between title and text */
}

#about h2,
#services h2,
#contact h2 {
  margin-bottom: 0.5rem;
}
#about {
  background: #292929;
  color: #f1efef;
  justify-content: flex-start; /* align card to the left */
}
#about .section-inner { margin-left: 280px; gap: 1.25rem; }
/* Subtle lead for first paragraph in About */
#about .section-inner p:first-of-type {
  font-size: 1.05rem;
  line-height: 1.7;
}
/* Match Kontakt section to Om Mig */
#contact {
  background: #292929;
  color: #f1efef;
  justify-content: flex-start; /* align card to the left */
}
#contact .section-inner { margin-left: 280px; }
/* Contact content styling */
#contact .lead {
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 0.5rem;
}
#contact .contact-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  display: grid;
  gap: 0.5rem;
}
#contact .contact-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
#contact .contact-list li:last-child { border-bottom: none; }
#contact .contact-list .emoji {
  width: 1.25rem;
  display: inline-flex;
  justify-content: center;
}
/* Ensure links inside contact list are not blue; match section color */
#contact .contact-list a {
  color: inherit;
  text-decoration: none;
}
#contact .contact-list a:hover,
#contact .contact-list a:focus {
  text-decoration: underline;
}

/* Desktop safety */
@media (min-width: 769px) {
  .hamburger { display: none; }
  nav ul { display: flex; position: static; box-shadow: none; width: auto; padding: 0; gap: 2rem; background: transparent; }
}

/* Mobile navigation */
@media (max-width: 768px) {
  header {
    justify-content: space-between;
    padding: 0.5rem 1rem;
    min-height: 72px;
  }
  header .logo img { height: 44px; }
  nav ul {
    position: absolute;
    top: 72px;
    right: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #fff;
    width: 200px;
    padding: 2rem 0;
    gap: 1rem;
    display: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-left-radius: 5px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.06);
  }
  nav ul.active { display: flex; }
  nav a { font-size: 17px; }
  .hamburger { display: flex; }
}
#services {
  background: #f1efef;
  color: #242424;
  justify-content: flex-end; /* align card to the right */
}
#services .section-inner { margin-right: 280px; }
/* Services list */
  #services .services-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0; /* space from intro paragraph */
    display: grid;
    gap: 1rem;
  }
  #services .service-item {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0.25rem 0; /* subtle vertical spacing */
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  }
  #services .service-item:last-child { border-bottom: none; }
  #services .service-item h3 {
    margin: 0 0 0.25rem;
    font-weight: 600;
    display: flex;
    align-items: baseline;
    gap: 1rem; /* tighter space between title and price */
    padding-right: 2rem; /* pull price slightly left from edge */
  }
  #services .service-item h3 .price {
    margin-left: auto;
    font-weight: 700;
    color: #555;
    white-space: nowrap;
  }
  #services .service-item p {
    margin: 0;
    color: #333;
  }
/* Optional: center on small screens for readability */
@media (max-width: 768px) {
  #about, #services, #contact {
    justify-content: center;
  }
  #about .section-inner,
  #services .section-inner,
  #contact .section-inner {
    margin: 0 1rem; /* keep comfortable gutters on mobile */
  }
}

/* On small screens, let the last service item's price wrap and reduce spacing */
@media (max-width: 550px) {
  /* Make all service prices slightly smaller on small screens */
  #services .service-item h3 .price {
    font-size: 0.8em;
  }
  #services .services-list li:last-child h3 {
    flex-wrap: wrap;
    gap: 0.125rem; /* tighter gap between title and price */
    padding-right: 0.5rem; /* less right padding so price sits closer */
    margin-bottom: 0.1rem; /* reduce space before wrapped price */
  }
  #services .services-list li:last-child h3 .price {
    margin-left: 0;
    flex-basis: 100%;
    white-space: normal;
    text-align: left;
    margin-top: 0; /* remove extra vertical gap */
  }
}

/* ======== Footer ======== */
footer {
  background: #242424;
  color: #f9f9f9;
  text-align: center;
  padding: 2.25rem; /* slightly larger padding overall */
}

.footer-info {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  justify-content: center;
  align-items: center;
}
.footer-info ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 1rem 1.5rem;
}

/* Footer links: inherit light color, no default blue underline */
footer a {
  color: inherit;
  text-decoration: none;
}
footer a:hover,
footer a:focus {
  text-decoration: underline;
}

/* More space above and below the © Florea Juridik line */
footer p {
  margin: 1.25rem 0; /* increase top and bottom spacing */
}

/* Stack footer content on narrow screens */
@media (max-width: 600px) {
  .footer-info {
    flex-direction: column;
    gap: 0.75rem; /* tighter between groups when stacked */
  }
  .footer-info ul {
    flex-direction: column;
    gap: 0.5rem; /* stack individual items */
    align-items: center;
  }
}

.spacer {
  height: 90px;
}

@media (max-width: 768px) {
  .spacer {
    height: 72px; /* matchar mindre header på mobil */
  }
}
@media (prefers-color-scheme: dark) {
  header {
    background-color: #242424;
  }
  nav a:link,
  nav a:visited {
    color: #f1efef;
  }
  /* Active link underline in dark header */
  nav a.active {
    border-bottom: 2px solid #f1efef;
  }
  /* hamburger bars become light in dark mode */
  .hamburger span {
    background: #f1efef;
  }
  /* In dark mode, the mobile dropdown stays white; use dark text for contrast */
  @media (max-width: 768px) {
    nav ul { background-color: #f1efef; }
    nav ul a:link,
    nav ul a:visited { color: #242424; }
    /* Active link underline inside light dropdown */
    nav ul a.active { border-bottom: 2px solid #242424; }
  }
}
