/* =========================================
   BASE STYLING & REFINED PALETTE
   ========================================= */
:root {
    /* Refined Primary: Deep Midnight Charcoal (Premium & Modern) */
    --primary: #1A222C;      
    --secondary: #334155;    /* Slate Grey for body text */
    --bg-color: #F4EFE6;     /* Terrace Cream/Parchment */
    --surface: #ffffff;      /* Pure white for table/cards */
    --border: #DCD3C6;       /* Warm Stone borders */
    --accent: #C49A45;       /* Mustard Gold (from Chanda's dupatta) */
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--secondary);
    -webkit-font-smoothing: antialiased;
}

/* =========================================
   RESPONSIVE NAVIGATION & DROPDOWNS
   ========================================= */
.site-nav {
    background-color: rgba(176, 79, 51, 0.98); /* Terracotta Red */
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    padding: 0 2rem;
    min-height: 85px; /* Taller, more substantial */
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 2px solid var(--accent); /* Gold strip */
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    color: #F4EFE6; /* Parchment color for inactive links */
    text-decoration: none;
    font-size: 1.2rem; /* Larger font */
    font-family: 'Playfair Display', serif; /* Elegant, scholarly serif font */
    font-weight: 600;
    letter-spacing: 0.5px;
    padding-bottom: 6px;
    transition: color 0.3s ease;
    display: block;
}

.nav-links a:hover, 
.nav-links a.active { 
    color: #ffffff; 
}

/* Dropdown Container Styling */
.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1A222C;
    min-width: 220px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    border-radius: 8px;
    border: 1px solid var(--secondary);
    overflow: hidden;
    padding: 10px 0;
}

.dropdown-content a {
    padding: 12px 20px;
    font-size: 0.95rem;
    padding-bottom: 12px; /* Reset the active underline padding */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; /* Keep dropdowns clean and modern */
}

.dropdown-content a:hover {
    background-color: var(--secondary);
    color: var(--accent);
}

/* Show dropdown on hover */
.dropdown:hover .dropdown-content {
    display: block;
}

/* Mobile Hamburger Button (Hidden on Desktop) */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

/* --- MOBILE RESPONSIVENESS --- */
@media screen and (max-width: 850px) {
    .site-nav {
        justify-content: flex-end; /* Push hamburger to the right */
        padding: 1rem 2rem;
    }

    .menu-toggle {
        display: block;
    }

    .nav-links {
        display: none; /* Hidden by default on mobile */
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: rgba(176, 79, 51, 0.98); /* Terracotta */
        padding: 1rem 0 2rem 0;
        gap: 1.5rem;
        border-top: 1px solid var(--secondary);
    }

    /* JavaScript will add this class when the button is clicked */
    .nav-links.show {
        display: flex !important;
    }

    .dropdown-content {
        position: relative;
        top: 0;
        left: 0;
        transform: none;
        box-shadow: none;
        border: none;
        background-color: transparent;
        padding-left: 1rem;
    }

    .dropdown:hover .dropdown-content {
        display: block;
    }
}

/* =========================================
   HERO (Miniature Background)
   ========================================= */
.hero {
    background: linear-gradient(rgba(26, 34, 44, 0.75), rgba(26, 34, 44, 0.9)), url('header.jpg');
    background-size: cover;
    background-position: center 20%;
    color: white;
    text-align: center;
    padding: 5rem 1rem;
    margin-bottom: 3rem;
    border-bottom: 5px solid var(--accent); 
}

.hero h1 { margin: 0; font-size: 3.2rem; font-weight: 700; letter-spacing: -0.5px; }
.hero p { margin-top: 12px; font-size: 1.2rem; font-weight: 400; opacity: 0.9; }

/* =========================================
   CUSTOM HOMEPAGE LAYOUTS
   ========================================= */
.bio-section {
    display: flex;
    align-items: center;
    gap: 40px;
    background: white;
    padding: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 40px;
}

.bio-image {
    width: 220px;
    height: 220px;
    border-radius: 50%; /* Makes the square image a perfect circle */
    object-fit: cover;
    border: 4px solid var(--accent); /* Gold ring around the portrait */
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.15);
    flex-shrink: 0;
}

/* Helper class for alternating right-aligned images */
.bio-reverse {
    flex-direction: row-reverse;
}

/* Ensure mobile stacking keeps the image on top */
@media screen and (max-width: 850px) {
    .bio-reverse {
        flex-direction: column; 
    }
}

/* Makes the bio section stack neatly on mobile phones */
@media screen and (max-width: 850px) {
    .bio-section {
        flex-direction: column;
        text-align: center;
    }
}

/* =========================================
   MODERN APP CONTROLS 
   ========================================= */
.container {
    max-width: 1400px;
    margin: 0 auto 4rem auto;
    padding: 0 20px;
}

.controls {
    background: var(--surface);
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
    gap: 15px;
    align-items: center;
    border: 1px solid var(--border);
    flex-wrap: wrap;
}

.control-label { font-weight: 600; color: var(--primary); margin-right: 10px; }

/* Styled Checkbox "Pills" */
.controls label {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background-color: var(--bg-color);
    border: 1px solid var(--border);
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--secondary);
    transition: all 0.2s ease;
    user-select: none;
}

.controls label:hover { background-color: #fbebc8; border-color: var(--accent); }

.controls input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    margin-right: 8px;
    cursor: pointer;
}

/* =========================================
   SLEEK DATA TABLE 
   ========================================= */
.table-wrapper {
    overflow-x: auto;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

th {
    background-color: var(--primary); 
    color: #f8fafc;
    font-size: 1rem;
    font-weight: 600;
    padding: 20px;
    text-align: center;
    position: sticky;
    top: 0px; 
    z-index: 10;
    letter-spacing: 0.5px;
}

td {
    /* Increased top padding from 20px to 35px to give Nastaliq ascenders room to breathe */
    padding: 35px 24px 20px 24px; 
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background-color: #FAFCFF; } 

.id-col {
    text-align: center;
    color: #64748b;
    font-family: monospace;
    font-size: 1.1rem;
    font-weight: 600;
}

/* =========================================
   PROPER NASTALIQ TYPOGRAPHY & DIFFS
   ========================================= */
.urdu-text {
    font-family: 'Noto Nastaliq Urdu', serif; 
    font-size: 24px;
    line-height: 2.8;
    text-align: right;
    direction: rtl;
    white-space: nowrap; 
    min-width: 250px;
}

span.diff {
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 700;
}

/* Diff Colors mapped to the painting's pigments */
span.diff-anchor { background-color: #E2EFE5; color: #275734; } /* Forest Green (Seated Musician) */
span.diff-gm { background-color: #FADEDE; color: #962828; }     /* Crimson (Carpet/GM Corruption) */
span.diff-var1 { background-color: #FBEBC8; color: #8A611C; }   /* Mustard Gold (Dupatta) */
span.diff-var2 { background-color: #DBE6FE; color: #1A2B56; }   /* Lapis Blue (Night Sky) */
span.diff-var3 { background-color: #F9E1E8; color: #832247; }   /* Magenta/Pink (Standing Musician) */

.hide-col { display: none; }

/* =========================================
   ORNATE SECTION DIVIDER
   ========================================= */
.ornate-divider {
    text-align: center;
    margin: 4rem auto;
    position: relative;
    width: 60%; /* Keeps the line from stretching too far */
}

.ornate-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    border-bottom: 1px solid var(--border);
    z-index: 1;
}

.ornate-divider span {
    position: relative;
    z-index: 2;
    background-color: var(--bg-color); /* Matches the page background to "cut" the line */
    padding: 0 20px;
    color: var(--accent);
    font-size: 1.5rem;
}