/* =============================================================================
   Atelje Vek — components
   Header, footer, language switcher, project cards/grid, galleries.
   Built on tokens.css + base.css. Refine spacing against the reference CSS in
   docs/breakdance-css-reference/ (post-2378 header, post-2347 footer,
   post-2364 projects archive, post-1040 contact).
   ============================================================================ */

/* --- Site header --- */
.site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    background: var(--white);
    border-bottom: 1px solid var(--line);
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--col-gap);
    min-height: 72px;
}
.site-header__logo { display: inline-flex; align-items: center; }
.site-header__logo img { height: 44px; width: auto; display: block; }

.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav a {
    color: var(--ink);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.9rem;
}
.main-nav a:hover,
.main-nav a.is-active { color: var(--brand); }

/* Language switcher */
.lang-switch { display: inline-flex; gap: 6px; align-items: center; font-size: 0.85rem; }
.lang-switch a { color: var(--muted); }
.lang-switch a.is-active { color: var(--black); font-weight: 600; }
.lang-switch span { color: var(--line); }

/* Mobile nav toggle */
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
@media (max-width: 900px) {
    .nav-toggle { display: inline-flex; }
    .main-nav {
        position: fixed; inset: 72px 0 auto 0;
        flex-direction: column;
        background: var(--white);
        padding: 24px var(--section-pad-x);
        border-bottom: 1px solid var(--line);
        transform: translateY(-120%);
        transition: transform var(--transition) ease;
    }
    .main-nav.is-open { transform: translateY(0); }
}

/* Projects sector dropdown */
.nav-item { position: relative; display: inline-flex; align-items: center; }
.nav-item--has-sub::after { content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 16px; } /* hover bridge */
.nav-sub {
    list-style: none; margin: 0; padding: 8px 0;
    position: absolute; top: calc(100% + 14px); left: 0; min-width: 220px;
    background: var(--white); border: 1px solid var(--line); box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    opacity: 0; visibility: hidden; transform: translateY(6px);
    transition: opacity var(--transition) ease, transform var(--transition) ease;
    z-index: var(--z-dropdown);
}
.nav-item--has-sub:hover .nav-sub,
.nav-item--has-sub:focus-within .nav-sub { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-sub a { display: block; padding: 8px 18px; text-transform: uppercase; font-size: 0.82rem; letter-spacing: 0.04em; color: var(--ink); white-space: nowrap; }
.nav-sub a:hover { color: var(--brand); background: rgba(15,135,144,0.06); }
@media (max-width: 900px) {
    .nav-item, .nav-item--has-sub { display: block; width: 100%; }
    .nav-item--has-sub::after { content: none; }
    .nav-sub {
        position: static; opacity: 1; visibility: visible; transform: none;
        box-shadow: none; border: 0; padding: 4px 0 8px 16px; min-width: 0;
    }
}

/* --- Footer --- */
.site-footer {
    background: var(--black);
    color: var(--white);
    padding-block: 64px;
}
.site-footer a { color: var(--white); }
.site-footer a:hover { color: var(--brand); }
.site-footer__grid { display: grid; gap: var(--col-gap); grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 767px) { .site-footer__grid { grid-template-columns: 1fr; } }

/* --- Hero (split: teal panel + photo; stacks on phone) --- */
.hero { display: grid; grid-template-columns: minmax(0, 42%) 1fr; min-height: 86vh; color: var(--white); overflow: hidden; }
.hero__panel {
    background: #3c8c93; /* matches Figma hero teal (lighter than --brand) */
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; gap: 24px; padding: 64px clamp(24px, 6%, 80px);
}
.hero__logo { width: clamp(160px, 16vw, 260px); height: auto; }
.hero__title { color: var(--white); margin: 0; font-size: clamp(2rem, 3.6vw, 3.1rem); line-height: 1.1; }
.hero__subtitle { max-width: 42ch; margin: 0; font-size: 1.05rem; color: rgba(255,255,255,0.92); }
.hero__media { position: relative; overflow: hidden; }
.hero__bg { width: 100%; height: 100%; object-fit: cover; transform-origin: center; animation: hero-zoom 24s ease-in-out infinite alternate; }
.btn--hero { background: transparent; border: 1px solid var(--white); color: var(--white); padding: var(--btn-pad-lg); text-transform: uppercase; letter-spacing: 0.04em; }
.btn--hero:hover { background: var(--white); color: var(--brand); }

@keyframes hero-zoom { from { transform: scale(1); } to { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .hero__bg { animation: none; } }
@media (max-width: 767px) {
    .hero { grid-template-columns: 1fr; min-height: auto; }
    .hero__media { order: -1; min-height: 280px; }
    .hero__panel { padding: 48px 24px; }
}

/* --- Project cards / grid --- */
.project-card { position: relative; overflow: hidden; }
.project-card__img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; transition: transform var(--transition) ease; }
.project-card:hover .project-card__img { transform: scale(1.04); }
.project-card__overlay {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; justify-content: flex-end;
    padding: 24px;
    background: linear-gradient(to top, rgba(0,0,0,0.55), transparent 60%);
    color: var(--white);
}
.project-card__title { font-family: var(--font-heading); font-size: var(--fs-h4); color: var(--white); margin: 0; }
.project-card__meta { font-size: 0.85rem; color: var(--line); }

/* --- Project detail meta table --- */
.project-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 32px; margin: 32px 0; }
.project-meta dt { font-family: var(--font-accent); text-transform: uppercase; letter-spacing: 0.05em; color: var(--brand); font-size: 0.8rem; }
.project-meta dd { margin: 0 0 12px; font-size: 1.05rem; }

/* --- Gallery --- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gallery img { aspect-ratio: 1; object-fit: cover; cursor: zoom-in; }
@media (max-width: 767px) { .gallery { grid-template-columns: repeat(2, 1fr); } }

/* --- Partnerships strip --- */
.partners { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 48px; }
.partners img { max-height: 56px; width: auto; filter: grayscale(1); opacity: 0.7; transition: all var(--transition) ease; }
.partners a:hover img { filter: none; opacity: 1; }

/* --- Skip link --- */
.visually-hidden:focus { position: static !important; width: auto; height: auto; clip: auto; padding: 8px 16px; }

/* --- Section / page headings --- */
.section__title,
.page-title { margin-bottom: 0.6em; }
.page-title { font-size: var(--fs-h1); }
.eyebrow + .section__title,
.eyebrow + .page-title { margin-top: 0.1em; }


/* --- Footer detail --- */
.site-footer__brand { display: inline-block; margin-bottom: 16px; }
.site-footer__brand img { height: 64px; width: auto; display: block; }
.site-footer__tagline { color: var(--muted-2); max-width: 32ch; }
.site-footer__heading { color: var(--white); font-family: var(--font-accent); text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.85rem; margin-bottom: 16px; }
.site-footer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.site-footer__legal { margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.15); font-size: 0.85rem; color: var(--muted-2); }

/* --- Sector filters --- */
.filters { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 48px; }
.filter { font-family: var(--font-accent); text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.85rem; padding: 8px 18px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); }
.filter:hover { border-color: var(--brand); color: var(--brand); }
.filter.is-active { background: var(--brand); border-color: var(--brand); color: var(--white); }

/* --- Project detail --- */
.project-hero img { width: 100%; max-height: 70vh; object-fit: cover; }
.project-detail { max-width: 820px; }
.back-link { font-family: var(--font-accent); text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.8rem; display: inline-block; margin-bottom: 16px; }
.project-meta > div { display: contents; }
.project-description { font-size: 1.1rem; color: var(--ink-soft); }

/* --- About --- */
.about { max-width: 980px; }
.about__lead { margin: 0 0 64px; max-width: 40ch; }
.about__split { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--col-gap); align-items: center; margin-bottom: 64px; }
.about__image { border-radius: var(--radius); width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 767px) {
    .about__split, .about__split--reverse { grid-template-columns: 1fr; }
    .about__split--reverse .about__image { order: -1; }
}

/* --- Contact --- */
.contact { max-width: 980px; }
.contact__grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 64px; margin-top: 32px; }
@media (max-width: 767px) { .contact__grid { grid-template-columns: 1fr; gap: 40px; } }
.field-error { color: #c0392b; font-size: 0.85rem; display: block; margin-top: 4px; }
.validation-summary { color: #c0392b; }
.alert { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 24px; }
.alert--success { background: rgba(15,135,144,0.1); color: var(--brand-deep); border: 1px solid var(--brand); }

/* --- Rich text (About / Privacy bodies) --- */
.narrow { max-width: 760px; }
.rich-text h3 { margin-top: 1.4em; font-size: var(--fs-h4); }
.rich-text ul { padding-left: 1.2em; margin: 0 0 1em; }
.rich-text li { margin-bottom: 0.4em; }
.rich-text a { text-decoration: underline; }

/* --- Lightbox --- */
.lightbox { position: fixed; inset: 0; z-index: var(--z-lightbox); display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.92); }
.lightbox[hidden] { display: none; }
.lightbox__img { max-width: 90vw; max-height: 86vh; object-fit: contain; }
.lightbox__close, .lightbox__nav { position: absolute; background: none; border: 0; color: var(--white); cursor: pointer; font-size: 2.5rem; line-height: 1; padding: 16px; }
.lightbox__close { top: 8px; right: 16px; }
.lightbox__prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 8px; top: 50%; transform: translateY(-50%); }
.gallery[data-lightbox] img { cursor: zoom-in; }

/* --- Cookie consent --- */
.cookie-consent {
    position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: var(--z-lightbox);
    max-width: 720px; margin: 0 auto;
    display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
    background: var(--white); color: var(--ink);
    border: 1px solid var(--line); border-radius: var(--radius);
    padding: 16px 20px; box-shadow: 0 8px 30px rgba(0,0,0,0.18);
}
.cookie-consent[hidden] { display: none; }
.cookie-consent__text { margin: 0; flex: 1 1 260px; font-size: 0.92rem; }
.cookie-consent__text a { text-decoration: underline; color: var(--brand-deep); }
.cookie-consent__actions { display: flex; gap: 10px; flex-shrink: 0; }
.btn--ghost { background: none; border: 1px solid var(--line); color: inherit; }
@media (max-width: 520px) {
    .cookie-consent__actions { width: 100%; }
    .cookie-consent__actions .btn { flex: 1; }
}

/* --- Services icons (home) --- */
.services__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px; align-items: start; }
.services__item { text-align: center; }
.services__item img { width: 100%; max-width: 160px; height: auto; }
@media (max-width: 900px) { .services__grid { gap: 16px; } }       /* Figma tablet keeps all 5 in a row */
@media (max-width: 520px) { .services__grid { grid-template-columns: repeat(2, 1fr); gap: 24px; } }

/* --- Project carousel (home, auto-scroll) --- */
.carousel { position: relative; overflow: hidden; margin-top: 32px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.carousel__track { display: flex; gap: 20px; width: max-content; animation: carousel-scroll 60s linear infinite; }
.carousel:hover .carousel__track, .carousel:focus-within .carousel__track { animation-play-state: paused; }
.carousel__item { position: relative; flex: 0 0 auto; width: 360px; aspect-ratio: 3 / 2; border-radius: var(--radius); overflow: hidden; display: block; background: var(--line); }
.carousel__item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.carousel__item:hover img { transform: scale(1.05); }
.carousel__caption { position: absolute; inset: auto 0 0 0; display: flex; flex-direction: column; gap: 2px; padding: 28px 18px 14px; color: var(--white); background: linear-gradient(transparent, rgba(0,0,0,0.7)); }
.carousel__title { font-family: var(--font-heading); font-size: 1.25rem; line-height: 1.1; }
.carousel__sector { font-family: var(--font-accent); text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.75rem; opacity: 0.9; }
@keyframes carousel-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .carousel__track { animation: none; } .carousel { overflow-x: auto; } }
@media (max-width: 520px) { .carousel__item { width: 280px; } }

/* --- Gallery page (all project images, each links to its project) --- */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; }
.gallery-tile { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius); background: var(--line); }
.gallery-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.gallery-tile:hover img { transform: scale(1.05); }
.gallery-tile__overlay {
    position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px;
    padding: 16px; color: var(--white);
    background: linear-gradient(transparent 40%, rgba(0,0,0,0.72));
    opacity: 0; transition: opacity var(--transition) ease;
}
.gallery-tile:hover .gallery-tile__overlay, .gallery-tile:focus-visible .gallery-tile__overlay { opacity: 1; }
.gallery-tile__title { font-family: var(--font-heading); font-size: 1.2rem; line-height: 1.1; }
.gallery-tile__cta { font-family: var(--font-accent); text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.75rem; opacity: 0.92; }
@media (max-width: 767px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .gallery-grid { grid-template-columns: 1fr; } }

/* --- AOS fallback: reveal content when AOS is disabled (reduced-motion / library missing) --- */
.aos-off [data-aos] { opacity: 1 !important; transform: none !important; transition: none !important; }
