
/* =========================================
   VIA ULTRA — Design tokens
   ========================================= */

:root {
  --forest: #253a32;
  --deep: #1b2b25;
  --orange: #dc713d;
  --page: #f6f3ea;
  --sage: #e2e8df;
  --text: #171b18;
  --muted: #56615a;
  --line: #d9dfd8;
}

/* Base */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font: 16px/1.55 Inter, Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.wrap {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 80px;
}

/* Header */

.masthead {
  background: var(--deep);
  color: #fff;
  overflow: hidden;
}

.masthead-inner {
  max-width: 1440px;
  min-height: 360px;
  padding: 0 94px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  position: relative;
}

.brand,
.header-coffee {
  position: relative;
  z-index: 1;
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: #f8faf6;
  letter-spacing: .015em;
  font: 700 clamp(40px, 4.5vw, 75px)/1 Montserrat, sans-serif;
}

.wordmark em {
  font-weight: 500;
  letter-spacing: -.055em;
}

.tagline {
  color: var(--orange);
  font: 700 22px/1.5 Montserrat, sans-serif;
  margin-top: 12px;
}

.header-coffee {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  color: #e9eee9;
  font-size: 16px;
}

/* Buttons */

.btn {
  border: 0;
  border-radius: 6px;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 0 20px;
  font-family: Inter, Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: filter .15s, transform .15s;
}

.btn:hover {
  filter: brightness(.94);
}

.btn:active {
  transform: translateY(1px);
}

a.btn,
a.btn:link,
a.btn:visited,
a.btn:hover,
a.btn:active {
  text-decoration: none;
}

.btn-orange {
  background: var(--orange);
  color: var(--text);
}

.btn-forest {
  background: var(--forest);
  color: #fff;
}

.btn-outline {
  background: var(--sage);
  border: 1px solid #819087;
  color: var(--forest);
}

/* Introduction */

.intro {
  background: var(--sage);
}

.intro-grid {
  padding-top: 48px;
  padding-bottom: 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 40px;
}

.portrait {
  height: 450px;
  overflow: hidden;
  border-radius: 8px;
  background: #c8d3ca;
  position: relative;
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-note {
  display: none;
}

.portrait.missing-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #a8b8ac, #e0e8e0);
}

.portrait.missing-photo .photo-note {
  display: block;
  padding: 30px;
  text-align: center;
  color: #3e5546;
  max-width: 320px;
}

.intro h1 {
  font: 700 clamp(36px, 4vw, 56px)/1.13 Montserrat, sans-serif;
  letter-spacing: -.025em;
  margin: 0 0 8px;
}

.intro-kicker {
  font: 600 18px/1.4 Montserrat, sans-serif;
  color: var(--orange);
  margin: 0 0 24px !important;
}

.intro-copy p {
  font-size: 17px;
  line-height: 1.65;
  margin: 0 0 14px;
}

.intro-copy .btn {
  margin-top: 10px;
  min-height: 52px;
}

/* Directory and search */

.directory {
  background: var(--page);
  padding: 48px 0 64px;
}

.search-area {
  padding-bottom: 32px;
  border-bottom: 1px solid #e1e3db;
}

.search-area > label {
  display: block;
  font: 700 18px/1.4 Montserrat, sans-serif;
  margin-bottom: 16px;
}

.search-controls {
  display: flex;
  align-items: stretch;
  gap: 20px;
  max-width: 1050px;
  min-width: 0;
}

.search-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  padding: 0 14px;
  color: #65736b;
}

.search-box input {
  border: 0;
  outline: 0;
  width: 100%;
  min-width: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.search-box:focus-within {
  outline: 2px solid #7d9887;
}

.country-wrap {
  position: relative;
}

.country-wrap > .btn {
  height: 52px;
}

.country-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 240px;
  z-index: 5;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 10px 25px #0002;
  border-radius: 10px;
}

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

.country-panel label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 5px;
}

.country-panel select {
  width: 100%;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  margin-bottom: 14px;
  background: #fff;
}

.clear {
  border: 0;
  background: none;
  text-decoration: underline;
  color: var(--forest);
  padding: 0;
}

.search-button {
  height: 52px;
  min-width: 125px;
}

/* Results and filters */

.results-head {
  margin: 32px 0 20px;
  min-width: 0;
}

.results-head h2 {
  font: 600 16px Montserrat, sans-serif;
  margin: 0 0 12px;
}

.chips {
  display: flex;
  gap: 12px;
}

.chip {
  border: 1px solid #b8c0b8;
  border-radius: 100px;
  background: #fff;
  padding: 8px 17px;
  font-size: 14px;
  color: var(--text);
}

.chip.active {
  background: var(--forest);
  color: #fff;
  border-color: var(--forest);
}

.results-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  color: #667168;
  font-size: 14px;
}

.sort-label select {
  background: var(--sage);
  border: 1px solid #819087;
  border-radius: 5px;
  padding: 8px 12px;
  color: var(--forest);
  font-size: 14px;
}

/* Race cards */

.cards {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.race-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  min-height: 160px;
  min-width: 0;
  box-shadow: 0 3px 7px #172d1e0b;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.date-badge {
  background: var(--sage);
  width: 100px;
  min-width: 100px;
  height: 116px;
  border-radius: 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #2c3932;
}

.date-badge .month {
  font-size: 17px;
  font-weight: 700;
  color: #56655b;
  letter-spacing: .03em;
}

.date-badge .day {
  font-size: 37px;
  font-weight: 800;
  line-height: 1.12;
}

.date-badge .year {
  font-size: 16px;
  font-weight: 600;
  color: #647168;
}

.date-badge.undated .day {
  font-size: 19px;
}

.race-info {
  min-width: 0;
  flex: 1;
}

.race-info h3 {
  font: 700 20px/1.3 Montserrat, sans-serif;
  margin: 0 0 2px;
  overflow-wrap: anywhere;
}

.race-location {
  font-weight: 600;
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

/* Race metadata */

.race-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: #626b64;
  font-size: 14px;
}

.race-stats > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Bold race type only */

.race-stats .race-type {
  font-weight: 700;
}

/* Shared SVG icon styling */

.race-stats .stat-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  background-color: var(--orange);

  -webkit-mask-position: center;
  mask-position: center;

  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;

  -webkit-mask-size: contain;
  mask-size: contain;
}

/* Individual metadata icons */

.icon-route {
  -webkit-mask-image: url("assets/icon-route.svg");
  mask-image: url("assets/icon-route.svg");
}

.icon-mountain {
  -webkit-mask-image: url("assets/icon-mountain.svg");
  mask-image: url("assets/icon-mountain.svg");
}

.icon-race-type {
  -webkit-mask-image: url("assets/icon-race-type.svg");
  mask-image: url("assets/icon-race-type.svg");
}

.icon-difficulty {
  -webkit-mask-image: url("assets/icon-difficulty.svg");
  mask-image: url("assets/icon-difficulty.svg");
}

/* Race card button */

.race-card .more {
  min-width: 126px;
  margin-left: auto;
}

.race-card .more[disabled] {
  background: #e5e8e3;
  color: #69756d;
  cursor: default;
}

/* Load more and footer */

.load-wrap {
  text-align: center;
  margin-top: 40px;
}

.load-wrap .btn {
  min-width: 150px;
  min-height: 52px;
}

.footer {
  background: var(--deep);
  color: #f0f5ee;
}

.footer-inner {
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 12px;
}

.footer-inner span + span {
  font-size: 11px;
  color: #b8c7bb;
}

/* Feedback and utilities */

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--deep);
  color: #fff;
  padding: 14px 20px;
  border-radius: 8px;
  box-shadow: 0 10px 35px #0003;
  z-index: 10;
  max-width: calc(100% - 30px);
}

.toast[hidden] {
  display: none;
}

.empty {
  background: #fff;
  padding: 40px;
  border-radius: 10px;
  text-align: center;
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Tablet */

@media (max-width: 900px) {
  .wrap {
    padding-left: 24px;
    padding-right: 24px;
  }

  .masthead-inner {
    padding: 0 24px;
    min-height: 250px;
  }

  .intro-grid {
    gap: 24px;
  }

  .portrait {
    height: 340px;
  }

  .intro h1 {
    font-size: 36px;
  }

  .intro-copy p {
    font-size: 15px;
  }

  .race-card {
    padding: 16px;
  }

  .date-badge {
    min-width: 80px;
    width: 80px;
  }

  .search-controls {
    gap: 12px;
  }
}

/* Mobile */

@media (max-width: 680px) {
  .masthead-inner {
    min-height: 248px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 28px;
    padding: 35px 20px;
  }

.wordmark {
    font-size: 38px;
    gap: 6px;
  }

  .tagline {
    font-size: 13px;
    margin-top: 7px;
  }

  .header-coffee {
    align-items: flex-start;
    gap: 9px;
    font-size: 14px;
  }

  .header-coffee .btn {
    min-height: 36px;
    padding: 0 13px;
    font-size: 12px;
  }

  .wrap {
    padding-left: 24px;
    padding-right: 24px;
  }

  .intro-grid {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding-top: 20px;
    padding-bottom: 24px;
    gap: 20px;
  }

  .portrait {
    height: auto;
    aspect-ratio: 342 / 260;
  }

  .intro h1 {
    font-size: 36px;
    line-height: 1.12;
  }

  .intro-kicker {
    font-size: 16px;
    margin-bottom: 22px !important;
  }

  .intro-copy p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 12px;
  }

  .intro-copy .btn {
    margin-top: 8px;
  }

  .directory {
    padding-top: 24px;
    padding-bottom: 40px;
  }

  .search-area {
    padding-bottom: 24px;
  }

  .search-area > label {
    font-size: 16px;
    margin-bottom: 14px;
  }

  .search-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 12px;
  }

  .search-box {
    height: 48px;
  }

  .search-box input {
    font-size: 16px;
  }

  .country-wrap > .btn {
    height: 48px;
    min-height: 48px;
    width: 44px;
    padding: 0;
  }

  .country-label {
    display: none;
  }

  .country-panel {
    right: 0;
    width: min(240px, calc(100vw - 48px));
    max-width: calc(100vw - 48px);
  }

  .search-button {
    grid-column: 1 / -1;
    width: 100%;
    height: 52px;
  }

  .results-head {
    margin: 24px 0 16px;
  }

  .results-meta {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-top: 18px;
  }

  .sort-label select {
    width: 100%;
    height: 42px;
  }

  .cards {
    gap: 12px;
  }

  .race-card {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 16px;
    border-radius: 12px;
    min-height: 0;
  }

  .date-badge {
    grid-row: 1;
    width: 60px;
    min-width: 60px;
    height: 82px;
    border-radius: 6px;
  }

  .date-badge .month {
    font-size: 12px;
  }

  .date-badge .day {
    font-size: 24px;
  }

  .date-badge .year {
    font-size: 12px;
  }

  .date-badge.undated .day {
    font-size: 13px;
  }

  .race-info h3 {
    font-size: 17px;
    margin-top: 2px;
  }

  .race-location {
    font-size: 13px;
    margin: 3px 0 0;
  }

  .race-stats {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
  }

  .race-card .more {
    grid-column: 1 / -1;
    width: 100%;
    margin: 0;
    min-height: 40px;
  }

  .load-wrap {
    margin-top: 24px;
  }

  .load-wrap .btn {
    width: 100%;
  }

  .footer-inner {
    padding-top: 18px;
    padding-bottom: 18px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    font-size: 11px;
  }
}

/* Responsive race metadata spacing */

@media (max-width: 900px) {
  .race-location {
    margin-bottom: 20px;
  }

  .race-stats {
    row-gap: 8px;
  }
}
/* Header logo */

.brand-logo {
  display: block;
  width: 491px;
  max-width: 100%;
  height: auto;
}

@media (max-width: 680px) {
  .brand-logo {
    width: 213px;
  }
}

/* Race logo placement — desktop */

.race-card .race-logo {
  width: 125px;
  height: 83px;
  flex: 0 0 125px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 24px 0 auto;
}

.race-card .race-logo img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

/* Race logo placement — mobile */

@media (max-width: 680px) {
  .race-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .race-card .date-badge {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
  }

  .race-card .race-logo {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    width: 120px;
    height: 80px;
    flex: none;
    margin: 0;
  }

  .race-card .race-info {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .race-card .more {
    grid-column: 1 / -1;
    grid-row: 3;
    width: 100%;
  }
}


/* Responsive race filter modal */
.filter-overlay[hidden], .countries-list[hidden] { display:none !important; }
.filter-overlay { position:fixed; inset:0; z-index:100; background:rgba(0,0,0,.5); display:flex; justify-content:center; align-items:center; padding:20px; }
.filter-dialog { width:min(1035px,100%); max-height:min(88dvh,640px); background:#fff; border-radius:16px; box-shadow:0 20px 70px #0004; display:flex; flex-direction:column; overflow:hidden; }
.filter-header,.filter-footer { flex:none; display:flex; justify-content:space-between; align-items:center; padding:18px 28px; background:#fff; }
.filter-header { border-bottom:1px solid var(--line); }
.filter-header h2 { margin:0; font:700 20px Montserrat,sans-serif; }
.filter-close { border:0; background:none; font-size:30px; line-height:1; color:var(--forest); padding:0 4px; }
.filter-body { overflow-y:auto; overscroll-behavior:contain; padding:8px 28px 24px; }
.filter-section { padding:18px 0; border-bottom:1px solid var(--line); }
.filter-section:last-child { border-bottom:0; }
.filter-section h3 { font:700 15px Montserrat,sans-serif; margin:0 0 14px; }
.filter-chips { display:flex; flex-wrap:wrap; gap:10px; }
.filter-chip { padding:9px 16px; border:1px solid #b8c0b8; border-radius:30px; background:#fff; font-size:14px; color:var(--forest); }
.filter-chip[aria-pressed="true"] { background:var(--forest); border-color:var(--forest); color:white; }
.filter-footer { border-top:1px solid var(--line); gap:20px; }
.filter-footer .btn { min-width:140px; }
.filter-row { display:flex; justify-content:space-between; align-items:center; gap:16px; flex-wrap:wrap; }
.filter-row h3 { margin:0; }
.currency-tabs { display:flex; gap:4px; background:var(--sage); border-radius:8px; padding:4px; }
.currency-tabs button { border:0; background:transparent; border-radius:6px; padding:6px 12px; font-size:13px; color:var(--forest); }
.currency-tabs button.selected { background:var(--forest); color:white; }
.price-labels { display:flex; justify-content:space-between; margin:20px 0 5px; font-weight:600; font-size:14px; }
.fee-slider { height:32px; position:relative; margin:0 10px; }
.fee-track,.fee-fill { position:absolute; top:15px; height:5px; border-radius:5px; left:0; right:0; background:var(--sage); pointer-events:none; }
.fee-fill { right:auto; background:var(--forest); }
.fee-slider input[type="range"] { appearance:none; -webkit-appearance:none; position:absolute; top:0; left:0; width:100%; margin:0; height:32px; background:none; pointer-events:none; }
.fee-slider input[type="range"]::-webkit-slider-thumb { appearance:none; -webkit-appearance:none; width:20px; height:20px; border:3px solid #fff; box-shadow:0 0 0 1px var(--forest); border-radius:50%; background:var(--forest); cursor:grab; pointer-events:auto; }
.fee-slider input[type="range"]::-moz-range-thumb { width:14px; height:14px; border:3px solid #fff; box-shadow:0 0 0 1px var(--forest); border-radius:50%; background:var(--forest); cursor:grab; pointer-events:auto; }
.filter-help { margin:8px 0 0; color:var(--muted); font-size:12px; }
.filter-unavailable { color:#69756d; }
.filter-unavailable h3 { margin-bottom:6px; }
.filter-unavailable p { font-size:13px; margin:0; }
/* Inline country accordion: no floating dropdown or slider overlap. */
.country-accordion-trigger { width:100%; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:0; border:0; background:transparent; text-align:left; font:700 15px Montserrat,sans-serif; color:var(--text); cursor:pointer; }
.country-count { font:500 13px Inter,sans-serif; color:var(--muted); margin-left:8px; }
.country-chevron { width:9px; height:9px; border-right:2px solid var(--forest); border-bottom:2px solid var(--forest); transform:rotate(45deg); margin-right:5px; transition:transform .15s; }
.country-accordion-trigger[aria-expanded="true"] .country-chevron { transform:rotate(225deg); }
.countries-accordion-panel { padding-top:18px; }
.country-search-label { display:block; font-size:13px; font-weight:600; margin-bottom:8px; }
.countries-accordion-panel input[type="search"] { display:block; width:100%; max-width:420px; border:1px solid var(--line); border-radius:6px; padding:10px 12px; font-size:14px; }
.country-options { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:8px 20px; margin-top:16px; max-height:230px; overflow-y:auto; }
.country-option { display:flex; gap:10px; align-items:center; padding:5px 0; font-size:14px; cursor:pointer; }
.country-option[hidden],.filter-chip-remove[hidden] { display:none !important; }
.country-option input[type="checkbox"] { width:17px; height:17px; margin:0; accent-color:var(--forest); flex:none; }
.country-clear { display:block; margin-top:14px; padding:4px 0; border:0; background:none; color:var(--forest); text-decoration:underline; cursor:pointer; font-size:13px; }
.filter-chip-remove { margin-left:8px; font-size:18px; line-height:12px; font-weight:400; }
body.filters-open { overflow:hidden; }
@media(max-width:680px) {
  .filter-overlay { padding:0; align-items:flex-end; }
  .filter-dialog { width:100%; max-height:94dvh; border-radius:16px 16px 0 0; }
  .filter-header,.filter-footer { padding:16px 20px; }
  .filter-body { padding:4px 20px 20px; }
  .filter-header h2 { font-size:18px; }
  .filter-footer .btn { flex:1; }
  .country-options { grid-template-columns:repeat(auto-fit,minmax(125px,1fr)); }
}

/* Range and demo filter refinements */
.demo-note { font-style:italic; }
.filter-chip { display:inline-flex; align-items:center; gap:0; }
.filter-chip:focus-visible,.country-accordion-trigger:focus-visible { outline:2px solid #2563eb; outline-offset:3px; }


/* Applied filter summary replaces the search form after filters are submitted. */
.applied-filter-bar[hidden], .applied-filter-chips[hidden], #region-tabs[hidden],
#search-form[hidden], #load-more[hidden] { display: none !important; }
.applied-filter-bar { display:flex; align-items:center; flex-wrap:wrap; gap:16px; margin:18px 0 28px; }
.applied-filter-chips { display:flex; align-items:center; flex-wrap:wrap; gap:10px; }
.applied-chip { display:inline-flex; align-items:center; gap:10px; border:1px solid var(--forest); border-radius:999px; background:var(--forest); color:white; font:600 14px/20px Inter, sans-serif; padding:10px 14px; cursor:pointer; }
.applied-chip:hover { background:var(--deep); }
.applied-chip:focus-visible { outline:3px solid #287ad1; outline-offset:2px; }
.applied-chip-close { font-size:20px; line-height:14px; font-weight:400; }
.clear-applied-filters { background:none; border:0; padding:10px 0; color:var(--forest); text-decoration:underline; font:600 15px/20px Inter,sans-serif; cursor:pointer; }
.clear-applied-filters:focus-visible { outline:3px solid #287ad1; outline-offset:2px; }

.adventure-heading { margin:0 0 18px; font-family:Montserrat, sans-serif; font-size:24px; font-weight:700; line-height:1.3; }

/* Reopen filters from the applied-filter summary. */
#refine-filters { display:inline-flex; align-items:center; justify-content:center; gap:10px; min-height:44px; }
#refine-filters:focus-visible { outline:3px solid #287ad1; outline-offset:2px; }

/* Keep directory heading in both search and applied-filter views. */
.directory-search-title { margin:0 0 20px; font-family:Montserrat, sans-serif; font-weight:700; font-size:24px; line-height:1.3; color:var(--text); }
/* Native select arrow is replaced with one consistently positioned chevron. */
.sort-label { position:relative; display:inline-flex; align-items:center; min-width:0; }
.sort-label::after { content:""; position:absolute; right:15px; top:50%; width:8px; height:8px; border-right:1.7px solid var(--forest); border-bottom:1.7px solid var(--forest); transform:translateY(-70%) rotate(45deg); pointer-events:none; }
.sort-label select { appearance:none; -webkit-appearance:none; background-image:none !important; padding-right:40px; min-height:42px; line-height:22px; cursor:pointer; }
@media(max-width:640px) { .directory-search-title {font-size:21px;} .sort-label {width:100%;} }

/* Footer support link */
.footer-inner a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.footer-inner a:hover { color: #fff; }
.footer-inner a:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

/* 2026-11-02: Match the oversized decorative V to the Figma header composition. */

/* Footer: opposing alignment on desktop. */
.footer-inner { justify-content: space-between; }
.footer-inner > span { margin-left: auto; text-align: right; color: #b8c7bb; font-size: 11px; }
@media (max-width: 680px) {

.footer-inner { align-items: center; justify-content: center; }
  .footer-inner > a, .footer-inner > span { text-align: center; margin-left: 0; }
}

/* Header artwork — Figma-aligned responsive SVG (assets/V-mark.svg).
   Decorative only; header content remains above it. */
.masthead-inner::before {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
  width: 640px;
  height: 526px;
  right: 0;
  top: -18px;
  background: url("assets/V-mark.svg") no-repeat center / 100% 100%;
  transform: none;
}

@media (min-width: 681px) and (max-width: 900px) {
  .masthead-inner::before {
    width: 433px;
    height: 356px;
    right: 0;
    top: 0;
  }
}

@media (max-width: 680px) {
  .masthead-inner::before {
    width: 323px;
    height: 265px;
    right: 0;
    top: -4px;
  }
}


/* Tablet header composition — Figma 768px reference (364:10253). */
@media (min-width: 681px) and (max-width: 900px) {
  .masthead-inner {
    min-height: 204px;
    padding-left: 60px;
    padding-right: 60px;
    gap: 24px;
  }
  .brand-logo {
    width: 275px;
    max-width: 100%;
  }
  .tagline {
    font-size: 14px;
    margin-top: 6px;
  }
  .header-coffee {
    font-size: 17px;
    gap: 12px;
    align-items: flex-end;
    white-space: nowrap;
  }
  .header-coffee .btn {
    min-height: 44px;
    padding: 0 18px;
    font-size: 14px;
  }
}

/* Mobile header composition — Figma 375px reference (364:10252). */
@media (max-width: 680px) {
  .masthead-inner {
    height: 253px;
    min-height: 253px;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 34px;
  }
  .brand-logo {
    width: 213px;
    max-width: 100%;
  }
  .header-coffee {
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
  }
  .header-coffee .btn {
    min-height: 38px;
    padding: 0 14px;
    font-size: 12px;
  }
  .masthead-inner::before {
    width: 323px;
    height: 265px;
    right: 0;
    top: -4px;
  }
}

/* Header refinements — Figma 1440 / 1024 / 768 / mobile 355 */
@media (min-width: 1025px) {
  .masthead-inner { height: 250px; min-height: 250px; padding: 0 94px; }
  .brand-logo { width: 491px; }
  .header-coffee { font-size: 18px; gap: 12px; align-items: flex-end; }
  .header-coffee .btn { min-height: 44px; padding: 0 16px; font-size: 14px; }
  .masthead-inner::before { width: 640px; height: 526px; right: 0; top: -87px; }
}
@media (min-width: 901px) and (max-width: 1024px) {
  .masthead-inner { height: 212px; min-height: 212px; padding: 0 80px; gap: 20px; }
  .brand-logo { width: 354px; }
  .header-coffee { font-size: 18px; gap: 12px; align-items: flex-end; white-space: nowrap; }
  .header-coffee .btn { min-height: 44px; padding: 0 16px; font-size: 14px; }
  .masthead-inner::before { width: 439px; height: 361px; right: 30px; top: 0; }
}
@media (min-width: 681px) and (max-width: 900px) {
  .masthead-inner { height: 192px; min-height: 192px; padding: 0 60px; gap: 10px; }
  .brand-logo { width: 275px; }
  .header-coffee { font-size: 16px; gap: 12px; align-items: flex-end; white-space: nowrap; }
  .header-coffee .btn { min-height: 44px; padding: 0 16px; font-size: 14px; }
  .masthead-inner::before { width: 361px; height: 297px; right: 17px; top: 0; }
}
@media (max-width: 680px) {
  .masthead-inner { height: 224px; min-height: 224px; padding: 40px 20px 0; display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 40px; }
  .brand-logo { width: 213px; max-width: 100%; }
  .header-coffee { font-size: 16px; line-height: 24px; gap: 12px; align-items: flex-start; white-space: nowrap; }
  .header-coffee .btn { min-height: 36px; padding: 0 12px; font-size: 12px; gap: 8px; }
  .masthead-inner::before { width: 278px; height: 228px; right: -17px; top: 0; }
}

/* Load more: centre the label and chevron as one group */
.load-wrap .btn { gap: 8px; }
.load-more-icon { display: block; width: 20px; height: 20px; flex: 0 0 20px; }

/* Bio aside: two pixels smaller than body copy at each breakpoint */
.intro-copy p.bio-shoutout { font-size: 15px; }
@media (max-width: 900px) { .intro-copy p.bio-shoutout { font-size: 13px; } }
@media (max-width: 680px) { .intro-copy p.bio-shoutout { font-size: 14px; } }

/* Keep selected chip remove symbols optically centred with their labels. */
.filter-chip-remove { display:inline-flex; align-items:center; justify-content:center; width:18px; height:20px; margin-left:8px; font-size:20px; line-height:1; flex:0 0 18px; transform:translateY(-1px); }

/* Multi-select terrain chips in the results header */
#region-tabs .chip { display:inline-flex; align-items:center; justify-content:center; gap:9px; }
#region-tabs .chip-remove { display:inline-flex; align-items:center; justify-content:center; width:16px; height:20px; font-size:20px; line-height:1; font-weight:500; flex:0 0 16px; }
#region-tabs .chip-remove[hidden] { display:none !important; }

/* 2026-11-04 — Directory layout: terrain selection precedes search */
.directory-search-title { margin-bottom: 18px; }
.terrain-tabs { flex-wrap:wrap; margin-bottom: 20px; }
.terrain-tabs .chip { min-height: 44px; }
.search-area { border-bottom: 0; padding-bottom: 0; }
.results-head { margin: 28px 0 20px; }
.results-meta { margin-top: 0; flex-wrap:wrap; }
.applied-filter-bar { margin: 18px 0 0; }
@media(max-width:680px) {
  .terrain-tabs { gap: 8px; margin-bottom: 16px; }
  .terrain-tabs .chip { padding: 8px 13px; }
  .results-head { margin-top: 24px; }
}

/* Emphasise route format without bolding the distance itself. */
.race-stats .distance-route { font-weight: 700; }


/* Header Instagram link — desktop and mobile compositions */
.header-instagram {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
  color: #f8faf6;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}
.header-instagram img { display: block; width: 30px; height: 30px; flex: 0 0 30px; }
.header-instagram:hover { text-decoration: underline; text-underline-offset: 4px; }
.header-instagram:focus-visible { outline: 2px solid #fff; outline-offset: 5px; border-radius: 2px; }
@media (max-width: 680px) {
  .masthead-inner { height: auto; min-height: 306px; padding: 32px 20px 28px; gap: 34px; }
  .header-coffee { width: 100%; align-items: flex-start; }
  .header-instagram { align-self: flex-end; margin-top: 4px; font-size: 16px; }
  .header-instagram img { width: 32px; height: 32px; flex-basis: 32px; }
}

/* Instagram: compact beside the coffee button on tablet and mobile. */
@media (max-width: 1024px) {
  .header-coffee {
    display: grid;
    grid-template-columns: max-content 32px;
    grid-template-rows: auto auto;
    align-items: center;
    justify-content: end;
    column-gap: 14px;
    row-gap: 10px;
  }
  .header-coffee > span { grid-column: 1 / -1; }
  .header-coffee > .btn { grid-column: 1; grid-row: 2; }
  .header-instagram { grid-column: 2; grid-row: 2; margin: 0; align-self: center; }
  .header-instagram > span { display: none; }
  .header-instagram img { width: 30px; height: 30px; flex-basis: 30px; }
}
@media (max-width: 680px) {
  .masthead-inner { height: 224px; min-height: 224px; padding: 40px 20px 0; gap: 40px; }
  .header-coffee { width: auto; justify-content: start; align-items: center; }
  .header-instagram { align-self: center; }
}
/* Small footer Instagram icon, in the requested sage colour. */
.footer-community { display: inline-flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.footer-community .footer-instagram { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex: 0 0 18px; color: #E2E8DF; text-decoration: none; }
.footer-community .instagram-mark { display: block; width: 16px; height: 16px; background-color: #E2E8DF; -webkit-mask: url("assets/instagram.svg") center / contain no-repeat; mask: url("assets/instagram.svg") center / contain no-repeat; }
.footer-community .footer-instagram:focus-visible { outline: 2px solid #E2E8DF; outline-offset: 4px; }
@media (max-width: 680px) { .footer-community { justify-content: center; } }

/* Mobile: align Instagram icon with logo at the top-right, with equal side padding. */
@media (max-width: 680px) {
  .header-coffee {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .header-instagram {
    position: absolute;
    top: 40px;
    right: 20px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    z-index: 2;
  }
  .header-instagram img { width: 32px; height: 32px; flex: 0 0 32px; }
}

/* Registration status — race card */
.race-card .registration-status { display:flex; align-items:center; gap:8px; margin:0 0 14px; font:500 14px/20px Inter,Arial,sans-serif; color:var(--muted); }
.race-card .registration-dot { width:10px; height:10px; flex:0 0 10px; border-radius:50%; background:currentColor; }
.race-card .registration-open .registration-dot { background:#16b827; }
.race-card .registration-soon .registration-dot { background:#f59b18; }
.race-card .registration-not-open .registration-dot { background:#f5d000; }
.race-card .registration-closed .registration-dot { background:#d61f26; }
/* Override the old location-to-stats spacing only when status is present. */
.race-card .race-location:has(+ .registration-status) {
  margin-bottom: 8px;
}
@media(max-width:680px) {
  .race-card .registration-status { font-size:12px; line-height:18px; margin-bottom:12px; }
}
/* Race card alignment — intermediate breakpoints */
@media (min-width: 681px) and (max-width: 1100px) {
  .race-card {
    align-items: flex-start;
  }

  .race-card .date-badge {
    flex-shrink: 0;
  }

  .race-card .race-logo,
  .race-card .more {
    align-self: center;
  }
}

/* Align the location pin, registration dot and first metadata icon */
.race-card .race-location {
  display: flex;
  align-items: center;
  gap: 8px;
}
.race-card .location-icon,
.race-card .registration-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  width: 24px;
  height: 20px;
}
.race-card .registration-icon .registration-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
}
.race-card .race-stats > span:first-child { gap: 8px; }
.race-card .race-stats > span:first-child .stat-icon {
  width: 24px;
  height: 20px;
  flex: 0 0 24px;
  -webkit-mask-size: 16px 16px;
  mask-size: 16px 16px;
}
