/*
 * Site-wide contact surfaces (header phone, footer contact/legal block) and the
 * hamburger focus ring. Loaded after header-enhancements.css (see
 * includes/site-contact.php) so these rules can override its `outline: none !important`.
 *
 * Header states used (set by the inline script in ekoinstal-seo-engine.php):
 *   #masthead.header-scrolled / .ast-primary-header-bar.ast-header-sticked  -> white bar
 *   transparent bar over a hero: body.home and page ids 7, 1497-1499
 *   (same list as header-enhancements.css; /uslugi/, page 13, has a solid white
 *   header since the July 2026 header work, so it is not in the list)
 */

/* ===== Header phone ===== */
.eko-header-phone {
    position: fixed;
    z-index: 10000;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    width: 44px;
    min-width: 44px;
    height: 44px;
    color: #00073F;
    text-decoration: none;
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    font-size: 15px;
    line-height: 1;
    letter-spacing: 0.2px;
    white-space: nowrap;
    border-radius: 22px;
    transition: color 0.2s ease;
}

.eko-header-phone svg {
    flex: 0 0 auto;
}

.eko-header-phone__text {
    display: none;
}

.eko-header-phone:hover {
    color: #2f6b00;
}

.eko-header-phone:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Mobile: 44x44 icon-only at the top right of the header (header is ~70px tall). */
@media (max-width: 768px) {
    .eko-header-phone {
        top: 13px;
        right: 12px;
    }
}

/* 769px and up: left of the sector pills when they sit in the header bar, otherwise
   at the right edge. The offset is measured by the inline script in site-contact.php. */
@media (min-width: 769px) {
    .eko-header-phone {
        top: 10px;
        right: var(--eko-phone-right, 16px);
    }
}

/* Desktop (Astra breakpoint): icon + number as text. */
@media (min-width: 922px) {
    .eko-header-phone {
        width: auto;
        padding: 0 12px;
    }

    .eko-header-phone__text {
        display: inline;
    }
}

/* Transparent header over a hero: white. */
body:is(.home, .page-id-7, .page-id-1497, .page-id-1498, .page-id-1499):not(.ast-main-header-nav-open):not(:has(#masthead.header-scrolled, .ast-primary-header-bar.ast-header-sticked, .ast-primary-header-bar.header-scrolled)) .eko-header-phone {
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

body:is(.home, .page-id-7, .page-id-1497, .page-id-1498, .page-id-1499):not(.ast-main-header-nav-open):not(:has(#masthead.header-scrolled, .ast-primary-header-bar.ast-header-sticked, .ast-primary-header-bar.header-scrolled)) .eko-header-phone svg {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

/* Desktop menu drawer open: header bar turns navy -> white. */
@media (min-width: 922px) {
    body.ast-main-header-nav-open .eko-header-phone {
        color: #ffffff;
    }
}

/* Mobile menu open: the drawer covers the header; hide like the sector buttons. */
@media (max-width: 921px) {
    body.ast-main-header-nav-open .eko-header-phone {
        display: none;
    }
}

/* ===== Hamburger focus ring (header-enhancements.css sets outline: none !important) ===== */
body .menu-toggle:focus-visible,
body .menu-toggle.main-header-menu-toggle:focus-visible,
body .ast-mobile-menu-trigger-minimal:focus-visible {
    outline: 2px solid #00073F !important;
    outline-offset: 4px !important;
    border-radius: 4px;
}

/* Transparent header over a hero (white burger): white ring. */
body:is(.home, .page-id-7, .page-id-1497, .page-id-1498, .page-id-1499):not(.ast-main-header-nav-open):not(:has(#masthead.header-scrolled, .ast-primary-header-bar.ast-header-sticked, .ast-primary-header-bar.header-scrolled)) .menu-toggle:focus-visible,
body:is(.home, .page-id-7, .page-id-1497, .page-id-1498, .page-id-1499):not(.ast-main-header-nav-open):not(:has(#masthead.header-scrolled, .ast-primary-header-bar.ast-header-sticked, .ast-primary-header-bar.header-scrolled)) .ast-mobile-menu-trigger-minimal:focus-visible {
    outline-color: #ffffff !important;
}

/* Desktop drawer open (navy bar): white ring. */
@media (min-width: 922px) {
    body.ast-main-header-nav-open .menu-toggle:focus-visible,
    body.ast-main-header-nav-open .ast-mobile-menu-trigger-minimal:focus-visible {
        outline-color: #ffffff !important;
    }
}

/* Mobile drawer open: white bar except on the untouched home hero (navy bar). */
@media (max-width: 921px) {
    body.home.ast-main-header-nav-open #masthead:not(.header-scrolled) .menu-toggle:focus-visible,
    body.home.ast-main-header-nav-open #masthead:not(.header-scrolled) .ast-mobile-menu-trigger-minimal:focus-visible {
        outline-color: #ffffff !important;
    }
}

/* ===== Footer contact + legal block (own navy background => contrast holds wherever it lands) ===== */
.eko-footer-contact {
    box-sizing: border-box;
    width: 100%;
    background: #00073F;
    color: #e6ebff;
    padding: 24px 24px 28px;
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
}

.eko-footer-contact__list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 28px;
    list-style: none;
    margin: 0 auto 10px;
    padding: 0;
    max-width: 1200px;
}

.eko-footer-contact__list li {
    display: flex;
    align-items: center;
    min-height: 32px;
    margin: 0;
    padding: 0;
}

.eko-footer-contact__legal {
    margin: 0 auto 6px;
    max-width: 1200px;
    font-size: 13px;
    color: #cdd5f5;
}

.eko-footer-contact__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 24px;
    margin: 0;
}

.eko-footer-contact a,
.eko-footer-contact__cookie {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.eko-footer-contact__cookie {
    background: transparent;
    border: 0;
    padding: 0;
    font: inherit;
    cursor: pointer;
}

.eko-footer-contact a:hover,
.eko-footer-contact__cookie:hover {
    color: #b9e37f;
}

.eko-footer-contact a:focus-visible,
.eko-footer-contact__cookie:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

@media (max-width: 600px) {
    /* Leave room for the theme's scroll-to-top button in the bottom right corner. */
    .eko-footer-contact {
        padding-bottom: 72px;
    }

    .eko-footer-contact__list {
        flex-direction: column;
        align-items: center;
    }
}
