/* =========================================================
   BrightClub — shared design system
   One stylesheet for the public site, registration and portal.
   ---------------------------------------------------------
   FONTS: swap the two families below for the exact fonts
   used on brightclub.info (set in WordPress > Salient >
   Typography). Everything else inherits from these.
   ========================================================= */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&family=Open+Sans:wght@400;600;700&display=swap");

:root {
  --font-head: "Poppins", system-ui, sans-serif;
  --font-body: "Open Sans", system-ui, sans-serif;

  /* Brand colours (taken from the current site theme) */
  --sun: #fec624;      /* accent yellow — primary action */
  --sun-deep: #e9ad00;
  --sky: #309bc8;      /* blue — links, info */
  --sea: #21ab97;      /* teal — success, "confirmed" */
  --coral: #f0644f;    /* scarcity, errors */
  --ink: #13294b;      /* navy — headings, footer */
  --text: #212121;
  --muted: #5b6b7a;
  --paper: #ffffff;
  --mist: #eef5f9;     /* quiet section background */
  --line: #d9e4ec;

  --r-lg: 22px;
  --r-md: 14px;
  --r-sm: 8px;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--paper);
}
img { max-width: 100%; display: block; }
a { color: var(--sky); }
button { font: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--ink);
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: -0.015em;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 600; }
p { margin: 0 0 1em; max-width: 68ch; }
.lead { font-size: 1.15rem; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section--mist { background: var(--mist); }
.section--ink { background: var(--ink); color: #dfe8f1; }
.section--ink h2, .section--ink h3 { color: #fff; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: 32px; }
.section-head p { margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-head); font-weight: 600; font-size: .98rem;
  padding: 12px 22px; border-radius: 999px; border: 2px solid transparent;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn--sun { background: var(--sun); color: var(--ink); }
.btn--sun:hover { background: var(--sun-deep); }
.btn--ink { background: var(--ink); color: #fff; }
.btn--ink:hover { background: #1d3a66; }
.btn--line { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn--line:hover { background: var(--ink); color: #fff; }
.btn--ghost { color: var(--ink); background: transparent; padding-left: 8px; padding-right: 8px; }
.btn--ghost:hover { text-decoration: underline; }
.btn--sm { padding: 8px 16px; font-size: .9rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- Header ---------- */
.topbar { background: var(--ink); color: #cfdbe8; font-size: .85rem; }
.topbar .wrap { display: flex; justify-content: space-between; gap: 16px; padding-top: 7px; padding-bottom: 7px; }
.topbar a { color: #fff; text-decoration: none; }
.topbar span + span { margin-left: 18px; }
@media (max-width: 700px) { .topbar .hide-sm { display: none; } }

.header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.header .wrap { display: flex; align-items: center; gap: 24px; height: 76px; }
.logo img { height: 46px; width: auto; }
.nav { display: flex; gap: 4px; margin-left: auto; }
  .nav a { white-space: nowrap;
  font-family: var(--font-head); font-weight: 500; color: var(--ink);
  text-decoration: none; padding: 8px 14px; border-radius: 999px;
}
.nav a:hover { background: var(--mist); }
.nav a[aria-current="page"] { background: var(--mist); font-weight: 700; }
.header-actions { display: flex; gap: 8px; align-items: center; }
.menu-btn { display: none; background: none; border: 0; padding: 8px; cursor: pointer; color: var(--ink); }
@media (max-width: 1140px) {
  .nav { display: none; }
  .header-actions .btn--line { display: none; }
  .menu-btn { display: block; margin-left: auto; }
  .header-actions { order: 3; }
  .nav.open {
    display: flex; flex-direction: column; position: absolute; top: 76px; left: 0; right: 0;
    background: #fff; padding: 12px var(--gutter) 20px; border-bottom: 1px solid var(--line);
  }
  .nav.open a { padding: 12px 8px; font-size: 1.05rem; }
  .nav.open .nav-portal { display: block; }
}
.nav-portal { display: none; }
@media (max-width: 480px) { .header-actions .btn { padding: 9px 14px; font-size: .9rem; } .logo img { height: 38px; } }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: #b9c8d8; padding: 64px 0 28px; font-size: .95rem; }
.footer a { color: #fff; text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer h4 { color: #fff; margin-bottom: 14px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-logo { background: #fff; display: inline-block; padding: 10px 14px; border-radius: var(--r-md); margin-bottom: 16px; }
.footer-logo img { height: 40px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.15); margin-top: 48px; padding-top: 20px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: .85rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Tags & chips ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600;
  padding: 4px 10px; border-radius: 999px; background: var(--mist); color: var(--ink);
}
.tag--sea { background: #dcf3ef; color: #127466; }
.tag--sun { background: #fff3c9; color: #7a5a00; }
.tag--coral { background: #fde3df; color: #a8321f; }
.tag--sky { background: #dceffa; color: #1b6b8f; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  padding: 8px 16px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .92rem;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- Media / video ---------- */
.video-thumb {
  position: relative; display: block; width: 100%; aspect-ratio: 16/9; overflow: hidden;
  border-radius: var(--r-md); background: var(--ink) center/cover no-repeat; border: 0; padding: 0; cursor: pointer;
}
.video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.video-thumb .play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 64px; height: 64px; border-radius: 50%; background: var(--sun);
  display: grid; place-items: center; box-shadow: 0 6px 20px rgba(0,0,0,.25); transition: transform .15s;
}
.video-thumb:hover .play { transform: translate(-50%, -50%) scale(1.08); }
.video-thumb .play svg { width: 24px; height: 24px; margin-left: 4px; fill: var(--ink); }
.video-thumb .dur {
  position: absolute; left: 12px; bottom: 12px; background: rgba(19,41,75,.85); color: #fff;
  font-size: .8rem; font-weight: 600; padding: 4px 10px; border-radius: 999px;
}

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(10,22,40,.75); }
.modal.open { display: flex; }
.modal-box { background: #fff; border-radius: var(--r-lg); width: min(960px, 100%); max-height: 92vh; overflow: auto; position: relative; }
.modal-box--video { background: #000; overflow: hidden; }
.modal-box--video iframe { width: 100%; aspect-ratio: 16/9; border: 0; display: block; }
.modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: #fff; color: var(--ink); cursor: pointer; font-size: 1.4rem; line-height: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 600; color: var(--ink); font-size: .95rem; }
.field .hint { font-size: .85rem; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; font: inherit; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--r-sm);
  background: #fff; color: var(--text);
}
.input:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px rgba(48,155,200,.2); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 600px) { .grid-2 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--ink); }

/* ---------- Panels ---------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(20px, 3vw, 32px); }
.panel--mist { background: var(--mist); border-color: transparent; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { background: var(--mist); padding: clamp(40px, 6vw, 72px) 0 clamp(32px, 4vw, 48px); }
.page-hero h1 { font-size: clamp(2rem, 4.2vw, 3rem); margin-bottom: .3em; }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(120px); z-index: 200;
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 600;
  transition: transform .25s ease, visibility .25s; box-shadow: 0 8px 24px rgba(0,0,0,.25); visibility: hidden;
}
.toast.show { transform: translateX(-50%) translateY(0); visibility: visible; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Vertical name badge (54 × 86 mm) ---------- */
.badge-v {
  width: 240px; aspect-ratio: 54 / 86; display: flex; flex-direction: column; background: #fff;
  border-radius: 14px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 10px 30px -12px rgba(19,41,75,.35);
  break-inside: avoid; page-break-inside: avoid; margin: 0 auto;
}
.badge-v-top { background: var(--ink); padding: 14px 16px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.badge-v-slot { width: 46px; height: 8px; border-radius: 999px; background: var(--mist); opacity: .9; }
.badge-v-logo { background: #fff; border-radius: 8px; padding: 5px 10px; }
.badge-v-logo img { height: 26px; }
.badge-v-program { color: var(--sun); font-family: var(--font-head); font-weight: 700; font-size: .82rem; }
.badge-v-body { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 14px 14px 10px; }
.badge-v-first { font-family: var(--font-head); font-weight: 800; color: var(--ink); font-size: 2rem; line-height: 1.05; word-break: break-word; }
.badge-v-last { color: var(--muted); font-size: .95rem; margin-bottom: 10px; }
.badge-v-course { font-weight: 700; color: var(--ink); font-size: .8rem; line-height: 1.35; }
.badge-v-time { font-size: .76rem; color: var(--muted); margin-top: 2px; }
.badge-v-qr { margin-top: auto; padding-top: 10px; }
.badge-v-qr .qr { width: 92px; height: 92px; }
.badge-v-ref { font-size: .7rem; color: var(--muted); letter-spacing: .04em; margin-top: 4px; }
.badge-v-strip { height: 12px; background: linear-gradient(90deg, var(--sun) 0 25%, var(--sky) 25% 50%, var(--sea) 50% 75%, var(--coral) 75%); }
.qr { display: grid; grid-template-columns: repeat(11, 1fr); }
.qr i { background: var(--ink); }
.qr i.o { background: transparent; }
.badge-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px; justify-items: center; }
@media print {
  .badge-v { width: 54mm; height: 86mm; aspect-ratio: auto; box-shadow: none; border: .2mm dashed #999; border-radius: 3mm; }
  .badge-v-first { font-size: 20pt; }
  .badge-sheet { grid-template-columns: repeat(3, 54mm); gap: 6mm; justify-content: center; }
}

/* ---------- Achievement medal ---------- */
.medal {
  --s: 56px; width: var(--s); height: var(--s); border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: var(--sun); box-shadow: inset 0 0 0 calc(var(--s) * .07) rgba(255,255,255,.55), 0 0 0 calc(var(--s) * .05) var(--sun);
}
.medal svg { width: 52%; height: 52%; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.medal--sky { background: var(--sky); box-shadow: inset 0 0 0 calc(var(--s) * .07) rgba(255,255,255,.4), 0 0 0 calc(var(--s) * .05) var(--sky); }
.medal--sea { background: var(--sea); box-shadow: inset 0 0 0 calc(var(--s) * .07) rgba(255,255,255,.4), 0 0 0 calc(var(--s) * .05) var(--sea); }
.medal--coral { background: var(--coral); box-shadow: inset 0 0 0 calc(var(--s) * .07) rgba(255,255,255,.4), 0 0 0 calc(var(--s) * .05) var(--coral); }
.medal--ink { background: var(--ink); box-shadow: inset 0 0 0 calc(var(--s) * .07) rgba(255,255,255,.25), 0 0 0 calc(var(--s) * .05) var(--ink); }
.medal--sky svg, .medal--sea svg, .medal--coral svg, .medal--ink svg { stroke: #fff; }
.medal.locked { background: var(--mist); box-shadow: inset 0 0 0 2px var(--line); }
.medal.locked svg { stroke: #a9b8c6; }

/* ---------- Form dialog ---------- */
.modal-box--form { width: min(560px, 100%); }
.modal-pad { padding: 28px clamp(20px, 4vw, 32px) 28px; }
.modal-pad h2 { font-size: 1.4rem; padding-right: 40px; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }

/* ---------- Photo grid (portal, admin) ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.photo-grid figure { margin: 0; position: relative; }
.photo-grid img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--r-md); background: var(--mist); }
.photo-grid figcaption { font-size: .85rem; color: var(--muted); margin-top: 6px; line-height: 1.35; }
.photo-grid figcaption b { color: var(--ink); display: block; font-weight: 600; }
.dropzone {
  border: 2px dashed var(--line); border-radius: var(--r-lg); padding: 28px; text-align: center; background: #fff; cursor: pointer;
  display: block; color: var(--muted);
}
.dropzone:hover, .dropzone.over { border-color: var(--sky); background: #f4fafd; }
.dropzone b { color: var(--ink); display: block; font-family: var(--font-head); font-size: 1.05rem; margin-bottom: 4px; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* ---------- Event date tile ---------- */
.date-tile { background: #fff; border-radius: var(--r-md); text-align: center; padding: 8px 12px; min-width: 64px; font-family: var(--font-head); color: var(--ink); line-height: 1.1; }
.date-tile b { display: block; font-size: 1.6rem; }
.date-tile span { font-size: .8rem; }

/* ---------- Award picker (staff) ---------- */
.award-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.award-pick label { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: .8rem; font-weight: 600; color: var(--ink);
  border: 2px solid var(--line); border-radius: var(--r-md); padding: 10px 6px; cursor: pointer; line-height: 1.25; }
.award-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.award-pick label:has(input:checked) { border-color: var(--sea); background: #f2fbf9; }
.award-pick label:has(input:focus-visible) { outline: 3px solid var(--sky); outline-offset: 2px; }
