/* --- CSS FÜR DIE MODERNE STORY-WAND GALERIE --- */

* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.gallery-main-heading {
    font-family: 'Raleway' !important;
    font-weight: 100 !important;
    color: #2c5157;
}

/* --- Dynamisches Story-Grid Layout --- */
.p-story-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* Basis: 2 Spalten auf Mobile */
    grid-gap: 20px;
    grid-auto-flow: dense; /* Füllt Lücken automatisch auf */
}

/* Desktop Anpassung */
@media (min-width: 992px) {
    .p-story-grid { grid-template-columns: repeat(4, 1fr); } /* 4 Spalten auf Desktop */
}

/* Styling für einen einzelnen Galerie-Eintrag */
.p-story-item {
    background-color: white;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.03);
    
    /* WICHTIG: Für den Einblend-Effekt initial unsichtbar */
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Klasse wird vom JS hinzugefügt, wenn das Bild sichtbar wird */
.p-story-item.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Das "Hero"-Bild (doppelt so groß) */
@media (min-width: 768px) {
    .p-story-item-hero {
        grid-column: span 2;
        grid-row: span 2;
    }
}

/* Das Bild selbst */
.p-story-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Füllt den Container aus, ohne zu verzerren */
    display: block;
}

/* Kleiner Badge auf dem Bild */
.p-story-badge {
    position: absolute;
    bottom: 15px;
    left: 15px;
    display: inline-block;
    border: 1px solid rgba(44, 81, 87, 0.4);
    color: #2c5157;
    font-family: 'Inter', sans-serif;
    font-size: 0.65rem;
    padding: 3px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px); /* Sehr modern */
}

/* --- NEU: Anpassungs-Optionen Panel (Configurator Promo) --- */
.options-promo-section {
    background: white;
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.04);
}

.options-heading {
    font-family: 'Sacramento', cursive;
    color: #2c5157;
    font-size: 3rem;
    margin-bottom: 15px;
}

.options-subtext {
    font-family: 'Raleway', sans-serif;
    font-weight: 300;
    color: #777;
    max-width: 600px;
    margin: 0 auto;
}

.option-box {
    padding: 20px;
    background: rgba(196, 229, 226, 0.2); /* Sehr helles Aqua */
    border-radius: 20px;
    height: 100%;
    transition: transform 0.2s;
    /*
    margin-left: 1.5rem;
    margin-right: 1.5rem;
    */
}

.option-box:hover {
    transform: scale(1.05);
}

.option-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.option-titleRaleway {
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    color: #2c5157;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.option-textRaleway {
    font-family: 'Raleway', sans-serif;
    font-weight: 400;
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 0;
}

/* --- Dein beliebtes Abschluss-Panel --- */
.gallery-cta-section {
    background: rgba(255,255,255,0.4);
    backdrop-filter: blur(10px); 
    padding: 40px;
    border-radius: 30px;
}

.cta-heading {
    font-family: 'Sacramento', cursive;
    color: #2c5157;
    font-size: 3rem;
    margin-bottom: 20px;
}

.cta-textRaleway {
    font-family: 'Raleway', sans-serif;
    font-weight: 300;
    color: #555;
    line-height: 1.8;
    margin-bottom: 30px;
}



/* --- SCHRIFTART & ABSTÄNDE HERO --- */
.gallery-intro-text {
    font-family: 'Raleway', sans-serif !important;
    font-weight: 300;
    font-style: italic;
    margin-top: -10px; /* Abstand zur Hero-Section verkleinert */
    margin-bottom: 40px;
}

/* --- DAS "WIRRE" GRID (Masonry-ähnlich via CSS Grid) --- */
.p-story-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    grid-auto-rows: 200px; /* Basis-Höhe der Zeilen */
    grid-gap: 20px;
    grid-auto-flow: dense;
    margin-bottom: 100px; /* Größerer Abstand zum ersten Panel nach der Galerie */
}

.p-story-item {
    background-color: white;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* Definition der wirren Größen */
.p-story-item.p-tall { grid-row: span 2; } /* Hochkant */
.p-story-item.p-wide { grid-column: span 2; } /* Breit */
.p-story-item.p-big { grid-column: span 2; grid-row: span 2; } /* Großquadrat */

.p-story-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Badges entfernt (CSS-Regel einfach löschen oder auskommentieren) */
.p-story-badge { display: none; }

/* --- GLAS-OPTIK FÜR PANELS --- */
.glass-panel {
    background: rgba(255, 255, 255, 0.3) !important; /* Stark transparent */
    backdrop-filter: blur(15px); /* Verschwommener Hintergrund */
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 30px;
    padding: 60px 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    margin-bottom: 50px !important;/* Abstand zwischen den Panels untereinander */
}

/* Spezifische Panel-Anpassung */
.options-promo-section {
    margin-top: 20px; /* Kleinerer Abstand nach oben zur Galerie */
}

/* Verfeinerung der Optionen-Darstellung */
.option-box {
    padding: 25px;
    background: rgba(255, 255, 255, 0.4); /* Hellerer Glas-Effekt für die Boxen */
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.option-box:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.option-icon {
    font-size: 2.8rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}



/* --- DAS OPTIMIERTE "CREATIVE CHAOS" GRID --- */
.p-story-grid {
    display: grid;
    /* 4 Spalten auf Desktop, 2 auf Mobile */
    grid-template-columns: repeat(2, 1fr);
    /* Feste Zeilenhöhe als Basis für alle Proportionen */
    grid-auto-rows: 150px; 
    grid-gap: 15px;
    grid-auto-flow: dense; /* WICHTIG: Füllt Lücken automatisch auf */
    margin-bottom: 50px;
}

@media (min-width: 992px) {
    .p-story-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-auto-rows: 180px; /* Etwas größere Zellen auf Desktop */
    }
}

/* --- GRÖSSEN-KLASSEN --- */

/* 1. Quadratisch Klein (Standard) - belegt 1x1 Zelle */
.p-story-item {
    grid-column: span 1;
    grid-row: span 1;
}

/* 2. Quadratisch Groß - belegt 2x2 Zellen */
.p-story-item.p-square-big {
    grid-column: span 2;
    grid-row: span 2;
}

/* 3. Hochkant (Tall) - belegt 1 Spalte, 2 Zeilen */
.p-story-item.p-tall {
    grid-column: span 1;
    grid-row: span 2;
}

/* 4. Extra Hoch (Sehr schlank) - belegt 1 Spalte, 3 Zeilen */
.p-story-item.p-tall-extra {
    grid-column: span 1;
    grid-row: span 3;
}

/* 5. Breit (Wide) - belegt 2 Spalten, 1 Zeile */
.p-story-item.p-wide {
    grid-column: span 2;
    grid-row: span 1;
}

/* 6. Panorama (Sehr breit) - belegt 3 Spalten, 2 Zeilen (nur Desktop sinnvoll) */
@media (min-width: 992px) {
    .p-story-item.p-panorama {
        grid-column: span 3;
        grid-row: span 2;
    }
}

/* 7. Klein & Quer (Mini-Landscape) - belegt 2 Spalten, 1 Zeile (flacher als p-wide) */
/* (p-wide reicht hier oft aus, aber man kann variieren) */

/* Bild-Handling innerhalb der Boxen */
.p-story-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* WICHTIG: Beschneidet das Bild passend zur Box */
    display: block;
}



/* iconfarebn angepasst */
/* --- VERFEINERTES OPTIONEN-DESIGN --- */

.option-box {
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.4); 
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 25px;
    height: 100%;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.option-box:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 15px 35px rgba(0,0,0,0.05);
}

/* Stilisierung der neuen Icons */
.option-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a8d96; /* Dein Marken-Farbton */
    background: rgba(196, 229, 226, 0.3); /* Ganz zartes Aqua im Hintergrund */
    border-radius: 50%;
    font-size: 1.8rem;
    transition: all 0.3s ease;
}

.option-box:hover .option-icon {
    background: #c4e5e2; /* Aqua wird beim Hover etwas kräftiger */
    transform: rotate(5deg);
}

.option-titleRaleway {
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.9rem;
    color: #4a8d96;
    margin-bottom: 10px;
}



/* ============================================================
   GALERIE — größere Kacheln, Form nach Bildinhalt
   (maßgeblicher Block: überschreibt die obigen .p-story-grid-Definitionen)
   Formklassen: g-square / g-portrait / g-wide / g-panorama
   ============================================================ */

.p-story-grid {
    grid-template-columns: repeat(2, 1fr);   /* Mobile: 2 Spalten */
    grid-auto-rows: 150px;
    grid-gap: 16px;
    grid-auto-flow: dense;
    margin-bottom: 60px;
}

@media (min-width: 992px) {
    .p-story-grid {
        grid-template-columns: repeat(3, 1fr); /* Desktop: 3 Spalten (größere Bilder) */
        grid-auto-rows: 175px;
        grid-gap: 18px;
    }
}

/* Formklassen (Desktop) ─ Spaltenbreite ~368px, Zeilenhöhe 175px + 18px Gap:
     Quadrat   1 Sp × 2 Z  ≈ 368×368   (1,00)
     Porträt   1 Sp × 3 Z  ≈ 368×561   (0,66)
     Breit     2 Sp × 3 Z  ≈ 754×561   (1,34)
     Panorama  3 Sp × 3 Z  ≈ 1140×561  (2,03) */
@media (min-width: 992px) {
    .p-story-item.g-square   { grid-column: span 1; grid-row: span 2; }
    .p-story-item.g-portrait { grid-column: span 1; grid-row: span 3; }
    .p-story-item.g-wide     { grid-column: span 2; grid-row: span 3; }
    .p-story-item.g-panorama { grid-column: span 3; grid-row: span 3; }
}

/* Formklassen (Mobile, 2 Spalten) */
@media (max-width: 991.98px) {
    .p-story-item.g-square   { grid-column: span 1; grid-row: span 2; }
    .p-story-item.g-portrait { grid-column: span 1; grid-row: span 3; }
    .p-story-item.g-wide     { grid-column: span 2; grid-row: span 2; }
    .p-story-item.g-panorama { grid-column: span 2; grid-row: span 2; }
}

/* Bild füllt Kachel, Bildausschnitt zentriert */
.p-story-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}


/* ============================================================
   HANDY (< 768px): Einspalter – Optionskacheln & Galerie
   gestapelt; Desktop/Tablet unverändert
   (steht NACH dem 991.98px-Form-Block → gewinnt bei gleicher
    Spezifität, da Media-Queries die Spezifität nicht erhöhen)
   ============================================================ */
@media (max-width: 767.98px) {

    /* Galerie-Panel: Seitenabstand an die Kacheln angleichen (Rand kleiner) */
    .gallery-cta-section {
        padding-left: 20px;
        padding-right: 20px;
    }

    /* --- Galerie: aus dem Form-Raster ein gestapelter Foto-Feed --- */
    .p-story-grid {
        display: flex;
        flex-direction: column;
        gap: 16px;
        margin-bottom: 40px;
    }
    /* Form-/Span-Klassen sind im Flex-Container ohnehin wirkungslos;
       Höhe der Kachel richtet sich nach dem Bild */
    .p-story-item {
        width: 100%;
        height: auto;
    }
    /* Ganzes Bild, echtes Seitenverhältnis – kein Beschnitt */
    .p-story-item img {
        width: 100%;
        height: auto;
        object-fit: contain;
    }

    /* --- Optionskacheln: volle Breite, untereinander --- */
    /* Bootstrap .col-6 (width:50%) wird durch die höhere Spezifität
       dieses Selektors überschrieben (zwei Klassen vs. eine) */
    .options-promo-section .row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;
    }
    /* Etwas kompaktere Innenabstände auf kleinen Screens */
    .options-promo-section { padding: 40px 20px; }

    /* --- Kacheln deutlicher füllen (größer/lesbarer) --- */
    .options-promo-section .option-box { padding: 36px 28px; }
    .options-promo-section .option-icon {
        width: 72px; height: 72px; margin-bottom: 22px;
    }
    .options-promo-section .option-titleRaleway { font-size: 1.15rem; }
    .options-promo-section .option-textRaleway  { font-size: 1.05rem; line-height: 1.5; }

    /* --- Kein Hover auf dem Handy (Touch): Hover-Styles auf Basiszustand zurücksetzen --- */
    .option-box:hover {
        transform: none;
        background: rgba(255, 255, 255, 0.4);
        box-shadow: none;
    }
    .option-box:hover .option-icon {
        background: rgba(196, 229, 226, 0.3);
        transform: none;
    }
}
