/* =========================================================================
   TOBORZÓ KAMPÁNY OLDAL — SAFARI HARDWARE ACCELERATED VERSION
   ========================================================================= */

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

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; 
}

.hero-watermark {
    display: block !important;
    position: absolute !important;
    top: 90px !important;
    right: 8% !important;
    font-size: 14rem !important;
    font-weight: 800 !important;
    color: rgba(93, 74, 61, 0.05) !important;
    z-index: 0 !important;
    pointer-events: none !important;
    user-select: none !important;
    white-space: nowrap !important;
}

.hero-compact { 
    position: relative !important; 
    z-index: 2 !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;
    }
    
    /* Amikor asztali gépen vagy laptopon kinyílik a Referenciák, 
       a gomb elegánsan, fix szélességgel simul a címsor és a szöveg közé */
    .accordion-content-wrapper .btn-dark,
    .accordion-content-wrapper a[href*="referenciak"] {
        display: inline-block !important;
        width: max-content !important;    /* Nem nyúlik el, megtartja a kecses formáját */
        padding: 12px 28px !important;    /* Elegáns, prémium gomb-arányok */
        margin-top: 10px !important;      /* Finom távolság a felette lévő zöld címsortól */
        margin-bottom: 20px !important;   /* Szellős whitespace az alatta induló leírás előtt */
        font-size: 0.9rem !important;
        text-align: left !important;
    }

    
    nav {
        display: flex !important;
        align-items: center !important;
        gap: 20px !important;
        padding: 10px 30px !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        position: absolute !important;
        left: 50% !important;
        transform: translateX(-50%) !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)
   ========================================================================= */
@media (min-width: 1024px) and (max-width: 1440px) {
    .hero-compact { padding: 220px 10% 60px 10% !important; min-height: 45vh !important; gap: 4vw !important; }
    .hero-left h1 { font-size: 3.5vw !important; line-height: 1.1 !important; }
    .hero-right p { font-size: 1.05vw !important; line-height: 1.6 !important; }
    .hero-watermark { font-size: 11vw !important; top: 110px !important; right: 8% !important; }
    .hover-section { padding: 40px 10% 80px 10% !important; gap: 4vw !important; }
    .hover-item { padding: 20px 0 !important; }
    .hover-item h2 { font-size: 2.2vw !important; }
    .hover-item p { font-size: 0.95rem !important; }
    .hover-visual-container { top: 120px !important; height: 60vh !important; min-height: 400px !important; }
    /* Arányos skálázás kifejezetten laptop kijelzőkre */
    .accordion-content-wrapper .btn-dark,
    .accordion-content-wrapper a[href*="referenciak"] {
        padding: 10px 24px !important;
        font-size: 0.85rem !important;
        margin-top: 8px !important;
        margin-bottom: 15px !important;
    }
}

/* =========================================================================
   3. MOBIL TELEFONOK OPTIMALIZÁLÁSA (768px alatt)
   ========================================================================= */
@media (max-width: 768px) {
    *, *::before, *::after { 
        box-sizing: border-box !important; 
        touch-action: manipulation !important;
        -webkit-user-select: none; /* Letiltja a bosszantó kijelölési kék dobozt Safariban */
    }
    h1, h2, h3, h4, h5, p, span { word-wrap: break-word !important; overflow-wrap: break-word !important; max-width: 100% !important; }

    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: #F8EFE6 !important; box-shadow: 0 5px 20px rgba(0,0,0,0.05) !important; width: 100% !important; position: relative !important;
    }
    .logo { font-size: 1.1rem !important; margin: 0 !important; }
    .logo img { height: 45px !important; width: auto !important; margin-right: 10px !important; }
    .btn-dark { 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(0, 0, 0, 0.05) !important; background-color: rgba(255, 255, 255, 0.96) !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; box-shadow: 0 2px 10px rgba(0,0,0,0.02) !important;
    }
    nav::-webkit-scrollbar { display: none !important; }
    nav a { color: var(--text-dark) !important; opacity: 0.8 !important; text-decoration: none; margin-left: 0 !important; padding: 0 10px !important; }
    nav a.active-link { color: var(--text-emerald) !important; opacity: 1 !important; }

    .hero-compact { padding: 40px 25px 40px 25px !important; min-height: auto !important; flex-direction: column !important; align-items: flex-start !important; gap: 20px !important; }
    .hero-left h1 { font-size: 2.4rem !important; line-height: 1.1 !important; }
    .hero-right p { font-size: 1rem !important; line-height: 1.5 !important; }
    .hero-watermark { font-size: 18vw !important; top: 40px !important; right: 2% !important; }

    /* GRID ALAPÚ HARMONIKA */
    .hover-section { position: relative !important; padding: 20px 20px 60px 20px !important; flex-direction: column !important; gap: 0 !important; }
    .hover-list { width: 100% !important; }
    .hover-visual-container { display: none !important; }

    .hover-item {
        padding: 25px 15px !important;
        border-bottom: 1px solid rgba(0,0,0,0.08) !important;
        display: grid !important;
        grid-template-rows: auto 0fr;
        transition: grid-template-rows 0.35s cubic-bezier(0.25, 1, 0.5, 1) !important;
        cursor: pointer !important;
        pointer-events: auto !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    .hover-item h2 {
        font-size: 1.5rem !important;
        opacity: 0.7 !important;
        color: var(--text-dark) !important;
        transition: color 0.3s ease !important;
        grid-row: 1;
    }

    /* Kézi kis nyíl útmutató */
    .hover-item::after {
        content: "Bökj rá a részletekért" !important;
        font-size: 0.75rem !important;
        font-weight: 600 !important;
        text-transform: uppercase !important;
        letter-spacing: 1px !important;
        color: var(--accent-brown) !important;
        opacity: 0.6 !important;
        margin-top: 5px !important;
        display: block;
        transition: opacity 0.2s;
    }

    .accordion-content-wrapper {
        grid-row: 2;
        overflow: hidden !important;
        visibility: hidden;
        opacity: 0;
        transition: visibility 0s 0.35s, opacity 0.3s ease !important; /* Késleltetett eltűnés bezáráskor */
    }

    .hover-item p {
        font-size: 0.95rem !important;
        margin-top: 15px !important;
        margin-bottom: 15px !important;
        line-height: 1.5 !important;
    }

    .safari-fallback-img {
        display: block !important;
        width: 100% !important;
        height: 220px !important;
        border-radius: 20px !important;
        margin-top: 15px !important;
        background-size: cover !important;
        background-position: center !important;
        background-repeat: no-repeat !important;
    }

    .hover-item[data-target="img-1"] .safari-fallback-img { background-image: url("https://images.unsplash.com/photo-1522071820081-009f0129c71c?auto=format&fit=crop&q=80&w=1000") !important; }
    .hover-item[data-target="img-2"] .safari-fallback-img { background-image: url("https://images.unsplash.com/photo-1552664730-d307ca884978?auto=format&fit=crop&q=80&w=1000") !important; }
    .hover-item[data-target="img-3"] .safari-fallback-img { background-image: url("https://images.unsplash.com/photo-1611162616305-c69b3fa7fbe0?auto=format&fit=crop&q=80&w=1000") !important; }
    .hover-item[data-target="img-4"] .safari-fallback-img { background-image: url("https://images.unsplash.com/photo-1460925895917-afdab827c52f?auto=format&fit=crop&q=80&w=1000") !important; }
    .hover-item[data-target="img-5"] .safari-fallback-img { background-image: url("https://images.unsplash.com/photo-1551288049-bebda4e38f71?auto=format&fit=crop&q=80&w=1000") !important; }
    .hover-item[data-target="img-6"] .safari-fallback-img { background-image: url("https://images.unsplash.com/photo-1542744173-8e7e53415bb0?auto=format&fit=crop&q=80&w=1000") !important; }

    /* =========================================================================
       AKTÍV ÁLLAPOT VEZÉRLÉSE (.is-open OSZTÁLY ALAPJÁN)
       ========================================================================= */
    .hover-item.is-open {
        grid-template-rows: auto 1fr !important;
    }

    .hover-item.is-open h2 {
        color: var(--text-emerald) !important;
        opacity: 1 !important;
    }

    .hover-item.is-open::after {
        opacity: 0 !important;
        pointer-events: none;
    }

    .hover-item.is-open .accordion-content-wrapper {
        visibility: visible !important;
        opacity: 1 !important;
        transition: visibility 0s 0s, opacity 0.3s ease !important;
    }

    /* LÁBLÉC */
    footer { flex-direction: column !important; text-align: center !important; gap: 15px !important; padding: 30px 20px !important; }
    footer .logo img { height: 60px !important; margin: 0 !important; }
    .footer-links { margin-top: 5px !important; }
    .footer-links a { margin: 0 10px !important; }
}