/*
 * Responsive layer for the public website (loaded last on every page).
 * The legacy layout is a fixed 950px page; nothing here applies above 1000px,
 * so the desktop design stays exactly as it was.
 *
 *  ≤ 1000px  fluid page: boxes, banner, content, PDF viewer and footer fit the screen
 *  ≤  980px  mobile menu (☰ button + tap to open sub-menus)
 *  ≤  760px  one-column layouts, smaller headings
 *  ≤  480px  phones: tighter spacing
 */

/* Mobile menu controls are hidden on desktop */
.nav-toggle, .sub-toggle { display: none; }

@media (max-width: 1000px) {
    html { overflow-x: hidden; }   /* html only: on body it would turn the page into a nested scroll box */
    body { min-width: 0; }

    /* ---- page frame ---- */
    #rn_main_container { width: 100%; max-width: 974px; background-size: 100% auto; }
    #rn_main_container > .container,
    #rn_main_container > .container1 { width: auto; margin-left: 0; margin-right: 0; }
    .header, .header_top, .header_menu, .footer,
    .text_container, .animation_container, .scroller_container { width: 100% !important; }
    .header, .header_top { height: auto; }
    .header_top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; padding: 8px 12px 10px; box-sizing: border-box; }
    .logo { width: auto; height: auto; float: none; }
    .logo img { max-width: 100%; height: auto; display: block; }
    .header_top_right { width: auto; height: auto; float: none; margin: 0; }
    .header_top_right > div { float: none !important; width: auto !important; max-width: 100%; margin: 4px 0 !important; }
    .header_top_right span { white-space: normal; }
    .social_network_container { height: auto !important; padding: 5px 12px; border-radius: 20px; background: #00354e !important; }
    .social_network_container span { display: block; margin: 0 !important; line-height: 22px !important; font-size: 13px; }

    /* ---- inner page banner (jQuery cycle) ---- */
    .animation_container { height: auto !important; float: none; }
    .animation { width: 100% !important; height: auto !important; aspect-ratio: 950 / 300; position: relative; overflow: hidden; }
    .animation img { width: 100% !important; height: 100% !important; object-fit: cover; }

    /* ---- content area ---- */
    .text_container { height: auto !important; float: none; margin: 0 !important; }
    .text_container > .container,
    .text_container .container[style*="894px"] { width: auto !important; margin: 0 !important; padding: 20px 14px 20px; box-sizing: border-box; float: none; }
    .text_container [style*="879px"],
    .text_container [style*="894px"],
    .text_container [style*="950px"] { width: auto !important; }
    .container .top { width: auto !important; float: none; }
    .container .bottom, .bottom { width: auto !important; height: auto !important; float: none; }
    .text_container img { max-width: 100%; height: auto; }
    .text_container iframe { width: 100% !important; height: 75vh !important; min-height: 380px; }
    .text_container table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .text_container [style*="width"]:not(img):not(svg):not(iframe) { max-width: 100% !important; box-sizing: border-box; }
    .text_container pre { white-space: pre-wrap; }

    /* lists, pagination, footer */
    .doc-list { width: auto; }
    .site-footer { width: 100%; }
    .site-footer__cols { gap: 28px; padding: 26px 20px 20px; }

    /* contact page */
    .bottom .left { width: auto !important; height: auto !important; float: none !important; margin: 0 0 20px !important; }
    #contact_form { max-width: 100%; }
    #contact_form input[type="text"], #contact_form textarea, #contact_form select { max-width: 100%; box-sizing: border-box; }

    /* gallery */
    .catagory { width: calc(50% - 16px) !important; height: auto !important; margin: 8px !important; }
    .catagory img { width: 100%; height: auto; }
    .ad-gallery, .ad-gallery .ad-image-wrapper, .ad-gallery .ad-nav, .ad-gallery_container, #contentall, .bannerBox, .contentleftLook { width: 100% !important; max-width: 100%; }
    .ad-gallery .ad-image-wrapper .ad-image img { max-width: 100%; height: auto; }
}

/* ---------- Mobile menu ---------- */
@media (max-width: 980px) {
    .header_menu { height: auto !important; float: none; position: relative; z-index: 50; }
    .nav-toggle {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        padding: 12px 16px;
        border: 0;
        background: #00354e;
        color: #fff;
        font: bold 14px Arial, Helvetica, sans-serif;
        letter-spacing: 1px;
        text-transform: uppercase;
        cursor: pointer;
    }
    .nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
        display: block; width: 20px; height: 2px; background: #f2b705; position: relative; transition: transform .25s, background .25s;
    }
    .nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
    .nav-toggle__bars::before { top: -6px; }
    .nav-toggle__bars::after { top: 6px; }
    .nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
    .nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
    .nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

    #smoothmenu1 { display: none; background: #fff; box-shadow: 0 10px 24px rgba(0, 37, 55, .18); }
    #smoothmenu1.is-open { display: block; }
    #smoothmenu1 ul, #smoothmenu1 ul ul {
        float: none !important; margin: 0 !important; position: static !important;
        left: auto !important; top: auto !important; width: auto !important;
        visibility: visible !important; opacity: 1 !important; height: auto !important; overflow: visible !important;
        box-shadow: none !important;
    }
    #smoothmenu1 ul ul { display: none !important; background: #f3f7fa; }
    #smoothmenu1 li.is-open > ul { display: block !important; }
    #smoothmenu1 li { display: block !important; float: none !important; margin: 0 !important; padding: 0 !important; position: relative; border-top: 1px solid #e6edf2; }
    #smoothmenu1 li.menu-sep { display: none !important; }
    #smoothmenu1 li a,
    #smoothmenu1 ul li ul li a,
    #smoothmenu1 ul li ul li a.fin {
        width: auto !important; padding: 13px 56px 13px 18px !important;
        background: none !important; color: #00354e !important; font-size: 15px;
    }
    /* indent + shade each level (selectors must beat the "a.fin" rule above) */
    #smoothmenu1 ul li ul li a, #smoothmenu1 ul li ul li a.fin { padding-left: 34px !important; font-size: 14px; }
    #smoothmenu1 ul ul ul li a, #smoothmenu1 ul ul ul li a.fin { padding-left: 50px !important; }
    #smoothmenu1 ul ul ul ul li a, #smoothmenu1 ul ul ul ul li a.fin { padding-left: 66px !important; font-size: 13px; }
    #smoothmenu1 ul ul ul { background: #e8f0f5; }
    #smoothmenu1 ul ul ul ul { background: #dde8ef; }
    #smoothmenu1 ul ul li > a::before { content: "\203A"; position: absolute; margin-left: -14px; color: #c48f00; }
    #smoothmenu1 li a:active, #smoothmenu1 li a:hover { color: #c48f00 !important; }
    .ddshadow { display: none !important; }

    .sub-toggle {
        display: flex; align-items: center; justify-content: center;
        position: absolute; right: 6px; top: 5px;
        width: 40px; height: 36px; border: 0; border-radius: 4px;
        background: #eef4f8; color: #00354e; font-size: 20px; line-height: 1; cursor: pointer;
    }
    .sub-toggle::before { content: "+"; }
    li.is-open > .sub-toggle { background: #00354e; color: #f2b705; }
    li.is-open > .sub-toggle::before { content: "\2212"; }
}

/* ---------- One column ---------- */
@media (max-width: 760px) {
    .site-footer__cols { grid-template-columns: 1fr 1fr; }
    .site-footer__col--contact { grid-column: 1 / -1; }
    .site-footer__bottom { flex-direction: column; gap: 6px; text-align: center; padding: 14px 20px; }

    .text_container [style*="47.5%"], .text_container [style*="width:50%"], .text_container [style*="width: 50%"] {
        width: 100% !important; float: none !important;
    }
    .bottom img { width: auto !important; max-width: 100% !important; }

    .doc-item { gap: 12px; padding: 10px 12px 10px 10px; }
    .doc-item__title { font-size: 14px; }
    .catagory { width: calc(100% - 16px) !important; }
}

@media (max-width: 480px) {
    .logo img { max-width: 230px; }
    .header_top { padding: 8px 10px; }
    .site-footer__cols { grid-template-columns: 1fr; }
    .doc-item__badge { display: none; }
    .doc-item__tile { flex-basis: 54px; height: 60px; }
    .doc-item__day { font-size: 20px; }
    .rn-pagination a, .rn-pagination span.box { padding: 5px 7px; }
    .rn-pagination li:first-child a, .rn-pagination li:first-child span,
    .rn-pagination li:last-child a, .rn-pagination li:last-child span { font-size: 0; }
    .rn-pagination li:first-child a::before, .rn-pagination li:first-child span::before { content: "\2039"; font-size: 16px; }
    .rn-pagination li:last-child a::before, .rn-pagination li:last-child span::before { content: "\203A"; font-size: 16px; }
    .text_container iframe { height: 65vh !important; }
}

@media (prefers-reduced-motion: reduce) {
    .nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after { transition: none; }
}
