/* ===== CSS Variables ===== */
:root {
    /* Playful color palette */
    /* Nudged slightly darker than the original #6366f1 -- that was 4.47:1
       with white text, just under the 4.5:1 AA minimum; this is 5.0:1+
       and visually indistinguishable. */
    --primary: #5a5dea;       /* Indigo */
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #f472b6;     /* Pink */
    /* Indigo/teal pair used only for the hero's gradient-clipped highlight
       text, matching the quilt logo's own palette. The indigo is the
       logo's exact hue (6366f1, 4.47:1 alone); the logo's teal (22d3d3)
       only measures 1.85:1 on its own, so this uses a darker teal from
       the same hue instead -- together they hold 3.7-4.5:1 across the
       whole gradient, clear of the 3:1 minimum for large text. */
    --highlight-indigo: #6366f1;
    --highlight-teal: #0d9488;
    --accent-yellow: #fbbf24;
    --accent-orange: #fb923c;
    --accent-cyan: #22d3d3;

    /* Neutrals */
    --dark: #1e1b4b;
    --gray-800: #3f3f46;
    --gray-600: #71717a;
    --gray-400: #a1a1aa;
    --gray-200: #e4e4e7;
    --gray-100: #f4f4f5;
    --white: #ffffff;

    /* Backgrounds */
    --bg-primary: #faf7ff;

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

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

    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(99, 102, 241, 0.08);
    --shadow-md: 0 4px 20px rgba(99, 102, 241, 0.12);
    --shadow-lg: 0 8px 40px rgba(99, 102, 241, 0.16);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-800);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
}

/* Alternating section backgrounds, keyed off source order so re-arranging
   the sections in index.html re-alternates them automatically -- no
   per-section background rule to update by hand. Individual section rules
   (.about, .workshops, etc.) intentionally don't set their own background. */
main > section:nth-of-type(odd) {
    background: var(--bg-primary);
}

main > section:nth-of-type(even) {
    background: var(--white);
}

/* Hidden until keyboard-focused, then jumps to the top so keyboard users
   can bypass the nav without tabbing through every link first. */
.skip-link {
    position: absolute;
    top: -100px;
    left: var(--space-md);
    z-index: 2000;
    background: var(--primary);
    color: var(--white);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: var(--space-md);
}

/* Visually hidden but still reachable by screen readers -- used for status
   messages (e.g. "Showing 3 new resources") that only assistive tech needs
   to hear, since the visual update is already obvious on screen. */
.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;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    /* Exempt from the blanket rule above: a brief, click-only effect, not
       ambient/autoplaying motion, so it stays on even under reduced motion
       (see initHeroLogo in js/main.js). */
    .hero-tile.is-flipping {
        animation-duration: 0.5s !important;
    }
}

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

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

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

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

/* ===== Utility Classes ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.section-tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(244, 114, 182, 0.1));
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    margin-bottom: var(--space-md);
}

/* Fallback icon used in place of an emoji when a workshop doesn't have one
   (randomized per view -- see renderIcon in main.js), and also used as the
   flourish prepended to each section-tag pill (see randomizeFlourishes). */
.icon-flourish {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: -0.15em;
    border-radius: 3px;
    flex-shrink: 0;
}

.section-tag .icon-flourish {
    width: 11px;
    height: 11px;
}

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

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
}

.section-header p {
    color: var(--gray-600);
    font-size: 1.125rem;
}

#hubs-register-mount {
    margin-top: var(--space-lg);
}

#hubs-register-mount:empty {
    display: none;
}

#resources-shuffle {
    display: block;
    margin: var(--space-lg) auto 0;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1rem;
    padding: var(--space-md) var(--space-xl);
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.45);
    color: var(--white);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--gray-200);
}

.btn-secondary:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.btn-small {
    font-size: 0.875rem;
    padding: var(--space-sm) var(--space-lg);
}

.btn-large {
    font-size: 1.125rem;
    padding: var(--space-lg) var(--space-2xl);
}

.btn-icon {
    font-size: 1.2em;
}

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gray-200);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--dark);
}

.logo:hover {
    color: var(--dark);
}

.logo-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: block;
}

/* Always a dropdown menu (toggled by the hamburger below), on every screen
   size -- not just mobile. Constrained to the same max-width/centering as
   .nav-container so its right edge -- and the right-justified links inside
   it -- line up with the hamburger button above. */
.nav-menu {
    list-style: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    max-width: 1200px;
    margin: 0 auto;
    background: var(--white);
    display: flex;
    flex-direction: column;
    padding: var(--space-sm) 0;
    gap: 0;
    border-bottom: 1px solid var(--gray-200);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

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

.nav-menu a {
    display: block;
    text-align: right;
    padding: var(--space-sm) var(--space-lg);
    font-weight: 500;
    color: var(--gray-600);
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.nav-menu a:hover,
.nav-menu a:focus-visible {
    background-color: var(--primary);
    color: var(--white);
}

.nav-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 44px;
    min-height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--gray-800);
    border-radius: 2px;
    transition: var(--transition-base);
}

/* ===== Hero Section ===== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px var(--space-lg) var(--space-3xl);
    overflow: hidden;
    background: linear-gradient(180deg, var(--bg-primary) 0%, #fff 100%);
}

.hero-inner {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-2xl);
    max-width: 1100px;
}

/* Interactive quilt block: a big, clickable version of the logo. Each of
   the 16 tiles starts matching the logo, then shuffles to a fresh random
   pattern (solid or split) with a coin-flip animation on click. */
.hero-logo-interactive {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    width: clamp(200px, 26vw, 320px);
    height: clamp(200px, 26vw, 320px);
    perspective: 800px;
}

.hero-tile {
    border: none;
    padding: 0;
    font: inherit;
    border-radius: 4px;
    cursor: pointer;
    transform-style: preserve-3d;
}

.hero-tile:hover {
    filter: brightness(1.08);
}

.hero-tile:focus-visible {
    outline: 3px solid var(--dark);
    outline-offset: 2px;
}

.hero-tile.is-flipping {
    animation: tile-flip 0.5s ease;
}

@keyframes tile-flip {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(90deg); }
    100% { transform: rotateY(0deg); }
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 540px;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: var(--space-lg);
    line-height: 1.1;
}

.hero .highlight {
    background: linear-gradient(135deg, var(--highlight-indigo), var(--highlight-teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--gray-600);
    margin-bottom: var(--space-xl);
    max-width: 550px;
}

.hero-cta {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
    margin-bottom: var(--space-3xl);
}


/* ===== About Section ===== */
.about {
    padding: var(--space-3xl) 0;
}

.about-content {
    max-width: 700px;
    margin: 0 auto;
}

.about-header {
    text-align: center;
}

.about-content h2 {
    font-size: 2.5rem;
    margin-bottom: var(--space-lg);
}

.about-content p {
    color: var(--gray-600);
    margin-bottom: var(--space-md);
}

.about-features {
    margin-top: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.feature {
    display: flex;
    gap: var(--space-md);
    align-items: flex-start;
}

.feature-icon {
    font-size: 2rem;
    line-height: 1;
}

.feature h3 {
    font-size: 1.125rem;
    margin-bottom: var(--space-xs);
}

.feature p {
    font-size: 0.875rem;
    margin: 0;
}

/* ===== Workshops Section ===== */
.workshops {
    padding: var(--space-3xl) 0;
}

/* Condensed season calendar: just the dates, in colored boxes -- full
   detail on the nearest one already lives in the Next Workshop spotlight
   above, so repeating title/materials placeholders for every date here
   would just be noise. */
.schedule-dates {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-md);
}

.schedule-date-chip {
    width: 72px;
    height: 92px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--white);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base);
}

.schedule-date-chip:hover {
    transform: translateY(-3px);
}

.schedule-date-chip .month,
.schedule-date-chip .year {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    opacity: 0.9;
}

.schedule-date-chip .day {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    margin: 1px 0;
}

.schedule-date-chip.c0 { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); }

/* c1-c3 use lighter/brighter gradients that white text can't sit on at
   AA contrast (measured as low as 1.7:1) -- dark text instead measures
   5.4-9.6:1 against these same backgrounds. */
.schedule-date-chip.c1 {
    background: linear-gradient(135deg, var(--secondary), var(--primary-light));
    color: var(--dark);
}

.schedule-date-chip.c2 {
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-yellow));
    color: var(--dark);
}

.schedule-date-chip.c3 {
    background: linear-gradient(135deg, var(--accent-cyan), var(--primary-light));
    color: var(--dark);
}

/* ===== Resources Section ===== */
.resources {
    padding: var(--space-3xl) 0;
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-lg);
}

.resource-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    /* Stronger than --shadow-sm (used on the Show & Tell cards) on purpose:
       these cards sit on a plain white section, and their own tinted
       background is close enough in hue to --shadow-sm that it read as
       nearly invisible there -- the Show & Tell cards get their separation
       mostly from the white-card-on-tinted-section contrast instead. */
    box-shadow: 0 4px 14px rgba(30, 27, 75, 0.12);
    transition: all var(--transition-base);
    border: 2px solid transparent;
}

.resource-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.resource-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
}

.resource-card h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
}

.resource-card p {
    color: var(--gray-600);
    font-size: 0.9375rem;
    margin-bottom: var(--space-md);
}

.resource-meta {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.resource-meta span {
    font-size: 0.75rem;
    /* --gray-600 measures 4.40:1 against --gray-100 -- just under the
       4.5:1 AA minimum for text this size (12px isn't "large text"). */
    color: var(--gray-800);
    background: var(--gray-100);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
}

.resource-link {
    font-weight: 500;
    font-size: 0.9375rem;
}

/* ===== Hubs Section ===== */
.hubs {
    padding: var(--space-3xl) 0;
}

/* Text list of hub sites -- a redundant, accessible equivalent to the
   map's pins for keyboard/screen-reader users and anyone who'd rather
   not interact with an embedded map. */
.hubs-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-lg);
}

.hub-list-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    /* Same shadow as .resource-card -- both sit on a plain white section
       with an off-white card background, so they need the same boost over
       --shadow-sm to actually separate from it. No hover here, unlike the
       resource cards: these aren't clickable. */
    box-shadow: 0 4px 14px rgba(30, 27, 75, 0.12);
}

.hub-list-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    flex-shrink: 0;
}

.hub-list-body h3 {
    font-family: var(--font-display);
    font-size: 1.0625rem;
    color: var(--dark);
    margin-bottom: var(--space-xs);
}

.hub-list-location {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    /* --gray-600 measures 4.40:1 against --gray-100 -- just under the
       4.5:1 AA minimum for text this size (12px isn't "large text"). */
    color: var(--gray-800);
    background: var(--gray-100);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

/* ===== Team Section ===== */
.team {
    padding: var(--space-3xl) 0;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-3xl);
}

.team-card {
    text-align: center;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

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

.team-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--white);
}

.team-card h3 {
    font-size: 1.125rem;
    margin-bottom: var(--space-xs);
}

.team-org {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.partners {
    text-align: center;
    padding: var(--space-xl);
    background: var(--white);
    border-radius: var(--radius-lg);
}

.partners h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-lg);
}

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

.partners-list a {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--gray-100);
    color: var(--dark);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-full);
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.partners-list a:hover {
    background: var(--primary);
    color: var(--white);
}

.partner-icon {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    flex-shrink: 0;
}

/* Organizers Emeriti */
.emeriti {
    text-align: center;
    padding: var(--space-xl);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(244, 114, 182, 0.05));
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-xl);
}

.emeriti h3 {
    font-size: 1.125rem;
    margin-bottom: var(--space-md);
    color: var(--gray-600);
}

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

.emeriti-list span {
    color: var(--gray-600);
    font-size: 0.875rem;
}

.emeriti-list span:not(:last-child)::after {
    content: " · ";
    color: var(--gray-400);
}

/* ===== Gallery Section ===== */
.gallery {
    padding: var(--space-3xl) 0;
}

.gallery-submit {
    max-width: 480px;
    margin: var(--space-3xl) auto 0;
    text-align: center;
}

.gallery-submit p {
    color: var(--gray-600);
    margin-bottom: var(--space-lg);
}

.gallery-submit-note {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-top: calc(-1 * var(--space-md));
}

.gallery-submit-note:empty {
    display: none;
    margin: 0;
}

.showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

#showcase-shuffle {
    display: block;
    margin: 0 auto;
}

.gallery-placeholder {
    aspect-ratio: 1;
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--gray-400);
    transition: all var(--transition-base);
}

.gallery-placeholder:hover {
    border-color: var(--primary-light);
    background: rgba(99, 102, 241, 0.05);
}

.gallery-placeholder span {
    font-size: 2.5rem;
    margin-bottom: var(--space-sm);
}

.gallery-placeholder p {
    font-size: 0.875rem;
    /* --gray-600 measures 4.40:1 against --gray-100 -- just under the
       4.5:1 AA minimum for text this size. */
    color: var(--gray-800);
}

/* ===== Footer ===== */
.footer {
    background: var(--dark);
    color: var(--white);
    padding: var(--space-3xl) 0;
}

.footer-brand {
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: var(--space-sm);
    text-align: center;
}

.footer-brand .logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
}

.footer-brand .logo-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
}

.footer-brand p {
    flex-basis: 100%;
    margin-top: var(--space-md);
    opacity: 0.7;
    font-size: 0.9375rem;
}

.footer-brand a {
    flex-basis: 100%;
    margin-top: var(--space-sm);
    color: var(--white);
    opacity: 0.8;
    font-size: 0.9375rem;
    transition: opacity var(--transition-fast);
}

.footer-brand a:hover {
    opacity: 1;
}

.footer-brand .footer-contact {
    opacity: 1;
    flex-basis: 100%;
    margin-top: var(--space-sm);
    font-size: 0.9375rem;
}

.footer-contact-label {
    opacity: 0.7;
}

.footer-contact a {
    margin-top: 0;
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    .hero h1 {
        font-size: 2.75rem;
    }
}

@media (max-width: 768px) {
    .hero {
        padding-top: 100px;
        min-height: auto;
    }

    .hero-inner {
        flex-direction: column;
        gap: var(--space-xl);
    }

    .hero h1 {
        font-size: 2.25rem;
    }

    .section-header h2 {
        font-size: 2rem;
    }

    .resources-grid,
    .team-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.875rem;
    }

    .hero-cta {
        flex-direction: column;
    }

    .hero-cta .btn {
        width: 100%;
    }

    .schedule-date-chip {
        width: 64px;
        height: 82px;
    }
}

/* ===== Team Avatar Images ===== */
.team-avatar-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto var(--space-md);
    display: block;
    border: 4px solid var(--white);
    box-shadow: var(--shadow-md);
}

/* ===== Resource Cards Clickable ===== */
.resource-card[data-resource] {
    cursor: pointer;
}

.resource-card .resource-link {
    background: none;
    border: none;
    font-family: inherit;
    cursor: pointer;
}

/* ===== Hub Map ===== */
.hubs-map-container {
    margin-bottom: var(--space-xl);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

#hubs-map {
    height: 450px;
    width: 100%;
    background: var(--gray-100);
}

.hub-popup {
    min-width: 250px;
}

.hub-popup h3 {
    font-family: var(--font-display);
    font-size: 1.125rem;
    color: var(--dark);
    margin-bottom: var(--space-sm);
}

.hub-popup-location {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    /* --gray-600 measures 4.40:1 against --gray-100 -- just under the
       4.5:1 AA minimum for text this size (12px isn't "large text"). */
    color: var(--gray-800);
    background: var(--gray-100);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

/* Custom map marker: a standard pin shape (not a quilt patch -- an
   abstract geometric square doesn't read as a location marker), colored
   to match the theme instead. See PIN_SVG in js/main.js. */
.custom-hub-marker {
    width: 28px;
    height: 36px;
    filter: drop-shadow(0 3px 6px rgba(30, 27, 75, 0.4));
    transition: transform var(--transition-fast);
}

.custom-hub-marker svg {
    display: block;
    width: 100%;
    height: 100%;
}

.custom-hub-marker:hover {
    transform: scale(1.12);
}

/* ===== Resource Modal ===== */
/* display is intentionally NOT set here -- the native [hidden] attribute
   (toggled in JS, removed slightly after the fade-out finishes) handles
   removing this from layout and the accessibility tree entirely when
   closed; .active handles the visible/flex state while open. */
.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(30, 27, 75, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px) scale(0.95);
    transition: transform var(--transition-base);
}

.modal.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--gray-200);
    color: var(--dark);
}

.modal-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: var(--space-md);
}

.modal-title {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: var(--space-sm);
}

.modal-description {
    text-align: center;
    color: var(--gray-600);
    margin-bottom: var(--space-xl);
}

.modal-materials {
    background: var(--gray-100);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.modal-materials h3 {
    font-size: 1rem;
    margin-bottom: var(--space-md);
    color: var(--dark);
}

.materials-list {
    list-style: none;
    display: grid;
    gap: var(--space-sm);
}

.materials-list li {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.9375rem;
    /* Sits inside .modal-materials' --gray-100 background, where
       --gray-600 measures 4.40:1 -- just under the 4.5:1 AA minimum for
       text this size. */
    color: var(--gray-800);
}

.materials-list li::before {
    content: "•";
    color: var(--primary);
    font-weight: bold;
}

.modal-eyebrow {
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: var(--space-sm);
}

.modal-links {
    border-top: 1px solid var(--gray-200);
    padding-top: var(--space-lg);
}

.modal-links h3 {
    font-size: 1rem;
    margin-bottom: var(--space-md);
    color: var(--dark);
}

.modal-links-list {
    list-style: none;
    display: grid;
    gap: var(--space-sm);
}

.modal-links-list a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9375rem;
}

.modal-links-list a:hover {
    text-decoration: underline;
}

/* Leaflet popup overrides */
.leaflet-popup-content-wrapper {
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-md) !important;
}

.leaflet-popup-content {
    margin: var(--space-md) !important;
}

.leaflet-popup-tip {
    box-shadow: none !important;
}

@media (max-width: 768px) {
    #hubs-map {
        height: 350px;
    }

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

/* ===== Next Event Spotlight ===== */
.next-event {
    padding: var(--space-2xl) 0 var(--space-3xl);
}

.next-event-card {
    max-width: 700px;
    margin: 0 auto;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-xl);
    padding: var(--space-3xl);
    color: var(--white);
    box-shadow: var(--shadow-lg);
}

.next-event-info .section-tag {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

.next-event-info h2 {
    color: var(--white);
    font-size: 2.25rem;
    margin: var(--space-sm) 0 var(--space-md);
}

.next-event-when {
    font-size: 1.125rem;
    margin-bottom: var(--space-md);
    opacity: 0.95;
}

.next-event-description {
    max-width: 640px;
    opacity: 0.9;
    margin-bottom: var(--space-lg);
}

.next-event-materials {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-md);
    max-width: 640px;
    margin-bottom: var(--space-lg);
}

.next-event-materials h3 {
    font-size: 0.9375rem;
    margin-bottom: var(--space-sm);
    color: var(--white);
    opacity: 0.95;
}

.next-event-materials ul {
    list-style: none;
    display: grid;
    gap: 4px;
}

.next-event-materials li {
    font-size: 0.875rem;
    opacity: 0.9;
}

.next-event-materials li::before {
    content: "• ";
}

.next-event-info .btn-primary {
    background: var(--white);
    color: var(--primary);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.next-event-info .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.3);
}

.next-event-location {
    margin-top: var(--space-lg) !important;
    font-size: 0.9375rem;
    opacity: 0.85;
    max-width: 640px;
}

@media (max-width: 768px) {
    .next-event-card {
        padding: var(--space-xl);
    }

    .next-event-info h2 {
        font-size: 1.75rem;
    }
}

/* ===== Show & Tell gallery photos ===== */
/* No hover animation here -- unlike .resource-card, these aren't clickable,
   so there's no interaction for a hover state to be hinting at. */
.showcase-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin: 0;
}

.showcase-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    display: block;
    /* Background color is set per-card in JS (renderShowcaseSample), picked
       from the quilt palette -- shows behind the full, uncropped photo
       instead of a crop hiding part of it. */
    background: var(--gray-100);
}

/* Broken-photo fallback -- see handleShowcaseImageError in js/main.js.
   Insets and dims the swapped-in flourish so it reads as "no photo"
   rather than filling the frame like a real photo would. */
.showcase-card img.showcase-image-broken {
    padding: 2.5rem;
    opacity: 0.35;
}

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

.showcase-card figcaption h3 {
    font-size: 1.125rem;
    margin-bottom: var(--space-sm);
}

.showcase-card figcaption p {
    color: var(--gray-600);
    font-size: 0.9375rem;
    margin: 0 0 var(--space-sm);
}

.showcase-maker {
    display: block;
    font-size: 0.8125rem;
    color: var(--gray-600);
    font-weight: 500;
}
