/* =================================================================
   MOBILE NAVIGATION STYLES (Dedicated File)
   ================================================================= */

/* 1. Hamburger Menu (Hidden on Desktop) */
.hamburger-menu {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1100;
}

.hamburger-menu .bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #660000;
    margin: 5px 0;
    transition: 0.4s;
}

/* 2. Mobile Logic (< 768px) */
@media (max-width: 768px) {

    /* Show Hamburger */
    .hamburger-menu {
        display: block;
        order: 1;
        /* Left */
    }

    /* Logo to Right */
    .logo {
        order: 2;
        /* Right */
    }

    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 5px 20px;
    }

    /* Primary Nav: Initially Hidden, Slide/Overlay */
    .primary-nav {
        /* display: none; */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #E0D9D5;
        border-top: 1px solid #660000;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 1000;

        /* Dropdown Animation Logic */
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
    }

    /* Active State */
    .primary-nav.active {
        max-height: 100vh;
    }

    .primary-nav ul {
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
        width: 100%;
    }

    .primary-nav li {
        width: 100%;
        text-align: center;
        border-left: none;
        margin-bottom: 15px;
        padding: 0;
    }

    .primary-nav a {
        display: block;
        padding: 10px;
        font-size: 1.2rem;
    }

    /* Dropdown Handling */
    .dropdown-content {
        position: static;
        display: block;
        box-shadow: none;
        border: none;
        background-color: transparent;
        width: 100%;

        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
    }

    /* Open Class */
    .dropdown.active .dropdown-content {
        max-height: 500px;
    }

    .dropdown-content a {
        background-color: #E0D9D5;
        /* Match main menu background */
        padding: 10px 0;
        text-align: center;
        border-bottom: 1px solid #d0c8be;
    }

    /* Vision Grid Carousel */
    .vision-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 20px;
        padding-bottom: 20px;
        width: 100%;
        box-sizing: border-box;
        -webkit-overflow-scrolling: touch;
    }

    .vision-item {
        flex: 0 0 80%;
        scroll-snap-align: center;
        background-color: transparent;
        padding: 20px;
        border-radius: 10px;
        box-shadow: none;
        margin: 5px;
    }

    /* Objectives List Carousel */
    .objectives-list {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 20px;
        padding: 0;
        padding-bottom: 20px;
        width: 100%;
        box-sizing: border-box;
        list-style: none;
    }

    .objective-item {
        flex: 0 0 85%;
        scroll-snap-align: center;
        flex-direction: column;
        text-align: center;
        background-color: transparent;
        padding: 20px;
        border-radius: 10px;
        border: none;
        margin: 0;
        display: flex;
        gap: 15px;
    }

    .objective-item .objective-icon {
        margin: 0 auto;
    }

    .vision-grid::-webkit-scrollbar,
    .objectives-list::-webkit-scrollbar {
        display: none;
    }

    .vision-grid,
    .objectives-list {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    /* Carousel Dots */
    .carousel-indicators {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin-top: 10px;
        margin-bottom: 30px;
    }

    .carousel-dot {
        width: 10px;
        height: 10px;
        background-color: #ccc;
        border-radius: 50%;
        cursor: pointer;
        transition: background-color 0.3s, transform 0.3s;
    }

    .carousel-dot.active {
        background-color: #660000;
        transform: scale(1.2);
    }

    /* About Page Hero Adjustments */
    #page-hero {
        height: auto !important;
        min-height: 30vh !important;
        padding: 50px 20px !important;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center !important;
    }

    #page-hero h1 {
        font-size: 3rem !important;
        padding: 0 !important;
        margin: 0;
        width: 100%;
    }
}

/* Global Overflow Protection */
@media (max-width: 768px) {

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

    * {
        box-sizing: border-box;
    }
}

/* Law Journal Fixes */
@media (max-width: 768px) {
    .journal-card img {
        height: auto !important;
        width: 90% !important;
        max-width: 220px !important;
        margin: 0 auto;
        padding: 10px !important;
        object-fit: contain;
        display: block;
    }

    .journal-card {
        padding: 10px 0;
        width: 100%;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .journal-container {
        max-width: 100% !important;
        padding: 30px 5% !important;
        gap: 30px !important;
    }

    .journal-card-content {
        width: 100%;
        padding: 0 15px;
        text-align: center;
    }

    .journal-card-content h3 {
        white-space: normal !important;
        word-wrap: break-word;
        font-size: 1.2rem !important;
        margin: 10px 0;
        line-height: 1.3;
    }

    .journal-card-content a {
        display: inline-block;
        max-width: 100%;
    }
}