/* Warwickshire Boardgame Club. Colours and fonts come from Brand/brand.py; see Brand/README.md */
@font-face {
  font-family: 'Dumbledor';
  src: url(/fonts/dumbledor1.woff2?v=892be27822) format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #212319;
  --paper: #f6efdf;
  --parchment: #efdebc;
  --moss: #54643c;
  --moss-dark: #3a4628;
  --gold: #b3a26e;
  --stone: #6b6246;
  --display: 'Dumbledor', Georgia, serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --width: 68rem;
  /* What the page content uses, so the themes below can swap them. Header, hero and footer stay moss in every theme */
  --bg: var(--paper);
  --texture: url(/img/paper.webp?v=8b34f6ae1e);
  --text: var(--ink);
  --card: var(--parchment);
  --heading: var(--moss);
  --link: var(--moss-dark);
  --muted: var(--stone);
  --line: #d8ccb0;
}

/* Themes picked in the footer (js/theme.js). Light: plain ivory with white cards. Dark: the logo's colours at night */
[data-theme="light"] {
  --bg: #f8f6f0;
  --texture: none;
  --card: #fff;
  --line: #e3dccb;
}
[data-theme="light"] :is(.facts > div, .events li, .cal-month, .cal-card) { outline: 1px solid #e3dccb; outline-offset: -1px; }
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1a1c15;
  --text: #ebe4d2;
  --card: #272b20;
  --heading: #b5c28a;
  --link: #cdd8a0;
  --muted: #b3a98c;
  --line: #3e4333;
}
[data-theme="dark"] body { background-blend-mode: multiply; }

/* Christmas (js/christmas.js): red header and hero, holly green footer and links, brighter gold, in any theme */
.xmas { --moss: #9b2a22; --moss-dark: #24452d; --gold: #d4b45a; }
[data-theme="dark"].xmas { --heading: #e8a197; }
.xmas-card { position: relative; }
/* Christmas sessions always: a candy-cane edge and a sprig of holly */
.events li.xmas-session, .cal-card.xmas-session {
  position: relative; border-left-color: transparent;
  background: repeating-linear-gradient(-45deg, #c62828 0 5px, #fff 5px 10px) 0 0 / 6px 100% no-repeat border-box,
    linear-gradient(rgba(198, 40, 40, .07), rgba(46, 125, 50, .07)), var(--card);
}
.xmas-session :is(.date, .cal-date) a { color: #b3261e; }
[data-theme="dark"] .xmas-session :is(.date, .cal-date) a { color: #f09a90; }
.xmas-session::before {
  content: ""; position: absolute; top: -12px; right: 12px; width: 46px; height: 34px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 46 34'%3E%3Cpath d='M23 18C17 8 8 4 1 6c3 2 2 5 5 6-2 2 0 5 3 5-1 3 2 4 5 3 2 2 6 0 9-2z' fill='%232e7d32'/%3E%3Cpath d='M23 18c6-10 15-14 22-12-3 2-2 5-5 6 2 2 0 5-3 5 1 3-2 4-5 3-2 2-6 0-9-2z' fill='%23388e3c'/%3E%3Ccircle cx='19' cy='21' r='4.5' fill='%23d32f2f'/%3E%3Ccircle cx='27' cy='21' r='4.5' fill='%23c62828'/%3E%3Ccircle cx='23' cy='27' r='4.5' fill='%23e53935'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25));
}
.events li.xmas-card:hover, .events li.xmas-card, .cal-card.xmas-card {
  transform: translateY(-3px); box-shadow: 0 0 0 3px var(--gold), 0 12px 24px rgba(155, 42, 34, .3);
}
.xmas-card::after {
  content: "\2744" / ""; position: absolute; top: -.75rem; left: -.75rem; font: 1.8rem/1 var(--body);
  color: var(--gold); text-shadow: 0 2px 4px rgba(33, 35, 25, .3); animation: jingle .9s ease-in-out;
}
@keyframes jingle {
  0% { scale: 0; rotate: -90deg; }
  40% { scale: 1.3; rotate: 20deg; }
  70% { rotate: -12deg; }
}
/* Fairy lights hanging under the header, in two sets that twinkle in turn */
.xmas .site-header::before, .xmas .site-header::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 24px; pointer-events: none;
  background-repeat: repeat-x; background-size: 120px 24px;
  filter: drop-shadow(0 0 4px rgba(255, 236, 170, .9));
  animation: twinkle 1.6s ease-in-out infinite alternate;
}
.xmas .site-header::before {
  background-image:
    radial-gradient(ellipse 5px 7px at 15px 13px, #ff5a4e 90%, transparent),
    radial-gradient(ellipse 5px 7px at 75px 13px, #5ccf62 90%, transparent);
}
.xmas .site-header::after {
  background-image:
    radial-gradient(ellipse 5px 7px at 45px 14px, #ffd54a 90%, transparent),
    radial-gradient(ellipse 5px 7px at 105px 14px, #5ab8f0 90%, transparent),
    linear-gradient(#2b2a20, #2b2a20);
  background-size: 120px 24px, 120px 24px, 100% 2px;
  background-position: 0 0, 0 0, 0 4px;
  animation-delay: -1.6s;
}
@keyframes twinkle { from { opacity: .45; } to { opacity: 1; } }
/* A Santa hat on the header logo */
.xmas .brand { position: relative; }
.xmas .brand::before {
  content: ""; position: absolute; left: 54px; top: -10px; width: 38px; height: 33px; rotate: 28deg;
  pointer-events: none; transition: width .3s ease, height .3s ease, left .3s ease, top .3s ease;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 56'%3E%3Cpath d='M8 44C10 24 22 8 40 8c10 0 16 10 16 22h-6c-2-8-6-12-10-10 4 8 8 16 10 24z' fill='%23c62828'/%3E%3Ccircle cx='53' cy='32' r='6' fill='%23fff'/%3E%3Crect x='3' y='40' width='52' height='12' rx='6' fill='%23fff'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35));
}
@media (min-width: 36.01rem) {
  .xmas .site-header.scrolled .brand::before { left: 35px; top: -7px; width: 26px; height: 23px; }
}
/* Snow lying along the bottom of the home page hero */
.xmas .hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 30px; pointer-events: none;
  background:
    linear-gradient(#fdfdfb, #fdfdfb) 0 100% / 100% 10px no-repeat,
    radial-gradient(ellipse 45px 20px at 45px 30px, #fdfdfb 98%, transparent) 0 0 / 90px 30px repeat-x,
    radial-gradient(ellipse 35px 26px at 35px 34px, #fdfdfb 98%, transparent) 50px 0 / 130px 30px repeat-x;
  filter: drop-shadow(0 -2px 3px rgba(0, 0, 0, .18));
}
.scroll-cue { z-index: 1; }
.snow { position: fixed; inset: 0; z-index: 21; pointer-events: none; overflow: hidden; transition: opacity .9s ease; }
.snow.melt { opacity: 0; }
.snow i {
  position: absolute; top: 0; left: var(--x); font: normal var(--size)/1 var(--body); color: #fff;
  text-shadow: 1px 0 #7d9bb8, -1px 0 #7d9bb8, 0 1px #7d9bb8, 0 -1px #7d9bb8, 0 2px 6px rgba(40, 70, 110, .5);
  animation: fall var(--fall) linear var(--delay) var(--times, 1) both;
}
@keyframes fall {
  from { transform: translate(0, -2rem) rotate(0); }
  to { transform: translate(var(--drift), 105vh) rotate(var(--spin)); }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg) var(--texture) 0 0 / 512px 512px;
  color: var(--text);
  font: 1.125rem/1.6 var(--body);
  font-synthesis: none;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); color: var(--heading); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.1rem); color: var(--heading); margin-top: 1.6em; }
h3 { font-size: 1.4rem; }

p, ul, ol, dl { margin: 0 0 1em; }

a { color: var(--link); text-underline-offset: .15em; }
a[href^="mailto:"] { overflow-wrap: anywhere; }
a:hover { color: var(--text); }
a[target="_blank"]::after { content: "\2009\2197" / ""; }
:focus-visible { outline: 3px solid var(--heading); outline-offset: 3px; border-radius: 2px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 30;
  background: var(--parchment); color: var(--ink); padding: .6rem 1rem; border-radius: 4px;
}
.skip:focus { top: 1rem; }

/* Header: sticky on wider screens, and shrinks once you scroll (js/motion.js adds .scrolled) */
.site-header {
  background: var(--moss); color: var(--parchment); border-bottom: 4px solid var(--gold);
  position: relative; z-index: 20;
}
.site-header .inner {
  max-width: var(--width); margin: 0 auto; padding: .6rem 1.25rem;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem;
  transition: padding .3s ease;
}
.brand {
  display: flex; align-items: center; gap: .75rem;
  color: var(--parchment); text-decoration: none;
  font: 1.45rem/1.1 var(--display);
  text-wrap: balance;
}
.brand img {
  width: 72px; flex: none; background: var(--parchment); border-radius: 10px; padding: 4px;
  transition: width .3s ease, border-radius .3s ease;
}
@media (min-width: 36.01rem) {
  html { scroll-padding-top: 5.5rem; }
  .site-header { position: sticky; top: 0; z-index: 20; }
  .site-header.scrolled { box-shadow: 0 3px 16px rgba(33, 35, 25, .35); }
  .site-header.scrolled .inner { padding-block: .3rem; }
  .site-header.scrolled .brand img { width: 46px; border-radius: 8px; }
}
.brand:hover { color: #fff; }
.site-header ul { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin: 0; padding: 0; }
.site-header nav a { color: var(--parchment); text-decoration: none; padding: .3rem 0; display: inline-block; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: #fff; text-decoration: underline; }
.site-header :focus-visible, .site-footer :focus-visible { outline-color: var(--parchment); }
@media (max-width: 52rem) {
  .site-header .inner { flex-direction: column; text-align: center; }
  .site-header ul { justify-content: center; }
}
/* Tablets: once scrolled, the logo and the links share one row; the name stays for screen readers */
@media (min-width: 36.01rem) and (max-width: 52rem) {
  .site-header.scrolled .inner { flex-direction: row; }
  .site-header.scrolled .brand span {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
}
@media (max-width: 36rem) {
  .site-header nav { width: 100%; }
  .site-header ul { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
  .site-header nav a { display: block; padding: .55rem .25rem; border-radius: 6px; background: var(--moss-dark); }
  .site-header nav a[aria-current="page"] { background: var(--parchment); color: var(--ink); text-decoration: none; }
}

main { max-width: var(--width); margin: 0 auto; padding: 2rem 1.25rem 3rem; }
.narrow { max-width: 44rem; }
.narrow h2 { margin-bottom: .15em; }
.narrow li { margin-bottom: .5rem; }

/* Home */
.home { max-width: none; padding: 0; }
.wrap { max-width: var(--width); margin: 0 auto; padding: 2.5rem 1.25rem 3rem; }
.lead { font-size: 1.25rem; }
@media (min-width: 22rem) { .nowrap { white-space: nowrap; } }
@media (max-width: 36rem) { .lead { font-size: 1.15rem; } }

/* Hero: moss with the paper grain, the white-lettered logo; --p (0 to 1) from js/motion.js as it scrolls away */
.hero {
  position: relative; overflow: hidden; isolation: isolate; color: var(--parchment); background: var(--moss);
  border-bottom: 4px solid var(--gold);
}
/* The grain on a layer of its own, 160px taller than the hero, so scrolling moves it without repainting */
.hero::before {
  content: ""; position: absolute; inset: -160px 0 0; z-index: -1; pointer-events: none;
  background: var(--moss) url(/img/paper.webp?v=8b34f6ae1e) 0 0 / 512px 512px; background-blend-mode: multiply;
}
.hero-inner {
  max-width: var(--width); margin: 0 auto; padding: 2.5rem 1.25rem 3.5rem;
  display: grid; gap: 1.5rem 3rem; align-items: center; align-content: center;
}
@media (min-width: 52rem) {
  .hero-inner { grid-template-columns: 2fr 3fr; min-height: min(46rem, calc(100svh - 6.5rem)); }
}
.hero-logo { width: min(75%, 420px); margin: 0 auto; filter: drop-shadow(0 12px 18px rgba(20, 24, 14, .45)); }
@media (min-width: 52rem) { .hero-logo { width: min(100%, 420px); } }
.hero h1 { color: var(--parchment); font-size: clamp(2.3rem, 6vw, 3.8rem); text-wrap: balance; }
.hero .lead { max-width: 34rem; }
.hero :focus-visible { outline-color: var(--parchment); }
.hero .button { background: var(--parchment); color: var(--ink); border-color: var(--parchment); }
.hero .button:hover { background: #fff; border-color: #fff; color: var(--ink); }
.hero .button.quiet { background: transparent; color: var(--parchment); }
.hero .button.quiet:hover { background: var(--moss-dark); border-color: var(--parchment); color: #fff; }
.scroll-cue {
  position: absolute; left: 50%; bottom: 1.4rem; width: 1.1rem; height: 1.1rem; margin-left: -.55rem;
  border: solid var(--gold); border-width: 0 3px 3px 0; transform: rotate(45deg);
  opacity: calc(1 - var(--p, 0) * 5);
}
@media (max-width: 52rem) { .scroll-cue { display: none; } }

@media (prefers-reduced-motion: no-preference) {
  .hero-logo { animation: hero-logo 1.1s cubic-bezier(.2, .7, .2, 1) backwards; }
  .hero-text > * { animation: hero-up .9s cubic-bezier(.2, .7, .2, 1) backwards; }
  .hero-text > :nth-child(1) { animation-delay: .15s; }
  .hero-text > :nth-child(2) { animation-delay: .3s; }
  .hero-text > :nth-child(3) { animation-delay: .45s; }
  .scroll-cue { animation: nudge 2.2s ease-in-out 1.2s infinite; }
}
@keyframes hero-logo { from { opacity: 0; scale: .9; translate: 0 24px; } }
@keyframes hero-up { from { opacity: 0; translate: 0 28px; } }
@keyframes nudge { 50% { translate: 0 6px; } }

.motion .hero::before { transform: translateY(calc(var(--p, 0) * 160px)); will-change: transform; }
.motion .hero-logo { transform: translateY(calc(var(--p, 0) * 110px)) scale(calc(1 - var(--p, 0) * .12)); will-change: transform; }
/* Only where the hero fits on screen; on phones the text is still being read as it scrolls */
@media (min-width: 52rem) {
  .motion .hero-text { opacity: calc(1 - var(--p, 0) * 1.6); transform: translateY(calc(var(--p, 0) * -50px)); }
}

/* Facts as cards */
.facts { display: grid; gap: 1rem; margin: 0 0 1.5rem; }
@media (min-width: 30rem) { .facts { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); } }
.facts > div {
  background: var(--card); border-radius: 10px; padding: 1rem 1.2rem 1.1rem;
  border-top: 5px solid var(--moss); box-shadow: 0 1px 2px rgba(33, 35, 25, .12);
  transition: transform .25s ease, box-shadow .25s ease;
}
.facts > div:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(33, 35, 25, .16); }
.facts dt { font-family: var(--display); font-size: 1.4rem; color: var(--heading); margin-bottom: .2rem; }
.facts dd { margin: 0; }

.buttons { display: flex; flex-wrap: wrap; gap: .75rem; }
.button {
  display: inline-block; padding: .7rem 1.2rem; border-radius: 6px;
  background: var(--moss); color: var(--paper); text-decoration: none; font-weight: 600;
  border: 2px solid var(--moss);
  transition: background-color .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.button:hover { background: var(--moss-dark); color: #fff; transform: translateY(-2px); box-shadow: 0 6px 14px rgba(33, 35, 25, .22); }
.button.quiet { background: transparent; color: var(--link); }
.button.quiet:hover { background: var(--card); color: var(--text); }
@media (max-width: 36rem) {
  .buttons { flex-direction: column; }
  .button { text-align: center; }
}

/* Photo: drifts and zooms out slowly as it scrolls past (--p from js/motion.js) */
.photo { margin: 2.5rem 0 0; overflow: hidden; border-radius: 8px; border: 4px solid var(--card); }
.photo img { width: 100%; }
.motion .photo img { transform: translateY(calc((.5 - var(--p, .5)) * 8%)) scale(calc(1.16 - var(--p, .5) * .08)); }

.map { margin: 1.5rem 0; }
.map img { width: 100%; max-width: 32rem; border-radius: 8px; border: 4px solid var(--card); }
.map figcaption { margin-top: .4rem; font-size: .875rem; color: var(--muted); }

.columns { display: grid; gap: 0 3rem; }
@media (min-width: 52rem) { .columns { grid-template-columns: 1fr 1fr; } }

/* Game photos, like prints on a table: swipe or scroll sideways. js/gallery.js shuffles them, adds the buttons
   and moves them along */
.strip { padding: 0 0 3.5rem; }
.strip h2 { max-width: var(--width); margin: 0 auto .5rem; padding: 0 1.25rem; }
.strip-view {
  position: relative; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
  padding: 1.5rem 0 2rem;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.strip.ready .strip-view { scrollbar-width: none; cursor: grab; }
.strip.ready .strip-view::-webkit-scrollbar { display: none; }
.strip.dragging .strip-view { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.strip-view:focus-visible { outline-offset: -3px; }
.strip-track { list-style: none; margin: 0; padding: 0 1.25rem; display: flex; align-items: center; gap: 1.5rem; width: max-content; }
.strip-track li {
  flex: none; scroll-snap-align: center;
  background: var(--parchment); padding: 8px 8px 26px; border-radius: 3px;
  box-shadow: 0 2px 4px rgba(33, 35, 25, .14), 0 12px 26px rgba(33, 35, 25, .2);
  rotate: var(--tilt, 0deg); transition: rotate .3s ease, scale .3s ease;
}
.strip-track li.on, .strip-track li:hover { rotate: 0deg; scale: 1.05; }
.strip-track img { height: 240px; width: auto; max-width: none; border-radius: 2px; cursor: zoom-in; }
@media (min-width: 40rem) { .strip-track img { height: 320px; } }
.strip-controls { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .75rem; }
.strip-button {
  height: 2.9rem; min-width: 2.9rem; padding: 0 1.1rem; border-radius: 6px; cursor: pointer;
  border: 2px solid var(--moss); background: var(--bg); color: var(--link); font: 600 1rem var(--body);
  transition: background-color .2s ease, color .2s ease;
}
.strip-button:hover { background: var(--moss); color: var(--paper); }
.strip-button.arrow { padding: 0; font-size: 1.8rem; line-height: 1; }

/* A game photo, larger, opened by clicking it (js/gallery.js) */
.photo-viewer {
  border: 0; padding: 10px 10px 12px; border-radius: 4px; background: var(--parchment); color: var(--ink);
  max-width: 96vw; max-height: 96vh; box-shadow: 0 20px 50px rgba(0, 0, 0, .4);
}
.photo-viewer::backdrop { background: rgba(33, 35, 25, .82); }
.photo-viewer img { display: block; width: auto; height: auto; max-width: calc(96vw - 20px); max-height: calc(96vh - 90px); border-radius: 2px; touch-action: pan-y; user-select: none; }
.photo-viewer form { margin: 10px 0 0; display: flex; justify-content: center; gap: .75rem; }

/* Dates from Meetup */
.events { list-style: none; padding: 0; display: grid; gap: .75rem; }
@media (min-width: 40rem) { .events { grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); } }
.events li {
  background: var(--card); border-radius: 8px; padding: .9rem 1.1rem;
  border-left: 6px solid var(--moss);
  transition: transform .25s ease, box-shadow .25s ease;
}
.events li:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(33, 35, 25, .15); }
.events .date { font: 1.35rem/1.2 var(--display); display: block; }
.events .cancelled { border-left-color: var(--muted); }
.events .cancelled .date { text-decoration: line-through; }
.note { font-size: .95rem; color: var(--muted); }

/* Calendar on /events (js/calendar.js): the month on a parchment card, that month's sessions beside it */
.calendar { display: grid; gap: 1.5rem 2.5rem; align-items: start; }
@media (min-width: 52rem) { .calendar { grid-template-columns: minmax(0, 25rem) 1fr; } }
.cal-month {
  background: var(--card); border-radius: 10px; padding: .9rem 1rem 1rem;
  border-top: 5px solid var(--moss); box-shadow: 0 1px 2px rgba(33, 35, 25, .12);
}
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .4rem; }
.cal-head h3 { margin: 0; color: var(--heading); font-size: 1.6rem; text-align: center; }
.cal-head .strip-button:disabled { opacity: .35; cursor: default; background: var(--bg); color: var(--link); }
.cal-grid { margin: 0; table-layout: fixed; }
.cal-grid th, .cal-grid td { border: 0; padding: 3px; text-align: center; }
.cal-grid th { font: 600 .8rem var(--body); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cal-grid abbr { text-decoration: none; }
.cal-day {
  display: grid; place-items: center; width: 100%; aspect-ratio: 1; border-radius: 50%;
  font: 1rem/1 var(--body); color: var(--text);
}
.cal-day.past { opacity: .45; }
.cal-day.today { box-shadow: 0 0 0 3px var(--gold); }
button.cal-day {
  cursor: pointer; font-weight: 700; color: var(--link); background: var(--bg);
  border: 2px dashed var(--heading); transition: transform .2s ease, box-shadow .2s ease;
}
button.cal-day.open { background: var(--moss); border: 2px solid var(--moss); color: var(--paper); }
button.cal-day.past, button.cal-day.cancelled { border: 2px solid var(--muted); color: var(--muted); background: transparent; }
button.cal-day.cancelled { text-decoration: line-through; }
button.cal-day:hover { transform: scale(1.12); box-shadow: 0 4px 10px rgba(33, 35, 25, .2); }
button.cal-day.on { outline: 3px solid var(--text); outline-offset: 2px; }
.cal-key {
  list-style: none; display: flex; flex-wrap: wrap; gap: .3rem 1.1rem;
  margin: .6rem 0 0; padding: 0; font-size: .9rem; color: var(--muted);
}
.cal-key li::before {
  content: ""; display: inline-block; width: .95em; height: .95em; margin-right: .4em; vertical-align: -.12em;
  border-radius: 50%; box-sizing: border-box;
}
.cal-key .open::before { background: var(--moss); }
.cal-key .later::before { border: 2px dashed var(--heading); background: var(--bg); }
.cal-key .today::before { border: 3px solid var(--gold); }
.cal-list h3 { color: var(--heading); margin-bottom: .6rem; }
.cal-list ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.cal-card {
  background: var(--card); border-radius: 8px; padding: .9rem 1.1rem;
  border-left: 6px solid var(--moss); scroll-margin: 6rem 0 1rem;
  transition: transform .25s ease, box-shadow .25s ease;
}
.cal-card.later, .cal-card.missing, .cal-card.unknown { border-left-color: var(--gold); }
.cal-card.past, .cal-card.cancelled { border-left-color: var(--muted); opacity: .75; }
.cal-card.cancelled .cal-date { text-decoration: line-through; }
.cal-card.on { transform: translateY(-3px); box-shadow: 0 0 0 3px var(--heading), 0 10px 20px rgba(33, 35, 25, .15); }
.cal-card p { margin: 0 0 .5rem; }
.cal-card > :last-child { margin-bottom: 0; }
.cal-card .button { padding: .45rem 1rem; }
.cal-card button.button { font: 600 1.125rem/1.6 var(--body); cursor: pointer; }
.cal-card .button + .cal-msg:not(:empty) { margin-top: .6rem; }
.cal-date { font: 1.35rem/1.2 var(--display); }
.cal-msg { font-size: .95rem; color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .cal-turn tbody, .cal-turn .cal-card { animation: cal-in .45s cubic-bezier(.2, .7, .2, 1) backwards; }
  .cal-turn .cal-card:nth-child(2) { animation-delay: .08s; }
  .cal-turn .cal-card:nth-child(n+3) { animation-delay: .16s; }
}
@keyframes cal-in { from { opacity: 0; translate: 0 12px; } }

/* Code of conduct */
.conduct li { margin-bottom: .75rem; }
.conduct ul ul { margin-top: .25rem; }

table { border-collapse: collapse; width: 100%; margin: 0 0 1.5rem; font-size: 1rem; }
th, td { text-align: left; vertical-align: top; padding: .6rem .75rem; border-bottom: 1px solid var(--line); }
th { font-family: var(--display); font-weight: 400; font-size: 1.15rem; color: var(--heading); }
.table-wrap { overflow-x: auto; }

/* Footer */
.site-footer { background: var(--moss-dark); color: var(--parchment); font-size: 1rem; border-top: 4px solid var(--gold); }
.site-footer .inner { max-width: var(--width); margin: 0 auto; padding: 2rem 1.25rem 1.5rem; }
.site-footer a { color: var(--parchment); }
.site-footer a:hover { color: #fff; }
.footer-cols { display: grid; gap: 1.5rem; }
@media (min-width: 46rem) { .footer-cols { grid-template-columns: 1.3fr 1fr 1fr; } }
.site-footer h2 { font-size: 1.3rem; color: var(--parchment); margin: 0 0 .4rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .3rem; }
.site-footer address { font-style: normal; margin-bottom: .75rem; }
.copyright { border-top: 1px solid rgba(240, 222, 183, .3); margin: 1.5rem 0 0; padding-top: 1rem; font-size: .9rem; }

/* Theme picker (js/theme.js adds it above the copyright line) */
.theme-picker { border: 0; margin: 1.5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.theme-picker legend { float: left; padding: 0; margin-right: .5rem; font-weight: 600; }
.theme-picker label { position: relative; cursor: pointer; }
.theme-picker input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.theme-picker span {
  display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .9rem .3rem .45rem; border-radius: 999px;
  border: 2px solid rgba(240, 222, 183, .45); transition: background-color .2s ease, border-color .2s ease;
}
.theme-picker span::before {
  content: ""; width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 2px solid var(--parchment);
  background: linear-gradient(135deg, var(--swatch-bg) 50%, var(--swatch-card) 50%);
}
.theme-picker .club { --swatch-bg: var(--paper); --swatch-card: var(--moss); }
.theme-picker .light { --swatch-bg: #fff; --swatch-card: #f8f6f0; }
.theme-picker .dark { --swatch-bg: #1a1c15; --swatch-card: #b5c28a; }
.theme-picker label:hover span { border-color: var(--parchment); }
.theme-picker input:checked + span { background: var(--parchment); color: var(--ink); border-color: var(--parchment); }
.theme-picker input:checked + span::before { border-color: var(--moss-dark); }
.theme-picker input:focus-visible + span { outline: 3px solid var(--parchment); outline-offset: 2px; }

/* Blocks below the fold rise in as they come into view (js/motion.js adds .rise, then .in) */
.motion .rise {
  opacity: 0; translate: 0 40px;
  transition: opacity .8s ease var(--d, 0s), translate .8s cubic-bezier(.2, .7, .2, 1) var(--d, 0s),
    transform .25s ease, box-shadow .25s ease;
}
.motion .rise.in { opacity: 1; translate: none; }
.facts > div:nth-child(2) { --d: .1s; }
.facts > div:nth-child(3) { --d: .2s; }
.facts > div:nth-child(4) { --d: .3s; }

/* Session cards drop in one after another */
.motion .rise.in .events li { animation: drop .6s cubic-bezier(.2, .7, .2, 1) .2s backwards; }
.motion .rise.in .events li:nth-child(2) { animation-delay: .32s; }
.motion .rise.in .events li:nth-child(3) { animation-delay: .44s; }
.motion .rise.in .events li:nth-child(4) { animation-delay: .56s; }
.motion .rise.in .events li:nth-child(5) { animation-delay: .68s; }
.motion .rise.in .events li:nth-child(n+6) { animation-delay: .8s; }
@keyframes drop { from { opacity: 0; translate: 0 -20px; } }

/* Fades between the club's colours and Christmas (js/christmas.js) */
.site-header, .hero, .hero::before, .site-footer { transition: background-color .6s ease, border-color .6s ease, box-shadow .3s ease; }

@media print {
  .snow { display: none; }
  .motion .rise { opacity: 1; translate: none; }
  .site-header { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
