
/* =========================================================
   BA-PHALABORWA HOMEPAGE RESPONSIVE STYLES
   TABLET / IPAD TARGET
   Target: 992px - 1199.98px
   Example: 1032 x 1376

   IMPORTANT:
   Load this stylesheet AFTER all existing homepage CSS.
========================================================= */


/* =========================================================
   TABLET GLOBAL
========================================================= */

@media (min-width: 992px) and (max-width: 1199.98px) {

    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        overflow-x: clip;
    }

    .container {
        max-width: 960px;
    }

    .container-fluid {
        max-width: 100%;
    }


    /* =====================================================
       TOPBAR
    ===================================================== */

    .topbar {
        font-size: 11px;
    }

    .topbar .container {
        max-width: 960px;
    }

    .topbar-link {
        font-size: 11px;
        overflow-wrap: anywhere;
    }

    .topbar-social {
        font-size: 14px;
    }


    /* =====================================================
       STICKY HEADER
    ===================================================== */

    .municipality-sticky-header {
        position: sticky;
        top: 0;
        width: 100%;
        z-index: 9999;
        background: #FFFFFF;
    }


    /* =====================================================
       NAVBAR / TABLET NAVIGATION
    ===================================================== */

    .navbar {
        padding: 10px 0 !important;
        position: relative;
        z-index: 9999;
    }

    .navbar .container {
        max-width: 960px;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
    }

    /* Logo */

    .navbar-light .navbar-brand img {
        max-height: 65px;
        max-width: 165px;
        width: auto;
        object-fit: contain;
    }

    /* Hamburger */

    .navbar.navbar-expand-xl .navbar-toggler {
        display: block !important;
        padding: 8px 13px;
        margin-left: auto;
        border: 1px solid #1F368F;
        border-radius: 6px;
        color: #1F368F;
        background: #FFFFFF;
        position: relative;
        z-index: 10002;
    }

    .navbar.navbar-expand-xl .navbar-toggler:focus {
        box-shadow: 0 0 0 3px rgba(31, 54, 143, 0.15);
    }

    /* Collapse container */

    .navbar.navbar-expand-xl .navbar-collapse {
        flex-basis: 100%;
        width: 100%;
        position: relative;
        z-index: 10000;
    }

    /* Main navigation container */

    .navbar.navbar-expand-xl .navbar-nav {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        margin-top: 15px;
        margin-bottom: 0;
        padding: 8px;
        background: #F1F4F8;
        border-radius: 10px;
        position: relative;
        z-index: 10000;
    }

    /* Navigation items */

    .navbar.navbar-expand-xl .navbar-nav > .nav-item {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        padding: 0;
        width: 100%;
        position: relative;
    }

    /* Navigation links */

    .navbar.navbar-expand-xl .navbar-nav > .nav-item > .nav-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 13px 15px !important;
        font-size: 14px;
        font-weight: 600;
        color: #26382F;
        text-decoration: none;
        cursor: pointer;
        position: relative;
        z-index: 2;
    }

    .navbar.navbar-expand-xl .navbar-nav > .nav-item > .nav-link:hover {
        color: #1F368F;
        background: rgba(31, 54, 143, 0.05);
    }


    /* =====================================================
       DROPDOWN MENUS
       TABLET: CLICK TO OPEN
    ===================================================== */

    .navbar.navbar-expand-xl .nav-item.dropdown {
        position: relative;
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    /* Disable desktop hover animations */

    .navbar.navbar-expand-xl .nav-item:hover > .dropdown-menu {
        visibility: visible;
        opacity: 1;
        transform: none;
        margin-top: 0 !important;
    }

    /* Dropdown menu */

    .navbar.navbar-expand-xl .nav-item > .dropdown-menu {
        display: none;
        position: static !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: none !important;

        width: 100%;
        min-width: 0;
        max-width: 100%;

        margin: 0 !important;
        padding: 5px 0;

        background: #FFFFFF;
        border: none;
        border-left: 2px solid #1F368F;
        border-radius: 0 0 8px 8px;
        box-shadow: none;

        float: none;
        z-index: 10001;
    }

    /* Only show dropdown when Bootstrap opens it */

    .navbar.navbar-expand-xl .nav-item.dropdown.show > .dropdown-menu {
        display: block !important;
    }

    /* Dropdown items */

    .navbar.navbar-expand-xl .dropdown-menu > .dropdown-item {
        display: block;
        width: 100%;
        padding: 11px 18px;
        font-size: 13px;
        line-height: 1.5;
        color: #26382F;
        background: transparent;
        white-space: normal;
        text-decoration: none;
        cursor: pointer;
        position: relative;
        z-index: 2;
    }

    .navbar.navbar-expand-xl .dropdown-menu > .dropdown-item:hover,
    .navbar.navbar-expand-xl .dropdown-menu > .dropdown-item:focus {
        background: #1F368F;
        color: #FFFFFF;
    }

    /* Dropdown toggle */

    .navbar.navbar-expand-xl .dropdown-toggle {
        cursor: pointer;
    }

    /* Dropdown arrow */

    .navbar.navbar-expand-xl .dropdown-toggle::after {
        margin-left: 10px;
        flex-shrink: 0;
    }


    /* =====================================================
       DOCUMENTS DROPDOWN
    ===================================================== */

    .documents-dropdown {
        max-height: 350px;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }


    /* =====================================================
       DEPARTMENT NESTED SUBMENU
    ===================================================== */

    .navbar.navbar-expand-xl .dropdown-submenu {
        position: relative;
        display: block;
        width: 100%;
    }

    /* Department submenu trigger */

    .navbar.navbar-expand-xl .dropdown-submenu > .submenu-trigger {
        display: flex;
        align-items: center;
        justify-content: space-between;

        width: 100%;
        padding: 11px 18px;

        border: none;
        border-radius: 0;
        background: transparent;

        color: #26382F;
        font-size: 13px;
        font-weight: 400;
        text-align: left;

        cursor: pointer;
        position: relative;
        z-index: 3;
    }

    .navbar.navbar-expand-xl .dropdown-submenu > .submenu-trigger:hover,
    .navbar.navbar-expand-xl .dropdown-submenu > .submenu-trigger:focus {
        background: #1F368F;
        color: #FFFFFF;
    }

    /* Submenu arrow */

    .navbar.navbar-expand-xl .dropdown-submenu > .submenu-trigger::after {
        content: "";
        display: inline-block;
        width: 7px;
        height: 7px;

        border-top: 2px solid currentColor;
        border-right: 2px solid currentColor;

        transform: rotate(45deg);
        transition: transform 0.2s ease;

        margin-left: 10px;
        flex-shrink: 0;
    }

    /* Nested submenu closed */

    .navbar.navbar-expand-xl .dropdown-submenu > .dropdown-menu {
        display: none !important;

        position: static !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: none !important;

        width: 100%;
        min-width: 0;
        max-width: 100%;

        margin: 0 0 0 12px !important;
        padding: 5px 0;

        border: none;
        border-left: 2px solid #C69A35;
        border-radius: 0;
        box-shadow: none;

        background: #FFFFFF;

        z-index: 10001;
    }

    /* Open nested submenu using class */

    .navbar.navbar-expand-xl .dropdown-submenu.submenu-open > .dropdown-menu {
        display: block !important;
    }

    /* Rotate arrow when submenu is open */

    .navbar.navbar-expand-xl .dropdown-submenu.submenu-open > .submenu-trigger::after {
        transform: rotate(135deg);
    }

    /* Nested submenu links */

    .navbar.navbar-expand-xl .dropdown-submenu .dropdown-menu .dropdown-item {
        display: block;
        width: 100%;
        padding: 10px 18px;
        font-size: 13px;
        line-height: 1.5;
        white-space: normal;
        color: #26382F;
        cursor: pointer;
        position: relative;
        z-index: 2;
    }

    .navbar.navbar-expand-xl .dropdown-submenu .dropdown-menu .dropdown-item:hover {
        background: #1F368F;
        color: #FFFFFF;
    }

    /* IMPORTANT:
       Disable desktop hover opening on tablet */

    .navbar.navbar-expand-xl .dropdown-submenu:hover > .dropdown-menu {
        display: none !important;
    }

    .navbar.navbar-expand-xl .dropdown-submenu.submenu-open:hover > .dropdown-menu {
        display: block !important;
    }


    /* =====================================================
       FLAG
    ===================================================== */

    .navbar-flag {
        margin-left: 10px;
    }

    .navbar-flag img {
        width: 48px;
        height: 32px;
        object-fit: cover;
    }


    /* =====================================================
       HERO CAROUSEL
    ===================================================== */

    .header-carousel .header-carousel-item {
        height: 650px;
        position: relative;
        background-position: center center;
        background-size: cover;
    }

    .header-carousel .header-carousel-item .carousel-caption {
        padding: 40px 25px 90px;
        align-items: center;
        text-align: left;
    }

    .header-carousel .carousel-caption .container {
        max-width: 900px;
        width: 100%;
    }

    .header-carousel .carousel-caption h4 {
        font-size: 17px;
        letter-spacing: 1px;
        margin-bottom: 15px !important;
    }

    .header-carousel .carousel-caption h1 {
        font-size: clamp(38px, 4.5vw, 52px);
        line-height: 1.15;
        max-width: 700px;
        margin-bottom: 20px !important;
    }

    .header-carousel .carousel-caption p {
        font-size: 15px !important;
        line-height: 1.65;
        max-width: 650px;
        margin-bottom: 20px !important;
    }

    .header-carousel .carousel-caption .btn {
        padding: 10px 20px;
        font-size: 13px;
    }


    /* =====================================================
       HERO QUICK LINKS
    ===================================================== */

    .hero-quick-links {
        width: 100%;
        max-width: 680px;
        margin-top: 15px !important;
    }

    .quick-links-title {
        font-size: 11px;
        letter-spacing: 1.5px;
        margin-bottom: 10px;
    }

    .quick-pills {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        align-items: flex-start;
        gap: 8px;
    }

    .quick-pill {
        padding: 9px 13px;
        font-size: 11px;
        gap: 7px;
        white-space: normal;
        line-height: 1.35;
        max-width: 100%;
    }

    .quick-pill i {
        font-size: 12px;
        flex-shrink: 0;
    }

    /* Carousel controls */

    .header-carousel .owl-nav .owl-prev,
    .header-carousel .owl-nav .owl-next {
        width: 45px;
        height: 45px;
        font-size: 20px;
        bottom: 20px;
    }


    /* =====================================================
       ABOUT MUNICIPALITY
    ===================================================== */

    .about-section {
        padding-top: 45px !important;
        padding-bottom: 45px !important;
    }

    .about-section .container {
        max-width: 960px;
    }

    .about-content,
    .about-right {
        padding: 25px !important;
    }

    .about-content h1 {
        font-size: clamp(28px, 3vw, 36px);
        line-height: 1.2;
    }

    .about-content p {
        font-size: 13px;
        line-height: 1.75;
    }

    .about-intro {
        font-size: 14px !important;
    }

    .about-highlights {
        gap: 10px;
    }

    .about-highlight-item {
        font-size: 12px;
        gap: 9px;
    }

    .about-highlight-item i {
        font-size: 14px;
    }

    .about-main-image {
        height: 280px;
    }

    .about-image-overlay {
        padding: 50px 20px 20px;
    }

    .about-image-overlay h3 {
        font-size: 20px;
    }


    /* Information tiles */

    .about-info-card {
        min-height: 85px;
        padding: 12px;
        gap: 10px;
    }

    .about-info-icon {
        width: 38px;
        height: 38px;
        min-width: 38px;
        font-size: 16px;
    }

    .about-info-card h5 {
        font-size: 12px;
    }

    .about-info-card p {
        font-size: 10px;
    }


    /* =====================================================
       SERETO
    ===================================================== */

    .sereto-card {
        padding: 35px 30px;
    }

    .sereto-heading {
        font-size: 30px;
    }

    .sereto-content {
        max-height: 450px;
        padding: 10px 15px;
        font-size: 15px;
        line-height: 1.8;
    }

    .sereto-footer {
        flex-wrap: wrap;
        text-align: center;
        gap: 10px;
    }


    /* =====================================================
       INFORMATION CENTRE
    ===================================================== */

    .information-centre {
        padding: 30px 0;
    }

    .information-centre .container {
        max-width: 960px;
    }

    .information-links {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 20px 15px;
        padding: 15px 10px 25px;
    }

    .information-image {
        max-width: 110px;
        height: 85px;
    }

    .information-item h6 {
        font-size: 13px;
        line-height: 1.4;
    }


    /* =====================================================
       STANDBY NUMBERS
    ===================================================== */

    .standby-numbers {
        padding: 25px 20px;
    }

    .standby-heading {
        gap: 10px;
    }

    .standby-heading i {
        font-size: 25px;
    }

    .standby-heading h4 {
        font-size: 19px;
    }

    .standby-numbers p {
        font-size: 12px;
    }

    .standby-numbers a {
        font-size: 15px;
        overflow-wrap: anywhere;
    }


    /* =====================================================
       LATEST TENDERS
    ===================================================== */

    .blog {
        overflow: hidden;
    }

    .blog .container {
        max-width: 960px;
    }

    .blog .blog-content {
        padding: 20px !important;
    }

    .blog .blog-content h4 {
        font-size: 17px;
        line-height: 1.4;
    }

    .blog .blog-content p {
        font-size: 13px;
        line-height: 1.65;
    }

    .blog .blog-img img {
        width: 100%;
        object-fit: cover;
    }

    .blog .blog-content .btn {
        font-size: 12px;
        padding: 9px 15px;
    }


    /* =====================================================
       NOTICES
    ===================================================== */

    .notices {
        overflow: hidden;
    }

    .notices-carousel::before,
    .notices-carousel::after {
        width: 80px;
    }

    .notices-carousel .owl-nav {
        max-width: 320px;
    }

    .notices-carousel .owl-nav .owl-prev,
    .notices-carousel .owl-nav .owl-next {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }

    .notices .notice-buttons {
        gap: 8px;
    }

    .notices .notice-buttons a.btn {
        padding: 8px 15px;
        font-size: 12px;
    }


    /* Notice preview modal */

    .preview-nav {
        width: 45px;
        height: 45px;
        font-size: 24px;
    }

    .preview-prev {
        left: 10px;
    }

    .preview-next {
        right: 10px;
    }


    /* =====================================================
       EVENTS / CALENDAR
    ===================================================== */

    .upcoming-events {
        overflow: hidden;
    }

    .mini-calendar {
        max-width: 100%;
        padding: 12px !important;
    }

    .mini-calendar-day {
        font-size: 12px;
    }

    .full-calendar-weekdays,
    .full-calendar-week {
        gap: 4px;
    }

    .full-calendar-cell {
        min-height: 70px;
        padding: 5px;
        font-size: 11px;
    }

    .event-pill {
        font-size: 9px;
        padding: 2px 4px;
    }


    /* =====================================================
       FOOTER
    ===================================================== */

    .footer .container {
        max-width: 960px;
    }

    .footer .footer-item h4 {
        font-size: 17px;
    }

    .footer .footer-item a {
        font-size: 13px;
        line-height: 28px;
    }

    .footer-sereto-scroll {
        height: 210px;
    }

    .footer-sereto-text {
        font-size: 12px;
    }

}


/* =========================================================
   SMALL TABLET
   768px - 991.98px
========================================================= */

@media (min-width: 768px) and (max-width: 991.98px) {

    .header-carousel .header-carousel-item {
        height: 700px;
    }

    .header-carousel .carousel-caption h1 {
        font-size: clamp(36px, 5vw, 48px);
    }

    .hero-quick-links {
        max-width: 650px;
    }

    .quick-pill {
        white-space: normal;
    }

    .information-links {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .about-main-image {
        height: 300px;
    }

}


/* =========================================================
   PHONE
   767.98px AND BELOW
========================================================= */

@media (max-width: 767.98px) {

    .header-carousel .header-carousel-item {
        height: auto;
        min-height: 650px;
    }

    .header-carousel .header-carousel-item .carousel-caption {
        padding: 45px 15px 85px;
    }

    .header-carousel .carousel-caption h1 {
        font-size: clamp(30px, 8vw, 38px);
        line-height: 1.2;
    }

    .header-carousel .carousel-caption p {
        font-size: 13px !important;
    }

    .quick-pills {
        gap: 7px;
    }

    .quick-pill {
        padding: 8px 11px;
        font-size: 10px;
        white-space: normal;
    }

    .information-links {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .full-calendar-cell {
        min-height: 55px;
        padding: 3px;
    }

    .event-pill {
        display: none;
    }

}


/* =========================================================
   TABLET DROPDOWN CLICK FIX
   992px - 1199.98px
========================================================= */

@media (min-width: 992px) and (max-width: 1199.98px) {

    /* Remove hover-based dropdown activation */

    .navbar.navbar-expand-xl .dropdown:hover > .dropdown-menu {
        display: none !important;
    }

    /* Dropdown opened by Bootstrap click */

    .navbar.navbar-expand-xl .dropdown.show > .dropdown-menu {
        display: block !important;
    }

    /* Nested submenu opens only with submenu-open class */

    .navbar.navbar-expand-xl .dropdown-submenu:hover > .dropdown-menu {
        display: none !important;
    }

    .navbar.navbar-expand-xl .dropdown-submenu.submenu-open > .dropdown-menu {
        display: block !important;
    }

    /* Ensure links remain clickable */

    .navbar.navbar-expand-xl .dropdown-menu,
    .navbar.navbar-expand-xl .dropdown-menu * {
        pointer-events: auto !important;
    }

    .navbar.navbar-expand-xl .dropdown-menu {
        position: static !important;
        float: none !important;
        overflow: visible !important;
    }

    /* Avoid transparent overlay intercepting clicks */

    .navbar.navbar-nav,
    .navbar .navbar-nav,
    .navbar .dropdown-menu {
        pointer-events: auto;
    }

}