/**
 * Portal web — responsif mobile & tablet
 */

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

html,
body {
    overflow-x: hidden;
    max-width: 100%;
}

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

/* —— Sticky header (topbar + logo + menu) —— */
@media (max-width: 991.98px) {
    .portal-site-header .navbar-collapse.show,
    .portal-site-header .navbar-collapse.collapsing {
        max-height: min(70vh, 520px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 575.98px) {
    .portal-site-header header > .container > .row {
        row-gap: 0.5rem;
    }

    .portal-site-header .portal-site-nav > .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* —— Topbar —— */
@media (max-width: 767.98px) {
    #topbar .topbar-row {
        row-gap: 0.35rem;
    }

    #topbar .topbar-social-col {
        padding-top: 0.15rem;
        padding-bottom: 0.35rem;
    }

    #topbar .sosmed {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.35rem;
    }

    #topbar .sosmed li a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 2rem;
        height: 2rem;
        padding: 0;
    }

    .topbar-ticker,
    .topbar-ticker__track {
        height: 40px;
    }

    .topbar-ticker__item {
        font-size: 0.75rem;
        padding: 0 0.5rem;
    }
}

/* —— Header —— */
@media (max-width: 991.98px) {
    header {
        padding: 1rem 0;
    }

    header > .container > .row {
        row-gap: 0.75rem;
    }

    .brand img {
        width: 52px;
        height: 52px;
    }

    .brand .brand-name h1 {
        font-size: clamp(0.875rem, 4vw, 1.125rem);
        line-height: 1.25;
    }

    .brand .brand-name h3 {
        font-size: clamp(0.6875rem, 3vw, 0.8125rem);
    }

    .searchbox .form-control {
        font-size: 0.9375rem;
        min-height: 42px;
    }

    .searchbox .btn-utama {
        min-height: 42px;
        padding: 0.4rem 0.85rem;
        font-size: 0.8125rem;
    }
}

/* —— Navbar —— */
@media (max-width: 991.98px) {
    .navbar > .container {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-end;
    }

    .navbar-toggler {
        margin: 0.4rem 0;
        padding: 0.45rem 0.65rem;
    }

    .navbar-collapse {
        flex-basis: 100%;
        width: 100%;
    }

    .navbar-dark .navbar-nav .nav-link {
        display: block;
        width: 100%;
        padding: 0.75rem 1rem;
        font-size: 0.9375rem;
    }

    .navbar .dropdown-menu {
        position: static;
        float: none;
        width: 100%;
        margin: 0;
        border-radius: 0;
        background: rgba(0, 0, 0, 0.15);
    }

    .navbar .dropdown-item {
        padding: 0.65rem 1.25rem;
        font-size: 0.875rem;
    }

    .navbar .portal-nav-dropdown {
        background: rgba(0, 0, 0, 0.15) !important;
        border: 0 !important;
        box-shadow: none !important;
        padding: 0.25rem 0.35rem !important;
    }

    .navbar .portal-nav-dropdown__item {
        color: #fff !important;
    }

    .navbar .portal-nav-dropdown__item:hover,
    .navbar .portal-nav-dropdown__item:focus,
    .navbar .portal-nav-dropdown__item.active {
        background: rgba(242, 200, 8, 0.22) !important;
        color: #fff !important;
    }
}

/* —— Section umum —— */
@media (max-width: 991.98px) {
    .section {
        padding-top: 2.5rem;
        padding-bottom: 2rem;
    }

    .section-title {
        margin-bottom: 1.5rem;
    }

    .section-title h2 {
        font-size: 1.375rem;
    }

    .section-title h2:after {
        margin-top: 1.75rem;
    }
}

@media (max-width: 575.98px) {
    .section {
        padding-top: 2rem;
        padding-bottom: 1.75rem;
    }

    .section-title h2 {
        font-size: 1.125rem;
    }

    .section-title h2:after {
        margin-top: 1.35rem;
        height: 2px;
    }
}

/* —— Hero slider beranda —— */
@media (max-width: 767.98px) {
    #hero-area:not(.portal-hero-slider--fullwidth) {
        --hero-slide-max-h: 220px;
    }

    #hero-area .slider-item-img {
        aspect-ratio: 16 / 9;
    }

    #hero-area .slider-item-content h2,
    #hero-pres .item-content h2 {
        font-size: 1.0625rem;
        font-weight: 800;
    }

    #hero-area .slider-item-content p,
    #hero-pres .item-content p {
        font-size: 0.8125rem;
        font-weight: 600;
        line-height: 1.45;
    }

    #hero-area:not(.portal-hero-slider--fullwidth) #slider-hero-nav .owl-prev,
    #hero-area:not(.portal-hero-slider--fullwidth) #slider-hero-nav .owl-next {
        padding: 0.45rem 0.75rem;
        font-size: 0.875rem;
        transform: translateY(-50%);
    }
}

/* —— Sambutan —— */
@media (max-width: 991.98px) {
    #sambutan {
        margin: 0;
    }

    #sambutan h2 {
        font-size: 1.25rem;
    }

    #sambutan h3 {
        font-size: 0.875rem;
        line-height: 1.45;
    }

    #sambutan p {
        font-size: 0.875rem;
        line-height: 1.55;
    }

    #sambutan .embed-responsive {
        margin-bottom: 0.5rem;
    }
}

/* —— Counter statistik —— */
@media (max-width: 399.98px) {
    .counts__grid > [class*="col-"] {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* —— Prestasi / ekstra / pendidik / alumni —— */
@media (max-width: 767.98px) {
    #hero-pres .item-img {
        aspect-ratio: 16 / 9;
        max-height: 220px;
    }

    .ekstra-home__intro {
        padding: 0.65rem 0.7rem;
    }

    body.portal-site .portal-eskul-card__title {
        font-size: 0.6875rem;
        padding: 0.35rem 0.3rem;
    }

    .pendidik-home__name {
        font-size: 0.5625rem;
        line-height: 1.25;
    }

    .pendidik-home__name .pendidik-home__title {
        white-space: normal;
    }

    .alumni-home__quote {
        font-size: 0.8125rem;
    }
}

/* —— Galeri home —— */
@media (max-width: 575.98px) {
    .home-galery__col {
        margin-bottom: 1.75rem;
    }

    .home-galery__title h2 {
        font-size: 1.125rem;
    }

    .home-galery__post {
        flex-direction: column;
        align-items: flex-start;
    }

    .home-galery__post-thumb {
        width: 100%;
        max-width: 100%;
        height: auto;
        min-height: 72px;
        aspect-ratio: 4 / 3;
    }

    .home-galery__post-thumb img {
        max-width: 100%;
        max-height: 100%;
        width: auto;
        height: auto;
        object-fit: contain;
    }
}

/* —— Footer —— */
@media (max-width: 767.98px) {
    .footer .footer-top {
        padding: 1.5rem 0 1rem;
    }

    .footer .footer-top-row {
        margin-left: -0.35rem;
        margin-right: -0.35rem;
    }

    .footer .footer-top-row > [class*="col-"] {
        padding-left: 0.35rem;
        padding-right: 0.35rem;
        margin-bottom: 0.85rem;
    }

    .footer .footer-top-row > .footer-info,
    .footer .footer-top-row > .footer-contact {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .footer .footer-top-row > .footer-links {
        flex: 0 0 50%;
        max-width: 50%;
        margin-bottom: 0.85rem;
    }

    .footer .footer-top-row > .footer-contact {
        margin-bottom: 0;
        padding-top: 0.35rem;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
    }

    .footer .footer-top .footer-info {
        text-align: center;
    }

    .footer .footer-top .footer-info .logo {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        text-align: left;
        gap: 0.55rem;
        margin-bottom: 0.55rem;
    }

    .footer .footer-top .footer-info .logo img {
        width: 44px;
        height: 44px;
        max-width: 44px;
        max-height: 44px;
        margin-right: 0;
    }

    .footer .footer-top .footer-info .logo span {
        font-size: 0.75rem;
        line-height: 1.3;
        max-width: none;
        flex: 0 1 auto;
    }

    .footer .footer-top .footer-info p {
        max-width: 100%;
        margin: 0 auto 0.55rem;
        font-size: 0.6875rem;
        line-height: 1.4;
    }

    .footer .footer-top .footer-info p strong {
        font-weight: 600;
    }

    .footer .footer-social {
        justify-content: center;
        gap: 0.35rem;
        margin-bottom: 0;
    }

    .footer .footer-social a {
        width: 32px;
        height: 32px;
        font-size: 0.875rem;
    }

    .footer .footer-top .footer-links {
        text-align: left;
    }

    .footer .footer-top .footer-contact {
        text-align: center;
    }

    .footer .footer-top h4 {
        font-size: 0.75rem;
        margin-bottom: 0.45rem;
        padding-bottom: 0.4rem;
    }

    .footer .footer-top .footer-links h4 {
        display: block;
        text-align: left;
    }

    .footer .footer-top .footer-contact h4 {
        display: inline-block;
        text-align: center;
    }

    .footer .footer-top .footer-links h4::after {
        left: 0;
        transform: none;
        width: 24px;
        height: 2px;
    }

    .footer .footer-top .footer-contact h4::after {
        left: 50%;
        transform: translateX(-50%);
        width: 28px;
        height: 2px;
    }

    .footer .footer-top .footer-links ul {
        display: block;
        margin: 0;
        min-width: 0;
    }

    .footer .footer-top .footer-links ul li {
        padding: 0.28rem 0;
    }

    .footer .footer-top .footer-links ul .footer-link-chevron {
        min-width: 10px;
        padding-right: 0.25rem;
        font-size: 0.75rem;
        color: #f2c808;
    }

    .footer .footer-top .footer-links ul a {
        font-size: 0.75rem;
        line-height: 1.25;
    }

    .footer-map {
        max-width: 100%;
        margin: 0;
    }

    .footer-map iframe {
        min-height: 140px;
        height: 140px;
    }

    .footer .copyright {
        font-size: 0.6875rem;
        padding: 10px 0.5rem;
        line-height: 1.45;
    }
}

@media (max-width: 399.98px) {
    .footer .footer-top .footer-info .logo span {
        font-size: 0.6875rem;
    }

    .footer .footer-top .footer-info p {
        font-size: 0.625rem;
    }

    .footer-map iframe {
        min-height: 120px;
        height: 120px;
    }
}

/* —— Halaman dalam (portal-pages) —— */
@media (max-width: 991.98px) {
    body .portal-page {
        padding: 1rem 0 2rem;
    }

    body .portal-page-hero {
        padding: 1rem 1.1rem;
    }

    body .portal-page-layout > [class*="col-"] {
        margin-bottom: 1rem;
    }

    body .portal-page-panel {
        padding: 1rem 1.1rem;
    }
}

@media (max-width: 575.98px) {
    body .portal-page-hero__title {
        font-size: 1.125rem;
    }

    body .portal-page-list-card {
        flex-direction: column;
    }

    body .portal-page-list-card__thumb {
        width: 100%;
        max-width: 100%;
    }

    body .portal-page-list-card__thumb img {
        width: 100%;
        height: auto;
        max-width: 100%;
        max-height: none;
        object-fit: contain !important;
    }

    body .portal-kepsek-card {
        text-align: center;
    }

    body .portal-kepsek-card__avatar-wrap {
        margin-top: -2.5rem;
    }

    body .portal-kepsek-card__avatar {
        width: 4.75rem;
        height: auto;
        aspect-ratio: 3 / 4;
        object-fit: contain;
    }
}

/* —— SPMB banner home —— */
@media (max-width: 575.98px) {
    #spmb .spmb-portal-banner__img {
        max-height: 200px;
    }

    #spmb .spmb-portal-banner__btn {
        width: 100%;
        max-width: 280px;
    }
}
