/* hx.css: Hayrace Travel, palette "Heather and Harbor". Mobile first. */

@font-face {
  font-family: "Piazzolla";
  src: url("/static/fonts/piazzolla-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Piazzolla";
  src: url("/static/fonts/piazzolla-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f2f2ee;
  --paper-dim: #e7e6df;
  --card: #fafaf6;
  --ink: #1f2126;
  --ink-mild: #474b55;
  --faded: #757a86;
  --mauve: #7d5e8c;
  --mauve-deep: #5f4370;
  --mauve-mist: #efe9f3;
  --harbor: #57718f;
  --harbor-deep: #3f556e;
  --line: #c9c8bf;
  --line-strong: #a29f90;
  --deep: #14161d;
  --good: #2c6e49;
  --bad: #a63a24;
  --head: "Piazzolla", "Palatino Nova", "Book Antiqua", Palatino, Georgia, serif;
  --body: "Avenir Next", "Segoe UI Variable Text", Corbel, "Helvetica Neue", Arial, sans-serif;
}

/* reset */
* { margin: 0; }
html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.63;
  color: var(--ink);
  background: var(--paper);
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-family: var(--head);
  font-weight: 700;
  line-height: 1.22;
  color: var(--ink);
}
h1 { font-size: clamp(1.9rem, 4.6vw, 3.1rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: 14px; }
h3 { font-size: 1.12rem; margin: 22px 0 8px; }

p { margin-bottom: 14px; }
ul, ol { padding-left: 24px; margin-bottom: 14px; }
li { margin-bottom: 6px; }

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

strong { color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--mauve);
  outline-offset: 2px;
}

::selection { background: var(--mauve-mist); }

/* small caps meta voice */
.hx-kick,
.hx-tag,
.hx-board__date,
.hx-board__len,
.hx-art__date,
.hx-art__read,
.hx-field label,
.hx-facts dt,
.hx-records dt,
.hx-press__h,
.hx-strip__cell,
figcaption {
  font-variant-caps: small-caps;
  letter-spacing: 0.08em;
}

.hx-kick {
  color: var(--mauve);
  font-weight: 600;
  margin-bottom: 6px;
}

/* skip link */
.hx-skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 120;
  background: var(--mauve-deep);
  color: var(--card);
  padding: 10px 18px;
}
.hx-skip:focus {
  left: 8px;
  color: var(--card);
}

/* layout */
.hx-wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 18px;
}

/* top bar, one 60px strip */
.hx-bar {
  position: sticky;
  top: 0;
  z-index: 90;
  height: 60px;
  background: rgba(242, 242, 238, 0.88);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-strong);
}
.hx-bar.is-fastened { box-shadow: 0 2px 10px rgba(31, 33, 38, 0.08); }
.hx-bar__in {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 18px;
  height: 60px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
}
.hx-bar__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.hx-bar__word {
  font-family: var(--head);
  font-weight: 700;
  font-size: 1.12rem;
  white-space: nowrap;
}
.hx-bar__nav {
  display: none;
  justify-self: center;
}
.hx-bar__nav a {
  text-decoration: none;
  color: var(--ink-mild);
  padding: 6px 11px;
  font-size: 15.5px;
}
.hx-bar__nav a:hover { color: var(--mauve-deep); background: var(--mauve-mist); }
.hx-bar__nav a[aria-current="page"] {
  color: var(--mauve-deep);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--mauve);
}
.hx-bar__chip {
  display: none;
  justify-self: end;
  border: 1.5px solid var(--harbor);
  color: var(--harbor-deep);
  text-decoration: none;
  padding: 6px 13px;
  font-size: 14px;
  font-variant-caps: small-caps;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.hx-bar__chip:hover { background: var(--harbor); color: var(--card); }
.hx-bar__burger {
  justify-self: end;
  width: 44px;
  height: 44px;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1.5px solid var(--line-strong);
  cursor: pointer;
  padding: 0;
}
.hx-bar__burger span {
  width: 20px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.hx-bar__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hx-bar__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hx-bar__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* small screens: nav folds down from the bar */
.hx-bar__nav.is-open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  background: var(--paper);
  border-bottom: 1px solid var(--line-strong);
  padding: 10px 18px 16px;
}
.hx-bar__nav.is-open a {
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  font-size: 16.5px;
}
.hx-bar__nav.is-open a:last-child { border-bottom: 0; }

/* hero */
.hx-hero { padding: 54px 0 30px; }
.hx-hero--page, .hx-hero--hub { padding: 44px 0 22px; }
.hx-hero h1 { max-width: 21ch; }
.hx-hero__sub {
  font-size: 18.5px;
  color: var(--ink-mild);
  max-width: 62ch;
  margin-top: 12px;
}
.hx-hero__row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

/* buttons: square corners, 1.5px frame, small caps */
.hx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 22px;
  border: 1.5px solid var(--mauve-deep);
  background: var(--mauve);
  color: #fdfcfa;
  font-family: var(--body);
  font-size: 15.5px;
  font-weight: 600;
  font-variant-caps: small-caps;
  letter-spacing: 0.07em;
  text-decoration: none;
  border-radius: 0;
  cursor: pointer;
}
.hx-btn:hover { background: var(--mauve-deep); color: #fdfcfa; }
.hx-btn--line {
  background: transparent;
  border-color: var(--mauve);
  color: var(--mauve-deep);
}
.hx-btn--line:hover { background: var(--mauve-mist); color: var(--mauve-deep); }
.hx-btn[disabled] { opacity: 0.62; cursor: wait; }

/* route ribbon */
.hx-ribbon { margin: 8px 0 26px; }
.hx-ribbon__art { width: 100%; height: auto; display: block; }
.hx-ribbon__art text {
  font-family: var(--body);
  font-size: 15px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  fill: var(--harbor-deep);
}

/* fact strip */
.hx-strip {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 4px;
  margin-bottom: 34px;
  color: var(--ink-mild);
}
.hx-strip__cell { font-size: 15px; }

/* sections */
.hx-sec { padding: 30px 0; }
.hx-sec + .hx-sec { border-top: 1px solid var(--line); }
.hx-more { margin-top: 10px; }
.hx-more a {
  font-variant-caps: small-caps;
  letter-spacing: 0.08em;
  color: var(--harbor-deep);
}

/* departures board */
.hx-board {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  border-top: 1px solid var(--line);
}
.hx-board__row { margin: 0; border-bottom: 1px solid var(--line); }
.hx-board__link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 15px 10px;
  text-decoration: none;
  color: var(--ink);
}
.hx-board__link:hover { background: var(--mauve-mist); color: var(--ink); }
.hx-board__date {
  color: var(--harbor);
  font-weight: 600;
  font-size: 14.5px;
}
.hx-board__title {
  display: block;
  font-family: var(--head);
  font-weight: 700;
  font-size: 1.16rem;
  line-height: 1.3;
}
.hx-board__teaser {
  display: block;
  color: var(--faded);
  font-size: 15.5px;
  margin-top: 3px;
}
.hx-board__meta {
  display: flex;
  align-items: center;
  gap: 12px;
}
.hx-board__len {
  color: var(--faded);
  font-size: 14px;
  white-space: nowrap;
}
.hx-board__void { color: var(--faded); padding: 16px 4px; }

/* section chips */
.hx-tag {
  display: inline-block;
  border: 1px solid var(--mauve);
  color: var(--mauve-deep);
  padding: 2px 10px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.hx-tag--j { border-color: var(--harbor); color: var(--harbor-deep); }
a.hx-tag:hover { background: var(--mauve-mist); }
a.hx-tag--j:hover { background: var(--paper-dim); }

/* article */
.hx-art { padding-bottom: 20px; }
.hx-art .hx-wrap { max-width: 780px; }
.hx-art__head { padding: 44px 0 8px; }
.hx-art__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.hx-art__date, .hx-art__read { color: var(--faded); font-size: 14.5px; }
.hx-art__deck {
  font-size: 19px;
  color: var(--ink-mild);
  margin: 12px 0 22px;
  max-width: 60ch;
}
.hx-art h2 { margin-top: 30px; }

/* route facts float box */
.hx-facts {
  border: 1.5px solid var(--harbor);
  background: var(--card);
  padding: 18px 20px;
  margin: 6px 0 22px;
}
.hx-facts h2 {
  font-size: 1.05rem;
  margin: 0 0 10px;
  color: var(--harbor-deep);
}
.hx-facts dl { margin: 0; }
.hx-facts dl div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.hx-facts dl div:last-child { border-bottom: 0; }
.hx-facts dt { color: var(--faded); font-size: 14px; }
.hx-facts dd { margin: 0; text-align: right; font-size: 15px; }

/* cut figure */
.hx-cut { margin: 26px 0; }
.hx-cut img { width: 100%; border: 1px solid var(--line-strong); }
.hx-cut figcaption { color: var(--faded); font-size: 13.5px; margin-top: 8px; }

/* mile notes */
.hx-milenotes {
  margin-top: 34px;
  padding: 18px 20px;
  background: var(--paper-dim);
  border-left: 3px solid var(--harbor);
}
.hx-milenotes h2 { font-size: 1.05rem; margin: 0 0 8px; }
.hx-milenotes ul { margin: 0; padding-left: 20px; }
.hx-milenotes li { color: var(--ink-mild); font-size: 15px; }

/* byline */
.hx-byline {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 30px 0 8px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.hx-byline img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1.5px solid var(--mauve);
  background: var(--mauve-mist);
}
.hx-byline p { margin: 0; color: var(--ink-mild); font-size: 15.5px; }

/* connecting routes */
.hx-connect { margin: 26px 0 20px; }
.hx-connect h2 { font-size: 1.2rem; }
.hx-connect ul { list-style: none; padding: 0; margin: 0; }
.hx-connect li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
}
.hx-connect li:last-child { border-bottom: 0; }

/* records list on about and contact */
.hx-records { margin: 6px 0 0; }
.hx-records div {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.hx-records div:last-child { border-bottom: 0; }
.hx-records dt { color: var(--faded); font-size: 14px; }
.hx-records dd { margin: 0; }

/* form: underline inputs only */
.hx-form, .hx-time__form { max-width: 560px; }
.hx-field { margin-bottom: 20px; }
.hx-field label {
  display: block;
  color: var(--ink-mild);
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 5px;
}
.hx-field input,
.hx-field select,
.hx-field textarea {
  width: 100%;
  border: 0;
  border-bottom: 1.5px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  font-family: var(--body);
  font-size: 16.5px;
  color: var(--ink);
  padding: 8px 2px;
}
.hx-field input:focus,
.hx-field select:focus,
.hx-field textarea:focus {
  border-bottom-color: var(--mauve);
}
.hx-field textarea { resize: vertical; min-height: 130px; }
.hx-field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 6l4.5 4.5L12.5 6' fill='none' stroke='%235f4370' stroke-width='1.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-size: 15px;
  padding-right: 30px;
}
.hx-form__note { min-height: 1.4em; color: var(--bad); font-size: 15px; margin: 12px 0 4px; }
.hx-form__note.is-good { color: var(--good); }
.hx-form__legal { color: var(--faded); font-size: 14px; }
.hx-void {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* timetable band */
.hx-time { background: var(--mauve-mist); margin-top: 30px; padding: 34px 22px; border-top: 0; }
.hx-time h2 { margin-bottom: 8px; }
.hx-time .hx-field input { border-bottom-color: var(--mauve); background: transparent; }

/* postscript */
.hx-ps p { font-style: italic; color: var(--ink-mild); }

/* footer press */
.hx-press {
  margin-top: 46px;
  background: var(--deep);
  color: #d6d5cd;
  font-size: 15px;
}
.hx-press a { color: #e4e2da; }
.hx-press a:hover { color: #fff; }
.hx-press__lines i {
  display: block;
  height: 1px;
  margin-bottom: 3px;
  background: var(--line);
}
.hx-press__lines i:first-child { background: var(--mauve); margin-top: 0; }
.hx-press__lines i:last-child { background: var(--harbor); margin-bottom: 0; }
.hx-press__in {
  max-width: 1140px;
  margin: 0 auto;
  padding: 30px 18px 26px;
}
.hx-press__colophon {
  text-align: center;
  font-style: italic;
  font-family: var(--head);
  color: #b9b7c6;
  margin-bottom: 30px;
}
.hx-press__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
  padding-bottom: 26px;
  border-bottom: 1px solid #2a2d38;
}
.hx-press__co p { margin-bottom: 10px; color: #b9b8b0; }
.hx-press__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--head);
  font-weight: 700;
  color: #f0efe9;
}
.hx-press__brand span { color: #f0efe9; }
.hx-press__col { display: flex; flex-direction: column; gap: 7px; }
.hx-press__col a { text-decoration: none; font-size: 15px; }
.hx-press__col a:hover { text-decoration: underline; }
.hx-press__h {
  color: #8f93a3;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 4px;
}
.hx-press__legal { padding-top: 20px; color: #9a99a4; font-size: 13.5px; }
.hx-press__legal p { max-width: 74ch; margin-bottom: 8px; }

/* notice card, top left */
.hx-notice {
  position: fixed;
  top: 72px;
  left: 16px;
  z-index: 110;
  width: min(340px, calc(100vw - 32px));
  background: var(--card);
  border: 1.5px solid var(--line-strong);
  border-top: 3px solid var(--mauve);
  box-shadow: 0 10px 28px rgba(20, 22, 29, 0.18);
  padding: 18px 20px;
}
.hx-notice__title {
  font-family: var(--head);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 8px;
}
.hx-notice p { font-size: 14.5px; color: var(--ink-mild); margin-bottom: 10px; }
.hx-notice__row { display: flex; flex-wrap: wrap; gap: 10px; }
.hx-notice .hx-btn { min-height: 44px; padding: 8px 16px; font-size: 14px; }

/* back to top */
.hx-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 100;
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--mauve);
  color: #fdfcfa;
  border: 1.5px solid var(--mauve-deep);
  border-radius: 0;
  cursor: pointer;
}
.hx-top:hover { background: var(--mauve-deep); }

/* wake on scroll, applied only when js is present */
.hx-io .hx-wake {
  opacity: 0;
  transition: opacity 0.7s ease;
}
.hx-io .hx-wake.is-woken { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hx-io .hx-wake { opacity: 1; transition: none; }
  .hx-bar__burger span { transition: none; }
}

/* breakpoints, mobile first */
@media (min-width: 480px) {
  .hx-strip {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
  }
  .hx-notice { width: 340px; }
  .hx-time { padding: 38px 28px; }
}

@media (min-width: 768px) {
  .hx-board__link {
    flex-direction: row;
    align-items: baseline;
    gap: 18px;
  }
  .hx-board__date { flex: 0 0 108px; }
  .hx-board__body { flex: 1 1 auto; }
  .hx-board__meta { flex: 0 0 auto; }
  .hx-facts {
    float: right;
    width: 300px;
    margin: 6px 0 20px 28px;
  }
  .hx-records div { grid-template-columns: 240px 1fr; gap: 14px; }
  .hx-press__grid { grid-template-columns: 1.4fr 1fr; }
  .hx-hero { padding: 72px 0 36px; }
  .hx-sec { padding: 38px 0; }
}

@media (min-width: 840px) {
  .hx-bar__in { grid-template-columns: auto 1fr auto; }
  .hx-bar__nav { display: flex; gap: 2px; }
  .hx-bar__chip { display: inline-flex; }
  .hx-bar__burger { display: none; }
}

@media (min-width: 1024px) {
  .hx-press__grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
  .hx-hero h1 { max-width: 24ch; }
  .hx-art .hx-wrap { padding: 0 24px; }
}

@media (min-width: 1200px) {
  .hx-wrap, .hx-bar__in, .hx-press__in { padding-left: 24px; padding-right: 24px; }
  .hx-hero { padding: 84px 0 40px; }
  .hx-ribbon { margin-bottom: 34px; }
}

/* print, kept short */
@media print {
  .hx-bar, .hx-press, .hx-notice, .hx-top, .hx-skip { display: none; }
  body { background: #fff; color: #000; }
  a { color: #000; text-decoration: none; }
  .hx-facts { float: none; width: auto; }
}

[hidden] { display: none !important; }
