/* FinLegacy — the public history website. School colours come in as --h-primary / --h-accent. */
:root {
  --h-ink: #1d2433; --h-soft: #5b6475; --h-line: #e3e6ec; --h-bg: #f6f7f9; --h-card: #fff;
  --h-radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root { --h-ink: #e8ebf1; --h-soft: #a3abbb; --h-line: #2c3445; --h-bg: #121722; --h-card: #1a2130; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--h-ink); background: var(--h-bg); }
a { color: inherit; }
img { max-width: 100%; }
.h-wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.h-muted { color: var(--h-soft); font-size: .92em; }
.h-preview { background: #fff3cd; color: #5c4400; padding: 8px 16px; font-size: .9rem; text-align: center; }
.h-preview a { color: inherit; font-weight: 600; }

/* header */
.h-head { background: var(--h-primary); color: #fff; border-bottom: 4px solid var(--h-accent); }
.h-head-in { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding-top: 12px; padding-bottom: 12px; }
.h-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: 1 1 auto; min-width: 0; }
.h-brand img { height: 48px; width: auto; }
.h-brand > span { display: flex; flex-direction: column; line-height: 1.15; }
.h-school { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--h-accent); font-weight: 700; }
.h-site { font-family: Georgia, "Times New Roman", serif; font-size: 1.5rem; font-weight: 700; }
.h-search { display: flex; flex: 1 1 260px; max-width: 360px; }
.h-search input { flex: 1; min-width: 0; padding: 10px 12px; border: 0; border-radius: 8px 0 0 8px; font: inherit; }
.h-search button { padding: 0 14px; border: 0; border-radius: 0 8px 8px 0; background: var(--h-accent); color: var(--h-primary); font-size: 1.1rem; cursor: pointer; }

/* page */
main.h-wrap { padding-top: 18px; padding-bottom: 40px; }
.h-crumbs { font-size: .9rem; color: var(--h-soft); margin-bottom: 6px; }
.h-crumbs a { text-decoration: none; }
.h-crumbs a:hover { text-decoration: underline; }
.h-title { font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.6rem, 4vw, 2.3rem); margin: 0 0 18px; line-height: 1.15; }
.h-h { font-size: 1.05rem; text-transform: uppercase; letter-spacing: .06em; color: var(--h-soft); border-bottom: 2px solid var(--h-accent); padding-bottom: 4px; margin: 28px 0 12px; }
.h-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 8px; background: var(--h-primary); color: #fff; text-decoration: none; font-weight: 600; }

/* cards */
.h-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.h-card { display: flex; flex-direction: column; background: var(--h-card); border: 1px solid var(--h-line); border-bottom: 3px solid var(--h-accent); border-radius: var(--h-radius); overflow: hidden; text-decoration: none; transition: transform .12s; }
.h-card:hover { transform: translateY(-2px); }
.h-card-media { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; background: color-mix(in oklab, var(--h-primary) 12%, var(--h-card)); }
.h-card-media img { width: 100%; height: 100%; object-fit: cover; }
.h-card-icon { font-size: 3rem; color: var(--h-accent); }
.h-pcard .h-card-media { aspect-ratio: 4 / 5; }
.h-pcard .h-card-media img { object-position: 50% 20%; }
.h-card-body { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; }
.h-card-title { font-weight: 700; line-height: 1.25; }
.h-card-sub { font-size: .85rem; color: var(--h-accent); font-weight: 600; filter: brightness(.8); }
.h-card-line { font-size: .88rem; color: var(--h-soft); }
.h-hof { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px; text-align: center; font-size: .75rem; font-weight: 700; background: var(--h-accent); color: var(--h-primary); }

/* photo, gallery, video */
.h-photo { margin: 0; }
.h-photo img { display: block; width: 100%; height: auto; border-radius: var(--h-radius); }
.h-photo figcaption { color: var(--h-soft); margin-top: 6px; }
.h-names a { font-weight: 600; }
.h-gallery { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.h-gallery a { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 8px; background: var(--h-line); }
.h-gallery img { width: 100%; height: 100%; object-fit: cover; }
.h-video { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: var(--h-radius); overflow: hidden; }
.h-video iframe, .h-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.h-video-short { max-width: 640px; }
.h-pdf-thumb { max-width: 240px; border: 1px solid var(--h-line); border-radius: 8px; }

/* boards */
.h-table-wrap { overflow-x: auto; }
.h-table { width: 100%; border-collapse: collapse; background: var(--h-card); border-radius: var(--h-radius); overflow: hidden; }
.h-table th, .h-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--h-line); vertical-align: top; }
.h-table th { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--h-soft); }
.h-event { font-weight: 700; }
.h-mark { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.h-hist td { padding-top: 0; font-size: .9rem; }
.h-hist ul, .h-roster ul { margin: 6px 0 0; padding-left: 20px; }
.h-champs { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.h-champ { background: var(--h-card); border: 1px solid var(--h-line); border-radius: var(--h-radius); overflow: hidden; }
.h-champ-photo { aspect-ratio: 4 / 3; display: grid; place-items: center; background: color-mix(in oklab, var(--h-primary) 10%, var(--h-card)); }
.h-champ-photo a, .h-champ-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.h-champ-body { padding: 10px 12px 12px; border-top: 3px solid var(--h-accent); }
.h-champ-name { font-weight: 700; }
.h-places { display: flex; flex-direction: column; gap: 8px; }
.h-place { display: flex; align-items: flex-start; gap: 16px; padding: 12px 14px; background: var(--h-card); border: 1px solid var(--h-line); border-radius: var(--h-radius); }
.h-place-year { font-family: Georgia, serif; font-size: 1.5rem; font-weight: 700; color: var(--h-primary); min-width: 4.2rem; }
@media (prefers-color-scheme: dark) { .h-place-year { color: var(--h-accent); } }
.h-place-mid { flex: 1; min-width: 0; }
.h-place-finish { font-weight: 700; }
.h-place-photo img { width: 96px; height: 72px; object-fit: cover; border-radius: 6px; }
.h-roster summary { cursor: pointer; color: var(--h-soft); font-weight: 600; margin-top: 6px; }
.h-holders a, .h-table a, .h-champ-name a { font-weight: 700; text-decoration-color: var(--h-accent); text-decoration-thickness: 2px; }
.h-jump { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.h-jump a { min-width: 40px; min-height: 40px; display: grid; place-items: center; border: 1px solid var(--h-line); border-radius: 8px; background: var(--h-card); text-decoration: none; font-weight: 700; }

/* profile */
.h-profile-top { display: grid; gap: 24px; grid-template-columns: minmax(0, 320px) 1fr; align-items: start; }
@media (max-width: 640px) { .h-profile-top { grid-template-columns: 1fr; } }
.h-profile-photo img { width: 100%; border-radius: var(--h-radius); display: block; }
.h-profile-photo figure { margin: 0; }
.h-profile-photo figcaption { margin-top: .35rem; font-size: .85rem; text-align: center; opacity: .75; }
.h-profile-photo.is-two { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; align-items: start; }
.h-year { color: var(--h-soft); font-weight: 600; margin-top: -10px; margin-bottom: 10px; }
.h-headline { font-size: 1.15rem; }
.h-hof-inline { display: inline-flex; gap: 6px; align-items: center; padding: 3px 10px; border-radius: 999px; background: var(--h-accent); color: var(--h-primary); font-weight: 700; font-size: .85rem; margin-bottom: 8px; }
.h-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 12px 0 0; }
.h-stats div { background: var(--h-card); border: 1px solid var(--h-line); border-radius: 8px; padding: 8px 10px; }
.h-stats dt { font-size: .8rem; color: var(--h-soft); }
.h-stats dd { margin: 0; font-weight: 700; font-size: 1.1rem; }
.h-apps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.h-apps .ti { color: var(--h-accent); }

/* search */
.h-result { background: var(--h-card); border: 1px solid var(--h-line); border-radius: var(--h-radius); padding: 12px 14px; margin-bottom: 10px; }
.h-result-name { font-weight: 700; margin-bottom: 6px; }
.h-result-name .ti { color: var(--h-accent); }

/* footer */
.h-foot { color: var(--h-soft); font-size: .85rem; padding-top: 20px; padding-bottom: 30px; border-top: 1px solid var(--h-line); }

/* photo viewer */
.h-viewer { border: 0; padding: 0; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; background: rgba(0, 0, 0, .92); color: #fff; }
.h-viewer::backdrop { background: rgba(0, 0, 0, .8); }
.h-viewer figure { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 50px 56px; }
.h-viewer img { max-width: 100%; max-height: calc(100vh - 140px); object-fit: contain; }
.h-viewer figcaption { margin-top: 10px; text-align: center; }
.h-viewer button { position: absolute; border: 0; background: rgba(255, 255, 255, .15); color: #fff; width: 48px; height: 48px; border-radius: 50%; font-size: 1.4rem; cursor: pointer; }
.h-viewer-close { top: 10px; right: 10px; }
.h-viewer-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.h-viewer-next { right: 8px; top: 50%; transform: translateY(-50%); }
.h-card-icon .fl-svg-icon { width: 4.2rem; height: 4.2rem; }

/* Home page: section cards */
.h-sections { display: flex; flex-wrap: wrap; gap: 16px; }
.h-sections > * { flex: 1 1 240px; }
.h-sec { --sec-bg: color-mix(in oklab, var(--h-primary), white 10%); position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 190px; padding: 18px 20px;
  border-radius: var(--h-radius); border-bottom: 4px solid var(--h-accent);
  background:
    radial-gradient(120% 90% at 15% 0%, color-mix(in oklab, var(--h-accent) 18%, rgba(255,255,255,.16)) 0%, transparent 55%),
    linear-gradient(145deg, color-mix(in oklab, var(--sec-bg), white 10%) 0%, var(--sec-bg) 52%, color-mix(in oklab, var(--sec-bg), black 26%) 100%);
  color: #fff; text-decoration: none; overflow: hidden; transition: transform .12s; }
.h-sec:hover { transform: translateY(-2px); }
.h-sec.is-featured { flex-basis: 100%; min-height: 240px; }
.h-sec > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.h-sec > img + .h-sec-body::before { content: ""; position: absolute; inset: -200px -20px -18px; background: linear-gradient(to top, rgba(0,0,0,.75), transparent); z-index: -1; }
.h-sec-icon { position: absolute; top: 14px; right: 16px; color: var(--h-accent); font-size: 2.4rem; }
.h-sec-icon .fl-svg-icon { width: 3.6rem; height: 3.6rem; }
.h-sec-body { position: relative; display: flex; flex-direction: column; gap: 2px; z-index: 1; }
.h-sec-title { font-family: Georgia, "Times New Roman", serif; font-size: 1.6rem; font-weight: 700; line-height: 1.15; }
.h-sec.is-featured .h-sec-title { font-size: 2.1rem; }
.h-sec-tag { color: rgba(255,255,255,.85); }
.h-sec-hook { color: var(--h-accent); font-weight: 600; font-size: .9rem; }

/* Awards, year rosters, timelines */
.h-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.h-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--h-bg); border: 1px solid var(--h-line); font-size: .92rem; }
.h-chip-role { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--h-soft); }
.h-place-mid p { margin: 6px 0 0; color: var(--h-soft); font-size: .95rem; }
.h-tl { position: relative; padding-left: 26px; border-left: 3px solid var(--h-accent); margin-left: 8px; }
.h-tl-moment { position: relative; margin-bottom: 22px; padding: 14px 16px; background: var(--h-card); border: 1px solid var(--h-line); border-radius: var(--h-radius); }
.h-tl-moment::before { content: ""; position: absolute; left: -36px; top: 18px; width: 14px; height: 14px; border-radius: 50%; background: var(--h-accent); border: 3px solid var(--h-bg); }
.h-tl-date { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--h-soft); }
.h-tl-title { font-family: Georgia, serif; font-size: 1.35rem; margin: 2px 0 8px; }
.h-tl-photo { float: right; width: 220px; max-width: 40%; margin: 0 0 8px 14px; }
.h-tl-photo img { width: 100%; border-radius: 8px; display: block; }
.h-tl-moment::after { content: ""; display: block; clear: both; }
@media (max-width: 560px) { .h-tl-photo { float: none; width: 100%; max-width: none; margin: 0 0 8px; } }
.h-page-text { max-width: 760px; margin-top: 18px; font-size: 1.05rem; }
.h-svc { background: #3B4A3A !important; color: #fff !important; }

/* Year in review */
.h-yearslink { color: #fff; text-decoration: none; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid rgba(255,255,255,.35); border-radius: 8px; }
.h-years { display: flex; flex-wrap: wrap; gap: 8px; }
.h-year { display: flex; flex-direction: column; align-items: center; min-width: 76px; padding: 8px 10px; border-radius: 8px; background: var(--h-card); border: 1px solid var(--h-line); text-decoration: none; }
.h-year span { font-family: Georgia, serif; font-weight: 700; font-size: 1.2rem; }
.h-year small { color: var(--h-soft); }
.h-yearlist li { line-height: 1.4; }
.h-kind { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--h-soft); border: 1px solid var(--h-line); border-radius: 4px; padding: 1px 5px; margin-right: 4px; }
.h-yearnav { display: flex; justify-content: space-between; margin-top: 24px; font-weight: 600; }
.h-partial { font-style: italic; margin-top: .3rem; font-size: .9rem; }
.h-profile-top:has(.h-profile-photo.is-two) { grid-template-columns: minmax(0, 480px) 1fr; }
@media (max-width: 640px) { .h-profile-top:has(.h-profile-photo.is-two) { grid-template-columns: 1fr; } }

/* Help build our history: home-page panel, profile invitation, footer line */
.h-help { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; margin: 32px 0 8px; padding: 22px 24px; border-radius: var(--h-radius); border: 2px solid var(--h-accent); background: color-mix(in srgb, var(--h-accent) 8%, transparent); }
.h-help-text { flex: 1 1 340px; }
.h-help h2 { margin: 0 0 8px; font-size: 1.25rem; display: flex; align-items: center; gap: 8px; }
.h-help h2 .ti { color: var(--h-accent); }
.h-help p { margin: 0 0 8px; }
.h-help-actions { display: flex; flex-direction: column; gap: 10px; flex: 0 1 260px; }
.h-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 999px; background: var(--h-primary); color: #fff; font-weight: 600; text-decoration: none; text-align: center; }
.h-btn:hover { filter: brightness(1.15); }
.h-btn-ghost { background: transparent; color: var(--h-primary); border: 2px solid var(--h-primary); }
.h-invite { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--h-line); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.h-invite .ti { color: var(--h-accent); }
.h-foot-help { margin: 0 0 6px; }
@media (max-width: 640px) { .h-help-actions { flex: 1 1 100%; } .h-yearslink { padding: 6px 8px; } }
@media (prefers-color-scheme: dark) { .h-btn-ghost { color: var(--h-ink); border-color: var(--h-accent); } }

/* Viewer zoom: + / − / fit, wheel, double-click or double-tap, pinch, drag to move */
.h-viewer { overflow: hidden; }
.h-viewer img { touch-action: none; cursor: zoom-in; user-select: none; -webkit-user-drag: none; will-change: transform; }
.h-viewer.is-zoomed img { cursor: grab; }
.h-viewer.is-zoomed img:active { cursor: grabbing; }
.h-viewer.is-zoomed figcaption, .h-viewer.is-zoomed .h-viewer-prev, .h-viewer.is-zoomed .h-viewer-next { opacity: 0; pointer-events: none; }
.h-viewer-zoom { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 4px; border-radius: 999px; background: rgba(0, 0, 0, .55); z-index: 2; }
.h-viewer .h-viewer-zoom button { position: static; width: 44px; height: 44px; }
.h-viewer-pct { min-width: 3.5em; text-align: center; font-size: .85rem; font-variant-numeric: tabular-nums; }
.h-viewer figure { padding-bottom: 72px; }
.h-viewer .h-viewer-close { z-index: 2; }
.h-viewer button { background: rgba(0, 0, 0, .55); }
.h-viewer button:hover { background: rgba(0, 0, 0, .75); }

/* The FinLegacy bug (as on the kiosk): fixed bottom right on wide screens; in the footer everywhere */
.h-bug { position: fixed; right: 18px; bottom: 14px; z-index: 5; display: flex; align-items: center; gap: 6px; opacity: .8; pointer-events: none; }
.h-bug-mark { height: 26px; width: auto; display: block; }
.h-bug-fin { fill: var(--h-primary); }
.h-bug-wave { fill: #4F8FCB; }
.h-bug-word { font-size: .95rem; font-weight: 300; letter-spacing: .03em; color: var(--h-primary); line-height: 1; }
.h-bug-word b { font-weight: 700; }
.h-foot-brand { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; }
.h-foot-brand .h-bug-mark { height: 22px; }
.h-foot-brand .h-bug-word { font-size: .9rem; }
@media (prefers-color-scheme: dark) {
  .h-bug-fin { fill: #fff; }
  .h-bug-wave { fill: #8FC1EE; }
  .h-bug-word { color: #fff; }
}
@media (max-width: 1439px) { .h-bug { display: none; } }   /* only where it sits beside the 1100px content, never over it; the footer carries it otherwise */
body:has(.h-viewer[open]) .h-bug { display: none; }
