/* responsive.css - Responsive Adjustments for Masabeeh Al-Huda Association */

@media (max-width: 992px) {

    /* General section paddings */
    section {
        padding: 60px 0;
    }

    /* Hero section adjustments */
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .hero-content h1 {
        font-size: 2.8rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-media-wrapper {
        max-width: 420px;
        margin: 0 auto;
    }

    .hero-img {
        height: 340px;
    }

    /* Success Story Slide */
    .story-slide {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* Footer Grid Layout */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-about {
        grid-column: 1 / -1;
    }

    /* Dashboard Container */
    .dashboard-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 20px;
        flex-direction: row;
        flex-wrap: wrap;
    }

    body[dir="rtl"] .sidebar {
        border-left: none;
        border-bottom: 1px solid var(--border-color);
    }

    .sidebar-brand {
        display: none;
    }

    .sidebar-menu {
        flex-direction: row;
        flex-wrap: wrap;
        width: 100%;
        justify-content: space-around;
    }

    .sidebar-link {
        padding: 10px 14px;
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
    }

    /* Brand logo and text on mobile */
    .nav-logo-img {
        height: 40px;
        width: 40px;
    }

    .nav-brand-text {
        font-size: 1.05rem;
    }

    .nav-brand-sub {
        font-size: 0.65rem;
    }

    /* Navigation burger menu */
    .nav-toggle {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 25px;
        height: 20px;
        background: transparent;
        border: none;
        cursor: pointer;
        z-index: 1001;
        flex-shrink: 0; /* Prevent toggle button from being squished */
    }

    /* Compact nav actions on mobile */
    .nav-actions {
        gap: 8px;
    }

    .nav-actions .btn-toggle {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }

    .nav-actions .btn-lang {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .nav-actions .btn-primary {
        padding: 8px 14px;
        font-size: 0.8rem;
        border-radius: var(--radius-sm);
    }

    @media (max-width: 400px) {
        .nav-brand-sub {
            display: none; /* Hide subtitle on tiny screens to save space */
        }
        .nav-actions .btn-primary {
            padding: 6px 10px;
            font-size: 0.75rem;
        }
    }

    .nav-toggle span {
        width: 100%;
        height: 3px;
        background-color: var(--text-title);
        border-radius: 2px;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    .nav-toggle.open span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .nav-toggle.open span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.open span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    .nav-menu {
        position: fixed;
        top: 80px;
        left: 0;
        width: 280px;
        max-width: 85%;
        height: calc(100vh - 80px);
        background-color: var(--bg-card);
        flex-direction: column;
        padding: 40px;
        gap: 30px;
        z-index: 1000;
        transition: transform 0.4s cubic-bezier(0.77, 0.2, 0.05, 1.0), visibility 0.4s;
        transform: translateX(-100%);
        visibility: hidden;
        box-shadow: var(--shadow-lg);
        overflow-y: auto;
    }

    body[dir="rtl"] .nav-menu {
        left: unset;
        right: 0;
        transform: translateX(100%);
    }

    .nav-menu.open {
        transform: translateX(0);
        visibility: visible;
    }

    body[dir="rtl"] .nav-menu.open {
        transform: translateX(0);
        visibility: visible;
    }

    /* Navigation Drawer Overlay backdrop */
    .nav-overlay {
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        height: calc(100vh - 80px);
        background-color: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(3px);
        -webkit-backdrop-filter: blur(3px);
        z-index: 999;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .nav-overlay.open {
        opacity: 1;
        pointer-events: auto;
    }

    body.no-scroll {
        overflow: hidden;
    }

    /* Close Button inside Drawer */
    .mobile-close-item {
        display: block;
        width: 100%;
        margin-bottom: 10px;
    }

    .menu-close-btn {
        background: transparent;
        border: none;
        color: var(--text-title);
        font-size: 1.6rem;
        cursor: pointer;
        padding: 5px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-left: auto; /* LTR: align to right of drawer */
        transition: color 0.2s;
    }

    .menu-close-btn:hover {
        color: var(--primary);
    }

    body[dir="rtl"] .menu-close-btn {
        margin-left: 0;
        margin-right: auto; /* RTL: align to left of drawer */
    }

    /* Contacts and forms layouts */
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    /* Gallery masonry */
    .gallery-grid {
        column-count: 2;
    }

    /* Stats columns */
    .stats-bar {
        grid-template-columns: 1fr 1fr;
        padding: 20px;
    }

    /* Footer structure */
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

@media (max-width: 576px) {

    /* Mobile specific adjustments */
    .hero-content h1 {
        font-size: 2.2rem;
    }

    .hero-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .btn {
        width: 100%;
    }

    .gallery-grid {
        column-count: 1;
    }

    .stats-bar {
        grid-template-columns: 1fr;
    }

    .donate-amount-select {
        grid-template-columns: 1fr 1fr;
    }

    .cert-card {
        padding: 25px 15px;
    }

    .cert-title {
        font-size: 1.4rem;
    }

    .cert-body {
        font-size: 0.95rem;
    }
}