/* bray.today — Victorian guidebook styling
   Server-rendered HTML, no framework. Lifted from the design handoff; the only
   change from the handoff CSS is the font @import -> self-hosted @font-face. */

/* self-hosted fonts (latin subset), no third-party request on first paint */
@font-face {
  font-family: 'IM Fell English';
  font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/im-fell-english.woff2') format('woff2');
}
@font-face {
  font-family: 'IM Fell English';
  font-style: italic; font-weight: 400; font-display: swap;
  src: url('/fonts/im-fell-english-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'IM Fell English SC';
  font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/im-fell-english-sc.woff2') format('woff2');
}
@font-face {
  font-family: 'Oswald';
  font-style: normal; font-weight: 400 600; font-display: swap;
  src: url('/fonts/oswald.woff2') format('woff2');
}

:root {
  /* ink + paper */
  --ink:        #1a1a17;   /* body text, rules, borders */
  --ink-soft:   #3d3d34;   /* secondary text — still 9:1 on paper */
  --paper-1:    #eae8d4;   /* sheet gradient, top */
  --paper-2:    #e4e2cc;   /* sheet gradient, middle */
  --paper-3:    #dcdac2;   /* sheet gradient, bottom */
  --plate-bg:   #e9e7d4;   /* mount behind the engraving */
  --desk:       #1e2119;   /* page background behind the sheet */
  --rule:       rgba(26, 26, 23, .35);
  --rule-soft:  rgba(26, 26, 23, .22);
  --tint:       rgba(26, 26, 23, .04);   /* alternating table rows */
  --tint-head:  rgba(26, 26, 23, .06);   /* table head */

  /* type */
  --serif:      'IM Fell English', Georgia, serif;   /* body, italics */
  --smallcaps:  'IM Fell English SC', Georgia, serif; /* labels, headings, figures */
  --grotesque:  'Oswald', 'Helvetica Neue', sans-serif; /* flags, "Advertisement" */

  /* measure */
  --sheet-max:  440px;
  --gutter:     26px;
  --tap:        48px;      /* minimum control height */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--desk);
  background-image: radial-gradient(85% 50% at 50% 0%, rgba(160, 170, 130, .10) 0%, transparent 65%);
  font-family: var(--serif);
  color: var(--ink);
}

a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-style: dashed; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
::selection { background: #cfcdb2; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- the sheet ---------- */

.page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 22px 16px 56px;
}

.sheet {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: var(--sheet-max);
  background: linear-gradient(172deg, var(--paper-1) 0%, var(--paper-2) 55%, var(--paper-3) 100%);
  box-shadow: 0 34px 70px rgba(0, 0, 0, .6), 0 0 0 1px #14160f;
}

/* paper grain + vignette; decorative only */
.sheet::before,
.sheet::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
}
.sheet::before {
  opacity: .34;
  background-image: radial-gradient(rgba(90, 90, 70, .5) .5px, transparent .6px);
  background-size: 3px 3px;
}
.sheet::after {
  background: radial-gradient(115% 65% at 50% 45%, transparent 60%, rgba(60, 60, 40, .14) 100%);
}

.sheet > * { position: relative; }

.masthead { padding: 16px var(--gutter) 0; }
.body     { padding: 0 var(--gutter) 30px; }

/* ---------- running head + wordmark ---------- */

.runninghead {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 0 12px;
  font-family: var(--smallcaps);
  /* fluid: fits one line across phone widths — tracks content width
     (100vw minus the two fixed gutters), capped at the design's 13px */
  font-size: clamp(9.5px, calc((100vw - 52px) / 32), 13px);
  letter-spacing: .1em;
}
.runninghead__title { letter-spacing: .16em; }

.rule       { height: 1px; background: var(--ink); opacity: .5; }
.rule--tight { margin-top: 5px; }
.rule--head  { margin: 10px 0 0; }

.wordmark {
  margin: 0; padding: 12px 0 2px;
  display: flex; align-items: baseline; gap: 9px;
}
.wordmark__bray {
  font-family: var(--smallcaps); font-weight: 600;
  font-size: 27px; letter-spacing: .18em; text-indent: .18em; line-height: 1;
}
.wordmark__today {
  font-family: var(--serif); font-style: italic; font-size: 20px; line-height: 1;
}

/* ---------- weather + tide, side by side ---------- */

.panels {
  margin-top: 16px;
  border: 1px solid var(--ink);
  display: grid; grid-template-columns: 1fr 1fr;
}
.panel { padding: 16px 12px; text-align: center; }
.panel + .panel { border-left: 1px solid var(--ink); }

.panel__head {
  margin: 0;
  font-family: var(--smallcaps); font-weight: 400;
  font-size: 14px; letter-spacing: .2em; text-transform: uppercase;
}
.panel__figure { font-family: var(--smallcaps); font-size: 46px; line-height: 1; }
.panel__state  { font-family: var(--smallcaps); font-size: 32px; line-height: 1.15; letter-spacing: .03em; }
.panel__note   { font-family: var(--serif); font-style: italic; font-size: 16px; margin-top: 6px; }
.panel__call   { margin: 0; font-size: 17px; line-height: 1.35; text-wrap: pretty; }
.panel__meta   { font-family: var(--smallcaps); font-size: 13px; letter-spacing: .08em; margin-top: 10px; }

.hairline { margin: 12px auto; width: 34px; height: 1px; background: var(--ink); opacity: .55; }

.tidetable { display: flex; flex-direction: column; gap: 5px; text-align: left;
  font-family: var(--smallcaps); font-size: 13px; letter-spacing: .04em; }
.tidetable div { display: flex; justify-content: space-between; gap: 6px; }

/* ---------- section headings ---------- */

.section { margin-top: 28px; }
.section__head {
  margin: 0;
  font-family: var(--smallcaps); font-weight: 400;
  font-size: 20px; letter-spacing: .16em; text-transform: uppercase;
}
.section__sub { font-family: var(--serif); font-style: italic; font-size: 15px; margin-top: 4px; }
.listing-note { margin: 16px 0 0; text-align: center; font-family: var(--serif); font-style: italic; font-size: 12px; line-height: 1.45; color: var(--ink-soft); text-wrap: pretty; }
.section__rule { margin: 10px auto 0; width: 40px; height: 1px; background: var(--ink); }

/* ---------- ruled tables (departures AND events) ---------- */

.ledger { width: 100%; border-collapse: collapse; border: 1px solid var(--ink); text-align: left; }
.ledger caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ledger thead tr { background: var(--tint-head); }
.ledger th[scope="col"] {
  font-family: var(--smallcaps); font-weight: 400; font-size: 12px; letter-spacing: .06em;
  padding: 8px; border-bottom: 1px solid var(--ink);
}
.ledger th, .ledger td { border-right: 1px solid var(--ink); }
.ledger th:last-child, .ledger td:last-child { border-right: none; }
.ledger tbody tr { border-bottom: 1px solid var(--rule); }
.ledger tbody tr:last-child { border-bottom: none; }
.ledger tbody tr:nth-child(even) { background: var(--tint); }
.ledger tbody th, .ledger tbody td { padding: 12px 8px; vertical-align: top; font-weight: 400; }

.ledger__num  { text-align: center; font-family: var(--smallcaps); font-size: 24px; }
.ledger__dest { font-family: var(--smallcaps); font-size: 16px; letter-spacing: .02em; display: block; }
.ledger__line { font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--ink-soft); display: block; }
.ledger__note { text-align: center; font-family: var(--serif); font-style: italic; font-size: 14px; }
.ledger__foot { margin: 8px 0 0; font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--ink-soft); }

/* event rows: small-caps lead-in, description runs on */
.entry { margin: 0; font-family: var(--serif); font-size: 17px; line-height: 1.4; text-wrap: pretty; }
.entry__lead { font-family: var(--smallcaps); font-size: 17px; letter-spacing: .02em; }
.entry--cancelled { color: var(--ink-soft); text-decoration: line-through; }
.entry__meta { display: flex; align-items: center; gap: 12px; margin-top: 6px; flex-wrap: wrap; }
.entry__flag {
  font-family: var(--grotesque); font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  border: 1px solid var(--ink); padding: 3px 7px;
}
.entry__source { font-family: var(--smallcaps); font-size: 13px; letter-spacing: .06em; padding: 4px 0; display: inline-block; }

/* ---------- tabs ---------- */

.tabs { display: grid; grid-template-columns: repeat(3, 1fr); margin: 16px 0 6px; border: 1px solid var(--ink); }
.tab {
  font-family: var(--smallcaps); font-size: 15px; letter-spacing: .08em;
  min-height: var(--tap); padding: 12px 4px;
  background: transparent; color: var(--ink); border: none; cursor: pointer;
}
.tab + .tab { border-left: 1px solid var(--ink); }
.tab:hover { background: rgba(26, 26, 23, .1); }
.tab[aria-selected="true"] { background: var(--ink); color: var(--paper-1); }

/* ---------- ornament + plate ---------- */

.ornament { margin: 20px 0 6px; }
.ornament img { display: block; width: 100%; height: auto; }

.plate { margin: 10px 0 0; }
.plate__mount { border: 1px solid var(--ink); padding: 7px; background: var(--plate-bg); }
.plate__mount img { display: block; width: 100%; height: auto; }
.plate figcaption {
  text-align: center; font-family: var(--smallcaps);
  font-size: 12px; letter-spacing: .16em; margin-top: 8px;
}

/* ---------- advertisement (install prompt) ---------- */

.advert { margin-top: 8px; border: 1px solid var(--ink); padding: 18px 16px; text-align: center; }
.advert__label { font-family: var(--smallcaps); font-size: 16px; letter-spacing: .24em; text-transform: uppercase; }
.advert__head  { font-family: var(--smallcaps); font-size: 25px; letter-spacing: .04em; line-height: 1.2; margin-top: 12px; }
.advert__sub   { font-family: var(--grotesque); font-weight: 500; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; margin-top: 9px; }
.advert__body  { margin: 0; font-family: var(--serif); font-style: italic; font-size: 14px; line-height: 1.5; color: var(--ink-soft); text-wrap: pretty; }
.advert__info  { margin: 0; font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 11px; line-height: 1.5; color: var(--ink-soft); }
.advert__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.btn {
  font-family: var(--grotesque); font-weight: 500; font-size: 13px;
  letter-spacing: .16em; text-transform: uppercase;
  min-height: var(--tap); padding: 12px 20px; cursor: pointer;
  border: 1px solid var(--ink); background: transparent; color: var(--ink);
}
.btn:hover { background: var(--ink); color: var(--paper-1); }
.btn--quiet { border-color: rgba(26, 26, 23, .5); color: var(--ink); }
.btn--quiet:hover { background: rgba(26, 26, 23, .09); color: var(--ink); }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--paper-1); }

/* ---------- colophon ---------- */

.colophon { text-align: center; margin-top: 28px; }
.colophon p { margin: 0; font-family: var(--serif); font-style: italic; font-size: 10px; line-height: 1.45; text-wrap: pretty; }
.colophon__imprint { font-family: var(--smallcaps); font-size: 13px; letter-spacing: .12em; margin-top: 12px; }
.colophon__stamp   { font-family: var(--smallcaps); font-size: 12px; letter-spacing: .14em; margin-top: 4px; color: var(--ink-soft); }

/* screen-reader only */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
