/* ============================================================
   Design System — Charity Foundation Website
   Phase 2 + 3: tokens, layout, components, header & navigation
   ============================================================ */

/* === Design Tokens === */
:root {
    /* Brand palette */
    --color-accent: #E7B46A;
    --color-accent-dark: #C9974A;
    --color-sage: #A3AA5A;
    --color-sage-dark: #8A9147;
    --color-coral: #F1A17E;
    --color-coral-dark: #D8825E;
    --color-base: #DFDFE3;
    --color-base-light: #F4F4F6;
    --color-text: #2a2a2a;
    --color-text-muted: #6b6b6b;
    --color-white: #ffffff;
    --color-border: #e2e2e6;

    /* Typography */
    --font-primary: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-heading: 'Montserrat', 'Inter', system-ui, sans-serif;

    --fs-xs: 0.75rem;    /* 12px */
    --fs-sm: 0.875rem;   /* 14px */
    --fs-base: 1rem;     /* 16px */
    --fs-lg: 1.125rem;   /* 18px */
    --fs-xl: 1.375rem;   /* 22px */
    --fs-2xl: 1.75rem;   /* 28px */
    --fs-3xl: 2.25rem;   /* 36px */
    --fs-4xl: 3rem;      /* 48px */

    /* Spacing scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-8: 3rem;
    --space-10: 4rem;
    --space-12: 6rem;

    /* Layout */
    --container-max: 1200px;
    --header-height: 72px;

    /* Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-pill: 999px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;

    /* z-index layers */
    --z-header: 100;
    --z-dropdown: 90;
    --z-mobile-nav: 95;
}

/* === Reset === */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-primary);
    font-size: var(--fs-base);
    color: var(--color-text);
    line-height: 1.6;
    background-color: var(--color-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

ul {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }

p { margin-bottom: var(--space-4); }

/* === Layout Primitives === */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.section {
    padding: var(--space-10) 0;
}

.section-sm {
    padding: var(--space-8) 0;
}

/* Responsive grid */
.grid {
    display: grid;
    gap: var(--space-5);
}

.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }

@media (min-width: 768px) {
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* Flexbox utilities */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.items-center { align-items: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

/* Text utilities */
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    font-family: var(--font-primary);
    font-size: var(--fs-sm);
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    white-space: nowrap;
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-white);
}

.btn-primary:hover {
    background-color: var(--color-accent-dark);
}

.btn-secondary {
    background-color: var(--color-sage);
    color: var(--color-white);
}

.btn-secondary:hover {
    background-color: var(--color-sage-dark);
}

.btn-outline {
    background-color: transparent;
    color: var(--color-text);
    border-color: var(--color-border);
}

.btn-outline:hover {
    border-color: var(--color-accent);
    color: var(--color-accent-dark);
}

.btn-coral {
    background-color: var(--color-coral);
    color: var(--color-white);
}

.btn-coral:hover {
    background-color: var(--color-coral-dark);
}

.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--fs-xs);
}

.btn-lg {
    padding: var(--space-4) var(--space-6);
    font-size: var(--fs-base);
}

/* === Cards === */
.card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-body {
    padding: var(--space-5);
}

/* === Badges === */
.badge {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    font-size: var(--fs-xs);
    font-weight: 600;
    border-radius: var(--radius-pill);
}

.badge-active {
    background-color: rgba(163, 170, 90, 0.15);
    color: var(--color-sage-dark);
}

.badge-completed {
    background-color: rgba(231, 180, 106, 0.15);
    color: var(--color-accent-dark);
}

/* === Forms === */
input,
textarea,
select {
    font-family: var(--font-primary);
    font-size: var(--fs-base);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    width: 100%;
    transition: border-color var(--transition-fast);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-accent);
}

/* ============================================================
   Header & Navigation
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    transition: box-shadow var(--transition-base);
}

.site-header.scrolled {
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-height);
    gap: var(--space-3);
    flex-wrap: nowrap;
}

/* --- Logo --- */
.logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-shrink: 0;
}

.logo-icon {
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--fs-lg);
    color: var(--color-text);
}

.logo-sub {
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
}

/* --- Hamburger (hidden on desktop) --- */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--color-text);
    border-radius: 2px;
    transition: all var(--transition-base);
}

/* Hamburger to X animation when nav open */
body.nav-open .hamburger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
body.nav-open .hamburger span:nth-child(2) {
    opacity: 0;
}
body.nav-open .hamburger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* --- Main Navigation --- */
.main-nav {
    flex: 1;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    flex-wrap: nowrap;
}

.nav-item {
    position: relative;
}
.nav-link {
    display: block;
    padding: var(--space-2) var(--space-2);
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--color-text);
    border-radius: var(--radius-sm);
    white-space: nowrap;
    transition: color var(--transition-fast), background-color var(--transition-fast);
}

.nav-link:hover {
    color: var(--color-accent-dark);
}

/* Active nav state */
.nav-item.active > .nav-link {
    color: var(--color-accent-dark);
    font-weight: 600;
}

/* --- Dropdown (desktop: CSS hover) --- */
.has-dropdown > .nav-link::after {
    content: '▾';
    margin-left: var(--space-1);
    font-size: var(--fs-xs);
    opacity: 0.6;
}

.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 180px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: var(--space-2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity var(--transition-fast),
                visibility var(--transition-fast),
                transform var(--transition-fast);
    z-index: var(--z-dropdown);
}

.has-dropdown:hover > .dropdown,
.has-dropdown:focus-within > .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown li a {
    display: block;
    padding: var(--space-2) var(--space-3);
    font-size: var(--fs-sm);
    border-radius: var(--radius-sm);
    transition: background-color var(--transition-fast);
}

.dropdown li a:hover {
    background-color: var(--color-base-light);
    color: var(--color-accent-dark);
}

/* --- Header Actions (lang switcher + login) --- */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-shrink: 0;
}

.lang-switcher {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.lang-switcher a {
    color: var(--color-text-muted);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
}

.lang-switcher a.active {
    color: var(--color-accent-dark);
}

.lang-switcher a:hover {
    color: var(--color-text);
}

.lang-divider {
    color: var(--color-border);
}

/* ============================================================
   Responsive — Mobile Navigation
   ============================================================ */
@media (max-width: 1023px) {
    .hamburger {
        display: flex;
    }

    .main-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--color-white);
        padding: var(--space-4);
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform var(--transition-base);
        z-index: var(--z-mobile-nav);
        box-shadow: var(--shadow-lg);
    }

    body.nav-open .main-nav {
        transform: translateX(0);
    }

    .nav-list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .nav-link {
        padding: var(--space-3) var(--space-2);
        font-size: var(--fs-base);
        border-bottom: 1px solid var(--color-border);
    }

    /* Mobile dropdowns: expand inline on tap (toggled via .expanded class in JS) */
    .has-dropdown > .nav-link::after {
        float: right;
    }

    .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        padding-left: var(--space-4);
        max-height: 0;
        overflow: hidden;
        transition: max-height var(--transition-base);
    }

    .has-dropdown.expanded > .dropdown {
        max-height: 300px;
    }

    /* Desktop hover behavior disabled on mobile */
    .has-dropdown:hover > .dropdown {
        opacity: 0;
        visibility: hidden;
    }

    .header-actions {
        order: 3;
    }
}

@media (max-width: 600px) {
    .logo-sub {
        display: none;
    }

    .header-actions .btn {
        padding: var(--space-2) var(--space-3);
        font-size: var(--fs-xs);
    }
}

/* === Accessibility === */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Prevent body scroll when mobile nav open */
body.nav-open {
    overflow: hidden;
}
/* ============================================================
   Homepage Components — Phase 4
   ============================================================ */

/* --- Hero Section --- */
.hero {
    position: relative;
    min-height: 560px;
    display: flex;
    align-items: center;
    color: var(--color-white);
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-bg svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(135deg, rgba(42, 42, 42, 0.65) 0%, rgba(42, 42, 42, 0.35) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 720px;
    padding: var(--space-12) 0;
}

.hero-title {
    font-size: var(--fs-4xl);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: var(--space-5);
}

.hero-subtitle {
    font-size: var(--fs-lg);
    margin-bottom: var(--space-6);
    opacity: 0.95;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
}

@media (max-width: 600px) {
    .hero {
        min-height: 440px;
    }
    .hero-title {
        font-size: var(--fs-3xl);
    }
    .hero-subtitle {
        font-size: var(--fs-base);
    }
}

/* --- Mission Preview --- */
.mission-preview {
    display: grid;
    gap: var(--space-8);
    align-items: center;
}

@media (min-width: 768px) {
    .mission-preview {
        grid-template-columns: 1fr 1fr;
    }
}

.mission-text h2 {
    margin-bottom: var(--space-4);
}

.mission-image {
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.mission-image svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* --- Stats Strip --- */
.stats-strip {
    background-color: var(--color-base-light);
    border-radius: var(--radius-lg);
    padding: var(--space-8) var(--space-6);
    margin: var(--space-8) 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
    text-align: center;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.stat-number {
    font-family: var(--font-heading);
    font-size: var(--fs-3xl);
    font-weight: 700;
    color: var(--color-accent-dark);
    line-height: 1;
    margin-bottom: var(--space-2);
}

.stat-label {
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
}

/* --- Section Heading --- */
.section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: var(--space-6);
    gap: var(--space-4);
    flex-wrap: wrap;
}

.section-heading h2 {
    margin: 0;
}

.section-heading .view-all {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--color-accent-dark);
    white-space: nowrap;
}

.section-heading .view-all:hover {
    text-decoration: underline;
}

/* --- Project Card --- */
.project-card {
    display: flex;
    flex-direction: column;
}

.project-card-image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.project-card-image svg {
    width: 100%;
    height: 100%;
    display: block;
}

.project-card .card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.project-card .badge {
    align-self: flex-start;
    margin-bottom: var(--space-3);
}

.project-card h3 {
    margin-bottom: var(--space-2);
}

.project-card p {
    color: var(--color-text-muted);
    font-size: var(--fs-sm);
    margin-bottom: 0;
}

/* Clickable project card (anchor) */
.project-card-link {
    text-decoration: none;
    color: inherit;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.project-card-link:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg, 0 12px 24px rgba(0,0,0,0.12));
}

/* --- CTA Band --- */
.cta-band {
    background: linear-gradient(135deg, var(--color-sage) 0%, var(--color-sage-dark) 100%);
    color: var(--color-white);
    text-align: center;
    padding: var(--space-12) var(--space-6);
    border-radius: var(--radius-lg);
}

.cta-band h2 {
    margin-bottom: var(--space-4);
}

.cta-band p {
    max-width: 600px;
    margin: 0 auto var(--space-6);
    opacity: 0.95;
}

/* ============================================================
   Footer — Phase 5
   ============================================================ */
.site-footer {
    background-color: #2a2a2a;
    color: var(--color-base);
    padding-top: var(--space-10);
    margin-top: var(--space-10);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
    padding-bottom: var(--space-8);
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 2fr;
    }
}

.footer-col h3 {
    color: var(--color-white);
    font-size: var(--fs-base);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-4);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.footer-brand .logo-name {
    color: var(--color-white);
}

.footer-brand .logo-sub {
    color: var(--color-base);
}

.footer-mission {
    font-size: var(--fs-sm);
    color: var(--color-base);
    line-height: 1.6;
    max-width: 320px;
}

.footer-contact-list li {
    margin-bottom: var(--space-3);
    font-size: var(--fs-sm);
    display: flex;
    gap: var(--space-2);
    align-items: flex-start;
}

.footer-contact-list svg {
    flex-shrink: 0;
    margin-top: 3px;
}

.footer-nav-list li {
    margin-bottom: var(--space-2);
}

.footer-nav-list a {
    font-size: var(--fs-sm);
    color: var(--color-base);
    transition: color var(--transition-fast);
}

.footer-nav-list a:hover {
    color: var(--color-accent);
}

/* --- Subscribe Form --- */
.subscribe-form {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.subscribe-form input {
    flex: 1;
    padding: var(--space-3);
    font-size: var(--fs-sm);
    border: 1px solid #444;
    background-color: #1f1f1f;
    color: var(--color-white);
    border-radius: var(--radius-md);
}

.subscribe-form input::placeholder {
    color: #888;
}

.subscribe-form input:focus {
    border-color: var(--color-accent);
    outline: none;
}

.subscribe-form button {
    flex-shrink: 0;
    padding: var(--space-3) var(--space-4);
    font-size: var(--fs-sm);
    font-weight: 600;
    background-color: var(--color-accent);
    color: var(--color-white);
    border-radius: var(--radius-md);
    transition: background-color var(--transition-base);
}

.subscribe-form button:hover {
    background-color: var(--color-accent-dark);
}

/* --- Social Icons --- */
.social-links {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-4);
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-pill);
    background-color: #1f1f1f;
    color: var(--color-base);
    transition: all var(--transition-base);
}

.social-links a:hover {
    background-color: var(--color-accent);
    color: var(--color-white);
}

/* --- Copyright Bar --- */
.footer-bottom {
    border-top: 1px solid #404040;
    padding: var(--space-4) 0;
}

.footer-bottom-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    font-size: var(--fs-xs);
    color: #999;
}

.footer-bottom-inner a {
    color: #999;
}

.footer-bottom-inner a:hover {
    color: var(--color-accent);
}

/* ============================================================
   Inner Pages — Phase 6
   ============================================================ */

/* --- Page Header (banner) --- */
.page-header {
    background-color: var(--color-base-light);
    padding: var(--space-10) 0;
    text-align: center;
}

.page-header h1 {
    font-size: var(--fs-3xl);
    margin-bottom: var(--space-2);
}

.page-header p {
    color: var(--color-text-muted);
    font-size: var(--fs-lg);
    margin: 0;
}

/* --- Team Grid --- */
.team-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
}

@media (min-width: 576px) {
    .team-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .team-grid { grid-template-columns: repeat(4, 1fr); }
}

.team-member {
    text-align: center;
}

.team-member-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto var(--space-4);
}

.team-member-avatar svg {
    width: 100%;
    height: 100%;
}

.team-member h3 {
    font-size: var(--fs-base);
    margin-bottom: var(--space-1);
}

.team-member p {
    color: var(--color-text-muted);
    font-size: var(--fs-sm);
    margin: 0;
}

/* --- Partners Strip --- */
.partners-strip {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-5);
    align-items: center;
    justify-content: center;
}

.partner-logo {
    width: 140px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: var(--fs-sm);
}

/* --- Project Filter Tabs --- */
.filter-tabs {
    display: flex;
    gap: var(--space-2);
    justify-content: center;
    margin-bottom: var(--space-8);
    flex-wrap: wrap;
}

.filter-tabs input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.filter-tabs label {
    display: inline-block;
    padding: var(--space-2) var(--space-5);
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--color-text-muted);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all var(--transition-base);
}

.filter-tabs label:hover {
    border-color: var(--color-accent);
    color: var(--color-accent-dark);
}

.filter-tabs input:checked + label {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-white);
}

/* Project filtering via CSS :checked */
.projects-list .project-card-link[data-status] { display: none; }
#filter-all:checked ~ .projects-list .project-card-link { display: flex; }
#filter-active:checked ~ .projects-list .project-card-link[data-status="active"] { display: flex; }
#filter-completed:checked ~ .projects-list .project-card-link[data-status="completed"] { display: flex; }

/* --- News List --- */
.news-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
}

@media (min-width: 768px) {
    .news-list { grid-template-columns: repeat(2, 1fr); }
}

.news-card {
    display: flex;
    flex-direction: column;
}

.news-card-image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.news-card-image svg {
    width: 100%;
    height: 100%;
    display: block;
}

.news-card .card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.news-date {
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    margin-bottom: var(--space-2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-card h3 {
    font-size: var(--fs-lg);
    margin-bottom: var(--space-2);
}

.news-card .news-excerpt {
    color: var(--color-text-muted);
    font-size: var(--fs-sm);
    margin-bottom: var(--space-4);
    flex: 1;
}

.news-card .read-more {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--color-accent-dark);
    align-self: flex-start;
}

.news-card .read-more:hover {
    text-decoration: underline;
}

/* --- Contact Page --- */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
}

@media (min-width: 768px) {
    .contact-layout { grid-template-columns: 1fr 1fr; }
}

.contact-form .form-group {
    margin-bottom: var(--space-4);
}

.contact-form label {
    display: block;
    font-size: var(--fs-sm);
    font-weight: 500;
    margin-bottom: var(--space-2);
}

.contact-form textarea {
    min-height: 140px;
    resize: vertical;
}

.contact-info-list li {
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
    margin-bottom: var(--space-4);
    font-size: var(--fs-sm);
}

.contact-info-list svg {
    flex-shrink: 0;
    color: var(--color-accent);
    margin-top: 2px;
}

.map-placeholder {
    margin-top: var(--space-8);
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 21 / 9;
    background: var(--color-base-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
}

.map-placeholder svg {
    width: 100%;
    height: 100%;
}

/* --- Cooperation Cards --- */
.coop-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
}

@media (min-width: 768px) {
    .coop-grid { grid-template-columns: 1fr 1fr; }
}

.coop-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    transition: box-shadow var(--transition-base);
}

.coop-card:hover {
    box-shadow: var(--shadow-md);
}

.coop-card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-4);
    color: var(--color-white);
}

.coop-card-icon.business { background: var(--color-sage); }
.coop-card-icon.volunteer { background: var(--color-coral); }

.coop-card h3 {
    font-size: var(--fs-xl);
    margin-bottom: var(--space-3);
}

.coop-card p {
    color: var(--color-text-muted);
    font-size: var(--fs-sm);
    margin-bottom: var(--space-4);
}

.coop-points {
    margin-bottom: var(--space-5);
}

.coop-points li {
    position: relative;
    padding-left: var(--space-5);
    margin-bottom: var(--space-2);
    font-size: var(--fs-sm);
}

.coop-points li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--color-sage-dark);
    font-weight: 700;
}

/* --- FAQ Accordion --- */
.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-3);
    overflow: hidden;
}

.faq-item summary {
    padding: var(--space-4) var(--space-5);
    font-weight: 600;
    font-size: var(--fs-base);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color var(--transition-fast);
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
    content: '+';
    font-size: var(--fs-xl);
    color: var(--color-accent);
    transition: transform var(--transition-base);
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item summary:hover {
    background-color: var(--color-base-light);
}

.faq-item .faq-answer {
    padding: 0 var(--space-5) var(--space-4);
    color: var(--color-text-muted);
    font-size: var(--fs-sm);
    line-height: 1.7;
}

/* --- Rules Document --- */
.rules-doc {
    max-width: 800px;
    margin: 0 auto;
}

.rules-section {
    margin-bottom: var(--space-6);
}

.rules-section h2 {
    font-size: var(--fs-lg);
    color: var(--color-accent-dark);
    margin-bottom: var(--space-3);
}

.rules-section p {
    color: var(--color-text-muted);
    line-height: 1.8;
}

/* --- Two-column text + image --- */
.two-col {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
    align-items: center;
}

@media (min-width: 768px) {
    .two-col { grid-template-columns: 1fr 1fr; }
}

.two-col-image {
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.two-col-image svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* --- Form Feedback (AJAX) --- */
.form-feedback {
    margin-top: var(--space-3);
    font-size: var(--fs-sm);
    min-height: 1.25em;
    transition: color var(--transition-fast);
}

.form-feedback.success { color: var(--color-sage-dark); font-weight: 600; }
.form-feedback.error { color: var(--color-coral); font-weight: 600; }

.field-error {
    display: block;
    margin-top: var(--space-2);
    font-size: var(--fs-xs, 0.8rem);
    color: var(--color-coral);
    min-height: 1em;
}

.js-ajax-form input[aria-invalid="true"],
.js-ajax-form textarea[aria-invalid="true"] {
    border-color: var(--color-coral);
}

.js-ajax-form button[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* --- Radio group + required marker --- */
.form-label-text {
    display: block;
    font-size: var(--fs-sm);
    font-weight: 500;
    margin-bottom: var(--space-2);
}

.req { color: var(--color-coral); margin-left: 2px; }

.radio-group {
    display: flex;
    gap: var(--space-5);
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--fs-sm);
    cursor: pointer;
}

.radio-label input[type="radio"] {
    accent-color: var(--color-accent);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.js-legal-fields {
    padding-left: var(--space-3);
    border-left: 3px solid var(--color-base);
    margin-left: calc(-1 * var(--space-2));
    margin-bottom: var(--space-2);
}

.js-legal-fields[hidden] { display: none; }

/* --- News Filters --- */
.news-filters {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3);
    margin-bottom: var(--space-6);
    padding: var(--space-5);
    background: var(--color-base-light);
    border-radius: var(--radius-lg);
}

@media (min-width: 768px) {
    .news-filters { grid-template-columns: 2fr 1fr 1fr 1fr 1fr; align-items: end; }
}

.news-filter-group { display: flex; flex-direction: column; gap: var(--space-1); }

.news-filter-group label {
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-filter-input {
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    font-family: inherit;
    background: var(--color-white);
}

.news-filter-input:focus {
    border-color: var(--color-accent);
    outline: none;
}

.news-tags {
    margin-top: var(--space-3);
    font-size: var(--fs-xs);
    color: var(--color-accent-dark);
    font-weight: 600;
}

.news-no-results {
    text-align: center;
    padding: var(--space-8);
    color: var(--color-text-muted);
    font-size: var(--fs-lg);
}

/* ============================================================
   Fundraising, Checkout & Authentication Corrections
   ============================================================ */

/* --- Total Collected Displays --- */
.donate-total-under {
    margin-top: var(--space-6);
    padding: var(--space-4) var(--space-6);
    background: var(--color-base-light);
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid var(--color-border);
}

.donate-total-under .donate-total-label {
    display: block;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--space-1);
}

.donate-total-under .donate-total-amount {
    font-family: var(--font-heading);
    font-size: var(--fs-2xl);
    font-weight: 700;
    color: var(--color-accent-dark);
}

.cta-total-collected {
    margin-top: var(--space-4);
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--color-white);
    opacity: 0.9;
}

/* --- Checkout / Payment Gateway Styles --- */
.checkout-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
}

@media (min-width: 992px) {
    .checkout-wrapper {
        grid-template-columns: 1.1fr 1fr;
        align-items: start;
    }
}

.checkout-summary,
.checkout-form-container {
    padding: var(--space-6) var(--space-8);
}

.summary-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: var(--space-3);
}

.summary-header h3 {
    font-family: var(--font-heading);
    font-size: var(--fs-xl);
    color: var(--color-text);
}

.summary-details {
    margin-bottom: var(--space-6);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-2) 0;
    font-size: var(--fs-base);
}

.summary-row strong {
    color: var(--color-text);
}

/* Virtual Credit Card Mockup */
.virtual-card-wrapper {
    perspective: 1000px;
    width: 100%;
    max-width: 350px;
    margin: var(--space-4) auto 0;
}

.virtual-card {
    width: 100%;
    height: 200px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.virtual-card.flipped {
    transform: rotateY(180deg);
}

.virtual-card .card-front,
.virtual-card .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    box-sizing: border-box;
}

.virtual-card .card-front {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

.virtual-card .card-back {
    background: linear-gradient(135deg, #1c3666 0%, #23437c 100%);
    transform: rotateY(180deg);
    padding: 0;
    justify-content: flex-start;
}

.card-chip {
    width: 40px;
    height: 30px;
    background: linear-gradient(135deg, #f2c94c 0%, #f2994a 100%);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-2);
}

.card-brand {
    position: absolute;
    top: var(--space-5);
    right: var(--space-5);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--fs-lg);
    letter-spacing: 1px;
}

.card-number-display {
    font-family: monospace;
    font-size: var(--fs-lg);
    letter-spacing: 2px;
    margin: var(--space-4) 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.card-info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.card-label {
    display: block;
    font-size: 8px;
    text-transform: uppercase;
    opacity: 0.6;
    letter-spacing: 1px;
    margin-bottom: 2px;
}

#card-holder-display-val,
#card-expiry-display-val {
    font-size: var(--fs-sm);
    font-family: monospace;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

.card-magnetic-strip {
    width: 100%;
    height: 40px;
    background-color: #111;
    margin-top: var(--space-5);
}

.card-signature-area {
    margin: var(--space-5) var(--space-5) 0;
    background-color: #fff;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: var(--space-3);
    border-radius: var(--radius-sm);
}

.card-cvv-display {
    font-family: monospace;
    font-style: italic;
    font-weight: 700;
    color: #111;
    letter-spacing: 1px;
}

/* Checkout Form elements */
.amount-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

@media (min-width: 480px) {
    .amount-presets {
        grid-template-columns: repeat(5, 1fr);
    }
}

.amount-preset-btn {
    padding: var(--space-2) var(--space-1);
    font-size: var(--fs-xs);
    border-color: var(--color-border);
}

.amount-preset-btn.active {
    background-color: var(--color-accent);
    color: var(--color-white);
    border-color: var(--color-accent);
}

.amount-preset-btn.active:hover {
    background-color: var(--color-accent-dark);
    border-color: var(--color-accent-dark);
}

.custom-amount-wrapper input {
    font-family: var(--font-heading);
    font-size: var(--fs-lg);
    font-weight: 600;
    padding-right: var(--space-8);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

/* Spinner and Success Screens */
.payment-state-view {
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.spinner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
}

.payment-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--color-base);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: pay-spin 1s linear infinite;
}

@keyframes pay-spin {
    to { transform: rotate(360deg); }
}

.processing-text {
    font-size: var(--fs-base);
    font-weight: 500;
    color: var(--color-text-muted);
}

.success-animation-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.success-checkmark {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-4);
}

.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: var(--color-sage);
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-svg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: #fff;
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px var(--color-sage);
    animation: fill-check .4s ease-in-out .4s forwards, scale-check .3s ease-in-out .9s both;
}

.checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
    100% { stroke-dashoffset: 0; }
}
@keyframes scale-check {
    0%, 100% { transform: none; }
    50% { transform: scale3d(1.1, 1.1, 1); }
}
@keyframes fill-check {
    100% { box-shadow: inset 0px 0px 0px 40px var(--color-sage); }
}

.success-title {
    font-family: var(--font-heading);
    font-size: var(--fs-xl);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-2);
}

.success-message {
    color: var(--color-text-muted);
    font-size: var(--fs-sm);
    max-width: 320px;
    margin: 0 auto var(--space-4);
}

.receipt-box {
    width: 100%;
    max-width: 300px;
    background-color: var(--color-base-light);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    border: 1px dashed var(--color-border);
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    font-size: var(--fs-sm);
    padding: var(--space-1) 0;
}

.receipt-row span {
    color: var(--color-text-muted);
}

/* --- Authentication Pages (Login/Register) Styles --- */
.section-auth {
    min-height: calc(100vh - var(--header-height) - 160px);
    background-color: var(--color-base-light);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: var(--space-8) var(--space-6);
    box-shadow: var(--shadow-lg);
    background-color: var(--color-white);
}

@media (min-width: 480px) {
    .auth-card {
        padding: var(--space-8) var(--space-8);
    }
}

.auth-header {
    text-align: center;
    margin-bottom: var(--space-6);
}

.auth-header h2 {
    font-size: var(--fs-2xl);
    font-weight: 700;
    margin-bottom: var(--space-2);
    color: var(--color-text);
}

.auth-form .form-group {
    margin-bottom: var(--space-4);
}

.password-toggle-btn {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    height: calc(100% - 4px);
    padding: 0 var(--space-3);
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    transition: color var(--transition-fast);
}

.password-toggle-btn:hover {
    color: var(--color-accent-dark);
}

.password-toggle-btn.visible {
    color: var(--color-accent);
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: var(--space-5) 0;
    color: var(--color-text-muted);
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--color-border);
}

.auth-divider::before {
    margin-right: var(--space-3);
}

.auth-divider::after {
    margin-left: var(--space-3);
}

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.google-btn:hover {
    background-color: var(--color-base-light);
    border-color: var(--color-base);
    color: var(--color-text);
}

.google-icon {
    flex-shrink: 0;
}

.auth-footer {
    text-align: center;
    margin-top: var(--space-6);
    padding-top: var(--space-5);
    border-top: 1px solid var(--color-border);
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
}

.auth-link {
    color: var(--color-accent-dark);
    font-weight: 600;
}

.auth-link:hover {
    text-decoration: underline;
    color: var(--color-accent);
}

/* --- Project Progress Bars --- */
.project-progress {
    margin-top: var(--space-4);
    margin-bottom: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.project-progress .progress-bar-bg {
    width: 100%;
    height: 8px;
    background-color: var(--color-base);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.project-progress .progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
    border-radius: var(--radius-sm);
    transition: width 0.5s ease-out;
}

.project-progress .progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: var(--fs-xs);
    font-weight: 600;
}

.project-progress .progress-stats .collected {
    color: var(--color-text);
}

.project-progress .progress-stats .target {
    color: var(--color-text-muted);
}

/* --- Project Details Page Styles --- */

.project-detail-header-grid {
    align-items: center;
}

@media (max-width: 768px) {
    .project-detail-header-grid {
        display: flex;
        flex-direction: column-reverse;
        gap: var(--space-5);
    }
}

/* --- Image Slideshow Carousel --- */
.project-carousel {
    position: relative;
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    height: 480px;
    background-color: var(--color-base-light);
}

@media (max-width: 992px) {
    .project-carousel {
        height: 360px;
    }
}

@media (max-width: 576px) {
    .project-carousel {
        height: 260px;
    }
}

.carousel-track {
    display: flex;
    height: 100%;
    width: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-slide {
    min-width: 100%;
    width: 100%;
    height: 100%;
    flex-shrink: 0;
    display: block;
}

.carousel-slide svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-indicators {
    position: absolute;
    bottom: var(--space-4);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--space-2);
    z-index: 10;
}

.carousel-indicator-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    border: 1.5px solid rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.carousel-indicator-dot.active {
    background-color: var(--color-white);
    width: 24px;
    border-radius: var(--radius-lg);
    border-color: var(--color-white);
}

.carousel-indicator-dot:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

/* --- Navigation Tabs with Badges --- */
.project-tabs-nav-wrapper {
    border-bottom: 2px solid var(--color-border);
    margin-bottom: var(--space-5);
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
}

.project-tabs-nav-wrapper::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.project-tabs-nav {
    display: flex;
    gap: var(--space-6);
    min-width: max-content;
}

.tab-nav-btn {
    font-family: var(--ff-heading);
    font-size: var(--fs-sm);
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--color-text-muted);
    background: none;
    border: none;
    padding: var(--space-4) 0;
    position: relative;
    cursor: pointer;
    transition: color var(--transition-fast);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.tab-nav-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-accent-dark);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.tab-nav-btn.active {
    color: var(--color-accent-dark);
}

.tab-nav-btn.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

.tab-nav-btn:hover {
    color: var(--color-accent-dark);
}

.tab-badge {
    font-size: var(--fs-xs);
    background-color: var(--color-base);
    color: var(--color-text-muted);
    border-radius: var(--radius-full);
    padding: 2px 8px;
    font-weight: 600;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.tab-nav-btn.active .tab-badge {
    background-color: var(--color-accent-dark);
    color: var(--color-white);
}

/* --- Tab Panels Content --- */
.tab-panels-content {
    margin-bottom: var(--space-6);
}

.tab-panel {
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.tab-panel.active {
    display: block;
    opacity: 1;
}

.tab-panel-inner {
    text-align: left;
}

.tab-panel-inner h3 {
    margin-bottom: var(--space-3);
    font-family: var(--ff-heading);
}

/* --- Donors Table --- */
.donors-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background-color: var(--color-white);
}

.donors-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.donors-table th, .donors-table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border);
}

.donors-table th {
    background-color: var(--color-base-light);
    font-weight: 600;
    font-size: var(--fs-xs);
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.donors-table tr:last-child td {
    border-bottom: none;
}

.donor-amount {
    color: var(--color-accent-dark);
    font-weight: 700;
}

.anonymous-tag {
    color: var(--color-text-muted);
    font-style: italic;
}

/* --- Spendings list --- */
.spendings-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: var(--space-4);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.spendings-summary-text {
    text-align: left;
}

.spendings-total-card {
    background-color: var(--color-base-light);
    border: 1.5px dashed var(--color-accent);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-md);
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.total-label {
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    text-transform: uppercase;
    font-weight: 600;
    display: block;
}

.total-amount {
    font-size: var(--fs-lg);
    color: var(--color-accent-dark);
}

.spendings-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.spending-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background-color: var(--color-white);
}

.spending-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: var(--color-base);
}

.spending-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.spending-date {
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    font-weight: 500;
}

.spending-desc {
    font-size: var(--fs-base);
    margin: 0;
}

.spending-amount {
    font-weight: 700;
    color: var(--color-coral-dark);
    font-size: var(--fs-base);
    white-space: nowrap;
}

/* --- Comments layout --- */
.comments-section-layout {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: var(--space-6);
    align-items: start;
}

@media (max-width: 992px) {
    .comments-section-layout {
        grid-template-columns: 1fr;
    }
}

.comments-list-side {
    width: 100%;
}

.comments-form-side {
    width: 100%;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    max-height: 550px;
    overflow-y: auto;
    padding-right: var(--space-2);
}

.comment-item {
    padding: var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background-color: var(--color-white);
    border-left: 4px solid var(--color-accent-dark);
    text-align: left;
    transition: transform 0.2s ease;
}

.comment-item:hover {
    transform: scale(1.01);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
}

.comment-author {
    font-size: var(--fs-sm);
    color: var(--color-text);
}

.comment-date {
    font-size: var(--fs-xs);
}

.comment-text {
    margin: 0;
    font-size: var(--fs-sm);
    line-height: 1.6;
    color: var(--color-text);
    white-space: pre-line;
}

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

.comment-item-new {
    border-left-color: var(--color-sage-dark);
}
