:root {
    --black: #090807;
    --ink: #18130d;
    --muted: #766c5d;
    --gold: #c99a2e;
    --gold-soft: #f3d27a;
    --white: #fffdf8;
    --line: #eadfcb;
    --danger: #b42318;
    --success: #166534;
    --pending: #9a6700;
    --shadow: 0 22px 60px rgba(15, 12, 8, .13);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--white);
    line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px clamp(18px, 5vw, 64px);
    background: rgba(255, 253, 248, .92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(201, 154, 46, .22);
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 220px;
}
.brand-mark {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    color: var(--black);
    background: linear-gradient(135deg, var(--gold-soft), var(--gold));
    font-weight: 800;
}
.brand small { display: block; color: var(--muted); font-size: 12px; line-height: 1.2; }
.site-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}
.site-nav a,
.admin-sidebar nav a {
    padding: 10px 13px;
    border-radius: 999px;
    color: #3a3024;
    font-weight: 700;
    font-size: 14px;
}
.site-nav a.active,
.site-nav a:hover,
.admin-sidebar nav a.active,
.admin-sidebar nav a:hover { background: #f7ecd1; color: var(--black); }
.site-nav .nav-cta { color: var(--gold); border: 1px solid var(--line); }
.nav-toggle { display: none; }

.hero {
    min-height: 680px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: end;
    gap: 40px;
    padding: 110px clamp(20px, 6vw, 86px) 70px;
    color: white;
    background:
        linear-gradient(90deg, rgba(9, 8, 7, .94), rgba(9, 8, 7, .68), rgba(9, 8, 7, .25)),
        url("../img/pageant-hero.svg") center/cover no-repeat,
        var(--black);
}
.hero-content { max-width: 780px; }
.eyebrow {
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 800;
    font-size: 12px;
    margin: 0 0 12px;
}
h1, h2, h3 {
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.05;
    margin: 0;
}
h1 { font-size: clamp(44px, 8vw, 92px); }
h2 { font-size: clamp(30px, 4vw, 54px); }
h3 { font-size: 25px; }
.hero-copy {
    font-size: clamp(18px, 2vw, 23px);
    max-width: 650px;
    color: #f8ecd4;
}
.hero-actions,
.form-actions,
.table-head,
.admin-title {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.btn,
button.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    background: var(--black);
    color: white;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(0,0,0,.12);
}
.btn.primary { background: linear-gradient(135deg, var(--gold-soft), var(--gold)); color: var(--black); }
.btn.ghost { border: 1px solid rgba(255,255,255,.4); background: rgba(255,255,255,.08); color: white; }
.btn.ghost-dark { border: 1px solid var(--line); background: white; color: var(--black); }
.btn.small { min-height: 38px; padding: 0 16px; font-size: 13px; }
.btn.danger { background: var(--danger); }

.hero-panel,
.feature-card,
.status-card,
.article-card,
.detail-card,
.table-shell,
.login-panel,
.success-panel {
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}
.hero-panel {
    color: var(--black);
    padding: 28px;
}
.hero-panel span,
.hero-panel small { color: var(--muted); }
.hero-panel strong { display: block; font-size: 44px; color: var(--gold); }

.section,
.content-band,
.split-section,
.form-shell,
.article-grid,
.reading-page {
    padding: 76px clamp(18px, 6vw, 84px);
}
.section-heading { max-width: 820px; margin-bottom: 28px; }
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
.feature-card { padding: 28px; }
.feature-card span { color: var(--gold); font-weight: 900; }
.feature-card p,
.split-section p,
.prose,
.article-card p { color: var(--muted); }
.split-section {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    gap: 34px;
    background: var(--black);
    color: white;
}
.steps {
    display: grid;
    gap: 12px;
    padding: 0;
    margin: 0;
    list-style: none;
}
.steps li {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 16px;
    padding: 18px;
    border: 1px solid rgba(243, 210, 122, .24);
    border-radius: 8px;
    background: rgba(255,255,255,.06);
}
.steps span { color: #e8d8bb; }

.page-hero {
    padding: 80px clamp(18px, 6vw, 84px);
    background: linear-gradient(135deg, var(--black), #2a2014);
    color: white;
}
.page-hero.compact h1 { max-width: 820px; font-size: clamp(36px, 5vw, 68px); }
.content-band {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(260px, .7fr);
    gap: 36px;
}
.stat-strip {
    display: grid;
    gap: 12px;
}
.stat-strip div {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff8e8;
}
.stat-strip strong { display: block; font-size: 32px; color: var(--gold); }
.stat-strip span { color: var(--muted); }

.form-shell { max-width: 1180px; margin: 0 auto; }
.form-shell.narrow { max-width: 760px; }
.application-form,
.status-form,
.admin-filters {
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: clamp(18px, 4vw, 34px);
    box-shadow: var(--shadow);
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
label { display: grid; gap: 7px; font-weight: 800; color: #2c241b; }
input,
select,
textarea {
    width: 100%;
    border: 1px solid #d9c9aa;
    border-radius: 8px;
    padding: 13px 14px;
    font: inherit;
    color: var(--ink);
    background: #fffefa;
}
textarea { resize: vertical; }
.wide { grid-column: 1 / -1; }
.form-actions {
    justify-content: space-between;
    margin-top: 18px;
    color: var(--muted);
}

.flash {
    margin: 18px clamp(18px, 6vw, 84px);
    padding: 14px 18px;
    border-radius: 8px;
    font-weight: 800;
}
.flash.error { color: #7a271a; background: #fef3f2; border: 1px solid #fecdca; }
.flash.success { color: #085d3a; background: #ecfdf3; border: 1px solid #abefc6; }
.success-panel {
    max-width: 760px;
    margin: 72px auto;
    padding: clamp(28px, 5vw, 48px);
    text-align: center;
}
.id-box {
    display: inline-block;
    margin: 22px 0;
    padding: 16px 24px;
    border: 1px dashed var(--gold);
    background: #fff8e6;
    color: var(--black);
    border-radius: 8px;
    font-size: clamp(24px, 4vw, 40px);
    font-weight: 900;
}
.status-form { display: grid; gap: 16px; }
.status-card { margin-top: 20px; padding: 24px; }
.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}
.status-pill.pending { color: var(--pending); background: #fff7d6; }
.status-pill.approved { color: var(--success); background: #dcfce7; }
.status-pill.rejected { color: var(--danger); background: #fee2e2; }
.empty-state { padding: 28px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); background: #fffbf2; }

.article-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
.article-card { padding: 24px; }
.article-card time,
.reading-page time { color: var(--gold); font-weight: 800; font-size: 13px; }
.article-card a,
.back-link,
.actions a { color: var(--gold); font-weight: 900; }
.reading-page { max-width: 860px; margin: 0 auto; }
.reading-page h1 { color: var(--black); margin: 14px 0 22px; font-size: clamp(36px, 5vw, 64px); }
.prose { font-size: 18px; }

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 38px clamp(18px, 6vw, 84px);
    color: #eadfcb;
    background: var(--black);
}
.site-footer p { margin: 6px 0 0; color: #bcae96; }
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; }
.footer-links a { color: var(--gold-soft); font-weight: 800; }

.admin-body {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    min-height: 100vh;
    background: #fbf7ef;
}
.admin-login-body {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--black), #2a2014);
}
.admin-login-body .admin-main {
    display: grid;
    min-height: 100vh;
    place-items: center;
}
.admin-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px;
    background: var(--black);
    color: white;
}
.admin-sidebar .brand { margin-bottom: 28px; color: white; }
.admin-sidebar .brand small { color: #cbbda3; }
.admin-sidebar nav { display: grid; gap: 8px; }
.admin-sidebar nav a { color: #eadfcb; border-radius: 8px; }
.admin-main { padding: 34px clamp(18px, 4vw, 42px); min-width: 0; }
.admin-title { justify-content: space-between; margin-bottom: 20px; }
.admin-title h1 { font-size: clamp(32px, 4vw, 52px); }
.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.metric-grid div {
    padding: 22px;
    border-radius: 8px;
    background: white;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}
.metric-grid span { color: var(--muted); font-weight: 800; }
.metric-grid strong { display: block; font-size: 36px; color: var(--gold); }
.table-shell { overflow-x: auto; padding: 18px; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { text-align: left; padding: 13px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); text-transform: uppercase; }
.admin-filters {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 180px auto auto;
    gap: 12px;
    margin-bottom: 18px;
}
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.actions form { display: inline; }
.actions button {
    border: 0;
    background: transparent;
    color: var(--danger);
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}
.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 20px;
}
.detail-card { padding: 24px; }
.photo-grid { display: grid; gap: 16px; }
.photo-grid figure {
    margin: 0;
    padding: 12px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.photo-grid img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: 6px;
}
.photo-grid figcaption { margin-top: 8px; color: var(--muted); font-weight: 800; }
.admin-actions {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}
.admin-actions form:first-child {
    display: flex;
    gap: 12px;
    align-items: end;
    flex-wrap: wrap;
}
.admin-actions textarea { min-width: min(520px, 100%); }
.login-panel {
    max-width: 520px;
    margin: 60px auto;
    padding: clamp(24px, 5vw, 42px);
}
.checkbox-line {
    display: flex;
    align-items: center;
    gap: 10px;
}
.checkbox-line input { width: auto; }

@media (max-width: 900px) {
    .nav-toggle {
        display: inline-flex;
        border: 1px solid var(--line);
        background: white;
        border-radius: 999px;
        padding: 9px 14px;
        font-weight: 800;
    }
    .site-nav {
        position: absolute;
        left: 18px;
        right: 18px;
        top: 82px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: white;
        box-shadow: var(--shadow);
    }
    .site-nav.open { display: flex; }
    .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 80px; }
    .feature-grid,
    .article-grid,
    .content-band,
    .split-section,
    .detail-layout { grid-template-columns: 1fr; }
    .admin-body { grid-template-columns: 1fr; }
    .admin-sidebar {
        position: static;
        height: auto;
    }
    .admin-sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-filters { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .site-header { padding: 14px 16px; }
    .brand { min-width: 0; }
    .brand small { display: none; }
    .form-grid,
    .metric-grid { grid-template-columns: 1fr; }
    .steps li { grid-template-columns: 1fr; }
    .site-footer { flex-direction: column; }
    .admin-actions form:first-child { display: grid; }
}
