/*
Theme Name: Hello Elementor Child
Template: hello-elementor
Description: Optimalizált, tipográfiailag és technikailag finomhangolt stíluslap.
Author: Somogyi András
Version: 2.7.0
*/

/* ═════════════════════════════════════════════════════════════
   TARTALOM
    1. Alapbeállítások
    2. Elrendezés (asztali háttér, oldalkeret, rögzített fejléc)
    3. Tipográfia – V3 szövegszerkesztő
    4. Tipográfia – V4 (atomic) elemek
    5. Közös szövegelemek (linkek, kiemelés, idézet, kijelölés)
    6. Menü és horgonyok
    7. Komponensek (infodoboz, V4 lista)
    8. Címergyűjtemény (Loop Grid, WP Grid Builder szűrők)
    9. Képek és lightbox
   10. Vissza a tetejére gomb
   11. Akadálymentesség: csökkentett mozgás
   12. Nyomtatás / PDF-mentés
   ═════════════════════════════════════════════════════════════ */


/* ═════════════════════════════════════════════════════════════
   1. ALAPBEÁLLÍTÁSOK
   ═════════════════════════════════════════════════════════════ */

html {
    /* Sima görgetés; a rögzített fejléc magassága a horgonyokhoz, tartalomjegyzékhez */
    scroll-behavior: smooth;
    scroll-padding-top: 64px;

    /* Szövegméretezés */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;

    /* Betűsimítás */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ligatúrák, alávágás csak a címsorokon (a teljes oldalra drága) */
h1, h2, h3, h4, h5, h6 {
    text-rendering: optimizeLegibility;
}

/* Képek: soha ne lógjanak ki, arányosan kicsinyedjenek */
img {
    max-width: 100%;
    height: auto;
}


/* ═════════════════════════════════════════════════════════════
   2. ELRENDEZÉS
   ═════════════════════════════════════════════════════════════ */

/* Külső szürke háttér és fehér oldalkeret – csak asztalon */
@media (min-width: 901px) {
    body {
        background: #f5f5f7;
    }

    .elementor-location-single,
    .site-main {
        max-width: 960px;
        margin-inline: auto;
        padding: 60px;
        box-sizing: border-box;
        background: #fff;

        /* Halvány szegély + lágy árnyék */
        border: 1px solid rgba(0, 0, 0, 0.16);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    }
}


/* Rögzített fejléc tisztán CSS-ből (JavaScript nélkül, nem akad görgetéskor).
   Feltétel: a Fejléc sablonban (397) a konténer Mozgáseffektek → Sticky = Nincs. */
.elementor-location-header {
    position: sticky;
    top: var(--wp-admin--admin-bar--height, 0px);
    z-index: 100;
}


/* ═════════════════════════════════════════════════════════════
   3. TIPOGRÁFIA – V3 SZÖVEGSZERKESZTŐ
   ═════════════════════════════════════════════════════════════ */

/* Bekezdések és listaelemek: sorkizárás, elválasztás (kivétel: .cimer-lista) */
body:not(.wp-admin):not(.elementor-editor-active) .elementor-widget-text-editor:not(.cimer-lista) p,
body:not(.wp-admin):not(.elementor-editor-active) .elementor-widget-text-editor:not(.cimer-lista) li,
body:not(.wp-admin):not(.elementor-editor-active) .elementor-text-editor:not(.cimer-lista) p,
body:not(.wp-admin):not(.elementor-editor-active) .elementor-text-editor:not(.cimer-lista) li {
    text-align: justify !important;
    text-justify: inter-word !important;

    -webkit-hyphens: auto !important;
    hyphens: auto !important;

    /* Szigorúbb elválasztási limitek, hogy ne tördeljen fura helyen */
    -webkit-hyphenate-limit-chars: 8 3 3;
    hyphenate-limit-chars: 8 3 3;

    /* Árvák és özvegyek csökkentése */
    orphans: 3;
    widows: 3;

    text-wrap: pretty;
    overflow-wrap: break-word;
}

/* Mobil: balra zárt, elválasztás nélkül */
@media (max-width: 767px) {
    body:not(.wp-admin):not(.elementor-editor-active) .elementor-widget-text-editor:not(.cimer-lista) p,
    body:not(.wp-admin):not(.elementor-editor-active) .elementor-widget-text-editor:not(.cimer-lista) li,
    body:not(.wp-admin):not(.elementor-editor-active) .elementor-text-editor:not(.cimer-lista) p,
    body:not(.wp-admin):not(.elementor-editor-active) .elementor-text-editor:not(.cimer-lista) li {
        text-align: left !important;
        text-justify: auto !important;
        -webkit-hyphens: none !important;
        hyphens: none !important;
        text-wrap: normal !important;
    }
}

/* Címsorok: balra zárt, elválasztás nélkül, kiegyensúlyozott sorok */
.elementor-widget-heading h1,
.elementor-widget-heading h2,
.elementor-widget-heading h3,
.elementor-widget-heading h4,
.elementor-widget-heading h5,
.elementor-widget-heading h6,
.elementor-widget-theme-post-title h1 {
    text-align: left !important;
    -webkit-hyphens: none !important;
    hyphens: none !important;
    text-wrap: balance !important;
}

/* H1 alsó elválasztó vonal */
.elementor-widget-heading h1,
.elementor-widget-theme-post-title h1 {
    border-bottom: 1px solid var(--e-global-color-secondary);
    padding-bottom: 6px;
    margin-bottom: 10px;
}

/* Listák utáni térköz */
.elementor-widget-text-editor ul,
.elementor-widget-text-editor ol {
    margin-bottom: 1.2em;
}


/* ═════════════════════════════════════════════════════════════
   4. TIPOGRÁFIA – V4 (ATOMIC) ELEMEK
   A V4 widgetek "all: unset" alapstílussal jönnek (egy osztály
   specificitás), ezért ezek a szabályok erősebb választót használnak.
   ═════════════════════════════════════════════════════════════ */

/* Bekezdések: sorkizárás, elválasztás (kivétel: .cimer-lista az elemen vagy a szülőjén) */
body:not(.wp-admin):not(.elementor-editor-active) p.e-paragraph-base:not(.cimer-lista):not(.cimer-lista *) {
    text-align: justify;
    text-justify: inter-word;

    -webkit-hyphens: auto;
    hyphens: auto;

    -webkit-hyphenate-limit-chars: 8 3 3;
    hyphenate-limit-chars: 8 3 3;

    orphans: 3;
    widows: 3;

    text-wrap: pretty;
    overflow-wrap: break-word;
}

/* Mobil: balra zárt, elválasztás nélkül */
@media (max-width: 767px) {
    body:not(.wp-admin):not(.elementor-editor-active) p.e-paragraph-base:not(.cimer-lista):not(.cimer-lista *) {
        text-align: left;
        text-justify: auto;
        -webkit-hyphens: none;
        hyphens: none;
        text-wrap: normal;
    }
}

/* H1 alsó elválasztó vonal */
body h1.e-heading-base {
    border-bottom: 1px solid var(--e-global-color-secondary);
    padding-bottom: 6px;
    margin-bottom: 10px;
}


/* ═════════════════════════════════════════════════════════════
   5. KÖZÖS SZÖVEGELEMEK (V3 és V4)
   ═════════════════════════════════════════════════════════════ */

/* Szöveges linkek */
.elementor-widget-text-editor a,
.elementor-widget-theme-post-content a,
.e-paragraph-base a {
    color: var(--e-global-color-text);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--e-global-color-primary);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    text-decoration-skip-ink: auto;
    transition: color .2s ease, text-decoration-color .2s ease;
}

.elementor-widget-text-editor a:hover,
.elementor-widget-theme-post-content a:hover,
.e-paragraph-base a:hover {
    color: var(--e-global-color-primary);
    text-decoration-color: var(--e-global-color-text);
}

/* Kiemelés */
.elementor-widget-text-editor strong,
.elementor-widget-text-editor b,
.e-paragraph-base strong,
.e-paragraph-base b {
    font-weight: 600;
    color: var(--e-global-color-text);
}

/* Idézetblokk */
body:not(.wp-admin) blockquote {
    padding: 1rem 1.25rem !important;
    margin: 1.25rem 0 !important;
    background: #F7F6F6 !important;
    font-style: italic !important;
    border: 1px solid color-mix(in srgb, var(--e-global-color-text) 10%, white);
    border-left: 5px solid var(--e-global-color-primary);
}

/* Szövegkijelölés – csak egeres eszközön */
@media (hover: hover) and (pointer: fine) {
    ::selection {
        background: var(--e-global-color-primary);
        color: #fff;
    }
}


/* ═════════════════════════════════════════════════════════════
   6. MENÜ ÉS HORGONYOK
   ═════════════════════════════════════════════════════════════ */

/* Menü: aláhúzás és Elementor-mutatók tiltása */
.elementor-nav-menu .elementor-item,
.elementor-location-footer .elementor-nav-menu .elementor-item {
    text-decoration: none !important;
}

.elementor-nav-menu.e--pointer-underline .elementor-item:after,
.elementor-nav-menu.e--pointer-overline .elementor-item:before,
.elementor-nav-menu .elementor-item::before,
.elementor-nav-menu .elementor-item::after {
    display: none !important;
}

/* Billentyűzetes fókusz jelzése (az aláhúzás tiltása után) */
.elementor-nav-menu .elementor-item:focus-visible {
    outline: 2px solid var(--e-global-color-primary);
    outline-offset: 2px;
}

/* „Mentés PDF-ként” menüpont gombként
   (Megjelenés → Menük: egyéni hivatkozás, URL: #pdf-mentes – CSS-osztály nem kell) */
.elementor-nav-menu--main .menu-item:has(> a[href="#pdf-mentes"]) {
    align-self: center;
    margin-left: 12px;
}

.elementor-nav-menu--main .menu-item > a[href="#pdf-mentes"] {
    padding: 6px 14px !important;
    border: 1px solid var(--e-global-color-primary);
    border-radius: 3px;
    color: var(--e-global-color-primary) !important;
    transition: background-color .2s ease, color .2s ease;
}

.elementor-nav-menu--main .menu-item > a[href="#pdf-mentes"]:hover,
.elementor-nav-menu--main .menu-item > a[href="#pdf-mentes"]:focus-visible {
    background: var(--e-global-color-primary);
    color: #fff !important;
}

/* Mobilon (lenyíló menü) nem jelenik meg */
.elementor-nav-menu--dropdown .menu-item:has(> a[href="#pdf-mentes"]) {
    display: none !important;
}

/* Horgonyok: tiszta, semleges pontként viselkedjenek
   (a fejléc-eltolás a html blokk scroll-padding-top értéke) */
.elementor-widget-menu-anchor,
.elementor-menu-anchor {
    position: relative;
    display: block;
    visibility: hidden;
    pointer-events: none;
}


/* ═════════════════════════════════════════════════════════════
   7. KOMPONENSEK
   ═════════════════════════════════════════════════════════════ */

/* Címer infodoboz: üres dinamikus mező sorának elrejtése */
.elementor .cimer-infodoboz-sor:not(:has(.cimer-infodoboz-ertek)),
.elementor .cimer-infodoboz-sor:has(.cimer-infodoboz-ertek:empty) {
    display: none;
}

/* V4 lista: az Elementor konténer-padding nullázása */
.elementor .e-con.e-list-base,
.elementor .e-con.e-list-item-base,
.elementor .e-con.e-list-item-marker-base,
.elementor .e-con.e-list-item-content-base {
    padding: 0;
}

.elementor .e-con.e-list-item-base {
    gap: 0.625rem;
}

.elementor .e-con.e-list-item-marker-base {
    width: auto;
    flex: 0 0 auto;
}

/* V4 lista: a pont mérete */
.elementor .e-list-item-marker-base {
    --e-svg-width: 0.5rem;
    --e-svg-height: 0.5rem;
}

@media (max-width: 767px) {
    .elementor .e-con.e-list-item-base {
        gap: 0.5rem;
    }

    .elementor .e-list-item-marker-base {
        --e-svg-width: 0.4rem;
        --e-svg-height: 0.4rem;
    }
}


/* ═════════════════════════════════════════════════════════════
   8. CÍMERGYŰJTEMÉNY (LOOP GRID, WP GRID BUILDER)
   ═════════════════════════════════════════════════════════════ */

/* Rács: rugalmas sor, a címerek aljára igazítva */
@media screen {
    .wpgb-enabled .elementor-loop-container {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        align-items: flex-end !important;
        gap: 30px !important;
    }

    /* A kép a width/height attribútumából kapja a natív méretét (betöltés előtt is);
       keskeny képernyőn arányosan kicsinyedik */
    .wpgb-enabled .e-loop-item img {
        height: auto !important;
        max-width: 100% !important;
        display: block;
    }
}

/* Szűrők (facet): helyfoglalás betöltés közben, hogy ne ugráljon az oldal */
.wpgb-facet-1 .wpgb-hierarchical-list,
.wpgb-facet-2 .wpgb-hierarchical-list {
    min-height: 80px;
}

@media (min-width: 768px) {
    .wpgb-facet-1.wpgb-loading,
    .wpgb-facet-2.wpgb-loading {
        height: 80px;
        overflow: hidden;
    }

    .wpgb-facet-1.wpgb-loading .wpgb-hierarchical-list,
    .wpgb-facet-2.wpgb-loading .wpgb-hierarchical-list {
        visibility: hidden;
    }
}

@media (max-width: 767px) {
    .wpgb-facet-1 .wpgb-hierarchical-list,
    .wpgb-facet-2 .wpgb-hierarchical-list {
        min-height: 120px;
    }
}


/* ═════════════════════════════════════════════════════════════
   9. KÉPEK ÉS LIGHTBOX
   ═════════════════════════════════════════════════════════════ */

/* Elementor 48px-es SVG-szabályának felülírása: a kép a saját méretében marad,
   így a lazy placeholder (260×300) és a betöltött kép mérete megegyezik */
.elementor-widget-image a img[src$=".svg"] {
    width: auto;
    max-width: 100%;
    height: auto;
}

/* Lightbox: üveghatású háttér */
.elementor-lightbox {
    background: rgba(248, 250, 252, 0.85) !important;
    -webkit-backdrop-filter: blur(18px) saturate(130%) !important;
    backdrop-filter: blur(18px) saturate(130%) !important;
    isolation: isolate;
}

.elementor-lightbox .dialog-widget-content,
.elementor-lightbox .elementor-lightbox-image-container,
.elementor-lightbox .elementor-lightbox-item,
.elementor-lightbox .elementor-lightbox-item img {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

/* Lightbox fejléc */
html body .elementor-lightbox .elementor-slideshow__header {
    background: rgba(255, 255, 255, 0.7) !important;
    -webkit-backdrop-filter: blur(15px) saturate(180%) !important;
    backdrop-filter: blur(15px) saturate(180%) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.elementor-lightbox .dialog-close-button {
    font-size: var(--lightbox-header-icons-size) !important;
}


/* ═════════════════════════════════════════════════════════════
   10. VISSZA A TETEJÉRE GOMB
   ═════════════════════════════════════════════════════════════ */

#scroll-to-top {
    position: fixed;
    right: 25px;
    bottom: 25px;
    z-index: 9999;
    width: 45px;
    height: 45px;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--e-global-color-text);
    border: 0;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;

    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    will-change: opacity, transform;
}

#scroll-to-top svg {
    fill: #ffffff !important;
    width: 32px;
    height: 32px;
}

#scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* Hover csak egeres eszközön (érintőképernyőn "beragadna" a megemelt állapot) */
@media (hover: hover) and (pointer: fine) {
    #scroll-to-top:hover {
        background: var(--e-global-color-primary);
        transform: translate3d(0, -5px, 0);
    }
}

/* Billentyűzetes fókusz jelzése */
#scroll-to-top:focus-visible {
    outline: 2px solid var(--e-global-color-primary);
    outline-offset: 3px;
}


/* ═════════════════════════════════════════════════════════════
   11. AKADÁLYMENTESSÉG: CSÖKKENTETT MOZGÁS
   ═════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    #scroll-to-top {
        transition: none;
    }

    /* Hover-nagyítás kikapcsolása */
    .kep-hover-nagyitas,
    .kep-hover-nagyitas:hover {
        transition: none !important;
        transform: none !important;
    }
}


/* ═════════════════════════════════════════════════════════════
   12. NYOMTATÁS / PDF-MENTÉS
   A harmonikák kinyitását és a linkek kikapcsolását a footer.php végzi.
   ═════════════════════════════════════════════════════════════ */

@media print {

    /* Oldal: A4, lábléc oldalszámmal (Chrome/Edge) */
    @page {
        size: A4;
        margin: 18mm 16mm 18mm 16mm;

        @bottom-left {
            content: "cimerek.hu";
            font: 8pt sans-serif;
            color: #999;
        }

        @bottom-right {
            content: counter(page) " / " counter(pages);
            font: 8pt sans-serif;
            color: #666;
        }
    }

    /* 12.1 Konténerek blokkosítása (ne vágjon sort derékba) */
    .page-content,
    .elementor,
    .elementor-widget-container,
    .e-con:not(.e-list-base):not(.e-list-item-base):not(.e-list-item-marker-base):not(.e-list-item-content-base):not(.cimer-kartya):not(.e-accordion-item-icon-base):not(.e-accordion-item-icon-open-base),
    .e-flexbox-base:not(.cimer-kartya),
    .e-div-block-base {
        display: block !important;
        height: auto !important;
        overflow: visible !important;
    }

    /* 12.2 Ami nem kell a papírra (erősebb választó, a fentit felülírja) */
    html body .elementor-location-header,
    html body .elementor-location-footer,
    html body #scroll-to-top,
    html body .wpgb-facet,
    html body .elementor-lightbox,
    html body .pdf-letoltes,
    html body .elementor-widget-shortcode,
    html body .e-accordion-item-icon-base,
    html body .e-accordion-item-icon-open-base,
    html body .elementor-button-wrapper {
        display: none !important;
    }

    /* 12.3 Alap */
    html,
    body {
        background: #fff !important;
    }

    body {
        font-size: 11pt;
        line-height: 1.5;
        color: #222;
    }

    .site-main {
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        box-shadow: none !important;
    }

    .elementor-invisible {
        visibility: visible !important;
        opacity: 1 !important;
        animation: none !important;
    }

    * {
        transition: none !important;
    }

    /* 12.4 Tipográfia és tagolás */
    html body p,
    html body li,
    html body .e-paragraph-base {
        font-size: 11pt !important;
        line-height: 1.5 !important;
    }

    html body p,
    html body .e-paragraph-base {
        margin: 0 0 0.7em 0 !important;
        text-align: left !important;
        orphans: 3;
        widows: 3;
    }

    html body h1 { margin: 0.6em 0 0.5em 0 !important;  font-size: 22pt !important;   line-height: 1.2 !important; }
    html body h2 { margin: 1.2em 0 0.45em 0 !important; font-size: 16pt !important;   line-height: 1.25 !important; }
    html body h3 { margin: 1em 0 0.4em 0 !important;    font-size: 13pt !important;   line-height: 1.3 !important; }
    html body h4 { margin: 0.9em 0 0.35em 0 !important; font-size: 11.5pt !important; line-height: 1.3 !important; }

    /* A harmonika címe maradjon szerény */
    html body .harmonika-cim {
        margin: 0 !important;
        font-size: 12pt !important;
    }

    html body ul,
    html body ol,
    html body .e-list-base {
        margin: 0 0 0.8em 0 !important;
    }

    html body li,
    html body .e-list-item-base {
        margin: 0 0 0.25em 0 !important;
        text-align: left !important;
    }

    /* Listaelemen belül a bekezdés ne kapjon alsó margót */
    html body li p,
    html body .e-list-item-base p {
        margin: 0 !important;
    }

    /* 12.5 Oldaltörések */
    /* Cím ne maradjon a lap alján a szövege nélkül */
    h1, h2, h3, h4 {
        break-after: avoid-page;
        page-break-after: avoid;
        break-inside: avoid;
    }

    /* Dobozok egyben maradnak, ha elférnek egy oldalon */
    img, svg, figure,
    .harmonika,
    .e-accordion-item-base,
    .cimer-infodoboz,
    .cimer-idezet,
    .e-loop-item,
    .elementor-widget-table-of-contents,
    table {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    /* 12.6 Képek */
    img {
        max-width: 100% !important;
        height: auto !important;
    }

    /* A fő (első) nagy kép ne foglaljon el egy egész oldalt */
    .page-content > .elementor img:first-of-type,
    .elementor-25 img:first-of-type,
    .elementor-12377 img:first-of-type {
        max-height: 110mm;
        width: auto !important;
        margin: 0 auto 6mm auto !important;
        display: block !important;
    }

    /* 12.7 Dobozok (infodoboz, harmonika, idézet, tartalomjegyzék) */
    .cimer-infodoboz,
    .harmonika,
    .cimer-idezet,
    .elementor-widget-table-of-contents {
        box-shadow: none !important;
        margin: 1em 0 !important;
    }

    .harmonika-fejlec {
        padding: 10px 16px !important;
    }

    .harmonika-tartalom {
        padding: 12px 16px !important;
    }

    /* Harmonika nyitva (Chrome/Edge CSS-ből; a többi böngészőben a footer.php nyitja ki) */
    details::details-content {
        content-visibility: visible !important;
        display: block !important;
        height: auto !important;
    }

    /* 12.8 Címergyűjtemény: valós méretarányok
       Minden címer a saját natív méretéből, ugyanazzal a szorzóval (zoom)
       kicsinyítve. A kártya olyan széles, mint a címere; egy sorba annyi
       kerül, amennyi kifér. Inline-block: egy sort a böngésző soha nem vág ketté. */
    html body .elementor-loop-container {
        display: block !important;
        text-align: center !important;
        font-size: 0 !important; /* inline-block közti hézag eltüntetése */
    }

    html body .elementor-loop-container > .e-loop-item {
        display: inline-block !important;
        vertical-align: bottom !important;
        width: min-content !important; /* a felirat a címer szélességéhez tördel */
        max-width: 100% !important;
        min-height: 0 !important;
        margin: 0 4mm 7mm 4mm !important;
        font-size: 11pt !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    html body .elementor-loop-container .e-loop-item img {
        zoom: 0.72;                   /* EZ az egyetlen méretszabályzó */
        width: auto !important;       /* natív méret */
        height: auto !important;
        max-width: none !important;
        max-height: none !important;
        margin: 0 auto 2mm auto !important;
        display: block !important;
    }

    html body .elementor-loop-container .e-loop-item p,
    html body .elementor-loop-container .e-loop-item .e-paragraph-base {
        font-size: 9pt !important;
        line-height: 1.3 !important;
        text-align: center !important;
        margin: 0 !important;
    }

    .cimer-kartya {
        padding: 0 !important;
    }

    /* 12.9 Linkek: sima szöveg, URL és félkövér nélkül */
    html body a,
    html body a:visited,
    html body a *,
    html body p strong,
    html body p b,
    html body li strong,
    html body li b {
        color: inherit !important;
        text-decoration: none !important;
        font-size: inherit !important;
        line-height: inherit !important;
        font-family: inherit !important;
    }

    html body a,
    html body a * {
        font-weight: 400 !important;
    }

    html body a[href]:after,
    html body a[href]::after,
    html body abbr[title]:after,
    html body abbr[title]::after {
        content: "" !important;
        display: none !important;
    }
}