/* System-wide shared styles (moved from titulka.css)
   Contains header, footer, layout and common utilities used across pages.
*/

/* --- Page & typography --- */
body {
    background-color: #f0f2f5;
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.page-container {
    max-width: 1100px;
    margin: auto;
    flex-grow: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Top advertising banner wrapper (keeps layout consistent) */
.top-ad-banner-wrapper {
    text-align: center;
    margin-bottom: 24px;
}

.top-ad-banner {
    position: relative;
    max-width: 1000px;
    width: 100%;
    aspect-ratio: 1000 / 200;
    height: auto;
    display: inline-block;
    text-align: left;
}

.top-ad-banner #jsad_pozice_61 {
    position: relative;
    width: 100%;
    height: 100%;
}

.top-ad-banner #jsad_pozice_61 div[id^="div_ipozice_"],
.top-ad-banner #jsad_pozice_61 div[id^="div_ipozice_"] img {
    width: 100% !important;
    height: 100% !important;
    position: absolute;
    top: 0;
    left: 0;
    object-fit: cover;
}

.top-ad-banner .adCounter,
.top-ad-banner .adReklama {
    position: absolute;
    top: -20px;
    font-size: 11px;
    color: gray;
    z-index: 10;
}

.top-ad-banner .adCounter { left: 0; }
.top-ad-banner .adReklama { right: 0; }

.top-ad-banner img { max-width: 100%; height: auto; display: block; }

/* --- Utilities / accessibility --- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Skip-link helper: becomes visible when focused (for keyboard users) */
.visually-hidden-focusable {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.visually-hidden-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    padding: .5rem 1rem;
    background: #fff;
    border: 2px solid #0b5fff;
    z-index: 1000;
}

/* Visible focus outlines for accessibility (keyboard focus) */
:where(a, button, [tabindex]):focus-visible {
    outline: 3px solid #0b5fff;
    outline-offset: 2px;
}

.button--outline {
    display: inline-block;
    padding: 10px 25px;
    background-color: transparent;
    color: #D42E25;
    border: 2px solid #D42E25;
    border-radius: 20px;
    font-family: 'Oswald', sans-serif;
    font-weight: normal;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.button--outline:hover { background-color: #D42E25; color: white; }

/* --- Header / navigation --- */
.main-header {
    background-color: #D42E25;
    padding: 10px 0;
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    margin-bottom: 24px;
    border-radius: 12px;
}

.header-grid-container {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 0 90px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.logo { grid-row: 1 / 3; grid-column: 1; align-self: center; }
.logo img { display: block; max-height: 70px; width: auto; filter: drop-shadow(2px 2px 3px rgba(0,0,0,0.4)); }

.info-bar-content { grid-row: 1; grid-column: 2; justify-self: start; align-self: start; font-size: 0.8rem; padding-bottom: 5px; opacity: 0.9; letter-spacing: 0.5px; }

.main-nav-content { grid-row: 2; grid-column: 2; display: flex; align-items: center; position: relative; }

.main-menu { display: block; }
.main-menu ul { margin: 0; padding: 0; list-style: none; display: flex; gap: 35px; }
.main-menu a { color: white; text-decoration: none; text-transform: uppercase; font-family: 'Oswald', sans-serif; font-weight: normal; font-size: 1.1rem; letter-spacing: 0.5px; transition: opacity 0.2s; }
.main-menu a:hover { opacity: 0.8; }

.nav-tools { display: flex; align-items: center; gap: 20px; margin-left: 35px; }
.nav-tools a { color: white; text-decoration: none; font-family: 'Oswald', sans-serif; text-transform: uppercase; font-weight: normal; }
.nav-tools .more-menu-button { background: none; border: none; padding: 0; cursor: pointer; color: white; font-family: 'Oswald', sans-serif; font-size: 1.1rem; text-transform: uppercase; }

#mobile-nav-toggle { display: none; }

.search-button { transition: opacity 0.2s; display: flex; align-items: center; margin-left: auto; background: none; border: none; cursor: pointer; width: 30px; height: 20px; color: white; }
.search-button:hover { opacity: 0.8; }

.dropdown { position: relative; display: inline-block; }
.dropdown-content { display: none; position: absolute; background-color: #BF2820; min-width: 160px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); z-index: 100; right: 0; border-radius: 4px; overflow: hidden; }
.dropdown-content a { color: white; padding: 12px 16px; text-decoration: none; display: block; font-size: 0.9rem; text-align: left; }
.dropdown-content a:hover { background-color: #D42E25; }
.dropdown:hover .dropdown-content { display: block; }

/* Search popup */
:root { --search-bg: #BF2820; --search-hover: #D42E25; --search-text: #fff; --search-border: rgba(255,255,255,0.85); --search-border-strong: rgba(255,255,255,0.9); --search-border-weak: rgba(255,255,255,0.6); --search-placeholder: rgba(255,255,255,0.7); }
.search-form-container { position: absolute; right: 0; top: calc(100% + 10px); visibility: hidden; opacity: 0; transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out; background-color: var(--search-hover); padding: 8px; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.15); }
.search-form-container::after { content: ''; position: absolute; top: -10px; right: 15px; width: 0; height: 0; border-left: 10px solid transparent; border-right: 10px solid transparent; border-bottom: 10px solid var(--search-bg); }
.search-form-container.is-visible { visibility: visible; opacity: 1; }
.search-input, .mobile-search-input { background-color: transparent; color: var(--search-text); font-family: 'Roboto', sans-serif; font-size: 1rem; border-radius: 25px; box-sizing: border-box; outline: none; }
.search-input { padding: 8px 15px; width: 220px; border: 2px solid var(--search-border); }
.mobile-search-input { width: 100%; padding: 12px 16px; border: 2px solid var(--search-border-weak); }
.search-input::placeholder, .mobile-search-input::placeholder { color: var(--search-placeholder); }
.search-input:focus, .mobile-search-input:focus { border-color: var(--search-text); }
.search-form { display: flex; align-items: center; gap: 8px; }
.search-submit, .mobile-search-submit { border: 2px solid var(--search-border); background: transparent; color: var(--search-text); cursor: pointer; font-family: 'Oswald', sans-serif; text-transform: uppercase; transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease; }
.search-submit { display: inline-block; height: 36px; padding: 0 16px; border-radius: 18px; font-size: 0.8rem; letter-spacing: 0.5px; }
.mobile-search-submit { padding: 12px 18px; border-radius: 25px; font-size: 1rem; border-color: var(--search-border-strong); }
.search-submit:hover, .search-submit:focus, .mobile-search-submit:hover, .mobile-search-submit:focus { background-color: var(--search-hover); border-color: var(--search-text); color: var(--search-text); outline: none; }

/* --- Mobile nav --- */
.mobile-nav { height: 100%; width: 100%; position: fixed; z-index: 1000; top: 0; left: 0; background-color: rgba(212,46,37,0.95); display: flex; flex-direction: column; justify-content: flex-start; padding-top: 60px; box-sizing: border-box; opacity: 0; visibility: hidden; transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out; }
.mobile-nav.is-open { opacity: 1; visibility: visible; }
.mobile-nav .close-btn { position: absolute; top: 20px; right: 35px; color: #fff; background: none; border: none; cursor: pointer; font-size: 50px; text-decoration: none; }
.mobile-nav-content { display: flex; flex-direction: column; align-items: center; gap: 15px; padding-top: 30px; }
.mobile-nav-content a { text-decoration: none; font-size: 1.5rem; color: #fff; padding: 10px; font-family: 'Oswald', sans-serif; text-transform: uppercase; }
.mobile-search-container { width: 90%; margin-bottom: 20px; }
.mobile-search-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }

/* --- Footer --- */
footer { margin-top: 60px; background-color: #ffffff; padding: 40px; border-radius: 12px; box-shadow: 0 -4px 12px rgba(0,0,0,0.05); }
.footer-banner { margin-bottom: 40px; }
.footer-banner img { width: 100%; height: auto; display: block; border-radius: 8px; }
.footer-links-row, .footer-bottom-row { display: flex; justify-content: space-between; align-items: center; }
.footer-links-row { padding-bottom: 30px; margin-bottom: 30px; border-bottom: 1px solid #f0f2f5; }
.footer-rubriky { margin: 0; padding: 0; list-style: none; display: flex; gap: 25px; flex-wrap: wrap; }
.footer-rubriky a { text-decoration: none; color: #606770; font-size: 0.8rem; text-transform: uppercase; font-family: 'Oswald', sans-serif; transition: color 0.2s; }
.footer-rubriky a:hover { color: #D42E25; }
.footer-social { display: flex; gap: 20px; }
.footer-social a { display: block; }
.footer-social svg { width: 24px; height: 24px; fill: #606770; transition: fill 0.2s; }
.footer-social a:hover svg { fill: #D42E25; }
.footer-copyright { margin: 0; font-size: 0.85rem; color: #90949c; }
.footer-button { padding: 8px 20px; font-size: 0.9rem; }


*:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(212, 46, 37, 0.4);
}


/* Keep the header sticky at the top on all viewports so main menu remains visible. */
.main-header { position: sticky; top: 0; z-index: 1000; }
@media (max-width: 900px) {
    .main-header { margin-bottom: 12px; }
    .main-menu, .dropdown, .search-form-container, .search-button { display: none; }
    .header-grid-container { gap: 0 20px; grid-template-columns: auto 1fr; grid-template-rows: 1fr; padding: 0 16px; align-items: center; }
    .logo { grid-row: 1 / 2; grid-column: 1; align-self: center; }
    .logo img { max-height: 60px; }
    .info-bar-content { color: #606770; text-align: center; font-size: 0.8rem; background-color: transparent; border-radius: 0; }

    /* Ensure the main navigation content shares the same grid row as the logo
       so internal controls (mobile toggle) are vertically aligned. */
    .main-nav-content { grid-row: 1; grid-column: 2; align-self: center; display: flex; align-items: center; justify-self: end; }
}

/* Show mobile nav toggle (hamburger) on small screens */
@media (max-width: 900px) {
    #mobile-nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: transparent;
        border: none;
        color: white;
        cursor: pointer;
        font-size: 24px;
        padding: 6px;
        line-height: 1;
    }

    /* Ensure any SVG inside the toggle inherits the visible color */
    #mobile-nav-toggle svg { width: 28px; height: 28px; fill: currentColor; display: block; }
}

/* Align the mobile toggle inside the header grid so it is vertically centered with the logo */
@media (max-width: 900px) {
    /* Place toggle in the header's second column and vertically center */
    #mobile-nav-toggle {
        grid-row: 1;
        grid-column: 2;
        align-self: center;
        justify-self: end;
        margin: 0 8px 0 0; /* small right gap from edge */
        z-index: 100; /* keep above other header elements */
    }

    /* If toggle is placed outside the grid, fallback to vertical centering via position */
    .main-header #mobile-nav-toggle {
        position: relative;
        top: 0;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    /* Responsive footer adjustments moved from titulka.css */
    footer {
        padding: 20px;
        text-align: center;
    }

    .footer-links-row {
        flex-direction: column;
        gap: 30px;
    }

    .footer-rubriky {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }

    .footer-bottom-row {
        flex-direction: column-reverse;
        gap: 30px;
    }
}

