:root {
    --bg: #0d0f12;
    --bg-elevated: #191d23;
    --surface: #ffffff;
    --surface-soft: #f6f4ef;
    --border: #d9d2bf;
    --text: #171717;
    --text-soft: #5c564e;
    --brand-red: #9e1b1f;
    --brand-red-deep: #6f1114;
    --brand-gold: #c8a54c;
    --brand-gold-soft: #f1e3b3;
    --success: #285d3a;
    --warning: #8a6111;
    --danger: #87272b;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.15);
    --radius: 18px;
    --radius-small: 12px;
    --container: 1180px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at top, rgba(200, 165, 76, 0.2), transparent 30%),
        linear-gradient(180deg, #050607 0%, #11151b 100%);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.55;
}

a {
    color: inherit;
    text-decoration: none;
}

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

.container {
    width: min(calc(100% - 2rem), var(--container));
    margin: 0 auto;
}

.site-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-header {
    position: relative;
    z-index: 20;
    background: rgba(8, 10, 12, 0.94);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(200, 165, 76, 0.2);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #fff;
}

.brand-logo {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid rgba(200, 165, 76, 0.6);
    background: #fff;
}

.brand-kicker {
    display: block;
    color: var(--brand-gold-soft);
    font-size: 0.8rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.brand-name {
    display: block;
    font-size: 1.05rem;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    color: #fff;
}

.nav-toggle {
    display: none;
    width: 52px;
    height: 52px;
    padding: 0;
    flex-direction: column;
    border: 1px solid rgba(200, 165, 76, 0.35);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle span + span {
    margin-top: 5px;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.site-nav a {
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    transition: background 0.2s ease, color 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
    background: rgba(200, 165, 76, 0.18);
    color: var(--brand-gold-soft);
}

.site-main {
    flex: 1;
}

.hero-band {
    background:
        linear-gradient(90deg, rgba(158, 27, 31, 0.92), rgba(17, 21, 27, 0.78)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
    color: #fff;
    padding: 2rem 0 2.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-band__inner h1 {
    margin: 0.2rem 0 0;
    font-size: clamp(2rem, 4vw, 3.2rem);
}

.hero-band__eyebrow {
    margin: 0;
    color: var(--brand-gold-soft);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-size: 0.82rem;
}

.page-content {
    padding: 2rem 0 3rem;
}

.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.35rem;
    border: 1px solid rgba(17, 21, 27, 0.06);
}

.narrow-card {
    max-width: 640px;
    margin: 0 auto;
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.event-grid,
.stats-grid,
.admin-grid {
    display: grid;
    gap: 1.25rem;
}

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

.event-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

.event-card__image-wrap {
    background: linear-gradient(135deg, rgba(17, 21, 27, 0.03), rgba(200, 165, 76, 0.16));
    padding: 1rem;
}

.event-card__image {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: contain;
    border-radius: var(--radius-small);
    background: #fff;
}

.event-card__body {
    padding: 1.2rem;
}

.event-meta {
    margin: 0 0 0.5rem;
    color: var(--brand-red);
    font-weight: 700;
}

.capacity-pill,
.table-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.75rem 0;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: rgba(200, 165, 76, 0.18);
    color: #533d0d;
    font-size: 0.92rem;
    font-weight: 700;
}

.capacity-pill--full {
    background: rgba(158, 27, 31, 0.14);
    color: var(--danger);
}

.event-layout {
    display: grid;
    gap: 1.5rem;
    align-items: start;
}

.flyer-panel,
.registration-panel {
    min-width: 0;
}

.flyer-image,
.admin-flyer-preview {
    width: 100%;
    border-radius: var(--radius-small);
    background: var(--surface-soft);
    object-fit: contain;
}

.flyer-trigger {
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
    box-shadow: none;
}

.flyer-trigger:hover,
.flyer-trigger:focus-visible {
    transform: none;
    box-shadow: none;
}

.flyer-trigger:focus-visible .flyer-image {
    outline: 2px solid rgba(158, 27, 31, 0.22);
    outline-offset: 4px;
}

.admin-flyer-preview {
    max-width: 360px;
}

.rich-text,
.waiver-text {
    white-space: pre-wrap;
}

.rich-text p,
.rich-text ul,
.rich-text ol,
.rich-text blockquote,
.waiver-text p,
.waiver-text ul,
.waiver-text ol,
.waiver-text blockquote {
    margin: 0 0 0.9rem;
}

.rich-text > :last-child,
.waiver-text > :last-child {
    margin-bottom: 0;
}

.rich-editor {
    display: grid;
    gap: 0.75rem;
}

.rich-editor__toolbar {
    display: none;
    flex-wrap: wrap;
    gap: 0.55rem;
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-soft);
}

.rich-editor__toolbar .button {
    min-width: 0;
}

.rich-editor__surface {
    display: none;
    min-height: 220px;
    padding: 1rem;
    border: 1px solid #cfc7b3;
    border-radius: 14px;
    background: #fff;
    overflow-wrap: anywhere;
}

.rich-editor__surface:focus {
    outline: 2px solid rgba(158, 27, 31, 0.18);
    border-color: var(--brand-red);
}

.rich-editor__surface:empty::before {
    content: "Start typing here...";
    color: #7b7468;
}

.rich-editor__source {
    min-height: 140px;
}

.rich-editor.is-enhanced .rich-editor__toolbar {
    display: flex;
}

.rich-editor.is-enhanced .rich-editor__surface {
    display: block;
}

.rich-editor.is-enhanced .rich-editor__source {
    display: none;
}

.stack-form {
    display: grid;
    gap: 1rem;
}

.form-grid {
    display: grid;
    gap: 1rem;
}

.form-grid__full {
    grid-column: 1 / -1;
}

label,
.field-group {
    display: grid;
    gap: 0.4rem;
    font-weight: 600;
    color: var(--text);
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #cfc7b3;
    border-radius: 12px;
    padding: 0.85rem 0.95rem;
    background: #fff;
    color: var(--text);
}

input[type="date"],
input[type="time"] {
    min-height: 3.25rem;
    padding-right: 3rem;
    appearance: none;
    -webkit-appearance: none;
}

input[type="date"]::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value {
    text-align: left;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid rgba(158, 27, 31, 0.18);
    border-color: var(--brand-red);
}

.checkbox-stack {
    display: grid;
    gap: 0.8rem;
}

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-weight: 500;
}

.checkbox-row input {
    width: auto;
    margin-top: 0.2rem;
}

.button,
button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 0;
    border-radius: 999px;
    padding: 0.8rem 1.25rem;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.button:hover,
.button:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.14);
}

.button-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--brand-red), var(--brand-red-deep));
}

.button-secondary {
    color: #241b0c;
    background: linear-gradient(135deg, #f4e8c3, var(--brand-gold));
}

.button-small {
    padding: 0.55rem 0.9rem;
    font-size: 0.92rem;
}

.button-large {
    width: 100%;
}

.button[disabled],
button[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.button-row,
.compact-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.inline-form {
    display: inline;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-heading h2 {
    margin: 0;
}

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

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 0.85rem 0.7rem;
    border-bottom: 1px solid #ece7d7;
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    color: var(--text-soft);
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.status-stack {
    display: grid;
    gap: 0.2rem;
}

.share-link-group {
    display: grid;
    gap: 0.65rem;
}

.share-link-input {
    font-size: 0.92rem;
    background: var(--surface-soft);
}

.filter-form,
.summary-strip {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.summary-strip {
    padding: 1rem;
    background: var(--surface-soft);
    border-radius: var(--radius-small);
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 1.25rem;
}

.stat-card {
    background: linear-gradient(160deg, #fff, #f5efe1);
}

.stat-card p {
    margin: 0;
    color: var(--text-soft);
}

.stat-card strong {
    display: block;
    margin-top: 0.35rem;
    font-size: 2rem;
    color: var(--brand-red);
}

.notice {
    margin-bottom: 1rem;
    border-radius: 14px;
    padding: 1rem 1.1rem;
    border: 1px solid transparent;
}

.notice p:last-child {
    margin-bottom: 0;
}

.notice-success {
    background: rgba(40, 93, 58, 0.1);
    border-color: rgba(40, 93, 58, 0.22);
    color: var(--success);
}

.notice-error {
    background: rgba(135, 39, 43, 0.09);
    border-color: rgba(135, 39, 43, 0.18);
    color: var(--danger);
}

.notice-warning {
    background: rgba(138, 97, 17, 0.12);
    border-color: rgba(138, 97, 17, 0.22);
    color: var(--warning);
}

.field-error {
    color: var(--danger);
    font-size: 0.9rem;
}

.muted {
    color: var(--text-soft);
}

.waiver-box,
.event-summary {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--radius-small);
    background: var(--surface-soft);
    border: 1px solid var(--border);
}

.content-drawer {
    margin-top: 1rem;
    border-radius: var(--radius-small);
    background: var(--surface-soft);
    border: 1px solid var(--border);
    overflow: hidden;
}

.content-drawer summary {
    position: relative;
    display: block;
    padding: 1rem 3.25rem 1rem 1rem;
    cursor: pointer;
    list-style: none;
    font-weight: 700;
    color: var(--text);
}

.content-drawer summary::-webkit-details-marker {
    display: none;
}

.content-drawer summary::after {
    content: "+";
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(158, 27, 31, 0.08);
    color: var(--brand-red);
    font-size: 1.1rem;
    line-height: 1;
}

.content-drawer[open] summary::after {
    content: "-";
}

.content-drawer__body {
    padding: 0 1rem 1rem;
    border-top: 1px solid rgba(93, 86, 78, 0.12);
}

.content-drawer__body > :first-child {
    margin-top: 1rem;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(4, 6, 8, 0.9);
}

.lightbox.is-open {
    display: flex;
}

.lightbox__dialog {
    position: relative;
    width: min(100%, 1100px);
    max-height: 100%;
    padding: 3.5rem 1rem 1rem;
}

.lightbox__image {
    width: 100%;
    max-height: calc(100vh - 6rem);
    object-fit: contain;
    border-radius: 16px;
    background: #fff;
}

.lightbox__close {
    position: absolute;
    top: 0;
    right: 0;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 1px solid rgba(200, 165, 76, 0.4);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 1.45rem;
    line-height: 1;
}

.site-footer {
    padding: 1.5rem 0 2rem;
    color: rgba(255, 255, 255, 0.76);
}

.footer-inner {
    display: grid;
    gap: 0.35rem;
    justify-items: center;
    text-align: center;
    font-size: 0.95rem;
}

.footer-inner p {
    margin: 0;
}

@media (min-width: 760px) {
    .event-layout {
        grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.2fr);
    }

    .form-grid,
    .filter-form,
    .summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 759px) {
    .header-inner,
    .brand {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-inner {
        align-items: stretch;
    }

    .brand {
        width: 100%;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        align-self: flex-end;
    }

    .site-nav {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.55rem;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        pointer-events: none;
        margin-top: 0.5rem;
        padding: 0;
        border-radius: 16px;
        background: transparent;
        border: 0;
        transition: max-height 0.2s ease, opacity 0.2s ease, padding 0.2s ease;
    }

    .site-nav.is-open {
        max-height: 20rem;
        opacity: 1;
        pointer-events: auto;
        padding: 0.75rem;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(200, 165, 76, 0.14);
    }

    .site-nav a {
        width: 100%;
        background: rgba(255, 255, 255, 0.04);
    }

    .section-heading {
        flex-direction: column;
        align-items: flex-start;
    }

    .button-row .button,
    .compact-row .button {
        width: 100%;
    }

    input[type="date"],
    input[type="time"] {
        font-size: 16px;
    }

    .footer-inner {
        justify-items: start;
        text-align: left;
    }
}

@media (min-width: 760px) {
    .site-nav {
        display: flex !important;
    }
}

@media print {
    .site-header,
    .hero-band,
    .site-footer,
    .filter-form,
    .button-row,
    .notice {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .card {
        box-shadow: none;
        border: none;
        padding: 0;
    }
}
