/* ============================================================================
   TISCHLEREI KORTHAUS - REFERENZEN STYLESHEET (referenzen.css)
   ============================================================================
   
   BESCHREIBUNG:
   Stylesheet für die Referenzen-Seite (referenzen.html).
   Enthält Styles für Galerie, Filter, Lightbox und alle Komponenten.
   
   FARBSCHEMA:
   - Primärfarbe: Orange (#FF6600)
   - Hintergründe: Beige/Grau-Töne
   - Text: Schwarz/Grau-Töne
   
   RESPONSIVE BREAKPOINTS:
   - Desktop: > 1024px
   - Tablet: 768px - 1024px
   - Mobile: < 768px
   
   VERKNÜPFTE DATEIEN:
   - referenzen.html
   - referenzen.js
   
  
   ============================================================================ */

/* ============================================================================
   RESET & BASIS-STYLES
   ============================================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============================================================================
   CSS CUSTOM PROPERTIES (CSS-VARIABLEN)
   ============================================================================
   Identisch mit styles.css für Konsistenz zwischen den Seiten. */

:root {
    /* Primärfarben - Orange */
    --primary-orange: #FF6600;
    --dark-orange: #E55100;
    --logo-orange: #FF6600;
    
    /* Neutrale Farben - Beige/Grau */
    --stone-beige: #F5F2ED;
    --stone-gray: #E8E3DA;
    --stone-dark: #D4CFC4;
    --warm-white: #FEFEFE;
    
    /* Dunkle Farben */
    --deep-black: #1A1A1A;
    --charcoal: #2D2D2D;
    --warm-gray: #6B6B6B;
    --light-gray: #A8A8A8;
    
    /* Textfarben */
    --text-dark: #1A1A1A;
    --text-light: #6B6B6B;
}

/* ============================================================================
   BODY - GRUNDLEGENDE SEITENEINSTELLUNGEN
   ============================================================================ */

body {
    font-family: 'Arial', 'Helvetica', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--warm-white);
    font-size: 16px;
    letter-spacing: -0.01em;
}

/* ============================================================================
   TYPOGRAFIE
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* Responsive große Überschrift */
.display-lg {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

/* ============================================================================
   PRELOADER
   ============================================================================
   Identisch mit styles.css */

.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--warm-white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--stone-gray);
    border-top: 4px solid var(--primary-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 2rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.preloader-text {
    color: var(--text-light);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

/* ============================================================================
   NAVIGATION
   ============================================================================
   Identisch mit styles.css für konsistentes Erscheinungsbild. */

.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(254, 254, 254, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(232, 227, 218, 0.3);
    z-index: 1000;
    box-shadow: none;                             /* Kein Schatten initial */
    transition: all 0.3s ease, box-shadow 0.3s ease; /* Sanfte Änderungen inkl. Schatten */
}

/* Scrolled-Zustand: Schatten erscheint beim Scrollen */
.navbar.scrolled {
    box-shadow: 0 4px 20px rgba(255, 102, 0, 0.15); /* Orange-farbiger Schatten */
    background: rgba(254, 254, 254, 0.98);          /* Etwas weniger transparent */
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 3rem;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    z-index: 1001;
}

.logo img {
    height: 140px;
    width: auto;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.logo:hover img {
    opacity: 0.8;
    transform: scale(1.05);
}

/* Desktop-Menü */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 3rem;
}

.nav-menu a {
    position: relative;
    color: var(--text-light);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.10rem;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
}

/* Animierte Unterstreichung */
.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-orange), var(--dark-orange));
    transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-radius: 2px;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

.nav-menu a.active {
    color: var(--primary-orange);
    font-weight: 700;
}

.nav-menu a:hover {
    color: var(--dark-orange);
}

/* ============================================================================
   MOBILE NAVIGATION
   ============================================================================ */

/* Burger-Button (versteckt auf Desktop) */
.burger-menu {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 1001;
}

.burger-line {
    width: 25px;
    height: 3px;
    background: var(--text-dark);
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

/* Animation: Burger → X */
.burger-menu.active .burger-line:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.burger-menu.active .burger-line:nth-child(2) {
    opacity: 0;
}

.burger-menu.active .burger-line:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Mobile Navigation Panel */
.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background: var(--warm-white);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    padding-top: 100px;
}

.mobile-nav.active {
    right: 0;
}

.mobile-nav ul {
    list-style: none;
}

.mobile-nav li {
    border-bottom: 1px solid var(--stone-gray);
}

.mobile-nav a {
    display: block;
    padding: 1.5rem 2rem;
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.mobile-nav a:hover,
.mobile-nav a.active {
    background: var(--stone-beige);
    color: var(--primary-orange);
}

/* Overlay hinter Mobile-Nav */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ============================================================================
   REFERENZEN HERO SECTION
   ============================================================================
   Beiger Banner mit Seitenüberschrift.
   
   WICHTIG: margin-top: 180px verschiebt den Hero UNTER die fixierte
   Navigation, damit Flexbox-Zentrierung im sichtbaren Bereich funktioniert. */

.referenzen-hero {
    margin-top: 180px;                           /* Navbar-Höhe - Box beginnt UNTER der Navigation */
    padding: 3rem 3rem;                          /* Symmetrisches Padding für echte Zentrierung */
    background: var(--stone-beige);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(40vh - 180px);              /* Gleiche visuelle Höhe wie vorher */
}

/* Dekorative Farbverläufe im Hintergrund */
.referenzen-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(255, 102, 0, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 102, 0, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.hero-container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    text-align: center;                          /* Horizontale Zentrierung */
}

.hero-content {
    max-width: 700px;
    margin: 0 auto;
}

/* Kleine Überschrift über dem Titel */
.hero-eyebrow {
    font-size: 0.875rem;
    color: var(--primary-orange);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.hero-content h1 {
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-light);
    line-height: 1.7;
}

/* ============================================================================
   FILTER SECTION
   ============================================================================
   Sticky-Leiste mit Kategorie-Buttons.
   Bleibt beim Scrollen unter der Navigation fixiert.
   
   AUF MOBILE:
   - Horizontaler Scroll statt Umbruch
   - Scrollbar versteckt für saubere Optik */

.filter-section {
    padding: 2rem 3rem;
    background: var(--warm-white);
    border-bottom: 1px solid var(--stone-gray);
    /* Kein sticky - scrollt normal mit der Seite */
}

.filter-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Filter-Buttons Container */
.filter-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;                             /* Umbruch erlaubt */
    justify-content: center;                     /* Zentriert */
}

/* Einzelner Filter-Button */
.filter-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 2px solid var(--stone-dark);
    color: var(--text-light);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.02em;
}

/* Hover: Orange Rahmen */
.filter-btn:hover {
    border-color: var(--primary-orange);
    color: var(--primary-orange);
}

/* Aktiver Filter: Gefüllt orange */
.filter-btn.active {
    background: var(--primary-orange);
    border-color: var(--primary-orange);
    color: white;
}

/* ============================================================================
   PROJEKTE GRID
   ============================================================================
   Responsive Grid mit Projekt-Karten.
   
   grid-template-columns: repeat(auto-fill, minmax(380px, 1fr))
   - Füllt automatisch so viele Spalten wie möglich
   - Mindestens 380px pro Spalte
   - Auf Mobile: 1 Spalte */

.projekte-section {
    padding: 4rem 3rem 6rem;
    background: var(--warm-white);
}

.projekte-container {
    max-width: 1400px;
    margin: 0 auto;
}

.projekte-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 2.5rem;
}

/* ============================================================================
   PROJEKT CARD
   ============================================================================
   Einzelne Projekt-Karte mit Bild, Overlay und Info.
   
   AUFBAU:
   - projekt-image: Bildbereich mit Overlay
   - projekt-badge: Kategorie-Label (oben links)
   - projekt-info: Titel, Ort, Beschreibung
   
   INTERAKTION:
   - Hover: Karte hebt sich an, oranger Rahmen
   - Klick: Öffnet Lightbox (via JavaScript) */

.projekt-card {
    background: var(--warm-white);
    border: 1px solid var(--stone-gray);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                border-color 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;                       /* GPU-Beschleunigung für Hover-Animation */
}

/* Hover: Anheben + Schatten + oranger Rahmen */
.projekt-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-orange);
}

/* Versteckte Karte (durch Filter) */
.projekt-card.hidden {
    display: none;
}

/* Bildbereich */
.projekt-image {
    position: relative;
    height: 280px;
    overflow: hidden;
}

/* Bild-Platzhalter (enthält Background-Image) */
.projekt-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--stone-beige);         /* Placeholder-Farbe vor Bildladung */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.6s ease;
    will-change: transform;                       /* GPU-Beschleunigung für Zoom-Effekt */
}

/* Hover: Bild zoomt leicht */
.projekt-card:hover .projekt-placeholder {
    transform: scale(1.05);
}

/* Platzhalter-Icon (falls kein Bild) */
.placeholder-icon {
    width: 280px;
    height: 280px;
    opacity: 0;
    filter: brightness(1);
}

/* Overlay bei Hover */
.projekt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 26, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.projekt-card:hover .projekt-overlay {
    opacity: 1;
}

/* "Projekt ansehen" Text im Overlay */
.projekt-mehr {
    color: white;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.05em;
    padding: 1rem 2rem;
    border: 2px solid white;
    transition: all 0.3s ease;
}

/* Hover: Orange gefüllt */
.projekt-card:hover .projekt-mehr {
    background: var(--primary-orange);
    border-color: var(--primary-orange);
}

/* Kategorie-Badge (oben links) */
.projekt-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--primary-orange);
    color: white;
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    /* HINWEIS: text-transform: uppercase entfernt, da ß zu SS wird */
    /* Stattdessen werden Badge-Texte direkt in Großbuchstaben geschrieben */
}

/* Info-Bereich unter dem Bild */
.projekt-info {
    padding: 1.5rem;
}

.projekt-info h3 {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

/* Ort (orange) */
.projekt-ort {
    font-size: 0.875rem;
    color: var(--primary-orange);
    margin-bottom: 1rem;
    font-weight: 500;
}

/* Beschreibung */
.projekt-details {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.6;
}

/* ============================================================================
   CTA SECTION - CALL-TO-ACTION
   ============================================================================
   Aufforderung zur Kontaktaufnahme am Ende der Seite. */

.cta-section {
    padding: 6rem 3rem;
    background: var(--stone-beige);
}

.cta-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.cta-content h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.cta-content p {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* CTA Button */
.cta-button {
    display: inline-block;
    background: var(--primary-orange);
    color: white;
    padding: 1rem 2.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
}

.cta-button:hover {
    background: var(--dark-orange);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 102, 0, 0.3);
}

/* ============================================================================
   LIGHTBOX
   ============================================================================
   Modal-Dialog für Projektdetails.
   
   DESKTOP LAYOUT:
   - Bild links (flex: 1.5)
   - Info rechts (flex: 1)
   
   MOBILE LAYOUT:
   - Bild oben (50vh max)
   - Info unten (scrollbar)
   
   STEUERUNG:
   - Schließen: X-Button, Klick außerhalb, ESC-Taste
   - Navigation: Pfeiltasten, Prev/Next Buttons, Thumbnails */

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 26, 26, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

/* Sichtbarer Zustand */
.lightbox.show {
    opacity: 1;
    visibility: visible;
}

/* Schließen-Button (orange, oben rechts) */
.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--primary-orange);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 20px rgba(255, 102, 0, 0.3);
}

.lightbox-close:hover {
    background: var(--dark-orange);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 102, 0, 0.4);
}

.lightbox-close svg {
    width: 24px;
    height: 24px;
    color: white;
}

/* Navigation Buttons (Prev/Next) */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.lightbox-nav:hover {
    background: var(--primary-orange);
    border-color: var(--primary-orange);
}

.lightbox-nav svg {
    width: 28px;
    height: 28px;
    color: white;
}

.lightbox-prev {
    left: 2rem;
}

.lightbox-next {
    right: 2rem;
}

/* Lightbox Content Container */
.lightbox-content {
    display: flex;
    max-width: 1200px;
    max-height: 85vh;
    width: 90%;
    background: var(--warm-white);
    overflow: hidden;
}

/* Bildbereich (links auf Desktop) */
.lightbox-image-container {
    flex: 1.5;
    min-width: 0;
    background: var(--stone-beige);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Bild (als Background für bessere Kontrolle) */
.lightbox-image {
    width: 100%;
    height: 100%;
    min-height: 400px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Info-Bereich (rechts auf Desktop) */
.lightbox-info {
    flex: 1;
    padding: 2.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Header: Kategorie + Titel */
.lightbox-header {
    margin-bottom: 1rem;
}

/* Kategorie-Badge */
.lightbox-kategorie {
    display: inline-block;
    background: var(--primary-orange);
    color: white;
    padding: 0.3rem 0.7rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.lightbox-info h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    line-height: 1.3;
}

/* Ort */
.lightbox-ort {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* Beschreibung */
.lightbox-beschreibung {
    color: var(--text-dark);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 2rem;
}

/* Details-Box (Material, Jahr) */
.lightbox-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--stone-beige);
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.detail-value {
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: 600;
}

/* Thumbnail-Galerie */
.lightbox-thumbnails {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* Einzelnes Thumbnail */
.thumbnail {
    width: 60px;
    height: 60px;
    background-size: cover;
    background-position: center;
    border: 2px solid transparent;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.thumbnail:hover,
.thumbnail.active {
    opacity: 1;
    border-color: var(--primary-orange);
}

/* Bild-Zähler (z.B. "1 / 3") */
.lightbox-counter {
    margin-top: auto;
    text-align: center;
    color: var(--text-light);
    font-size: 0.875rem;
}

/* ============================================================================
   FOOTER
   ============================================================================ */

.footer {
    background: var(--charcoal);
    color: var(--light-gray);
    padding: 3rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-info p {
    font-size: 0.875rem;
}

.footer-address {
    margin-top: 0.5rem;
    opacity: 0.7;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--light-gray);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-orange);
}

/* ============================================================================
   SCROLL TO TOP BUTTON
   ============================================================================ */

.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--primary-orange);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    box-shadow: 0 4px 20px rgba(255, 102, 0, 0.3);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: var(--dark-orange);
    transform: translateY(-2px);
}

.scroll-to-top svg {
    width: 28px;
    height: 28px;
}

/* ============================================================================
   ANIMATIONEN
   ============================================================================ */

/* Fade-In Animation für Projekt-Karten */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;              /* GPU-Beschleunigung für Scroll-Animation */
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
    will-change: auto;                            /* Nach Animation zurücksetzen (Speicher sparen) */
}

/* Gestaffelte Animation für die ersten 10 Karten */
.projekte-grid .projekt-card:nth-child(1) { transition-delay: 0.1s; }
.projekte-grid .projekt-card:nth-child(2) { transition-delay: 0.2s; }
.projekte-grid .projekt-card:nth-child(3) { transition-delay: 0.3s; }
.projekte-grid .projekt-card:nth-child(4) { transition-delay: 0.1s; }
.projekte-grid .projekt-card:nth-child(5) { transition-delay: 0.2s; }
.projekte-grid .projekt-card:nth-child(6) { transition-delay: 0.3s; }
.projekte-grid .projekt-card:nth-child(7) { transition-delay: 0.1s; }
.projekte-grid .projekt-card:nth-child(8) { transition-delay: 0.2s; }
.projekte-grid .projekt-card:nth-child(9) { transition-delay: 0.3s; }
.projekte-grid .projekt-card:nth-child(10) { transition-delay: 0.1s; }

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

/* ==================== TABLET (≤ 1024px) ==================== */
@media (max-width: 1024px) {
    .nav-container {
        padding: 1.2rem 2rem;
    }

    .logo img {
        height: 115px;
    }

    /* Reduziertes Padding */
    .referenzen-hero,
    .filter-section,
    .projekte-section,
    .cta-section {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    /* Kleinere Projekt-Karten */
    .projekte-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 2rem;
    }

    /* Lightbox: Vertikales Layout (Bild oben, Info unten) */
    .lightbox-content {
        flex-direction: column;
        max-height: calc(100vh - 90px);          /* Platz für Thumbnail-Leiste */
        margin-bottom: 90px;
        overflow-y: auto;                        /* Scrollbar statt Überlappung */
        overflow-x: hidden;
    }

    .lightbox-image-container {
        min-height: 300px;
        max-height: 50vh;
        flex: none;
        position: relative;
    }

    .lightbox-image {
        min-height: 300px;
        height: 100%;
        background-size: contain;                /* Bild vollständig sichtbar */
    }

    .lightbox-info {
        padding: 2rem;
        padding-bottom: 1rem;
        flex: none;
        background: var(--warm-white);
    }

    /* Navigation ausblenden auf Tablet (Swipe verwenden) */
    .lightbox-nav {
        display: none;
    }

    /* ==================== SCHWEBENDE THUMBNAIL-LEISTE (TABLET) ==================== */
    .lightbox-thumbnails {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(26, 26, 26, 0.95);
        backdrop-filter: blur(10px);
        padding: 12px 20px;
        margin: 0;
        display: flex;
        gap: 12px;
        justify-content: center;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        z-index: 2020;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    }

    .lightbox-thumbnails::-webkit-scrollbar {
        display: none;
    }

    .lightbox-thumbnails .thumbnail {
        width: 60px;
        height: 60px;
        flex-shrink: 0;
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-radius: 6px;
        opacity: 0.7;
    }

    .lightbox-thumbnails .thumbnail.active {
        opacity: 1;
        border-color: var(--primary-orange);
        box-shadow: 0 0 10px rgba(255, 102, 0, 0.5);
    }

    .lightbox-counter {
        position: fixed;
        bottom: 80px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(26, 26, 26, 0.8);
        padding: 4px 12px;
        border-radius: 12px;
        font-size: 0.8rem;
        z-index: 2021;
    }
}

/* ==================== MOBILE (≤ 768px) ==================== */
@media (max-width: 768px) {
    /* Desktop-Menü ausblenden */
    .nav-menu {
        display: none;
    }

    /* Burger-Menü anzeigen */
    .burger-menu {
        display: flex;
    }

    .logo img {
        height: 80px;
    }

    .nav-container {
        padding: 1rem 1.5rem;
    }

    /* Hero: Angepasstes margin-top für kleinere Navbar */
    .referenzen-hero {
        margin-top: 100px;
        padding: 2rem 1.5rem;
        min-height: calc(35vh - 100px);
    }

    /* Filter: Anpassungen für Mobile */
    .filter-section {
        padding: 1rem 0;
    }

    /* Horizontales Scrollen auf Mobile */
    .filter-buttons {
        flex-wrap: nowrap;                       /* Kein Umbruch */
        justify-content: flex-start;
        gap: 0.5rem;
        overflow-x: auto;                        /* Horizontaler Scroll */
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;       /* Smoothes Scrollen auf iOS */
        scrollbar-width: none;                   /* Firefox: Scrollbar verstecken */
        -ms-overflow-style: none;                /* IE/Edge: Scrollbar verstecken */
        padding: 0.5rem 1.5rem;                  /* Seitliches Padding für ersten/letzten Button */
    }

    /* Chrome/Safari: Scrollbar verstecken */
    .filter-buttons::-webkit-scrollbar {
        display: none;
    }

    .filter-btn {
        flex-shrink: 0;                          /* Nicht schrumpfen */
        white-space: nowrap;                     /* Text nicht umbrechen */
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    /* Projekte */
    .projekte-section {
        padding: 3rem 1.5rem 4rem;
    }

    /* 1 Spalte auf Mobile */
    .projekte-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .cta-section {
        padding: 4rem 1.5rem;
    }

    /* Lightbox: Schließen-Button fixiert (bleibt beim Scrollen sichtbar) */
    .lightbox-close {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        position: fixed;
        z-index: 2010;
    }

    .lightbox-content {
        width: 95%;
        max-height: calc(100vh - 90px);          /* Platz für Thumbnail-Leiste unten */
        margin-bottom: 90px;                     /* Abstand zur Thumbnail-Leiste */
    }

    /* Bild-Bereich: 50% der Bildschirmhöhe */
    .lightbox-image-container {
        min-height: 280px;
        max-height: 50vh;
    }

    .lightbox-image {
        min-height: 280px;
    }

    .lightbox-info {
        padding: 1.5rem;
        padding-bottom: 1rem;                    /* Weniger Padding unten, da Thumbnails raus */
    }

    /* Details: 1 Spalte */
    .lightbox-details {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* ==================== SCHWEBENDE THUMBNAIL-LEISTE ==================== */
    /* Thumbnails als fixierte Leiste am unteren Bildschirmrand */
    .lightbox-thumbnails {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(26, 26, 26, 0.95);      /* Dunkler Hintergrund */
        backdrop-filter: blur(10px);             /* Leichter Blur-Effekt */
        padding: 12px 15px;
        margin: 0;                               /* Reset margin */
        display: flex;
        gap: 10px;
        justify-content: center;                 /* Zentriert wenn wenige Bilder */
        overflow-x: auto;                        /* Horizontal scrollbar bei vielen Bildern */
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        z-index: 2020;                           /* Über allem anderen */
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    }

    .lightbox-thumbnails::-webkit-scrollbar {
        display: none;
    }

    /* Größere Thumbnails in der Leiste für bessere Touch-Bedienung */
    .lightbox-thumbnails .thumbnail {
        width: 55px;
        height: 55px;
        flex-shrink: 0;                          /* Nicht schrumpfen */
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-radius: 6px;
        opacity: 0.7;
    }

    .lightbox-thumbnails .thumbnail.active {
        opacity: 1;
        border-color: var(--primary-orange);
        box-shadow: 0 0 10px rgba(255, 102, 0, 0.5);
    }

    .lightbox-thumbnails .thumbnail:hover {
        opacity: 1;
    }

    /* Bild-Zähler in der Thumbnail-Leiste integrieren */
    .lightbox-counter {
        position: fixed;
        bottom: 75px;                            /* Über der Thumbnail-Leiste */
        left: 50%;
        transform: translateX(-50%);
        background: rgba(26, 26, 26, 0.8);
        padding: 4px 12px;
        border-radius: 12px;
        font-size: 0.75rem;
        z-index: 2021;
    }

    /* Footer */
    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    /* Kleinerer Scroll-to-Top Button - höher positionieren wegen Thumbnail-Leiste */
    .scroll-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 45px;
        height: 45px;
    }
}

/* ==================== SEHR KLEINE GERÄTE (≤ 480px) ==================== */
@media (max-width: 480px) {
    /* Noch kleinere Filter-Buttons */
    .filter-btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.8rem;
    }

    /* Kompaktere Thumbnail-Leiste */
    .lightbox-thumbnails {
        padding: 10px 12px;
        gap: 8px;
    }

    .lightbox-thumbnails .thumbnail {
        width: 48px;
        height: 48px;
    }

    .lightbox-counter {
        bottom: 68px;
        font-size: 0.7rem;
        padding: 3px 10px;
    }

    /* Lightbox-Content noch etwas mehr Platz */
    .lightbox-content {
        max-height: calc(100vh - 78px);
        margin-bottom: 78px;
    }
}
