/* Responsive refinements loaded after frontend.css. */
html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    overflow-x: hidden;
}

img,
svg,
video,
iframe {
    max-width: 100%;
}

.hero-alhasyimi {
    margin-top: 0;
}

.navbar-account-actions {
    display: flex;
    align-items: center;
}

.news-card {
    display: block;
    color: inherit;
}

.gallery-home-empty {
    grid-column: 1 / -1;
    padding: 42px;
    border: 2px dashed #d8e3dc;
    border-radius: 12px;
    color: #6b7c73;
    text-align: center;
}

.gallery-home-empty i {
    display: block;
    margin-bottom: 10px;
    color: var(--green);
    font-size: 2.4rem;
}

.gallery-home-empty p { margin: 0; }
.slider-position-top { object-position: center top !important; }
.slider-position-center { object-position: center center !important; }
.slider-position-bottom { object-position: center bottom !important; }

.footer-modern-grid {
    grid-template-columns: 1.35fr .72fr 1fr .78fr 1.55fr;
    gap: 28px;
    padding-top: 42px;
    padding-bottom: 32px;
}

.footer-section {
    min-width: 0;
}

.footer-section h5 {
    padding-bottom: 9px;
    border-bottom: 1px solid rgba(255, 255, 255, .14);
}

.footer-identity > p {
    max-width: 270px;
    margin-top: 18px;
    color: #d9eee2;
    line-height: 1.75;
}

.footer-social-list {
    display: grid;
    gap: 8px;
}

.footer-social-list a {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .08);
    transition: .2s;
}

.footer-social-list a:hover {
    background: rgba(255, 255, 255, .16);
    color: #fff;
}

.footer-social-list i {
    width: 22px;
    color: var(--gold);
    font-size: 1rem;
    text-align: center;
}

.footer-contact-list {
    margin-bottom: 15px;
}

.footer-contact-list p {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 10px;
}

.footer-contact-list i {
    flex: 0 0 18px;
    margin-top: 2px;
    color: var(--gold);
    text-align: center;
}

.footer-map-modern {
    position: relative;
    overflow: hidden;
    border-radius: 11px;
}

.footer-map-modern iframe,
.footer-map-modern .map-placeholder {
    display: grid;
    width: 100%;
    height: 145px;
    border: 0;
    place-items: center;
}

.footer-map-modern > a {
    position: absolute;
    right: 10px;
    bottom: 10px;
    margin: 0;
    padding: 7px 11px;
    border-radius: 7px;
    background: rgba(0, 75, 44, .94);
    color: #fff;
    font-weight: 700;
}

.ppdb-notification-section {
    padding: 24px 0;
    background: #f5f8f6;
}

.ppdb-notification {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 20px 24px;
    border: 1px solid #cfe5d8;
    border-left: 5px solid #008b4a;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 9px 26px rgba(26, 70, 47, .08);
}

.ppdb-notification.is-closed {
    border-color: #eadba8;
    border-left-color: #d5a018;
    background: #fffdf5;
}

.ppdb-notification-icon {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 50%;
    background: #e8f7ee;
    color: #008b4a;
    font-size: 1.45rem;
}

.ppdb-notification.is-closed .ppdb-notification-icon {
    background: #fff3cc;
    color: #b77c00;
}

.ppdb-notification-copy span,
.ppdb-notification-copy strong {
    display: block;
}

.ppdb-notification-copy span {
    margin-bottom: 2px;
    color: #008b4a;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .1em;
}

.ppdb-notification-copy strong {
    color: #173e2b;
    font-size: 1rem;
}

.ppdb-notification-copy p {
    margin: 3px 0 0;
    color: #687970;
    font-size: .82rem;
}

.ppdb-notification-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    padding: 10px 17px;
    border-radius: 8px;
    background: #00683c;
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
    white-space: nowrap;
}

.ppdb-notification-action:hover {
    background: #004e2d;
    color: #fff;
}

.news-card,
.unit-card,
.welcome-grid > *,
.footer-main > * {
    min-width: 0;
}

.leader-photo {
    position: relative;
    width: min(100%, 360px);
    justify-self: center;
    background: #f1f4f2;
}

.leader-photo-media {
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
}

.leader-photo-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.leader-photo-caption {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2;
    padding: 40px 16px 16px;
    background: linear-gradient(transparent, rgba(0, 55, 32, .92));
    color: #fff;
    text-align: center;
}

.leader-photo-caption strong,
.leader-photo-caption span {
    display: block;
}

.leader-photo-caption strong {
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
}

.leader-photo-caption span {
    margin-top: 3px;
    color: #e4f3ea;
    font-size: .75rem;
}

.news-body h3,
.unit-card h3,
.unit-card p,
.footer p,
.footer a {
    overflow-wrap: anywhere;
}

@media (min-width: 992px) {
    .hero-alhasyimi {
        height: 460px;
        margin-top: 40px;
    }

    .unit-section {

        padding-top: 20px;
    }
}

@media (min-width: 1200px) {
    .site-navbar .container,
    .hero-content,
    .welcome-section .container,
    .unit-section .container,
    .stats-section .container,
    .news-section .container,
    .ppdb-banner .container,
    .footer .container {
        max-width: 1240px;
    }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .hero-alhasyimi {
        height: 400px;
    }

    .hero-content h1 {
        font-size: clamp(3rem, 7vw, 4.5rem);
    }

    .welcome-grid {
        grid-template-columns: minmax(240px, .8fr) minmax(0, 1.2fr);
        gap: 28px;
    }

    .quote-card {
        grid-column: 1 / -1;
        min-height: auto;
    }

    .unit-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .unit-card {
        width: 100%;
        aspect-ratio: 1 / 1;
    }

    .unit-card:last-child {
        grid-column: 1 / -1;
        width: calc(50% - 7px);
        justify-self: center;
    }

    .news-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .news-img {
        height: 210px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        padding: 12px 0;
    }

    .stats-grid article {
        display: flex;
        min-height: 120px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        padding: 16px 10px;
        border: 1px solid rgba(255, 255, 255, .14);
        border-radius: 12px;
        background: rgba(255, 255, 255, .07);
        text-align: center;
    }

    .stats-grid article:last-child {
        grid-column: 1 / -1;
        width: calc(50% - 6px);
        justify-self: center;
    }

    .stats-grid i {
        grid-row: auto;
        font-size: 32px;
        line-height: 1;
    }

    .footer-main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-location {
        grid-column: 1 / -1;
    }

    .footer-map-modern iframe,
    .footer-map-modern .map-placeholder {
        height: 210px;
    }

    .footer-brand,
    .footer-map {
        grid-column: span 2;
    }

    .footer-map iframe,
    .map-placeholder {
        height: 190px;
    }
}

@media (max-width: 991.98px) {
    .navbar-spacer {
        height: 78px;
    }

    .site-navbar > .container {
        flex-wrap: wrap;
    }

    .site-navbar .navbar-collapse {
        max-height: calc(100vh - 78px);
        overflow-y: auto;
        border-top: 1px solid #e6ece8;
    }

    .site-navbar .navbar-nav {
        align-items: stretch !important;
    }

    .navbar .nav-link {
        margin: 0;
        padding: 11px 4px !important;
    }

    .navbar-account-actions,
    .navbar-account-actions .btn-ppdb {
        width: 100%;
    }

    .navbar-account-actions {
        margin-top: 12px;
        padding-bottom: 8px;
    }

    .ppdb-panel {
        align-items: stretch;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        padding: 12px 0;
    }

    .stats-grid article {
        display: flex;
        min-height: 120px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        padding: 16px 10px;
        border: 1px solid rgba(255, 255, 255, .14);
        border-radius: 12px;
        background: rgba(255, 255, 255, .07);
        text-align: center;
    }

    .stats-grid i {
        grid-row: auto;
        font-size: 32px;
        line-height: 1;
    }

    .stats-grid strong {
        margin-top: 3px;
        font-size: 24px;
    }

    .stats-grid span {
        font-size: 12px;
    }

    .stats-grid article:nth-child(2n) {
        border-right: 0;
    }

    .stats-grid article:last-child {
        grid-column: 1 / -1;
        width: calc(50% - 6px);
        justify-self: center;
        border-bottom: 0;
    }
}

@media (max-width: 767.98px) {
    .container {
        --bs-gutter-x: 2rem;
    }

    .navbar-spacer {
        height: 70px;
    }

    .site-navbar {
        min-height: 70px;
    }

    .brand-wrap {
        max-width: calc(100vw - 88px);
        gap: 8px;
    }

    .brand-wrap img {
        width: 44px;
        height: 44px;
        flex: 0 0 44px;
    }

    .brand-wrap span {
        min-width: 0;
    }

    .brand-wrap small,
    .brand-wrap strong {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .brand-wrap small {
        font-size: 8px;
    }

    .brand-wrap strong {
        font-size: clamp(17px, 6vw, 23px);
    }

    .navbar-toggler {
        padding: 5px 8px;
    }

    .site-navbar .navbar-collapse {
        max-height: calc(100vh - 70px);
    }

    .hero-alhasyimi {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
        background: #f1f4f2;
    }

    .hero-alhasyimi .carousel,
    .hero-alhasyimi .carousel-inner,
    .hero-alhasyimi .carousel-item {
        height: 100%;
    }

    .hero-alhasyimi .carousel-item {
        aspect-ratio: auto;
    }

    .hero-alhasyimi .carousel-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        background: #f1f4f2;
    }

    .hero-alhasyimi::after {
        display: block;
        background: linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, .94) 34%, rgba(255, 255, 255, .58) 62%, rgba(255, 255, 255, .18) 100%);
    }

    .hero-pattern {
        display: block;
        width: 58%;
    }

    .hero-content {
        display: block;
        width: 100%;
        text-align: left;
    }

    .hero-content span {
        font-size: 10px;
        letter-spacing: .025em;
    }

    .hero-content h1 {
        margin: 7px 0 5px;
        font-size: clamp(2rem, 9vw, 2.7rem);
        line-height: 1.05;
    }

    .hero-content p {
        max-width: 320px;
        margin: 0;
        font-size: 11px;
        line-height: 1.55;
    }

    .hero-actions {
        justify-content: flex-start;
        margin-top: 15px;
    }

    .hero-actions .btn {
        width: auto;
        padding: 9px 15px;
        font-size: 10px;
        box-shadow: 0 7px 15px rgba(0, 91, 54, .22);
    }

    .hero-alhasyimi .carousel-control-prev,
    .hero-alhasyimi .carousel-control-next {
        display: none;
    }

    .hero-alhasyimi .carousel-indicators {
        margin-bottom: 7px;
    }

    .hero-alhasyimi .carousel-indicators [data-bs-target] {
        width: 13px;
        height: 3px;
    }

    .leader-photo {
        width: 100%;
        max-width: 340px;
        margin: auto;
        border-radius: 12px;
        overflow: hidden;
    }

    .leader-photo-media {
        aspect-ratio: auto;
    }

    .leader-photo-media img {
        width: 100%;
        height: auto;
        display: block;
    }

    .carousel-control-prev,
    .carousel-control-next {
        width: 36px;
    }

    .welcome-section{
        padding: 23px;

    }
    .unit-section,
    .news-section {
        padding: 38px 0;
    }

    .welcome-grid,
    .unit-grid,
    .news-grid,
    .footer-main {
        grid-template-columns: minmax(0, 1fr);
    }

    .welcome-grid {
        gap: 24px;
    }

    .welcome-copy,
    .section-heading,
    .section-heading.text-start {
        text-align: center !important;
    }

    .welcome-copy h2::after,
    .section-heading h2::after {
        margin-right: auto;
        margin-left: auto;
    }

    .quote-card {
        min-height: auto;
        padding: 28px 20px;
    }

    .unit-card {
        grid-template-columns: 58px minmax(0, 1fr);
        gap: 14px;
        padding: 20px;
    }

    .unit-icon {
        font-size: 42px;
    }

    .unit-btn {
        justify-content: center;
        width: 100%;
    }

    .stats-section {
        padding: 20px 0;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        padding: 10px 0;
    }

    .stats-grid article {
        min-height: 112px;
        padding: 14px 8px;
        border: 1px solid rgba(255, 255, 255, .14);
    }

    .stats-grid article:last-child {
        width: calc(50% - 5px);
    }

    .stats-grid i {
        font-size: 34px;
    }

    .news-img {
        height: 220px;
    }

    .section-title-row {
        align-items: stretch;
    }

    .section-title-row .btn {
        width: 100%;
        justify-content: center;
    }

    .ppdb-banner {
        padding: 28px 0;
    }

    .ppdb-notification-section {
        padding: 18px 0;
    }

    .ppdb-notification {
        grid-template-columns: 48px minmax(0, 1fr);
        gap: 13px;
        padding: 18px;
    }

    .ppdb-notification-icon {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }

    .ppdb-notification-action {
        grid-column: 1 / -1;
        width: 100%;
    }

    .ppdb-panel,
    .ppdb-left {
        align-items: center;
        flex-direction: column;
        text-align: center;
    }

    .ppdb-left > i {
        width: 76px;
        height: 76px;
        font-size: 40px;
    }

    .ppdb-left h2 {
        font-size: 24px;
    }

    .ppdb-features {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .footer-main {
        gap: 24px;
        padding-right: 4px;
        padding-left: 4px;
    }

    .footer-modern-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 26px 18px;
        padding-top: 34px;
    }

    .footer-identity,
    .footer-social-section,
    .footer-location {
        grid-column: 1 / -1;
    }

    .footer-section,
    .footer-identity,
    .footer-location {
        text-align: left;
    }

    .footer-logo {
        justify-content: flex-start;
    }

    .footer-identity > p {
        margin-right: 0;
        margin-left: 0;
    }

    .footer-map-modern iframe,
    .footer-map-modern .map-placeholder {
        height: 190px;
    }

    .footer-social-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-brand,
    .footer-main > div {
        text-align: center;
    }

    .footer-logo,
    .footer-social {
        justify-content: center;
    }

    .footer-brand > p {
        margin-right: auto;
        margin-left: auto;
    }

    .footer-map iframe,
    .map-placeholder {
        height: 180px;
    }

    .ppdb-info-page,
    .ppdb-page,
    .gallery-public-page,
    .story-page {
        padding-top: 32px !important;
        padding-bottom: 45px !important;
    }

    .ppdb-info-hero {
        min-height: auto;
        padding: 30px 22px;
        border-radius: 18px;
    }

    .ppdb-info-content h1 {
        font-size: 2rem;
    }

    .ppdb-status-badge {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .ppdb-account-note {
        flex-direction: column;
        padding: 22px;
        text-align: center;
    }

    .gallery-public-page {
        padding-right: 0;
        padding-left: 0;
    }

    .gallery-filters {
        flex-wrap: nowrap;
        justify-content: flex-start;
        margin-right: calc(var(--bs-gutter-x) * -.5);
        margin-left: calc(var(--bs-gutter-x) * -.5);
        padding: 0 calc(var(--bs-gutter-x) * .5) 8px;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .gallery-filters a {
        flex: 0 0 auto;
    }

    .content-hero {
        padding: 42px 0;
    }

    .story-page {
        padding-right: 0;
        padding-left: 0;
    }
}

@media (max-width: 420px) {
    .container {
        --bs-gutter-x: 1.5rem;
    }

    .hero-alhasyimi {
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .btn-gold,
    .btn-green {
        padding-right: 16px;
        padding-left: 16px;
        font-size: 13px;
    }

    .hero-actions .btn.btn-green {
        width: auto;
        padding: 9px 15px;
        font-size: 10px;
    }

    .unit-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .unit-icon {
        margin: auto;
    }

    .news-img {
        height: 190px;
    }

    .ppdb-features {
        gap: 14px;
    }

    .ppdb-step-indicator small {
        max-width: 72px;
        text-align: center;
        line-height: 1.2;
    }

    .ppdb-step-indicator span {
        width: 38px;
        height: 38px;
    }

    .ppdb-steps::before {
        top: 18px;
    }
}
