/* ==========================================================================
   BYB Bygg & Design AB — layout & struktur
   ========================================================================== */

.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); position: relative; z-index: 2; }
.container-narrow { max-width: 860px; margin: 0 auto; padding: 0 var(--gutter); position: relative; z-index: 2; }

main { display: block; }
section { position: relative; padding: var(--section-y) 0; }
.section-tight { padding: clamp(2.5rem, 5vw, 3.5rem) 0; }

.on-dark { background: var(--ink); color: var(--ink-text); }
.on-dark h1, .on-dark h2, .on-dark h3, .on-dark h4 { color: var(--ink-text); }
.on-dark p { color: var(--ink-text-faded); }
.on-paper-deep { background: var(--paper-deep); }

.section-head { margin-bottom: clamp(2.5rem, 5vw, 3.5rem); max-width: 780px; }
.section-head.center { text-align: center; margin-left: auto; margin-right: auto; }
.section-head h2 { margin-bottom: 1.1rem; }

/* ---- Site header / nav ---- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: transparent;
  transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease), backdrop-filter 0.35s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(18, 17, 16, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-color: var(--ink-line);
}
.header-inner {
  max-width: var(--max); margin: 0 auto;
  padding: 1rem var(--gutter);
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem;
}

.brand { display: flex; align-items: center; gap: 0.65rem; flex-shrink: 0; }
.brand img { height: 42px; width: auto; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong {
  font-family: var(--display); font-size: 1.05rem; font-weight: 700;
  letter-spacing: 0.02em; text-transform: uppercase; color: var(--ink-text);
}
.brand-text span { font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-pale); }

.nav { display: flex; align-items: center; gap: 2rem; }
.nav-links { display: flex; align-items: center; gap: 1.85rem; }
.nav-right { display: flex; align-items: center; gap: 1.5rem; }

/* ---- Mobile menu ---- */
.menu-toggle { display: none; width: 44px; height: 44px; position: relative; z-index: 210; flex-shrink: 0; }

@media (max-width: 1280px) {
  .menu-toggle { display: block; }
  .nav {
    position: fixed; inset: 0;
    width: 100vw; height: 100dvh;
    background: var(--ink);
    flex-direction: column; justify-content: flex-start; align-items: center;
    gap: 1.75rem;
    padding: 6rem 1.5rem 2.5rem;
    transform: translateX(100%);
    transition: transform 0.45s var(--ease);
    z-index: 205;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nav.open { transform: translateX(0); }
  .nav-links { flex-direction: column; gap: 1.35rem; text-align: center; width: 100%; }
  .nav-right { flex-direction: column; gap: 1.5rem; margin-top: 0.5rem; padding-top: 1.75rem; border-top: 1px solid var(--ink-line); width: 100%; align-items: center; }
}

/* ---- Hero ---- */
.hero {
  position: relative;
  min-height: min(92vh, 860px);
  min-height: min(92dvh, 860px);
  display: flex; align-items: center;
  overflow: hidden;
  padding: clamp(6rem, 14vh, 8rem) 0 clamp(3rem, 8vh, 5rem);
}
.hero-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.hero-bg img {
  width: 100%; height: 100%; object-fit: cover;
}
.hero-slideshow img {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 2.2s ease-in-out;
}
.hero-slideshow img.active { opacity: 1; }
.hero-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(18,17,16,0.55) 0%, rgba(18,17,16,0.72) 55%, rgba(18,17,16,0.94) 100%);
}
.hero-content { position: relative; z-index: 2; max-width: 760px; }
.hero-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem;
  margin-bottom: 1.5rem;
  font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-text-faded);
}
.hero-meta .dot { width: 4px; height: 4px; background: var(--gold-bright); border-radius: 50%; }
.hero-title { margin-bottom: 1.5rem; color: var(--ink-text); }
.hero-title em { font-style: normal; color: var(--gold-pale); }
.hero p.lead { color: rgba(244,241,233,0.88); max-width: 52ch; margin-bottom: 2.25rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }

/* Trust bar */
.trust-bar { border-top: 1px solid var(--ink-line); background: var(--ink-soft); padding: 1rem 0; }
.trust-bar-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 0; font-size: 0.82rem; letter-spacing: 0.02em; color: var(--ink-text-faded); }
.trust-bar-list li { display: flex; align-items: center; white-space: nowrap; padding: 0.2rem 0; gap: 0.5rem; }
.trust-bar-list li:not(:last-child)::after { content: '·'; color: var(--gold-bright); font-weight: 700; margin: 0 0.9rem; }
.trust-bar-list strong { color: var(--ink-text); font-weight: 600; }
@media (max-width: 720px) {
  .trust-bar-list { flex-direction: column; align-items: center; gap: 0.6rem; text-align: center; }
  .trust-bar-list li:not(:last-child)::after { display: none; }
}

/* Grids */
.services-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.75rem; }
@media (min-width: 640px) { .services-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; } }
@media (min-width: 1020px) { .services-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.values-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; }
@media (min-width: 700px) { .values-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.25rem; } }

.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 1.5rem; }
@media (min-width: 700px) { .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.story-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; align-items: center; }
.story-grid > * { min-width: 0; }
@media (min-width: 900px) { .story-grid { grid-template-columns: 1.05fr 1fr; gap: 4rem; } }
.story-grid.reverse { direction: rtl; }
.story-grid.reverse > * { direction: ltr; }
.story-grid h2 { margin-bottom: 0.9rem; }

.case-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; align-items: center; }
.case-grid > * { min-width: 0; }
@media (min-width: 900px) { .case-grid { grid-template-columns: 1fr 1fr; gap: 3rem; } }
.case-grid p.lead { margin-bottom: 1.75rem; }
#nobbelov { scroll-margin-top: 96px; }

.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3rem; }
@media (min-width: 860px) { .contact-grid { grid-template-columns: 0.95fr 1.05fr; gap: 4rem; } }

.footer-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.75rem; }
@media (min-width: 700px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5rem 2rem; } }
@media (min-width: 1020px) { .footer-grid { grid-template-columns: 1.3fr 1fr 1fr 1.1fr; gap: 3rem; } }

.image-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
@media (min-width: 640px) { .image-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 700px) { .image-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.form-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
@media (min-width: 560px) { .form-row.split { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 560px) { .form-row.split-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Legal page */
.legal-content { max-width: 780px; }
.legal-content h2 { margin: 2.5rem 0 1rem; font-size: clamp(1.25rem, 2vw, 1.5rem); }
.legal-content h2:first-child { margin-top: 0; }
.legal-content h3 { margin: 1.5rem 0 0.75rem; font-size: 1.05rem; }
.legal-content p { max-width: 72ch; margin-bottom: 1rem; }
.legal-content ul { max-width: 72ch; margin: 0.5rem 0 1.25rem 1.25rem; list-style: disc; color: var(--text-soft); }
.legal-content li { margin-bottom: 0.4rem; }

/* Safe area */
@supports (padding: max(0px)) {
  .site-header { padding-top: env(safe-area-inset-top); }
}

html, body { touch-action: manipulation; }
