/* =========================================================================
   REFERENCIÁK — SÖTÉT MOZIS TÉMÁRA SZABOTT GOLYÓÁLLÓ STÍLUSLAP
   ========================================================================= */

/* GLOBÁLIS BIZTONSÁGI ALAPOK */
html, body {
    max-width: 100vw !important;
    width: 100% !important;
    overflow-x: clip !important;
    margin: 0;
    padding: 0;
    background-color: #0d0a08;
}

p, .editorial-desc, .deck-text p, .subtitle {
    text-align: justify !important;
    text-justify: inter-word !important; /* Kizárólag a szavak közötti térközt növeli */
    
    /* TELJESEN LEKAPCSOLJUK A SZÓELVÁLASZTÁST */
    -webkit-hyphens: none !important;
    -ms-hyphens: none !important;
    hyphens: none !important;
    
    /* MEGTILTJUK A SZAVAK KETTÉVÁGÁSÁT */
    word-break: keep-all !important;
    overflow-wrap: break-word !important; /* Ha egy szó extrém hosszú lenne, csak akkor töri meg, hogy ne lógjon ki a képernyőről */
    
    /* Az utolsó sor természetes, balra zárt lezárása */
    text-align-last: left !important; 
}

/* =========================================================================
   1. VASZSIGORÚ ASZTALI FEJLÉC FIXÁLÁS (1024px felett minden monitorra)
   ========================================================================= */
@media (min-width: 1024px) {
    header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 20px 40px !important;
        width: 100% !important;
    }
    
    nav {
        display: flex !important;
        align-items: center !important;
        gap: 20px !important;
        padding: 10px 30px !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important; /* Tilos összenyomni a menüt */
        position: absolute !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        background-color: rgba(20, 20, 20, 0.6) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
    
    nav a {
        font-size: 0.85rem !important;
        font-weight: 600 !important;
        white-space: nowrap !important;
    }

    .logo { flex-shrink: 0 !important; }
    .logo img { height: 150px !important; width: auto !important; }
    .btn-dark { flex-shrink: 0 !important; white-space: nowrap !important; }
}

/* =========================================================================
   2. LAPTOP ARÁNYOSÍTÁS (1024px - 1440px között) — VIEWPORT DIZÁJN
   ========================================================================= */
@media (min-width: 1024px) and (max-width: 1440px) {
    
    /* Intro Hero igazítása laptop kijelzőkhöz */
    .intro-hero {
        padding-top: 100px !important;
        height: 90vh !important;
    }

    .intro-content h1 {
        font-size: 3.8vw !important; /* Arányosan zsugorodik a monitorral */
        line-height: 1.1 !important;
        margin-bottom: 20px !important;
    }

    .intro-content p {
        font-size: 1.1vw !important;
        max-width: 50vw !important;
    }

    .bg-watermark {
        font-size: 12vw !important;
    }

    /* VÍZSZINTES SÍN FINOMÍTÁSA LAPTOPON */
    .horizontal-scroll-wrapper {
        height: 350vh !important; /* Finomabb görgetési út */
    }

    .horizontal-track {
        gap: 5vw !important; /* Arányos távolság a kártyák között */
        padding: 0 8vw !important;
        height: 65vh !important;
    }

    /* Referencia kártyák méretezése, hogy ne lógjanak le függőlegesen */
    .ref-card {
        width: 65vw !important;
        min-width: 650px !important;
        gap: 40px !important;
    }

    .ref-image-wrapper {
        border-radius: 30px !important;
    }

    .ref-info h2 {
        font-size: 2.8vw !important;
        line-height: 1.1 !important;
        margin-bottom: 20px !important;
    }

    .ref-info p {
        font-size: 0.95vw !important;
        line-height: 1.6 !important;
        margin-bottom: 25px !important;
    }

    .ref-stats {
        gap: 30px !important;
        padding-top: 20px !important;
        margin-bottom: 25px !important;
    }

    .stat-item h4 {
        font-size: 1.8rem !important;
    }

    .stat-item span {
        font-size: 0.75rem !important;
    }

    .btn-outline {
        padding: 12px 28px !important;
        font-size: 0.85rem !important;
    }
}

/* =========================================================================
   3. MOBIL TELEFONOK OPTIMALIZÁLÁSA (768px alatt) — KLASSZIKUS MEGJELENÉS
   ========================================================================= */
@media (max-width: 768px) {
    
    /* Dobozmodell és törésvédelem */
    *, *::before, *::after { box-sizing: border-box !important; }
    h1, h2, h3, h4, h5, p, span { word-wrap: break-word !important; overflow-wrap: break-word !important; max-width: 100% !important; }

   /* SÖTÉTRE HANGOLT PRÉMIUM MOBIL FEJLÉC ÉS KAPSZULA */
    header, header.scrolled { 
        display: flex !important; 
        flex-wrap: wrap !important; 
        justify-content: space-between !important;
        align-items: center !important; 
        padding: 15px 20px !important; 
        background-color: #0d0a08 !important; /* Hajszálpontosan a Referenciák oldal mélyfekete háttere */
        box-shadow: 0 5px 20px rgba(0,0,0,0.3) !important; 
        width: 100% !important;
    }
    
    .logo { font-size: 1.1rem !important; margin: 0 !important; color: #ffffff !important; }
    .logo img { height: 45px !important; width: auto !important; margin-right: 10px !important; }
    
    /* Visszaállítjuk a gombot az eredeti ragyogó fehér dizájnra, hogy leugorjon a fekete háttérről */
    .btn-dark { 
        background-color: #ffffff !important; 
        color: #0d0a08 !important; 
        width: auto !important; 
        padding: 10px 15px !important; 
        font-size: 0.8rem !important; 
        margin: 0 !important; 
    }
    
    nav { 
        order: 3 !important; 
        width: 100% !important; 
        position: static !important; 
        transform: none !important;
        overflow-x: auto !important; 
        white-space: nowrap !important; 
        justify-content: flex-start !important; 
        padding: 12px 15px !important; 
        margin-top: 10px !important;
        border-radius: 25px !important; 
        border: 1px solid rgba(255, 255, 255, 0.08) !important; /* Finom fehér élvilágítás a sötétben */
        background-color: rgba(20, 17, 15, 0.9) !important; /* Elegáns, sötétített üvegkapszula */
        box-shadow: 0 4px 15px rgba(0,0,0,0.4) !important;
    }
    nav::-webkit-scrollbar { display: none !important; }
    nav a { color: #ffffff !important; opacity: 0.7 !important; text-decoration: none; margin-left: 0 !important; padding: 0 10px !important; }
    nav a.active-link { color: var(--text-emerald) !important; opacity: 1 !important; }

    /* INTRO HERO JAVÍTÁS MOBILRA */
    .intro-hero {
        padding: 160px 25px 60px 25px !important;
        height: auto !important;
        min-height: auto !important;
    }

    .intro-content h1 {
        font-size: 2.4rem !important;
        line-height: 1.1 !important;
        margin-bottom: 20px !important;
    }

    .intro-content p {
        font-size: 1rem !important;
        line-height: 1.6 !important;
    }

    .bg-watermark {
        font-size: 4.5rem !important;
        top: 130px !important;
    }

    .scroll-indicator {
        display: none !important; /* Mobilon nincs szükség rá, mert lefelé áramlik az oldal */
    }

    /* VÍZSZINTES SÍN KIKAPCSOLÁSA MOBILON (Függőleges, gyönyörű folyamatos elrendezéssé alakítjuk) */
    .horizontal-scroll-wrapper {
        height: auto !important; /* Megszüntetjük a mesterséges 400vh magasságot */
        position: relative !important;
    }

    .sticky-container {
        position: relative !important;
        top: 0 !important;
        height: auto !important;
        overflow: visible !important;
        padding: 20px 20px 60px 20px !important;
    }

    .horizontal-track {
        display: flex !important;
        flex-direction: column !important; /* Egymás alá kényszerítjük a kártyákat */
        gap: 50px !important; /* Tiszta távolság a projektek között */
        width: 100% !important;
        height: auto !important;
        padding: 0 !important;
        transform: none !important; /* Letiltjuk a JavaScript eltolást mobilon! */
    }

    /* MOBIL REFERENCIA KÁRTYÁK */
    .ref-card, .ref-card:nth-child(even) {
        flex-direction: column !important; /* Mindig felül a kép, alatta a szöveg */
        width: 100% !important;
        min-width: auto !important;
        max-width: none !important;
        height: auto !important;
        gap: 20px !important;
    }

    .ref-image-wrapper {
        width: 100% !important;
        height: 250px !important; /* Biztonságos, kompakt mobil magasság a projektképeknek */
        border-radius: 25px !important;
    }

    .ref-image-wrapper img {
        transform: scale(1) !important; /* Letiltjuk a parallax nagyítást mobilon */
    }

    .ref-info {
        width: 100% !important;
        padding: 10px 5px !important;
    }

    .ref-category {
        font-size: 0.8rem !important;
        margin-bottom: 10px !important;
    }

    .ref-info h2 {
        font-size: 1.8rem !important;
        line-height: 1.2 !important;
        margin-bottom: 15px !important;
    }

    .ref-info p {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
        margin-bottom: 25px !important;
    }

    /* Statisztikák igazítása mobilra */
    .ref-stats {
        gap: 30px !important;
        padding-top: 20px !important;
        margin-bottom: 25px !important;
    }

    .stat-item h4 {
        font-size: 1.6rem !important;
    }

    .btn-outline {
        width: 100% !important; /* Könnyen bökhető mobilgomb */
        justify-content: center !important;
    }

    /* Utolsó CTA kártya egyedi mobil igazítása */
    .ref-card[style*="justify-content: center"] {
        width: 100% !important;
        padding: 40px 10px !important;
    }

    .ref-card[style*="justify-content: center"] h2 {
        font-size: 2.6rem !important;
    }

    .ref-card[style*="justify-content: center"] .btn-dark {
        width: 100% !important;
        padding: 15px 30px !important;
        font-size: 1rem !important;
        justify-content: center !important;
        display: inline-flex !important;
    }

    /* LÁBLÉC MOBILRA */
    footer {
        flex-direction: column !important;
        text-align: center !important;
        gap: 15px !important;
        padding: 30px 20px !important;
        background-color: #050403 !important;
    }

    footer .logo img {
        height: 60px !important;
        margin: 0 !important;
    }

    .footer-links {
        margin-top: 5px !important;
    }

    .footer-links a {
        margin: 0 10px !important;
    }
}