/* ==========================================================================
   Globe AHSC - public site responsive layer
   Loaded from components/navbar.blade.php, after each page's own CSS.
   Everything sits inside "screen" queries, so printed documents never change.
   Breakpoints follow Bootstrap 5: 576 / 768 / 992 / 1200.
   ========================================================================== */

/* --- All screens ---------------------------------------------------------- */
/* --- Keyboard and form usability ------------------------------------------- */
.skip-link {
    position: fixed;
    top: -60px;
    left: 12px;
    z-index: 2000;
    padding: 10px 16px;
    background: #7A0202;
    color: #FBD13A;
    font-weight: 600;
    border-radius: 0 0 8px 8px;
    transition: top .15s ease;
}
.skip-link:focus { top: 0; color: #FBD13A; }
[tabindex="-1"]:focus { outline: none; }
/* Jump targets stop below the fixed header instead of under it. */
#page-content,
header.fixed-top ~ [id] { scroll-margin-top: var(--site-header-h, 25vh); }
/* The logo keeps its shape (width follows the height set by the layout). */
.navbar .web-logo { width: auto; }

/* Visible ring only for keyboard users (mouse clicks stay unchanged). */
:is(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid #FBD13A;
    outline-offset: 2px;
    box-shadow: 0 0 0 5px #7A0202 !important;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: #7A0202;
    box-shadow: 0 0 0 .2rem rgba(122, 2, 2, .2);
}
.form-check-input:checked { background-color: #7A0202; border-color: #7A0202; }

/* --- News ticker (replaces the old <marquee>) ------------------------------ */
.news-ticker { overflow: hidden; white-space: nowrap; }
.news-ticker-track {
    display: inline-block;
    padding-left: 100%;
    white-space: nowrap;
    animation: news-ticker var(--ticker-duration, 40s) linear infinite;
}
.news-ticker:hover .news-ticker-track,
.news-ticker:focus-within .news-ticker-track { animation-play-state: paused; }
.news-ticker:focus-visible { outline: 2px solid #7A0202; outline-offset: -2px; }
@keyframes news-ticker {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}
@media (prefers-reduced-motion: reduce) {
    .news-ticker { overflow-x: auto; }
    .news-ticker-track { padding-left: 0; animation: none; }
}

@media screen {
    /* Fallback until the header script measures the real height. */
    :root { --site-header-h: 25vh; }

    html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

    /* Every page starts right below the fixed header, on every screen size. */
    header.fixed-top + * { margin-top: var(--site-header-h) !important; }
    header.fixed-top + #main-content { margin-top: 0 !important; }

    /* Those blocks used their own guess for the header height; it is no longer needed. */
    #pp-hero { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
    .dnt { padding-top: 1.5rem !important; }
    .exp { padding-top: 0 !important; }
    .af-hero { padding-top: 3rem !important; }
    #all-blogs-listing.py-5,
    #all-courses-listing.py-5,
    #all-partners-listing.py-5 { padding-top: 0 !important; }
    #all-blogs-listing .card.mt-5,
    #all-courses-listing .card.mt-5,
    #all-partners-listing .card.mt-5 { margin-top: 1.5rem !important; }

    /* About-section banners fit the first screen and their title stays readable. */
    body :is(#directormessage, #why-choose-us, #our-facilites, #quality-policy, #social-responsibility,
        #student-success-story, #accreditations-affiliations, #career-opportunites) {
        height: calc(100vh - var(--site-header-h));
        min-height: 320px;
        padding-top: 0 !important;
    }
    #aboutus > .container-fluid:first-child,
    #our-vision-mision > .container-fluid:first-child {
        height: calc(100vh - var(--site-header-h)) !important;
        min-height: 320px;
        padding-top: 0 !important;
    }
    body :is(#directormessage, #why-choose-us, #our-facilites, #quality-policy, #social-responsibility,
        #student-success-story, #accreditations-affiliations, #career-opportunites) h1,
    #our-vision-mision .step-1 h1,
    #aboutus .step-1 h1.main-heading {
        margin: 0 0 .35rem !important;
        padding-top: 0 !important;
        font-size: clamp(26px, 5.2vw, 96px) !important;
        line-height: 1.12;
        text-align: center !important;
        text-shadow: none !important;
        text-wrap: balance;
    }
    body :is(#directormessage, #why-choose-us, #our-facilites, #quality-policy, #social-responsibility,
        #student-success-story, #accreditations-affiliations, #career-opportunites) div:has(> h1),
    #our-vision-mision .step-1 > div:has(> h1) {
        max-width: calc(100% - 24px);
        margin-top: 0 !important;
        padding: clamp(12px, 2vw, 26px) clamp(16px, 3vw, 44px) !important;
        background: rgba(255, 255, 255, .84);
        border-radius: 12px;
        box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
    }
    #aboutus .step-1 h1.main-heading {
        max-width: calc(100% - 24px);
        margin: 0 !important;
        padding: clamp(12px, 2vw, 26px) clamp(16px, 3vw, 44px) !important;
        background: rgba(255, 255, 255, .84);
        border-radius: 12px;
        box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
    }
    body :is(#directormessage, #why-choose-us, #our-facilites, #quality-policy, #social-responsibility,
        #student-success-story, #accreditations-affiliations, #career-opportunites) .breadcrumb,
    #our-vision-mision .step-1 .breadcrumb { justify-content: center; margin-bottom: 0; }

    /* Vision page: intro card follows the banner instead of floating over it. */
    #our-vision-mision + .card.position-absolute {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        z-index: 2;
        width: min(92%, 1100px) !important;
        margin: -48px auto 0;
    }
    #our-vision-mision ~ .step-3 { padding-top: 2rem !important; }
    #our-vision-mision ~ .step-3 .col-md-12 { margin-top: 1rem !important; }
    footer .col-md-12 { margin-top: 0 !important; }

    /* Footer map stays inside its column on every screen (50vh was wider than the column on tall screens). */
    footer .card[style*="38vh"] { width: 100% !important; }
    footer .card.float-end { float: none !important; width: 100%; align-items: stretch !important; }
    footer .card.float-end > .card-body { width: 100%; }
    footer iframe { display: block; width: 100%; height: 100%; border: 0; }

    /* Facilities: the large photo never pushes the page wider than the screen. */
    body #our-facilites-product .product-img { width: 100%; max-width: 100%; }
    body #our-facilites-info .d-lg-flex > div { flex: 1 1 0; min-width: 0; }
    body #our-facilites-info .four-img { width: 100%; max-width: 100%; object-fit: cover; }

    /* All courses: a long course name no longer squashes the photo to nothing. */
    #all-courses-listing .col-md-3 > .card { height: auto !important; min-height: 100%; }
    #all-courses-listing .courses-img { flex: 0 0 auto; height: auto !important; aspect-ratio: 1 / 1; }
    #all-courses-listing .col-md-3 > .card > .card-body { flex: 0 0 auto; }
    #all-courses-listing .col-md-3 > .card > .card-body:has(> h6) { flex: 1 1 auto; }
    #all-courses-listing .col-md-3 > .card h6 {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        overflow: hidden;
    }

    #all-courses-listing .col-md-3 > .card .btn,
    #trending-courses .our-courses .btn { white-space: nowrap; }

    .slick-dots { left: 0; right: 0; max-width: 100%; padding: 0 !important; }

    /* Hero video always fills its frame (no blank band under it). */
    #main-content .card,
    #main-content .card-body { height: 100%; }
    #main-content video {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* The vh-based type scale stays readable on short or very tall screens. */
    .fze   { font-size: clamp(13px, 2vh, 22px); }
    .fze-2 { font-size: clamp(16px, 2.5vh, 27px); }
    .fze-1 { font-size: clamp(18px, 3vh, 32px); }
    .fze-3 { font-size: clamp(20px, 3.5vh, 38px); }
    .fze-4 { font-size: clamp(22px, 4vh, 44px); }
    .fze-5 { font-size: clamp(28px, 7vh, 76px); }
}

/* --- Phones, tablets and small laptops: compact header ----------------------- */
@media screen and (max-width: 1199.98px) {
    :root {
        --site-bar-notice: 34px;
        --site-bar-actions: 52px;
        --site-bar-nav: 64px;
        --site-header-h: calc(var(--site-bar-notice) + var(--site-bar-actions) + var(--site-bar-nav));
    }

    html, body { overflow-x: clip; }

    .fze   { font-size: 15px; }
    .fze-2 { font-size: 18px; }
    .fze-1 { font-size: 20px; }
    .fze-3 { font-size: 22px; }
    .fze-4 { font-size: clamp(21px, 3.4vw, 28px); }
    .fze-5 { font-size: clamp(27px, 6vw, 44px); }

    /* Notification strip */
    #notification-area { height: var(--site-bar-notice); overflow: hidden; }
    #notification-area > .row { flex-wrap: nowrap; height: 100%; margin: 0; }
    #notification-area .col-md-2 {
        display: flex;
        align-items: center;
        flex: 0 0 auto;
        width: auto;
        height: 100%;
        padding: 0 30px 0 12px !important;
    }
    #notification-area .col-md-2 h5 { font-size: 12.5px; white-space: nowrap; }
    #notification-area .col-md-10 { flex: 1 1 0; width: auto; min-width: 0; padding: 0 6px; }
    #notification-area .news-ticker { display: block; font-size: 13px; line-height: var(--site-bar-notice); white-space: nowrap; }

    /* Action buttons */
    #functional-area { height: var(--site-bar-actions); }
    #functional-area > .row {
        flex-wrap: nowrap;
        gap: 6px;
        height: 100%;
        margin: 0;
        padding: 7px 10px !important;
    }
    #functional-area > .row > .col-md-6 { flex: 1 1 auto; width: auto; min-width: 0; padding: 0; }
    #functional-area .d-flex { gap: 6px; height: 100%; }
    #functional-area .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 1 1 auto;
        height: 100%;
        margin: 0 !important;
        padding: 0 8px !important;
        font-size: 12.5px;
        line-height: 1;
        white-space: nowrap;
    }
    #functional-area .btn i { margin-right: 5px !important; }
    #functional-area .btn[data-bs-toggle="modal"] { flex: 0 0 42px; }
    #functional-area .btn[data-bs-toggle="modal"] i { margin-right: 0 !important; font-size: 17px; }

    /* Logo row */
    header .navbar { padding: 0; min-height: var(--site-bar-nav); }
    header .navbar > .container-fluid { min-height: var(--site-bar-nav); padding-inline: 12px !important; }
    header .navbar-brand { margin: 0; padding: 0; }
    .navbar .web-logo { display: block; height: 52px; width: auto; }
    header .navbar-toggler { padding: 7px 10px; border-color: #7A0202; box-shadow: none !important; }

    /* Slide-down menu */
    header .navbar-collapse {
        max-height: calc(100vh - var(--site-header-h));
        max-height: calc(100dvh - var(--site-header-h));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        border-top: 1px solid rgba(122, 2, 2, .15);
    }
    header .navbar-nav { margin: 0 !important; padding: 4px 0 12px; }
    header .navbar-nav .nav-item { border-bottom: 1px solid rgba(122, 2, 2, .1); }
    header .navbar-nav .nav-link { display: flex; justify-content: space-between; align-items: center; padding: 12px 4px; font-size: 15px; }
    header ._customdropdown > .nav-link::after {
        content: "\f107";
        font-family: "Font Awesome 6 Free";
        font-weight: 900;
        font-size: 13px;
    }
    header .nav-menu {
        position: static !important;
        width: 100% !important;
        min-height: 0 !important;
        max-height: none !important;
        margin: 0 0 8px !important;
        background: rgba(255, 255, 255, .75);
        box-shadow: none !important;
        overflow: visible !important;
    }
    header .nav-menu .col-md-4 { display: none; }
    header .nav-menu .col-md-8 { flex: 0 0 100%; width: 100%; max-width: 100%; max-height: none !important; overflow: visible !important; }
    header .nav-menu .row > .col { flex: 0 0 50%; max-width: 50%; }
    header .nav-menu .list-group-item { background: transparent; padding: 9px 10px; font-size: 14px; white-space: normal; }

    /* Compact when scrolled: only the logo row stays. */
    header.is-scrolled #notification-area,
    header.is-scrolled #functional-area { display: none; }

    /* Hero video sits below the header and keeps its 16:9 shape. */
    header.fixed-top + #main-content { margin-top: var(--site-header-h) !important; }
    #main-content { height: auto !important; aspect-ratio: 16 / 9; background: #111; }

    /* ---------- Shared content ---------- */
    img, video, iframe { max-width: 100%; }

    /* Carousel arrows stay inside the screen */
    .slick-prev { left: 2px; z-index: 2; }
    .slick-next { right: 2px; z-index: 2; }

    /* About-section banners: shorter on phones and tablets */
    body :is(#directormessage, #why-choose-us, #our-facilites, #quality-policy, #social-responsibility,
        #student-success-story, #accreditations-affiliations, #career-opportunites) {
        height: clamp(240px, 42vh, 440px);
        min-height: 0;
    }
    #aboutus > .container-fluid:first-child,
    #our-vision-mision > .container-fluid:first-child {
        height: clamp(260px, 46vh, 480px) !important;
        min-height: 0;
    }
    #aboutus > .container-fluid:first-child > div:nth-child(2) { height: auto !important; padding: 10px 12px; }
    #aboutus > .container-fluid:first-child .step-1 { height: calc(100% - 64px); background-position: center; }
    #aboutus > .container-fluid:first-child h2 { margin: 0; font-size: clamp(14px, 2.4vw, 20px) !important; text-align: center; }

    /* Footer: two columns, map fills its column */
    footer .row > .col-md-3 { flex: 0 0 50%; width: 50%; max-width: 50%; }
    footer .card.float-end { float: none !important; width: 100%; align-items: stretch !important; }
    footer .card.float-end > .card-body { width: 100%; }
    footer .card[style*="38vh"] { width: 100% !important; height: 280px !important; }
    footer .card[style*="38vh"] > .card-body { padding: 6px; }
    footer iframe { display: block; width: 100%; height: 100%; border: 0; }
    footer .d-flex:has(> #visitor-counter) { flex-wrap: wrap; gap: 8px; }
    footer .visitor-digit { padding: 4px 9px; }

    /* Home: stats */
    #welcome .card-body > .row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
    #welcome .card-body > .row > .col { width: auto; max-width: none; margin: 0 !important; padding: 0; }
    #welcome .card-body > .row > .col > .card { height: 100%; }

    /* Home: campus tour + notices */
    #social .card.mb-5 { margin-bottom: 1rem !important; }
    #social .gallery,
    #social .gallery .col { height: auto !important; }
    #social .gallery .col .gallery-img { display: block; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
    #social .gallery .col-md-4 { flex: 0 0 33.333%; width: 33.333%; max-width: 33.333%; padding: 4px !important; }
    #social .gallery .col-md-4 .card-body { padding: 0; }

    /* Home: trending courses */
    #trending-courses .our-courses .card { height: auto !important; }
    #trending-courses .courses-img { display: block; height: auto; aspect-ratio: 3 / 4; object-fit: cover; }
    #trending-courses .our-courses .card-body { flex: 0 0 auto; padding: 10px; }

    /* Home: popular stories */
    #videos { height: auto; }
    #videos .videos .card,
    #videos .videos .card img { height: auto; aspect-ratio: 16 / 9; }
    #videos .videos .card img { display: block; object-fit: cover; }

    /* Home: partners */
    #training-placement .carousel-item .card-body { min-height: 0 !important; padding: 8px; }
    #training-placement #carouselExampleFade .carousel-item img { height: 96px; object-fit: contain; }

    /* Home: recognition heading no longer floats over the logos */
    #recognition-membership .container-fluid > .card.position-absolute {
        position: static !important;
        width: 100% !important;
        height: auto !important;
        margin-bottom: 8px;
        clip-path: polygon(0 0, 100% 0, 97% 100%, 0 100%) !important;
    }
    #recognition-membership .container-fluid > .card.position-absolute .card-body { justify-content: flex-start !important; }

    /* Home: testimonials and blogs */
    #testimonials p.w-50 { width: 100% !important; }
    #latest-blogs .card-group { flex-flow: row wrap; gap: 14px; margin-top: 1.5rem !important; padding-inline: 0 !important; }
    #latest-blogs .card-group > .card {
        flex: 1 1 calc(33.333% - 14px);
        min-width: 220px;
        margin-inline: 0 !important;
        border-radius: 8px !important;
    }
}

/* --- Tablets ---------------------------------------------------------------- */
@media screen and (max-width: 991.98px) {
    #welcome .card-body > .row { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    #welcome .card-body > .row > .col { grid-column: span 2; }
    #welcome .card-body > .row > .col:nth-child(n+4) { grid-column: span 3; }

    #videos .card > .row { row-gap: 10px; padding-inline: 1.25rem !important; }
    #videos .col-md-2 {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
        justify-content: flex-start !important;
        padding: .9rem 2.5rem .9rem 1.25rem !important;
        clip-path: polygon(0 0, 96% 0, 100% 50%, 96% 100%, 0 100%) !important;
    }
    #videos .col-md-2 br { display: none; }
    #videos .col-md-10 { flex: 0 0 100%; width: 100%; max-width: 100%; }

    #aha-edge .aha-row-1,
    #aha-edge .aha-row-2 { flex-direction: column; }

    /* Listing pages: two cards per row on tablets */
    :is(#all-courses-listing, #all-blogs-listing, #all-partners-listing) .row > .col-md-3 {
        flex: 0 0 50%;
        width: 50%;
        max-width: 50%;
    }

    /* Facilities: photos in a tidy 2 x 2 grid */
    body #our-facilites-info .d-lg-flex { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    body #our-facilites-info .d-lg-flex > div { margin: 0 !important; }
    body #our-facilites-info .d-lg-flex .card-body { padding: 4px; }
    body #our-facilites-info .four-img { display: block; width: 100% !important; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
}

/* --- Phones ---------------------------------------------------------------- */
@media screen and (max-width: 767.98px) {
    :root {
        --site-bar-notice: 30px;
        --site-bar-actions: 78px;
        --site-bar-nav: 60px;
    }
    #notification-area .col-md-2 { padding: 0 24px 0 10px !important; }
    #notification-area .col-md-2 h5 { font-size: 11.5px; }
    #notification-area .news-ticker { font-size: 12px; }

    #functional-area > .row { flex-direction: column; gap: 4px; padding: 5px 6px !important; }
    #functional-area > .row > .col-md-6 { flex: 1 1 0; width: 100%; min-height: 0; }
    #functional-area .d-flex { gap: 4px; }
    #functional-area .btn { padding: 0 4px !important; font-size: 11.5px; }
    #functional-area .btn i { margin-right: 4px !important; font-size: 11px; }
    #functional-area .btn[data-bs-toggle="modal"] i { font-size: 15px; }

    .navbar .web-logo { height: 48px; }
    header .nav-menu .row > .col { flex: 0 0 100%; max-width: 100%; }

    /* Tighter page gutters */
    .container-fluid.p-5,
    .container.p-5 { padding-inline: 1rem !important; padding-bottom: 1.75rem !important; }
    .container-fluid.p-5:not([class*="pt-"]):not([class*="py-"]) { padding-top: 1.75rem !important; }
    .px-5 { padding-left: 1rem !important; padding-right: 1rem !important; }

    footer .row > .col-md-3 { flex: 0 0 100%; width: 100%; max-width: 100%; }
    footer .card-body.justify-content-center { justify-content: flex-start !important; }
    footer .col-md-12.justify-content-between { flex-direction: column; gap: 8px; text-align: center; }

    #welcome .card-body > .row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    #welcome .card-body > .row > .col,
    #welcome .card-body > .row > .col:nth-child(n+4) { grid-column: auto; }
    #welcome .card-body > .row > .col:last-child { grid-column: 1 / -1; }

    #social > .container-fluid > .row > .col-md-6 { padding-inline: 0 !important; }
    #social > .container-fluid > .row > .col-md-6:first-child { margin-bottom: 1.5rem; }

    #training-placement .carousel-item .row > .col-md-3 { flex: 0 0 50%; width: 50%; max-width: 50%; }

    #aha-edge .aha-main-title { font-size: 26px; letter-spacing: 1px; }
    #aha-edge .aha-subtitle { font-size: 14px; }
    #aha-edge .aha-card { padding: 20px 18px; }
    #aha-edge .aha-card-title { font-size: 20px; }
    #aha-edge .aha-card-left .aha-card-title,
    #aha-edge .aha-card-left .aha-card-desc,
    #aha-edge .aha-card-right .aha-card-title,
    #aha-edge .aha-card-right .aha-card-desc { padding-right: 0; }
    #aha-edge .aha-badge-container { display: none; }
    #aha-edge .aha-doctor-img { position: static; display: block; width: 120px; height: 140px; margin-top: 12px; }

    #latest-blogs .card-group > .card { flex-basis: 100%; }

    /* Listing pages: one card per row on phones */
    :is(#all-courses-listing, #all-blogs-listing) .row > .col-md-3 { flex: 0 0 100%; width: 100%; max-width: 100%; }

    /* Public notices: each notice becomes a small card, so the PDF button stays visible */
    .pn-table,
    .pn-table tbody { display: block; width: 100%; }
    .pn-table thead { display: none; }
    .pn-table tbody tr {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        column-gap: 12px;
        padding: 10px 12px;
        border-bottom: 1px solid rgba(122, 2, 2, .12);
    }
    .pn-table td { display: block; width: auto !important; padding: 0 !important; border: 0 !important; }
    .pn-table td:first-child,
    .pn-table td[colspan] { grid-column: 1 / -1; margin-bottom: 6px; }
    .pn-table td.pn-col-date { font-size: 13px; opacity: .75; }
    .pn-table td.pn-col-file { text-align: right; }

    /* Who We Are: smaller photo blocks */
    #aboutus .col-md-4.d-lg-flex { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0 8px !important; }
    #aboutus .col-md-4.d-lg-flex > div { padding: 0 !important; }
    #aboutus .ab-style-1,
    #aboutus .ab-style-2,
    #aboutus .ab-style-3 { height: 150px !important; border-radius: 10px; object-fit: cover; }
    #aboutus img[style*="height:80vh"],
    #aboutus img[style*="height:50vh"] { width: 100% !important; height: 280px !important; }
}

@media screen and (max-width: 359.98px) {
    #functional-area .btn:not([data-bs-toggle="modal"]) i { display: none; }
    #functional-area .btn { font-size: 11px; }
}
