﻿
/* --- CSS VARIABLES & THEMES --- */
:root[data-theme="light"] {
    --bg-primary: #fcfbf7;
    --bg-secondary: #ffffff;
    --bg-accent: #f0ebe1;
    --text-main: #2c3e50;
    --text-muted: #5a6c7d;
    --primary-color: #1b4d3e; /* Islamic Green */
    --secondary-color: #c9a66b; /* Premium Gold */
    --border-color: #e2e8f0;
}

:root[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-accent: #1e3a2f;
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --primary-color: #2e7d62;
    --secondary-color: #dfba7d;
    --border-color: #334155;
}

/* --- GLOBAL STYLES --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
}

/* Urdu Specific Overrides */
[lang="ur"] {
    font-family: 'Noto Nastaliq Urdu', serif;
    direction: rtl;
    text-align: right;
}

    /* Fixed target selectors for Urdu RTL alignment */
    [lang="ur"] .nav-controls,
    [lang="ur"] .contact-info {
        flex-direction: row-reverse;
    }

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 0;
}

/* --- HEADER & NAVIGATION --- */
header {
    background-color: var(--bg-secondary);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 3px solid var(--secondary-color);
    width: 100%;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    flex-wrap: wrap; /* Allows wrapping on small devices */
    gap: 1rem;
}

.logo h1 {
    font-size: 1.3rem;
    color: var(--primary-color);
    font-weight: 700;
    word-wrap: break-word;
}

.nav-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap; /* Prevents button row explosion on small screens */
}

.btn-toggle {
    background: var(--bg-accent);
    border: 1px solid var(--secondary-color);
    color: var(--text-main);
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    border-radius: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    text-decoration: none;
    white-space: nowrap;
}

    .btn-toggle:hover {
        background: var(--secondary-color);
        color: #fff;
    }

/* --- HERO SECTION --- */
.hero {
    background: linear-gradient(rgba(27, 77, 62, 0.85), rgba(27, 77, 62, 0.95)), url('/images/landing-page/jamia-logo.png') no-repeat center center/cover;
    color: #fff;
    padding: 4rem 0; /* Reduced mobile padding default */
    text-align: center;
    border-bottom: 5px solid var(--secondary-color);
    width: 100%;
}

    .hero h2 {
        font-size: 2rem;
        margin-bottom: 1rem;
        color: var(--secondary-color);
        word-wrap: break-word;
    }

    .hero p {
        font-size: 1.1rem;
        max-width: 800px;
        margin: 0 auto 1.5rem auto;
    }

.leadership-badge {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--secondary-color);
    display: inline-block;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1.5rem;
    max-width: 100%; /* Keeps badge fluid inside viewports */
    text-align: inherit;
}

/* --- SECTIONS GENERAL --- */
section {
    padding: 3rem 0;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--primary-color);
    position: relative;
}

    .section-title::after {
        content: '';
        display: block;
        width: 80px;
        height: 3px;
        background: var(--secondary-color);
        margin: 10px auto 0 auto;
    }

/* --- CARD GRID DESIGN --- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.card {
    background: var(--bg-secondary);
    padding: 2rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    text-align: center;
    border-top: 4px solid var(--primary-color);
    width: 100%;
    word-wrap: break-word;
}

    .card i {
        font-size: 2.5rem;
        color: var(--secondary-color);
        margin-bottom: 1.5rem;
    }

    .card h3 {
        margin-bottom: 1rem;
        font-size: 1.3rem;
    }

/* --- PLACEHOLDER GALLERY --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

.gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    height: 350px;
    background: #ccc;
    width: 100%;
}

    .gallery-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .gallery-item .caption {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(0,0,0,0.7);
        color: #fff;
        padding: 0.5rem;
        text-align: center;
        font-size: 0.9rem;
    }

/* --- CONTACT & FOOTER --- */
.contact-info {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 2rem;
    width: 100%;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
    background: var(--bg-secondary);
    padding: 1.2rem 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    min-width: 280px;
    max-width: 100%;
    flex: 1;
    word-break: break-all; /* Prevents overflow of email addresses */
}

    .contact-item i {
        color: var(--primary-color);
        font-size: 1.5rem;
    }

footer {
    background: var(--primary-color);
    color: #fff;
    padding: 2rem 0;
    text-align: center;
    border-top: 4px solid var(--secondary-color);
    width: 100%;
}

/* --- RESPONSIVE DESIGN --- */
@@media (min-width: 769px) {
    .logo h1 {
        font-size: 1.5rem;
    }

    .hero {
        padding: 8rem 0;
    }

        .hero h2 {
            font-size: 3rem;
        }

    .section-title {
        font-size: 2.5rem;
    }

    section {
        padding: 5rem 0;
    }
}

@@media (max-width: 480px) {
    .navbar {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .nav-controls {
        justify-content: center;
        width: 100%;
    }
    /* Ensures Nastaliq line-height doesn't expand boxes aggressively */
    [lang="ur"] .btn-toggle {
        padding: 0.2rem 0.6rem;
    }
}
