/* ==========================================================================
   ZIMMERHACKL — subpage.css
   Subpage-spezifische Styles: Hero, Back-Button, Project-Galerien
   ========================================================================== */

/* ─────────────────────────────────────────────────────────────────────────
   1. SUBPAGE HERO (kompakter als Index-Hero)
   ───────────────────────────────────────────────────────────────────────── */

/* BASIS — Text-only Hero (Kontakt, Impressum, Datenschutz) */
.subpage-hero {
    position: relative;
    padding-top: calc(var(--nav-h) + clamp(4rem, 9vw, 7rem));
    padding-bottom: clamp(2rem, 5vw, 4rem);
    overflow: hidden;
    isolation: isolate;
    background: var(--bg-tint);
}

.subpage-hero-inner {
    max-width: 64rem;
    margin-inline: auto;
    text-align: center;
}

.subpage-hero .label {
    margin-bottom: 1.4rem;
}

.subpage-hero h1 {
    font-size: clamp(2.6rem, 6vw, 5rem);
    font-variation-settings: 'opsz' 96, 'wght' 400;
    margin-bottom: 1.4rem;
    letter-spacing: -0.018em;
    color: var(--text);
    max-width: 22ch;
    margin-inline: auto;
}

.subpage-hero h1 em {
    color: var(--accent-deep);
    font-variation-settings: 'opsz' 96, 'wght' 420;
}

.subpage-hero-lead {
    font-size: clamp(1.05rem, 1.45vw, 1.3rem);
    line-height: 1.55;
    color: var(--text-body);
    max-width: 56ch;
    margin: 0 auto;
}

/* ─────────────────────────────────────────────────────────────────────────
   1b. FULL-BLEED IMAGE-HERO (Portfolio-Subpages: Schreinereinbauten, Einzelstücke)
   Modifier-Klasse — überschreibt Basis-Hero mit Bild + Scrim + hellem Text.
   ───────────────────────────────────────────────────────────────────────── */
.subpage-hero--image {
    min-height: clamp(440px, 62vh, 680px);
    display: flex;
    align-items: center;
    padding-top: calc(var(--nav-h) + clamp(2.5rem, 5vw, 4rem));
    padding-bottom: clamp(2.5rem, 5vw, 4rem);
    background: none;
}

/* Full-Bleed Hero-Bild — Parallax-Wrapper (scroll-driven) + inneres Bild (Ken-Burns).
   Wrapper übersteht den Hero oben/unten (top/height-Buffer), damit der Parallax-Shift
   nie eine Lücke an der Kante freilegt. Translate (Parallax) und Scale (Ken-Burns)
   sitzen auf GETRENNTEN Elementen — sonst würden sich beide transform-Werte clobbern. */
.subpage-hero-bg {
    position: absolute;
    left: 0;
    right: 0;
    top: -12vh;
    height: calc(100% + 24vh);
    z-index: 0;
}

.subpage-hero-img {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    animation: subpage-hero-zoom 24s var(--ease-out) forwards;
}

@keyframes subpage-hero-zoom {
    from { transform: scale(1); }
    to   { transform: scale(1.07); }
}

/* Scroll-Parallax wie auf der Startseite — Bild sinkt langsam beim Vorbeiscrollen */
@supports (animation-timeline: scroll()) {
    .subpage-hero-bg {
        animation: subpage-hero-parallax linear both;
        animation-timeline: scroll(root block);
        animation-range: 0vh 100vh;
    }
}

@keyframes subpage-hero-parallax {
    from { transform: translateY(0); }
    to   { transform: translateY(12vh); }
}

/* Warm-anthrazit Scrim für Text-Lesbarkeit (kein reines Schwarz).
   Center-weighted: vertikal in der Mitte am dunkelsten, wo der zentrierte Hero-Text
   sitzt. Edges bleiben heller → die Luftigkeit/Helligkeit der Motive bleibt erhalten.
   Der text-shadow-Halo (unten) übernimmt die lokale Lesbarkeit auf sehr hellen
   Bildern (Rattan-Kanu, Weißtanne-Küche), ohne das ganze Bild abzudunkeln. */
.subpage-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(to bottom,
            color-mix(in oklch, var(--text) 40%, transparent) 0%,
            color-mix(in oklch, var(--text) 62%, transparent) 50%,
            color-mix(in oklch, var(--text) 46%, transparent) 100%);
}

.subpage-hero--image .subpage-hero-inner {
    position: relative;
    z-index: 2;
}

.subpage-hero--image .label {
    color: var(--accent-soft);
}

.subpage-hero--image .label::before {
    background: var(--accent-soft);
}

.subpage-hero--image h1 {
    color: #fff;
}

.subpage-hero--image h1 em {
    color: var(--accent-soft);
}

.subpage-hero--image .subpage-hero-lead {
    color: color-mix(in oklch, #fff 92%, transparent);
}

/* Text-Shadow-Halo — tighter Edge-Shadow für Schärfe + weicher Halo für Trennung
   vom hellen Motiv. Macht weißen Text auf nahezu weißen Bildern lesbar, ohne dass
   das Scrim das ganze Bild abdunkeln muss. */
.subpage-hero--image .label,
.subpage-hero--image h1,
.subpage-hero--image .subpage-hero-lead {
    text-shadow:
        0 1px 2px color-mix(in oklch, var(--text) 42%, transparent),
        0 2px 30px color-mix(in oklch, var(--text) 52%, transparent);
}

/* ─────────────────────────────────────────────────────────────────────────
   2. BACK-BUTTON (statisch, in-flow oben im Content)
   ───────────────────────────────────────────────────────────────────────── */

.back-area {
    padding-top: clamp(1rem, 2.5vw, 1.6rem);
    padding-bottom: clamp(0.5rem, 1.5vw, 1rem);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    font-family: var(--font-sans);
    font-size: 0.74rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-body);
    background: linear-gradient(to bottom,
        color-mix(in oklch, white 50%, transparent),
        color-mix(in oklch, white 40%, transparent));
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-pill);
    backdrop-filter: blur(10px);
    transition: border-color var(--dur-normal) var(--ease),
                color var(--dur-normal) var(--ease),
                background var(--dur-normal) var(--ease),
                box-shadow var(--dur-normal) var(--ease);
}

.back-link::before {
    content: '←';
    font-weight: 400;
    transition: transform var(--dur-normal) var(--ease);
}

.back-link:hover {
    color: var(--accent-deep);
    border-color: var(--accent-40);
    background: linear-gradient(to bottom,
        color-mix(in oklch, var(--accent) 14%, white),
        color-mix(in oklch, var(--accent) 8%, white));
    box-shadow: var(--depth-soft), var(--depth-glow);
}

.back-link:hover::before {
    transform: translateX(-3px);
}

/* ─────────────────────────────────────────────────────────────────────────
   3. PROJECT-LIST (Editorial-Stack auf Subpages)
   ───────────────────────────────────────────────────────────────────────── */

.projects {
    padding-block: clamp(3rem, 6vw, 6rem) clamp(4rem, 8vw, 8rem);
}

.project {
    margin-bottom: clamp(4rem, 9vw, 8rem);
}

.project:last-child {
    margin-bottom: 0;
}

.project-header {
    margin-bottom: clamp(2rem, 4vw, 3rem);
    max-width: 56rem;
}

.project-header .label {
    margin-bottom: 1rem;
}

.project-header h2 {
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    font-variation-settings: 'opsz' 72, 'wght' 420;
    margin-bottom: 1.2rem;
    max-width: 22ch;
}

.project-header h2 em {
    color: var(--accent-deep);
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.6rem;
    margin-top: 1.2rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--border-soft);
}

.project-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 9rem;
}

.project-meta-label {
    font-family: var(--font-sans);
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.project-meta-value {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 400;
}

.project-text p {
    font-size: clamp(1rem, 1.25vw, 1.15rem);
    line-height: 1.6;
    color: var(--text-body);
    max-width: 56ch;
}

/* Project Galerie — Bento-Grid mit gemischten Formaten */
.project-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(0.85rem, 1.8vw, 1.5rem);
}

@media (min-width: 700px) {
    .project-gallery {
        grid-template-columns: repeat(6, 1fr);
    }
    /* Erstes Bild full-width Hero */
    .project-gallery .gal-item:first-child {
        grid-column: span 6;
        aspect-ratio: 16 / 9;
    }
    /* Alle weiteren: 50/50 Reihen (3+3 cols) */
    .project-gallery .gal-item:nth-child(n+2) {
        grid-column: span 3;
        aspect-ratio: 4 / 3;
    }
    /* Orphan-Fix: bei gerader Gesamtzahl steht das letzte Bild allein in
       seiner Reihe und würde 50% Freiraum daneben lassen. Stattdessen full-
       width als Closing-Hero. Funktioniert für 4, 6, 8, 10 Bilder. */
    .project-gallery .gal-item:last-child:nth-child(even) {
        grid-column: span 6;
        aspect-ratio: 16 / 9;
    }
}

.gal-item {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-md);
    overflow: hidden;
    isolation: isolate;
    background: var(--bg-paper);
    box-shadow: var(--depth-soft);
    cursor: pointer;
    /* Per-Item Reveal-Startzustand — Stagger-Delay wird per JS gesetzt.
       opacity + zentriertes scale (kein Edge-Bleed an den runden Ecken).
       box-shadow behält die schnellere Hover-Dauer. */
    opacity: 0;
    transform: scale(0.97);
    transition: opacity 0.8s var(--ease),
                transform 0.8s var(--ease),
                box-shadow var(--dur-medium) var(--ease);
}

.gal-item.visible {
    opacity: 1;
    transform: scale(1);
}

/* Container selbst NICHT mehr block-faden — die einzelnen .gal-item übernehmen
   den Reveal. Sonst animiert die ganze (mehrere Screens hohe) Galerie als ein
   Block, sobald ihre Oberkante eintritt, und untere Reihen sind fertig bevor
   man hinscrollt. */
.project-gallery.reveal-fog,
.project-gallery.reveal-fog.visible {
    opacity: 1;
    filter: none;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .gal-item {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

.gal-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--glass-highlight);
    pointer-events: none;
    z-index: 1;
}

.gal-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 1.4s var(--ease);
}

.gal-item:hover {
    box-shadow: var(--depth-hover), var(--depth-glow);
}

.gal-item:hover img {
    transform: scale(1.04);
}

/* ─────────────────────────────────────────────────────────────────────────
   4. EINZELSTÜCKE-GRID (kompakter — pro Stück eine Card)
   ───────────────────────────────────────────────────────────────────────── */

.stueck-overview {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: clamp(4rem, 8vw, 6rem);
}

@media (min-width: 720px) {
    .stueck-overview {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1100px) {
    .stueck-overview {
        grid-template-columns: repeat(3, 1fr);
    }
}

.stueck-card {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    text-align: left;
}

.stueck-card-image {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-md);
    overflow: hidden;
    isolation: isolate;
    background: var(--bg-paper);
    box-shadow: var(--depth-soft);
    transition: box-shadow var(--dur-medium) var(--ease);
}

.stueck-card-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--glass-highlight);
    pointer-events: none;
    z-index: 1;
}

.stueck-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 1.4s var(--ease);
}

.stueck-card:hover .stueck-card-image {
    box-shadow: var(--depth-hover), var(--depth-glow);
}

.stueck-card:hover .stueck-card-image img {
    transform: scale(1.04);
}

.stueck-card-num {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent-deep);
    letter-spacing: 0.04em;
    margin-bottom: -0.2rem;
}

.stueck-card-title {
    font-family: var(--font-display);
    font-size: clamp(1.4rem, 2.4vw, 1.85rem);
    font-variation-settings: 'opsz' 48, 'wght' 420;
    letter-spacing: -0.01em;
    line-height: 1.1;
    color: var(--text);
    margin: 0;
}

.stueck-card-desc {
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--text-body);
    margin: 0;
}

.stueck-card-material {
    font-family: var(--font-sans);
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-muted);
    font-weight: 400;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border-soft);
}

/* ─────────────────────────────────────────────────────────────────────────
   5. EDITIONEN HERO-STÜCK (eigene Section)
   ───────────────────────────────────────────────────────────────────────── */

.edition-hero {
    padding-block: clamp(4rem, 8vw, 7rem);
    background: var(--bg-tint);
}

.edition-hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(2.5rem, 5vw, 4.5rem);
    align-items: center;
}

@media (min-width: 900px) {
    .edition-hero-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.edition-hero-text .label {
    margin-bottom: 1.2rem;
}

.edition-hero-text h2 {
    font-size: clamp(2rem, 4vw, 3.4rem);
    font-variation-settings: 'opsz' 96, 'wght' 400;
    margin-bottom: 1.6rem;
    max-width: 16ch;
}

.edition-hero-text h2 em {
    color: var(--accent-deep);
}

.edition-hero-text p {
    font-size: clamp(1rem, 1.3vw, 1.18rem);
    line-height: 1.6;
    color: var(--text-body);
    max-width: 36rem;
    margin-bottom: 1.4rem;
}

/* ─────────────────────────────────────────────────────────────────────────
   6. EDITIONEN-LIST (Stack mit Bild + Text alternierend)
   ───────────────────────────────────────────────────────────────────────── */

.edition-list {
    padding-block: clamp(4rem, 8vw, 7rem);
}

.edition-item {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: center;
    margin-bottom: clamp(4rem, 8vw, 7rem);
}

.edition-item:last-child {
    margin-bottom: 0;
}

@media (min-width: 800px) {
    .edition-item {
        grid-template-columns: 1fr 1fr;
    }
    .edition-item--reverse .edition-item-image {
        order: 2;
    }
}

.edition-item-image {
    position: relative;
    aspect-ratio: 5 / 4;
    border-radius: var(--radius-md);
    overflow: hidden;
    isolation: isolate;
    background: var(--bg-paper);
    box-shadow: var(--depth-rest);
}

.edition-item-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--glass-highlight);
    pointer-events: none;
    z-index: 1;
}

.edition-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.4s var(--ease);
}

.edition-item:hover .edition-item-image img {
    transform: scale(1.03);
}

.edition-item-text .label {
    margin-bottom: 1rem;
}

.edition-item-text h3 {
    font-size: clamp(1.5rem, 2.6vw, 2.2rem);
    font-variation-settings: 'opsz' 72, 'wght' 420;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.edition-item-text p {
    font-size: clamp(0.98rem, 1.2vw, 1.1rem);
    line-height: 1.6;
    color: var(--text-body);
    margin-bottom: 1.2rem;
    max-width: 36rem;
}

.edition-item-material {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
    padding-top: 1rem;
    border-top: 1px solid var(--border-soft);
    max-width: 36rem;
}

/* ─────────────────────────────────────────────────────────────────────────
   7. KONTAKT-PAGE (Direkt-Kontakt + Form-Placeholder)
   ───────────────────────────────────────────────────────────────────────── */

.kontakt-page-section {
    padding-block: clamp(3rem, 6vw, 6rem) clamp(4rem, 8vw, 8rem);
}

.kontakt-page-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(2.5rem, 5vw, 4rem);
    align-items: start;
}

@media (min-width: 900px) {
    .kontakt-page-grid {
        grid-template-columns: 1fr 1.4fr;
    }
}

.kontakt-page-info {
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
}

.kontakt-page-info h2 {
    font-size: clamp(1.6rem, 2.8vw, 2.2rem);
    font-variation-settings: 'opsz' 72, 'wght' 420;
    margin-bottom: 0.4rem;
    max-width: 16ch;
}

.kontakt-page-info p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-body);
    max-width: 32rem;
}

/* Kontakt-Cards-Pattern bleibt gleich wie auf Index */

/* ─────────────────────────────────────────────────────────────────────────
   8. LEGAL PAGES (Impressum, Datenschutz)
   ───────────────────────────────────────────────────────────────────────── */

.legal-section {
    padding-block: clamp(3rem, 6vw, 5rem) clamp(4rem, 8vw, 7rem);
}

.legal-section h2 {
    font-size: clamp(1.4rem, 2.4vw, 1.85rem);
    font-variation-settings: 'opsz' 48, 'wght' 440;
    margin-top: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1rem;
    padding-top: clamp(1.5rem, 3vw, 2rem);
    border-top: 1px solid var(--border-soft);
}

.legal-section h2:first-of-type {
    margin-top: 1rem;
    padding-top: 0;
    border-top: none;
}

.legal-section h3 {
    font-size: clamp(1.05rem, 1.4vw, 1.2rem);
    font-variation-settings: 'opsz' 36, 'wght' 480;
    margin-top: 1.8rem;
    margin-bottom: 0.7rem;
}

.legal-section p,
.legal-section li {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-body);
    margin-bottom: 0.9rem;
}

.legal-section ul {
    padding-left: 1.4rem;
    margin-bottom: 1.4rem;
}

.legal-section a {
    color: var(--accent-deep);
    text-decoration: underline;
    text-decoration-color: var(--accent-40);
    text-underline-offset: 3px;
}

.legal-section a:hover {
    text-decoration-color: var(--accent);
}

/* ─────────────────────────────────────────────────────────────────────────
   9. FAQ-SECTION (Schreinereinbauten-Subpage)
   ───────────────────────────────────────────────────────────────────────── */

.faq-section {
    padding-block: clamp(4rem, 8vw, 7rem);
    background: var(--bg-tint);
}

.faq-section .section-header {
    text-align: center;
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

.faq-section .section-header h2 {
    max-width: none;
    margin-inline: auto;
}

.faq-section .section-header .label::before {
    margin-right: 0.6rem;
}

.faq-list {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--border-soft);
}

.faq-item {
    border-bottom: 1px solid var(--border-soft);
}

.faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: 1.5rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 1.5vw, 1.35rem);
    font-variation-settings: 'opsz' 36, 'wght' 420;
    line-height: 1.3;
    color: var(--text);
    transition: color var(--dur-normal) var(--ease);
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary:hover {
    color: var(--accent-deep);
}

.faq-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-sans);
    font-size: 1.1rem;
    font-weight: 300;
    color: var(--text-muted);
    line-height: 1;
    transition: transform var(--dur-normal) var(--ease),
                background var(--dur-normal) var(--ease),
                border-color var(--dur-normal) var(--ease),
                color var(--dur-normal) var(--ease);
}

.faq-item[open] .faq-icon {
    transform: rotate(45deg);
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}

.faq-item summary:hover .faq-icon {
    border-color: var(--accent-40);
    color: var(--accent-deep);
}

.faq-answer {
    padding: 0.3rem 0 1.8rem;
    max-width: 64ch;
}

.faq-answer p {
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text-body);
    margin-bottom: 1rem;
}

.faq-answer p:last-child {
    margin-bottom: 0;
}

.faq-answer ul {
    margin: 0.4rem 0 1rem;
    padding-left: 1.2rem;
    list-style: none;
}

.faq-answer li {
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text-body);
    padding-left: 0.4rem;
    position: relative;
    margin-bottom: 0.3rem;
}

.faq-answer li::before {
    content: '·';
    color: var(--accent);
    font-weight: 700;
    position: absolute;
    left: -0.7rem;
}
