/* =========================================================================
   Vermont Scholastic Chess — design tokens + components
   Palette drawn from the subject: deep Vermont pine, warm board-ivory,
   brass accent for the chess-piece sponsor tiers. Signature: a thin
   chessboard rule used as a structural divider.
   ========================================================================= */

:root {
  --ivory:     #ECE7DB;
  --paper:     #FBFAF7;
  --ink:       #16211B;
  --ink-soft:  #4C574F;
  --pine:      #1F4A38;
  --pine-700:  #163629;
  --brass:     #C29B43;
  --brass-600: #A9863A;
  --line:      #D9D2C3;

  --shadow: 0 1px 2px rgba(22,33,27,.06), 0 8px 24px rgba(22,33,27,.06);
  --radius: 10px;
  --wrap: 1080px;

  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: var(--ivory);
  line-height: 1.6;
  font-size: 17px;
}

h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.12; margin: 0 0 .4em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }
a { color: var(--pine); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* eyebrow / label utility */
.eyebrow {
  font-size: .74rem; letter-spacing: .18em; text-transform: uppercase;
  font-weight: 600; color: var(--brass-600);
}

/* ---- chessboard rule (signature) ---------------------------------------- */
.board-rule {
  height: 10px;
  background-image:
    linear-gradient(45deg, var(--pine) 25%, transparent 25%, transparent 75%, var(--pine) 75%),
    linear-gradient(45deg, var(--pine) 25%, transparent 25%, transparent 75%, var(--pine) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  background-color: var(--brass);
  opacity: .9;
}

/* ---- header ------------------------------------------------------------- */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-area { display: flex; align-items: center; gap: 14px; }
.fb-icon { display: inline-flex; align-items: center; line-height: 0; color: var(--pine); opacity: .9; transition: opacity .15s, transform .15s; }
.fb-icon:hover { opacity: 1; transform: translateY(-1px); }
.fb-icon svg { display: block; }
.brand img { height: 46px; width: auto; }
.brand .brand-text { font-family: var(--display); font-weight: 600; font-size: 1.05rem; color: var(--ink); line-height: 1.1; }
.nav { display: flex; align-items: center; gap: 26px; }
.nav a { color: var(--ink); font-weight: 500; font-size: .96rem; }
.nav a:hover { color: var(--pine); text-decoration: none; }
.nav .fb { color: var(--ink-soft); font-size: .85rem; }

/* ---- hero (featured event) ---------------------------------------------- */
.hero {
  background: radial-gradient(120% 120% at 70% -10%, var(--pine) 0%, var(--pine-700) 55%, var(--ink) 100%);
  color: #F3EFE4;
}
.hero .wrap { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; padding-top: 64px; padding-bottom: 64px; }
.hero .eyebrow { color: var(--brass); }
.hero h1 { color: #FBF7EC; margin-top: .3rem; }
.hero .meta { font-size: 1.05rem; color: #D9E2D6; margin: 0 0 1.4rem; }
.hero .meta strong { color: #fff; font-weight: 600; }
.hero-art { justify-self: center; }
.hero-art img { border-radius: var(--radius); box-shadow: var(--shadow); max-height: 340px; width: auto; }

/* buttons */
.btn { display: inline-block; font-weight: 600; font-size: .98rem; padding: 12px 22px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; }
.btn-primary { background: var(--brass); color: #211a06; }
.btn-primary:hover { background: #d3a949; text-decoration: none; }
.btn-ghost { border-color: rgba(255,255,255,.4); color: #F3EFE4; }
.btn-ghost:hover { border-color: #fff; text-decoration: none; }
.btn-outline { border-color: var(--pine); color: var(--pine); background: transparent; }
.btn-outline:hover { background: var(--pine); color: #fff; text-decoration: none; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.reg-note { font-size: .9rem; color: #CDD8CB; margin-top: .8rem; }

/* ---- generic sections --------------------------------------------------- */
.section { padding: 56px 0; }
.section-tight { padding: 40px 0; }
.section.alt { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.center { text-align: center; }
.lead { font-size: 1.1rem; color: var(--ink-soft); max-width: 60ch; }
.center .lead { margin-left: auto; margin-right: auto; }

/* sponsors strip */
.sponsors { text-align: center; }
.sponsors .eyebrow { display: block; margin-bottom: 14px; }
.sponsor-list { display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: center; font-family: var(--display); font-size: 1.15rem; color: var(--pine-700); }
.sponsor-list span { position: relative; }
.sponsor-list span:not(:last-child)::after { content: "•"; color: var(--brass); margin-left: 28px; }

/* archive teaser + cards */
.teaser { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: center; }
.teaser img { border-radius: var(--radius); box-shadow: var(--shadow); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card .date { font-size: .82rem; letter-spacing: .04em; color: var(--brass-600); font-weight: 600; text-transform: uppercase; }
.card h3 { margin: .3rem 0 .5rem; }
.card .venue { color: var(--ink-soft); font-size: .95rem; margin: 0; }

/* tier cards (sponsor/donate) */
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.tier { background: var(--paper); border: 1px solid var(--line); border-top: 3px solid var(--brass); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.tier .glyph { font-size: 2.2rem; color: var(--pine); line-height: 1; }
.tier h3 { margin: .3rem 0 .1rem; }
.tier .price { font-family: var(--display); font-size: 1.9rem; color: var(--brass-600); margin: 0 0 .8rem; }
.tier ul { list-style: none; padding: 0; margin: 0; }
.tier li { padding-left: 1.4em; position: relative; margin-bottom: .5rem; font-size: .95rem; color: var(--ink-soft); }
.tier li::before { content: "\2713"; color: var(--pine); position: absolute; left: 0; font-weight: 700; }

/* sections list on event detail */
.section-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 10px; }
.section-list li { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; font-size: .95rem; }
.section-list .flag { display: inline-block; font-size: .7rem; letter-spacing: .05em; text-transform: uppercase; color: var(--brass-600); font-weight: 600; }

.notice { background: #FBF6E6; border: 1px solid #E6D9A8; border-radius: 8px; padding: 14px 16px; font-size: .92rem; color: #6b5a1f; }

/* ---- footer ------------------------------------------------------------- */
.site-footer { background: var(--ink); color: #C9D2C6; padding: 40px 0; font-size: .9rem; }
.site-footer a { color: #E7DFC9; }
.site-footer .org { font-family: var(--display); color: #fff; font-size: 1.1rem; margin-bottom: 6px; }
.site-footer .sponsors-line { color: #9FB0A2; margin: 10px 0; }

/* ---- responsive --------------------------------------------------------- */
@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; text-align: center; padding-top: 48px; padding-bottom: 48px; }
  .hero-art { order: -1; }
  .btn-row { justify-content: center; }
  .teaser { grid-template-columns: 1fr; }
  .tiers { grid-template-columns: 1fr; }
  .site-header .wrap { flex-wrap: wrap; gap: 8px 16px; }
  .nav { flex-wrap: wrap; gap: 14px 18px; }
}

/* accessibility */
a:focus-visible, .btn:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* ---- event page --------------------------------------------------------- */
.event-hero .venue-link { color: #E7DFC9; text-decoration: underline; text-underline-offset: 3px; }
.event-body { max-width: 820px; }
.event-body h2 { margin-top: 2.2rem; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; margin: 0 0 1rem; font-size: .95rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.data thead th { background: var(--pine-700); color: #F3EFE4; text-align: left; padding: 10px 14px; font-family: var(--body); font-weight: 600; font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; }
table.data td { padding: 9px 14px; border-top: 1px solid var(--line); }
table.data tbody tr:nth-child(even) td { background: #F4F0E6; }

/* native <details> accordion */
.accordion { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper); }
.accordion details { border-top: 1px solid var(--line); }
.accordion details:first-child { border-top: 0; }
.accordion summary { cursor: pointer; padding: 15px 18px; font-family: var(--display); font-weight: 600; font-size: 1.08rem; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: "+"; color: var(--brass-600); font-size: 1.3rem; line-height: 1; }
.accordion details[open] summary::after { content: "\2013"; }
.accordion summary:hover { color: var(--pine); }
.acc-body { padding: 0 18px 16px; color: var(--ink-soft); }
.acc-body ul { margin: .4rem 0 .8rem; padding-left: 1.2rem; }
.acc-body a { color: var(--pine); }

.register-area { margin-top: 40px; padding-top: 28px; border-top: 2px solid var(--line); }
.addons-label { margin-bottom: 6px; }
.addons { list-style: none; padding: 0; margin: 0 0 18px; max-width: 360px; }
.addons li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.addons .price { font-weight: 600; color: var(--brass-600); }

code { background: #ece7db; padding: 1px 6px; border-radius: 4px; font-size: .88em; font-family: ui-monospace, Menlo, monospace; }

/* results (posted as blocks, one per section) */
.results-area { margin-top: 40px; padding-top: 28px; border-top: 2px solid var(--line); }
.results-area h3 { margin: 26px 0 8px; }
.results-area table { width: 100%; border-collapse: collapse; margin: 0 0 1rem; font-size: .92rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.results-area th { background: var(--pine-700); color: #F3EFE4; text-align: left; padding: 8px 12px; font-size: .78rem; letter-spacing: .03em; text-transform: uppercase; }
.results-area td { padding: 7px 12px; border-top: 1px solid var(--line); }
.results-area tbody tr:nth-child(even) td { background: #F4F0E6; }

/* legal pages (privacy policy, terms) */
.legal-page { max-width: 760px; }
.legal-body h2 { margin: 2rem 0 .6rem; font-size: 1.4rem; }
.legal-body h3 { margin: 1.4rem 0 .4rem; font-size: 1.08rem; color: var(--pine); }
.legal-body p, .legal-body li { color: var(--ink-soft); line-height: 1.7; }
.legal-body ul { margin: .5rem 0 1rem; padding-left: 1.3rem; }
.legal-body a { color: var(--pine); }
.legal-updated { margin-top: 2rem; font-weight: 600; color: var(--ink); }
.legal-note { font-size: .92rem; }
.site-footer a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* registration wizard */
.wizard { max-width: 640px; }
.wizard-step { font-family: var(--body); font-size: .82rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--brass-600); margin: 1.2rem 0 .4rem; }
.wizard-bar { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 1.4rem; }
.wizard-bar span { display: block; height: 100%; background: var(--pine); border-radius: 999px; transition: width .3s; }
.radio-card { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; cursor: pointer; background: var(--paper); }
.radio-card:hover { border-color: var(--brass); }
.radio-card input { margin-top: 3px; }
.wizard-actions { display: flex; gap: 10px; margin-top: 22px; }
.field-error { color: #a23b32; font-size: .88rem; margin: -6px 0 12px; }
fieldset.fld { border: 0; padding: 0; margin: 0 0 14px; }
fieldset.fld > span { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }

/* --- wizard spacing + Stage 2 components ------------------------------- */
.wizard h2 { margin: 1.9rem 0 .5rem; }
.wizard .lead { color: var(--ink-soft); line-height: 1.65; margin: 0 0 1.9rem; }
.wizard form { margin-top: .5rem; }
.fld-row { display: flex; gap: 18px; flex-wrap: wrap; }
.fld-row .fld { flex: 1 1 220px; }
.fld { display: block; margin-bottom: 20px; }
.fld > span { display: block; font-size: .9rem; font-weight: 600; margin-bottom: 7px; }
.fld > span em { font-weight: 400; color: var(--ink-soft); font-style: normal; }
.fld input, .fld select { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: var(--paper); }
.fld input:focus, .fld select:focus { outline: 2px solid var(--brass); border-color: var(--brass); }
.fld-hint { font-size: .85rem; color: var(--ink-soft); margin: -12px 0 18px; line-height: 1.5; }
.radio-card { margin-bottom: 16px; padding: 18px; }
.radio-card span strong { font-size: 1.02rem; }
.chk-row { display: flex; gap: 22px; margin-top: 4px; }
.chk { display: inline-flex; gap: 8px; align-items: center; font-size: .95rem; }
.consent-inline { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.wizard-actions { display: flex; gap: 12px; margin-top: 26px; align-items: center; }
.reg-savednote { font-size: .9rem; color: var(--ink-soft); background: var(--paper-2, #f6f3ec); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 1.6rem; }
.reg-subhead { margin: 2rem 0 .8rem; font-size: 1.08rem; }
.reg-list { list-style: none; padding: 0; margin: 0 0 1.2rem; }
.reg-list li { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: var(--paper); }
.reg-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 6px; background: var(--paper); }
.reg-haring { margin: 6px 0 4px; }
.reg-continue { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.consent-box { border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; max-height: 260px; overflow-y: auto; background: var(--paper); margin-bottom: 12px; }
.consent-box p { margin: 0 0 .7rem; line-height: 1.6; color: var(--ink-soft); font-size: .92rem; }
.consent-ack { margin: 0 0 1.4rem; font-weight: 600; }
.reg-review { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 1.4rem; }
.reg-consent-ok { color: var(--pine); font-weight: 600; margin-top: 1rem; }

/* account / logout / impersonation */
.nav-logout { display: inline; margin: 0; }
.nav-logout button, .nav .btn-link { background: none; border: 0; font: inherit; color: inherit; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.account { max-width: 720px; }
.account-logout { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.imp-banner { background: #8a1c1c; color: #fff; font-size: .9rem; }
.imp-banner .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; }
.imp-banner form { margin: 0; }
.imp-banner button { background: #fff; color: #8a1c1c; border: 0; border-radius: 6px; padding: 5px 12px; font: inherit; font-weight: 600; cursor: pointer; }

/* resume-hung-order banner */
.resume-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--brass); background: #faf6ea; border-radius: var(--radius); padding: 16px 18px; margin-bottom: 1.8rem; }
.resume-banner form { margin: 0; }

/* hard-gate verify page + small logout + admin email edit */
.verify-actions { margin: 1.6rem 0; }
.verify-help { border-top: 1px solid var(--line); margin-top: 1.6rem; padding-top: 1.4rem; }
.verify-help p { margin: 0 0 1rem; color: var(--ink-soft); line-height: 1.6; }
.account-id { display: flex; align-items: center; gap: 12px; color: var(--ink-soft); }
.inline-logout { margin: 0; display: inline; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--pine); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font-size: .9rem; }
.account-emailnote { margin-top: 4px; font-size: .9rem; }
.inline-email { display: flex; gap: 6px; margin: 0; }
.inline-email input { padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; font: inherit; min-width: 200px; }

/* searchable school combobox */
.combo { position: relative; }
.combo-input { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: var(--paper); }
.combo-input:focus { outline: 2px solid var(--brass); border-color: var(--brass); }
.combo-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.14); max-height: 260px; overflow-y: auto; }
.combo-opt { padding: 9px 11px; border-radius: 7px; cursor: pointer; font-size: .95rem; }
.combo-opt:hover, .combo-opt.is-active { background: var(--pine); color: #fff; }

/* readable small + danger-outline buttons on public pages; fold-down add form */
.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn-danger-outline { border-color: #a23b32; color: #a23b32; background: transparent; }
.btn-danger-outline:hover { background: #a23b32; color: #fff; text-decoration: none; }
.addshade { border: 1px solid var(--line); border-radius: var(--radius); margin-top: 8px; background: var(--paper); }
.addshade[open] { padding-bottom: 6px; }
.addshade > summary { list-style: none; cursor: pointer; padding: 14px 18px; font-weight: 600; color: var(--pine); user-select: none; }
.addshade > summary::-webkit-details-marker { display: none; }
.addshade > summary:hover { background: #faf6ea; border-radius: var(--radius); }
.addshade[open] > summary { border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
.addshade > .reg-card { border: 0; }
.fld textarea { width:100%; padding:11px 13px; border:1px solid var(--line); border-radius:10px; font:inherit; background:var(--paper); resize:vertical; } .fld textarea:focus { outline:2px solid var(--brass); border-color:var(--brass); }

/* account order actions */
.order-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.order-actions form { margin: 0; }
.flash-wrap { padding-top: 18px; } .flash-wrap .notice { margin-bottom: 0; }
.reg-total { font-size:1.15rem; margin-top:1rem; padding-top:1rem; border-top:1px solid var(--line); }
