/*
 * Clan Henderson Society - Heritage Design System
 * Mobile-first responsive design built on Henderson Tartan colors
 * Bootstrap 5.3.8 companion stylesheet
 *
 * Table of Contents:
 *   1. Design Tokens (CSS Custom Properties)
 *   2. Base / Reset
 *   3. Typography
 *   4. Navigation
 *   5. Hero Sections
 *   6. Buttons
 *   7. Cards
 *   8. Sections & Layout
 *   9. Data Display (Tables, Grids, Badges)
 *  10. Forms
 *  11. Directory & Officer Components
 *  12. Timeline & Events
 *  13. Footer
 *  14. Tartan Effects & Dividers
 *  15. Utility Classes
 *  16. Animations
 *  17. Scroll-Reveal
 *  18. Accessibility
 *  19. Print Styles
 */

/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */

:root {
    /* Henderson Tartan Palette — green scale */
    --chs-green-900: #062E18;
    --chs-green-800: #0A4F28;
    --chs-green-700: #1A6B3A;
    --chs-green-600: #2D6945;
    --chs-green-500: #3D8B5A;
    --chs-green-400: #5BA87A;
    --chs-green-300: #8BC4A0;
    --chs-green-200: #C1DFD0;
    --chs-green-100: #E8F5EE;
    --chs-green-50:  #F2FAF6;

    /* Blue scale */
    --chs-blue-800: #0E3D7A;
    --chs-blue-700: #1A5FB4;
    --chs-blue-600: #2B72C9;
    --chs-blue-500: #4A8FDE;
    --chs-blue-400: #7AB3EE;
    --chs-blue-300: #B0D4F7;
    --chs-blue-200: #D6EAFC;
    --chs-blue-100: #EBF4FE;

    /* Gold scale */
    --chs-gold-700: #B8860B;
    --chs-gold-600: #D4A017;
    --chs-gold-500: #EAB308;
    --chs-gold-400: #F0C940;
    --chs-gold-300: #F5DC78;
    --chs-gold-200: #FAF0BE;
    --chs-gold-100: #FEFCE8;

    /* Semantic color aliases */
    --color-primary: var(--chs-green-800);
    --color-primary-light: var(--chs-green-600);
    --color-primary-hover: var(--chs-green-700);
    --color-secondary: var(--chs-blue-700);
    --color-secondary-hover: var(--chs-blue-600);
    --color-accent: var(--chs-gold-500);
    --color-accent-hover: var(--chs-gold-600);

    /* Text colors */
    --color-foreground: #0C3A1F;
    --color-muted: #6B7C70;
    --color-muted-dark: #4A5B50;

    /* Surfaces */
    --surface-0: #FFFFFF;
    --surface-1: var(--chs-green-50);
    --surface-2: var(--chs-green-100);
    --surface-elevated: #FFFFFF;
    --color-background: #FFFFFF;
    --color-card: #FFFFFF;
    --color-muted-bg: #F5F7F6;

    /* Borders */
    --color-border: #D9E1DD;
    --color-border-light: #E8EDEA;

    /* Status colors */
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-danger: #EF4444;
    --color-info: #3B82F6;

    /* Typography */
    --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-accent: 'Cormorant Garamond', Georgia, serif;

    /* Fluid type scale */
    --text-xs:  clamp(0.75rem, 0.7rem + 0.25vw, 0.8rem);
    --text-sm:  clamp(0.8rem, 0.77rem + 0.25vw, 0.9rem);
    --text-base: clamp(0.95rem, 0.9rem + 0.25vw, 1.05rem);
    --text-lg:  clamp(1.1rem, 1rem + 0.5vw, 1.25rem);
    --text-xl:  clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
    --text-2xl: clamp(1.5rem, 1.2rem + 1.5vw, 2rem);
    --text-3xl: clamp(1.875rem, 1.5rem + 1.875vw, 2.5rem);
    --text-4xl: clamp(2.25rem, 1.75rem + 2.5vw, 3.5rem);
    --text-5xl: clamp(3rem, 2rem + 3vw, 4.5rem);

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

    /* Shadows (layered for depth) */
    --shadow-xs: 0 1px 2px rgba(10, 79, 40, 0.05);
    --shadow-sm: 0 2px 4px rgba(10, 79, 40, 0.08);
    --shadow-md: 0 4px 12px rgba(10, 79, 40, 0.1);
    --shadow-lg: 0 8px 24px rgba(10, 79, 40, 0.12);
    --shadow-xl: 0 12px 40px rgba(10, 79, 40, 0.16);
    --shadow-glow: 0 0 20px rgba(234, 179, 8, 0.3);
    /* Legacy aliases */
    --shadow-elegant: var(--shadow-xl);
    --shadow-card: var(--shadow-md);

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 400ms;

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

    /* Section rhythm */
    --section-padding: var(--space-12);
}

@media (min-width: 768px) {
    :root {
        --section-padding: var(--space-16);
    }
}

@media (min-width: 992px) {
    :root {
        --section-padding: var(--space-20);
    }
}


/* ==========================================================================
   2. BASE / RESET
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

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

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

a {
    color: var(--color-primary);
    text-decoration-color: var(--chs-green-300);
    text-underline-offset: 0.15em;
    transition: color var(--duration-fast) var(--ease-out),
                text-decoration-color var(--duration-fast) var(--ease-out);
}

a:hover {
    color: var(--color-primary-hover);
    text-decoration-color: var(--color-primary);
}


/* ==========================================================================
   3. TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    color: var(--color-foreground);
    font-weight: 700;
    line-height: 1.25;
    margin-top: 0;
}

h1 { font-size: var(--text-4xl); line-height: 1.15; }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl);  }
h5 { font-size: var(--text-lg);  }
h6 { font-size: var(--text-base); font-weight: 600; }

.text-accent {
    font-family: var(--font-accent);
}

.text-motto {
    font-family: var(--font-accent);
    font-style: italic;
    font-size: var(--text-lg);
    color: var(--color-muted);
}

.section-heading {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-2);
}

.section-subheading {
    font-size: var(--text-lg);
    color: var(--color-muted);
    font-family: var(--font-sans);
    font-weight: 400;
    max-width: 640px;
}

.section-header {
    margin-bottom: var(--space-8);
}

.section-header.text-center .section-subheading {
    margin-left: auto;
    margin-right: auto;
}

/* Rich text content from Wagtail */
.rich-text h2 { margin-top: var(--space-8); margin-bottom: var(--space-4); }
.rich-text h3 { margin-top: var(--space-6); margin-bottom: var(--space-3); }
.rich-text p  { margin-bottom: var(--space-4); }
.rich-text ul,
.rich-text ol { margin-bottom: var(--space-4); padding-left: var(--space-6); }
.rich-text li { margin-bottom: var(--space-2); }
.rich-text blockquote {
    border-left: 4px solid var(--color-accent);
    padding: var(--space-4) var(--space-6);
    margin: var(--space-6) 0;
    background: var(--surface-1);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-family: var(--font-accent);
    font-size: var(--text-lg);
    font-style: italic;
}
.rich-text img {
    border-radius: var(--radius-lg);
    margin: var(--space-4) 0;
}


/* ==========================================================================
   4. NAVIGATION
   ========================================================================== */

.navbar-heritage {
    background: rgba(10, 79, 40, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 2px solid var(--color-accent);
    padding: var(--space-2) 0;
    transition: box-shadow var(--duration-normal) var(--ease-out),
                background var(--duration-normal) var(--ease-out);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.navbar-heritage.navbar-scrolled {
    background: rgba(10, 79, 40, 0.98);
    box-shadow: var(--shadow-lg);
    border-bottom-color: var(--chs-gold-600);
}

.navbar-heritage .navbar-brand {
    font-family: var(--font-serif);
    font-size: var(--text-lg);
    font-weight: 700;
    color: white !important;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.navbar-heritage .navbar-brand img {
    height: 36px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

@media (min-width: 992px) {
    .navbar-heritage .navbar-brand img {
        height: 42px;
    }
}

.navbar-heritage .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    font-size: var(--text-sm);
    transition: color var(--duration-fast) var(--ease-out),
                background-color var(--duration-fast) var(--ease-out);
    padding: var(--space-2) var(--space-3) !important;
    border-radius: var(--radius-sm);
    position: relative;
}

.navbar-heritage .nav-link:hover,
.navbar-heritage .nav-link:focus-visible {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.1);
}

.navbar-heritage .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: var(--space-3);
    right: var(--space-3);
    height: 2px;
    background: var(--color-accent);
    border-radius: 1px;
}

/* Dropdown menus */
.navbar-heritage .dropdown-menu-heritage {
    background: var(--chs-green-800);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-top: 2px solid var(--color-accent);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-xl);
    padding: var(--space-2) 0;
    margin-top: 0;
    min-width: 220px;
}

.navbar-heritage .dropdown-menu-heritage .dropdown-item {
    color: rgba(255, 255, 255, 0.85);
    padding: var(--space-2) var(--space-5);
    font-size: var(--text-sm);
    transition: all var(--duration-fast) var(--ease-out);
}

.navbar-heritage .dropdown-menu-heritage .dropdown-item:hover,
.navbar-heritage .dropdown-menu-heritage .dropdown-item:focus-visible {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.navbar-heritage .dropdown-menu-heritage .dropdown-divider {
    border-color: rgba(255, 255, 255, 0.12);
    margin: var(--space-1) 0;
}

.navbar-heritage .nav-link.dropdown-toggle::after {
    margin-left: 0.35em;
    vertical-align: 0.15em;
}

/* Join button in nav */
.navbar-heritage .btn-join {
    background: var(--color-accent) !important;
    color: var(--color-primary) !important;
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: var(--space-2) var(--space-4) !important;
    transition: background var(--duration-fast) var(--ease-out),
                transform var(--duration-fast) var(--ease-out);
}

.navbar-heritage .btn-join:hover {
    background: var(--chs-gold-400) !important;
    transform: translateY(-1px);
}

/* Mobile nav adjustments */
@media (max-width: 991.98px) {
    .navbar-heritage .navbar-collapse {
        padding: var(--space-4) 0;
    }

    .navbar-heritage .dropdown-menu-heritage {
        background: transparent;
        border: none;
        box-shadow: none;
        padding-left: var(--space-4);
    }

    .navbar-heritage .dropdown-menu-heritage .dropdown-item {
        padding: var(--space-2) var(--space-4);
    }

    .navbar-heritage .dropdown-menu-heritage .dropdown-divider {
        display: none;
    }

    .navbar-heritage .btn-join {
        margin-left: 0 !important;
        margin-top: var(--space-2);
        display: inline-block;
    }
}


/* ==========================================================================
   5. HERO SECTIONS
   ========================================================================== */

/* ── Homepage hero ── */
.heritage-hero {
    min-height: 85vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: var(--chs-green-900);
    background-size: cover;
    background-position: center;
}

@media (min-width: 768px) {
    .heritage-hero {
        min-height: 90vh;
    }
}

/* Dark gradient overlay for text readability over photo */
.heritage-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(6, 46, 24, 0.6) 0%,
        rgba(10, 79, 40, 0.45) 40%,
        rgba(10, 79, 40, 0.55) 70%,
        rgba(6, 46, 24, 0.75) 100%
    );
    z-index: 1;
}

/* No decorative ::after element */
.heritage-hero::after {
    display: none;
}

/* Tartan accent strip at bottom of hero */
.heritage-hero-tartan-strip {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 6px;
    z-index: 10;
    background: repeating-linear-gradient(
        90deg,
        var(--chs-green-800) 0px,
        var(--chs-green-800) 40px,
        var(--chs-gold-500) 40px,
        var(--chs-gold-500) 44px,
        var(--chs-blue-700) 44px,
        var(--chs-blue-700) 84px,
        var(--chs-gold-500) 84px,
        var(--chs-gold-500) 88px
    );
}

.heritage-hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: white;
    max-width: 900px;
    padding: var(--space-6) var(--space-4);
}

@media (min-width: 768px) {
    .heritage-hero-content {
        padding: var(--space-8) var(--space-8);
    }
}

/* Frosted glass card inside hero */
.heritage-hero-card {
    background: rgba(10, 79, 40, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-2xl);
    padding: var(--space-8) var(--space-6);
    max-width: 720px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .heritage-hero-card {
        padding: var(--space-12) var(--space-10);
    }
}

.heritage-hero h1 {
    font-size: var(--text-4xl);
    font-weight: 700;
    color: white;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-bottom: var(--space-4);
}

@media (min-width: 768px) {
    .heritage-hero h1 {
        font-size: var(--text-5xl);
    }
}

.heritage-hero .clan-badge {
    width: 4rem;
    height: 4rem;
    margin: 0 auto var(--space-4);
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
    animation: heroFadeIn 0.8s var(--ease-out);
}

@media (min-width: 768px) {
    .heritage-hero .clan-badge {
        width: 5rem;
        height: 5rem;
        margin-bottom: var(--space-6);
    }
}

@keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(-10px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.heritage-hero .motto {
    font-size: var(--text-lg);
    font-style: italic;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--space-3);
    font-family: var(--font-accent);
}

@media (min-width: 768px) {
    .heritage-hero .motto {
        font-size: var(--text-xl);
    }
}

.heritage-hero .lead {
    font-size: var(--text-base);
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: var(--space-8);
    line-height: 1.8;
}

@media (min-width: 768px) {
    .heritage-hero .lead {
        font-size: var(--text-lg);
    }
}

.heritage-hero .btn-group-hero {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    justify-content: center;
}

@media (min-width: 480px) {
    .heritage-hero .btn-group-hero {
        flex-direction: row;
    }
}

/* ── Inner page header ── */
.page-header {
    background: linear-gradient(135deg, var(--chs-green-800), var(--chs-green-700));
    color: white;
    padding: var(--space-10) 0 var(--space-8);
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('/static/images/henderson-tartan.gif');
    background-size: 300px 300px;
    background-repeat: repeat;
    opacity: 0.06;
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent), var(--chs-gold-300), var(--color-accent));
}

.page-header .container {
    position: relative;
    z-index: 1;
}

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

@media (min-width: 768px) {
    .page-header h1 {
        font-size: var(--text-4xl);
    }
}

.page-header p {
    color: rgba(255, 255, 255, 0.85);
    font-size: var(--text-lg);
    margin-bottom: 0;
}

/* Page header with featured image */
.page-header--featured {
    min-height: 280px;
    display: flex;
    align-items: flex-end;
    background-size: cover;
    background-position: center;
}

@media (min-width: 768px) {
    .page-header--featured {
        min-height: 360px;
    }
}

.page-header--featured::before {
    background: linear-gradient(to top, rgba(6, 46, 24, 0.9) 0%, rgba(10, 79, 40, 0.6) 50%, rgba(10, 79, 40, 0.3) 100%);
    background-image: none;
    opacity: 1;
}

/* Breadcrumbs */
.breadcrumb-heritage {
    padding: var(--space-3) 0;
    font-size: var(--text-sm);
}

.breadcrumb-heritage a {
    color: var(--chs-green-300);
    text-decoration: none;
}

.breadcrumb-heritage a:hover {
    color: white;
}

.breadcrumb-heritage .separator {
    color: var(--chs-green-400);
    margin: 0 var(--space-2);
}


/* ==========================================================================
   6. BUTTONS
   ========================================================================== */

.btn-chs {
    background: linear-gradient(135deg, var(--chs-green-800), var(--chs-green-700));
    border: none;
    color: white;
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-base);
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--duration-normal) var(--ease-out);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.btn-chs:hover {
    background: linear-gradient(135deg, var(--chs-green-700), var(--chs-green-600));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

.btn-chs:active {
    transform: translateY(0);
}

.btn-chs:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

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

.btn-chs-outline {
    background: transparent;
    border: 2px solid var(--chs-green-800);
    color: var(--chs-green-800);
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-base);
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--duration-normal) var(--ease-out);
    cursor: pointer;
}

.btn-chs-outline:hover {
    background: var(--chs-green-800);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-chs-outline:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.btn-chs-gold {
    background: linear-gradient(135deg, var(--chs-gold-500), var(--chs-gold-600));
    border: none;
    color: var(--chs-green-900);
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-base);
    font-weight: 700;
    border-radius: var(--radius-md);
    transition: all var(--duration-normal) var(--ease-out);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.btn-chs-gold:hover {
    background: linear-gradient(135deg, var(--chs-gold-400), var(--chs-gold-500));
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
    color: var(--chs-green-900);
}

.btn-chs-gold:focus-visible {
    outline: 2px solid var(--chs-green-800);
    outline-offset: 2px;
}

.btn-chs-ghost {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    border: 2px solid rgba(255, 255, 255, 0.6);
    color: white;
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-base);
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--duration-normal) var(--ease-out);
    cursor: pointer;
}

.btn-chs-ghost:hover {
    background: white;
    color: var(--color-primary);
    border-color: white;
}

.btn-chs-ghost:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Large button variant */
.btn-chs-lg,
.btn-chs-outline-lg,
.btn-chs-gold-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-lg);
}

/* Legacy button aliases */
.btn-heritage { /* legacy alias for btn-chs */
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    border: none;
    color: white;
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-base);
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--duration-normal) var(--ease-out);
    box-shadow: var(--shadow-md);
}

.btn-heritage:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary));
    color: white;
}

.btn-hero {
    background: white;
    color: var(--color-primary);
    border: 2px solid white;
    padding: var(--space-3) var(--space-8);
    font-size: var(--text-lg);
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--duration-normal) var(--ease-out);
}

.btn-hero:hover {
    background: transparent;
    color: white;
    border-color: white;
}

.btn-hero-outline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.7);
    padding: var(--space-3) var(--space-8);
    font-size: var(--text-lg);
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--duration-normal) var(--ease-out);
}

.btn-hero-outline:hover {
    background: white;
    color: var(--color-primary);
    border-color: white;
}


/* ==========================================================================
   7. CARDS
   ========================================================================== */

/* ── Base card ── */
.chs-card {
    background: var(--color-card);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--duration-normal) var(--ease-out),
                transform var(--duration-normal) var(--ease-out);
    position: relative;
    overflow: hidden;
}

.chs-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.chs-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--chs-green-800), var(--chs-green-600), var(--chs-blue-700));
    opacity: 0.8;
    transition: height var(--duration-fast) var(--ease-out);
}

.chs-card:hover::before {
    height: 5px;
    opacity: 1;
}

.chs-card-title {
    font-family: var(--font-serif);
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-foreground);
    margin-bottom: var(--space-3);
}

.chs-card-body {
    color: var(--color-muted);
    font-size: var(--text-base);
    line-height: 1.7;
}

/* Card without hover effect */
.chs-card-static {
    composes: chs-card;
}
.chs-card-static:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
}

/* ── Featured card ── */
.chs-card-featured {
    background: var(--color-card);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--duration-normal) var(--ease-out),
                transform var(--duration-normal) var(--ease-out);
}

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

.chs-card-featured .card-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}

@media (min-width: 768px) {
    .chs-card-featured .card-image {
        height: 240px;
    }
}

.chs-card-featured .card-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(0,0,0,0.4), transparent);
}

.chs-card-featured .card-content {
    padding: var(--space-6);
}

/* ── Officer card ── */
.chs-card-officer {
    background: var(--color-card);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--duration-normal) var(--ease-out),
                transform var(--duration-normal) var(--ease-out);
}

.chs-card-officer:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.chs-card-officer .officer-photo {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 3px solid var(--chs-green-200);
    margin: 0 auto var(--space-4);
    display: block;
    box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
    .chs-card-officer .officer-photo {
        width: 120px;
        height: 120px;
    }
}

.chs-card-officer .officer-name {
    font-family: var(--font-serif);
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--color-foreground);
    margin-bottom: var(--space-1);
}

.chs-card-officer .officer-role {
    font-size: var(--text-sm);
    color: var(--color-primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-3);
}

.chs-card-officer .officer-contact {
    font-size: var(--text-sm);
    color: var(--color-muted);
}

.chs-card-officer .officer-contact a {
    color: var(--color-secondary);
}

/* Officer placeholder for vacant positions */
.chs-card-officer--vacant {
    border-style: dashed;
    border-color: var(--color-border);
    background: var(--surface-1);
}

.chs-card-officer--vacant .officer-photo {
    background: var(--chs-green-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--chs-green-400);
    font-size: 2rem;
}

/* ── Event card ── */
.chs-card-event {
    background: var(--color-card);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--duration-normal) var(--ease-out),
                transform var(--duration-normal) var(--ease-out);
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .chs-card-event--horizontal {
        flex-direction: row;
    }
}

.chs-card-event:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.chs-card-event .event-date-badge {
    background: linear-gradient(135deg, var(--chs-green-800), var(--chs-green-700));
    color: white;
    text-align: center;
    padding: var(--space-3) var(--space-4);
    min-width: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.chs-card-event .event-date-badge .month {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    opacity: 0.9;
}

.chs-card-event .event-date-badge .day {
    font-size: var(--text-2xl);
    font-weight: 700;
    font-family: var(--font-serif);
    line-height: 1;
}

.chs-card-event .event-content {
    padding: var(--space-4) var(--space-5);
    flex: 1;
}

.chs-card-event .event-title {
    font-family: var(--font-serif);
    font-size: var(--text-lg);
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.chs-card-event .event-location {
    font-size: var(--text-sm);
    color: var(--color-muted);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* ── Stat card ── */
.chs-card-stat {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
    text-align: center;
    border-top: 4px solid var(--color-primary);
    transition: all var(--duration-normal) var(--ease-out);
}

.chs-card-stat:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.chs-card-stat .stat-number {
    font-size: var(--text-4xl);
    font-weight: 700;
    color: var(--color-primary);
    font-family: var(--font-serif);
    line-height: 1;
    margin-bottom: var(--space-2);
}

.chs-card-stat .stat-label {
    color: var(--color-muted);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.chs-card-stat .stat-trend {
    font-size: var(--text-xs);
    margin-top: var(--space-2);
    font-weight: 600;
}

.chs-card-stat .stat-trend.up { color: var(--color-success); }
.chs-card-stat .stat-trend.down { color: var(--color-danger); }

/* Legacy card alias */
.heritage-card {
    background: var(--color-card);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-md);
    transition: all var(--duration-normal) var(--ease-out);
    position: relative;
    overflow: hidden;
}

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

.heritage-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--chs-green-800), var(--chs-green-600), var(--chs-blue-700));
}

.membership-card {
    background: linear-gradient(135deg, var(--color-card), var(--color-muted-bg));
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.membership-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 8rem;
    height: 8rem;
    background-image: url('/static/images/henderson-tartan.gif');
    background-size: 80px 80px;
    background-repeat: repeat;
    opacity: 0.15;
    transform: translate(2rem, -2rem) rotate(45deg);
}

/* Legacy stat card alias */
.stat-card-heritage {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-md);
    text-align: center;
    border-top: 4px solid var(--color-primary);
    transition: all var(--duration-normal) var(--ease-out);
}

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

.stat-card-heritage .stat-number {
    font-size: var(--text-4xl);
    font-weight: 700;
    color: var(--color-primary);
    font-family: var(--font-serif);
    margin: var(--space-2) 0;
}

.stat-card-heritage .stat-label {
    color: var(--color-muted);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}


/* ==========================================================================
   8. SECTIONS & LAYOUT
   ========================================================================== */

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

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

@media (min-width: 768px) {
    .chs-section-sm {
        padding: var(--space-12) 0;
    }
}

.chs-section-muted {
    background-color: var(--surface-1);
}

.chs-section-dark {
    background: var(--chs-green-900);
    color: white;
    position: relative;
}

.chs-section-dark::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('/static/images/henderson-tartan.gif');
    background-size: 200px 200px;
    background-repeat: repeat;
    opacity: 0.04;
}

.chs-section-dark .container {
    position: relative;
    z-index: 1;
}

.chs-section-dark h2,
.chs-section-dark h3,
.chs-section-dark h4 {
    color: white;
}

.chs-section-dark p {
    color: rgba(255, 255, 255, 0.85);
}

.chs-section-hero {
    position: relative;
    background-size: cover;
    background-position: center;
    color: white;
    overflow: hidden;
}

.chs-section-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(10, 79, 40, 0.85), rgba(26, 95, 180, 0.75));
}

.chs-section-hero .container {
    position: relative;
    z-index: 1;
}

/* Legacy section aliases */
.heritage-section {
    padding: var(--section-padding) 0;
}

.heritage-section-muted {
    background-color: var(--color-muted-bg);
}

.heritage-section-primary {
    background: var(--color-primary);
    color: white;
    position: relative;
}

.heritage-section-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('/static/images/henderson-tartan.gif');
    background-size: 200px 200px;
    background-repeat: repeat;
    opacity: 0.04;
}


/* ==========================================================================
   9. DATA DISPLAY — Tables, Grids, Badges
   ========================================================================== */

/* ── Tables ── */
.chs-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    font-size: var(--text-sm);
}

.chs-table thead {
    background: linear-gradient(135deg, var(--chs-green-800), var(--chs-green-700));
    color: white;
}

.chs-table thead th {
    padding: var(--space-3) var(--space-4);
    font-weight: 600;
    font-size: var(--text-sm);
    text-align: left;
    border: none;
    white-space: nowrap;
}

.chs-table tbody tr {
    border-bottom: 1px solid var(--color-border-light);
    transition: background-color var(--duration-fast) var(--ease-out);
}

.chs-table tbody tr:last-child {
    border-bottom: none;
}

.chs-table tbody tr:nth-child(even) {
    background-color: var(--surface-1);
}

.chs-table tbody tr:hover {
    background-color: var(--chs-green-50);
}

.chs-table tbody td {
    padding: var(--space-3) var(--space-4);
    vertical-align: middle;
}

/* Responsive table wrapper */
.chs-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg);
}

/* Legacy table alias */
.table-heritage {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table-heritage thead {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    color: white;
}

.table-heritage thead th {
    padding: var(--space-3) var(--space-4);
    font-weight: 600;
    border: none;
}

.table-heritage tbody tr {
    border-bottom: 1px solid var(--color-border);
    transition: background-color var(--duration-fast) var(--ease-out);
}

.table-heritage tbody tr:hover {
    background-color: var(--color-muted-bg);
}

.table-heritage tbody td {
    padding: var(--space-3) var(--space-4);
}

/* ── Directory grid ── */
.chs-directory-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
}

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

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

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

/* ── Stats grid ── */
.chs-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
}

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

/* ── Badges ── */
.chs-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.chs-badge-primary {
    background-color: var(--chs-green-100);
    color: var(--chs-green-800);
}

.chs-badge-success {
    background-color: #ECFDF5;
    color: #065F46;
}

.chs-badge-warning {
    background-color: #FFFBEB;
    color: #92400E;
}

.chs-badge-danger {
    background-color: #FEF2F2;
    color: #991B1B;
}

.chs-badge-info {
    background-color: var(--chs-blue-100);
    color: var(--chs-blue-800);
}

.chs-badge-gold {
    background-color: var(--chs-gold-100);
    color: var(--chs-gold-700);
}

.chs-badge-active {
    background-color: #ECFDF5;
    color: #065F46;
}

.chs-badge-passive {
    background-color: #FEF3C7;
    color: #92400E;
}

.chs-badge-lifetime {
    background: linear-gradient(135deg, var(--chs-gold-200), var(--chs-gold-100));
    color: var(--chs-gold-700);
    border: 1px solid var(--chs-gold-300);
}

/* Legacy badge alias */
.badge-heritage {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 600;
}

.badge-heritage.badge-primary {
    background-color: var(--color-primary);
    color: white;
}

.badge-heritage.badge-success {
    background-color: var(--color-success);
    color: white;
}

.badge-heritage.badge-warning {
    background-color: var(--color-warning);
    color: #92400E;
}

.badge-heritage.badge-gold {
    background-color: var(--color-accent);
    color: #92400E;
}


/* ==========================================================================
   10. FORMS
   ========================================================================== */

.form-heritage .form-label {
    color: var(--color-foreground);
    font-weight: 600;
    font-size: var(--text-sm);
    margin-bottom: var(--space-2);
}

.form-heritage .form-control,
.form-heritage .form-select {
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    min-height: 44px;
    transition: border-color var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out);
}

.form-heritage .form-control:focus,
.form-heritage .form-select:focus {
    border-color: var(--chs-green-600);
    box-shadow: 0 0 0 3px rgba(10, 79, 40, 0.1);
    outline: none;
}

.form-heritage .form-control::placeholder {
    color: var(--color-muted);
    opacity: 0.7;
}

.form-heritage .form-text {
    color: var(--color-muted);
    font-size: var(--text-xs);
    margin-top: var(--space-1);
}

/* Validation states */
.form-heritage .form-control.is-valid {
    border-color: var(--color-success);
}

.form-heritage .form-control.is-invalid {
    border-color: var(--color-danger);
}

.form-heritage .invalid-feedback {
    color: var(--color-danger);
    font-size: var(--text-sm);
}

/* Form card container */
.form-card {
    background: var(--color-card);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-sm);
}

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

/* PayPal button area */
.paypal-container {
    background: var(--surface-1);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    text-align: center;
}


/* ==========================================================================
   11. DIRECTORY & OFFICER COMPONENTS
   ========================================================================== */

/* Feature icons */
.feature-icon-wrapper {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: var(--radius-full);
    background-color: var(--chs-green-100);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-4);
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .feature-icon-wrapper {
        width: 4rem;
        height: 4rem;
    }
}

.feature-icon-wrapper i {
    font-size: 1.5rem;
    color: var(--color-primary);
}

@media (min-width: 768px) {
    .feature-icon-wrapper i {
        font-size: 2rem;
    }
}

/* Benefits list */
.benefits-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.benefits-list li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-md);
    transition: background-color var(--duration-fast) var(--ease-out);
}

.benefits-list li:hover {
    background-color: var(--surface-1);
}

.benefits-list li::before {
    content: '\2713';
    color: var(--color-primary);
    font-weight: 700;
    font-size: var(--text-lg);
    flex-shrink: 0;
    line-height: 1.5;
}

/* Membership type cards in portal */
.membership-type-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 600;
    font-size: var(--text-sm);
}

/* Portal dashboard card headers */
.portal-card-header {
    background: linear-gradient(135deg, var(--chs-green-800), var(--chs-green-700));
    color: white;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    font-weight: 600;
    font-size: var(--text-base);
}

.portal-card-header--info {
    background: linear-gradient(135deg, var(--chs-blue-700), var(--chs-blue-600));
}

.portal-card-header--accent {
    background: linear-gradient(135deg, var(--chs-gold-600), var(--chs-gold-500));
    color: var(--chs-green-900);
}


/* ==========================================================================
   12. TIMELINE & EVENTS
   ========================================================================== */

.chs-timeline {
    position: relative;
    padding-left: var(--space-8);
}

.chs-timeline::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--chs-green-200);
}

.chs-timeline-item {
    position: relative;
    padding-bottom: var(--space-6);
}

.chs-timeline-item::before {
    content: '';
    position: absolute;
    left: calc(-1 * var(--space-8) + 8px);
    top: 6px;
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    background: var(--chs-green-800);
    border: 2px solid white;
    box-shadow: var(--shadow-xs);
}

.chs-timeline-item .timeline-date {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: var(--space-1);
}

.chs-timeline-item .timeline-content {
    background: var(--surface-1);
    border-radius: var(--radius-md);
    padding: var(--space-4);
}

/* Quote / pull-quote */
.chs-quote {
    border-left: 4px solid var(--color-accent);
    padding: var(--space-4) var(--space-6);
    margin: var(--space-6) 0;
    background: var(--chs-gold-100);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.chs-quote p {
    font-family: var(--font-accent);
    font-size: var(--text-xl);
    font-style: italic;
    color: var(--color-foreground);
    margin-bottom: var(--space-2);
    line-height: 1.6;
}

.chs-quote cite,
.chs-quote .attribution {
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    color: var(--color-muted);
    font-style: normal;
    display: block;
}

.chs-quote cite::before,
.chs-quote .attribution::before {
    content: '\2014\00a0';
}

/* President's message */
.presidents-message {
    background: linear-gradient(135deg, var(--chs-green-50), white);
    border: 1px solid var(--chs-green-200);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    position: relative;
}

@media (min-width: 768px) {
    .presidents-message {
        padding: var(--space-8);
    }
}

.presidents-message::before {
    content: '\201C';
    position: absolute;
    top: var(--space-3);
    left: var(--space-4);
    font-size: 4rem;
    font-family: var(--font-serif);
    color: var(--chs-green-200);
    line-height: 1;
}


/* ==========================================================================
   13. FOOTER
   ========================================================================== */

.heritage-footer {
    background: var(--chs-green-900);
    color: white;
    padding: var(--space-12) 0 var(--space-8);
    position: relative;
    margin-top: var(--section-padding);
}

.heritage-footer::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('/static/images/henderson-tartan.gif');
    background-size: 200px 200px;
    background-repeat: repeat;
    opacity: 0.04;
}

.heritage-footer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent), var(--chs-gold-300), var(--color-accent));
}

.heritage-footer .container {
    position: relative;
    z-index: 1;
}

.heritage-footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}

.heritage-footer a:hover {
    color: white;
}

.heritage-footer h3,
.heritage-footer h4,
.heritage-footer h5 {
    color: white;
    font-family: var(--font-serif);
}

.footer-text {
    color: rgba(255, 255, 255, 0.75);
}

.footer-motto {
    font-style: italic;
    font-family: var(--font-accent);
    color: rgba(255, 255, 255, 0.5);
    font-size: var(--text-sm);
    margin-top: var(--space-2);
}

.footer-badge {
    width: 60px;
    height: 60px;
    margin-bottom: var(--space-4);
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.footer-divider {
    border-color: rgba(255, 255, 255, 0.15) !important;
}

.footer-copyright {
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--text-sm);
    margin-bottom: var(--space-2);
}


/* ==========================================================================
   14. TARTAN EFFECTS & DIVIDERS
   ========================================================================== */

.chs-divider-tartan {
    height: 4px;
    background-image: url('/static/images/henderson-tartan.gif');
    background-size: 150px 150px;
    background-repeat: repeat-x;
    margin: var(--space-8) 0;
    border-radius: 2px;
}

/* Legacy alias */
.tartan-divider {
    height: 4px;
    background-image: url('/static/images/henderson-tartan.gif');
    background-size: 150px 150px;
    background-repeat: repeat-x;
    margin: var(--space-8) 0;
}

.tartan-accent-top {
    position: relative;
}

.tartan-accent-top::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-image: url('/static/images/henderson-tartan.gif');
    background-size: 100px 100px;
    background-repeat: repeat-x;
    opacity: 0.7;
}

.tartan-frame {
    position: relative;
}

.tartan-frame::before {
    content: '';
    position: absolute;
    inset: -0.75rem;
    background-image: url('/static/images/henderson-tartan.gif');
    background-size: 120px 120px;
    background-repeat: repeat;
    opacity: 0.4;
    border-radius: var(--radius-xl);
}

.tartan-frame::after {
    content: '';
    position: absolute;
    inset: -0.75rem;
    background: linear-gradient(135deg, rgba(10, 79, 40, 0.35), rgba(26, 95, 180, 0.35));
    border-radius: var(--radius-xl);
}

.tartan-frame img {
    position: relative;
    z-index: 10;
    border: 3px solid white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}


/* ==========================================================================
   15. UTILITY CLASSES
   ========================================================================== */

.text-heritage    { color: var(--color-primary); }
.text-heritage-light { color: var(--chs-green-600); }
.text-secondary-heritage { color: var(--color-secondary); }
.text-accent      { color: var(--color-accent); }
.text-muted-heritage { color: var(--color-muted); }

.bg-heritage      { background-color: var(--color-primary); }
.bg-heritage-light { background-color: var(--color-primary-light); }
.bg-heritage-muted { background-color: var(--color-muted-bg); }
.bg-heritage-surface { background-color: var(--surface-1); }

.border-heritage  { border-color: var(--color-primary) !important; }
.border-accent    { border-color: var(--color-accent) !important; }

.shadow-heritage     { box-shadow: var(--shadow-md); }
.shadow-heritage-lg  { box-shadow: var(--shadow-xl); }
.shadow-heritage-sm  { box-shadow: var(--shadow-sm); }

.rounded-heritage { border-radius: var(--radius-xl); }

/* Gradient text */
.text-gradient {
    background: linear-gradient(135deg, var(--chs-green-700), var(--chs-blue-600));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Hover underline effect */
.hover-underline {
    text-decoration: none;
    position: relative;
}

.hover-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width var(--duration-normal) var(--ease-out);
}

.hover-underline:hover::after {
    width: 100%;
}


/* ==========================================================================
   16. ANIMATIONS
   ========================================================================== */

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

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

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

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}

.animate-fade-in     { animation: fadeIn 0.6s var(--ease-out); }
.animate-fade-in-up  { animation: fadeInUp 0.6s var(--ease-out); }
.animate-fade-in-down { animation: fadeInDown 0.6s var(--ease-out); }
.animate-slide-in-left  { animation: slideInLeft 0.6s var(--ease-out); }
.animate-slide-in-right { animation: slideInRight 0.6s var(--ease-out); }


/* ==========================================================================
   17. SCROLL-REVEAL (works with chs-ui.js)
   ========================================================================== */

.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--duration-slow) var(--ease-out),
                transform var(--duration-slow) var(--ease-out);
}

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

.reveal-delay-1 { transition-delay: 100ms; }
.reveal-delay-2 { transition-delay: 200ms; }
.reveal-delay-3 { transition-delay: 300ms; }
.reveal-delay-4 { transition-delay: 400ms; }


/* ==========================================================================
   18. ACCESSIBILITY
   ========================================================================== */

/* Focus-visible outlines for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Skip link */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-4);
    background: var(--color-primary);
    color: white;
    padding: var(--space-2) var(--space-4);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    z-index: 9999;
    font-weight: 600;
    text-decoration: none;
    transition: top var(--duration-fast) var(--ease-out);
}

.skip-link:focus {
    top: 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }

    .heritage-hero .clan-badge {
        animation: none;
    }
}

/* High contrast mode improvements */
@media (forced-colors: active) {
    .chs-card,
    .chs-card-officer,
    .chs-card-event,
    .heritage-card {
        border: 2px solid;
    }

    .chs-badge,
    .badge-heritage {
        border: 1px solid;
    }
}


/* ==========================================================================
   19. PRINT STYLES
   ========================================================================== */

@media print {
    /* Hide non-content elements */
    .navbar-heritage,
    .heritage-footer,
    .tartan-divider,
    .chs-divider-tartan,
    .skip-link,
    .btn-chs,
    .btn-chs-gold,
    .btn-chs-outline,
    .btn-heritage,
    .btn-hero,
    .btn-hero-outline,
    .btn-join,
    .heritage-hero::before,
    .heritage-hero::after {
        display: none !important;
    }

    /* Reset backgrounds */
    body {
        background: white;
        color: black;
        font-size: 11pt;
        line-height: 1.5;
    }

    /* Hero becomes simple header */
    .heritage-hero {
        min-height: auto;
        background: none !important;
        color: black;
        padding: 1rem 0;
    }

    .heritage-hero h1 {
        color: black;
        text-shadow: none;
        font-size: 24pt;
    }

    .heritage-hero .clan-badge {
        display: none;
    }

    /* Page header simplification */
    .page-header {
        background: none !important;
        color: black;
        padding: 0.5rem 0;
        border-bottom: 2px solid black;
    }

    .page-header::before,
    .page-header::after {
        display: none;
    }

    .page-header h1 {
        color: black;
        font-size: 20pt;
    }

    /* Cards print cleanly */
    .chs-card,
    .heritage-card,
    .chs-card-officer,
    .chs-card-event,
    .chs-card-stat,
    .membership-card {
        border: 1px solid #ccc;
        box-shadow: none;
        page-break-inside: avoid;
    }

    .chs-card::before,
    .heritage-card::before {
        display: none;
    }

    /* Tables */
    .chs-table thead {
        background: #eee !important;
        color: black;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Links show URL */
    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #666;
    }

    /* Prevent page breaks inside important elements */
    h2, h3, h4 {
        page-break-after: avoid;
    }

    .chs-section,
    .heritage-section {
        padding: 1rem 0;
    }

    /* Remove shadows and animations */
    * {
        box-shadow: none !important;
        text-shadow: none !important;
        animation: none !important;
        transition: none !important;
    }

    /* Images */
    img {
        max-width: 100% !important;
    }
}

/* ── Alerts (heritage-themed) ── */
.alert-heritage {
    border-left: 4px solid var(--color-primary);
    border-radius: var(--radius-md);
    padding: var(--space-4) var(--space-5);
    margin-bottom: var(--space-4);
}

.alert-heritage-success {
    background-color: #ECFDF5;
    border-left-color: var(--color-success);
    color: #065F46;
}

.alert-heritage-info {
    background-color: #EFF6FF;
    border-left-color: var(--color-info);
    color: #1E40AF;
}

.alert-heritage-warning {
    background-color: #FFFBEB;
    border-left-color: var(--color-warning);
    color: #92400E;
}

.alert-heritage-danger {
    background-color: #FEF2F2;
    border-left-color: var(--color-danger);
    color: #991B1B;
}

/* ── Wizard styles ── */
.wizard-heritage {
    background: var(--color-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: var(--space-6);
}

.wizard-heritage .wizard-steps {
    position: relative;
    margin: var(--space-6) 0;
}

.wizard-heritage .wizard-step {
    background: white;
    border: 3px solid var(--color-border);
    color: var(--color-foreground);
}

.wizard-heritage .wizard-step.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.wizard-heritage .wizard-step.completed {
    background: var(--color-success);
    border-color: var(--color-success);
    color: white;
}

/* ── Gallery grid ── */
.chs-gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
}

@media (min-width: 576px) {
    .chs-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-4);
    }
}

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

.chs-gallery-item {
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    aspect-ratio: 1;
}

.chs-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-slow) var(--ease-out);
}

.chs-gallery-item:hover img {
    transform: scale(1.05);
}

/* ── Error pages ── */
.error-page {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-8);
}

.error-page .error-code {
    font-size: var(--text-5xl);
    font-weight: 900;
    font-family: var(--font-serif);
    color: var(--chs-green-200);
    line-height: 1;
    margin-bottom: var(--space-4);
}

.error-page h1 {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-4);
}

.error-page p {
    color: var(--color-muted);
    font-size: var(--text-lg);
    margin-bottom: var(--space-6);
}

/* ── Newsletter styles ── */
.newsletter-header {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    align-items: start;
}

@media (min-width: 768px) {
    .newsletter-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.newsletter-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    font-size: var(--text-sm);
    color: var(--color-muted);
}

.newsletter-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

/* ── "In this section" sidebar ── */
.sidebar-nav {
    position: sticky;
    top: calc(60px + var(--space-4));
}

.sidebar-nav .nav-link {
    color: var(--color-muted);
    padding: var(--space-2) var(--space-3);
    border-left: 2px solid var(--color-border);
    font-size: var(--text-sm);
    transition: all var(--duration-fast) var(--ease-out);
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    color: var(--color-primary);
    border-left-color: var(--color-primary);
    background: var(--surface-1);
}

/* ── Tartan swatch gallery ── */
.tartan-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    justify-content: center;
}

.tartan-swatch {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-md);
    border: 2px solid var(--color-border-light);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
    transition: transform var(--duration-fast) var(--ease-out),
                box-shadow var(--duration-fast) var(--ease-out);
}

.tartan-swatch:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.tartan-swatch img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (min-width: 768px) {
    .tartan-swatch {
        width: 120px;
        height: 120px;
    }
}

/* ── New members welcome list ── */
.new-members-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3);
}

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

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

.new-member-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--surface-1);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--color-primary);
}

.new-member-item .member-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--chs-green-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-size: 1rem;
    flex-shrink: 0;
}

.new-member-item .member-info {
    min-width: 0;
}

.new-member-item .member-name {
    font-weight: 600;
    font-size: var(--text-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.new-member-item .member-location {
    font-size: var(--text-xs);
    color: var(--color-muted);
}

/* ── Regional stats bar chart ── */
.region-bar {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) 0;
}

.region-bar .region-name {
    min-width: 120px;
    font-size: var(--text-sm);
    font-weight: 500;
}

.region-bar .region-bar-track {
    flex: 1;
    height: 24px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.region-bar .region-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--chs-green-700), var(--chs-green-500));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 var(--space-2);
    font-size: var(--text-xs);
    color: white;
    font-weight: 600;
    min-width: 30px;
    transition: width var(--duration-slow) var(--ease-out);
}

.region-bar .region-count {
    min-width: 40px;
    text-align: right;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-foreground);
}
