/* TotalCounts - responsive fixes
 * Overrides for the legacy NEXGEN landing page.
 */

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

img,
video,
iframe {
    max-width: 100%;
}

#map .modal-body {
    width: 100%;
    overflow: hidden;
}

#map iframe {
    display: block;
    width: 100% !important;
    max-width: 100%;
    height: min(70vh, 600px) !important;
    min-height: 320px;
    border: 0;
}

@media (max-width: 1199px) {
    .container.header {
        width: 100%;
        max-width: 100%;
        padding-left: 20px;
        padding-right: 20px;
    }

    header .navbar.sub .navbar-brand {
        flex-shrink: 0;
    }

    header .navbar.sub .navbar-brand .brand {
        font-size: 1.1rem;
    }
}

@media (max-width: 767px) {
    header .navbar.sub .container.header {
        min-height: 68px;
        padding-left: 15px;
        padding-right: 15px;
    }

    header .navbar-brand {
        max-width: calc(100vw - 150px);
        overflow: hidden;
        white-space: nowrap;
    }

    header .navbar-brand img {
        max-height: 32px;
        width: auto;
    }

    header .navbar-brand .brand {
        font-size: 1rem;
    }

    header .navbar.sub .navbar-nav.icons,
    header .navbar.sub .navbar-nav.toggle,
    header .navbar.sub .navbar-nav.action {
        flex-shrink: 0;
    }

    header .navbar.sub .navbar-nav.icons .nav-link,
    header .navbar.sub .navbar-nav.toggle .nav-link {
        padding-left: 8px;
        padding-right: 8px;
    }

    header .navbar.sub .navbar-nav.action {
        display: none !important;
    }

    body .full-slider .inner,
    body .no-slider .inner {
        padding: 0 20px;
    }

    body .full-slider .slide-content .inner .left,
    body .full-slider .slide-content .inner .right,
    body .full-slider .slide-content .inner .center,
    body .no-slider .slide-content .inner .left,
    body .no-slider .slide-content .inner .right,
    body .no-slider .slide-content .inner .center {
        width: 100%;
        max-width: 100%;
        padding: 2rem 0;
    }

    body .slide-content .title,
    body h1 {
        font-size: clamp(2.1rem, 9vw, 3rem);
        line-height: 1.08;
        margin-bottom: 1rem;
    }

    body .slide-content .description {
        font-size: .95rem;
        line-height: 1.55;
        max-width: 100%;
    }

    body .slide-content .buttons .d-sm-inline-flex {
        display: flex !important;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    body .slide-content .buttons .btn {
        min-width: 0;
        width: auto;
        max-width: 100%;
        margin: 0 !important;
    }

    body section {
        padding: 70px 0;
    }

    body .container,
    body .container.smaller {
        width: 100%;
        max-width: 100%;
        padding-left: 15px;
        padding-right: 15px;
    }

    body .intro {
        margin-bottom: 35px;
    }

    body h2 {
        font-size: clamp(1.8rem, 7vw, 2.3rem);
        line-height: 1.15;
    }

    body .intro p,
    body .text-max-800 {
        font-size: .95rem;
    }

    body .row.form-group-margin {
        margin-left: -8px;
        margin-right: -8px;
    }

    body .form-group-margin .input-group {
        padding: 8px !important;
    }

    body .contacts {
        margin-top: 35px;
    }

    body .contacts .nav-link {
        overflow-wrap: anywhere;
    }

    body footer .footer-left,
    body footer .footer-right {
        width: 100%;
    }

    body footer .items .item {
        margin-bottom: 25px;
    }

    body .modal-dialog {
        max-width: 100%;
        margin: 0;
    }

    body .modal-content {
        min-height: 100vh;
        border-radius: 0;
    }
}

@media (max-width: 576px) {
    header .navbar.sub .container.header {
        min-height: 62px;
    }

    header .navbar-brand {
        max-width: calc(100vw - 125px);
    }

    header .navbar-brand img {
        max-height: 28px;
    }

    header .navbar-brand .brand {
        font-size: .9rem;
    }

    header .navbar.sub .navbar-nav.icons .nav-link,
    header .navbar.sub .navbar-nav.toggle .nav-link {
        padding-left: 5px;
        padding-right: 5px;
    }

    body .full-slider .inner,
    body .no-slider .inner {
        padding: 0 16px;
    }

    body .full-slider .slide-content .inner .left,
    body .full-slider .slide-content .inner .right,
    body .full-slider .slide-content .inner .center,
    body .no-slider .slide-content .inner .left,
    body .no-slider .slide-content .inner .right,
    body .no-slider .slide-content .inner .center {
        padding: 1.5rem 0;
    }

    body .slide-content .description {
        font-size: .9rem;
    }

    body .slide-content .buttons .btn {
        width: 100%;
        min-width: 0;
    }

    body .square-image {
        min-height: 210px;
    }

    body .funfacts .item {
        margin-bottom: 35px;
    }

    body .funfacts .item:last-child {
        margin-bottom: 0;
    }

    body .contact .contacts {
        text-align: center;
    }

    body .contact .contacts .navbar-nav {
        align-items: center;
    }

    body .contact .contacts .nav-link {
        text-align: center;
    }

    #map iframe {
        height: 60vh !important;
        min-height: 280px;
    }
}

@media (max-width: 374px) {
    header .navbar-brand {
        max-width: calc(100vw - 110px);
    }

    header .navbar-brand .brand {
        font-size: .82rem;
    }

    body .slide-content .title,
    body h1 {
        font-size: 2rem;
    }

    body .slide-content .buttons .btn {
        font-size: .82rem;
        padding: 9px 16px;
    }
}

/* Mobile menu: force the custom dark panel above the legacy theme. */
#menu.modal {
    background: rgba(8, 13, 16, 0.72) !important;
}

#menu .modal-dialog,
#menu .modal-content,
#menu .modal-body.menu {
    background-color: #21333e !important;
    background-image: linear-gradient(
        145deg,
        #21333e 0%,
        #182832 55%,
        #101b22 100%
    ) !important;
}

#menu .modal-content {
    color: #ffffff !important;
    opacity: 1 !important;
    border: 0 !important;
}

#menu .modal-body.menu {
    min-height: calc(100vh - 82px);
}

#menu .menu .items,
#menu .menu .contacts {
    background: transparent !important;
}

#menu .menu .nav-link,
#menu .menu .nav-link:visited,
#menu .menu .nav-link i {
    color: #ffffff !important;
}

#menu .menu .nav-link:hover,
#menu .menu .nav-link:focus {
    color: #ffffff !important;
    background: rgba(255,255,255,0.06) !important;
}

@media (max-width: 767px) {
    #menu .modal-dialog,
    #menu .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 100vh;
        margin: 0 !important;
    }

    #menu .modal-content {
        border-radius: 0 !important;
    }
}

/* Mobile menu: dark glassmorphism */
#menu .modal-dialog {
    width: 100%;
    max-width: 100%;
}

#menu .modal-content {
    background: rgba(33, 51, 62, 0.48) !important;
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 18px 50px rgba(10, 25, 32, 0.28);
    color: #ffffff;
}

#menu .modal-header {
    color: #ffffff !important;
    padding: 22px 24px;
}

#menu .modal-header .icon-close {
    color: #ffffff;
    font-size: 28px;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

#menu .modal-header .icon-close:hover {
    color: #ffffff;
}

#menu .menu {
    background: transparent !important;
    color: #ffffff;
}

#menu .menu .items,
#menu .menu .contacts {
    background: transparent !important;
}

#menu .menu .nav-link:not(.btn),
#menu .menu .nav-link:not(.btn):visited {
    color: #ffffff !important;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

#menu .menu .nav-link:not(.btn):hover,
#menu .menu .nav-link:not(.btn):focus {
    color: #ffffff !important;
}

#menu .menu .nav-link {
    border-bottom-color: rgba(255, 255, 255, 0.10);
}

#menu .menu .nav-link i {
    color: #ffffff;
}

#menu .modal-content::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.10),
        rgba(33, 51, 62, 0.05) 45%,
        rgba(255, 255, 255, 0.02)
    );
}

#menu .modal-header,
#menu .modal-body {
    position: relative;
    z-index: 1;
}

@media (max-width: 576px) {
    #menu .modal-header {
        padding: 20px 18px;
    }

    #menu .menu .nav-link:not(.btn) {
        font-size: 1.35rem;
    }
}
/* Team: keep paired members aligned across the two desktop columns. */
@media (min-width: 768px) {
    .team .items > .col-md-6 > .row.item {
        min-height: 151px;
    }
}



/* Responsive menu: visible transparency over the page. */
@media (max-width: 767px) {
    #menu {
        background: rgba(33, 51, 62, 0.22) !important;
    }

    #menu .modal-dialog,
    #menu .modal-content {
        background-color: rgba(33, 51, 62, 0.48) !important;
    }

    #menu .modal-content {
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }

    .modal-backdrop.show {
        opacity: 0.18 !important;
    }
}

/* Homepage mobile: preserve the original hero images and keep the header
 * clear of the slide content. Desktop is intentionally untouched.
 */
@media (max-width: 767px) {
    body.home #slider.hero {
        position: relative;
        overflow: hidden !important;
        min-height: 620px !important;
        height: 620px !important;
        padding: 0 !important;
        background: #21333e;
    }

    body.home #slider.hero .swiper-container,
    body.home #slider.hero .swiper-wrapper,
    body.home #slider.hero .swiper-slide {
        position: relative;
        width: 100%;
        min-height: 620px !important;
        height: 620px !important;
    }

    body.home #slider.hero .swiper-slide {
        overflow: hidden;
    }

    body.home #slider.hero .swiper-slide > img.full-image {
        display: block !important;
        visibility: visible !important;
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        object-fit: cover !important;
        object-position: center !important;
        z-index: 0 !important;
    }

    body.home #slider.hero .slide-content {
        position: relative;
        z-index: 2 !important;
        min-height: 620px;
        height: 620px;
    }

    body.home #slider.hero .slide-content .inner {
        position: relative;
        z-index: 2 !important;
        width: 100%;
        min-height: 620px;
        padding: 105px 16px 45px !important;
        align-items: flex-start;
    }

    body.home #slider.hero .slide-content .inner .left,
    body.home #slider.hero .slide-content .inner .center,
    body.home #slider.hero .slide-content .inner .right {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }

    body.home #slider.hero .slide-content .title {
        font-size: clamp(2.05rem, 9vw, 2.7rem) !important;
        line-height: 1.08 !important;
        margin-top: 0 !important;
        margin-bottom: 1rem !important;
        max-width: 100% !important;
    }

    body.home #slider.hero .slide-content .description {
        max-width: 100% !important;
        margin-bottom: 1rem !important;
        font-size: .95rem !important;
        line-height: 1.5 !important;
    }

    body.home #slider.hero .slide-content .buttons .d-sm-inline-flex {
        width: 100%;
        align-items: stretch !important;
    }

    body.home #slider.hero .slide-content .buttons .btn {
        width: 100% !important;
        max-width: 100% !important;
        justify-content: center;
    }

    body.home #slider.hero .swiper-pagination {
        z-index: 5;
        bottom: 16px !important;
    }
}