/**
 * Homepage & shared public layout — responsive across all screen sizes.
 */

/* ── Global spacing & typography ── */
@media (max-width: 991.98px) {
    section.py-5 {
        padding-top: 2.75rem !important;
        padding-bottom: 2.75rem !important;
    }
}

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

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    h2.display-5,
    h2.display-6,
    .display-5,
    .display-6 {
        font-size: clamp(1.35rem, 5.5vw, 1.85rem) !important;
        line-height: 1.25;
    }

    .mb-5 {
        margin-bottom: 1.75rem !important;
    }
}

/* ── Top bar ── */
@media (max-width: 575.98px) {
    .top-bar {
        padding: 0.4rem 0;
    }

    .top-bar-dept {
        font-size: 0.68rem;
        letter-spacing: 0.02em;
    }

    .top-bar-motto {
        font-size: 0.72rem;
        letter-spacing: 0.04em;
    }

    .helpline-chip.emergency {
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem;
        gap: 0.35rem;
    }

    .helpline-chip.emergency span:not(.num) {
        display: none;
    }
}

/* ── Navbar (mobile menu) ── */
@media (max-width: 991.98px) {
    .navbar .navbar-nav {
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: stretch !important;
        gap: 0.15rem;
        padding: 0.75rem 0 1rem;
    }

    .navbar .nav-item {
        width: 100%;
    }

    .navbar .nav-link {
        padding: 0.65rem 0.85rem;
        border-radius: 8px;
    }

    .navbar .nav-link:hover {
        background: rgba(255, 255, 255, 0.08);
    }

    .navbar .dropdown-menu {
        position: static !important;
        float: none;
        width: 100%;
        margin: 0.25rem 0 0.5rem;
        box-shadow: none;
        border: 1px solid rgba(255, 255, 255, 0.12);
        background: rgba(0, 0, 0, 0.15);
    }

    .navbar .dropdown-item {
        padding: 0.55rem 1rem;
        white-space: normal;
    }

    .navbar-toggler {
        margin-left: auto;
    }
}

/* ── Hero ── */
.hero-section {
    min-height: 320px;
}

.hero-slider,
.hero-slider .swiper-wrapper,
.hero-slider .swiper-slide {
    height: 100% !important;
    min-height: inherit;
}

@media (max-width: 1199.98px) {
    .hero-section {
        height: clamp(360px, 62vh, 520px) !important;
    }
}

@media (max-width: 575.98px) {
    .hero-section {
        height: clamp(320px, 52vh, 420px) !important;
        min-height: 300px;
    }

    .hero-content {
        width: calc(100% - 1.5rem);
        margin: 0 auto;
    }

    .swiper-pagination {
        bottom: 8px !important;
    }
}

/* ── Glance / stats ── */
@media (max-width: 991.98px) {
    #glance .row.g-5 {
        --bs-gutter-y: 1.5rem;
    }
}

@media (max-width: 575.98px) {
    #glance .stat-card {
        min-height: 150px;
        padding: 1.25rem !important;
    }

    #glance .stat-card i.fa-3x {
        font-size: 2rem !important;
        margin-bottom: 0.75rem !important;
    }

    #glance .stat-card h2 {
        font-size: 1.5rem !important;
    }

    #glance .stat-card p {
        font-size: 0.85rem;
    }

    #glance .card-body.p-4 {
        padding: 1.25rem !important;
    }

    #glance .igp-excerpt {
        padding-left: 0 !important;
        padding-right: 0 !important;
        font-size: 0.95rem;
    }
}

/* ── Online services ── */
@media (max-width: 575.98px) {
    #online-services .service-card {
        padding: 1.25rem !important;
    }

    #online-services .service-card h5 {
        font-size: 1.05rem;
    }
}

/* Disable pulse animation on small screens (layout jitter) */
@media (max-width: 991.98px) {
    .service-card {
        animation: none !important;
    }
}

/* ── News ── */
@media (max-width: 575.98px) {
    .home-news-image {
        height: 180px;
    }

    .home-news-body {
        padding: 1rem 1.1rem 1.25rem;
    }

    .home-news-title {
        font-size: 1rem;
    }
}

/* ── Initiatives ── */
@media (max-width: 575.98px) {
    .home-initiative-image {
        height: 150px;
    }

    .home-initiative-body {
        padding: 1rem;
    }
}

/* ── Mobile apps ── */
@media (max-width: 575.98px) {
    #mobile-apps .app-card-image {
        height: 180px;
    }

    #mobile-apps .app-card {
        padding: 1rem !important;
    }

    #mobile-apps .app-card h5 {
        font-size: 1rem;
    }
}

/* ── Divisions ── */
@media (max-width: 575.98px) {
    .division-mobile-grid .col-sm-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .division-card .card-img-wrapper {
        height: 130px;
    }

    .division-title {
        font-size: 1rem;
    }
}

/* ── Notices ── */
@media (max-width: 575.98px) {
    .home-notice-box {
        min-height: auto;
        padding: 1.1rem 1.15rem 1.2rem;
    }

    .home-notice-box-title {
        font-size: 1rem;
    }

    .home-notice-box-actions {
        flex-direction: column;
    }

    .home-notice-box-actions .btn {
        width: 100%;
    }
}

/* ── Connect / social ── */
@media (max-width: 575.98px) {
    .home-connect-radio,
    .home-connect-social {
        padding: 1.25rem;
    }

    .home-connect-radio .btn-lg {
        width: 100%;
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }

    #connect .col-sm-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .social-tile {
        padding: 0.85rem 1rem;
    }
}

/* ── Locator / map ── */
@media (max-width: 991.98px) {
    #locator .map-container {
        height: clamp(280px, 45vh, 420px) !important;
    }
}

@media (max-width: 575.98px) {
    #locator .btn-lg {
        font-size: 0.82rem;
        padding: 0.55rem 0.5rem;
    }

    #locator .btn-lg i {
        margin-right: 0.25rem !important;
    }

    #locator .row.mb-4 {
        --bs-gutter-y: 0.5rem;
    }

    #results .card {
        margin-bottom: 0.75rem;
    }
}

/* ── Footer ── */
@media (max-width: 575.98px) {
    #site-footer {
        padding-top: 2.5rem !important;
        padding-bottom: 2rem !important;
    }

    #site-footer img {
        height: 56px !important;
    }
}

/* ── Touch devices: reduce hover motion ── */
@media (hover: none) and (pointer: coarse) {
    .service-card:hover,
    .stat-card:hover,
    .home-news-card:hover,
    .home-initiative-card:hover,
    .home-notice-box:hover,
    .app-card:hover,
    .division-card:hover {
        transform: none;
    }
}
