/* BAPS Singapore RSVP – shared styles (public pages + admin) */

/* ── Fonts ──────────────────────────────────────────────────────────────────
   LICENSED CENTURY GOTHIC WEBFONT GOES HERE.
   If BAPS Singapore holds a Century Gothic *webfont* licence, copy the files to
   /assets/fonts/ with these names and remove the comment markers around both
   blocks. Every device will then use real Century Gothic.

@font-face { font-family: 'Century Gothic'; src: url('/assets/fonts/century-gothic.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Century Gothic'; src: url('/assets/fonts/century-gothic-bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap; }
*/

/* Free look-alike for phones without Century Gothic (most Android, iOS).
   TeX Gyre Adventor, GUST Font License – see /assets/fonts/GUST-FONT-LICENSE.txt */
@font-face {
  font-family: 'TeX Gyre Adventor';
  src: local('TeX Gyre Adventor'), local('TeXGyreAdventor-Regular'),
       url('/assets/fonts/adventor-regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'TeX Gyre Adventor';
  src: local('TeX Gyre Adventor Bold'), local('TeXGyreAdventor-Bold'),
       url('/assets/fonts/adventor-bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ── Design tokens ─────────────────────────────────────────────────────── */
:root {
  --font: 'Century Gothic', CenturyGothic, 'Apple Gothic', 'URW Gothic', 'Didact Gothic', 'Questrial', 'TeX Gyre Adventor', sans-serif;

  /* colour: one accent (deep red from the BAPS logo) + a saffron hairline */
  --ink: #1f1b18;
  --ink-muted: #5a534d;
  --line: #e4ddd2;
  --paper: #ffffff;
  --paper-alt: #faf6ef;
  --accent: #b3161c;
  --accent-hover: #8e1116;
  --on-accent: #ffffff;
  --saffron: #e8902f;
  --error: #b3161c;
  --success: #1d6b3a;
  --focus: #1f1b18;

  /* type scale (base 16px) */
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.375rem;
  --fs-xl: 1.75rem;
  --fs-2xl: clamp(2rem, 8vw, 3.25rem);
  --lh: 1.6;
  --lh-tight: 1.15;

  /* spacing scale */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4.5rem;

  --radius: 6px;
  --wrap: 66rem;
  --narrow: 38rem;
  --tap: 44px;
}

/* ── Base ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }   /* the hidden attribute must win over .button etc. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: var(--lh);
  color: var(--ink);
  background: var(--paper);
  border-top: 4px solid var(--saffron);
  overflow-wrap: break-word;
}
/* form controls do not inherit fonts by default */
input, select, textarea, button { font-family: inherit; font-size: inherit; color: inherit; line-height: inherit; }
::placeholder { font-family: var(--font); color: #77706a; opacity: 1; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { line-height: var(--lh-tight); margin: 0 0 var(--s-4); font-weight: 700; }
h1 { font-size: var(--fs-2xl); letter-spacing: -0.01em; }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-md); margin-top: var(--s-6); }
p, ul, dl { margin: 0 0 var(--s-4); }
a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: var(--s-4); top: -100px; background: var(--ink); color: #fff; padding: var(--s-3) var(--s-4); z-index: 10; }
.skip:focus { top: var(--s-2); color: #fff; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--s-4); }
.narrow { max-width: var(--narrow); }
.section { padding-block: var(--s-7); }
.section-alt { background: var(--paper-alt); border-block: 1px solid var(--line); }
.eyebrow { font-size: var(--fs-sm); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: var(--s-3); }
.muted { color: var(--ink-muted); }
.small { font-size: var(--fs-sm); }
.tbc { color: var(--ink-muted); font-style: italic; }
.placeholder { border: 1px dashed var(--line); padding: var(--s-3) var(--s-4); color: var(--ink-muted); font-style: italic; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px; padding: var(--s-3) var(--s-5);
  border: 2px solid var(--accent); border-radius: var(--radius);
  background: var(--accent); color: var(--on-accent);
  font-weight: 700; text-decoration: none; cursor: pointer;
}
.button:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.button[disabled] { opacity: 0.7; cursor: progress; }
.button-secondary { background: var(--paper); color: var(--accent); }
.button-secondary:hover { background: var(--paper-alt); color: var(--accent-hover); }
.button-block { width: 100%; }

/* ── Header / footer ───────────────────────────────────────────────────── */
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding-block: var(--s-3); }
.brand { display: inline-flex; align-items: center; gap: var(--s-3); color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: 0.02em; min-height: var(--tap); }
.brand img { width: 40px; height: 51px; }
.brand:hover { color: var(--ink); }
.header-link { display: inline-flex; align-items: center; min-height: var(--tap); padding-inline: var(--s-2); font-weight: 700; }

.site-footer { padding-block: var(--s-7) var(--s-6); border-top: 1px solid var(--line); }
.site-footer h2 { font-size: var(--fs-lg); }
.contact-list { list-style: none; padding: 0; display: grid; gap: var(--s-3); }
.contact-list li { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--s-3); }
.contact-list a, .footer-links a { display: inline-flex; align-items: center; min-height: var(--tap); }
.footer-links { display: flex; flex-wrap: wrap; column-gap: var(--s-5); margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--line); }

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero { padding-block: var(--s-6) var(--s-7); }
.hero-grid { display: grid; gap: var(--s-6); align-items: center; }
.hero-speaker { font-size: var(--fs-lg); margin-bottom: var(--s-5); }
.hero-when { font-size: var(--fs-md); color: var(--ink-muted); margin-bottom: var(--s-5); }
.hero-when strong { color: var(--ink); }
.hero-photo img { width: 100%; max-width: 420px; margin-inline: auto; border-radius: var(--radius); }

/* ── Event facts ───────────────────────────────────────────────────────── */
.facts { margin: 0 0 var(--s-5); border-top: 1px solid var(--line); }
.facts > div { display: grid; grid-template-columns: 6.5rem 1fr; gap: var(--s-3); padding-block: var(--s-3); border-bottom: 1px solid var(--line); }
.facts dt { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-muted); padding-top: 0.15em; }
.facts dd { margin: 0; }
.facts a { display: inline-flex; align-items: center; min-height: var(--tap); }
.plain-list { padding-left: 1.2em; }
.plain-list li { margin-bottom: var(--s-2); }

/* ── Speaker ───────────────────────────────────────────────────────────── */
.speaker-grid { display: grid; gap: var(--s-5); align-items: center; }
.speaker-grid img { border-radius: var(--radius); }

/* ── Form ──────────────────────────────────────────────────────────────── */
.form-intro { margin-bottom: var(--s-5); }
.field { margin: 0 0 var(--s-5); padding: 0; border: 0; min-width: 0; }
label, legend { display: block; font-weight: 700; margin-bottom: var(--s-2); padding: 0; }
.optional { font-weight: 400; color: var(--ink-muted); }
.hint { font-size: var(--fs-sm); color: var(--ink-muted); margin: calc(-1 * var(--s-1)) 0 var(--s-2); }
.hint-after { margin: var(--s-2) 0 0; }
input[type='text'], input[type='tel'], input[type='email'], input[type='password'], input[type='search'], select, textarea {
  display: block; width: 100%; min-height: 48px;
  padding: var(--s-3) var(--s-4);
  border: 1px solid #8f8780; border-radius: var(--radius);
  background: var(--paper);
}
textarea { min-height: 6rem; resize: vertical; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 2.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%231f1b18' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
[aria-invalid='true'] { border: 2px solid var(--error) !important; }
.error { color: var(--error); font-size: var(--fs-sm); font-weight: 700; margin: var(--s-2) 0 0; }
.error:empty { display: none; }
.input-prefix { display: flex; align-items: stretch; }
.input-prefix span { display: flex; align-items: center; padding-inline: var(--s-3); border: 1px solid #8f8780; border-right: 0; border-radius: var(--radius) 0 0 var(--radius); background: var(--paper-alt); color: var(--ink-muted); }
.input-prefix input { border-radius: 0 var(--radius) var(--radius) 0; }

.guests { border-left: 3px solid var(--line); padding-left: var(--s-4); }
.guest { display: grid; gap: var(--s-3); margin-bottom: var(--s-4); }
.guest .field { margin-bottom: 0; }

.consents legend { margin-bottom: var(--s-3); }
.check { display: grid; grid-template-columns: 1.5rem 1fr; column-gap: var(--s-3); align-items: start; margin-bottom: var(--s-4); }
.check input { width: 1.5rem; height: 1.5rem; margin: 0.15rem 0 0; accent-color: var(--accent); cursor: pointer; }
.check label { font-weight: 400; margin: 0; cursor: pointer; }
.check .error { grid-column: 2; }
.req { color: var(--accent); }

.alert { border: 1px solid var(--error); border-left-width: 4px; padding: var(--s-3) var(--s-4); margin-bottom: var(--s-5); border-radius: var(--radius); font-weight: 700; }
.alert:empty { display: none; }

/* honeypot – off-screen for people, visible to naive bots */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.panel { border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: var(--s-5); background: var(--paper); }
.panel-success { border-left-color: var(--success); }
.panel h3 { margin-top: 0; }
.panel:focus, .panel:focus-visible { outline: none; }  /* focused by script for screen readers only */

/* ── Donation ──────────────────────────────────────────────────────────── */
.donate { text-align: center; }
.donate .qr { width: 240px; height: 240px; margin: var(--s-4) auto var(--s-3); border: 1px solid var(--line); }
.donate .download { display: inline-flex; align-items: center; min-height: var(--tap); }

/* ── Legal pages ───────────────────────────────────────────────────────── */
.legal h2 { font-size: var(--fs-lg); margin-top: var(--s-6); }
.legal li { margin-bottom: var(--s-2); }

/* ── Larger screens ────────────────────────────────────────────────────── */
@media (min-width: 768px) {
  .wrap { padding-inline: var(--s-6); }
  .section { padding-block: var(--s-8); }
  .hero { padding-block: var(--s-7) var(--s-8); }
  .hero-grid { grid-template-columns: 1.1fr 0.9fr; gap: var(--s-7); }
  .speaker-grid { grid-template-columns: 1fr 1fr; gap: var(--s-7); }
  .guest { grid-template-columns: 3fr 2fr; }
  .facts > div { grid-template-columns: 9rem 1fr; }
}

@media print {
  body { border: 0; }
  .site-header, .skip, .button, #donate { display: none !important; }
}
