/* Amoras: one stylesheet, no build step. Palette "complementary":
   #000080 navy (main), #00165a dark navy, #bfcfff light blue, #804d00 brown,
   #5a3600 dark brown. Navy carries the site; the light blue is the accent on
   navy surfaces (header, hero, footer, date tiles); brown is the small warm
   accent on white (link hover, focus ring, notices). Red stays for errors and
   delete buttons only. */

:root {
  --navy: #000080;
  --navy-700: #000a6e;
  --navy-900: #00165a;
  --accent: #bfcfff;
  --accent-600: #a6bbf7;
  --warm: #804d00;
  --warm-900: #5a3600;
  --warm-tint: #f8f0e3;
  --bg: #f5f6fb;
  --surface: #ffffff;
  --text: #14162b;
  --muted: #5b5f7a;
  --border: #e3e5f0;
  --danger: #c62828;
  --success: #1b7f4c;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgb(10 12 40 / 6%), 0 8px 24px rgb(10 12 40 / 6%);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --container: 1120px;
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 0.6em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); }
h2 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
a { color: var(--navy); text-underline-offset: 3px; }
a:hover { color: var(--warm); }
img, svg { max-width: 100%; height: auto; }
code { background: #eef0f8; padding: 0.1em 0.35em; border-radius: 4px; font-size: 0.9em; word-break: break-all; }

:focus-visible { outline: 3px solid var(--warm); outline-offset: 2px; }
.site-header :focus-visible, .hero :focus-visible, .site-footer :focus-visible, .admin-sidebar :focus-visible { outline-color: var(--accent); }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--navy-900); padding: 0.5rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; }

.container { width: min(100% - 2rem, var(--container)); margin-inline: auto; }
.narrow { max-width: 520px; }
.section { padding-block: clamp(2rem, 5vw, 4rem); }
.section + .section { padding-top: 0; }
.muted { color: var(--muted); }
.inline { display: inline; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgb(0 0 102 / 92%);
  backdrop-filter: saturate(160%) blur(10px);
  color: #fff;
}
.site-header .header-inner { width: auto; max-width: none; padding-inline: clamp(1rem, 3vw, 2.5rem); }
.header-inner { display: flex; align-items: center; gap: 1.5rem; min-height: 68px; flex-wrap: wrap; }
.brand img { display: block; height: 44px; width: auto; }
.main-nav { display: flex; gap: 0.25rem; flex: 1; }
.link-button { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }
.link-button:hover { color: var(--warm); }
.main-nav a, .header-actions .pill {
  color: #fff;
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
}
.header-actions .link-button.pill { text-decoration: none; line-height: inherit; }
.main-nav a:hover, .header-actions .pill:hover { background: rgb(255 255 255 / 12%); color: #fff; }
.header-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.lang-switch { color: var(--accent); font-size: 0.9rem; text-decoration: none; padding: 0.4rem 0.6rem; }
.lang-switch:hover { color: #fff; }
.nav-toggle { display: none; }
/* Menu groups: the dropdown opens on hover, with the arrow button (nav.js),
   or on keyboard focus when the script isn't running. */
.nav-group { position: relative; display: flex; align-items: center; }
.nav-sub-toggle {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: none; border: 0; color: #fff; cursor: pointer;
  font: inherit; font-size: 0.95rem; font-weight: 500;
  padding: 0.4rem 0.7rem 0.4rem 0.3rem; border-radius: 999px;
}
.nav-group-label { padding-left: 0.8rem; }
.nav-sub-toggle::after {
  content: ""; width: 0.38em; height: 0.38em;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-0.15em) rotate(45deg);
}
.nav-sub-toggle:hover { background: rgb(255 255 255 / 12%); }
.nav-sub {
  display: none; position: absolute; top: 100%; left: 0; z-index: 60;
  flex-direction: column; gap: 0.1rem; min-width: 13rem; padding: 0.4rem;
  background: var(--navy-900); border-radius: 12px; box-shadow: 0 12px 30px rgb(0 0 40 / 35%);
}
.main-nav .nav-sub a { border-radius: 8px; }
.nav-group:hover .nav-sub, .nav-group.open .nav-sub,
.site-header:not(.js-nav) .nav-group:focus-within .nav-sub { display: flex; }


/* Hero */
.hero {
  background:
    url("/static/pattern.svg") center top / 180px 180px,
    radial-gradient(900px 500px at 0% 120%, rgb(191 207 255 / 16%), transparent 60%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-900) 100%);
  color: #fff;
  padding-block: clamp(3.5rem, 9vw, 7rem);
}
.hero h1 { font-size: clamp(2.2rem, 1.4rem + 3.5vw, 3.75rem); max-width: 16ch; }
.hero .lead { font-size: 1.2rem; max-width: 52ch; color: rgb(255 255 255 / 85%); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.8rem; font-weight: 700; color: var(--accent); }
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 2rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.3rem;
  border-radius: 999px;
  border: 2px solid transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  background: var(--navy);
  color: #fff;
  transition: transform 0.08s ease, background-color 0.15s ease;
}
.btn:hover { background: var(--navy-700); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy); }
.btn-accent { background: var(--accent); color: var(--navy-900); }
.btn-accent:hover { background: var(--accent-600); color: var(--navy-900); }
.btn-ghost { background: transparent; border-color: rgb(255 255 255 / 60%); }
.btn-ghost:hover { background: rgb(255 255 255 / 10%); }
.btn-ghost-dark { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost-dark:hover { background: #eef0f8; color: var(--text); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #a51f1f; }
.btn-danger-ghost { background: transparent; border-color: #f5c2c2; color: var(--danger); }
.btn-danger-ghost:hover { background: #fdecec; color: var(--danger); }
.btn-sm { padding: 0.35rem 0.9rem; font-size: 0.9rem; }

/* Cards and grids */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 3vw, 2rem);
}
.card.narrow { margin-inline: auto; }
.grid-2, .grid-3 { display: grid; gap: 1.25rem; }
.admin-main .grid-2 { align-items: start; }
.grants { margin-top: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.feature h2 { margin-top: 0.75rem; }
.feature-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--navy-900);
  font-size: 1.4rem;
}

/* Forms */
/* Grids pack their content at the top: a form next to a taller column must
   not spread the extra height over its fields. */
.stack { display: grid; gap: 1rem; align-content: start; }
/* Grid items grow to fit wide content (tables) unless allowed to shrink; .table-wrap then scrolls. */
.stack > *, .grid-2 > * { min-width: 0; }
.row-2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: start; }
label { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 0.35rem; font-weight: 600; font-size: 0.95rem; }
/* Fields side by side share their rows (text, input, hint), so the inputs
   line up even when one label wraps to two lines. */
.row-2 > label:not(.check) { grid-row: span 3; grid-template-rows: subgrid; row-gap: 0.35rem; }
/* Date and time pickers need more room than a half column of a card. */
.row-2:has(input[type="datetime-local"]) { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
label small { font-weight: 400; color: var(--muted); }
label.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }
label.check > input { flex-shrink: 0; }
label.check-top { align-items: flex-start; }
label.check-top > input { margin-top: 0.35rem; }
input, select, textarea {
  font: inherit;
  font-size: 1rem;
  font-weight: 400;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  width: 100%;
  min-width: 0;
}
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--navy); }
input:focus, select:focus, textarea:focus { border-color: var(--navy); outline: 3px solid rgb(0 0 128 / 15%); outline-offset: 0; }
.form-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.25rem; font-size: 0.95rem; }
.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.flash, .notice, .error { border-radius: var(--radius-sm); padding: 0.75rem 1rem; margin: 1rem 0; }
.flash { background: #e8f6ee; color: var(--success); border: 1px solid #bfe5cf; }
.notice { background: var(--warm-tint); border: 1px solid #e3c99e; font-size: 0.95rem; }
.error { background: #fdecec; color: var(--danger); border: 1px solid #f5c2c2; }

.details { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1.25rem; margin: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }
.details + .actions { margin-top: 1.25rem; }

.badge { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; background: #eef0ff; color: var(--navy); font-size: 0.8rem; font-weight: 600; }

/* Footer */
.site-footer { background: url("/static/pattern.svg") center top / 180px 180px, var(--navy-900); color: rgb(255 255 255 / 80%); margin-top: 3rem; padding-block: 2.5rem; font-size: 0.95rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; align-items: flex-end; }
.site-footer .muted { color: rgb(255 255 255 / 55%); }
.site-footer p { margin: 0; }
.site-footer img { display: block; margin-bottom: 0.5rem; }

.error-page { padding-block: 4rem; text-align: center; }

/* Admin */
body.admin { flex-direction: row; background: #f2f3f8; }
.admin-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--navy-900);
  color: #fff;
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.admin-sidebar nav { display: grid; gap: 0.15rem; }
.admin-sidebar a { color: rgb(255 255 255 / 85%); text-decoration: none; padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); font-size: 0.95rem; }
.admin-sidebar nav a:hover { background: rgb(255 255 255 / 10%); color: #fff; }
.admin-sidebar .brand { padding: 0; }
.admin-sidebar-foot { margin-top: auto; }
.admin-sidebar nav a[aria-current="page"] { background: rgb(255 255 255 / 14%); color: #fff; font-weight: 600; }
.admin-nav-group summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  padding: 0.5rem 0.75rem; border-radius: var(--radius-sm);
  color: rgb(255 255 255 / 85%); font-size: 0.95rem;
}
.admin-nav-group summary::-webkit-details-marker { display: none; }
.admin-nav-group summary::after { content: ""; width: 0.4rem; height: 0.4rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 0.15s; }
.admin-nav-group[open] summary::after { transform: rotate(45deg); }
.admin-nav-group summary:hover { background: rgb(255 255 255 / 10%); color: #fff; }
.admin-nav-group[open] summary { color: #fff; font-weight: 600; }
.admin-nav-group a { display: block; margin-top: 0.15rem; padding-left: 1.5rem; }
.admin-main { flex: 1; padding: clamp(1rem, 3vw, 2.5rem); min-width: 0; }
.admin-main > .card + .card { margin-top: 1.25rem; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; }
.search input { min-width: 280px; }
.search { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.badge-warn { background: #fdeceb; color: var(--danger); }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 0.2rem 0; }
.stat { display: grid; gap: 0.25rem; }
.stat-label { color: var(--muted); font-size: 0.9rem; }
.stat-value { font-size: 2rem; font-weight: 700; color: var(--navy); }
a.stat { text-decoration: none; color: inherit; }
a.stat:hover { border-color: var(--navy); }
.qr { background: #fff; display: inline-block; padding: 0.75rem; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.check-row { display: flex; align-items: flex-start; gap: 0.65rem; }
.member-card-preview {
  width: min(100%, 360px);
  min-height: 210px;
  margin-top: 1.25rem;
  padding: 1.25rem;
  border-radius: 1rem;
  color: #fff;
  background: var(--member-card-color, #000080);
  box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 18%);
}
.member-card-preview p { margin: 1.1rem 0 0; }
.member-card-preview p span:first-child { font-size: 0.72rem; opacity: 0.75; text-transform: uppercase; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.7rem 1rem; border-bottom: 1px solid var(--border); }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); background: #fafbfe; }
tbody tr:hover { background: #fafbff; }
tbody tr:last-child td { border-bottom: 0; }

@media (max-width: 760px) {
  .header-inner { padding-block: 0.5rem; gap: 0.5rem; }
  .main-nav { order: 3; flex-basis: 100%; flex-wrap: wrap; }
  .nav-toggle:not([hidden]) {
    display: inline-flex; align-items: center; gap: 0.5rem; margin-left: auto;
    background: none; border: 1px solid rgb(255 255 255 / 40%); border-radius: 999px;
    color: #fff; font: inherit; font-size: 0.95rem; padding: 0.35rem 0.9rem; cursor: pointer;
  }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 16px; height: 2px; background: currentColor; position: relative; }
  .nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-bars::before { top: -5px; }
  .nav-toggle-bars::after { top: 5px; }
  .js-nav .main-nav, .js-nav .header-actions { display: none; }
  .js-nav.nav-open .main-nav { display: flex; flex-direction: column; }
  /* On a phone the groups are open: a heading with its items indented. */
  .nav-group { flex-direction: column; align-items: stretch; }
  .nav-group > a + .nav-sub-toggle { display: none; }
  .nav-group-label { pointer-events: none; padding: 0.4rem 0.8rem; }
  .nav-group-label::after { display: none; }
  .nav-sub, .nav-group:hover .nav-sub {
    display: flex; position: static; min-width: 0; padding: 0 0 0 1rem;
    background: none; box-shadow: none;
  }
  .js-nav.nav-open .header-actions { display: flex; order: 4; flex-basis: 100%; padding-bottom: 0.5rem; }
  .footer-inner { align-items: flex-start; }
  body.admin { flex-direction: column; }
  .admin-sidebar { width: auto; height: auto; position: static; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .admin-sidebar nav { display: flex; flex-wrap: wrap; }
  .admin-nav-group summary { gap: 0.5rem; }
  .admin-nav-group[open] { flex-basis: 100%; }
  .admin-nav-group a { display: inline-block; padding-left: 0.75rem; }
  .admin-sidebar-foot { margin-top: 0; }
  .search input { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Account */
.section-title { margin-top: 2.5rem; }
.membership + .membership { border-top: 1px solid var(--border); margin-top: 1rem; padding-top: 1rem; }
.badge-ok { background: #e8f6ee; color: var(--success); }
.num { text-align: right; white-space: nowrap; }
.order-items { margin-top: 1.25rem; }
tfoot td, tfoot th { border-top: 1px solid var(--border); border-bottom: 0; }
tfoot th { background: none; font-size: 1rem; text-transform: none; letter-spacing: 0; color: var(--text); }

/* Membership */
.lead { font-size: 1.1rem; max-width: 65ch; }
.small { font-size: 0.875rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.plans { border: 0; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.plan { display: grid; gap: 0.35rem; cursor: pointer; position: relative; padding-left: 3rem; }
.plan input { position: absolute; left: 1.25rem; top: 1.6rem; accent-color: var(--navy); }
.plan:has(input:checked) { border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy); }
.plan-name { font-weight: 700; font-size: 1.1rem; }
.plan-price { font-size: 1.5rem; font-weight: 800; color: var(--navy); }
.membership .actions { margin-top: 0.75rem; }

/* Events and tickets */
.event-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.event-card { display: grid; gap: 0.35rem; text-decoration: none; color: inherit; align-content: start; }
.event-card:hover { border-color: var(--navy); }
/* Posters are A4 portrait (about 2:3). Products are mostly too, but not
   always: show the whole picture on a plain background instead of cropping. */
.event-card img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--radius-sm); background: var(--bg); }
.product-card img { object-fit: contain; }
.event-when { color: var(--navy); font-weight: 600; font-size: 0.95rem; }
.event-title { font-weight: 700; font-size: 1.15rem; }
.past-events li { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: baseline; }
.event-layout { display: grid; gap: 2rem; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; }
.event-image { width: auto; max-width: 100%; max-height: 75vh; height: auto; margin-inline: auto; border-radius: var(--radius); display: block; }
.event-image-link { display: block; }
.event-side { display: grid; gap: 1rem; }
.prose { max-width: 70ch; line-height: 1.6; }
.prose img { max-width: 100%; height: auto; }
.ticket-type + .ticket-type { border-top: 1px solid var(--border); padding-top: 1rem; }
.ticket-type { display: grid; gap: 0.5rem; }
.ticket-head { display: flex; justify-content: space-between; gap: 1rem; font-weight: 700; }
.ticket-price { color: var(--navy); white-space: nowrap; }
.ticket-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.ticket { text-align: center; }
.ticket .qr svg { width: 200px; height: 200px; display: block; }
.ticket .code { word-break: break-all; }
.ticket-void { opacity: 0.6; }
@media (max-width: 860px) {
  .event-layout { grid-template-columns: 1fr; }
  .event-side { order: -1; }
  .event-image { max-height: 60vh; }
}

/* Shop and cart */
.search-form { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; max-width: 32rem; }
.search-form input { flex: 1 1 12rem; }
.category-links { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.category-links .pill { padding: 0.25rem 0.8rem; border-radius: 999px; border: 1px solid var(--border); text-decoration: none; }
.category-links .pill.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.code-form { display: grid; gap: 0.35rem; margin-top: 1.25rem; max-width: 26rem; }
.code-applied { display: flex; gap: 0.75rem; align-items: baseline; flex-wrap: wrap; margin-top: 1.25rem; }
.input-group { display: flex; gap: 0.5rem; }
.input-group input { flex: 1; min-width: 0; }
.input-group .btn { padding-block: 0; white-space: nowrap; }
.checkout { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: center; justify-content: space-between; margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.checkout > div { flex: 1 1 16rem; }
.checkout p { margin: 0; }
.checkout p + p { margin-top: 0.4rem; }
.cart-items td:first-child { width: 100%; }
.code-applied p { margin: 0; }
.code-applied .error, .code-applied .muted { margin-left: 0.5rem; }

/* Admin: products */
.admin-thumb { max-width: 220px; border-radius: 6px; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem 1rem; margin: 0; }
legend { font-weight: 600; padding: 0 .25rem; }
.grid-2 + .variants { margin-top: 1.25rem; }
.variant-list { display: grid; gap: .5rem; }
.variant-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
  gap: .35rem .75rem;
  padding: .75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8f9fc;
}
/* Every control takes two rows (column name, field), so the checkboxes and
   the button sit on the line of the inputs. */
.variant-row > label { grid-row: span 2; grid-template-rows: subgrid; }
.variant-row > span { grid-row: span 2; }
.variant-row > .btn { grid-row: span 2; align-self: end; justify-self: start; white-space: nowrap; }
.vcheck input { align-self: center; justify-self: start; }
.variant-row .vl { hyphens: auto; overflow-wrap: break-word; }
/* Wide screens: one line per variant, like a table with the column names
   shown once. */
@media (min-width: 1200px) {
  .variant-row {
    /* Fixed proportions, so every row has the same columns. */
    grid-template-columns: repeat(2, minmax(0, 1.6fr)) repeat(3, minmax(0, 1fr)) minmax(0, 1.3fr) repeat(2, minmax(0, 1fr)) 3.5rem 7rem;
  }
  .variant-list .variant-row + .variant-row { row-gap: 0; }
  .variant-list .variant-row + .variant-row .vl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* Content: home slider, footer links, contact honeypot, page editor */
.slider { display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--radius-sm); }
.slide { flex: 0 0 100%; margin: 0; scroll-snap-align: start; position: relative; }
.slide img { width: 100%; max-height: 28rem; object-fit: cover; display: block; border-radius: var(--radius-sm); }
.slide figcaption { position: absolute; left: 1rem; bottom: 1rem; background: rgb(0 0 74 / 75%); color: #fff; padding: 0.4rem 0.8rem; border-radius: var(--radius-sm); }
.hero-text { max-width: 60ch; }
.hero-text h1, .hero-text h2 { margin-top: 0; }
.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-links a { color: inherit; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.vacancy h2 { margin-top: 0.25rem; }
.editor { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
.editor .preview { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem 1.25rem; min-height: 12rem; }
@media (max-width: 900px) { .editor { grid-template-columns: 1fr; } }
.slide-row { display: grid; grid-template-columns: 160px 1fr; gap: 1rem; align-items: start; border-top: 1px solid var(--border); padding-top: 1rem; }
.slide-row img { width: 160px; height: auto; border-radius: 6px; }
.slide-row form.inline { grid-column: 2; }

/* Admin: media library and the image picker */
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.stack-sm { display: grid; gap: 0.4rem; align-content: start; }
.stack-sm > h3, .stack-sm > p, .stack-sm > ul { margin: 0; }
.field-label { font-weight: 600; font-size: 0.95rem; }
.media-layout { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr) 22rem; grid-template-areas: "main edit"; align-items: start; }
.media-main { grid-area: main; gap: 1.25rem; }
.media-edit { grid-area: edit; position: sticky; top: 1.25rem; max-height: calc(100vh - 2.5rem); overflow-y: auto; padding: 1.25rem; }
.media-edit h2 { margin: 0; }
.media-edit > p { margin: 0; }
.media-edit-preview img { display: block; width: 100%; max-height: 16rem; object-fit: contain; border-radius: var(--radius-sm); background: #eef0f6; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0.6rem; }
.media-tile { display: block; border-radius: var(--radius-sm); }
.media-tile img, .picker-tile img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); background: #eef0f6; transition: opacity 0.15s; }
.media-tile:hover img, .picker-tile:hover img { opacity: 0.8; }
.media-tile[aria-current] img, .picker-tile:focus-visible img { outline: 3px solid var(--navy); outline-offset: 2px; }
.picker-tile:focus-visible { outline: none; }
.copy-row { display: flex; gap: 0.5rem; }
.copy-row input { font-family: monospace; font-size: 0.8rem; }
@media (max-width: 1100px) {
  .media-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "edit" "main"; }
  .media-edit { position: static; max-height: none; }
  .media-edit-empty { display: none; }
}
.picker { width: min(56rem, calc(100vw - 2rem)); max-height: calc(100vh - 4rem); padding: 0; border: 0; border-radius: var(--radius); box-shadow: 0 1rem 3rem rgb(0 0 0 / 25%); }
.picker::backdrop { background: rgb(0 0 40 / 45%); }
.picker-body { display: grid; gap: 1rem; padding: clamp(1rem, 3vw, 1.5rem); }
.picker-body > p { margin: 0; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: 0.6rem; max-height: 60vh; overflow-y: auto; padding: 4px; }
.picker-tile { padding: 0; border: 0; background: none; cursor: pointer; border-radius: var(--radius-sm); }
.picker-more, .picker-empty { grid-column: 1 / -1; justify-self: center; margin: 0.5rem 0; }
.md-tools { display: flex; }
.upload-new summary { cursor: pointer; font-weight: 600; color: var(--navy); width: fit-content; }
.upload-new[open] summary { margin-bottom: 1rem; }

.audit-details { max-width: 32rem; }
.audit-summary { display: flex; align-items: center; gap: .5rem; }
.audit-first { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-summary .btn { flex: none; }
.audit-popover { width: min(40rem, calc(100vw - 2rem)); max-height: 80vh; overflow: auto; margin: auto; padding: 1.25rem 1.5rem; border: 1px solid var(--border); box-shadow: var(--shadow); }
.audit-popover::backdrop { background: rgb(0 0 0 / 0.35); }
.audit-popover h2 { font-size: 1.1rem; margin: 0; }
.audit-lines { margin: 0; padding-left: 1.1rem; overflow-wrap: anywhere; }
.audit-lines li + li { margin-top: .3rem; }

/* To-do list and message board on the dashboard */
.todo-board { align-items: start; margin-bottom: 1.5rem; }
.todo-list, .posts { list-style: none; margin: 0; padding: 0; }
.todo-list li { padding: .4rem 0; border-bottom: 1px solid var(--border); }
.todo-list li:last-child, .posts li:last-child { border-bottom: 0; }
.posts li { padding: .5rem 0; border-bottom: 1px solid var(--border); }
.post-meta { margin: 0 0 .2rem; }
.post-body { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }

/* Vacancies */
.vacancy-filter { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; margin: 1rem 0 1.5rem; }
.vacancy-filter label { display: grid; gap: 0.25rem; }
.vacancy-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.25rem 0 0.75rem; }
.sponsor-logo { max-width: 12rem; max-height: 5rem; object-fit: contain; display: block; margin-bottom: 0.75rem; }
.vacancy .apply { margin-top: 2rem; }
.pre-wrap { white-space: pre-wrap; }

/* Admin menu editor: one line per item, a group's items indented under it,
   and a preview of the bar with the groups shown open. */
.menu-preview { margin-bottom: 1.5rem; }
.menu-preview h2 { font-size: 1.05rem; margin-top: 0; }
.menu-preview-bar { list-style: none; margin: 0 0 0.5rem; padding: 0.6rem 0.9rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; align-items: flex-start; background: var(--navy); border-radius: var(--radius-sm); color: #fff; }
.menu-preview-top { font-weight: 600; }
.menu-preview-heading { opacity: 0.85; font-style: italic; }
.menu-preview-sub { list-style: none; margin: 0.35rem 0 0; padding: 0.4rem 0.6rem; background: #fff; color: var(--text); border-radius: var(--radius-sm); font-size: 0.9rem; display: grid; gap: 0.2rem; }
.menu-rows { list-style: none; margin: 0 0 1.5rem; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.menu-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.4rem 0.75rem; border-top: 1px solid var(--border); }
.menu-row:first-child { border-top: 0; }
.menu-row:target { background: #eef2ff; }
.menu-child { padding-left: 2.5rem; }
.menu-child .menu-name::before { content: "└"; color: var(--muted); margin-right: 0.4rem; }
.menu-move { display: flex; gap: 0.25rem; }
.menu-move .btn { padding: 0.15rem 0.55rem; }
.menu-move .btn:disabled { opacity: 0.3; cursor: default; }
.menu-name { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.menu-actions { display: flex; gap: 0.4rem; }
.menu-add summary { cursor: pointer; }
.menu-add[open] summary { margin-bottom: 0.75rem; }
@media (max-width: 640px) {
  .menu-row { flex-wrap: wrap; }
  .menu-actions { width: 100%; justify-content: flex-end; }
}

/* Password box for hidden ticket types */
.unlock-tickets { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* Upcoming events on the home page: two or three cards side by side */
.upcoming { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.upcoming:has(> :only-child) { max-width: 420px; }
.upcoming-card { position: relative; display: flex; flex-direction: row; padding: 0; overflow: hidden; text-decoration: none; color: inherit; transition: transform 0.15s ease, border-color 0.15s ease; }
.upcoming-card:hover, .upcoming-card:focus-visible { border-color: var(--navy); transform: translateY(-2px); }
.upcoming-media { flex: 0 0 42%; aspect-ratio: 2 / 3; background: var(--navy); }
.upcoming-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.date-tile { position: absolute; top: 0.75rem; right: 0.75rem; display: grid; justify-items: center; min-width: 3.2rem; padding: 0.35rem 0.5rem; border-radius: var(--radius-sm); background: var(--navy); color: #fff; line-height: 1; }
.date-day { font-size: 1.4rem; font-weight: 800; }
.date-month { color: var(--accent); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.upcoming-body { display: grid; gap: 0.3rem; padding: 4.25rem 1.1rem 1.1rem; align-content: start; }
.upcoming-body .badge { justify-self: start; }
@media (prefers-reduced-motion: reduce) { .upcoming-card { transition: none; } .upcoming-card:hover { transform: none; } }
@media (max-width: 640px) {
  .upcoming { gap: 0.75rem; }
  .upcoming-media { flex-basis: 34%; }
  .date-tile { top: 0.5rem; right: 0.5rem; min-width: 2.6rem; }
  .date-day { font-size: 1.15rem; }
  .upcoming-body { padding: 3.5rem 0.9rem 0.75rem; }
}
.home-events .page-head h2 { margin: 0; }
.message-body { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem; margin: 1rem 0; }

/* Returns on the order page */
.return-line { display: flex; align-items: center; gap: .5rem; }
.return-line input { width: 4.5rem; flex: none; }
