/* Astons Village Hall - shared stylesheet
   Design tokens up top; change colours/fonts here and every page follows. */

/* ---------- Design tokens ---------- */
:root {
  --cream: #faf6ee;
  --cream-deep: #f3ecdd;
  --ink: #2e2a23;
  --ink-soft: #5b544a;
  --sage: #6b7d5e;
  --sage-deep: #4f6144;
  --terracotta: #b5643c;
  --line: #e2d9c6;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Source Sans 3", system-ui, sans-serif;
  --radius: 14px;
  --shadow: 0 10px 30px rgb(46 42 35 / 0.10);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; margin: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; text-wrap: balance; }
h2 { font-size: clamp(1.8rem, 1.4rem + 1.6vw, 2.6rem); margin-bottom: 0.75rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.35rem; }
p  { max-width: 62ch; }
img { max-width: 100%; display: block; }

a { color: var(--sage-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--terracotta); }

.wrap { width: min(1100px, 92%); margin-inline: auto; }

section { padding-block: clamp(3.5rem, 8vw, 6rem); }

.kicker {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--terracotta);
  display: block;
  margin-bottom: 0.6rem;
}

/* ---------- Header / nav ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--cream) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.9rem;
}

.brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ink);
  text-decoration: none;
}

.nav ul {
  display: flex;
  gap: 1.15rem;
  list-style: none;
  padding: 0;
}

.nav ul a { text-decoration: none; font-weight: 600; font-size: 0.95rem; color: var(--ink-soft); }
.nav ul a:hover { color: var(--terracotta); }
.nav ul a[aria-current="page"] { color: var(--terracotta); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  font: inherit;
  cursor: pointer;
}

@media (max-width: 1000px) {
  .nav-toggle { display: block; }
  .nav ul {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav ul.open { display: flex; }
  .nav ul li { border-top: 1px solid var(--line); }
  .nav ul a { display: block; padding: 0.9rem 4%; }
}

/* ---------- Hero (homepage) ---------- */
.hero {
  position: relative;
  min-height: min(88vh, 720px);
  display: grid;
  place-items: center;
  text-align: center;
  color: #fff;
  padding-block: 6rem;
  isolation: isolate;
}

.hero img.bg,
.page-hero img.bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

.hero::after,
.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgb(30 26 20 / 0.35), rgb(30 26 20 / 0.6));
  z-index: -1;
}

.hero h1 {
  font-size: clamp(2.4rem, 1.6rem + 4vw, 4.2rem);
  font-weight: 700;
  text-shadow: 0 2px 18px rgb(0 0 0 / 0.35);
}

.hero p {
  margin: 1rem auto 2rem;
  font-size: clamp(1.05rem, 1rem + 0.5vw, 1.3rem);
  max-width: 34ch;
  text-shadow: 0 1px 10px rgb(0 0 0 / 0.4);
}

/* ---------- Page hero (sub-pages) ---------- */
.page-hero {
  position: relative;
  min-height: 320px;
  display: grid;
  place-items: center;
  text-align: center;
  color: #fff;
  padding-block: 5rem 3.5rem;
  isolation: isolate;
}

.page-hero h1 {
  font-size: clamp(2rem, 1.4rem + 3vw, 3.2rem);
  font-weight: 700;
  text-shadow: 0 2px 18px rgb(0 0 0 / 0.35);
}

.page-hero p {
  margin: 0.8rem auto 0;
  font-size: clamp(1rem, 0.95rem + 0.4vw, 1.2rem);
  max-width: 44ch;
  text-shadow: 0 1px 10px rgb(0 0 0 / 0.4);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--terracotta);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 0.85rem 1.8rem;
  border-radius: 999px;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { background: var(--sage-deep); color: #fff; transform: translateY(-2px); }
.btn.ghost { background: transparent; border: 1.5px solid #fff; margin-left: 0.6rem; }
.btn.ghost:hover { background: rgb(255 255 255 / 0.15); }

/* ---------- Two-column content ---------- */
.about-grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
}
@media (max-width: 800px) { .about-grid { grid-template-columns: 1fr; } }

.about-grid img { border-radius: var(--radius); box-shadow: var(--shadow); }
.about-grid p + p { margin-top: 1rem; }

.flip .about-grid { direction: rtl; }
.flip .about-grid > * { direction: ltr; }

/* ---------- Cards ---------- */
.tinted { background: var(--cream-deep); }

.cards {
  display: grid;
  gap: 1.2rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 2rem;
}

.card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.card .icon { font-size: 1.6rem; margin-bottom: 0.6rem; display: block; }
.card p { font-size: 0.97rem; color: var(--ink-soft); }

/* ---------- Stats (capacity figures etc.) ---------- */
.stats {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-block: 2rem;
  max-width: 700px;
}

.stat {
  background: var(--cream-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
  text-align: center;
}

.stat .num {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--sage-deep);
  display: block;
  line-height: 1.1;
}

.stat .label { font-size: 0.9rem; color: var(--ink-soft); }

/* ---------- Photo gallery grid ---------- */
.gallery-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  margin-top: 2rem;
}

.gallery-grid img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.caption { font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.8rem; }

/* ---------- Weekly timetable (what's on page) ----------
   Week-view calendar: time axis on the left, one column per day,
   events positioned by start time and duration via CSS variables:
   --start (decimal hours, e.g. 12.5 = 12:30) and --dur (hours).
   The visible day runs from --day-start to --day-end. */
.timetable-scroll { overflow-x: auto; margin-block: 2rem 1rem; }

.timetable {
  --day-start: 8;   /* 08:00 */
  --day-end: 22;    /* 22:00 */
  --hour-h: 3rem;   /* vertical scale */
  display: grid;
  grid-template-columns: 3.4rem repeat(7, minmax(105px, 1fr));
  gap: 0.45rem;
  min-width: 880px;
}

.tcol-head {
  height: 2.1rem;
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  margin: 0;
}

.tcol-body {
  position: relative;
  height: calc((var(--day-end) - var(--day-start)) * var(--hour-h));
  background-color: var(--cream);
  border: 1px solid var(--line);
  border-radius: 10px;
  /* faint line every hour, stronger every two (matching the labels) */
  background-image:
    repeating-linear-gradient(to bottom,
      var(--line) 0 1px, transparent 1px calc(var(--hour-h) * 2)),
    repeating-linear-gradient(to bottom,
      color-mix(in srgb, var(--line) 45%, transparent) 0 1px,
      transparent 1px var(--hour-h));
}

.taxis .tcol-body { background: none; border: none; }

.tlabel {
  position: absolute;
  right: 0.45rem;
  top: calc((var(--h) - var(--day-start)) * var(--hour-h));
  translate: 0 -0.55em;
  font-size: 0.72rem;
  color: var(--ink-soft);
}

.tevent {
  position: absolute;
  left: 4px;
  right: 4px;
  top: calc((var(--start) - var(--day-start)) * var(--hour-h));
  height: calc(var(--dur) * var(--hour-h));
  background: var(--sage-deep);
  color: #fff;
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
  overflow: hidden;
}

.tevent .ev-time {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  opacity: 0.85;
}

/* ---------- Timeline (history page) ---------- */
.timeline {
  list-style: none;
  padding: 0;
  margin-top: 2.5rem;
  display: grid;
  gap: 1.8rem;
  border-left: 2px solid var(--line);
  max-width: 720px;
}

.timeline li { padding-left: 1.6rem; position: relative; }

.timeline li::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 0.45em;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--terracotta);
  border: 2.5px solid var(--cream);
}

.timeline .year {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--sage-deep);
  display: block;
  margin-bottom: 0.15rem;
}

.timeline p { font-size: 0.98rem; color: var(--ink-soft); }

/* ---------- Call-to-action band ---------- */
.cta-band {
  background: var(--sage-deep);
  color: var(--cream);
  text-align: center;
  padding-block: 3.5rem;
}

.cta-band h2 { color: #fff; }
.cta-band p { margin: 0.6rem auto 1.6rem; max-width: 50ch; color: var(--cream-deep); }

/* ---------- Dark band (what's on) ---------- */
.whatson { background: var(--sage-deep); color: var(--cream); }
.whatson .kicker { color: var(--cream-deep); }
.whatson a { color: #fff; }
.whatson p { color: var(--cream-deep); }

.event-list { list-style: none; padding: 0; margin-top: 1.8rem; display: grid; gap: 0.9rem; max-width: 640px; }

.event-list li {
  display: flex;
  gap: 1.2rem;
  align-items: baseline;
  border-bottom: 1px solid rgb(255 255 255 / 0.2);
  padding-bottom: 0.9rem;
}

.event-list .when {
  font-family: var(--serif);
  font-weight: 600;
  white-space: nowrap;
  min-width: 7.5rem;
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: 1fr 1fr;
  align-items: start;
}
@media (max-width: 800px) { .contact-grid { grid-template-columns: 1fr; } }

.contact-grid img { border-radius: var(--radius); border: 1px solid var(--line); }

.contact-list { list-style: none; padding: 0; margin-top: 1.2rem; display: grid; gap: 0.7rem; }
.contact-list strong { display: inline-block; min-width: 8.5rem; }

/* ---------- Map embed (consent-gated) ---------- */
.map-slot { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.map-slot img { width: 100%; }
.map-slot iframe { width: 100%; aspect-ratio: 4 / 3; border: 0; display: block; }

.map-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 1rem;
  text-align: center;
  padding: 1.5rem;
  background: rgb(46 42 35 / 0.55);
  color: #fff;
}
.map-overlay p { max-width: 32ch; font-size: 0.95rem; text-shadow: 0 1px 6px rgb(0 0 0 / 0.4); }

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed;
  inset: auto 1rem 1rem 1rem;
  z-index: 100;
  max-width: 560px;
  margin-inline: auto;
  background: var(--ink);
  color: #efe9dc;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.3rem 1.5rem;
  font-size: 0.93rem;
}
.cookie-banner p { max-width: none; margin-bottom: 0.9rem; }
.cookie-banner a { color: #fff; }
.cookie-banner .actions { display: flex; gap: 0.7rem; flex-wrap: wrap; }
.cookie-banner button {
  font: inherit;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.6rem 1.4rem;
  cursor: pointer;
  border: 1.5px solid transparent;
}
.cookie-banner .accept { background: var(--terracotta); color: #fff; }
.cookie-banner .decline { background: transparent; color: #efe9dc; border-color: #efe9dc; }
.cookie-banner button:hover { opacity: 0.85; }

/* ---------- Footer ---------- */
footer {
  background: var(--ink);
  color: #cfc8bb;
  padding-block: 2.2rem;
  font-size: 0.9rem;
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  text-align: center;
}

footer a { color: #efe9dc; }

/* ---------- Utilities ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; translate: 0 24px; transition: opacity 0.6s ease, translate 0.6s ease; }
.reveal.shown { opacity: 1; translate: 0 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; translate: none; transition: none; }
  .btn { transition: none; }
}
