/* Oldfields Sports & Social Club — site styles
   Palette is the physical card: black panel, white face, warm card-stock page. */

:root {
  --black: #000000;
  --ink: #161616;
  --paper: #F3F1EC;
  --white: #FFFFFF;
  --line: #D6D2C9;
  --line-strong: #B9B4A9;
  --muted: #6B675F;
  --ok: #1D7A3B;
  --warn: #9A6A00;
  --bad: #B3261E;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --max: 1080px;
  --radius: 4px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1; margin: 0 0 .4em; letter-spacing: .005em; }
h1 { font-size: clamp(44px, 8vw, 84px); }
h2 { font-size: clamp(32px, 5vw, 48px); }
h3 { font-size: 26px; }
p { margin: 0 0 1em; max-width: 60ch; }
.lede { font-size: 20px; color: var(--muted); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
section { padding: 56px 0; }
section + section { border-top: 1px solid var(--line); }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid var(--black); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- Header ---------- */
.site-header { background: var(--black); color: var(--white); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 20px; line-height: 1; text-transform: uppercase; }
.brand img { height: 46px; width: auto; mix-blend-mode: screen; }
.brand img + span { display: none; }
.brand small { display: block; font-size: 11px; font-weight: 500; letter-spacing: .12em; opacity: .75; margin-top: 3px; }
.nav { display: flex; gap: 4px; align-items: center; }
.nav a { color: var(--white); text-decoration: none; padding: 8px 10px; font-weight: 500; font-size: 15px; border-radius: var(--radius); opacity: .85; }
.nav a:hover, .nav a[aria-current] { opacity: 1; background: rgba(255,255,255,.12); }
.nav a.cta { background: var(--white); color: var(--black); opacity: 1; font-weight: 600; }
@media (max-width: 640px) {
  .site-header .wrap { flex-wrap: wrap; padding-bottom: 8px; }
  .brand { padding-top: 12px; }
  .nav { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .nav a { white-space: nowrap; padding: 6px 8px; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--black); color: var(--white); padding: 40px 0; margin-top: 40px; font-size: 15px; }
.site-footer .wrap { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.site-footer h3 { font-size: 20px; margin-bottom: 8px; }
.site-footer p { margin: 0 0 6px; opacity: .85; white-space: pre-line; }
.site-footer a { color: var(--white); }
.site-footer .fine { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.2); padding-top: 16px; opacity: .6; font-size: 13px; }

/* ---------- Buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 16px var(--body); padding: 12px 20px; border-radius: var(--radius);
  background: var(--black); color: var(--white); border: 2px solid var(--black);
  text-decoration: none; cursor: pointer; min-height: 46px; transition: transform .08s ease;
}
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.small { padding: 7px 12px; min-height: 36px; font-size: 14px; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: var(--white); }
.btn.danger.ghost { background: transparent; color: var(--bad); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
input, select, textarea {
  width: 100%; font: 400 17px var(--body); padding: 11px 12px; border: 1px solid var(--line-strong);
  border-radius: var(--radius); background: var(--white); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--black); outline-offset: 0; border-color: var(--black); }
textarea { min-height: 110px; resize: vertical; }
.field { margin-bottom: 18px; }
.field .hint { font-size: 14px; color: var(--muted); margin-top: 6px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.check input { width: auto; }
.form { max-width: 460px; }
.notice { padding: 12px 14px; border-left: 3px solid var(--black); background: var(--white); margin-bottom: 18px; font-size: 15px; }
.notice.bad { border-color: var(--bad); }
.notice.ok { border-color: var(--ok); }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 40px; }
.hero .wrap { display: grid; gap: 40px; align-items: center; grid-template-columns: 1fr; }
.hero .copy p { font-size: 20px; }
@media (min-width: 880px) {
  .hero { padding: 80px 0 64px; }
  .hero .wrap { grid-template-columns: 1fr 1fr; }
}

/* ---------- Membership card ---------- */
.mcard {
  container-type: inline-size;
  display: grid; grid-template-columns: 1fr; width: 100%; max-width: 420px;
  background: var(--white); color: var(--ink); border-radius: 12px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 18px 40px -18px rgba(0,0,0,.45);
  border: 1px solid rgba(0,0,0,.08);
}
.mcard-front { background: var(--black); color: var(--white); padding: 24px 20px; display: grid; grid-template-rows: 1fr auto; gap: 18px; min-height: 300px; }
.mcard-mark { align-self: center; }
.mcard-mark { display: grid; gap: 10px; justify-items: center; text-align: center; }
.mcard-mark img { max-height: 170px; width: auto; max-width: 100%; mix-blend-mode: screen; }
.mcard-mark img + .mcard-club { display: none; }
.mcard-club { font-family: var(--display); font-weight: 600; font-size: clamp(15px, 5.2cqw, 20px); overflow-wrap: anywhere; line-height: 1.15; text-transform: uppercase; letter-spacing: .02em; }
.mcard-title {
  font-family: var(--display); font-weight: 700; font-size: clamp(24px, 9.5cqw, 38px); line-height: .95; text-align: center; text-transform: uppercase;
  border-top: 2px solid var(--white); border-bottom: 2px solid var(--white); padding: 12px 0; letter-spacing: .01em;
}
.mcard-face { padding: 24px; display: grid; gap: 16px; position: relative; }
.mcard-face .f { border-bottom: 1px dotted var(--line-strong); padding-bottom: 6px; }
.mcard-face .f span { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }
.mcard-face .f strong { display: block; font-family: var(--display); font-weight: 600; font-size: 24px; line-height: 1.1; margin-top: 2px; word-break: break-word; }
.mcard-face .f.small strong { font-size: 19px; }
.mcard-face .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mcard-qr { display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: center; padding-top: 4px; }
.mcard-qr img { width: 112px; height: 112px; border: 1px solid var(--line); border-radius: 4px; }
.mcard-qr .scan { font-size: 13px; color: var(--muted); line-height: 1.4; }
.mcard-tier {
  position: absolute; top: 18px; right: 18px; font-family: var(--display); font-weight: 700; font-size: 13px;
  text-transform: uppercase; letter-spacing: .08em; padding: 4px 9px; border-radius: 3px; color: var(--white); background: var(--tier, var(--black));
}
.mcard[data-status="expired"] .mcard-face, .mcard[data-status="revoked"] .mcard-face, .mcard[data-status="pending"] .mcard-face { filter: grayscale(1); }
.mcard-stamp {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
}
.mcard-stamp span {
  font-family: var(--display); font-weight: 700; font-size: 40px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--bad); border: 4px solid var(--bad); padding: 6px 16px; transform: rotate(-12deg); background: rgba(255,255,255,.85); border-radius: 6px;
}
.mcard-stamp.pending span { color: var(--warn); border-color: var(--warn); }
@media (min-width: 560px) {
  .mcard { grid-template-columns: 42% 58%; max-width: 680px; }
  .mcard-front { min-height: 0; }
  .mcard-club { font-size: clamp(14px, 2.6cqw, 20px); }
  .mcard-title { font-size: clamp(22px, 4.6cqw, 38px); }
  .mcard-mark img { max-height: 26cqw; }
  .mcard-front { padding: 32px 26px; }
  .mcard-face { padding: 28px 28px 24px; align-content: start; }
  .mcard-qr img { width: 124px; height: 124px; }
  .mcard-qr { grid-template-columns: 124px 1fr; }
}
.mcard.sample { pointer-events: none; }

/* Full-screen card mode for showing at the bar */
.card-stage { display: grid; gap: 20px; justify-items: start; }
.card-stage .mcard { justify-self: center; }
body.showcard { background: var(--black); }
body.showcard .site-header, body.showcard .site-footer, body.showcard .not-card { display: none !important; }
body.showcard .card-stage { min-height: 100svh; align-content: center; justify-content: center; grid-template-columns: minmax(0, 440px); padding: 16px; }
body.showcard .card-stage > * { width: 100%; }
body.showcard .card-stage .btn-row { justify-content: center; }
body.showcard .mcard { max-width: none; grid-template-columns: 1fr; aspect-ratio: auto; }

/* ---------- Tiers ---------- */
.tiers { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.tier { background: var(--white); border: 1px solid var(--line); border-top: 6px solid var(--tier, var(--black)); border-radius: var(--radius); padding: 24px; display: grid; gap: 12px; align-content: start; }
.tier h3 { margin: 0; }
.tier .price { font-family: var(--display); font-weight: 700; font-size: 52px; line-height: 1; }
.tier .price small { font-size: 18px; font-weight: 500; color: var(--muted); font-family: var(--body); margin-left: 6px; }
.tier ul { margin: 0; padding-left: 18px; }
.tier li { margin-bottom: 4px; }
.tier .btn { margin-top: 8px; }

/* ---------- Events ---------- */
.events { display: grid; gap: 0; border-top: 1px solid var(--line); }
.event { display: grid; grid-template-columns: 78px 1fr; gap: 18px; padding: 22px 0; border-bottom: 1px solid var(--line); align-items: start; }
.event .date { font-family: var(--display); text-align: center; line-height: 1; border-right: 1px solid var(--line); padding-right: 14px; }
.event .date b { display: block; font-size: 40px; font-weight: 700; }
.event .date span { display: block; font-size: 15px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-top: 4px; }
.event h3 { margin-bottom: 4px; }
.event .meta { color: var(--muted); font-size: 15px; margin-bottom: 8px; }
.event .desc { white-space: pre-line; margin-bottom: 12px; }
.event .rsvp { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 14px; color: var(--muted); }
.event .rsvp .btn.on { background: var(--black); color: var(--white); }
.event .rsvp .btn.off { background: transparent; color: var(--ink); }
.event .tag { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: var(--black); color: var(--white); padding: 3px 7px; border-radius: 3px; margin-left: 8px; vertical-align: middle; }
.empty { padding: 32px 0; color: var(--muted); }

/* ---------- Info blocks ---------- */
.split { display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 800px) { .split { grid-template-columns: 1.2fr 1fr; } }
.hours { white-space: pre-line; font-size: 18px; }
.kv { display: grid; gap: 10px; }
.kv div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.kv div span:first-child { color: var(--muted); font-size: 15px; }

/* ---------- Verify page ---------- */
.verify { min-height: 100svh; display: grid; place-content: center; padding: 24px; text-align: center; }
.verify .status { font-family: var(--display); font-weight: 700; font-size: clamp(56px, 16vw, 120px); line-height: 1; text-transform: uppercase; }
.verify .status.ok { color: var(--ok); }
.verify .status.bad { color: var(--bad); }
.verify .status.warn { color: var(--warn); }
.verify .who { font-family: var(--display); font-weight: 600; font-size: 34px; margin-top: 12px; }
.verify .detail { color: var(--muted); margin-top: 6px; font-size: 18px; }
body.v-ok { background: #E3F3E8; }
body.v-bad { background: #F8E1DF; }
body.v-warn { background: #F7ECD2; }

/* ---------- Account ---------- */
.account-grid { display: grid; gap: 40px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .account-grid { grid-template-columns: 1.3fr 1fr; } }
.status-line { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); }
.dot.active { background: var(--ok); } .dot.pending { background: var(--warn); } .dot.expired, .dot.revoked { background: var(--bad); }

/* ---------- Admin ---------- */
.admin-tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--black); margin-bottom: 24px; overflow-x: auto; }
.admin-tabs button { font: 600 16px var(--body); padding: 10px 14px; background: none; border: none; cursor: pointer; color: var(--muted); white-space: nowrap; }
.admin-tabs button[aria-selected="true"] { color: var(--black); box-shadow: inset 0 -3px 0 var(--black); }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-bottom: 28px; }
.stat { background: var(--white); border: 1px solid var(--line); padding: 14px; border-radius: var(--radius); }
.stat b { display: block; font-family: var(--display); font-size: 40px; font-weight: 700; line-height: 1; }
.stat span { font-size: 14px; color: var(--muted); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar input { max-width: 320px; }
.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
th { font-weight: 600; background: var(--paper); font-size: 13px; }
td.wrap-text { white-space: normal; min-width: 200px; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 3px 8px; border-radius: 3px; color: var(--white); background: var(--muted); }
.pill.active { background: var(--ok); } .pill.pending { background: var(--warn); } .pill.expired, .pill.revoked { background: var(--bad); } .pill.none { background: var(--line-strong); color: var(--ink); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; min-width: 250px; }
td.stack { line-height: 1.5; }
td.stack small { color: var(--muted); font-size: 13px; }
td.stack a { color: inherit; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.panel h3 { margin-bottom: 14px; }
.grid-2 { display: grid; gap: 0 20px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
dialog { border: none; border-radius: 8px; padding: 24px; max-width: 520px; width: calc(100% - 32px); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(0,0,0,.5); }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--black); color: var(--white); padding: 12px 18px; border-radius: 6px; font-weight: 500; z-index: 50; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.toast.bad { background: var(--bad); }

/* Admin tables stack into cards on phones: no sideways scrolling to find the buttons. */
@media (max-width: 720px) {
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; }
  .table-wrap thead { display: none; }
  .table-wrap tr { display: flex; flex-direction: column; padding: 10px 14px 12px; border-bottom: 6px solid var(--paper); }
  .table-wrap tr:last-child { border-bottom: none; }
  .table-wrap td { border: none; padding: 5px 0; white-space: normal; display: flex; gap: 12px; align-items: baseline; min-width: 0; }
  .table-wrap td::before { content: attr(data-label); flex: 0 0 84px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
  .table-wrap td:not([data-label])::before { content: none; }
  .table-wrap td.wrap-text { min-width: 0; }
  .table-wrap td:has(.row-actions) { display: block; padding-top: 10px; }
  .table-wrap td:has(.row-actions)::before { content: none; }
  .table-wrap td.empty { display: block; text-align: center; }
  .table-wrap td.stack br { display: block; content: ''; margin-top: 2px; }
  .table-wrap td.name-cell { order: -1; font: 700 19px/1.2 var(--display); display: block; padding-bottom: 2px; }
  .table-wrap td.name-cell::before { content: none; }
  .row-actions .btn.small { flex: 1 1 calc(50% - 6px); text-align: center; }
}
