:root {
  --color-paper: #f8f1e7;
  --color-surface: #fffaf3;
  --color-ink: #352922;
  --color-muted: #74655b;
  --color-clay: #b65c45;
  --color-clay-dark: #914632;
  --color-leaf: #49735b;
  --color-line: #e7d8ca;
  --color-warning: #8a5b27;
  --shadow: 0 16px 40px rgba(75, 49, 35, .1);
  --radius: 24px;
  --max-width: 1120px;
  font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--color-ink);
  background: var(--color-paper);
  line-height: 1.6;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  overflow-x: clip;
  background: radial-gradient(circle at 85% 5%, #f8eadf 0, transparent 24rem), var(--color-paper);
}
a { color: inherit; }
button, input { font: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }

.skip-link {
  position: fixed;
  z-index: 10;
  top: -5rem;
  left: 1rem;
  padding: .75rem 1rem;
  color: var(--color-ink);
  background: #fff;
  border-radius: 8px;
}
.skip-link:focus { top: 1rem; }

.site-header,
main {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
}
.brand-logo {
  display: block;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  object-fit: contain;
  border-radius: 50%;
  background: transparent;
}
.brand strong,
.brand small { display: block; }
.brand small { color: var(--color-muted); font-size: .78rem; }
.language-control,
.location-view-switch {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.language-button,
.location-view-switch .button {
  min-height: 44px;
  padding: .5rem .85rem;
  color: var(--color-ink);
  background: transparent;
  border: 1px solid var(--color-line);
  border-radius: 999px;
}
.language-button[aria-pressed="true"],
.location-view-switch .button[aria-pressed="true"] {
  color: #fff;
  background: var(--color-leaf);
  border-color: var(--color-leaf);
}

.status-banner {
  width: min(100% - 2rem, var(--max-width));
  margin: 0 auto 1rem;
  padding: .85rem 1rem;
  color: var(--color-leaf);
  background: #edf4ef;
  border: 1px solid #cfe0d3;
  border-radius: 14px;
}
.status-banner-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: #7b3325;
  background: #fff0eb;
  border-color: #e8bdaf;
}
.status-banner[hidden] { display: none; }

main { padding-bottom: 5rem; }
section {
  padding: 3.75rem 0;
  border-top: 1px solid var(--color-line);
}
#next-event {
  min-height: 17rem;
  padding-top: 4rem;
  border-top: 0;
}
h1,
h2,
h3 {
  font-family: Georgia, "Songti SC", "STSong", serif;
  line-height: 1.15;
}
h1 {
  max-width: 12ch;
  margin: .35rem 0 1rem;
  font-size: clamp(2.8rem, 7vw, 5.8rem);
  font-weight: 600;
}
h2 { margin: .35rem 0 1rem; font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 600; }
h3 { margin: .2rem 0 .65rem; font-size: clamp(1.25rem, 2.8vw, 1.8rem); }
.eyebrow {
  margin: 0 0 .45rem;
  color: var(--color-leaf);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.section-heading { margin-bottom: 1.5rem; }
.next-event-content,
#event-detail-content,
.location-card,
.location-empty-state {
  padding: 1.35rem 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(75, 49, 35, .06);
}
.location-list,
.map-panel {
  padding: 1.35rem 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(75, 49, 35, .06);
}
.next-event-content:empty,
#event-detail-content:empty { display: none; }
#event-detail[hidden] { display: none; }
.event-summary,
.event-detail-card {
  position: relative;
  overflow: hidden;
  padding-inline-start: 2rem;
}
.event-summary::before,
.event-detail-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  content: "";
  background: var(--color-leaf);
}
.event-summary.cancelled::before,
.event-detail-card.cancelled::before { background: var(--color-clay); }
.event-summary h3,
.event-detail-card h3 { margin-top: 0; }
.event-meta,
.event-note { margin: .55rem 0; }
.event-identity {
  display: block;
  min-width: 0;
  font-size: clamp(1.15rem, 2.3vw, 1.55rem);
  font-weight: 850;
  line-height: 1.35;
  overflow-wrap: normal;
  word-break: keep-all;
}
.event-note,
.location-address,
.location-upcoming,
.map-panel p { color: var(--color-muted); }
.status {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: .15rem .65rem;
  color: var(--color-leaf);
  background: #edf4ef;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 800;
}
.status.cancelled { color: #8b3f30; background: #fff0eb; }
.status.ended_today { color: var(--color-warning); background: #fbf0dc; }
.status.no_schedule { color: var(--color-muted); background: #f1ebe5; }
.inline-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }
.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: .7rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
}
.button.primary { color: #fff; background: var(--color-clay); }
.button.primary:hover { background: var(--color-clay-dark); }
.button.secondary { color: var(--color-ink); background: var(--color-surface); border-color: var(--color-line); }
.button:disabled { cursor: not-allowed; opacity: .55; }


/* Compact month, using the homepage preview dimensions and palette. */
.calendar-scroll{padding:1rem;margin:0;border:1px solid var(--color-line);border-radius:18px;background:var(--color-surface);box-shadow:0 8px 28px rgba(75,49,35,.06);min-width:0}
.calendar-scroll-hint{display:none}
.calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:.25rem;width:100%;min-width:0}
.calendar-cell{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;width:100%;min-width:0;min-height:3.4rem;gap:.12rem;padding:.25rem .14rem;color:var(--color-ink);background:#fffdf9;border:1px solid var(--color-line);border-radius:8px;text-align:center;font:inherit}
.calendar-column-header{padding:.2rem 0;color:var(--color-muted);font-size:.7rem;font-weight:850;text-align:center}
.cell-date{font-size:1rem;font-weight:700;line-height:1.2}
.cell-empty-label,.cell-identity{min-width:0;border:0;text-align:center;overflow-wrap:break-word;word-break:normal;white-space:normal;display:-webkit-box;max-width:100%;overflow:hidden;font-size:.6rem;font-weight:750;line-height:1.2;-webkit-box-orient:vertical;-webkit-line-clamp:3}
.calendar-cell-unpublished{border-style:dashed}
.cell-empty-label{color:var(--color-muted);font-weight:400}
.calendar-cell-unpublished .cell-identity{color:var(--color-muted);font-weight:400}
.calendar-cell-empty{visibility:hidden;pointer-events:none}
.calendar-cell[aria-current="date"],.calendar-cell[aria-selected="true"]{background:#f0f5ed;border-color:var(--color-leaf)}
.calendar-cell[aria-selected="true"]{box-shadow:inset 0 0 0 1px var(--color-leaf)}
.cell-status,.calendar-legend{display:none}
@media(min-width:761px){.calendar-scroll{padding:1.25rem}.calendar-grid{gap:.4rem}.calendar-column-header{font-size:.85rem}.calendar-cell{min-height:5.25rem;padding:.6rem .35rem;gap:.3rem}.cell-date{font-size:1.4rem}.cell-empty-label,.cell-identity{font-size:.875rem;line-height:1.3}}
.schedule-caveat { max-width: 48rem; margin: 1rem 0 0; color: var(--color-muted); font-size: .92rem; }
.alert-list { display: grid; gap: .7rem; }
.schedule-alert {
  padding: 1rem 1.15rem;
  color: #6d4520;
  background: #fff3dc;
  border: 1px solid #e7cf9e;
  border-radius: 14px;
}
.schedule-alert button { margin-top: .65rem; }

.location-context { margin-top: -.5rem; color: var(--color-muted); font-size: clamp(1.15rem, 2.2vw, 1.5rem); line-height: 1.4; }
.location-context-value { display: inline-block; overflow-wrap: normal; word-break: keep-all; }
.location-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1rem;
  margin: 1.25rem 0;
}
.location-tools-note { margin: -.5rem 0 1rem; color: var(--color-muted); font-size: .9rem; }
.location-tools form { min-width: 0; }
label { display: block; margin-bottom: .4rem; font-weight: 800; }
.postcode-row { display: flex; gap: .6rem; }
input {
  width: min(100%, 14rem);
  min-height: 44px;
  padding: .65rem .8rem;
  color: var(--color-ink);
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: 10px;
}
.field-feedback { min-height: 1.5rem; margin: .45rem 0 0; color: var(--color-muted); font-size: .9rem; }
.field-feedback.error { color: #8b3f30; }
.field-feedback.success { color: var(--color-leaf); }
.location-view-switch { margin: 1rem 0; }
#location-view-switch[hidden] { display: none; }
#location-section[hidden] { display: none; }
.location-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.location-list { display: grid; gap: .8rem; min-width: 0; }
.location-card { min-width: 0; }
.location-empty-state { min-width: 0; }
.location-list > .location-empty-state {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.location-empty-state h3 { margin-top: 0; }
.location-empty-state p { margin: .55rem 0; color: var(--color-muted); }
.location-card {
  position: relative;
  -webkit-tap-highlight-color: transparent;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background-color .18s ease;
}
.location-select::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); cursor: pointer; }
.location-future button,
.location-links a,
.location-links button,
.copy-address-feedback { position: relative; z-index: 1; }
.location-card:has(.location-select:focus-visible) { outline: 3px solid #2d6f91; outline-offset: 3px; }
@supports selector(.location-card:has(.location-select)) {
  .location-card .location-select:focus-visible { outline: none; }
}
.location-card[aria-current="true"] { border-color: var(--color-leaf); background: #f0f5ed; box-shadow: 0 0 0 1px var(--color-leaf); }
.location-card:has(.location-select:active) { transform: scale(.99); background: #e4edde; border-color: var(--color-leaf); box-shadow: 0 0 0 1px var(--color-leaf); }
.location-card h3 { margin-top: 0; }
.location-name,
.location-identity {
  color: var(--color-ink);
  font-size: clamp(1.25rem, 2.3vw, 1.6rem);
  font-weight: 850;
  line-height: 1.3;
  overflow-wrap: normal;
  word-break: keep-all;
}
.location-card p { margin: .45rem 0; }
.location-future { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .8rem; }
.future-date {
  min-height: 44px;
  padding: .45rem .65rem;
  color: var(--color-leaf);
  background: #edf4ef;
  border: 1px solid #cfe0d3;
  border-radius: 10px;
  font-size: .85rem;
  font-weight: 800;
}
.location-links { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: .85rem; }
.location-links a,
.copy-address,
.text-button,
.location-select {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: .55rem .75rem;
}
.location-links a { color: var(--color-clay-dark); font-weight: 800; }
.text-button {
  color: var(--color-clay-dark);
  background: transparent;
  border: 1px solid var(--color-line);
  border-radius: 10px;
  font-weight: 800;
}
.location-select {
  width: 100%;
  justify-content: flex-start;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 10px;
  font-family: inherit;
  font-size: inherit;
  font-weight: 850;
  text-align: left;
  white-space: normal;
  overflow-wrap: normal;
  word-break: keep-all;
}
.map-panel { min-height: 18rem; }
.map-panel h3 { margin-top: 0; }
.real-map-status { min-height: 1.4em; margin: .4rem 0; color: var(--color-muted); }
.real-map-retry { margin: .25rem 0 .65rem; }
.real-map-retry[hidden], .real-map-point-list[hidden] { display: none !important; }
.real-map-canvas { min-height: 20rem; height: clamp(18rem, 42vh, 30rem); overflow: hidden; border: 1px solid var(--color-line); border-radius: 16px; background: #e8efe8; }
.real-map-canvas .leaflet-container { width: 100%; height: 100%; font: inherit; background: #e8efe8; }
.real-map-attribution-logo { width: 16px; height: 16px; vertical-align: text-bottom; }
.real-map-point-list { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .65rem; max-height: 8rem; overflow-y: auto; flex-shrink: 0; padding-right: .25rem; }
.real-map-point-choice { min-height: 40px; padding: .45rem .65rem; color: var(--color-leaf); font-weight: 800; }
.real-map-point-choice[aria-pressed="true"] { color: white; background: var(--color-leaf); border-color: var(--color-leaf); }
.point-diagram { position: relative; height: clamp(12rem, 25vh, 18rem); margin: 1rem 0; border: 1px solid var(--color-line); border-radius: 16px; background: var(--color-paper); }
.map-point { position: absolute; transform: translate(-50%, -50%); min-width: 44px; min-height: 44px; padding: .4rem; border-radius: 50%; border: 1px solid var(--color-leaf); background: var(--color-paper); color: var(--color-leaf); font-weight: 800; }
.map-point[aria-pressed="true"] { background: var(--color-leaf); color: white; box-shadow: 0 0 0 3px var(--color-paper), 0 0 0 4px var(--color-leaf); }
.map-selection { font-weight: 800; overflow-wrap: break-word; }
.copy-address { color: var(--color-clay-dark); border: 1px solid var(--color-line); background: transparent; border-radius: 10px; font-weight: 800; }
.copy-address-feedback { user-select: text; overflow-wrap: break-word; }
.copy-address-feedback:empty { display: none; }
#map-panel[hidden] { display: none; }
.location-layout.map-active .location-list { display: none; }
.location-layout.map-active .map-panel { display: block; }
.return-link {
  min-height: 44px;
  padding: .55rem 0;
  color: var(--color-clay-dark);
  background: transparent;
  border: 0;
  font-weight: 800;
  text-align: left;
}

.visit-return-actions{display:flex;flex-wrap:wrap;gap:.25rem 1.5rem;margin-bottom:1rem}
.location-return-actions{position:relative;z-index:1;display:flex;flex-wrap:wrap;gap:.25rem 1rem;border-top:1px solid var(--color-line);margin-top:.75rem;padding-top:.4rem}
.origin-tools{margin:1.5rem 0;padding:1.5rem 0;border-top:1px solid var(--color-line)}
.origin-tools h3{font-size:1.15rem;margin:0;color:var(--color-muted)}
.location-event-summary{margin:.8rem 0;padding:.75rem 0;border-block:1px solid var(--color-line)}
.location-card[tabindex="-1"]:focus-visible{outline:3px solid #2d6f91;outline-offset:3px}

@media (min-width: 761px) {
  .location-layout { --location-layout-height: clamp(30rem, 62vh, 42rem); }
  .location-list,
  .map-panel { height: var(--location-layout-height); }
  .location-list {
    overflow-y: auto;
    align-content: start;
  }
  .map-panel,
  .location-layout.map-active .map-panel { display: flex; flex-direction: column; overflow: hidden; }
  .map-panel h3 { margin-bottom: .65rem; }
  .map-panel p { margin: .4rem 0; }
  .map-panel .point-diagram { flex: 1 1 auto; min-height: 8rem; margin: .65rem 0; }
  .map-panel .real-map-canvas { flex: 1 1 auto; min-height: 16rem; height: auto; }
}

:focus-visible { outline: 3px solid #2d6f91; outline-offset: 3px; }
@media (hover: hover) {
  .calendar-cell:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
  .calendar-cell { transition: transform .18s ease, box-shadow .18s ease; }
  .location-card:hover { transform: translateY(-3px); border-color: var(--color-leaf); box-shadow: 0 0 0 1px var(--color-leaf), 0 12px 28px rgba(73, 115, 91, .15); }
  .location-card:has(.location-select:active) { transform: scale(.99); }
}
@media (max-width: 760px) {
  .site-header { align-items: flex-start; }
  .brand small { max-width: 14rem; }
  .location-view-switch { display: flex; }
  .location-tools { grid-template-columns: 1fr; }
  .location-layout { grid-template-columns: 1fr; }
  .location-layout:not(.map-active) .location-list { display: grid; }
  .location-layout:not(.map-active) .map-panel { display: none; }
  .location-layout.map-active { grid-template-columns: 1fr; }
  .location-layout.map-active .map-panel { display: block; }
  .location-list,
  .map-panel {
    height: auto;
    overflow: visible;
  }
  .real-map-canvas { height: 22rem; min-height: 18rem; }
  .calendar-scroll-hint { display:none; }
}
@media (max-width: 480px) {
  .site-header,
  main,
  .status-banner { width: min(100% - 1rem, var(--max-width)); }
  section { padding: 3rem 0; }
  #next-event { padding-top: 3rem; }
  .next-event-content,
  #event-detail-content,
  .location-list,
  .map-panel,
  .location-card { padding: 1rem; border-radius: 18px; }
  .postcode-row { align-items: stretch; flex-direction: column; }
  input { width: 100%; }
  .status-banner-error { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .calendar-cell:hover,
  .location-card:hover,
  .location-card:has(.location-select:active) { transform: none; }
}
/* Keep the two alternative origin methods together and compact the location cards. */
.location-tools{display:block}
.postcode-row{display:flex;align-items:center;flex-wrap:wrap}
.postcode-row .button{min-height:46px;white-space:normal;align-self:stretch}
.location-choice-or{color:var(--color-muted)}
.location-list-hint{font-size:.9rem;color:var(--color-muted);margin:0 0 .75rem}
.location-list .location-card{padding:1rem;}
.location-card .location-name{font-size:1.15rem;margin:0 0 .4rem;line-height:1.35}
.location-card .location-future{display:flex;gap:.4rem;flex-wrap:wrap;margin:0 0 .55rem}
.location-card .location-future button{min-height:36px;padding:.35rem .6rem}
.location-card .location-event-summary{display:flex;align-items:center;flex-wrap:wrap;gap:.35rem .6rem;padding:.3rem 0;margin:.35rem 0;border:0}
.location-card .location-event-summary p{margin:0}
.location-card .location-verification{font-size:.8rem;color:var(--color-muted)}
.location-card .location-return-actions{margin-top:.5rem;padding-top:.25rem}
.location-card .location-links{margin-top:.5rem}
@media(max-width:600px){.postcode-row{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:.5rem}.postcode-row input{grid-column:1/-1;width:100%}.postcode-row .button{padding:.65rem .5rem;font-size:.9rem}.location-choice-or{text-align:center}}
#clear-origin[hidden] { display: none !important; }

/* The public calendar shows one complete month at a time. */
.calendar-heading-row{display:flex;align-items:end;justify-content:space-between;gap:1rem}
.calendar-month-controls{display:flex;align-items:center;gap:.45rem;margin-bottom:.7rem;color:var(--color-ink);font-weight:700;font-size:.875rem}
.calendar-month-controls button{width:42px;min-height:42px;padding:0;color:var(--color-ink);background:var(--color-surface);border:1px solid var(--color-line);border-radius:10px;font:inherit;font-weight:850}
.calendar-month-controls button:disabled{cursor:not-allowed;opacity:.4}
#calendar-month-label{order:-1;margin-right:auto;text-align:left}
@media(max-width:760px){.real-map-point-list{max-height:none;overflow:visible}}
