:root {
  --paper: #ffffff;
  --card: rgba(243, 243, 243, 0.4); /* translucent so the watermark tread shows through */
  --ink: #111111;
  --ink-muted: #555555;
  --accent: #e8b400; /* road-paint yellow; single knob for site color variation */
  --heading-font: 'Anton', 'Impact', 'Arial Narrow', sans-serif;
  --body-font: 'Barlow', 'Helvetica Neue', Arial, sans-serif;
  --spacing-unit: 1rem;
  --wm-height: 90vh;                                  /* watermark logo height */
  --wm-width: calc(var(--wm-height) * 0.525);         /* 525x1000 PNG ratio */
  --wm-opacity: 0.45;
  --col: 1000px;                                      /* content column */
  --text-gutter: calc(var(--wm-width) + 2.5rem);      /* card text stops before the logo */
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--body-font);
  font-size: 1.05rem;
  background-color: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
}

/* Logo as a fixed watermark behind everything, sized to the viewport height
   so the two vertical words read as a big faded 11 on any screen. */
.watermark {
  position: fixed;
  inset: 0;
  background-image: url('../images/zb11/logo-with-background.png');
  background-repeat: no-repeat;
  background-size: auto var(--wm-height);
  /* park the logo inside the right end of the content column; card text
     stops short of it via .card padding-right, cards themselves run under it */
  background-position: calc(50% + var(--col) / 2 - 1rem - var(--wm-width) / 2) center;
  opacity: var(--wm-opacity);
  pointer-events: none;
  z-index: 0;
}

main {
  position: relative;
  z-index: 1;
  padding: 1rem 1rem 3rem;
}

section {
  max-width: var(--col);
  margin: 0 auto;
}

h1, h2, h3, h4 {
  font-family: var(--heading-font);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.1;
  margin: 0 0 0.5rem;
}

h2 {
  display: inline-block;
  font-size: 1.9rem;
  color: var(--paper);
  background: var(--ink);
  padding: 0.15rem 0.75rem;
  margin: -1.5rem 0 1rem -1.5rem;
}

h3 {
  font-size: 1.5rem;
  color: var(--ink);
  margin-top: 1.25rem;
}

h4 {
  font-size: 1.15rem;
  color: var(--ink-muted);
}

.card {
  background-color: var(--card);
  color: var(--ink);
  padding: 1.5rem var(--text-gutter) 1.5rem 1.5rem;
  margin: 1.5rem 0;
}

/* Scroll focus (mobile): the card nearest the viewport centre is solid enough
   to read, the rest fade to reveal the watermark. --focus is set by JS, 0..1. */
.focus-fade .card {
  background-color: rgba(255, 255, 255, var(--focus, 0));
  transition: background-color 0.2s ease-out;
}

.card p {
  margin: 0 0 0.75rem;
}

.card a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 3px;
  transition: background-color 0.15s ease;
}

.card a:hover {
  background-color: var(--accent);
  text-decoration: none;
}

ul {
  list-style-type: square;
  padding-left: 1.25rem;
}

/* Run switcher */
.run-tabs {
  display: flex;
  gap: 0.5rem;
  max-width: var(--col);
  margin: 1.5rem auto 0;
}

.run-tab {
  flex: 1;
  font-family: var(--heading-font);
  font-size: 1.4rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--paper);
  color: var(--ink);
  border: 3px solid var(--ink);
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.run-tab small {
  display: block;
  font-family: var(--body-font);
  font-size: 0.85rem;
  letter-spacing: 0;
  text-transform: none;
  opacity: 0.8;
}

.run-tab:hover {
  background: var(--card);
}

.run-tab[aria-selected="true"] {
  background: var(--accent);
  color: var(--ink);
  border-color: var(--ink);
}

.run-panel[hidden] {
  display: none;
}

.badge {
  display: inline-block;
  font-family: var(--heading-font);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--accent);
  color: var(--ink);
  padding: 0.15rem 0.5rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.tbd {
  color: var(--ink-muted);
  font-style: italic;
}

/* Meeting point */
.meeting-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-unit);
  margin-top: 1rem;
}

.meeting-details .map-container {
  grid-column: 1 / -1;
  /* map may run under the logo: cancel the text gutter back to normal padding */
  margin-right: calc(1.5rem - var(--text-gutter));
}

.map-container iframe {
  width: 100%;
  max-width: 100%;
  border: 3px solid var(--ink);
}

/* Timeline */
.timeline {
  border-left: 4px solid var(--accent);
  padding-left: 1.25rem;
}

.timeline-item {
  position: relative;
  margin-bottom: 1rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1.25rem - 10px);
  top: 0.4rem;
  width: 16px;
  height: 16px;
  background: var(--ink);
  border: 3px solid var(--paper);
}

.timeline-item h4 {
  color: var(--ink);
  margin-bottom: 0;
}

.timeline-item p {
  margin: 0;
}

/* Route */
.route-content {
  text-align: left;
}

/* each leg is its own row: text left, QR right, so the code sits beside the leg it belongs to */
.leg-section {
  display: grid;
  grid-template-columns: 1fr 170px;
  gap: var(--spacing-unit);
  align-items: center;
}

.leg-text {
  min-width: 0;
}

/* heading margin would push the text block below the QR; the row's gap handles spacing */
.leg-text > h3:first-child {
  margin-top: 0;
}

.route-content > * + .leg-section {
  margin-top: 1.25rem;
}

.leg-qr {
  display: flex;
  justify-content: center;
}

.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.qr-caption {
  font-family: var(--heading-font);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  text-align: center;
}

.leg-qr img {
  max-width: 100%;
  height: auto;
  margin: 0;
}

footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.85rem;
  color: #888;
}

@media (max-width: 768px) {
  h2 {
    font-size: 1.5rem;
  }

  /* no room to dodge the logo; centre it, fade it, let text run over */
  :root {
    --wm-opacity: 0.45;
    --text-gutter: 1.5rem;
  }

  .watermark {
    background-position: center center;
  }

  .run-tab {
    font-size: 1.1rem;
    padding: 0.5rem;
  }

  .meeting-details {
    grid-template-columns: 1fr;
  }

  .leg-section {
    grid-template-columns: 1fr;
    margin-bottom: var(--spacing-unit);
  }

  .leg-qr {
    margin-top: 0.5rem;
  }

  .leg-qr img {
    max-width: 250px;
  }
}
