/* ==========================================================================
   THE SANXING SPARK — public stylesheet
   --------------------------------------------------------------------------
   Colours, fonts, corner roundness and banner height are set in the ADMIN
   PANEL (Design tab) and injected into the page as CSS variables.
   The values below are only the fallbacks used before any are saved.
   ========================================================================== */

:root {
  --brand:            #2f6fd0;
  --brand-dark:       #1e4d9b;
  --brand-soft:       #e4eeff;

  --spark:            #ffc247;
  --spark-dark:       #a56d00;
  --spark-soft:       #fff4dc;

  --ink:              #16233c;
  --ink-soft:         #5b6a86;

  --paper:            #fbfaf7;
  --surface:          #ffffff;
  --line:             #e5e6ec;

  --success:          #1f8a5b;
  --danger:           #c8442f;

  /* Worked out by the site so text stays readable on any colour you pick. */
  --on-brand:      #ffffff;
  --on-brand-dark: #ffffff;
  --on-brand-soft: #1e4d9b;
  --on-spark:      #4a3200;
  --on-spark-soft: #a56d00;
  --on-surface:    #16233c;

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body:    'Nunito Sans', system-ui, -apple-system, sans-serif;

  --radius-card:   22px;
  --radius-pill:   999px;
  --radius-input:  14px;

  --page-width:    1160px;
  --page-gutter:   24px;

  --shadow-card:   0 16px 36px -24px rgba(22, 35, 60, .45);
  --shadow-lift:   0 24px 48px -26px rgba(22, 35, 60, .55);

  --banner-height: 300px;
}


/* ==========================================================================
   2. BASE — you can stop reading here
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, video, iframe { max-width: 100%; display: block; }
img { height: auto; }

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.015em;
  color: var(--ink);
  margin: 0;
}

h1 { font-size: clamp(2.1rem, 5vw, 3.35rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.35rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p { margin: 0; }

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  max-width: var(--page-width);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

.section { padding-block: clamp(46px, 7vw, 76px); }
.section--tight { padding-block: 0 clamp(46px, 7vw, 76px); }

.eyebrow {
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0;
}

.lead {
  font-size: 1.12rem;
  color: var(--ink-soft);
  max-width: 62ch;
}

.muted { color: var(--ink-soft); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}


/* ==========================================================================
   3. BUTTONS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 800;
  padding: 13px 26px;
  border-radius: var(--radius-pill);
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.99); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

.btn--primary { background: var(--brand); color: var(--on-brand); }
.btn--primary:hover { background: var(--brand-dark); color: var(--on-brand-dark); }

.btn--spark { background: var(--spark); color: var(--on-spark); }
.btn--spark:hover { filter: brightness(.94); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
}
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); }

.btn--sm { padding: 8px 16px; font-size: .87rem; }


/* ==========================================================================
   4. HEADER & NAVIGATION
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header__bar {
  max-width: 1320px;
  margin-inline: auto;
  padding: 12px var(--page-gutter);
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 12px; color: inherit; }
.brand:hover { color: inherit; }
.brand__mark {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: linear-gradient(140deg, var(--brand), var(--brand-dark));
  color: var(--on-brand);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  flex: none;
}
.brand__logo { height: 46px; width: auto; border-radius: 10px; }
.brand__name {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.18rem;
  line-height: 1.1;
  white-space: nowrap;
}
.brand__tag {
  display: block;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* The menu sits on its own row under the masthead, like a newspaper. */
.nav-row { display: none; border-top: 1px solid var(--line); }
.nav {
  max-width: 1320px;
  margin-inline: auto;
  padding: 5px var(--page-gutter) 7px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
}
.nav a {
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  font-size: .87rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.nav a:hover { background: var(--brand-soft); color: var(--on-brand-soft); }
.nav a[aria-current="page"] { background: var(--brand); color: var(--on-brand); }

.searchbox {
  display: none;
  margin-left: auto;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 7px 14px;
}
.searchbox input {
  border: 0; outline: 0; background: transparent;
  font: inherit; font-size: .9rem; width: 140px; color: inherit;
}
.searchbox svg { flex: none; color: var(--ink-soft); }

.menu-btn {
  margin-left: auto;
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  color: var(--ink);
}

.mobile-nav {
  display: none;
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 14px var(--page-gutter) 22px;
}
.mobile-nav.is-open { display: block; }
.mobile-nav a {
  display: block;
  padding: 11px 14px;
  border-radius: 12px;
  font-weight: 700;
  color: var(--ink);
}
.mobile-nav a:hover { background: var(--brand-soft); color: var(--on-brand-soft); }
.mobile-nav a[aria-current="page"] { background: var(--brand); color: var(--on-brand); }
.mobile-nav .searchbox { display: flex; margin-bottom: 12px; }
.mobile-nav .searchbox input { width: 100%; }

@media (min-width: 1000px) {
  .nav-row { display: block; }
  .site-header__bar > .searchbox { display: flex; }
  .menu-btn { display: none; }
  .mobile-nav { display: none !important; }
}


/* ==========================================================================
   5. HOME — banner, hero, marquee
   ========================================================================== */

.banner {
  max-width: 1320px;
  margin: 22px auto 0;
  padding-inline: var(--page-gutter);
}
.banner__inner {
  height: var(--banner-height);
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--brand-soft), var(--spark-soft));
  box-shadow: var(--shadow-card);
}
.banner__inner img { width: 100%; height: 100%; object-fit: cover; }

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.marquee {
  border-block: 1px solid var(--line);
  background: var(--surface);
  padding-block: 11px;
  overflow: hidden;
}
.marquee__track {
  display: inline-flex;
  white-space: nowrap;
  animation: marquee 30s linear infinite;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--brand);
}
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }


/* ==========================================================================
   6. SECTION HEADINGS
   ========================================================================== */

.heading { margin-bottom: 30px; max-width: 66ch; }
.heading__title { display: flex; align-items: center; gap: 12px; }
.heading__icon {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--spark-soft);
  color: var(--on-spark-soft);
}
.heading p { margin-top: 8px; color: var(--ink-soft); }


/* ==========================================================================
   7. CARDS & GRIDS
   ========================================================================== */

.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
.grid--4 { grid-template-columns: 1fr; }

@media (min-width: 640px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card--hover:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.card__body { padding: 20px; display: flex; flex-direction: column; gap: 7px; }
.card__body p { font-size: .93rem; color: var(--ink-soft); }
.card__media {
  aspect-ratio: 16 / 10;
  background: var(--brand-soft);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__media iframe, .card__media video { width: 100%; height: 100%; border: 0; }
.card__media--video { aspect-ratio: 16 / 9; background: #0d1526; }
.card__media--tall { aspect-ratio: 4 / 3; }
.card__media--feature { aspect-ratio: 16 / 10; }
.card__placeholder { color: var(--brand); opacity: .4; }
.card__placeholder svg { width: 62px; height: 62px; }

.card--open { padding: 0; text-align: left; font: inherit; color: inherit; border: 0; background: none; cursor: pointer; width: 100%; }

.tag {
  align-self: flex-start;
  margin-top: 6px;
  background: var(--spark);
  color: var(--on-spark);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .04em;
  padding: 5px 13px;
  border-radius: var(--radius-pill);
}

.note-card {
  background: linear-gradient(135deg, var(--surface), var(--brand-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 26px;
  box-shadow: var(--shadow-card);
}

.person { text-align: center; }
.person__avatar {
  width: 92px; height: 92px;
  margin: 0 auto 14px;
  border-radius: 50%;
  object-fit: cover;
  display: grid; place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
}
.person__role { color: var(--brand); font-weight: 800; font-size: .9rem; }

.empty {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-card);
  padding: 44px 26px;
  text-align: center;
  color: var(--ink-soft);
  grid-column: 1 / -1;
}

.year-label {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 16px;
}
.year-group + .year-group { margin-top: 44px; }


/* ==========================================================================
   8. FILTER / TOOLBAR
   ========================================================================== */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.chip {
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: .87rem;
  font-weight: 800;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--brand-soft);
  color: var(--on-brand-soft);
  transition: background-color .15s ease;
}
.chip:hover { filter: brightness(.96); }
.chip[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }


/* ==========================================================================
   9. FORMS
   ========================================================================== */

.field { display: flex; flex-direction: column; gap: 7px; }
.field__label { font-size: .87rem; font-weight: 800; color: var(--ink); }
.field__hint { font-size: .8rem; color: var(--ink-soft); font-weight: 400; }

.input,
select.input,
textarea.input {
  width: 100%;
  font: inherit;
  font-size: .97rem;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-input);
  padding: 11px 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus {
  outline: 0;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
textarea.input { resize: vertical; min-height: 120px; }
.input[type="file"] { padding: 9px 12px; }
.input--narrow { max-width: 260px; }

.form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 26px;
  display: grid;
  gap: 18px;
}
@media (min-width: 720px) {
  .form--2col { grid-template-columns: 1fr 1fr; }
  .form--2col .span-2 { grid-column: 1 / -1; }
}

.form-message {
  border-radius: var(--radius-card);
  padding: 26px;
  font-weight: 700;
  text-align: center;
}
.form-message--ok { background: var(--spark-soft); color: var(--on-spark-soft); }
.form-message--error { background: #fdecea; color: var(--danger); font-weight: 600; text-align: left; padding: 12px 16px; }

.contact-list { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 12px; }
.contact-list li { display: flex; align-items: flex-start; gap: 12px; color: var(--ink-soft); }
.contact-list svg { flex: none; color: var(--brand); margin-top: 4px; }


/* ==========================================================================
   10. READER (flipbook / PDF pop-up)
   ========================================================================== */

.reader {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(11, 19, 34, .72);
}
.reader[hidden] { display: none; }
.reader__panel {
  width: min(1000px, 100%);
  height: min(88vh, 900px);
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lift);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.reader__top {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
}
.reader__title { font-weight: 800; }
.reader__stage {
  flex: 1;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  padding: 14px;
  overflow: auto;
}
.reader__stage img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-lift);
  transform-origin: left center;
  animation: flip .5s cubic-bezier(.22, .8, .3, 1);
}
.reader__stage iframe { width: 100%; height: 100%; border: 0; border-radius: 12px; background: #fff; }
.reader__bottom {
  display: flex; align-items: center; justify-content: center; gap: 22px;
  padding: 11px; border-top: 1px solid var(--line);
  font-size: .9rem; color: var(--ink-soft);
}
.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  color: var(--ink);
}
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }

@keyframes flip {
  from { transform: perspective(1600px) rotateY(-85deg); opacity: .2; }
  to   { transform: perspective(1600px) rotateY(0);      opacity: 1; }
}


/* ==========================================================================
   11. FOOTER
   ========================================================================== */

.site-footer {
  margin-top: 72px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.site-footer__inner {
  display: grid;
  gap: 28px;
  padding-block: 44px;
  font-size: .93rem;
  color: var(--ink-soft);
}
@media (min-width: 820px) {
  .site-footer__inner { grid-template-columns: 1.3fr 1fr 1fr; }
}
.site-footer strong { display: block; color: var(--ink); font-size: 1.03rem; margin-bottom: 5px; }
.site-footer__links { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.site-footer__links a { color: var(--ink-soft); font-weight: 600; }
.site-footer__links a:hover { color: var(--brand); }


/* ==========================================================================
   12. MISC
   ========================================================================== */

.skeleton {
  border-radius: var(--radius-card);
  background: linear-gradient(90deg, #eef0f4, #f7f8fa, #eef0f4);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
  height: 250px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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


/* ==========================================================================
   13. ADDITIONS FOR THE PHP VERSION
   ========================================================================== */

.hero__title { max-width: 20ch; margin-top: 10px; text-wrap: balance; }
.hero__lead { margin-top: 18px; }

.section--narrow { max-width: 900px; }

.split { display: grid; gap: 44px; align-items: start; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; } }

.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.info-card__body { margin-top: 12px; }
.person__bio { font-size: .9rem; margin-top: 4px; }

.card__media--empty { background: var(--brand-soft); }

.contact-photo {
  margin-top: 8px;
  width: 100%;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.result { display: block; color: inherit; }
.result:hover { color: inherit; border-color: var(--brand); }
.result h3 { margin-top: 6px; }
.result p.muted { margin-top: 6px; font-size: .93rem; }

.site-footer__legal { margin-top: 14px; }
.site-footer__legal a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; }
.site-footer__legal a:hover { color: var(--brand); }

/* Honeypot: a field only automated spam fills in. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.card.is-hidden, .year-group.is-hidden { display: none; }

.form-message--error {
  background: #fdecea;
  color: var(--danger);
  border-radius: var(--radius-input);
  padding: 12px 16px;
  margin-bottom: 18px;
  font-weight: 600;
}

.marquee__track span { padding-right: 1.5em; }
.reader__note { padding: 30px; text-align: center; }
