/* =========================================================================
   KÖZÖS RESPONZÍV OPTIMALIZÁLÁS (TV, LAPTOP, TABLET, MOBIL)
   ========================================================================= */

/* GOLYÓÁLLÓ VÉDELEM VÍZSZINTES KILÓGÁS ELLEN */
    html, body {
        max-width: 100vw !important;
        width: 100% !important;
        overflow-x: clip !important; /* JAVÍTÁS: hidden helyett clip, így a position: sticky tökéletesen működik, és nem törik össze a kártyapakli vagy a vízszintes görgetés! */
        margin: 0;
        padding: 0;
    }
    
  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. ULTRA WIDE & TV KÉPERNYŐK (1920px felett) */
@media (min-width: 1920px) {
    .hero-section, .services-hover-section, .why-us-section, .editorial-section, .testimonial-section,
    .services-section, .group-hero-section, .horizontal-scroll-wrapper {
        max-width: 1600px;
        margin-left: auto;
        margin-right: auto;
    }
    .hero-title { font-size: 6.5rem; } 
}

/* =========================================================================
   ASZTALI KIJELZŐK FIXÁLÁSA — HOGY PONTOSAN ÚGY NÉZZEN KI, MINT A NAGY MONITORON (1024px felett)
   ========================================================================= */
@media (min-width: 1024px) {
    header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 20px 40px !important;
        width: 100% !important;
    }
    
    /* A menü kapszula fixálása, hogy sose nyomódhasson össze és tilos legyen a sortörés */
    nav {
        display: flex !important;
        align-items: center !important;
        gap: 20px !important; /* Fix távolság a gombok között */
        padding: 10px 30px !important;
        white-space: nowrap !important; /* Szigorúan TILOS a két sorba ugrás */
        flex-shrink: 0 !important; /* Megtiltja a böngészőnek, hogy összenyomja a kapszulát */
    }
    
    nav a {
        font-size: 0.85rem !important; /* Pontos, fix prémium betűméret */
        font-weight: 600 !important;
        white-space: nowrap !important;
    }

    .logo {
        flex-shrink: 0 !important;
    }

    .btn-dark {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }
}

/* =========================================================================
   SZIGORÚ LAPTOP ARÁNYOSÍTÁS (1024px - 1440px között) — AZONOS KIALAKÍTÁS FIX
   ========================================================================= */
@media (min-width: 1024px) and (max-width: 1440px) {
    /* Biztosítjuk a szellős, kétoldalas elrendezést */
    .hero-section {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding-top: 150px !important;
        padding-bottom: 40px !important;
        max-width: 90vw !important; /* Dinamikus szélesség */
        margin: 0 auto !important;
        gap: 2vw !important;
    }

    /* A bal oldali szöveges blokk aránya a nagy monitorhoz igazítva */
    .hero-text-side {
        flex: 0 0 45% !important;
        max-width: 45% !important;
        text-align: left !important;
    }

    /* A főcím méretét a képernyő szélességéhez (vw) kötjük, így milliméterre együtt változik a képpel */
    .hero-title {
        font-size: 4.2vw !important; 
        line-height: 1.05 !important;
        margin-bottom: 1.5vw !important;
        letter-spacing: -0.02em !important;
    }

    .hero-subtitle {
        font-size: 1.1vw !important;
        line-height: 1.5 !important;
        margin-bottom: 2vw !important;
        max-width: 35vw !important;
    }

    /* A "Kezdjük el a közös munkát" gomb mérete */
    .hero-text-side .btn-dark, .hero-text-side .btn-main {
        font-size: 1vw !important;
        padding: 1vw 2vw !important;
    }

    /* A jobb oldali vizuális blokk (A nagy kamerás kép) */
    .hero-visual-side {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        display: flex !important;
        justify-content: flex-end !important;
        position: relative !important;
    }

    /* A nagy kép magassága és aránya, hogy kitöltse a teret felül és alul is */
    .hero-media-main {
        width: 100% !important;
        height: 65vh !important; /* Magas, monumentális marad, mint a nagy monitoron */
        object-fit: cover !important;
        border-radius: 30px !important;
    }

    /* A kis lebegő videó hajszálpontos elhelyezése és takarása */
    .hero-media-float {
        display: block !important;
        width: 42% !important;
        height: auto !important;
        position: absolute !important;
        left: -8% !important;
        bottom: -4% !important;
        z-index: 2 !important;
    }
}

/* 2. TABLETEK ÉS KISEBB LAPTOPOK (1024px alatt) */
@media (max-width: 1024px) {
    /* Általános Hero */
    .hero-section { flex-direction: column; text-align: center; padding-top: 160px; height: auto; min-height: auto; }
    .hero-text-side { padding-right: 0; margin-bottom: 60px; max-width: 100%; }
    .hero-title { font-size: 4.5rem; }
    .hero-visual-side { width: 100%; height: 50vh; justify-content: center; }
    
    /* 3D vizuál kisebb lesz */
    .hero-media-main { width: 90%; }
    .hero-media-float { width: 40%; left: -2%; bottom: -5%; border-width: 5px; }
    .hero-badge { top: -20px; left: auto; right: 5%; width: 80px; height: 80px; font-size: 1.5rem; }

    /* Szolgáltatások szétcsúszása kisebb helyen */
    .service-item h3 { font-size: 2.8rem; }
    
    /* Grid-ek 4-ből 2 oszloposra állnak */
    .why-grid, .bento-grid { grid-template-columns: repeat(2, 1fr); gap: 30px; }
    .why-item { border-left: none; border-top: 1px solid rgba(255,255,255,0.1); padding-left: 0; padding-top: 30px; }
    .why-item:nth-child(1), .why-item:nth-child(2) { border-top: none; padding-top: 0; } 

    /* Magazin blokkok */
    .editorial-block, .editorial-block:nth-child(even) { gap: 40px; margin-bottom: 100px; }
    .ed-content h3 { font-size: 2.8rem; }
}

/* =========================================================================
   3. MOBILTELEFONOK (768px alatt) - VÉGSŐ, KILÓGÁS-MENTES VERZIÓ
   ========================================================================= */
@media (max-width: 768px) {

    /* GLOBÁLIS DOBOZ-MODELL JAVÍTÁS (Hogy semmi ne nőjön a képernyőn túlra) */
    *, *::before, *::after {
        box-sizing: border-box !important;
    }

    /* Minden szöveg sortörésének kikényszerítése, ha túl hosszú a szó */
    h1, h2, h3, h4, h5, p, span {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        max-width: 100% !important;
    }
    
    /* 1. FEJLÉC ÉS MENÜ */
    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;
    }
    .logo { font-size: 1.1rem !important; margin: 0 !important; }
    .logo img { height: 35px !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; /* Szép lekerekített kapszula forma */
        border: 1px solid rgba(0, 0, 0, 0.05) !important; /* Nagyon finom, elegáns keret */
        background-color: rgba(255, 255, 255, 0.9) !important; /* Tiszta fehér, félig áttetsző háttér */
        box-shadow: 0 2px 10px rgba(0,0,0,0.02) !important; /* Minimalista árnyék a kiemelkedésért */
    }
    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; }

    /* 2. ÁLTALÁNOS VÉDŐZÓNA (Fix 25px padding százalék helyett!) */
    .hero-section, .services-hover-section, .why-us-section, .editorial-section, .testimonial-section {
        padding-left: 25px !important;
        padding-right: 25px !important;
        width: 100% !important;
        overflow: hidden !important;
    }

    /* 3. SZÖVEGEK KICSINYÍTÉSE (Hogy kiférjenek a hosszú szavak is) */
    .hero-title { font-size: 2.5rem !important; margin-bottom: 15px !important; line-height: 1.1 !important; }
    .hero-subtitle { font-size: 1rem !important; margin-bottom: 30px !important; }
    .section-title { font-size: 2.2rem !important; line-height: 1.1 !important; }
    .section-header { margin-bottom: 30px !important; }

    /* HERO SZEKCIÓ VIZUÁL */
    .hero-section { padding-top: 160px !important; padding-bottom: 60px !important; min-height: auto !important; height: auto !important; }
    .hero-visual-side { height: auto !important; padding: 20px 0 0 0 !important; }
    .hero-media-main { width: 100% !important; height: 30vh !important; border-radius: 15px !important; }
    .hero-media-float { display: none !important; } 
    .hero-badge { width: 50px !important; height: 50px !important; font-size: 1rem !important; top: -15px !important; right: 0 !important; }

    /* 4. SZOLGÁLTATÁSOK KÁRTYÁI */
    .services-hover-section { padding-top: 60px !important; padding-bottom: 60px !important; }
    .service-list { display: block !important; } 
    .service-item { 
        display: block !important; padding: 25px !important; margin-bottom: 25px !important; 
        background: #FFFFFF !important; border-radius: 20px !important;
        box-shadow: 0 10px 25px rgba(0,0,0,0.05) !important; border: none !important; overflow: hidden !important; 
    }
    .service-item h3 { font-size: 1.8rem !important; text-align: left !important; margin-bottom: 10px !important; transform: none !important; color: var(--text-dark) !important; }
    .service-item p { text-align: left !important; transform: none !important; max-width: 100% !important; color: #555 !important; font-size: 0.95rem !important; }
    
    .service-img-preview { 
        position: static !important; display: block !important; width: 100% !important; height: 200px !important; 
        margin-top: 20px !important; transform: none !important; border-radius: 12px !important; 
        opacity: 1 !important; pointer-events: auto !important; box-shadow: none !important;
    } 
    .service-item:hover h3, .service-item:hover p, .service-item:hover .service-img-preview { transform: none !important; }

    /* 5. MIÉRT MI? KÁRTYÁK */
    .why-us-section { padding-top: 50px !important; padding-bottom: 50px !important; border-radius: 30px !important; margin-left: 15px !important; margin-right: 15px !important; width: auto !important; }
    .why-grid, .bento-grid { grid-template-columns: 1fr !important; }
    .why-item { border-top: 1px solid rgba(255,255,255,0.1) !important; padding-top: 25px !important; border-left: none !important; padding-left: 0 !important; }
    .why-item:nth-child(2) { border-top: 1px solid rgba(255,255,255,0.1) !important; padding-top: 25px !important; }
    .why-item:hover { transform: none !important; box-shadow: none !important; background-color: transparent !important; }
    .why-item:hover i { color: #F8EFE6 !important; }
    .why-item:hover h4 { color: white !important; }
    .why-item:hover p { color: rgba(255,255,255,0.6) !important; }

    /* 6. MAGAZINOS BLOKKOK (Először megismerjük...) */
    .editorial-section { padding-top: 60px !important; padding-bottom: 60px !important; }
    .editorial-block, .editorial-block:nth-child(even) { flex-direction: column-reverse !important; gap: 20px !important; margin-bottom: 60px !important; text-align: center !important; }
    .ed-content h3 { font-size: 2.2rem !important; margin-bottom: 15px !important; }
    .ed-content p { max-width: 100% !important; font-size: 1rem !important; padding: 0 10px !important; }
    .ed-badge { width: 50px !important; height: 50px !important; font-size: 1.2rem !important; bottom: -10px !important; right: 10px !important; left: auto !important; border-width: 3px !important; }
    .editorial-block:nth-child(even) .ed-badge { right: auto !important; left: 10px !important; }

    /* 7. VÉLEMÉNYEK ÉS LÁBLÉC */
    .testimonial-section { padding-top: 50px !important; padding-bottom: 60px !important; }
    .testi-quote { font-size: 1.2rem !important; margin-bottom: 20px !important; padding: 0 10px !important; }
    .testi-dots { margin-top: 20px !important; }
    
    footer { flex-direction: column !important; text-align: center !important; gap: 15px !important; padding: 30px 20px !important; }
    .footer-links { margin-top: 10px !important; }
    .footer-links a { margin: 0 10px !important; }

    /* 8. CSAPAT SZEKCIÓ KÁRTYA SLAJDER JAVÍTÁS (MOBILRA) */
    .carousel-container {
        height: 440px !important;
    }
    .team-card {
        width: 290px !important;
        height: 400px !important;
        border-radius: 25px !important;
    }
    .team-card.prev {
        transform: translateX(-35%) scale(0.8) !important;
        opacity: 0.4 !important;
    }
    .team-card.next {
        transform: translateX(35%) scale(0.8) !important;
        opacity: 0.4 !important;
    }
    .card-content {
        padding: 15px 10px !important;
    }
    .card-content h3 {
        font-size: 1.4rem !important;
    }
    .card-content p {
        font-size: 0.75rem !important;
    }
}