/* Responsive Breakpoints based on blueprint */

/* <= 1200px */
@media (max-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* <= 992px (Tablets) */
@media (max-width: 992px) {
    .container {
        max-width: 960px;
    }
    .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
    .footer-widgets { grid-template-columns: repeat(2, 1fr); }
    
    .header-inner {
        height: 70px;
        position: relative;
    }
    .main-navigation {
        display: block !important;
        position: fixed;
        top: 0;
        right: -320px;
        width: 300px;
        height: 100vh;
        background: var(--color-white);
        padding: 80px 20px 20px;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        z-index: 1000;
        transition: right 0.3s ease;
        overflow-y: auto;
    }
    .main-navigation.is-open {
        right: 0 !important;
    }
    .main-navigation ul {
        flex-direction: column;
        gap: 15px;
        display: flex;
    }
    .main-navigation a {
        color: var(--color-primary) !important;
        padding: 10px 0;
    }
    .main-navigation ul ul {
        display: flex !important;
        position: static;
        box-shadow: none;
        padding-left: 20px;
        margin-top: 5px;
    }
    .main-navigation li:hover > ul {
        display: flex;
    }
    #mobile-menu-toggle {
        display: block !important;
        color: var(--color-primary);
        position: relative;
        z-index: 1001;
    }
    .header-transparent #mobile-menu-toggle {
        color: var(--color-white);
    }
    .hero-title {
        font-size: 3rem;
    }
}

/* <= 768px (Mobile Landscape) */
@media (max-width: 768px) {
    .container {
        max-width: 720px;
    }
    .grid-cols-3 { grid-template-columns: repeat(1, 1fr); }
    .grid-cols-2 { grid-template-columns: repeat(1, 1fr); }
    
    .hero-title {
        font-size: 2.5rem;
    }
    .hero-actions {
        flex-direction: column;
    }
    .main-body {
        flex-direction: column;
    }
    .sidebar {
        max-width: 100%;
    }
    .about-grid {
        grid-template-columns: 1fr !important;
    }
    .about-content {
        order: -1; /* Shows text before image on mobile */
    }
    .homepage-marquee-container,
    .hero-marquee-container {
        flex-direction: column !important;
        align-items: stretch !important;
        border-radius: 20px !important;
    }
    .marquee-title {
        margin-right: 0 !important;
        margin-bottom: 10px !important;
        align-self: center !important;
    }
    .marquee-content {
        font-size: 0.95rem !important;
        width: 100%;
        line-height: 1.5;
    }
    .footer-bottom > .container,
    .footer-bottom .custom,
    .footer-bottom .mod-custom {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
        gap: 10px !important;
    }
    .footer-bottom div,
    .footer-bottom p {
        text-align: center !important;
        width: 100% !important;
        justify-content: center !important;
    }
    
    .header-hero-wrapper {
        background-position: left center !important;
    }
    
    /* Fix Committee Images Cut Off */
    .committee-card img {
        height: auto !important;
        aspect-ratio: 4/5 !important;
        object-fit: cover !important;
    }

    /* Fix Contribution Banner (Make it stack and center) */
    .contribution-banner {
        flex-direction: column !important;
        text-align: center !important;
        padding: 40px 20px !important;
        gap: 20px !important;
    }
    .contrib-title h2 {
        white-space: normal !important;
        text-align: center !important;
    }
    .contrib-desc {
        text-align: center !important;
    }
    
    /* Center align all homepage sections on mobile */
    .section-subtitle {
        justify-content: center !important;
    }
    .section-subtitle span {
        font-size: 0.75rem !important; /* Force to fit on one line */
        white-space: nowrap !important;
    }
    .section-subtitle svg {
        width: 30px !important;
    }
    
    .section-title,
    .about-content h2,
    .contribute-content h2,
    .committee-info h2,
    .darshan-content h2 {
        text-align: center !important;
    }
    .about-text,
    .about-text p,
    .contribute-text,
    .contribute-text p,
    .committee-info p,
    .darshan-content p {
        text-align: center !important;
    }
    .about-content .btn,
    .contribute-content .btn,
    .committee-info .btn,
    .darshan-content .btn,
    .darshan-spacer .btn,
    .mod-custom .btn {
        display: block !important;
        width: fit-content !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* Generic Contribution / Custom Module Centering */
    .darshan-spacer .custom,
    .darshan-spacer .module,
    .mod-custom {
        text-align: center !important;
    }
    .darshan-spacer img,
    .darshan-spacer i,
    .mod-custom img,
    .mod-custom i {
        display: block !important;
        margin: 0 auto 15px auto !important;
        text-align: center !important;
    }

    /* Inner Page Hero Modules on Mobile */
    .hero-darshan-container {
        padding: 8px 20px !important;
        gap: 10px !important;
    }
    .hero-darshan-container .darshan-content {
        font-size: 0.95rem !important;
    }
    .hero-darshan-container i {
        font-size: 1rem !important;
    }

    /* Fix Donations Component Overflow */
    .section-donation-bank {
        padding: 20px 15px !important;
    }

    .bank-contact-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    .bank-card, 
    .contact-card, 
    .payment-card {
        padding: 20px !important;
        word-break: break-word; /* Prevent long account numbers from scrolling */
    }
}

/* <= 576px (Mobile Portrait) */
@media (max-width: 576px) {
    .container {
        max-width: 100%;
        padding-left: var(--spacing-16);
        padding-right: var(--spacing-16);
    }
    .footer-widgets { grid-template-columns: 1fr; }
    
    .hero-title {
        font-size: 2rem;
    }
    .section-title {
        font-size: 2rem;
    }
}

/* --- Global Utilities for Inner Components --- */

/* Responsive Video / Iframe Embeds (16:9) */
.responsive-video-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}
.responsive-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Smart Table Responsive Scrolling */
.table-responsive {
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-height: 70vh; /* Keeps the horizontal scrollbar visible on screen */
}

.table-responsive table {
    min-width: 700px; /* Forces scroll on mobile for 4+ column tables */
    width: 100%;
    table-layout: auto;
}

.table-responsive th,
.table-responsive td {
    white-space: normal !important;
    word-break: break-word;
    vertical-align: middle;
    padding: 10px;
}

.table-responsive th,
.table-responsive th h4 {
    background-color: var(--primary-color, #1A1E36) !important;
    color: #ffffff !important;
    position: sticky;
    top: -20px;
    z-index: 10;
}

/* Custom Scrollbar for Table */
.table-responsive::-webkit-scrollbar {
    height: 8px;
}
.table-responsive::-webkit-scrollbar-track {
    background: #f8fafc;
    border-radius: 4px;
    margin: 10px;
}
.table-responsive::-webkit-scrollbar-thumb {
    background: var(--secondary-color, #F6B846);
    border-radius: 4px;
}
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color, #1A1E36);
}
