@font-face {
  font-family: "PP Watch";
  src: url("./assets/fonts/PPWatch-Bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "PP Watch";
  src: url("./assets/fonts/PPWatch-Semibold.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "PP Pangram Sans";
  src: url("./assets/fonts/PPPangramSans-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --red: #e81e25;
  --red-deep: #b5161c;
  --ink: #101010;
  --muted: #2d2d2d;
  --paper: #f2f4f7;
  --map-paper: #dfe1e4;
  --line: rgba(16, 16, 16, 0.14);
  --visited: #e81e25;
  --unvisited: #f2f4f7;
  --focus: #f2f4f7;
  --input-focus: #3898ec;
  --overlay-content-width: min(100%, 1160px);
  --font-heading: "PP Watch", ui-sans-serif, system-ui, sans-serif;
  --font-body: "PP Pangram Sans", ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
}

button,
input {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(460px, 520px) minmax(0, 1fr);
  min-height: 100vh;
}

.map-stage {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(232, 30, 37, 0.08), transparent 34%),
    var(--map-paper);
}

.map {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.leaflet-container {
  background: transparent;
  font-family: inherit;
}

.leaflet-control-attribution {
  font-size: 10px;
}

.photo-overlay {
  position: absolute;
  inset: 0;
  z-index: 500;
  display: block;
  padding: clamp(22px, 4vw, 52px);
  pointer-events: none;
  overflow: auto;
  opacity: 0;
  transform: scale(1.01);
  transition:
    opacity 180ms ease,
    transform 240ms ease;
}

.photo-overlay.is-visible {
  opacity: 1;
  transform: scale(1);
}

.photo-scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(10, 10, 10, 0.82);
  backdrop-filter: blur(2px);
}

.photo-content {
  width: var(--overlay-content-width);
  margin: 0 auto;
  display: grid;
  gap: clamp(18px, 3vw, 30px);
}

.photo-copy {
  width: 100%;
  color: white;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}

.photo-copy h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  text-transform: none;
  font-size: clamp(36px, 6vw, 78px);
  line-height: 0.94;
  letter-spacing: 0;
}

.photo-copy p,
.photo-copy .eyebrow {
  display: none;
}

.photo-gallery {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  grid-auto-rows: auto;
  gap: clamp(4px, 0.7vw, 8px);
  min-height: 0;
  align-content: start;
}

.photo-card {
  position: relative;
  margin: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--muted);
  border: 2px solid var(--muted);
  aspect-ratio: 16 / 9;
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-card figcaption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 72px 14px 14px;
  color: white;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.76) 72%);
  font-size: 13px;
  line-height: 1.3;
}

.photo-date {
  display: block;
  margin-bottom: 4px;
  color: var(--focus);
  font-size: 11px;
  font-family: var(--font-body);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.control-panel {
  z-index: 700;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 26px;
  height: 100vh;
  overflow: auto;
  padding: clamp(24px, 4vw, 44px);
  border-right: 1px solid var(--line);
  background: var(--paper);
  box-shadow: 18px 0 44px rgba(28, 34, 36, 0.12);
}

.eyebrow {
  margin: 0;
  color: var(--red-deep);
  font-size: 12px;
  font-family: var(--font-body);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.photo-copy .eyebrow {
  color: var(--focus);
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

h1 {
  margin-top: 8px;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 0.96;
}

.lede {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.45;
}

.progress-wrap {
  display: grid;
  gap: 12px;
  padding-bottom: 12px;
}

.progress-track {
  width: 100%;
  height: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--map-paper);
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: var(--red);
  transition: width 300ms ease;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(0, 0, 0, 0.18);
}

.swatch.visited {
  background: var(--visited);
}

.swatch.unvisited {
  background: var(--unvisited);
}

.lead-form,
.riding-details {
  display: grid;
  gap: 14px;
  padding-top: 36px;
  border-top: 1px solid var(--line);
}

.lead-form h2,
.riding-details h2 {
  font-size: 23px;
  line-height: 1.08;
}

.lead-form p,
.riding-details p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

input {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-bottom: 2px solid var(--red);
  padding: 0 14px;
  color: var(--ink);
  background: white;
  outline: none;
  font-size: 13px;
}

input:focus {
  border-bottom-color: var(--input-focus);
  box-shadow: none;
}

input::placeholder {
  color: #9a9a9a;
  opacity: 1;
}

button {
  min-height: 50px;
  border: 3px solid var(--red);
  font-family: var(--font-heading);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: white;
  background: var(--red);
  cursor: pointer;
}

button:hover {
  color: var(--red);
  background: transparent;
}

.form-status {
  min-height: 20px;
  font-size: 13px;
}

.form-status.is-success {
  color: #146c43;
}

.form-status.is-error {
  color: var(--red-deep);
}

.riding-details {
  margin-top: auto;
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .control-panel {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 16px 38px rgba(28, 34, 36, 0.08);
  }

  .map-stage {
    min-height: 62vh;
  }

  .photo-overlay {
    padding-bottom: 30px;
  }

  .photo-copy {
    display: none;
  }

  .photo-gallery .photo-card {
    display: none;
  }

  .photo-gallery .photo-card:first-child {
    display: block;
  }
}

@media (max-width: 560px) {
  .map-stage {
    min-height: 58vh;
  }

  .photo-copy h2 {
    font-size: 40px;
  }

}
