/* ═══════════════════════════════════════════════════════════════════
   Bible Misfits Study Group - Theme
   Colors: Cyan, Purple, Gold, White
   WCAG AA Contrast Compliant
   ═══════════════════════════════════════════════════════════════════ */

/* ─── CSS Custom Properties ───────────────────────────────────────── */

:root {
    /* Brand Colors */
    --cyan: #00bcd4;
    --cyan-dark: #0097a7;
    --cyan-light: #b2ebf2;
    --purple: #7b1fa2;
    --purple-dark: #4a148c;
    --purple-light: #ce93d8;
    --gold: #f9a825;
    --gold-dark: #c17900;
    --gold-light: #fdd835;

    /* Light Mode (default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f0fa;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --bg-code: #f3e5f5;
    --bg-nav: #4a148c;
    --bg-footer: #4a148c;
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a6a;
    --text-muted: #6b6b8a;
    --text-on-dark: #ffffff;
    --heading-color: #4a148c;
    --link-color: #0097a7;
    --link-hover: #00bcd4;
    --accent: #f9a825;
    --border-color: #e0d4f0;
    --shadow: 0 2px 8px rgba(74, 20, 140, 0.1);
    --shadow-hover: 0 4px 16px rgba(74, 20, 140, 0.18);
    --badge-upcoming-bg: #00bcd4;
    --badge-upcoming-text: #ffffff;
    --badge-past-bg: #9e9e9e;
    --badge-past-text: #ffffff;
    --mark-bg: #fdd835;
    --mark-text: #1a1a2e;
}

[data-theme="dark"] {
    --bg-primary: #0d0221;
    --bg-secondary: #1a0a3e;
    --bg-card: #1e0e42;
    --bg-input: #2a1652;
    --bg-code: #2a1652;
    --bg-nav: #1a0a3e;
    --bg-footer: #1a0a3e;
    --text-primary: #eee8f5;
    --text-secondary: #c8b8e0;
    --text-muted: #9a8ab5;
    --heading-color: #00e5ff;
    --link-color: #4dd0e1;
    --link-hover: #00e5ff;
    --accent: #fdd835;
    --border-color: #3a2662;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 4px 16px rgba(0, 188, 212, 0.2);
    --badge-upcoming-bg: #00e5ff;
    --badge-upcoming-text: #0d0221;
    --badge-past-bg: #4a4a6a;
    --badge-past-text: #c8b8e0;
    --mark-bg: #f9a825;
    --mark-text: #1a1a2e;
}

/* ─── Reset & Base ────────────────────────────────────────────────── */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s, color 0.3s;
}

/* ─── Typography ──────────────────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
    color: var(--heading-color);
    line-height: 1.3;
    margin-bottom: 0.5em;
    font-weight: 700;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover, a:focus { color: var(--link-hover); text-decoration: underline; }

p { margin-bottom: 1em; }

mark {
    background: var(--mark-bg);
    color: var(--mark-text);
    padding: 0.1em 0.3em;
    border-radius: 3px;
}

code, pre {
    font-family: 'Fira Code', 'Consolas', monospace;
    background: var(--bg-code);
    border-radius: 4px;
}
code { padding: 0.15em 0.4em; font-size: 0.9em; }
pre { padding: 1em; overflow-x: auto; margin-bottom: 1em; }
pre code { padding: 0; background: none; }

blockquote {
    border-left: 4px solid var(--accent);
    padding: 0.5em 1em;
    margin: 1em 0;
    background: var(--bg-secondary);
    border-radius: 0 4px 4px 0;
    color: var(--text-secondary);
}

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

/* ─── Layout ──────────────────────────────────────────────────────── */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* ─── Navigation ──────────────────────────────────────────────────── */

.nav {
    background: var(--bg-nav);
    padding: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.nav-brand {
    color: var(--gold) !important;
    font-size: 1.25rem;
    font-weight: 800;
    text-decoration: none !important;
    letter-spacing: 0.02em;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    flex-wrap: wrap;
}

.nav-links a, .nav-links button {
    color: #e0d4f0;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

.nav-links a:hover, .nav-links a.active,
.nav-links button:hover {
    background: rgba(255,255,255,0.12);
    color: #ffffff;
    text-decoration: none;
}

.nav-links a.active {
    color: var(--gold);
}

/* Theme toggle button */
.theme-toggle {
    background: rgba(255,255,255,0.1) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    border-radius: 50% !important;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    font-size: 1.1rem;
}

/* ─── Hero Logo ───────────────────────────────────────────────────── */

.hero-logo {
    text-align: center;
    margin-bottom: 1.5rem;
    transition: opacity 0.3s, transform 0.3s;
    will-change: opacity, transform;
}

.hero-logo img {
    max-height: 200px;
    max-width: 100%;
    object-fit: contain;
    border-radius: 12px;
}

.hero-logo.scrolled-away {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    pointer-events: none;
    height: 0;
    margin: 0;
    overflow: hidden;
}

@media (max-width: 480px) {
    .hero-logo img {
        max-height: 140px;
    }
}

/* ─── Search Bar ──────────────────────────────────────────────────── */

.search-bar {
    display: flex;
    max-width: 500px;
    margin: 0 auto 2rem;
}

.search-bar input {
    flex: 1;
    padding: 0.65rem 1rem;
    border: 2px solid var(--border-color);
    border-right: none;
    border-radius: 8px 0 0 8px;
    font-size: 1rem;
    background: var(--bg-input);
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

.search-bar input:focus {
    border-color: var(--cyan);
}

.search-bar button {
    padding: 0.65rem 1.25rem;
    background: var(--purple);
    color: white;
    border: 2px solid var(--purple);
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

.search-bar button:hover {
    background: var(--purple-dark);
    border-color: var(--purple-dark);
}

/* ─── View Mode Controls ──────────────────────────────────────────── */

.view-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.view-controls label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.view-btn {
    padding: 0.35rem 0.6rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.view-btn.active, .view-btn:hover {
    background: var(--purple);
    color: white;
    border-color: var(--purple);
}

/* ─── Event Grid / List ───────────────────────────────────────────── */

.events-container {
    display: grid;
    gap: 1.5rem;
}

.events-container.grid-view {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.events-container.cols-1 {
    grid-template-columns: 1fr;
}

.events-container.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.events-container.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* ─── Event Card ──────────────────────────────────────────────────── */

.event-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s, transform 0.2s;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

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

.event-card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Thumbnail (grid/multi-col: top banner) */
.event-card-thumb {
    display: block;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.event-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.event-card:hover .event-card-thumb img {
    transform: scale(1.05);
}

/* 1-col: side-by-side layout */
.events-container.cols-1 .event-card.has-thumbnail {
    flex-direction: row;
}

.events-container.cols-1 .event-card-thumb {
    width: 200px;
    aspect-ratio: auto;
    min-height: 140px;
}

.event-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.event-card h3 {
    margin: 0;
    flex: 1;
}

.event-card h3 a {
    color: var(--heading-color);
    text-decoration: none;
}
.event-card h3 a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.badge {
    display: inline-block;
    padding: 0.2em 0.65em;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.badge-upcoming {
    background: var(--badge-upcoming-bg);
    color: var(--badge-upcoming-text);
}

.badge-past {
    background: var(--badge-past-bg);
    color: var(--badge-past-text);
}

.event-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.event-meta span::before {
    margin-right: 0.3em;
}

.event-excerpt {
    color: var(--text-secondary);
    flex: 1;
    margin-bottom: 1rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.event-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.event-card-footer a {
    font-weight: 600;
}

/* ─── Single Event Page ───────────────────────────────────────────── */

.event-detail {
    max-width: 850px;
    margin: 0 auto;
}

.event-detail .event-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.event-detail .event-header h1 {
    margin-bottom: 0.5rem;
}

.event-detail .event-body {
    margin-bottom: 2rem;
}

.event-detail .event-body img,
.event-detail .event-body video,
.event-detail .event-body audio {
    max-width: 100%;
    border-radius: 8px;
    margin: 1em 0;
}

.event-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.event-actions a, .event-actions button {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
}

/* ─── Follow-ups ──────────────────────────────────────────────────── */

.followups-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-color);
}

.followup-item {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--cyan);
}

.followup-item h4 {
    color: var(--heading-color);
    margin-bottom: 0.5rem;
}

.followup-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

/* ─── Feedback / Comments ─────────────────────────────────────────── */

.feedback-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-color);
}

.feedback-item {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
}

.feedback-author {
    font-weight: 600;
    color: var(--heading-color);
}

.feedback-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.feedback-body {
    margin-top: 0.5rem;
    color: var(--text-secondary);
}

/* ─── Forms ───────────────────────────────────────────────────────── */

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

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--cyan);
}

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

.form-group small {
    display: block;
    margin-top: 0.3rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ─── Buttons ─────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none !important;
    transition: all 0.2s;
    line-height: 1.4;
}

.btn-primary {
    background: var(--purple);
    color: #ffffff;
    border-color: var(--purple);
}
.btn-primary:hover {
    background: var(--purple-dark);
    border-color: var(--purple-dark);
    color: #ffffff;
}

.btn-accent {
    background: var(--cyan);
    color: #ffffff;
    border-color: var(--cyan);
}
.btn-accent:hover {
    background: var(--cyan-dark);
    border-color: var(--cyan-dark);
    color: #ffffff;
}

.btn-gold {
    background: var(--gold);
    color: #1a1a2e;
    border-color: var(--gold);
}
.btn-gold:hover {
    background: var(--gold-dark);
    border-color: var(--gold-dark);
    color: #ffffff;
}

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

.btn-danger {
    background: #d32f2f;
    color: #ffffff;
    border-color: #d32f2f;
}
.btn-danger:hover {
    background: #b71c1c;
    border-color: #b71c1c;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

/* ─── Flash Messages ──────────────────────────────────────────────── */

.flash {
    padding: 0.85rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.flash-success {
    background: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #a5d6a7;
}

.flash-error {
    background: #ffebee;
    color: #b71c1c;
    border: 1px solid #ef9a9a;
}

.flash-info {
    background: var(--cyan-light);
    color: #004d5a;
    border: 1px solid var(--cyan);
}

[data-theme="dark"] .flash-success {
    background: #1b3a1b;
    color: #a5d6a7;
    border-color: #2e7d32;
}
[data-theme="dark"] .flash-error {
    background: #3a1b1b;
    color: #ef9a9a;
    border-color: #c62828;
}
[data-theme="dark"] .flash-info {
    background: #003d47;
    color: #b2ebf2;
    border-color: #00838f;
}

/* ─── Embedded Media ──────────────────────────────────────────────── */

.embed-responsive {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin: 1em 0;
    border-radius: 8px;
}

.embed-responsive iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
    border-radius: 8px;
}

.embedded-media {
    max-width: 100%;
    border-radius: 8px;
    margin: 0.5em 0;
    display: block;
}

.pdf-embed {
    margin: 1em 0;
}

.embedded-pdf {
    width: 100%;
    height: 500px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.pdf-link {
    display: inline-block;
    margin-top: 0.5em;
    font-size: 0.85rem;
}

/* ─── Attachments List ────────────────────────────────────────────── */

.attachments-list {
    list-style: none;
    margin: 1em 0;
}

.attachments-list li {
    padding: 0.4rem 0;
}

.attachments-list a {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
}

/* ─── Footer ──────────────────────────────────────────────────────── */

.footer {
    background: var(--bg-footer);
    color: #c8b8e0;
    padding: 1.5rem 0;
    margin-top: auto;
    text-align: center;
    font-size: 0.85rem;
}

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

.footer .feed-links {
    margin-top: 0.5rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* ─── Admin Specific ──────────────────────────────────────────────── */

.admin-layout {
    display: flex;
    min-height: calc(100vh - 60px);
}

.admin-sidebar {
    width: 220px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem 0;
    flex-shrink: 0;
}

.admin-sidebar a {
    display: block;
    padding: 0.6rem 1.25rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
    background: var(--bg-primary);
    color: var(--heading-color);
    border-right: 3px solid var(--purple);
}

.admin-main {
    flex: 1;
    padding: 2rem;
    max-width: 900px;
}

.admin-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

/* ─── Tables ──────────────────────────────────────────────────────── */

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

th, td {
    padding: 0.65rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tr:hover td {
    background: var(--bg-secondary);
}

/* ─── Login Page ──────────────────────────────────────────────────── */

.login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--purple-dark) 0%, #0d0221 100%);
}

.login-box {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--purple);
}

/* ─── Signup / Groups.io ──────────────────────────────────────────── */

.signup-section {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.signup-section .embed-container {
    margin-top: 2rem;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

/* ─── Search Results ──────────────────────────────────────────────── */

.search-result {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.search-result:last-child {
    border-bottom: none;
}

.search-result h3 {
    margin-bottom: 0.3rem;
}

.search-result .result-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.search-result .result-matches {
    font-size: 0.8rem;
    color: var(--cyan-dark);
}

[data-theme="dark"] .search-result .result-matches {
    color: var(--cyan);
}

.search-result .result-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ─── Quickview Lightbox ──────────────────────────────────────────── */

.qv-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qv-overlay[hidden] {
    display: none;
}

.qv-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.qv-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    max-width: 860px;
    max-height: 92vh;
    padding: 0.5rem;
    z-index: 1;
}

.qv-panel {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    animation: qvSlideIn 0.25s ease-out;
}

@keyframes qvSlideIn {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.qv-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem 1.75rem 0.75rem;
    position: sticky;
    top: 0;
    background: var(--bg-card);
    border-radius: 16px 16px 0 0;
    z-index: 2;
}

.qv-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    flex-wrap: wrap;
}

.qv-title-row h2 {
    margin: 0;
    font-size: 1.35rem;
}

.qv-close {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.qv-close:hover {
    background: #d32f2f;
    border-color: #d32f2f;
    color: #fff;
}

.qv-meta {
    padding: 0 1.75rem 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.qv-actions {
    padding: 0 1.75rem 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.qv-body {
    padding: 0 1.75rem;
    flex: 1;
    overflow-y: auto;
    line-height: 1.7;
    color: var(--text-primary);
}

.qv-body img,
.qv-body video,
.qv-body audio {
    max-width: 100%;
    border-radius: 8px;
    margin: 0.75em 0;
}

.qv-body .embed-responsive {
    margin: 0.75em 0;
}

.qv-followups {
    padding: 0 1.75rem;
    margin-top: 0.5rem;
}

.qv-followups:empty {
    display: none;
}

.qv-followup-item {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--cyan);
}

.qv-followup-item h4 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
}

.qv-followup-item .qv-fu-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.qv-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.75rem 1rem;
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
    position: sticky;
    bottom: 0;
    background: var(--bg-card);
    border-radius: 0 0 16px 16px;
}

/* Navigation arrows */
.qv-nav {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 2rem;
    line-height: 1;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    z-index: 2;
}

.qv-nav:hover {
    background: var(--purple);
    border-color: var(--purple);
    color: #fff;
}

.qv-nav:disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

/* Event card footer actions layout */
.event-card-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Responsive quickview */
@media (max-width: 768px) {
    .qv-container {
        flex-direction: column;
        padding: 0.25rem;
        max-height: 100vh;
        height: 100%;
    }

    .qv-panel {
        max-height: calc(100vh - 80px);
        border-radius: 12px;
    }

    .qv-nav {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
        position: fixed;
        top: 50%;
        transform: translateY(-50%);
    }

    .qv-nav-prev { left: 4px; }
    .qv-nav-next { right: 4px; }

    .qv-header { padding: 1rem 1.25rem 0.5rem; }
    .qv-meta { padding: 0 1.25rem 0.5rem; }
    .qv-actions { padding: 0 1.25rem 0.75rem; }
    .qv-body { padding: 0 1.25rem; }
    .qv-followups { padding: 0 1.25rem; }
    .qv-footer { padding: 0.5rem 1.25rem 0.75rem; }
}

/* ─── Merchandise Grid ────────────────────────────────────────────── */

.merch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.merch-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow 0.3s, transform 0.2s;
    display: flex;
    flex-direction: column;
}

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

.merch-card-image {
    display: block;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--bg-secondary);
}

.merch-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.merch-card:hover .merch-card-image img {
    transform: scale(1.05);
}

.merch-card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.merch-card-body h3 {
    margin: 0 0 0.5rem;
}

.merch-card-body h3 a {
    color: var(--heading-color);
    text-decoration: none;
}

.merch-card-body h3 a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.merch-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.75rem;
}

.merch-detail-image {
    text-align: center;
}

.merch-detail-image img {
    max-width: 100%;
    max-height: 500px;
    border-radius: 12px;
    object-fit: contain;
}

/* ─── Members Grid ───────────────────────────────────────────────── */

.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.member-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    text-align: center;
    transition: box-shadow 0.3s, transform 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

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

.member-card-photo {
    display: block;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 1rem;
    border: 3px solid var(--border-color);
    transition: border-color 0.3s;
}

.member-card:hover .member-card-photo {
    border-color: var(--cyan);
}

.member-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-card-placeholder {
    width: 100%;
    height: 100%;
    background: var(--purple);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    text-transform: uppercase;
}

.member-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.member-card-body h3 {
    margin: 0 0 0.25rem;
}

.member-card-body h3 a {
    color: var(--heading-color);
    text-decoration: none;
}

.member-card-body h3 a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.member-role {
    color: var(--cyan-dark);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

[data-theme="dark"] .member-role {
    color: var(--cyan);
}

.member-profile {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.member-profile-photo {
    flex-shrink: 0;
}

.member-profile-photo img {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--border-color);
}

.member-profile-info h1 {
    margin-bottom: 0.25rem;
}

@media (max-width: 480px) {
    .member-profile {
        flex-direction: column;
        text-align: center;
    }

    .member-profile-photo img {
        width: 120px;
        height: 120px;
    }
}

/* ─── Utility ─────────────────────────────────────────────────────── */

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

.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;
}

/* ─── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 768px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }

    .nav .container {
        flex-direction: column;
        gap: 0.5rem;
    }

    .nav-links {
        justify-content: center;
    }

    .events-container.cols-2,
    .events-container.cols-3 {
        grid-template-columns: 1fr;
    }

    /* Stack thumbnail on top in 1-col on mobile */
    .events-container.cols-1 .event-card.has-thumbnail {
        flex-direction: column;
    }

    .events-container.cols-1 .event-card-thumb {
        width: 100%;
        aspect-ratio: 16/9;
        min-height: auto;
    }

    .admin-layout {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 0.5rem 0;
        display: flex;
        overflow-x: auto;
    }

    .admin-sidebar a {
        white-space: nowrap;
    }

    .admin-main {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .event-card {
        padding: 1rem;
    }

    .search-bar {
        flex-direction: column;
    }

    .search-bar input {
        border-radius: 8px;
        border-right: 2px solid var(--border-color);
        margin-bottom: 0.5rem;
    }

    .search-bar button {
        border-radius: 8px;
    }
}
