/*============================================================================
   05-footer.css: patička (footer.php: .site-footer > .footer-row > .footer-col > .fwidget)
============================================================================*/

/* === Footer (Divi default + Theme Builder global footer .site-footer) === */
#main-footer,
.site-footer,
section.et_pb_section.site-footer,
.et_pb_section.site-footer {
    background-color: var(--cream) !important;
    background-image: none !important;
    border-top: 1px solid var(--line);
    color: var(--ink) !important;
    padding-top: 96px !important;
    padding-bottom: 0 !important;
    /* Divi 5 dává sekci (flex column) row-gap z --section-gutter — na ostrém webu
       je 60px, takže mezi hlavním řádkem a spodní lištou vznikala mezera navíc.
       Demo má gutter 0, odsazení řeší padding řádků. Srovnáváme na demo. */
    row-gap: 0 !important;
}

/* Hlavní řádek s columns: brand + 3 link columns přes CSS grid (jako mockup).
   Divi default 2/5 + 1/5 × 3 = 40/20/20/20 dává brandu moc, link cols se mačkají.
   Mockup používá 1.4fr + 1fr × 3 ≈ 32/23/23/23 — vyrovnanější. */
.site-footer .footer-row {
    /* Na Divi měly řádky patičky výchozí rozměry řádku Divi: šířka 80 % i na
       mobilu (.container má na mobilu 90 %) a max-width 1080 px (ne 1320 px
       jako .container). Patička je proto užší než obsah stránky. */
    width: 80%;
    max-width: 1080px;
    display: grid !important;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 64px;
    padding-top: 0 !important;
    padding-bottom: 64px !important;
    border-bottom: 1px solid var(--line);
    align-items: start;
}

/* Na Divi skládal Sidebar modul widgety jako flex s mezerou 30 px a jeho
   skrytý ::after (clearfix) z ní udělal 30 px pod každým sloupcem.
   Napodobeno odsazením, aby patička měla stejnou výšku. */
.site-footer .footer-row > .footer-col {
    padding-bottom: 30px !important;
}

.site-footer .footer-col {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Bottom row (copyright) — stejně přes grid 1fr 1fr */
.site-footer .footer-row.footer-bottom,
.site-footer .footer-bottom {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    border-bottom: none;
    align-items: center;
}

/* Brand block (1. sloupec) — logo + popisek + social icons */
.site-footer .footer-brand .logo,
.site-footer .footer-brand a.logo {
    color: var(--ink) !important;
}
.site-footer .footer-brand p,
.site-footer .footer-brand .et_pb_text p {
    color: var(--ink-soft);
    margin: 20px 0 28px;
    font-size: .95rem;
    max-width: 320px;
    line-height: 1.5;
}

/* Social icons (Pinterest, Instagram, Facebook v Code modulu) */
.footer-socials {
    display: flex;
    gap: 8px;
}
.footer-socials a {
    width: 42px;
    height: 42px;
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--ink);
    transition: background var(--t-slow), border-color var(--t-slow), color var(--t-slow), transform var(--t-slow);
    text-decoration: none;
}
.footer-socials a:hover {
    background: var(--berry);
    border-color: var(--berry);
    color: #fff;
    transform: translateY(-3px);
}

/* Link columns headings (h5) */
.site-footer h4,
.site-footer h5,
.site-footer .et_pb_text h4,
.site-footer .et_pb_text h5 {
    font-family: 'Manrope', sans-serif !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    letter-spacing: -.01em !important;
    margin-bottom: 18px !important;
    color: var(--ink) !important;
}

/* Link columns — pokud jsou v Text/Code modulu jako <ul><li><a> */
.site-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}
.site-footer ul li {
    margin: 0;
}
.site-footer ul a,
.site-footer .et_pb_text ul a {
    font-size: .92rem;
    color: var(--ink-soft) !important;
    transition: color var(--t-base);
    text-decoration: none;
}
.site-footer ul a:hover,
.site-footer .et_pb_text ul a:hover {
    color: var(--berry) !important;
}

/* === Footer Widgets (Sidebar modul + WP Navigation Menu widgets) ===
   Pro multijazyčný web (WPML/Polylang) řešíme link columns jako widgety —
   překlad se pak nastavuje per-jazyk v WP Admin → Vzhled → Widgety. */

/* Sidebar modul wrapper — bez paddingu/marginu */
.site-footer .footer-col,
.site-footer .footer-col {
    padding: 0 !important;
    background: transparent !important;
}
.site-footer .fwidget {
    margin: 0 0 24px !important;
    padding: 0 !important;
    background: transparent !important;
    float: none !important;
    width: 100% !important;
}
.site-footer .fwidget:last-child {
    margin-bottom: 0 !important;
}

/* Divi 5 přidává .et_flex_column class na widget wrapper s flex layoutem.
   Donutit zpět na block, ať text-align cascade-uje normálně (jinak inline
   obsah inside flex container nepřebírá text-align od parentů).
   Tím se zároveň vyřeší gap mezi <h5> a <ul> (řídí jen margin-bottom h5). */
.site-footer .fwidget.et_flex_column,
.site-footer .et_flex_column,
.site-footer .widget_block {
    display: block !important;
    gap: 0 !important;
}

/* Widget title (h4/h5/widget-title) — sjednoceno na náš h5 styl */
.site-footer .widgettitle,
.site-footer .fwidget .widgettitle,
.site-footer .widget-title,
.site-footer .fwidget h4 {
    font-family: 'Manrope', sans-serif !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    letter-spacing: -.01em !important;
    margin: 0 0 18px !important;
    padding: 0 !important;
    color: var(--ink) !important;
    text-transform: none !important;
    border: none !important;
    background: transparent !important;
}

/* Navigation Menu widget content (ul.menu) */
.site-footer .fwidget ul,
.site-footer .widget_nav_menu ul.menu,
.site-footer .widget_nav_menu ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: grid !important;
    gap: 12px !important;
}
.site-footer .fwidget li,
.site-footer .widget_nav_menu li {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    list-style: none;
}
.site-footer .fwidget a,
.site-footer .widget_nav_menu li a {
    font-family: 'Inter', sans-serif !important;
    font-size: .92rem !important;
    font-weight: 500 !important;
    color: var(--ink-soft) !important;
    text-decoration: none !important;
    transition: color var(--t-base);
    padding: 0 !important;
    background: transparent !important;
}
.site-footer .fwidget a:hover,
.site-footer .widget_nav_menu li a:hover {
    color: var(--berry) !important;
}

/* Footer Menu modul (alternativa pro single-language sites) — vertikální list */
.site-footer .et_pb_menu .et-menu {
    flex-direction: column !important;
    gap: 12px !important;
    justify-content: flex-start !important;
}
.site-footer .et_pb_menu .et-menu > li {
    padding: 0 !important;
    margin: 0 !important;
    width: 100%;
}
.site-footer .et_pb_menu .et-menu > li > a,
.site-footer .et_pb_menu__menu > nav > ul > li > a {
    padding: 0 !important;
    background: transparent !important;
    font-family: 'Inter', sans-serif !important;
    font-size: .92rem !important;
    font-weight: 500 !important;
    color: var(--ink-soft) !important;
    border-radius: 0 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    line-height: 1.4 !important;
}
.site-footer .et_pb_menu .et-menu > li > a:hover,
.site-footer .et_pb_menu__menu > nav > ul > li > a:hover {
    background: transparent !important;
    color: var(--berry) !important;
}

/* Bottom row — copyright (vlevo) + "Made with ♥" (vpravo) */
.site-footer .footer-bottom,
.site-footer #footer-bottom {
    background: transparent !important;
    padding: 28px 0 !important;
    border-top: none !important;
    font-size: .85rem;
}

/* Spany a widgety v bottom rowu dědí muted color (přebíjí .site-footer { color: ink }) */
.site-footer .footer-bottom,
.site-footer .footer-bottom span,
.site-footer .footer-bottom .fwidget,
.site-footer .footer-bottom .fwidget * {
    color: var(--muted) !important;
    font-size: .85rem !important;
}

/* 1. sloupec = copyright vlevo (default) */
.site-footer .footer-bottom .footer-col:first-child,
.site-footer .footer-bottom .footer-col:first-child .fwidget,
.site-footer .footer-bottom .footer-col:first-child .fwidget * {
    text-align: left !important;
}
/* 2. sloupec = "Made with ♥" vpravo
   Cílíme přes :last-child i přes Divi class .et-last-child (kdyby :last-child nematchnul
   kvůli clearfixu) a propisujeme do widget potomků přes ", *" */
.site-footer .footer-bottom .footer-col:last-child,
.site-footer .footer-bottom .footer-col.et-last-child,
.site-footer .footer-bottom .footer-col:last-child .fwidget,
.site-footer .footer-bottom .footer-col.et-last-child .fwidget,
.site-footer .footer-bottom .footer-col:last-child .fwidget *,
.site-footer .footer-bottom .footer-col.et-last-child .fwidget * {
    text-align: right !important;
}

/* Linky v bottom rowu */
.site-footer .footer-bottom a {
    color: var(--ink-soft) !important;
    text-decoration: none;
    transition: color var(--t-base);
}
.site-footer .footer-bottom a:hover {
    color: var(--berry) !important;
}

/* Responsive footer */
@media (max-width: 1100px) {
    /* Tablet: 2 sloupce */
    .site-footer .footer-row {
        grid-template-columns: 1fr 1fr !important;
        gap: 48px !important;
    }
}
@media (max-width: 780px) {
    /* Na Divi tohle pravidlo prohrávalo se selektorem .et_pb_section.site-footer
       (96 px), patička má tedy i na mobilu nahoře 96 px. Zachováno. */
    #main-footer {
        padding-top: 64px !important;
    }
    /* Mobile: 1 sloupec, vše na střed (brand + 3 link cols + bottom row).
       Cílíme text-align: center na všechny úrovně (row, column, widget, span)
       protože Divi widget wrappers ne vždy přebírají text-align z parentů. */
    .site-footer .footer-row {
        grid-template-columns: 1fr !important;
        gap: 36px !important;
        padding-bottom: 32px !important;
    }
    .site-footer .footer-row,
    .site-footer .footer-row .footer-col,
    .site-footer .footer-row .fwidget,
    .site-footer .footer-row .fwidget *,
    .site-footer .footer-col {
        text-align: center !important;
    }
    /* Footer-socials vycentrovat (flex container) */
    .site-footer .footer-socials {
        justify-content: center !important;
    }
    /* Brand paragraph: zrušit max-width, ať se vycentruje normálně */
    .site-footer .footer-brand p {
        max-width: none !important;
        margin-left: auto;
        margin-right: auto;
    }
    /* Logo (inline-flex) — vycentrovat na střed */
    .site-footer .footer-brand .logo {
        justify-content: center;
    }
    /* Bottom row: stack vertikálně */
    .site-footer .footer-row.footer-bottom,
    .site-footer .footer-bottom {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        padding: 24px 0 !important;
    }
    /* Přepsat desktopový left/right align v bottom row na center na mobilu.
       Musí mít stejnou specificity jako desktopová pravidla (oba s !important),
       jinak desktopová pravidla vyhrají kvůli vyšší specificity. */
    .site-footer .footer-bottom .footer-col:first-child,
    .site-footer .footer-bottom .footer-col:first-child .fwidget,
    .site-footer .footer-bottom .footer-col:first-child .fwidget *,
    .site-footer .footer-bottom .footer-col:last-child,
    .site-footer .footer-bottom .footer-col.et-last-child,
    .site-footer .footer-bottom .footer-col:last-child .fwidget,
    .site-footer .footer-bottom .footer-col.et-last-child .fwidget,
    .site-footer .footer-bottom .footer-col:last-child .fwidget *,
    .site-footer .footer-bottom .footer-col.et-last-child .fwidget * {
        text-align: center !important;
    }
}
