/*
 * Responsivita (Fáze 6) — pouze mobilní/tabletové úpravy.
 *
 * Desktopový layout (style.css) zůstává beze změny; veškeré přepisy níže
 * jsou uzavřené v media queries, takže na ≥ 981px se nic nemění.
 * Breakpointy: 980px (tablet/mobil), 600px (malý mobil).
 */

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

/* ==========================================================================
   ≤ 980px — tablet a mobil
   ========================================================================== */
@media (max-width: 980px) {

    body {
        overflow-x: hidden;
    }

    .entry-content img,
    .entry-content iframe,
    .textwidget img {
        max-width: 100%;
        height: auto;
    }

    .dbs-wrapper {
        width: 100%;
        max-width: 960px;
        box-sizing: border-box;
        padding: 0 15px;
    }

    /* Hlavička: zrušit pevnou výšku rezervovanou pro absolutní nav/slider. */
    #dbs-header,
    #dbs-header.small,
    #dbs-content {
        width: 100%;
        height: auto;
        float: none;
    }

    #dbs-top-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: auto;
        margin: 15px 0 0 0;
    }
    #dbs-top-bar .dbs-left,
    #dbs-top-bar .dbs-right {
        float: none;
    }
    .dbs-logo img {
        max-width: 100%;
        height: auto;
    }

    /* ===== Mobilní navigace (hamburger) ===== */
    #dbs-nav-toggle {
        display: block;
        width: 100%;
        margin: 12px 0 0 0;
        padding: 14px 16px;
        border: 0;
        background-color: #589023;
        color: #fff;
        font-size: 15px;
        font-weight: bold;
        text-transform: uppercase;
        text-align: left;
        cursor: pointer;
    }
    .dbs-nav-toggle-bars {
        display: inline-block;
        width: 22px;
        height: 16px;
        margin-right: 12px;
        vertical-align: middle;
        position: relative;
    }
    .dbs-nav-toggle-bars span {
        display: block;
        position: absolute;
        left: 0;
        width: 100%;
        height: 2px;
        background-color: #fff;
        transition: transform .3s ease, opacity .3s ease;
    }
    .dbs-nav-toggle-bars span:nth-child(1) { top: 0; }
    .dbs-nav-toggle-bars span:nth-child(2) { top: 7px; }
    .dbs-nav-toggle-bars span:nth-child(3) { top: 14px; }

    /* Otevřeno (JS přepne aria-expanded): tři čáry → animovaný křížek (X). */
    #dbs-nav-toggle[aria-expanded="true"] .dbs-nav-toggle-bars span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    #dbs-nav-toggle[aria-expanded="true"] .dbs-nav-toggle-bars span:nth-child(2) {
        opacity: 0;
    }
    #dbs-nav-toggle[aria-expanded="true"] .dbs-nav-toggle-bars span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    #dbs-navigation {
        position: static;
        top: auto;
        left: auto;
        width: 100%;
        height: auto;
        margin: 0;
        background: none;
        z-index: auto;
    }

    /* Sbalené menu (rozbalí JS přidáním .dbs-nav-open na #dbs-navigation). */
    #dbs-navigation .main-menu {
        max-height: 0;
        overflow: hidden;
        background-color: #589023;
        transition: max-height .3s ease;
    }
    #dbs-navigation.dbs-nav-open .main-menu {
        max-height: 2000px;
    }

    .sf-menu,
    .sf-menu > li {
        float: none;
    }
    .sf-menu > li {
        height: auto;
    }
    .sf-menu > li a,
    .sf-menu > li > a:first-child {
        height: auto;
        line-height: 1.3;
        margin: 0;
        padding: 14px 16px;
        border-bottom: 1px solid rgba(255, 255, 255, .2);
    }

    .sf-menu > li:hover > a:after,
    .sf-menu > li.current-menu-item > a:before,
    .sf-menu > li.current-menu-ancestor > a:before {
        display: none;
    }

    /* Submenu na mobilu trvale rozbalené a odsazené (žádný hover). */
    .sf-menu ul,
    .sf-menu li:hover > ul,
    .sf-menu li.sfHover > ul {
        position: static;
        display: block;
        width: 100%;
        box-shadow: none;
        background-color: rgba(0, 0, 0, .12);
    }
    .sf-menu ul:before {
        display: none;
    }
    .sf-menu ul > li a {
        height: auto;
        line-height: 1.3;
        padding: 12px 16px 12px 34px;
        color: #6c6c6c;
        border-bottom: 1px solid rgba(255, 255, 255, .15);
    }

    /* Slider i mapa kontaktu z absolutního 1920px zpět do toku. */
    #dbs-widget-header {
        position: static;
        left: auto;
        width: 100%;
        height: auto;
        margin: 0;
    }
    #dbs-widget-header img,
    #dbs-widget-header iframe {
        max-width: 100%;
        height: auto;
    }
    #dbs-widget-header iframe {
        height: 320px;
    }

    #dbs-widget-header-small {
        position: static;
        width: 100%;
        height: auto;
    }
    #dbs-widget-header-small img {
        display: block;
        max-width: 100%;
        height: auto;
    }

    .dbisqspaces {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    .sqspace,
    .sqspace:last-child {
        float: none;
        width: 100%;
        max-width: 304px;
        height: auto;
        margin: 20px auto;
    }
    .sqspace img {
        max-width: 100%;
        height: auto;
    }

    .dbs-content-hp-1,
    .dbs-content-hp-2,
    .dbs-content-hp-3 {
        float: none;
        width: 100%;
        box-sizing: border-box;
        padding: 100px 4% 30px 4%;
    }
    .dbs-content-hp-wrap {
        margin: 30px 0;
        padding-bottom: 30px;
    }

    .dbs-contacts .textwidget,
    .dbs-contact-sidebar-1 .textwidget {
        flex-wrap: wrap;
    }
    .contact-box,
    .contact-box:nth-of-type(3) {
        flex-basis: 100%;
        margin: 0 0 30px 0;
    }
    .dbs-contact-sidebar-1 .textwidget div {
        flex-basis: 100%;
    }

    /* Tabulky v obsahu: vodorovný scroll místo přetékání layoutu. */
    .entry-content table {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
    }

    #dbs-footer {
        height: auto;
        padding: 40px 0;
        background-size: cover;
    }
    #dbs-footer-sub .dbs-left,
    #dbs-footer-sub .dbs-right,
    #dbs-footer-sub .dbs-ft-social {
        float: none;
        margin: 0 auto;
        text-align: center;
    }
    #dbs-footer-sub .dbs-to-top {
        margin: 15px auto 0 auto;
    }
}

/* ==========================================================================
   ≤ 600px — malý mobil
   ========================================================================== */
@media (max-width: 600px) {

    #dbs-widget-header iframe {
        height: 240px;
    }
    .dbs-content-hp-1,
    .dbs-content-hp-2,
    .dbs-content-hp-3 {
        padding-top: 90px;
    }
    h1 {
        font-size: 20px;
    }
    .entry-content {
        font-size: 14px;
    }
}

/* ==========================================================================
   ≤ 500px — extra malý mobil
   ========================================================================== */
@media (max-width: 500px) {
    .dbs-contact-fb, .dbs-contact-mail {
        display: none;
    }
}
