/*
Theme Name:   WALDRAUM Child
Theme URI:    https://waldraum.com
Description:  Child-Theme für Twenty Twenty-Four. Implementiert das WALDRAUM-Design für Projektseiten — identisch mit den statischen Backup-Seiten.
Author:       WALDRAUM / Martin Fenske
Author URI:   https://waldraum.com
Template:     twentytwentyfour
Version:      1.0.0
License:      GNU General Public License v2 or later
License URI:  http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  waldraum-child
Tags:         custom-design, portfolio, furniture
*/

/* ============================================================
   WALDRAUM DESIGN SYSTEM
   Zieldesign: identisch mit den statischen Projekt-Backup-Seiten
   ============================================================ */

/* --- Custom Fonts --- */
@font-face {
    font-family: 'Garet';
    src: url('https://waldraum.com/wp-content/uploads/2023/01/Garet-Book.ttf') format('truetype');
    font-weight: 300;
    font-display: swap;
}
@font-face {
    font-family: 'Roboto';
    src: url('https://waldraum.com/wp-content/uploads/2022/06/Roboto-Light.ttf') format('truetype');
    font-weight: 300;
    font-display: swap;
}
@font-face {
    font-family: 'Roboto';
    src: url('https://waldraum.com/wp-content/uploads/2022/06/Roboto-Regular.ttf') format('truetype');
    font-weight: 400;
    font-display: swap;
}

/* --- Design Tokens --- */
:root {
    --wf-bg:       #f8f7f5;
    --wf-text:     #1a1a1a;
    --wf-gold:     #c9a84c;
    --wf-meta:     #888;
    --wf-nav-h:    60px;
    --wf-max:      1100px;
    --wf-font-body: 'Roboto', -apple-system, 'Helvetica Neue', sans-serif;
    --wf-font-nav:  'Garet', -apple-system, 'Helvetica Neue', sans-serif;
}

/* ============================================================
   BASE RESET — gilt nur für Projektseiten (single-post in cat 13)
   ============================================================ */

.wf-projekt-page {
    background: var(--wf-bg) !important;
    color: var(--wf-text) !important;
    font-family: var(--wf-font-body) !important;
    font-weight: 300;
    line-height: 1.7;
}

/* Parent-Theme Elemente verstecken auf Projektseiten */
.wf-projekt-page .wp-block-template-part[class*="header"],
.wf-projekt-page header.wp-block-template-part,
.wf-projekt-page .site-header,
.wf-projekt-page .wp-block-site-title,
.wf-projekt-page .wp-block-site-tagline,
.wf-projekt-page footer.wp-block-template-part,
.wf-projekt-page .site-footer,
.wf-projekt-page .wp-block-post-date,
.wf-projekt-page .wp-block-post-author-name,
.wf-projekt-page .wp-block-post-navigation-link {
    display: none !important;
}

/* ============================================================
   NAVIGATION — Fixed Top Bar
   ============================================================ */

.wf-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100000;
    height: var(--wf-nav-h);
    padding: 0 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.07);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.wf-nav-logo {
    height: 26px;
    width: auto;
    opacity: 0.85;
    display: block;
}

.wf-nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.wf-nav-links a {
    font-family: var(--wf-font-nav);
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    text-decoration: none !important;
    color: #333;
    transition: color 0.3s;
}

.wf-nav-links a:hover,
.wf-nav-links a.active {
    color: var(--wf-gold) !important;
    text-decoration: none !important;
}

/* Hamburger (Mobile) */
.wf-nav-hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px;
}

.wf-nav-hamburger span {
    display: block;
    width: 24px;
    height: 1px;
    background: #333;
    transition: all 0.3s;
}

/* Mobile Drawer */
.wf-nav-drawer {
    display: none;
    position: fixed;
    top: var(--wf-nav-h);
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.97);
    z-index: 99999;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    padding: 1.5rem 2rem;
}

.wf-nav-drawer.open {
    display: block;
}

.wf-nav-drawer a {
    display: block;
    font-family: var(--wf-font-nav);
    font-size: 0.85rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-decoration: none;
    color: #333;
    padding: 0.9rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.wf-nav-drawer a:last-child {
    border-bottom: none;
}

.wf-nav-drawer a:hover {
    color: var(--wf-gold);
    text-decoration: none;
}

/* ============================================================
   PROJEKT SINGLE PAGE LAYOUT
   ============================================================ */

.wf-projekt-wrap {
    max-width: var(--wf-max);
    margin: 0 auto;
    padding: calc(var(--wf-nav-h) + 4rem) 2rem 6rem;
}

/* --- Hero Section: 2-spaltig --- */
.wf-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
    margin-bottom: 4rem;
}

.wf-hero-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* Fallback: featured image ohne Crop */
.wf-hero-image .wp-block-post-featured-image img,
.wf-hero-image figure img {
    width: 100%;
    height: auto;
    display: block;
}

.wf-hero-text {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 0.5rem;
}

.wf-projekt-title {
    font-family: var(--wf-font-body);
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--wf-text);
    line-height: 1.2;
    margin: 0 0 1.5rem;
}

.wf-projekt-desc {
    font-family: var(--wf-font-body);
    font-size: 0.95rem;
    font-weight: 300;
    line-height: 1.8;
    color: var(--wf-text);
    margin: 0 0 2rem;
}

.wf-projekt-credits {
    font-family: var(--wf-font-body);
    font-size: 0.82rem;
    font-weight: 300;
    color: var(--wf-meta);
    line-height: 1.6;
    letter-spacing: 0.03em;
}

.wf-projekt-credits a {
    color: var(--wf-meta);
    text-decoration: none;
}

.wf-projekt-credits a:hover {
    color: var(--wf-gold);
}

/* Goldene Trennlinie */
.wf-divider {
    width: 40px;
    height: 1px;
    background: var(--wf-gold);
    margin: 1.5rem 0;
}

/* --- Galerie: 2-spaltig — enger Abstand --- */
.wf-galerie {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 4rem;
}

.wf-galerie figure,
.wf-galerie .wp-block-image {
    margin: 0;
    overflow: hidden;
}

.wf-galerie img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease;
}

.wf-galerie img:hover {
    transform: scale(1.02);
}

/* WordPress gallery block override */
.wf-projekt-wrap .wp-block-gallery {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem !important;
    margin-bottom: 4rem;
}

.wf-projekt-wrap .wp-block-gallery .wp-block-image {
    width: auto !important;
    flex: none !important;
    margin: 0 !important;
}

.wf-projekt-wrap .wp-block-gallery img {
    width: 100% !important;
    height: auto !important;
}

/* --- Einzelne Bilder im Content --- */
.wf-projekt-wrap .entry-content figure.wp-block-image {
    margin: 0;
}

.wf-projekt-wrap .entry-content .wp-block-image img {
    width: 100%;
    height: auto;
}

/* --- Tags / Credits Bereich --- */
.wf-tags {
    display: none; /* Tags für Besucher ausgeblendet */
    margin-bottom: 3rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.wf-tags .wp-block-post-terms a,
.wf-tags a {
    display: inline-block;
    font-family: var(--wf-font-nav);
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--wf-meta);
    text-decoration: none;
    border: 1px solid rgba(0, 0, 0, 0.15);
    padding: 0.3rem 0.8rem;
    margin: 0.2rem 0.2rem 0.2rem 0;
    transition: all 0.25s;
}

.wf-tags .wp-block-post-terms a:hover,
.wf-tags a:hover {
    border-color: var(--wf-gold);
    color: var(--wf-gold);
}

/* --- Zurück-Link --- */
.wf-back {
    display: inline-block;
    font-family: var(--wf-font-nav);
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--wf-text);
    padding-bottom: 2px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.25);
    transition: all 0.3s;
    margin-top: 1rem;
}

.wf-back:hover {
    color: var(--wf-gold);
    border-color: var(--wf-gold);
    text-decoration: none !important;
}

.wf-back::before {
    content: '← ';
}

/* ============================================================
   TWENTY TWENTY-FOUR OVERRIDES für Projektseiten
   ============================================================ */

/* Hintergrundfarbe */
.wf-projekt-page body,
body.wf-projekt-page {
    background-color: var(--wf-bg) !important;
    --wp--preset--color--base: var(--wf-bg) !important;
}

/* Padding-Reset für wp-site-blocks auf Projektseiten */
.wf-projekt-page .wp-site-blocks {
    padding: 0 !important;
}

/* Content-Breite aufheben (wir kontrollieren selbst via wf-projekt-wrap) */
.wf-projekt-page .is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

/* Post-Titel (falls noch im Standard-Flow sichtbar) */
.wf-projekt-page .wp-block-post-title {
    font-family: var(--wf-font-body);
    font-weight: 300;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--wf-text);
}

/* Links global */
.wf-projekt-page a:where(:not(.wp-element-button)) {
    color: var(--wf-text);
}

.wf-projekt-page a:where(:not(.wp-element-button)):hover {
    color: var(--wf-gold);
    text-decoration: none;
}

/* ============================================================
   RESPONSIVE — unter 768px alles einspaltig
   ============================================================ */

@media (max-width: 768px) {
    .wf-nav {
        padding: 0 1.2rem;
    }

    .wf-nav-links {
        display: none;
    }

    .wf-nav-hamburger {
        display: flex;
    }

    .wf-projekt-wrap {
        padding: calc(var(--wf-nav-h) + 2rem) 1.2rem 4rem;
    }

    .wf-hero {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .wf-galerie {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .wf-projekt-wrap .wp-block-gallery {
        grid-template-columns: 1fr !important;
    }

    .wf-projekt-title {
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    .wf-nav-logo {
        height: 20px;
    }

    .wf-projekt-title {
        font-size: 1.4rem;
    }
}


/* ============================================================
   BLOCK PATTERNS — Frontend-Styles für Gutenberg Patterns
   Layout-Konzept: EIN Typ, 3 Anpassungen nach Bildformat
   - Querformat-Hero → volle Breite, Text oben, 2-Spalten-Grid
   - Hochformat-Hero → 2-spaltig (Bild + Text oben), dann Grid
   - Gemischt → Querformate breit, Hochformate paarweise
   Regel: NIEMALS Bilder croppen. Immer width:100%, height:auto.
   Text steht NUR oben (Titel + Beschreibung), nicht zwischen Bildern.
   ============================================================ */

/* --- Gemeinsame Pattern-Klassen --- */

.wf-block-content {
    /* Wrapper für the_content() im Gutenberg-Modus */
    width: 100%;
}

.wf-content-section {
    max-width: var(--wf-max);
    margin-left: auto;
    margin-right: auto;
    padding: 3rem 2rem 2rem;
}

.wf-pattern-title {
    font-family: var(--wf-font-body) !important;
    font-size: clamp(1.8rem, 3vw, 2.8rem) !important;
    font-weight: 300 !important;
    letter-spacing: 0.15em !important;
    text-transform: uppercase !important;
    color: var(--wf-text) !important;
    line-height: 1.2 !important;
    margin: 0 0 1.5rem !important;
}

.wf-pattern-desc {
    font-family: var(--wf-font-body) !important;
    font-size: 0.95rem !important;
    font-weight: 300 !important;
    line-height: 1.8 !important;
    color: var(--wf-text) !important;
}

/* Goldene Trennlinie */
.wf-separator-gold {
    border: none !important;
    border-top: none !important;
    background-color: var(--wf-gold) !important;
    height: 1px !important;
    width: 40px !important;
    max-width: 40px !important;
    margin: 1.5rem 0 !important;
}

.wf-separator-centered {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Tags aus Pattern (wp:post-terms) */
.wf-pattern-tags {
    max-width: var(--wf-max);
    margin-left: auto;
    margin-right: auto;
    padding: 2rem 2rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin-top: 3rem;
}


/* --- LAYOUT A — Panorama-Querformat + 2-Spalten-Grid ---
   Querformat-Hero: Cover vollbreit, Text oben (Titel + Desc),
   darunter 2-Spalten-Galerie. Bilder niemals croppen.        */

/* Cover-Block: vollbreites Panorama-Bild */
.wf-cover-panorama {
    min-height: 520px !important;
    max-height: 700px;
    width: 100%;
    margin-bottom: 0 !important;
}

.wf-cover-panorama .wp-block-cover__image-background {
    object-fit: cover !important;
    border-radius: 0 !important;
}

/* 2-Spalten Galerie — enger Abstand */
.wf-gallery-2col.wp-block-gallery,
.wp-block-gallery.wf-gallery-2col {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem !important;
    margin-bottom: 4rem !important;
}

.wf-gallery-2col .wp-block-image,
.wf-gallery-2col figure {
    margin: 0 !important;
    flex: none !important;
    width: auto !important;
}

/* Keine feste Höhe, kein Crop — Bilder in natürlichem Seitenverhältnis */
.wf-gallery-2col img {
    width: 100% !important;
    height: auto !important;
    display: block;
    border-radius: 0 !important;
}


/* --- LAYOUT B — Hochformat-Hero: 2-spaltig (Bild + Text) + Grid ---
   Hochformat-Bild links, Text rechts (NUR Titel + Beschreibung),
   darunter 3-Spalten-Grid. Bilder niemals croppen.                   */

/* Columns-Block: Bild 60% / Text 40% */
.wf-split-hero {
    gap: 0 !important;
    margin-bottom: 3rem !important;
    align-items: stretch;
}

.wf-split-image-col {
    padding: 0 !important;
    overflow: hidden;
}

.wf-split-image-col .wf-split-img {
    margin: 0 !important;
    height: 100%;
}

/* Hochformat-Bild: kein festes aspect-ratio, kein Crop */
.wf-split-image-col .wf-split-img img {
    width: 100% !important;
    height: auto !important;
    display: block;
    border-radius: 0 !important;
}

.wf-split-text-col {
    background-color: #1a1a1a !important;
    color: #f8f7f5 !important;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 3rem !important;
}

.wf-split-title {
    font-family: var(--wf-font-body) !important;
    font-weight: 300 !important;
    letter-spacing: 0.15em !important;
    text-transform: uppercase !important;
    color: #f8f7f5 !important;
    margin-bottom: 0 !important;
}

.wf-split-text-col .wf-separator-gold {
    background-color: var(--wf-gold) !important;
}

.wf-split-desc {
    color: #f8f7f5 !important;
    font-weight: 300 !important;
    line-height: 1.8 !important;
}

.wf-split-meta {
    color: #888 !important;
    font-size: 0.82rem !important;
    font-weight: 300 !important;
    letter-spacing: 0.03em !important;
    margin-top: auto;
}

/* 3-Spalten Galerie — enger Abstand */
.wf-gallery-3col.wp-block-gallery,
.wp-block-gallery.wf-gallery-3col {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 0.5rem !important;
    margin-bottom: 4rem !important;
}

.wf-gallery-3col .wp-block-image,
.wf-gallery-3col figure {
    margin: 0 !important;
    flex: none !important;
    width: auto !important;
}

/* Keine feste Höhe, kein Crop */
.wf-gallery-3col img {
    width: 100% !important;
    height: auto !important;
    display: block;
    border-radius: 0 !important;
}


/* --- LAYOUT C — Storytelling (Gemischt) ---
   Querformate breit, Hochformate paarweise.
   Text steht NUR am Anfang (Titel + Desc).
   Media-Text-Blöcke für abwechslungsreiches Storytelling.  */

.wf-storytelling-header {
    padding-bottom: 0;
}

/* Media-Text Blöcke */
.wf-media-text-block {
    margin-bottom: 0.5rem !important;
    align-items: stretch;
}

.wf-media-text-block .wp-block-media-text__media {
    overflow: hidden;
}

/* Kein Crop, kein festes aspect-ratio */
.wf-media-text-block .wp-block-media-text__media img {
    width: 100% !important;
    height: auto !important;
    display: block;
    border-radius: 0 !important;
}

.wf-media-text-block .wp-block-media-text__content {
    padding: 2.5rem !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: var(--wf-bg);
}

.wf-story-heading {
    font-family: var(--wf-font-body) !important;
    font-size: clamp(1.1rem, 2vw, 1.5rem) !important;
    font-weight: 300 !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
    color: var(--wf-text) !important;
    margin-bottom: 1rem !important;
}

.wf-story-text {
    font-family: var(--wf-font-body) !important;
    font-size: 0.95rem !important;
    font-weight: 300 !important;
    line-height: 1.8 !important;
    color: var(--wf-text) !important;
}

/* Vollbreites Zwischenbild — kein Crop, natürliche Höhe */
.wf-full-image-break {
    margin: 0.5rem 0 !important;
}

.wf-full-image-break img {
    width: 100% !important;
    height: auto !important;
    display: block;
    border-radius: 0 !important;
}


/* --- LAYOUT D — Asymmetrisches Mosaik ---
   Querformate breit, Hochformate paarweise.
   Kein Crop, kein festes aspect-ratio.               */

.wf-mosaik-header {
    text-align: center;
    padding: 4rem 2rem 2rem;
}

.wf-mosaik-title {
    text-align: center !important;
}

.wf-mosaik-row {
    gap: 0.5rem !important;
    margin-bottom: 0.5rem !important;
    align-items: stretch;
}

.wf-mosaik-img {
    margin: 0 !important;
    height: 100%;
    overflow: hidden;
}

/* Kein Crop, natürliche Bildhöhe */
.wf-mosaik-img img {
    width: 100% !important;
    height: auto !important;
    display: block;
    border-radius: 0 !important;
}

/* Querformat-Spalte */
.wf-mosaik-col-large .wf-mosaik-img img {
    width: 100%;
    height: auto;
}

/* Hochformat-Spalte */
.wf-mosaik-col-small .wf-mosaik-img img {
    width: 100%;
    height: auto;
}

/* Halbe Spalte */
.wf-mosaik-col-half .wf-mosaik-img img {
    width: 100%;
    height: auto;
}

/* Spalten dehnen sich aus */
.wf-mosaik-col-large,
.wf-mosaik-col-small,
.wf-mosaik-col-half {
    display: flex;
    flex-direction: column;
}

.wf-mosaik-col-large .wf-mosaik-img,
.wf-mosaik-col-small .wf-mosaik-img,
.wf-mosaik-col-half .wf-mosaik-img {
    flex: 1;
}


/* ============================================================
   BLOCK PATTERNS — RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {

    /* Gallery: immer einspaltig auf Mobile */
    .wf-gallery-2col.wp-block-gallery,
    .wp-block-gallery.wf-gallery-2col,
    .wf-gallery-3col.wp-block-gallery,
    .wp-block-gallery.wf-gallery-3col {
        grid-template-columns: 1fr !important;
        gap: 0.5rem !important;
    }

    /* Split Hero: untereinander */
    .wf-split-hero {
        flex-direction: column !important;
    }

    .wf-split-image-col,
    .wf-split-text-col {
        flex-basis: 100% !important;
        width: 100% !important;
    }

    /* Media-Text: stacked */
    .wf-media-text-block {
        flex-direction: column !important;
    }

    .wf-media-text-block .wp-block-media-text__media,
    .wf-media-text-block .wp-block-media-text__content {
        width: 100% !important;
    }

    /* Mosaik: einspaltig */
    .wf-mosaik-row {
        flex-direction: column !important;
    }

    .wf-mosaik-col-large,
    .wf-mosaik-col-small,
    .wf-mosaik-col-half {
        flex-basis: 100% !important;
        width: 100% !important;
    }

    /* Content Section */
    .wf-content-section,
    .wf-pattern-tags {
        padding-left: 1.2rem;
        padding-right: 1.2rem;
    }
}

@media (max-width: 480px) {
    /* Alles bleibt einspaltig, natürliche Bildhöhen */
}
