/* ========================================
   CSS Variables & Reset
   ======================================== */

:root {
    /* Colors */
    --color-ink: #14313d;
    --color-teal: #1b6d67;
    --color-amber: #d9992a;
    --color-cream: #faf6ef;
    --color-white: #ffffff;
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;

    /* Typography */
    --font-display: 'Fraunces', serif;
    --font-body: 'Inter', sans-serif;

    /* Fluid Type Scale */
    --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
    --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
    --text-lg: clamp(1.125rem, 1.05rem + 0.375vw, 1.25rem);
    --text-xl: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
    --text-2xl: clamp(1.5rem, 1.35rem + 0.75vw, 1.875rem);
    --text-3xl: clamp(1.875rem, 1.65rem + 1.125vw, 2.25rem);
    --text-4xl: clamp(2.25rem, 1.95rem + 1.5vw, 3rem);
    --text-5xl: clamp(3rem, 2.5rem + 2.5vw, 4rem);

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    --space-3xl: 6rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(20, 49, 61, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(20, 49, 61, 0.08), 0 2px 4px -1px rgba(20, 49, 61, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(20, 49, 61, 0.1), 0 4px 6px -2px rgba(20, 49, 61, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(20, 49, 61, 0.1), 0 10px 10px -5px rgba(20, 49, 61, 0.04);

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Layout */
    --container-max: 1280px;
    --header-height: 80px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.7;
    color: var(--color-gray-800);
    background-color: var(--color-cream);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Typography
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.2;
    color: var(--color-ink);
    margin-bottom: 0.75em;
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
    margin-bottom: 1em;
}

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

a:hover {
    color: var(--color-amber);
}

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

/* ========================================
   Layout Utilities
   ======================================== */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-md);
    padding-right: var(--space-md);
}

@media (min-width: 768px) {
    .container {
        padding-left: var(--space-lg);
        padding-right: var(--space-lg);
    }
}

/* ========================================
   Top Bar
   ======================================== */

.top-bar {
    background: linear-gradient(135deg, var(--color-ink) 0%, var(--color-teal) 100%);
    color: var(--color-white);
    font-size: var(--text-sm);
    padding: var(--space-xs) 0;
}

.top-bar-content {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.top-bar-contacts {
    display: flex;
    gap: var(--space-lg);
}

.top-bar-link {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--color-white);
    opacity: 0.9;
    transition: opacity var(--transition-fast);
}

.top-bar-link:hover {
    color: var(--color-white);
    opacity: 1;
}

@media (max-width: 640px) {
    .top-bar-contacts {
        flex-direction: column;
        gap: var(--space-xs);
        align-items: flex-end;
    }
}

/* ========================================
   Header & Navigation
   ======================================== */

.site-header {
    background: var(--color-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: box-shadow var(--transition-base);
}

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

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) 0;
    gap: var(--space-lg);
}

.site-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--color-ink);
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 700;
    text-decoration: none;
    transition: transform var(--transition-base);
}

.site-logo:hover {
    color: var(--color-ink);
    transform: translateY(-1px);
}

.logo-mark {
    color: var(--color-teal);
    flex-shrink: 0;
}

.logo-image {
    max-height: 48px;
    width: auto;
}

.site-name {
    white-space: nowrap;
}

@media (max-width: 480px) {
    .site-name {
        font-size: var(--text-base);
    }
}

.main-nav {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.nav-link {
    color: var(--color-gray-700);
    font-weight: 500;
    font-size: var(--text-sm);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--color-teal);
    transition: width var(--transition-base);
}

.nav-link:hover {
    color: var(--color-teal);
    background: rgba(27, 109, 103, 0.05);
}

.nav-link:hover::after {
    width: 80%;
}

.nav-link.active {
    color: var(--color-teal);
    font-weight: 600;
}

.nav-link.active::after {
    width: 80%;
}

.nav-link-donate {
    background: linear-gradient(135deg, var(--color-amber) 0%, #c98915 100%);
    color: var(--color-white);
    font-weight: 600;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
}

.nav-link-donate:hover {
    color: var(--color-white);
    background: linear-gradient(135deg, #c98915 0%, var(--color-amber) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.nav-link-donate::after {
    display: none;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-xs);
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-ink);
    transition: all var(--transition-base);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translateY(8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translateY(-8px);
}

@media (max-width: 1024px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .main-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--color-white);
        flex-direction: column;
        align-items: stretch;
        padding: var(--space-lg);
        gap: var(--space-sm);
        box-shadow: var(--shadow-xl);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-base);
        max-height: calc(100vh - var(--header-height));
        overflow-y: auto;
    }

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

    .nav-link {
        padding: var(--space-md);
        text-align: center;
        font-size: var(--text-base);
    }

    .nav-link::after {
        display: none;
    }
}

/* ========================================
   Buttons
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-lg);
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-teal) 0%, #156660 100%);
    color: var(--color-white);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #156660 0%, var(--color-teal) 100%);
    color: var(--color-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--color-amber) 0%, #c98915 100%);
    color: var(--color-white);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #c98915 0%, var(--color-amber) 100%);
    color: var(--color-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

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

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: var(--text-lg);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ========================================
   Cards
   ======================================== */

.card {
    background: var(--color-white);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: all var(--transition-base);
}

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

.card-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: linear-gradient(135deg, var(--color-gray-100) 0%, var(--color-gray-200) 100%);
}

.card-content {
    padding: var(--space-lg);
}

.card-title {
    font-size: var(--text-xl);
    margin-bottom: var(--space-sm);
}

.card-text {
    color: var(--color-gray-600);
    margin-bottom: var(--space-md);
}

/* ========================================
   Sections
   ======================================== */

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

.section-alt {
    background: var(--color-white);
}

.section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto var(--space-2xl);
}

.section-title {
    font-size: var(--text-4xl);
    margin-bottom: var(--space-sm);
}

.section-subtitle {
    color: var(--color-gray-600);
    font-size: var(--text-lg);
    font-weight: 400;
}

.section-accent {
    color: var(--color-amber);
    font-weight: 600;
}

/* ========================================
   Grid Layouts
   ======================================== */

.grid {
    display: grid;
    gap: var(--space-lg);
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

@media (max-width: 640px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Hero Section
   ======================================== */

.hero {
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, var(--color-ink) 0%, var(--color-teal) 100%);
}

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

.hero-background img,
.hero-background svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.2;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: var(--color-white);
    max-width: 900px;
    padding: var(--space-2xl);
}

.hero-title {
    color: var(--color-white);
    font-size: var(--text-5xl);
    margin-bottom: var(--space-md);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: var(--text-xl);
    margin-bottom: var(--space-xl);
    opacity: 0.95;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: center;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .hero {
        min-height: 500px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn {
        width: 100%;
    }
}

/* ========================================
   Stats Band
   ======================================== */

.stats-band {
    background: var(--color-ink);
    color: var(--color-white);
    padding: var(--space-2xl) 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-xl);
    text-align: center;
}

.stat-item {
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-slow);
}

.stat-item.reveal {
    opacity: 1;
    transform: translateY(0);
}

.stat-number {
    font-family: var(--font-display);
    font-size: var(--text-5xl);
    font-weight: 700;
    color: var(--color-amber);
    display: block;
    margin-bottom: var(--space-xs);
}

.stat-label {
    font-size: var(--text-lg);
    opacity: 0.9;
}

/* ========================================
   Badge
   ======================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-md);
    background: var(--color-amber);
    color: var(--color-white);
    font-size: var(--text-sm);
    font-weight: 600;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-teal {
    background: var(--color-teal);
}

.badge-outline {
    background: transparent;
    border: 2px solid var(--color-teal);
    color: var(--color-teal);
}

/* ========================================
   Date Badge
   ======================================== */

.date-badge {
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: var(--space-sm);
    text-align: center;
    box-shadow: var(--shadow-lg);
    min-width: 60px;
}

.date-badge-day {
    display: block;
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--color-teal);
    line-height: 1;
}

.date-badge-month {
    display: block;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--color-gray-600);
    text-transform: uppercase;
    margin-top: 2px;
}

/* ========================================
   Forms
   ======================================== */

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

.form-label {
    display: block;
    font-weight: 600;
    color: var(--color-gray-700);
    margin-bottom: var(--space-xs);
    font-size: var(--text-sm);
}

.form-label-required::after {
    content: ' *';
    color: #dc2626;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-body);
    font-size: var(--text-base);
    color: var(--color-gray-800);
    background: var(--color-white);
    border: 2px solid var(--color-gray-300);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-teal);
    box-shadow: 0 0 0 3px rgba(27, 109, 103, 0.1);
}

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

.form-error {
    color: #dc2626;
    font-size: var(--text-sm);
    margin-top: var(--space-xs);
}

/* ========================================
   Alert
   ======================================== */

.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    display: flex;
    gap: var(--space-sm);
    align-items: flex-start;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* ========================================
   Pagination
   ======================================== */

.pagination {
    display: flex;
    gap: var(--space-xs);
    justify-content: center;
    align-items: center;
    margin-top: var(--space-2xl);
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-md);
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.pagination a {
    color: var(--color-gray-700);
    background: var(--color-white);
    border: 1px solid var(--color-gray-300);
}

.pagination a:hover {
    color: var(--color-teal);
    border-color: var(--color-teal);
    background: rgba(27, 109, 103, 0.05);
}

.pagination .active span {
    background: var(--color-teal);
    color: var(--color-white);
    border: 1px solid var(--color-teal);
}

/* ========================================
   Lightbox
   ======================================== */

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(20, 49, 61, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: var(--color-white);
    font-size: 40px;
    cursor: pointer;
    padding: var(--space-sm);
    line-height: 1;
}

.lightbox-caption {
    color: var(--color-white);
    text-align: center;
    margin-top: var(--space-md);
    font-size: var(--text-lg);
}

/* ========================================
   Footer
   ======================================== */

.site-footer {
    background: var(--color-ink);
    color: var(--color-white);
    padding-top: var(--space-3xl);
}

.footer-main {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-2xl);
    padding-bottom: var(--space-2xl);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-col {
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-slow);
}

.footer-col.reveal {
    opacity: 1;
    transform: translateY(0);
}

.footer-about .footer-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--color-white);
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 700;
    margin-bottom: var(--space-md);
}

.footer-about-text {
    opacity: 0.8;
    line-height: 1.8;
}

.footer-heading {
    font-size: var(--text-lg);
    margin-bottom: var(--space-md);
    color: var(--color-white);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--space-sm);
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    transition: all var(--transition-fast);
}

.footer-links a:hover {
    color: var(--color-amber);
    padding-left: var(--space-xs);
}

.footer-contact p {
    opacity: 0.8;
    margin-bottom: var(--space-sm);
}

.footer-contact a {
    color: var(--color-white);
}

.footer-social {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    color: var(--color-white);
    transition: all var(--transition-base);
}

.social-link:hover {
    background: var(--color-amber);
    color: var(--color-white);
    transform: translateY(-3px);
}

.footer-bottom {
    padding: var(--space-lg) 0;
}

.footer-bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
    font-size: var(--text-sm);
    opacity: 0.7;
}

.footer-affiliation {
    font-weight: 500;
}

.footer-copyright {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    flex-wrap: wrap;
}

.footer-divider {
    opacity: 0.5;
}

.footer-admin-link {
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--text-xs);
}

.footer-admin-link:hover {
    color: var(--color-amber);
}

@media (max-width: 768px) {
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
}

/* ========================================
   Reveal on Scroll Animation
   ======================================== */

.reveal-item {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal-item.reveal {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation delays */
.reveal-item:nth-child(1) { transition-delay: 0.1s; }
.reveal-item:nth-child(2) { transition-delay: 0.2s; }
.reveal-item:nth-child(3) { transition-delay: 0.3s; }
.reveal-item:nth-child(4) { transition-delay: 0.4s; }
.reveal-item:nth-child(5) { transition-delay: 0.5s; }
.reveal-item:nth-child(6) { transition-delay: 0.6s; }

/* ========================================
   Utility Classes
   ======================================== */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

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