
/* ================================ VELKÝ LAYOUT (>1000px) ================================ */
@media screen and (min-width: 1001px) {

    .table {
        margin-left: 49px !important;
    }

    /* Skrytí burger menu na desktopu */
    .mobile-menu-wrapper {
        display: none;
    }

    /* Menu vždy viditelné */
    #menu {
        display: block;
    }

    /* Skrytí zanořených úrovní menu defaultně */
    #menu ul li ul {
        display: none;
    }

    /* Zobrazení zanořených úrovní po kliknutí */
    #menu ul li.expanded ul {
        display: block;
    }

    /* Indikátor pro rozbalitelné položky */
    #menu ul li:has(ul) > a {
        position: relative;
        cursor: pointer;
    }

    #menu ul li:has(ul) > a:after {
        content: '▶';
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 10px;
        color: #0C75C2;
        transition: transform 0.3s ease;
    }

    #menu ul li.expanded:has(ul) > a:after {
        transform: translateY(-50%) rotate(90deg);
    }

    /* Styling pro klikatelné menu položky s dětmi */
    #menu ul li:has(ul) > a:hover:after {
        color: #FF600C;
    }
}


/* ================================ STŘEDNÍ LAYOUT (576px - 1000px) ================================ */
@media screen and (max-width: 1000px) and (min-width: 576px) {

    /* Layout úpravy - zachování dvou sloupců */
    #telo {
        flex-wrap: nowrap;
    }

    #pravyPanel {
        width: 100%;
        flex-grow: 1;
        margin: 0 0 0 10px;
        order: 2;
    }

    /* Menu zůstává viditelné - skrytí burger menu */
    .mobile-menu-wrapper {
        display: none;
    }

    /* Menu viditelné s první úrovní rozbalené */
    #menu {
        display: block;
        width: 222px;
        position: relative;
        z-index: 1000;
    }

    /* Skrytí zanořených úrovní menu */
    #menu ul li ul {
        display: none;
    }

    /* Zobrazení zanořených úrovní po kliknutí */
    #menu ul li.expanded ul {
        display: block;
    }

    /* Indikátor pro rozbalitelné položky */
    #menu ul li:has(ul) > a:after {
        content: ' ▶';
        float: right;
        transition: transform 0.3s ease;
    }

    #menu ul li.expanded:has(ul) > a:after {
        transform: rotate(90deg);
    }

    /* Bannery pod menu */
    .banner {
        width: 100%;
        margin-bottom: 10px;
    }

    .banner h2 {
        cursor: pointer;
        position: relative;
        padding-right: 30px;
    }

    #zapati {
        & .zapati-text {
            flex-direction: column;
            align-items: center;
        }
    }

        /* TITULKA Tabulky horizontálně scrollovatelné */

    #includovanyObsah {
        & .container {
            &.uvod {
                display: flex;
                flex-direction: column;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                margin: 0 -5px;
                padding: 0 5px;
            }

            & .loga {
                display: flex;
                flex-direction: row !important;
            }

            & TABLE, & table {
                border-collapse: collapse !important;
                width: 100%;
                min-width: 250px;
                text-wrap: wrap;
                border-top: 1px solid grey;
                border-bottom: 1px solid grey;
            }

            & p img {
                width: 100% !important;
                height: auto;
                object-fit: contain !important;
            }
        }

        & .section .container {
            overflow-x: auto;

            & table {
                min-width: 250px;
                text-wrap: wrap;
            }
        }
    }
}

/* ================================ MOBILNÍ LAYOUT (< 576px) ================================ */
@media screen and (max-width: 576px) {

    /* Layout úpravy */
    #center {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }

    #obsahCentru {
        max-width: 100%;
        padding: 0;
    }

    #telo {
        flex-direction: column;
    }

    #levyPanel {
        width: 100%;
        order: 1;
    }

    #pravyPanel {
        width: 100%;
        max-width: 100%;
        margin: 0;
        order: 2;
    }

    DIV.navigace {
        text-align: center;
    }

    /* Menu na plnou šířku */
    .mobile-menu-wrapper {
        width: 100%;
        background-color: white;
    }

    .mobile-menu-toggle {
        width: 50px;
        justify-content: flex-end;
    }

    .mobile-search, .mobile-group.mobile-only {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
    }

    .mobile-group {
        margin-top: 10px;
    }

    #menu {
        display: none;
        width: 100%;
    }

    #menu.active {
        display: block;
        width: 100%;
        background: white;
        border: 1px solid #ddd;
        border-radius: 5px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    #menu ul li,
    #menu ul li a {
        width: 100%;
    }

    /* Všechny bannery collapsnuté */
    DIV.banner {
        width: 100%;
        border-radius: 0;
        margin-bottom: 1px;
        overflow: hidden;

        & FORM {
            margin: 18px;
        }
    }

    DIV.banner-mobile-left {
        width: calc(50% - 2px);
        border-right: 2px solid white;
    }

    DIV.banner-mobile-right {
        width: 50%;
    }

    DIV.banner IMG.istravne, DIV.banner IMG.skolaOnline {
        border-top: 1px solid lightgrey;
        border-bottom: 1px solid lightgrey;
    }

    .banner h2 {
        cursor: pointer;
        margin: 0;
        padding: 15px 20px;
        background: linear-gradient(to bottom, #48c2e7, #0C75C2);
        color: white;
        position: relative;
        font-size: 14px;
    }

    /* Vyhledávání s ikonkou lupy */

    .banner.search {
        width: calc(100% - 62px);
        height: 59px;
        background: linear-gradient(to bottom, #d3d3d3, #adadad);
        margin-bottom: 0;
    }

    .banner.search H2:before {
        content: '';
        display: inline-block;
        width: 16px;
        height: 16px;
        background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDE2IDE2IiBmaWxsPSJub25lIj4KICA8cGF0aCBkPSJNMTEuNzQyIDEwLjM0NGE2LjUgNi41IDAgMSAwLTEuMzk3IDEuMzk4aC0uMDAxYy4wMy4wNC4wNjIuMDc4LjA5OC4xMTVsMy44NSAzLjg1YTEgMSAwIDAgMCAxLjQxNS0xLjQxNGwtMy44NS0zLjg1YTEuMDA3IDEuMDA3IDAgMCAwLS4xMTUtLjF6TTEyIDYuNWE1LjUgNS41IDAgMSAxLTExIDAgNS41IDUuNSAwIDAgMSAxMSAweiIgZmlsbD0id2hpdGUiLz4KPC9zdmc+');
        background-size: contain;
        background-repeat: no-repeat;
        margin-right: 10px;
        vertical-align: middle;
    }

    /* TITULKA Tabulky */
    #includovanyObsah {

        & .container {
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            margin: 0 -5px;
            padding: 0 5px;

            & TABLE, & table {
                border-collapse: collapse !important;
                min-width: 250px;
                text-wrap: wrap;
                margin: 0 auto;
            }

            & p img {
                width: 100% !important;
                height: auto;
                object-fit: contain !important;
            }

            &.uvod {
                display: flex;
                flex-direction: column;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                margin: 0 -5px;
                padding: 0 5px;
            }
        }

        & .section .container {
            overflow-x: auto;

            & table {
                min-width: 250px;
                text-wrap: wrap;
            }
        }
    }

    #zapati {
        margin: 20px 0;
        padding: 0 0 20px 0;

        & .zapati-text {
            flex-direction: column;
            align-items: center;
        }

        & .mobile-group {
            & DIV.banner {
                margin-bottom: 0;
                background: linear-gradient(to bottom, #eeeeee, #e3e3e3);

                &.banner-mobile-left h2 {
                    border-right: 1px solid white;
                }

                & IMG {
                    margin: 0;
                }
            }
        }
    }
}

/* ================================ UTILITY CLASSES ================================ */

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

/* Focus styles */
.mobile-menu-toggle:focus,
.banner h2:focus {
    outline: 2px solid #0C75C2;
    outline-offset: 2px;
}

/*  ================================ BREAKPOINTS VISIBILITY ================================  */
@media screen and (min-width: 1001px) {
    .mobile-only {
        display: none;
    }

    .tablet-only {
        display: block;
    }
}

@media screen and (max-width: 1000px) {
    .mobile-only {
        display: none;
    }

    .tablet-only {
        display: block;
    }
}

@media screen and (max-width: 576px) {
    .mobile-only {
        display: block;
    }

    .tablet-only {
        display: none;
    }
}
