/* =====================================================================
   DS — Responsive layer (mobile up to 767px, tablet 768px–1024px)
   Desktop (1025px+) is styled entirely by style.css. This file ONLY
   overrides inside max-width queries, so desktop stays untouched.
   ===================================================================== */

/* 0. Overflow guards: `width:100vw` counts the scrollbar and alone can
   create a few px of sideways scroll — 100% looks identical, no scroll. */
.ds-topbar,
.ds-jobbar {
    width: 100%;
    max-width: 100%;
}
img,
iframe,
video,
table {
    max-width: 100%;
}
.ds-footer-map,
.ds-contact-map {
    max-width: 100%;
}

/* ============ TABLET (<=1024px) + MOBILE shared fixes ============ */
@media (max-width: 1024.98px) {
    .ds-nav-inner {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: .5rem .75rem;
    }
    .ds-navbar .navbar-brand {
        flex: 1 1 auto;
        min-width: 0;
    }
    .ds-toggler {
        flex: 0 0 auto;
        margin-left: auto;
        min-width: 44px;
        min-height: 44px;
    }
    .ds-navbar .navbar-collapse {
        flex: 1 1 100%;
        min-width: 0;
    }
    .ds-navbar .navbar-nav {
        width: 100%;
        gap: .1rem;
    }
    .ds-navbar .navbar-nav .nav-link {
        padding: .65rem .25rem;
    }
    .ds-dropdown,
    .ds-dropdown-wide {
        width: calc(100% - 1.1rem);
        max-width: 100%;
        min-width: 0;
    }
    .ds-sublist {
        display: grid;
        gap: .1rem;
    }
    .ds-dropdown .dropdown-item {
        white-space: normal;
        overflow-wrap: anywhere;
    }
    .ds-nav-cta-wrap {
        justify-content: stretch;
        margin-top: .75rem;
    }
    .ds-nav-cta-wrap .ds-nav-cta {
        width: 100%;
        min-width: 0;
        justify-content: center;
    }
    .ds-footer-main-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .ds-footer-findus {
        grid-column: 1 / -1;
    }
    .ds-footer-findus .ds-footer-map {
        max-width: 640px;
    }
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
    .ds-assessors-scroll {
        overflow: auto;
        max-width: 100%;
    }
    .ds-slide-content {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}

/* Tablet-only (768px–1024px) */
@media (min-width: 768px) and (max-width: 1024.98px) {
    .section {
        padding: 4rem 0;
    }
    .ds-hero-slider {
        height: 62vh;
        min-height: 420px;
    }
    .ds-slide-headline {
        font-size: clamp(1.8rem, 4.6vw, 2.6rem);
        max-width: 560px;
    }
    .ds-jobbar-inner {
        padding: 0 .85rem;
        min-height: 34px;
    }
    .ds-jobbar-label {
        font-size: .68rem;
        padding: .28rem .55rem;
    }
    .ds-jobbar-text {
        font-size: .78rem;
    }
}

/* ============ MOBILE (up to 767px) ============ */
@media (max-width: 767.98px) {
    .ds-topbar.d-none.d-lg-block {
        display: block !important;
        padding: .45rem 0;
        font-size: .74rem;
    }
    .ds-topbar-inner {
        flex-wrap: wrap;
        justify-content: center;
        gap: .35rem .75rem;
        padding: 0 .75rem;
    }
    .ds-topbar-list {
        flex-wrap: wrap;
        justify-content: center;
        gap: .3rem .9rem;
    }
    .ds-topbar-right {
        flex-wrap: wrap;
        justify-content: center;
        gap: .45rem .75rem;
    }
    .ds-topbar-apply {
        padding: .25rem .7rem;
        font-size: .76rem;
    }
    .ds-jobbar { overflow: hidden; }
    .ds-jobbar-inner {
        gap: 0;
        min-height: 34px;
        padding: 0 .65rem;
    }
    .ds-jobbar-label {
        font-size: .62rem;
        padding: .25rem .45rem;
        margin-right: .5rem;
    }
    .ds-jobbar-text { font-size: .72rem; }
    /* Shared mobile fix (all pages): hero / first content section starts flush
       under the navbar. `sticky-top` + sub-pixel rounding can leave a hairline
       seam, and every hero keeps desktop top padding that reads as a blank
       band on phones (pale on light heroes, purple on dark heroes). Zero the
       hero's own top padding only; inner containers and bottom stacking keep
       their tuned values. Heights, images, text and positioning untouched;
       tablet/desktop unaffected. */
    #main > .ds-hero,
    #main > .ds-page-banner,
    #main > .ds-sector-hero,
    #main > .ds-assessor-hero,
    #main > .ds-staff-hero {
        margin-top: -1px;
        border-top: 0;
        padding-top: 0;
    }
    /* Assessor / staff / sector heroes have no tuned mobile container inset,
       so keep a minimal breathing room so the heading never touches the
       navbar. Page-banner variants keep their own tuned container padding. */
    #main > .ds-sector-hero > .container,
    #main > .ds-assessor-hero > .container,
    #main > .ds-staff-hero > .container {
        padding-top: 1rem;
    }
    .ds-hero,
    .ds-hero-slider {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }
    .ds-hero-slider {
        height: 460px;
        min-height: 440px;
        max-height: 500px;
    }
    /* Mobile ONLY: fill the hero with no letterbox. `cover` keeps the image
       large/prominent and removes the empty purple bands above/below;
       centred position keeps the crop balanced. Text/arrows/dots/layout
       untouched. */
    .ds-hero-slider,
    .ds-slide {
        background-color: var(--ds-primary-deep, #2B1B63);
    }
    .ds-slide img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: 50% 50%;
    }
    .ds-slide-content {
        justify-content: center;
        max-width: 100%;
        box-sizing: border-box;
        padding-top: 2rem;
        padding-bottom: 3rem;
    }
    .ds-slide-label {
        max-width: 100%;
        overflow-wrap: break-word;
        font-size: .68rem;
        letter-spacing: .1em;
    }
    .ds-slide-headline {
        overflow-wrap: break-word;
        text-wrap: balance;
        font-size: clamp(1.55rem, 7.4vw, 2.1rem);
        max-width: 100%;
    }
    .ds-slide-actions {
        margin-top: 1.4rem;
        width: 100%;
        max-width: 100%;
    }
    .ds-slide-actions .btn {
        flex: 1 1 100%;
        justify-content: center;
        max-width: 100%;
        white-space: normal;
    }
    .ds-slider-btn {
        width: 34px;
        height: 34px;
        font-size: .8rem;
    }
    .ds-slider-prev { left: .55rem; }
    .ds-slider-next { right: .55rem; }
    .ds-slider-dots { bottom: 1rem; }
    .ds-dot { width: 20px; }
    .ds-dot.is-active { width: 30px; }
    .section { padding: 3rem 0; }
    .ds-section-tight { padding: 2.5rem 0 3rem; }
    .ds-section-head { margin-bottom: 2rem; }
    .ds-head-split {
        flex-direction: column;
        align-items: flex-start;
    }
    .assessor-description { min-height: 0; }
    .ds-affil-grid-row2 .ds-affil-card:last-child:nth-child(odd) {
        grid-column: 1 / -1;
        width: 100%;
        max-width: 280px;
        margin-left: auto;
        margin-right: auto;
    }
    .ds-affil-card {
        min-height: 120px;
        padding: .65rem .5rem;
    }
    .ds-affil-logo-row1,
    .ds-affil-logo-row2 { max-height: 104px; }
    .ds-manuals-table,
    .ds-grm-table,
    .ds-posh-table { min-width: 600px; }
    .ds-manuals-table > thead > tr > th,
    .ds-manuals-table > tbody > tr > td { padding: .8rem .9rem; }
    .ds-manuals-actions { justify-content: flex-start; }
    .ds-form { padding: 1.5rem 1.15rem; }
    .ds-form .form-control { font-size: 1rem; }
    .ds-form .btn-ds {
        width: 100%;
        justify-content: center;
    }
    .ds-form input[type="file"] { max-width: 100%; }
    .ds-footer-main-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.75rem;
    }
    .ds-footer-about-text { max-width: none; }
    .ds-footer-findus .ds-footer-map {
        max-width: none;
        height: 200px;
    }
    .ds-contact-map { height: 220px; }
    .ds-footer-bottom .ds-footer-inner { align-items: flex-start; }
    .ds-footer-legal {
        flex-wrap: wrap;
        gap: .4rem 1.1rem;
    }
    .ds-backtotop {
        width: 42px;
        height: 42px;
        right: .9rem;
        bottom: calc(.9rem + env(safe-area-inset-bottom, 0px));
        font-size: 1rem;
    }
    #dsBackToTop {
        bottom: calc(.9rem + 42px + .55rem + env(safe-area-inset-bottom, 0px));
    }
    .ds-page-banner { padding: 2.75rem 0 2.5rem; }
    .ds-page-title {
        font-size: clamp(1.55rem, 6.6vw, 2rem);
        overflow-wrap: break-word;
    }
    .ds-page-lead { font-size: .98rem; }
    .ds-sector-body { padding: 2.5rem 0 3.5rem; }
    .ds-sector-hero__title {
        font-size: clamp(1.5rem, 6.8vw, 2rem);
        overflow-wrap: break-word;
    }
    .ds-sector-hero__lead { font-size: .98rem; }
    .ds-sector-role { min-width: 0; }
    .ds-cta-actions .btn,
    .ds-soon-actions .btn,
    .ds-faq-help-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Small phones (up to 575px) */
@media (max-width: 575.98px) {
    .ds-nav-inner {
        padding-left: 14px;
        padding-right: 14px;
    }
    .ds-jobbar-inner { padding: 0 .55rem; }
    .ds-jobbar-label {
        font-size: .58rem;
        padding: .22rem .4rem;
        margin-right: .45rem;
    }
    .ds-jobbar-text { font-size: .7rem; }
    .ds-form { padding: 1.25rem .95rem; }
    .ds-footer-inner {
        padding-left: 20px;
        padding-right: 20px;
    }
    .ds-affil-card { min-height: 112px; }
    .ds-affil-logo-row1,
    .ds-affil-logo-row2 { max-height: 92px; }
    .ds-lightbox { padding: .9rem .9rem 1.1rem; }
}

/* Very narrow devices (360px and below) */
@media (max-width: 389.98px) {
    .ds-brand-logo {
        height: 40px;
        max-width: 104px;
    }
    .ds-slide-actions .btn {
        padding: .8rem 1.2rem;
        font-size: .88rem;
    }
}
