/* ============================================================================
   Early Music San Antonio
   Hand-written CSS matching the live WordPress/EventON site: no framework,
   no theme, no plugin, no JavaScript.

   Every value the design depends on is a custom property in :root, so the
   planned style-editing page only ever writes properties, never rules.
   All measurements were read from the live site's computed styles at 1280px
   and 375px wide.
   ========================================================================== */

:root {
  /* --- brand ------------------------------------------------------------ */
  --gold:          #9e7e00;   /* headings */
  --gold-deep:     #8c7200;   /* footer bar */
  --card-bg:       #b3d1db;   /* event card panel */
  --card-text:     #ffffff;
  --ink:           #000000;
  --ink-soft:      #202124;   /* calendar month title */
  --page-bg:       #ffffff;

  --btn-bg:        #656565;   /* "Jump Months" */
  --btn-text:      #ffffff;
  --more-bg:       #b4b4b4;   /* "Show More Events" */
  --more-text:     #ffffff;

  --cal-dayname-bg:   #ececec;
  --cal-dayname-text: #9e9e9e;
  --cal-day-text:     #d4d4d4;
  --cal-day-bg:       #ffffff;
  --cal-accent:       var(--gold);

  /* --- type ------------------------------------------------------------- */
  --font: 'Raleway', Helvetica, Arial, sans-serif;
  --text-size: 16px;
  --text-leading: 1.5;

  --h1-size: 43.36px;
  --h1-size-mobile: 27.58px;
  --h1-weight: 500;

  /* Interior pages use the theme's page title, which is larger and a shade
     lighter than the gold used for headings inside the home page content. */
  --page-title-size: 47.68px;
  --page-title-size-mobile: 30px;
  --page-title-color: #aa8b00;

  --h2-size: 28.64px;
  --h2-size-mobile: 22px;
  --h2-weight: 300;           /* section headings are light */
  --widget-title-weight: 400; /* the sidebar title is a touch heavier */

  --nav-size: 20px;
  --nav-weight: 500;

  --card-title-size: 24px;
  --card-title-weight: 800;
  --card-day-size: 30px;
  --card-month-size: 11px;
  --card-year-size: 10px;
  --card-time-size: 12px;

  --month-title-size: 20px;
  --month-title-weight: 800;
  --cal-day-size: 12px;

  --more-size: 14px;
  --footer-size: 16px;

  /* --- layout ----------------------------------------------------------- */
  --container: 1200px;        /* content column incl. padding */
  --container-pad: 50px;
  --container-pad-mobile: 30px;

  --primary-ratio: 68%;       /* main column share of the row */
  --sidebar-width: 352px;
  --column-gap: 50px;         /* lives as padding on the main column */
  --content-top: 50px;
  --content-bottom: 70px;

  --banner-height: 185px;
  --banner-overlay: rgba(0, 33, 43, 0.66);   /* the wash over the header photo */
  --banner-position: 24% 42%;
  /* The live site reserves only 65px for its 155px fixed banner, which leaves
     its own <h1> hidden underneath. Reserving the full height keeps the
     heading visible; set this to 65px to reproduce the overlap exactly. */
  --banner-reserve: var(--banner-height);
  --logo-width: 205px;
  --logo-height: 150px;

  --hero-radius: 3px;
  --measure: 62ch;

  --card-pad: 20px;
  --card-pad-sidebar: 15px;
  --card-gap: 10px;
  /* The live site's cards are square and butt together. Rounded corners are a
     deliberate change — 10px is the radius the rest of the design already uses
     (thumbnails, buttons, calendar corners), and the gap lets the rounding
     read. Set radius to 0 and gap to 1px to go back to the live look. */
  --card-radius: 10px;
  --card-stack-gap: 10px;
  --thumb-size: 140px;
  --thumb-size-sidebar: 50px; /* the sidebar card runs a smaller thumbnail */
  --thumb-radius: 10px;
  --thumb-focus: 50% 0%;      /* which part of a wide banner survives the crop */

  --more-radius: 10px;
  --more-leading: 16px;

  /* --- past-events tiles ------------------------------------------------- */
  --tile-columns: 3;
  --tile-height: 436px;
  --tile-radius: 20px;
  --tile-inset: 5px;          /* the gap between tiles is padding, as on live */
  --tile-blur: 22px;
  --tile-back-opacity: 0.75;
  --card-text-dark: #202124;
  --tile-scrim: linear-gradient(to top, rgb(0 0 0 / 0.55) 0%, rgb(0 0 0 / 0.15) 45%, rgb(0 0 0 / 0) 70%);

  --cal-cell-height: 39px;
  --cal-cell-height-events: 60px;
  --cal-radius: 10px;

  /* --- calendar page, the full-width grid -------------------------------- */
  --calpage-cell: 91px;            /* an empty row on the live calendar */
  --calpage-cell-events: 111px;    /* a row with something on */
  --calpage-cell-pad: 30px 0;
  --calpage-day-size: 20px;
  --calpage-day-weight: 700;
  --calpage-dayname-size: 14px;
  --calpage-dayname-weight: 700;
  --calpage-chip-size: 10px;
  --calpage-chip-radius: 5px;
  --calpage-month-size: 26px;
  --cal-hairline: #f0f0f0;

  /* --- forms ------------------------------------------------------------- */
  --field-size: 16px;
  --field-text: rgb(0 0 0 / 0.7);
  --field-border: rgb(0 0 0 / 0.25);
  /* Rounded to match the events form, so the two look like the same site.
     Tall boxes get less, as a pill on a 164px textarea reads as a mistake. */
  --field-radius: 20px;
  --field-textarea-radius: 10px;
  --field-pad: 10px 14px;
  --field-gap: 18px;
  --field-textarea-height: 120px;
  --form-accent: #066aab;      /* the live submit button */
  --form-submit-size: 17px;
  --form-required: #b3261e;

  /* The Submit page's fields, taken from EventON's own form. */
  --evoform-field-size: 14px;
  --evoform-field-height: 42px;
  --evoform-field-text: #666666;
  --evoform-border: #dddddd;
  --evoform-radius: 20px;           /* pill-shaped, as on the live form */
  --evoform-textarea-radius: 10px;
  --evoform-textarea-height: 164px;
  --evoform-pad: 12px 15px;
  --evoform-label-size: 14px;
  --evoform-label-weight: 700;
  --evoform-label-color: #202124;

  --admin-bg: #f2f3f5;
  --rule-strong: #cfd3d7;
  --ink-faint: #6b7075;

  /* --- expanded detail panel -------------------------------------------- */
  --card-bg-hover: #a9c9d4;
  --modal-width: 1000px;
  --modal-inset: 24px;
  --modal-radius: 12px;
  --modal-scrim: rgb(0 0 0 / 0.55);
  --modal-close-bg: #2b2b2b;
  --panel-bg: #f5f6f7;
  --panel-radius: 10px;
  --panel-pad: 18px;
  --panel-gap: 14px;
  --map-height: 260px;
  --map-tile: 256px;
  --map-backing: #e8e4dd;
  --map-zoom-bg: rgb(255 255 255 / 0.92);
  --map-zoom-ink: #1c1c1c;
  --mapbox-scrim: rgb(0 0 0 / 0.62);
  --mapbox-width: 900px;
  --mapbox-height: 74vh;
  --mapbox-radius: 10px;
  --mapbox-head: #00212b;
  --rule: #e2e4e6;

  --banner-image: url('media/Giovanni_Pauolo_2000x400.jpg');
}

/* ------------------------------------------------------------------ base -- */

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

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--text-size);
  line-height: var(--text-leading);
}

img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: inherit; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* ---------------------------------------------------------------- header -- */

/* Pinned to the top, full width, with only its contents constrained. */
.site-banner {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10;
  height: var(--banner-height);
  background-image: var(--banner-image);
  background-size: cover;
  background-position: var(--banner-position);
  background-repeat: no-repeat;
}

/* A wash over the photograph so the white logo and menu stay readable whatever
   part of the image happens to sit behind them. */
.site-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--banner-overlay);
  pointer-events: none;
}
/* The logo and menu sit above the wash. */
.site-banner .header-inner { position: relative; z-index: 1; }

/* The header container spans the full width, unlike the content below it. */
.site-banner .header-inner { max-width: none; }

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 100%;
}

.site-logo img {
  width: var(--logo-width);
  height: var(--logo-height);
  object-fit: contain;
}

.main-nav { margin-left: auto; }
.main-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-nav a {
  color: var(--card-text);
  font-size: var(--nav-size);
  font-weight: var(--nav-weight);
  text-decoration: none;
}
.main-nav a:hover,
.main-nav a[aria-current='page'] { text-decoration: underline; }

/* Mobile menu with no JavaScript: a hidden checkbox drives the panel. */
.nav-toggle { display: none; }
.nav-toggle-label { display: none; margin-left: auto; padding: 8px; cursor: pointer; }
.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
  display: block; width: 26px; height: 3px;
  background: #fff; border-radius: 2px;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.45);
}
.nav-toggle-label span { position: relative; }
.nav-toggle-label span::before,
.nav-toggle-label span::after { content: ''; position: absolute; }
.nav-toggle-label span::before { top: -8px; }
.nav-toggle-label span::after  { top: 8px; }

/* --------------------------------------------------------------- layout --- */

.site-main { padding-top: var(--banner-reserve); }

.content { display: flex; align-items: flex-start; }

.primary {
  flex: 1 1 auto;
  min-width: 0;
  max-width: var(--primary-ratio);
  padding-right: var(--column-gap);
  margin-block: var(--content-top) var(--content-bottom);
}

.sidebar {
  flex: 0 0 var(--sidebar-width);
  width: var(--sidebar-width);
  margin-block: var(--content-top) var(--content-bottom);
}

/* ------------------------------------------------------------- headings -- */

.site-heading {
  font-size: var(--h1-size);
  font-weight: var(--h1-weight);
  line-height: 1;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 32.52px;
}

/* Its own row above the two columns, so a long title still sets on one line. */
.page-header { padding-top: var(--content-top); }

.page-title {
  font-size: var(--page-title-size);
  font-weight: var(--h1-weight);
  line-height: 1;
  color: var(--page-title-color);
  text-transform: uppercase;
  text-wrap: balance;
}

/* The title row already provides the top spacing on these pages. */
.page-header + .content .primary,
.page-header + .content .sidebar { margin-top: 30px; }

.page-hero {
  margin-bottom: 26px;
  border-radius: var(--hero-radius);
  overflow: hidden;
}
.page-hero img { width: 100%; height: auto; }

/* Body copy on the hand-written pages, kept to a readable measure. */
.page-prose { max-width: var(--measure); }
.page-prose p { margin: 0 0 1.1em; }
.page-prose p:last-child { margin-bottom: 0; }
.page-prose a { color: var(--gold); }
.page-prose a:hover { color: var(--gold-deep); }

.section-heading,
.widget-title {
  font-size: var(--h2-size);
  font-weight: var(--h2-weight);
  line-height: 1;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 28px;
}
.widget-title { font-weight: var(--widget-title-weight); margin-bottom: 20px; }

/* ----------------------------------------------------------- event cards -- */

.event-list { display: flex; flex-direction: column; gap: var(--card-stack-gap); }

.event-card {
  background: var(--card-bg);
  color: var(--card-text);
  padding: var(--card-pad);
  border-radius: var(--card-radius);
}

.event-title {
  font-size: var(--card-title-size);
  font-weight: var(--card-title-weight);
  line-height: 1.2;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.event-title a { text-decoration: none; }
.event-title a:hover { text-decoration: underline; }

.event-inner { display: flex; flex-wrap: wrap; gap: var(--card-gap); }

.event-thumb {
  flex: 0 0 var(--thumb-size);
  width: var(--thumb-size);
  height: var(--thumb-size);
  border-radius: var(--thumb-radius);
  overflow: hidden;
}
/* The uploads are wide banners; crop to the square the design wants, anchored
   to the top, rather than letterboxing them. */
.event-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: var(--thumb-focus);
}

.event-date {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.1;
  text-transform: uppercase;
}
.event-date .year  { font-size: var(--card-year-size); font-weight: 700; }
.event-date .day   { font-size: var(--card-day-size); font-weight: 700; }
.event-date .month { font-size: var(--card-month-size); font-weight: 400; }

.event-info { flex: 1 1 200px; min-width: 0; }
.event-time { margin: 0; font-size: var(--card-time-size); font-weight: 400; }
.event-tz { margin-left: 5px; }

/* The sidebar runs the same card, tighter, with a smaller thumbnail. The extra
   right margin reproduces the 60px column the live layout leaves for it. */
.sidebar .event-card { padding: var(--card-pad-sidebar); }
.sidebar .event-list { margin-top: 10px; }
.sidebar .event-thumb {
  flex-basis: var(--thumb-size-sidebar);
  width: var(--thumb-size-sidebar);
  height: var(--thumb-size-sidebar);
  margin-right: var(--card-gap);
}
/* In the narrow column the time drops to its own row, as it does on the live
   site, rather than squeezing in beside the date. */
.sidebar .event-info { flex-basis: 100%; }

.show-more {
  display: inline-block;
  padding: 10px;
  min-width: 160px;
  border-radius: var(--more-radius);
  background: var(--more-bg);
  color: var(--more-text);
  font-size: var(--more-size);
  line-height: var(--more-leading);
  text-align: center;
  text-decoration: none;
}
.show-more:hover { background: var(--gold); }

/* ------------------------------------------------------------------ forms -- */

.site-form { max-width: var(--measure); margin-top: 26px; }

.field-row { display: flex; flex-wrap: wrap; gap: var(--field-gap); }
.field-row .field { flex: 1 1 200px; }

.field { display: block; margin: 0 0 var(--field-gap); }
.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 500;
}
.req { color: var(--form-required); }

.field input,
.field textarea,
.field select {
  width: 100%;
  font: inherit;
  font-size: var(--field-size);
  color: var(--field-text);
  background: var(--page-bg);
  border: 1px solid var(--field-border);
  border-radius: var(--field-radius);
  padding: var(--field-pad);
}
.field-hint { display: block; margin-top: 5px; font-size: 13px; color: var(--ink-soft); }
.field.checkbox { display: flex; align-items: center; gap: 9px; }
.field.checkbox input { width: auto; }
.field.checkbox label { margin: 0; }
.form-section { margin: 34px 0 4px; }

.field textarea {
  min-height: var(--field-textarea-height);
  border-radius: var(--field-textarea-radius);
  padding: 14px;
  resize: vertical;
}
.field input:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--form-accent);
  outline-offset: 1px;
  border-color: var(--form-accent);
}

/* A field only a bot will fill in. Kept out of the tab order and off screen
   rather than display:none, which some bots check for. */
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-submit {
  font: inherit;
  font-size: var(--form-submit-size);
  font-weight: 500;
  color: #fff;
  background: var(--form-accent);
  border: 0;
  border-radius: var(--field-radius);
  padding: 10px 18px;
  cursor: pointer;
}
.form-submit:hover { filter: brightness(1.08); }
.form-submit:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* The quieter partner to .form-submit -- the venue lookup on the events form
   uses it. It was styled only in admin.css, which no public page loads, so it
   rendered as a raw browser button. */
.ghost {
  font: inherit;
  font-size: var(--field-size);
  color: var(--form-accent);
  background: none;
  border: 1px solid var(--field-border);
  border-radius: var(--field-radius);
  padding: 9px 16px;
  cursor: pointer;
}
.ghost:hover { border-color: var(--form-accent); }
.ghost:focus-visible { outline: 2px solid var(--form-accent); outline-offset: 2px; }

/* The Submit page copies EventON's form rather than the WPForms one the
   Contact page uses: pill-shaped fields, smaller bold labels, softer borders.
   Two genuinely different looks on the live site, so two here. */
.form-evo { max-width: 760px; }

.form-evo .field label,
.form-evo .field > label {
  font-size: var(--evoform-label-size);
  font-weight: var(--evoform-label-weight);
  color: var(--evoform-label-color);
}

.form-evo .field input,
.form-evo .field textarea,
.form-evo .field select {
  font-size: var(--evoform-field-size);
  color: var(--evoform-field-text);
  border: 1px solid var(--evoform-border);
  border-radius: var(--evoform-radius);
  padding: var(--evoform-pad);
  min-height: var(--evoform-field-height);
  /* The body leading would make a 42px field 47px tall. */
  line-height: 1.2;
}
.form-evo .field textarea {
  border-radius: var(--evoform-textarea-radius);
  min-height: var(--evoform-textarea-height);
}
.form-evo .field input:focus-visible,
.form-evo .field textarea:focus-visible {
  border-color: var(--form-accent);
  outline: 2px solid var(--form-accent);
  outline-offset: 1px;
}
.form-evo .field input::placeholder,
.form-evo .field textarea::placeholder { color: #9aa0a6; }

/* Checkboxes keep a normal square box; the pill radius is for text fields. */
.form-evo .field.checkbox input {
  min-height: 0;
  border-radius: 3px;
  padding: 0;
}

.form-evo .field-hint { font-size: 12px; }

.form-evo .form-submit {
  border-radius: var(--evoform-radius);
  padding: 13px 26px;
}

.form-evo .form-section {
  font-size: 20px;
  font-weight: 700;
  text-transform: none;
  color: var(--evoform-label-color);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--evoform-border);
}

.image-preview { margin: 0 0 var(--field-gap); }
.image-preview img { max-width: 320px; border-radius: var(--evoform-textarea-radius); border: 1px solid var(--evoform-border); }

.colour-row { display: flex; align-items: center; gap: 10px; }
.colour-row input[type="color"] { width: 52px; min-height: 42px; padding: 2px; cursor: pointer; }
.colour-row input[type="text"] { width: 8em; }

.form-evo input[type="file"] { padding: 10px 12px; background: var(--page-bg); }

.venue-map { margin: 0 0 var(--field-gap); border-radius: var(--evoform-textarea-radius); overflow: hidden; border: 1px solid var(--evoform-border); }
.venue-map .staticmap { height: 240px; }

.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 4px 14px;
  max-height: 300px;
  overflow-y: auto;
  padding: 12px 14px;
  margin-bottom: var(--field-gap);
  border: 1px solid var(--evoform-border);
  border-radius: var(--evoform-textarea-radius);
}
.type-option { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.type-option input { width: auto; min-height: 0; }

.form-evo select {
  width: 100%;
  font: inherit;
  font-size: var(--evoform-field-size);
  color: var(--evoform-field-text);
  background: var(--page-bg);
  border: 1px solid var(--evoform-border);
  border-radius: var(--evoform-radius);
  padding: var(--evoform-pad);
  min-height: var(--evoform-field-height);
  line-height: 1.2;
}

/* ------------------------------------------------- calendar page (large) -- */

/* The full-width calendar. Seven equal columns; each event shows in its day as
   a small chip carrying that event's own colour. Distinct from the sidebar
   widget, which is the same idea at a much smaller size. */
/* Doubled-up class so these beat the sidebar widget's rules regardless of
   which block comes first in the file. */
.cal-daynames.cal-daynames-lg { border-radius: var(--cal-radius) var(--cal-radius) 0 0; overflow: hidden; }
.cal-daynames.cal-daynames-lg div {
  font-size: var(--calpage-dayname-size);
  font-weight: var(--calpage-dayname-weight);
  padding: 10px 0;
}

.cal-month-line.cal-month-line-lg .cal-month-title {
  font-size: var(--calpage-month-size);
}

.cal-days-lg {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-radius: 0 0 var(--cal-radius) var(--cal-radius);
  overflow: hidden;
}

.calday {
  margin: 0;
  min-height: var(--calpage-cell);
  padding: var(--calpage-cell-pad);
  background: var(--cal-day-bg);
  color: var(--cal-day-text);
  font-size: var(--calpage-day-size);
  font-weight: var(--calpage-day-weight);
  line-height: 1.2;
  border: 1px solid var(--cal-hairline);
  border-width: 0 1px 1px 0;
}
.calday.empty { background: var(--cal-day-bg); }
.calday.has-events { min-height: var(--calpage-cell-events); }
.calday-num { display: block; }

.calday-events { display: flex; flex-direction: column; gap: 3px; margin-top: 5px; }
.calday-event {
  display: block;
  background: var(--card-bg);
  color: var(--card-text);
  font-size: var(--calpage-chip-size);
  line-height: 1.5;
  padding: 1px 5px;
  border-radius: var(--calpage-chip-radius);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calday-event:hover { filter: brightness(1.12); }

.cal-month-list { margin-top: 30px; }

/* "Jump Months" opens a panel of every month that has something on — a
   <details>, so it needs no script. */
.cal-jump { position: relative; }
.cal-jump > summary { list-style: none; cursor: pointer; }
.cal-jump > summary::-webkit-details-marker { display: none; }
.cal-jump-panel {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  width: max(320px, 34vw);
  max-height: 60vh;
  overflow-y: auto;
  padding: 12px 14px;
  background: var(--page-bg);
  border: 1px solid var(--rule);
  border-radius: var(--cal-radius);
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.15);
}
.cal-jump-year {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  padding: 3px 0;
}
.cal-jump-label {
  width: 3.2em;
  font-weight: 800;
  font-size: 13px;
  color: var(--ink-soft);
}
.cal-jump-year a {
  padding: 2px 7px;
  font-size: 12px;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 4px;
  color: var(--ink-soft);
}
.cal-jump-year a:hover,
.cal-jump-year a[aria-current='page'] { background: var(--gold); color: #fff; }

@media (max-width: 700px) {
  /* Seven columns stop being readable; show the days that have something on
     as a list instead, which is what a phone visitor actually wants. */
  .cal-daynames.cal-daynames-lg { display: none; }
  .cal-days-lg { grid-template-columns: 1fr; border-radius: var(--cal-radius); }
  .calday { border-width: 0 0 1px; min-height: 0; }
  .calday.empty, .calday:not(.has-events) { display: none; }
  /* With the weekday header gone, each row has to name its own date. */
  .calday .calday-num { font-weight: 700; color: var(--ink-soft); }
  .calday .calday-num::before { content: attr(data-label) ' '; }
  .calday-event { white-space: normal; font-size: 13px; }
  .cal-jump-panel { width: min(90vw, 320px); }
}

/* ----------------------------------------------------------- event tiles -- */

/* Past Events uses a different card entirely: a grid of tall tiles with the
   image filling the tile and the text over it, rather than the home page's
   horizontal rows. Three across, dropping to two then one. */
.event-tiles {
  display: grid;
  grid-template-columns: repeat(var(--tile-columns), minmax(0, 1fr));
}
.event-tile { padding: var(--tile-inset); }

.tile-inner {
  position: relative;
  display: block;
  height: var(--tile-height);
  border-radius: var(--tile-radius);
  overflow: hidden;
  background: var(--card-bg);
  color: var(--card-text);
  text-decoration: none;
}
/* The photo is shown whole rather than cropped: a blurred, enlarged copy fills
   the tile behind it, so the surround is drawn from the picture's own colours
   and nothing is cut off. */
.tile-photo { position: absolute; inset: 0; }
.tile-photo img { position: absolute; inset: 0; width: 100%; height: 100%; }

.tile-photo-back {
  object-fit: cover;
  filter: blur(var(--tile-blur)) saturate(1.15);
  transform: scale(1.2);
  opacity: var(--tile-back-opacity);
}
.tile-photo-front { object-fit: contain; }

/* White text over a photograph needs some help; the live tiles rely on the
   images happening to be dark. Set --tile-scrim to transparent to drop it. */
.tile-inner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--tile-scrim);
}

.tile-body {
  position: relative;
  z-index: 2;
  height: 100%;
  padding: var(--card-pad);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
}
.tile-title {
  font-size: var(--card-title-size);
  font-weight: var(--card-title-weight);
  line-height: 1.2;
  text-transform: uppercase;
  text-wrap: balance;
}
.tile-meta {
  display: flex;
  align-items: flex-start;
  gap: var(--card-gap);
  padding-left: 10px;
}
.tile-inner:hover .tile-photo-front { transform: scale(1.03); }
.tile-photo-front { transition: transform 0.4s ease; }
@media (prefers-reduced-motion: reduce) {
  .tile-photo-front { transition: none; }
}

@media (max-width: 900px) { :root { --tile-columns: 2; } }
@media (max-width: 560px) { :root { --tile-columns: 1; } }

/* A full-width column, for pages with no sidebar. */
.primary.wide { max-width: none; padding-right: 0; }

.year-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 22px;
}
.year-jump a {
  padding: 4px 11px;
  border-radius: var(--more-radius);
  background: var(--btn-bg);
  color: var(--btn-text);
  font-size: 12px;
  text-decoration: none;
}
.year-jump a:hover,
.year-jump a[aria-current='page'] { background: var(--gold); }

.pager {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}
.pager-note { text-align: center; margin-top: 14px; color: var(--ink-soft); font-size: 14px; }

/* ------------------------------------------------------ expanded details -- */

/* The whole card is clickable, with the title still a real link on top. */
.event-card { position: relative; }
.card-hit { position: absolute; inset: 0; z-index: 1; }
.event-card > :not(.card-hit) { position: relative; z-index: 2; pointer-events: none; }
.event-card a:not(.card-hit) { pointer-events: auto; }
.event-card:hover { background: var(--card-bg-hover); }

/* Opened by :target — the URL carries which panel is showing, so Back closes
   it and a link to an open panel can be shared. */
.event-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  padding: var(--modal-inset);
  place-items: center;
}
.event-modal:target { display: grid; }

/* Freeze the page behind the panel without a line of script. */
body:has(.event-modal:target) { overflow: hidden; }

.modal-scrim {
  position: absolute;
  inset: 0;
  background: var(--modal-scrim);
}

.modal-panel {
  position: relative;
  width: min(var(--modal-width), 100%);
  max-height: calc(100vh - var(--modal-inset) * 2);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: var(--modal-radius);
  background: var(--page-bg);
  box-shadow: 0 20px 60px rgb(0 0 0 / 0.35);
}

.modal-head {
  position: relative;
  padding: var(--card-pad);
  background: var(--card-bg);
  color: var(--card-text);
}
.modal-title {
  font-size: var(--card-title-size);
  font-weight: var(--card-title-weight);
  line-height: 1.2;
  text-transform: uppercase;
  margin-bottom: 10px;
  padding-right: 50px;
}

.modal-close {
  position: absolute;
  top: var(--card-pad);
  right: var(--card-pad);
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--modal-close-bg);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  text-decoration: none;
}
.modal-close:hover { background: var(--gold); }

.modal-body {
  display: flex;
  flex-direction: column;
  gap: var(--panel-gap);
  padding: var(--panel-gap);
}

.panel-row {
  display: grid;
  gap: var(--panel-gap);
  grid-template-columns: 1fr;
}
@media (min-width: 700px) {
  .panel-row { grid-template-columns: 1fr 1fr; }
}

.panel {
  background: var(--panel-bg);
  border-radius: var(--panel-radius);
  padding: var(--panel-pad);
  color: var(--ink);
}
.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
.panel-icon { width: 20px; height: 20px; flex: none; color: var(--ink-soft); }
.panel p { margin: 0 0 0.75em; }
.panel p:last-child { margin-bottom: 0; }
.panel-prose { font-size: 15px; }

.panel-figure { padding: 0; overflow: hidden; display: grid; }
.panel-figure img { width: 100%; height: 100%; object-fit: cover; }

.venue-name { font-weight: 700; }
.venue-address { color: var(--ink-soft); }

.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--page-bg);
  border: 1px solid var(--rule, #ddd);
  font-size: 13px;
  text-decoration: none;
}
.pill:hover { background: var(--gold); color: #fff; border-color: var(--gold); }

/* The map is a grid of OpenStreetMap tiles, mirrored onto our own domain and
   composited by the browser — no API key, no billing, no iframe, and nothing
   third-party that can fail at page load. The plane is offset so the venue
   sits dead centre, behind the pin. */
.panel-map { padding: 0; overflow: hidden; }

.staticmap {
  position: relative;
  height: var(--map-height);
  overflow: hidden;
  background: var(--map-backing);
}
.staticmap-plane {
  position: absolute;
  display: grid;
  grid-template-columns: repeat(3, var(--map-tile));
  width: calc(var(--map-tile) * 3);
  line-height: 0;
}
.staticmap-plane img { display: block; width: var(--map-tile); height: var(--map-tile); }

.staticmap-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 1px 6px rgb(0 0 0 / 0.45);
}

.staticmap-label,
.staticmap-credit {
  position: absolute;
  bottom: 0;
  font-size: 11px;
  padding: 3px 8px;
  background: rgb(255 255 255 / 0.88);
}
.staticmap-label { left: 0; border-radius: 0 var(--panel-radius) 0 0; font-weight: 700; }
.staticmap-credit {
  right: 0;
  border-radius: var(--panel-radius) 0 0 0;
  color: var(--ink-soft);
  text-decoration: none;
}

/* With no key there is no Google frame, so the whole tile map is the link.
   It sits under the credit so that stays clickable on its own -- the credit is
   a condition of using the tiles. */
.staticmap-open {
  position: absolute;
  inset: 0;
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: zoom-in;
}
.staticmap-credit { z-index: 1; }

/* Google's map, laid over the tiles.

   The tiles stay underneath rather than being replaced. They come from our own
   domain and need no script, so a map is on the page immediately and stays
   there if the frame is blocked or never arrives. Once Google's map paints it
   covers them and takes the interaction -- it pans and zooms in place. */
.staticmap-live {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  z-index: 1;
}

/* Google draws its own marker, name and attribution inside the frame, so ours
   would only be duplicates sitting on top of its controls. */
.staticmap.has-live .staticmap-pin,
.staticmap.has-live .staticmap-label,
.staticmap.has-live .staticmap-credit { display: none; }

/* The frame swallows clicks, so the way to a bigger map has to sit above it
   and be only as large as itself. */
.staticmap.has-live .staticmap-open {
  inset: 8px 8px auto auto;
  z-index: 2;
  cursor: pointer;
}
.staticmap.has-live .staticmap-zoom { position: static; display: block; }

.staticmap-zoom {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--map-zoom-bg);
  color: var(--map-zoom-ink);
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.28);
}
.staticmap-open:hover .staticmap-zoom,
.staticmap-open:focus-visible .staticmap-zoom { background: #fff; }
.staticmap-open:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }

/* ------------------------------------------------------- the larger map -- */

/* Opened by the one script the site ships. The iframe has no src until it is
   opened, so no request reaches Google until somebody asks for a map. */
.mapbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
}
.mapbox[hidden] { display: none; }
.mapbox-scrim { position: absolute; inset: 0; background: var(--mapbox-scrim); }

.mapbox-frame {
  position: relative;
  width: min(var(--mapbox-width), 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: var(--mapbox-radius);
  overflow: hidden;
  background: #fff;
  box-shadow: 0 18px 50px rgb(0 0 0 / 0.4);
}

.mapbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 12px 8px 12px 16px;
  background: var(--mapbox-head);
  color: #fff;
  font-weight: 700;
}
.mapbox-close {
  flex: none;
  width: 34px;
  height: 34px;
  font-size: 24px;
  line-height: 1;
  border: 0;
  border-radius: 50%;
  background: none;
  color: inherit;
  cursor: pointer;
}
.mapbox-close:hover { background: rgb(255 255 255 / 0.18); }

.mapbox-map {
  display: block;
  width: 100%;
  height: var(--mapbox-height);
  border: 0;
}

.mapbox-foot { margin: 0; padding: 10px 16px; font-size: 14px; }

/* The page behind must not scroll while the map is over it. */
.mapbox-open, .mapbox-open body { overflow: hidden; }

@media (max-width: 640px) {
  .mapbox { padding: 0; }
  .mapbox-frame { width: 100%; height: 100%; max-height: 100%; border-radius: 0; }
  .mapbox-map { height: 100%; flex: 1; }
}

/* --------------------------------------------------------- calendar box -- */

.cal-buttons { display: flex; flex-wrap: wrap; }
.cal-button {
  font-size: 12px;
  line-height: 25px;
  padding-inline: 10px;
  margin: 0 4px 5px 0;
  border-radius: var(--cal-radius);
  background: var(--btn-bg);
  color: var(--btn-text);
  text-transform: uppercase;
  text-decoration: none;
}
.cal-button:hover { background: var(--gold); }

.cal-month-line { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.cal-month-title {
  font-size: var(--month-title-size);
  font-weight: var(--month-title-weight);
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-right: 10px;
}
.cal-arrows { display: flex; gap: 6px; margin-left: auto; }
.cal-arrows a {
  width: 25px; height: 25px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--btn-bg);
  color: var(--btn-text);
  font-size: 12px;
  text-decoration: none;
}
.cal-arrows a:hover { background: var(--gold); }

.cal-daynames, .cal-days { display: grid; grid-template-columns: repeat(7, 1fr); }

.cal-daynames div {
  background: var(--cal-dayname-bg);
  color: var(--cal-dayname-text);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
  padding: 10px 0;
}
.cal-daynames div:first-child { border-radius: var(--cal-radius) 0 0 0; }
.cal-daynames div:last-child  { border-radius: 0 var(--cal-radius) 0 0; }

.cal-days > * {
  min-height: var(--cal-cell-height);
  padding: 10px 0;
  background: var(--cal-day-bg);
  color: var(--cal-day-text);
  font-size: var(--cal-day-size);
  font-weight: 700;
  text-align: center;
  line-height: 1.5;
}

/* A day with something on gets the accent colour and grows, as on the live
   calendar where the event title appears inside the cell. */
.cal-days a.has-events {
  min-height: var(--cal-cell-height-events);
  color: var(--cal-accent);
  text-decoration: none;
}
.cal-days a.has-events::after {
  content: '';
  display: block;
  width: 6px; height: 6px;
  margin: 4px auto 0;
  border-radius: 50%;
  background: var(--cal-accent);
}
.cal-days a.has-events:hover { background: var(--cal-dayname-bg); }

/* ---------------------------------------------------------------- footer -- */

.site-footer { background: var(--gold-deep); color: #fff; }
.site-footer .container { padding-block: 25px; }
.site-footer p { margin: 0; font-size: var(--footer-size); text-align: center; }
.site-footer a { color: #fff; }

/* ------------------------------------------------------------ responsive -- */

@media (max-width: 900px) {
  /* The sidebar drops below the listings, as the live site does. */
  .content { flex-direction: column; }
  .primary {
    max-width: 100%;
    padding-right: 0;
    margin-bottom: 30px;
  }
  .sidebar { flex: 1 1 auto; width: 100%; margin-top: 0; }
}

@media (max-width: 782px) {
  :root { --container-pad: var(--container-pad-mobile); }

  .site-heading { font-size: var(--h1-size-mobile); }
  .page-title { font-size: var(--page-title-size-mobile); }
  .section-heading, .widget-title { font-size: var(--h2-size-mobile); }

  .nav-toggle-label { display: block; }
  .main-nav {
    flex-basis: 100%;
    margin-left: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .nav-toggle:checked ~ .main-nav { max-height: 60vh; }
  .main-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0 20px;
  }
  /* Once the menu can open, the banner has to grow with it. Relative, not
     static: the wash is an absolutely positioned ::after, so without a
     positioned banner to sit in it escapes and sizes itself to the viewport,
     dropping a dark film over the top screenful of the page. */
  .site-banner { position: relative; height: auto; }
  .site-main { padding-top: 0; }
  .header-inner { flex-wrap: wrap; height: auto; min-height: var(--banner-height); }
}

@media (prefers-reduced-motion: reduce) {
  .main-nav { transition: none; }
}

@media print {
  .main-nav, .nav-toggle-label, .sidebar, .show-more { display: none; }
  .site-banner { position: static; background: none; }
  .site-main { padding-top: 0; }
  .event-card { border: 1px solid #999; break-inside: avoid; }
}
