/* ── Design tokens ── */
:root {
    --ink:    #111111;
    --chalk:  #f7f5f0;
    --line:   #e0ddd7;
    --gold:   #b8963e;
    --muted:  #888580;
    --danger: #c0392b;
    --radius: 6px;
    --w:      1200px;
    --pad:    clamp(16px, 2.5vw, 32px);
}

/* ── Reset / base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
    background: var(--chalk);
    color: var(--ink);
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 600;
    letter-spacing: -.3px;
    line-height: 1.2;
}

a { color: var(--gold); }
a:hover { color: var(--ink); text-decoration: none; }

/* ── Nav ── */
.site-nav {
    background: var(--ink);
    padding: 0 var(--pad);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-nav__inner {
    max-width: var(--w);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
}

.site-nav__brand {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: #fff;
    text-decoration: none;
    letter-spacing: .02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-nav__brand:hover { color: var(--gold); }

.site-nav__links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.site-nav__link {
    color: rgba(255,255,255,.7);
    font-size: .85rem;
    font-weight: 400;
    padding: 6px 12px;
    border-radius: var(--radius);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    transition: color .15s, background .15s;
}

.site-nav__link:hover,
.site-nav__link:focus {
    color: #fff;
    background: rgba(255,255,255,.08);
    outline: none;
}

.site-nav__link--active { color: #fff !important; }

/* ── Admin subnav ── */
.admin-subnav {
    background: #fff;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.admin-subnav::-webkit-scrollbar { display: none; }

.admin-subnav__inner {
    max-width: var(--w);
    margin: 0 auto;
    padding: 0 var(--pad);
    display: flex;
    align-items: center;
    gap: 0;
    height: 40px;
    white-space: nowrap;
}

.admin-subnav__group {
    display: flex;
    align-items: center;
    gap: 2px;
}

.admin-subnav__label {
    font-size: .7rem;
    font-weight: 500;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0 8px 0 4px;
}

.admin-subnav__divider {
    width: 1px;
    height: 16px;
    background: var(--line);
    margin: 0 8px;
    flex-shrink: 0;
}

.admin-subnav__link {
    font-size: .8rem;
    color: var(--muted);
    text-decoration: none;
    padding: 4px 10px;
    border-radius: var(--radius);
    transition: color .15s, background .15s;
}

.admin-subnav__link:hover {
    color: var(--ink);
    background: var(--chalk);
    text-decoration: none;
}

.admin-subnav__link--active {
    color: var(--ink);
    font-weight: 500;
    background: var(--chalk);
}

/* ── Announcements bar ── */
.announcements-bar {
    background: #fffbea;
    border-bottom: 1px solid #f0e68c;
    display: flex;
    align-items: center;
    padding: 0 var(--pad);
    min-height: 38px;
    gap: 12px;
}

.announcement {
    flex: 1;
    font-size: .85rem;
    color: #6b5900;
    padding: 8px 0;
}

.announcement p { margin: 0; }
.announcement ul, .announcement ol { margin: 0; padding-left: 16px; }
.announcement a { color: #6b5900; text-decoration: underline; }

.announcements-bar__controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.ann-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #6b5900;
    font-size: .8rem;
    padding: 4px 6px;
    border-radius: 4px;
    line-height: 1;
    opacity: .7;
    transition: opacity .15s;
}

.ann-btn:hover { opacity: 1; }
.ann-btn--close { font-size: .7rem; margin-left: 4px; }

.ann-count {
    font-size: .75rem;
    color: #a08a00;
    min-width: 36px;
    text-align: center;
}

/* ── Flash messages ── */
.flash-container {
    max-width: var(--w);
    margin: 0 auto;
    padding: 0 var(--pad);
}

.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: .88rem;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
}

.flash--success { border-color: #b7ddb0; background: #f0faf0; }
.flash--danger, .flash--error { border-color: #f5c6c6; background: #fff5f5; color: var(--danger); }
.flash--warning { border-color: #f5e1a0; background: #fffbf0; }
.flash--info { border-color: #b8d4e8; background: #f0f7ff; }

.flash__close {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* ── Page wrapper — single consistent max-width across all pages ── */
.page {
    width: 100%;
    max-width: var(--w);
    margin: 48px auto 80px;
    padding: 0 var(--pad);
    animation: fadeUp .4s ease both;
}

/* Keep these classes for backward compat — they don't change the width */
.page--wide,
.page--full {
    max-width: var(--w);
}

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

/* ── Page header ── */
.page-header {
    margin-bottom: 32px;
    border-bottom: 2px solid var(--ink);
    padding-bottom: 16px;
}

.page-header h1 {
    font-size: 2rem;
    margin: 0 0 4px;
}

.page-header p {
    color: var(--muted);
    font-size: .9rem;
    font-weight: 300;
    margin: 0;
}

/* ── Card blocks ── */
.card-block {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 16px;
}

.card-block__label {
    font-size: .7rem;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 18px;
}

/* ── Fields ── */
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.field:last-child { margin-bottom: 0; }

.field label {
    font-size: .8rem;
    font-weight: 500;
    color: var(--ink);
}

.field input,
.field select,
.field textarea {
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-family: 'DM Sans', sans-serif;
    font-size: .95rem;
    color: var(--ink);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
    width: 100%;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(17,17,17,.07);
}

.field input[readonly] {
    background: var(--chalk);
    color: var(--muted);
    cursor: default;
}

/* ── Buttons ── */
.btn-primary-ink {
    display: inline-block;
    padding: 11px 24px;
    background: var(--ink);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-family: 'DM Sans', sans-serif;
    font-size: .95rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: opacity .15s;
    white-space: nowrap;
}

.btn-primary-ink:hover:not(:disabled) { opacity: .82; color: #fff; }
.btn-primary-ink:disabled { opacity: .3; cursor: not-allowed; }
.btn-primary-ink--full { width: 100%; text-align: center; }

.btn-outline-ink {
    display: inline-block;
    padding: 10px 24px;
    background: transparent;
    color: var(--ink);
    border: 1.5px solid var(--ink);
    border-radius: var(--radius);
    font-family: 'DM Sans', sans-serif;
    font-size: .95rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, color .15s;
    white-space: nowrap;
}

.btn-outline-ink:hover { background: var(--ink); color: #fff; }

/* ── Tournament table ── */
.tournament-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

.tournament-table th {
    font-size: .7rem;
    font-weight: 500;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 10px 12px;
    text-align: left;
    border-bottom: 2px solid var(--ink);
}

.tournament-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    vertical-align: middle;
}

.tournament-table tr:last-child td { border-bottom: none; }
.tournament-table tr:hover td { background: var(--chalk); }

.tournament-table .tournament-name { font-weight: 500; }

.tournament-table .tournament-date {
    color: var(--muted);
    font-size: .85rem;
}

/* ── Admin tables ── */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .88rem;
}

.admin-table th {
    font-size: .7rem;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 10px 12px;
    border-bottom: 2px solid var(--ink);
    text-align: left;
}

.admin-table td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

.admin-table tr:hover td { background: var(--chalk); }

/* ── Bootstrap form overrides ── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.form-group label {
    font-size: .8rem;
    font-weight: 500;
    color: var(--ink);
    margin: 0;
}

.form-group .form-control {
    border: 1.5px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-family: 'DM Sans', sans-serif;
    font-size: .95rem;
    height: auto;
    background: #fff;
    color: var(--ink);
    transition: border-color .15s, box-shadow .15s;
}

.form-group .form-control:focus {
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(17,17,17,.07);
    outline: none;
}

.form-row .form-group {
    flex-direction: column;
    align-items: stretch;
}

/* ── Fieldsets ── */
fieldset {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
}

legend {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 600;
    padding: 0 8px;
    color: var(--ink);
}

/* ── Footer ── */
.site-footer {
    margin-top: auto;
    background: var(--ink);
    color: rgba(255,255,255,.5);
    padding: 32px var(--pad);
}

.site-footer__inner {
    max-width: var(--w);
    margin: 0 auto;
}

.site-footer__name {
    font-family: 'Playfair Display', serif;
    color: rgba(255,255,255,.85);
    font-size: 1rem;
    display: inline;
}

.site-footer__details {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: .8rem;
}

.site-footer__details a { color: rgba(255,255,255,.5); }
.site-footer__details a:hover { color: var(--gold); }

/* Hero reel styles live in home.html <style> block to avoid caching issues */

/* ── Responsive ── */
@media (max-width: 768px) {
    .hero-reel { height: 240px; }
    .page { margin-top: 28px; }
    .field-row { grid-template-columns: 1fr; }
    .page-header h1 { font-size: 1.6rem; }
}

@media (max-width: 540px) {
    .hero-reel { height: 180px; }
    .hero-reel__arrow { display: none; }
}
