/* css/global-mobile.css */

/* =========================================
   MOBILE RESPONSIVENESS (PHONES & TABLETS)
   ========================================= */

/* Default state for text swapping (Desktop View) */
.text-mobile { display: none !important; }
.text-desktop { display: inline !important; }

/* The Hamburger Button - Hidden by default on big screens */
.mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    color: #D4AF37; 
    font-size: 2.2rem; 
    cursor: pointer;
    padding: 0;
}

/* Base header positioning needed for the dropdown */
.site-header {
    position: relative;
    z-index: 1000;
}

.nav-wrapper {
    background-color: #121212; 
    display: flex;
    justify-content: center;
}

@media screen and (max-width: 768px) {
    
    /* Global Mobile Safety Net - Kills horizontal scroll */
    html, body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }

    /* Swap the Text */
    .text-desktop { display: none !important; }
    .text-mobile { display: inline !important; }
    
    /* Standardize Icon Sizes */
    .icon-img {
        width: 32px !important;
        height: 32px !important;
        object-fit: contain;
        display: block; 
    }
    
    /* Format the Top Bar layout into 2 rows */
    .top-bar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        /* THE FIX: Pushes emails to far left and far right on Row 1 */
        justify-content: space-between !important; 
        padding: 5px 15px;       
        row-gap: 2px;            
        column-gap: 0 !important; 
        font-size: 0;            
    }

    /* Dissolve containers */
    .top-contacts, .top-socials {
        display: contents !important; 
    }

    .top-bar a {
        display: inline-flex;
        align-items: center;
        color: inherit;
        text-decoration: none;
        padding: 0;             
        margin: 0 !important;   
        font-size: 14px;        
    }

    /* ROW 1: Emails */
    .nav-email:nth-of-type(1) { 
        order: 1; 
    }
    .nav-email:nth-of-type(2) { 
        order: 2; 
    }

    /* The Magic Line Break */
    .top-bar::after {
        content: "";
        flex-basis: 100%;
        order: 3;
        height: 0;
    }

    /* ROW 2: Icons Grouped Left */
    .nav-phone { 
        order: 4; 
        margin-right: 8px !important; 
    }
    
    .top-socials a:nth-of-type(1) { 
        order: 5; 
        margin-right: 8px !important; 
    }
    
    .top-socials a:nth-of-type(2) { 
        order: 6; 
    }

    /* ROW 2: Burger Menu Pinned Right */
    .mobile-toggle {
        display: block; 
        order: 7;
        /* This pushes icons to the left and burger to the right */
        margin-left: auto !important; 
        margin-right: 0 !important;
    }

    /* Dropdown Styles */
    .nav-wrapper { border-top: 1px solid #333; }
    .main-nav {
        display: none !important; 
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #121212;
        box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    }
    .main-nav.active { display: block !important; }
    .main-nav ul { display: flex; flex-direction: column; padding: 0; margin: 0; }
    .main-nav li { width: 100%; border-bottom: 1px solid #222; text-align: center; }
    .main-nav a { display: block; padding: 15px 20px; font-size: 1.1rem; }
    
    /* Header Scaling */
    h1 { font-size: 2.2rem !important; }
    h2 { font-size: 1.8rem !important; }

    /* =========================================
       FOOTER TIGHTENING & CENTERING
       ========================================= */
    .footer-container {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 15px !important; 
        padding-top: 20px !important;
        padding-bottom: 10px !important;
    }

    .footer-section {
        width: 100% !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-bottom: 0 !important;
    }

    .footer-section h3 {
        margin-top: 5px !important;
        margin-bottom: 8px !important;
    }

    .footer-section p {
        margin: 4px 0 !important;
    }

    .footer-section p a, 
    .footer-section div {
        justify-content: center !important;
        width: 100%;
    }

    .footer-bottom {
        text-align: center !important;
        padding: 10px 10px !important; 
        margin-top: 5px;
    }
    
    .footer-bottom p {
        margin: 0 !important;
        font-size: 0.85rem;
    }
}