/* ==========================================================================
   KHAQAH DAYEMIA | HISTORICAL AZIMPUR CHOTO DAYERA SHARIF
   Unified Design System & Stylesheet (style.css)
   A Living Heritage Archive
   ========================================================================== */

:root {
    /* Palette according to Visual Direction */
    --primary-green: #0a4d3c;     /* Deep Islamic green — primary */
    --primary-dark: #063529;      /* Darkest forest tone */
    --primary-deep: #04251d;
    --forest-green: #14532d;      /* Secondary forest green */
    --sage-green: #e8f5e9;        /* Sage / muted green — supporting */
    --sage-accent: #c8e6c9;
    --sage-border: #d4ebd4;
    --parchment: #fcfbf7;         /* Cream / parchment — historical bg */
    --parchment-dark: #f4f1ea;    /* Warm shaded parchment */
    --parchment-card: #fdfdfc;
    --antique-gold: #c5a059;      /* Antique gold — subtle accents */
    --gold-light: #dfc182;
    --gold-hover: #b38f47;
    --gold-muted: rgba(197, 160, 89, 0.2);
    --gold-border: rgba(197, 160, 89, 0.4);
    
    /* Text & Status Colors */
    --text-main: #2d3748;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --white: #ffffff;
    
    /* Historical Source Verification Badges */
    --status-confirmed: #15803d;
    --status-supported: #0284c7;
    --status-traditional: #b45309;
    --status-oral: #7c3aed;
    --status-research: #c026d3;

    /* Shadows & Transitions */
    --shadow-sm: 0 4px 6px -1px rgba(10, 77, 60, 0.08), 0 2px 4px -1px rgba(10, 77, 60, 0.04);
    --shadow-md: 0 10px 20px -3px rgba(10, 77, 60, 0.12), 0 4px 8px -2px rgba(10, 77, 60, 0.06);
    --shadow-lg: 0 20px 25px -5px rgba(10, 77, 60, 0.15), 0 10px 10px -5px rgba(10, 77, 60, 0.04);
    --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--parchment);
    color: var(--text-main);
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    max-width: 100vw;
}

img, svg, picture, video {
    max-width: 100%;
    height: auto;
}

main {
    flex: 1;
    overflow-x: hidden;
    width: 100%;
}

h1, h2, h3, h4, h5, h6, .brand-title {
    font-family: 'Cinzel', serif;
    color: var(--primary-green);
    letter-spacing: 0.5px;
    line-height: 1.3;
    overflow-wrap: break-word;
}

.arabic-script {
    font-family: 'Amiri', serif;
    font-weight: 700;
    direction: rtl;
    line-height: 1.5;
}

/* Container */
.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

/* Header & Navigation Bar */
header {
    background-color: var(--white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid var(--sage-accent);
}

.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
}

.brand-logo-emblem {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary-green), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--antique-gold);
    box-shadow: 0 2px 8px rgba(10, 77, 60, 0.25);
    flex-shrink: 0;
}

.brand-logo-emblem svg {
    width: 22px;
    height: 22px;
    fill: var(--antique-gold);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--primary-green);
    line-height: 1.15;
}

.brand-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    font-weight: 600;
}

/* Navigation Bar & Menus */
nav ul.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
    list-style: none;
}

.nav-item > .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.88rem;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    white-space: nowrap;
    border: 1px solid transparent;
}

.nav-item > .nav-link:hover {
    color: var(--primary-green);
    background-color: var(--sage-green);
    border-color: var(--sage-border);
}

.nav-item > .nav-link.active {
    color: var(--primary-green);
    background-color: var(--sage-green);
    border-color: var(--antique-gold);
    box-shadow: 0 2px 6px rgba(10, 77, 60, 0.08);
}

.dropdown-caret {
    width: 13px;
    height: 13px;
    fill: currentColor;
    opacity: 0.7;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.has-dropdown:hover > .nav-link .dropdown-caret,
.has-dropdown:focus-within > .nav-link .dropdown-caret,
.has-dropdown.mobile-open > .nav-link .dropdown-caret {
    transform: rotate(180deg);
    opacity: 1;
}

/* Dropdown Menu Popup (Desktop) */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    background: var(--white);
    border: 1px solid var(--sage-border);
    border-top: 3px solid var(--antique-gold);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: 0 16px 32px rgba(10, 77, 60, 0.12), 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 0.45rem 0;
    list-style: none;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.2s;
    pointer-events: none;
    z-index: 1050;
}

/* Invisible hover bridge */
.has-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 8px;
}

@media(min-width: 769px) {
    .has-dropdown:hover > .dropdown-menu,
    .has-dropdown:focus-within > .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }
}

.dropdown-item {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

.dropdown-link {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.65rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
    text-decoration: none;
    background: transparent;
    border-left: 3px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
}

.dropdown-link:hover {
    background-color: var(--sage-green);
    color: var(--primary-green);
    font-weight: 600;
    padding-left: 1.45rem;
    border-left-color: var(--antique-gold);
}

.dropdown-link.active {
    background-color: rgba(10, 77, 60, 0.07);
    color: var(--primary-green);
    font-weight: 700;
    border-left-color: var(--primary-green);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-green);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.mobile-menu-toggle:hover {
    background: var(--sage-green);
}

/* Navigation Actions & Language Switcher */
.nav-auth-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-left: 0.75rem;
    flex-shrink: 0;
}

.btn-lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: linear-gradient(135deg, rgba(10, 77, 60, 0.08), rgba(197, 160, 89, 0.18));
    color: var(--primary-green);
    border: 1.5px solid var(--antique-gold);
    border-radius: 30px;
    padding: 0.35rem 0.95rem;
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 5px rgba(10, 77, 60, 0.08);
    white-space: nowrap;
}

.btn-lang-toggle:hover {
    background: linear-gradient(135deg, var(--primary-green), var(--primary-dark));
    color: var(--gold-light);
    border-color: var(--gold-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(10, 77, 60, 0.25);
}

.btn-lang-toggle .lang-flag {
    font-size: 1.05rem;
    line-height: 1;
}

.btn-lang-toggle .lang-text {
    font-size: 0.86rem;
    letter-spacing: 0.3px;
}

.btn-nav-login {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: var(--white);
    color: var(--primary-green);
    border: 1px solid var(--sage-border);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.9rem;
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-nav-login:hover {
    background: var(--sage-green);
    border-color: var(--antique-gold);
    color: var(--primary-dark);
}

/* Bengali Typography Optimization */
html.lang-bn body,
html[lang="bn"] body {
    font-family: 'Hind Siliguri', 'Plus Jakarta Sans', sans-serif;
}

html.lang-bn h1,
html.lang-bn h2,
html.lang-bn h3,
html.lang-bn h4,
html.lang-bn h5,
html.lang-bn h6,
html.lang-bn .brand-title,
html[lang="bn"] h1,
html[lang="bn"] h2,
html[lang="bn"] h3,
html[lang="bn"] h4,
html[lang="bn"] h5,
html[lang="bn"] h6,
html[lang="bn"] .brand-title {
    font-family: 'Noto Serif Bengali', 'Cinzel', serif;
    letter-spacing: normal;
}

/* Page Banner / Hero Banner */
.page-banner {
    background: linear-gradient(rgba(6, 53, 41, 0.9), rgba(10, 77, 60, 0.85)),
                url('https://images.unsplash.com/photo-1564507592333-c60657eea523?auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
    color: var(--white);
    text-align: center;
    padding: 5rem 2rem 4rem 2rem;
    border-bottom: 4px solid var(--antique-gold);
}

.banner-crest {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(197, 160, 89, 0.18);
    border: 1px solid var(--antique-gold);
    padding: 0.3rem 1.2rem;
    border-radius: 30px;
    font-size: 0.78rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--gold-light);
    margin-bottom: 1.2rem;
    backdrop-filter: blur(4px);
}

.page-banner h1 {
    color: var(--white);
    font-size: 2.6rem;
    margin-bottom: 0.8rem;
    letter-spacing: 1px;
}

.page-banner p.subtitle {
    font-size: 1.15rem;
    color: var(--sage-accent);
    max-width: 720px;
    margin: 0 auto 1.5rem auto;
    font-weight: 300;
}

.breadcrumb-nav {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--parchment-dark);
}

.breadcrumb-nav a {
    color: var(--gold-light);
    text-decoration: none;
}

.breadcrumb-nav a:hover {
    text-decoration: underline;
}

/* Section Commons */
section {
    padding: 5rem 0;
}

section:nth-child(even) {
    background-color: var(--parchment-dark);
}

.section-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.section-pre-title {
    display: inline-block;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--antique-gold);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.section-header h2 {
    font-size: 2.3rem;
    margin-bottom: 0.85rem;
    color: var(--primary-green);
}

.section-header p {
    color: var(--text-muted);
    max-width: 680px;
    margin: 0 auto;
    font-size: 1.05rem;
}

.section-divider {
    width: 70px;
    height: 3px;
    background: linear-gradient(to right, transparent, var(--antique-gold), transparent);
    margin: 1.2rem auto 0 auto;
}

/* Cards & Images */
.card-image-wrap {
    position: relative;
    width: 100%;
    height: 230px;
    overflow: hidden;
    background-color: #e2e8f0;
}

.card-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.card-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(10, 77, 60, 0.92);
    color: var(--gold-light);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.6px;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    border: 1px solid var(--gold-border);
    text-transform: uppercase;
    z-index: 2;
}

.card-meta-stamp {
    position: absolute;
    bottom: 10px;
    right: 12px;
    background: rgba(0, 0, 0, 0.65);
    color: var(--white);
    font-size: 0.7rem;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}

.visual-card:hover .card-image-wrap img {
    transform: scale(1.06);
}

/* Responsive Grid Layouts */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.75rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

/* Feature Showcase Card (for History, Sufis, Dayera, Stories, Visit) */
.showcase-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--sage-border);
    padding: 3rem;
    margin-bottom: 3.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.showcase-card:hover {
    box-shadow: var(--shadow-md);
    border-color: rgba(197, 160, 89, 0.4);
}

/* Nested Features Mini Grid (e.g. Dayera sanctuaries) */
.features-mini-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* 2-Column Responsive Form Row */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Home Visit Gateway Section */
.home-visit-box {
    background: var(--parchment);
    border-radius: var(--radius-lg);
    border: 1px solid var(--sage-border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.home-visit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.home-visit-image {
    position: relative;
    min-height: 380px;
}

.home-visit-content {
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Journey Flow Section */
.journey-flow-box {
    background: var(--parchment);
    border: 1px solid var(--sage-border);
    padding: 3rem 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
}

.journey-flow-chain {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

/* Hero Banner */
.hero-banner {
    padding: 6.5rem 2rem 5.5rem 2rem;
}

/* Standard Heritage Card */
.heritage-card {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--sage-border);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.heritage-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--antique-gold);
}

.heritage-card .card-content {
    padding: 1.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.heritage-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.65rem;
    color: var(--primary-green);
}

.heritage-card p {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.65;
    flex: 1;
}

/* Verification Badges */
.badge-verification {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    align-self: flex-start;
}

.badge-confirmed {
    background-color: #dcfce7;
    color: var(--status-confirmed);
    border: 1px solid #bbf7d0;
}

.badge-supported {
    background-color: #e0f2fe;
    color: var(--status-supported);
    border: 1px solid #bae6fd;
}

.badge-traditional {
    background-color: #fef3c7;
    color: var(--status-traditional);
    border: 1px solid #fde68a;
}

.badge-oral {
    background-color: #f3e8ff;
    color: var(--status-oral);
    border: 1px solid #e9d5ff;
}

.badge-research {
    background-color: #fce7f3;
    color: var(--status-research);
    border: 1px solid #fbcfe8;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.8rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--antique-gold);
    color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(197, 160, 89, 0.35);
}

.btn-primary:hover {
    background-color: var(--gold-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(197, 160, 89, 0.45);
}

.btn-outline {
    background-color: transparent;
    color: var(--primary-green);
    border: 2px solid var(--primary-green);
}

.btn-outline:hover {
    background-color: var(--primary-green);
    color: var(--white);
    transform: translateY(-2px);
}

.btn-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Quote Callout Box */
.quote-banner {
    background-color: var(--white);
    border-left: 4px solid var(--antique-gold);
    padding: 2rem 2.5rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin: 3rem 0;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--sage-border);
    border-left-width: 5px;
}

.quote-banner blockquote {
    font-size: 1.18rem;
    font-style: italic;
    color: var(--primary-green);
    line-height: 1.8;
}

.quote-banner cite {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--antique-gold);
    font-weight: 700;
    text-transform: uppercase;
    font-style: normal;
}

/* Timeline Styles */
.timeline {
    position: relative;
    max-width: 960px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background: linear-gradient(to bottom, var(--antique-gold), var(--primary-green), var(--sage-accent));
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
    border-radius: 2px;
}

.timeline-item {
    padding: 15px 45px;
    position: relative;
    width: 50%;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: var(--white);
    border: 4px solid var(--antique-gold);
    top: 25px;
    border-radius: 50%;
    z-index: 1;
    box-shadow: 0 0 0 4px rgba(10, 77, 60, 0.15);
}

.timeline-item.left {
    left: 0;
}

.timeline-item.right {
    left: 50%;
}

.timeline-item.right::after {
    left: -10px;
}

.timeline-content {
    background-color: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--sage-border);
    overflow: hidden;
    transition: var(--transition);
}

.timeline-content:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--antique-gold);
    transform: translateY(-3px);
}

.timeline-thumb-wrap {
    height: 150px;
    position: relative;
    overflow: hidden;
}

.timeline-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.timeline-body {
    padding: 1.5rem;
}

.timeline-header-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.timeline-date-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--antique-gold);
}

.timeline-content h3 {
    font-size: 1.15rem;
    color: var(--primary-green);
    margin-bottom: 0.5rem;
}

.timeline-content p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ==========================================================================
   Category & Archive Filters (Pill Navigation)
   ========================================================================== */
.archive-filters,
.timeline-filters,
.story-filters,
.category-filters {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 0 auto 3rem auto;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--sage-border);
    border-radius: 9999px;
    box-shadow: var(--shadow-sm);
    width: fit-content;
    max-width: 100%;
}

.filter-btn {
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    background-color: transparent;
    border: 1.5px solid transparent;
    color: var(--text-main);
    padding: 0.65rem 1.45rem;
    border-radius: 9999px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    line-height: 1.3;
    transition: var(--transition);
    position: relative;
    user-select: none;
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: rgba(197, 160, 89, 0.5);
    color: var(--primary-green);
    background-color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(10, 77, 60, 0.08);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-dark) 100%);
    color: var(--white) !important;
    border-color: var(--antique-gold);
    box-shadow: 0 4px 14px rgba(10, 77, 60, 0.28), 0 0 0 1px rgba(197, 160, 89, 0.35);
    transform: translateY(-1px);
}

.filter-btn.active::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: var(--gold-light);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(223, 193, 130, 0.9);
}

.filter-btn:focus-visible {
    outline: 2px solid var(--antique-gold);
    outline-offset: 2px;
}

/* ==========================================================================
   Tab Navigation & Segmented View Controls
   ========================================================================== */
.tab-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.65rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.5rem 0.6rem;
    border-radius: 9999px;
    border: 1.5px solid var(--sage-border);
    box-shadow: 0 4px 18px -2px rgba(10, 77, 60, 0.08);
    margin: 0 auto 3.5rem auto;
    flex-wrap: wrap;
    width: fit-content;
    max-width: 100%;
}

.tab-btn {
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    border: 1.5px solid transparent;
    background: transparent;
    color: var(--text-main);
    padding: 0.75rem 1.7rem;
    border-radius: 9999px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    white-space: nowrap;
    position: relative;
    user-select: none;
    line-height: 1.3;
}

.tab-btn:hover {
    color: var(--primary-green);
    background: var(--sage-green);
    border-color: rgba(10, 77, 60, 0.12);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border-color: var(--antique-gold);
    box-shadow: 0 6px 20px rgba(10, 77, 60, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.tab-btn:focus-visible {
    outline: 2px solid var(--antique-gold);
    outline-offset: 2px;
}

.tab-badge {
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: rgba(10, 77, 60, 0.08);
    color: var(--primary-green);
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
}

.tab-btn:hover .tab-badge {
    background: rgba(10, 77, 60, 0.15);
}

.tab-btn.active .tab-badge {
    background: rgba(197, 160, 89, 0.25);
    color: var(--gold-light);
    border: 1px solid rgba(197, 160, 89, 0.4);
}

/* Tab Panes */
.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: tabFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes tabFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Silsilah Tree Visualization */
.tree-container {
    background: var(--white);
    padding: 3rem 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--sage-border);
    margin: 2rem 0;
}

.tree-node-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    margin-bottom: 2.5rem;
}

.tree-connector {
    width: 3px;
    height: 40px;
    background: var(--antique-gold);
    margin: 0 auto;
}

.tree-card {
    background: var(--parchment);
    border: 2px solid var(--primary-green);
    border-radius: var(--radius-md);
    padding: 1.5rem 2rem;
    text-align: center;
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.tree-card:hover {
    border-color: var(--antique-gold);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.tree-card h4 {
    font-size: 1.15rem;
    color: var(--primary-green);
    margin-bottom: 0.35rem;
}

.tree-card .tree-sub {
    font-size: 0.82rem;
    color: var(--antique-gold);
    font-weight: 700;
    text-transform: uppercase;
}

/* Lightbox Modal */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(6, 35, 27, 0.94);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox-modal.active {
    display: flex;
}

.lightbox-content-box {
    max-width: 900px;
    width: 100%;
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    border: 2px solid var(--antique-gold);
}

.lightbox-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--white);
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.lightbox-close-btn:hover {
    background: var(--primary-green);
    color: var(--gold-light);
}

.lightbox-img-holder {
    max-height: 520px;
    width: 100%;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.lightbox-img-holder img {
    width: 100%;
    height: 100%;
    max-height: 520px;
    object-fit: contain;
}

.lightbox-details {
    padding: 1.5rem 2rem;
    background: var(--parchment);
    border-top: 1px solid var(--sage-border);
}

.lightbox-details h3 {
    font-size: 1.25rem;
    color: var(--primary-green);
    margin-bottom: 0.35rem;
}

.lightbox-details p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Forms (Contribute / Contact) */
.form-card {
    background: var(--white);
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--sage-border);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary-green);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid #cbd5e1;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-main);
    background-color: var(--parchment);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(10, 77, 60, 0.15);
    background-color: var(--white);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* Footer */
footer {
    background-color: var(--primary-green);
    color: var(--white);
    padding: 4.5rem 0 2rem 0;
    border-top: 4px solid var(--antique-gold);
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 2.5rem;
    margin-bottom: 3.5rem;
}

.footer-brand h3 {
    color: var(--white);
    font-size: 1.35rem;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.footer-brand p {
    color: var(--sage-accent);
    font-size: 0.92rem;
    max-width: 380px;
    line-height: 1.6;
}

.footer-links h3 {
    color: var(--gold-light);
    font-size: 1.05rem;
    margin-bottom: 1rem;
}

.footer-links ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.footer-links a {
    color: var(--parchment);
    text-decoration: none;
    font-size: 0.88rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--antique-gold);
    padding-left: 4px;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.85rem;
    color: var(--sage-accent);
}

/* ==========================================================================
   COMPREHENSIVE RESPONSIVE DESIGN SYSTEM
   Optimized for Laptop (1024px-1440px), Tablet (768px-991px), & Mobile (<768px)
   ========================================================================== */

/* 1. Large Laptops & Medium Desktops (up to 1280px) */
@media (max-width: 1280px) {
    .container {
        padding: 0 1.75rem;
    }
    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }
    .grid-3 {
        gap: 1.5rem;
    }
    .grid-2 {
        gap: 1.75rem;
    }
}

/* 2. Standard Laptops & Sub-notebooks (992px - 1199px) */
@media (max-width: 1200px) and (min-width: 992px) {
    .container {
        padding: 0 1.5rem;
    }
    .nav-bar {
        padding: 0.65rem 1.25rem;
        gap: 0.5rem;
    }
    .brand {
        gap: 0.55rem;
    }
    .brand-logo-emblem {
        width: 36px;
        height: 36px;
    }
    .brand-logo-emblem svg {
        width: 18px;
        height: 18px;
    }
    .brand-title {
        font-size: 1.05rem;
        letter-spacing: 0.4px;
    }
    .brand-subtitle {
        font-size: 0.62rem;
        letter-spacing: 0.4px;
    }
    nav ul.nav-menu {
        gap: 0.2rem;
    }
    .nav-item > .nav-link {
        font-size: 0.8rem;
        padding: 0.4rem 0.55rem;
        gap: 0.2rem;
    }
    .btn-nav-login {
        padding: 0.38rem 0.7rem !important;
        font-size: 0.78rem !important;
    }
    .grid-4 {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.4rem;
    }
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.4rem;
    }
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    .showcase-card {
        padding: 2.5rem;
        margin-bottom: 3rem;
    }
}

/* 3. Tablet & Mobile Hamburger Navigation Breakpoint (<= 991px) */
@media (max-width: 991px) {
    .nav-bar {
        padding: 0.75rem 1.25rem;
        position: relative;
    }

    .brand {
        gap: 0.65rem;
    }

    .brand-logo-emblem {
        width: 38px;
        height: 38px;
    }

    .brand-title {
        font-size: 1.1rem;
    }

    .brand-subtitle {
        font-size: 0.65rem;
        max-width: 280px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Hamburger Button (44x44px accessible target) */
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        width: 44px;
        height: 44px;
        background: var(--sage-green);
        border: 1.5px solid var(--sage-border);
        border-radius: var(--radius-sm);
        cursor: pointer;
        padding: 9px;
        transition: var(--transition);
        margin-left: auto;
        position: relative;
        z-index: 1002;
    }

    .mobile-menu-toggle:hover,
    .mobile-menu-toggle:focus {
        background: var(--sage-accent);
        border-color: var(--antique-gold);
    }

    .mobile-menu-toggle .hamburger-line {
        display: block;
        width: 22px;
        height: 2.5px;
        background-color: var(--primary-green);
        border-radius: 2px;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    }

    /* Animated hamburger transform to X */
    .mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
        transform: translateY(7.5px) rotate(45deg);
    }
    .mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
        opacity: 0;
    }
    .mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
        transform: translateY(-7.5px) rotate(-45deg);
    }

    /* Mobile Drawer Fullscreen Dropdown */
    nav {
        position: fixed;
        top: 65px;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        border-top: 1px solid var(--sage-border);
        box-shadow: 0 20px 40px rgba(10, 77, 60, 0.15);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s;
        z-index: 1001;
        display: flex;
        flex-direction: column;
    }

    nav.menu-open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    nav ul.nav-menu {
        display: flex;
        flex-direction: column;
        width: 100%;
        padding: 1.25rem 1.5rem 1.5rem 1.5rem;
        gap: 0.4rem;
        align-items: stretch;
        margin: 0;
    }

    .nav-item {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        border-bottom: 1px solid rgba(10, 77, 60, 0.07);
        padding-bottom: 0.3rem;
    }

    .nav-item > .nav-link {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.85rem 1rem;
        font-size: 1rem;
        border-radius: var(--radius-sm);
        min-height: 46px;
    }

    .nav-item > .nav-link.active {
        background-color: var(--sage-green);
        color: var(--primary-green);
        border-color: var(--antique-gold);
    }

    .has-dropdown .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: auto;
        display: none;
        box-shadow: none;
        border: none;
        border-left: 3px solid var(--antique-gold);
        background: var(--parchment-dark);
        margin: 0.35rem 0.5rem 0.75rem 1rem;
        border-radius: var(--radius-sm);
        padding: 0.35rem 0;
    }

    .has-dropdown.mobile-open .dropdown-menu {
        display: flex;
        flex-direction: column;
        animation: subMenuSlide 0.25s ease forwards;
    }

    @keyframes subMenuSlide {
        from { opacity: 0; transform: translateY(-6px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .dropdown-link {
        padding: 0.75rem 1.25rem;
        font-size: 0.92rem;
        min-height: 42px;
    }

    .mobile-drawer-footer {
        display: block;
        margin-top: auto;
        padding: 1.25rem 1.5rem 2.5rem 1.5rem;
        border-top: 1px solid var(--sage-border);
        background: var(--parchment);
    }

    .mobile-drawer-footer .btn-nav-login {
        display: flex;
        width: 100%;
        justify-content: center;
        padding: 0.85rem 1rem !important;
        font-size: 0.95rem !important;
    }

    .nav-auth-actions {
        display: none; /* In navbar on desktop, in drawer on mobile */
    }

    /* Grids on Tablets (641px - 991px) */
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.35rem;
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.35rem;
    }

    .grid-2 {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }

    .showcase-card {
        padding: 2.25rem 1.75rem;
        margin-bottom: 2.5rem;
    }

    .page-banner {
        padding: 4.5rem 1.5rem 3.5rem 1.5rem;
    }

    .hero-banner {
        padding: 5rem 1.5rem 4rem 1.5rem;
    }

    .section-header {
        margin-bottom: 2.5rem;
    }

    section {
        padding: 4rem 0;
    }
}

/* 4. Mobile Breakpoint (<= 768px) */
@media (max-width: 768px) {
    .container {
        padding: 0 1.25rem;
    }

    /* Fluid Page Banners */
    .page-banner {
        padding: 3.5rem 1.25rem 2.75rem 1.25rem;
    }

    .hero-banner {
        padding: 4rem 1.25rem 3rem 1.25rem;
    }

    .quote-banner {
        padding: 1.5rem 1.25rem;
        margin: 2rem 0;
    }

    .quote-banner blockquote {
        font-size: 1.05rem;
        line-height: 1.7;
    }

    /* Single Column Timeline */
    .timeline {
        padding: 0;
    }

    .timeline::after {
        left: 20px;
    }

    .timeline-item {
        width: 100% !important;
        padding-left: 50px !important;
        padding-right: 0 !important;
        left: 0 !important;
        margin-bottom: 1.5rem;
    }

    .timeline-item.right {
        left: 0% !important;
    }

    .timeline-item.left::after,
    .timeline-item.right::after {
        left: 10px !important;
        right: auto !important;
        top: 22px;
        width: 20px;
        height: 20px;
    }

    .timeline-thumb-wrap {
        height: 180px;
    }

    .timeline-body {
        padding: 1.2rem;
    }

    /* Horizontal Swipable Pill Filters & Tabs */
    .tab-nav,
    .archive-filters,
    .timeline-filters,
    .story-filters,
    .category-filters {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        justify-content: flex-start;
        padding: 0.35rem 0.5rem;
        border-radius: 9999px;
        width: 100%;
        max-width: 100%;
        gap: 0.5rem;
        margin: 0 auto 2.25rem auto;
    }

    .tab-nav::-webkit-scrollbar,
    .archive-filters::-webkit-scrollbar,
    .timeline-filters::-webkit-scrollbar,
    .story-filters::-webkit-scrollbar,
    .category-filters::-webkit-scrollbar {
        display: none;
    }

    .tab-btn, .filter-btn {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 0.6rem 1.15rem;
        font-size: 0.84rem;
    }

    /* Tree Visualization on Mobile */
    .tree-container {
        padding: 2rem 1rem;
        margin: 1.5rem 0;
    }

    .tree-card {
        padding: 1.25rem 1rem;
        max-width: 100%;
    }

    .tree-connector {
        height: 28px;
    }

    /* Form Card on Mobile */
    .form-card {
        padding: 1.75rem 1.25rem;
        border-radius: var(--radius-md);
    }

    .form-grid-2 {
        grid-template-columns: 1fr;
        gap: 0;
    }

    /* Lightbox Modal on Mobile */
    .lightbox-modal {
        padding: 0.75rem;
    }

    .lightbox-img-holder {
        max-height: 45vh;
    }

    .lightbox-details {
        padding: 1.15rem 1.25rem;
    }

    .lightbox-details h3 {
        font-size: 1.15rem;
    }

    /* Footer on Mobile */
    footer {
        padding: 3.5rem 0 1.5rem 0;
    }

    .footer-content {
        flex-direction: column;
        gap: 2.25rem;
        margin-bottom: 2.5rem;
    }

    .footer-brand p {
        max-width: 100%;
    }

    .footer-links {
        width: 100%;
    }

    .footer-links ul {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 0.5rem 1rem;
    }
}

/* 5. Mobile Small Devices (<= 640px) */
@media (max-width: 640px) {
    .container {
        padding: 0 1rem;
    }

    .grid-4,
    .grid-3,
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 1.35rem;
    }

    .showcase-card {
        padding: 1.5rem 1.15rem;
        margin-bottom: 2rem;
        border-radius: var(--radius-md);
    }

    .card-image-wrap {
        height: 210px;
    }

    .showcase-card .card-image-wrap {
        height: 220px !important;
        margin-bottom: 1.25rem;
    }

    .features-mini-grid {
        grid-template-columns: 1fr;
    }

    .btn-group {
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
    }

    .btn-group .btn {
        width: 100%;
        justify-content: center;
    }

    section {
        padding: 3.5rem 0;
    }
}

/* 6. Extra Small Screens (<= 480px, e.g. iPhone SE, 360px Android) */
@media (max-width: 480px) {
    .nav-bar {
        padding: 0.65rem 0.85rem;
    }

    .brand-subtitle {
        display: none;
    }

    .brand-title {
        font-size: 0.95rem;
        letter-spacing: 0.3px;
    }

    .brand-logo-emblem {
        width: 34px;
        height: 34px;
    }

    .brand-logo-emblem svg {
        width: 17px;
        height: 17px;
    }

    nav {
        top: 57px;
    }

    .page-banner {
        padding: 3rem 1rem 2.25rem 1rem;
    }

    .hero-banner {
        padding: 3.5rem 1rem 2.5rem 1rem;
    }

    .banner-crest {
        font-size: 0.72rem;
        padding: 0.25rem 0.85rem;
        letter-spacing: 0.8px;
    }

    .quote-banner {
        padding: 1.25rem 1rem;
    }

    .quote-banner blockquote {
        font-size: 0.95rem;
    }

    .form-card {
        padding: 1.25rem 0.9rem;
    }

    .footer-links ul {
        grid-template-columns: 1fr;
    }
}
