@import url("./pages.css");

:root {
  --paper: #f8f6ed;
  --paper-dark: #eeeadd;
  --white: #fffcf4;
  --ink: #173e39;
  --body: #344941;
  --muted: #53695e;
  --line: #b9c4b5;
  --rule: #6e8274;
  --blue: #285d70;
  --rust: #a04d31;
  --gold: #c88e3b;
  --tint: #e8eddf;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Avenir Next", "Segoe UI", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 1rem; }
body { margin: 0; font-size: 1rem; line-height: 1.57; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
h1, h2 { font-family: var(--serif); font-weight: 500; }
h1 { font-size: clamp(3.25rem, 5.5vw, 5.65rem); letter-spacing: -.065em; line-height: .99; }
h2 { font-size: clamp(2rem, 3.3vw, 3rem); letter-spacing: -.05em; line-height: 1.12; }
h3 { line-height: 1.2; }
p { color: var(--body); }
a { color: inherit; text-underline-offset: .21em; }
a:hover { color: var(--rust); }
button, input { font: inherit; }
button, summary { cursor: pointer; }
:focus-visible { outline: 3px solid #b5562e; outline-offset: 4px; }
[hidden] { display: none !important; }
.wrap { max-width: 1440px; width: calc(100% - clamp(2rem, 8.9vw, 11rem)); margin-inline: auto; }
.skip { position: fixed; top: .5rem; left: .5rem; padding: .65rem 1rem; background: var(--white); color: var(--ink); z-index: 20; transform: translateY(-170%); }
.skip:focus { transform: none; }
.mast { background: var(--ink); color: var(--paper); border-bottom: 4px solid #d4b276; }
.bar { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; font: bold 2rem/1 var(--serif); letter-spacing: -.07em; text-decoration: none; min-height: 44px; }
.brand svg { width: 33px; height: 33px; color: #eee8cb; }
.brand i { font-weight: 400; color: #d9dfc8; }
.mast a:hover, .mast summary:hover { color: #ead49d; }
.mast :focus-visible, footer :focus-visible { outline-color: #f5ca7c; }
.desktop-nav, .mobile-nav nav { display: flex; align-items: center; gap: clamp(.85rem, 2.1vw, 2.3rem); }
.mast nav a { text-decoration: none; line-height: 1.2; padding-block: 15px; font-size: .91rem; font-weight: 550; }
.mast nav a[aria-current] { text-decoration: underline; text-decoration-color: #d9b87d; text-underline-offset: 6px; }
.mobile-nav { display: none; }
.tag, .overline, .count, figcaption, .field-label { font: 600 .71rem/1.5 var(--mono); text-transform: uppercase; letter-spacing: .105em; }
.overline { display: flex; gap: .65rem; align-items: center; color: var(--muted); margin-bottom: 1.15rem; }
.overline::before { content: ""; display: inline-block; width: 26px; height: 3px; background: var(--rust); }
.lede { font-size: clamp(1.03rem, 1.28vw, 1.2rem); line-height: 1.56; max-width: 53ch; margin-top: 1.15rem; }
.ledger { border-bottom: 1px solid var(--line); }
.ledger-mast {
  background-color: #e6ebdf;
  background-image: linear-gradient(90deg, #e6ebdf 46%, transparent 100%),
    repeating-linear-gradient(90deg, transparent 0 31px, #68877720 31px 32px),
    repeating-linear-gradient(0deg, transparent 0 31px, #68877720 31px 32px);
  border-bottom: 1px solid var(--rule);
}
.ledger-mast-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem 1.05rem;
}
.ledger-mast h1 {
  font-size: clamp(1.9rem, 3vw, 2.7rem);
  line-height: 1.12;
  letter-spacing: -.045em;
}
.ledger-mast p { margin-top: .28rem; font-size: .98rem; }
.directory-jump {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  flex-shrink: 0;
  font-weight: 650;
  font-size: .85rem;
}
.count { color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: .04em; text-transform: none; }
.filterbar {
  display: flex;
  justify-content: space-between;
  gap: 1.3rem;
  align-items: end;
  padding: .95rem 0 1rem;
}
.filterbar .field-label { display: block; margin-bottom: .32rem; font-size: .65rem; color: var(--muted); }
.modes { display: flex; flex-wrap: wrap; gap: .4rem; }
.search-field { width: clamp(17.5rem, 26vw, 24rem); min-width: 0; }
.mode, .more, .action { border: 1px solid #94a493; border-radius: 4px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .48rem; font-weight: 600; font-size: .88rem; min-height: 44px; padding: .55rem .88rem; background: transparent; color: var(--ink); }
.mode[aria-pressed="true"], .action.primary { background: var(--ink); color: var(--white); border-color: var(--ink); }
.mode:hover, .more:hover, .action:hover { border-color: var(--ink); background: var(--tint); color: var(--ink); }
.mode[aria-pressed="true"]:hover, .action.primary:hover { background: #325649; color: white; }
.lookup { display: flex; align-items: center; gap: .5rem; border: 1px solid #94a493; border-radius: 4px; padding-inline: .8rem; background: var(--white); }
.lookup input { width: 100%; min-width: 0; font-size: .9rem; background: transparent; border: 0; color: var(--ink); padding-block: .62rem; min-height: 44px; }
.lookup:focus-within { outline: 3px solid var(--rust); outline-offset: 2px; }
.lookup input:focus { outline: none; }
.lookup input::placeholder { color: var(--muted); }
.icon { width: 19px; height: 19px; flex: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.port-table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.port-table .town-col { width: 19%; }
.port-table .mode-col { width: 15%; }
.port-table .point-col { width: 37%; }
.port-table .operator-col { width: 29%; }
.port-table th, .port-table td { text-align: left; vertical-align: middle; overflow-wrap: anywhere; }
.port-table thead th {
  padding: .6rem .9rem;
  color: var(--paper);
  background: var(--ink);
  font: 600 .68rem/1.4 var(--mono);
  text-transform: uppercase;
  letter-spacing: .1em;
}
.port-table .entry { border-bottom: 1px solid var(--line); }
.port-table .entry > * { padding: .55rem .9rem; }
.port-table .entry:focus-within { background: #eaf0e4; }
.town-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font: 600 clamp(1.08rem, 1.55vw, 1.4rem)/1.25 var(--serif);
  text-decoration: none;
  letter-spacing: -.035em;
}
.town-link:hover { text-decoration: underline; }
.point-content { display: flex; align-items: center; gap: .8rem; }
.point-content > div { min-width: 0; }
.point-name, .task-link { font-size: .97rem; font-weight: 650; line-height: 1.35; }
.task-link { display: inline-flex; align-items: center; min-height: 44px; text-decoration-thickness: 1px; }
.point-detail { display: block; color: var(--muted); font-size: .79rem; line-height: 1.4; }
.ferry-swatch {
  width: clamp(5.7rem, 8vw, 7.2rem);
  height: 3.55rem;
  flex-shrink: 0;
  object-fit: cover;
  object-position: center 60%;
  border: 1px solid var(--rule);
}
.operator-link {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 44px;
  line-height: 1.35;
  text-decoration: none;
}
.operator-name { font-size: .9rem; font-weight: 650; }
.operator-action { font-size: .8rem; color: var(--blue); text-decoration: underline; text-underline-offset: .18em; }
.operator-link:hover .operator-action { color: var(--rust); }
.mobile-field { display: none; }
.key {
  display: inline-flex;
  align-items: center;
  gap: .43rem;
  padding: .25rem .48rem;
  border: 1px solid currentColor;
  border-radius: 2px;
  font: 500 .73rem/1.35 var(--mono);
  color: #315b69;
  background: #e4edef;
}
.key::before { content: ""; width: 8px; height: 8px; flex-shrink: 0; background: currentColor; border-radius: 50%; }
.key.road { color: #84492e; background: #f1e7db; }
.key.road::before { border-radius: 0; }
.key.walk { color: #44633f; background: #e5eddf; }
.key.walk::before { clip-path: polygon(50% 0,100% 100%,0 100%); border-radius: 0; }
.key.service { color: #715227; background: #f2ebd9; }
.key.service::before { border-radius: 0; transform: rotate(45deg) scale(.8); }
.source { font-size: .86rem; font-weight: 650; display: inline-flex; align-items: center; gap: .38rem; min-height: 44px; text-decoration-thickness: 1px; }
.source::after { content: none; font-family: var(--sans); text-decoration: none; }
.ledger-end { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding: .8rem 0 1rem; }
.empty { padding: 1.2rem 0; }
.section { padding-block: clamp(2.5rem, 5vw, 5rem); }
.topic-band { border-top: 1px solid var(--rule); background: #e8ecdf; }
.topic-list { display: grid; grid-template-columns: repeat(4,1fr); gap: 2rem; margin-top: 1.75rem; }
.topic-list article { border-top: 2px solid var(--ink); padding-top: 1rem; }
.topic-list h3 { font: 500 1.6rem/1.25 var(--serif); letter-spacing: -.035em; }
.topic-list a { display: inline-flex; gap: .5rem; align-items: center; min-height: 44px; text-decoration: none; }
.topic-list p { margin-top: .45rem; font-size: .95rem; }
.text-link { font-weight: 650; min-height: 44px; display: inline-flex; align-items: center; gap: .4rem; }
.city-index { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); column-gap: 2rem; margin-top: 1.5rem; list-style: none; padding: 0; }
.city-index a { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding: .78rem .12rem; text-decoration: none; font: 500 1.25rem/1.3 var(--serif); }
.city-index a::after { content: "→"; font-family: var(--sans); color: var(--muted); }
footer { padding: 1.6rem 0; background: var(--ink); color: var(--paper); }
footer p { color: #d1d9cd; font-size: .84rem; }
footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 1rem 2rem; flex-wrap: wrap; }
footer nav { display: flex; flex-wrap: wrap; gap: .25rem 1.35rem; }
footer nav a { color: #f7f5e9; display: inline-flex; align-items: center; min-height: 44px; font-size: .88rem; }
footer a:hover { color: #e6c789; }
@media(max-width: 920px) {
  .filterbar { gap: .8rem; }
  .mode { padding-inline: .6rem; }
  .port-table .town-col { width: 18%; }
  .port-table .mode-col { width: 16%; }
  .port-table .entry > *, .port-table thead th { padding-inline: .6rem; }
  .ferry-swatch { width: 4.2rem; height: 3rem; }
}
@media(max-width: 760px) {
  .ledger-mast-inner { padding-block: .75rem; }
  .ledger-mast h1 { font-size: clamp(1.67rem, 5.5vw, 2.15rem); }
  .ledger-mast p { margin-top: .2rem; font-size: .88rem; line-height: 1.4; }
  .directory-jump { display: none; }
  .filterbar { display: grid; gap: .65rem; padding-block: .75rem; }
  .search-field { width: 100%; }
  .port-table, .port-table tbody { display: block; width: 100%; }
  .port-table colgroup { display: none; }
  .port-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .port-table tbody { border-top: 2px solid var(--ink); }
  .port-table .entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "town mode" "point point" "operator operator";
    align-items: center;
    gap: .15rem .6rem;
    padding: .48rem .15rem .6rem;
  }
  .port-table .entry > * { display: block; padding: 0; }
  .town-cell { grid-area: town; }
  .town-link { font-size: 1.3rem; }
  .mode-cell { grid-area: mode; }
  .point-cell { grid-area: point; }
  .point-content { gap: .65rem; }
  .ferry-swatch { width: 5.35rem; height: 3rem; }
  .operator-cell { grid-area: operator; }
  .mobile-field { display: inline-block; margin-right: .5rem; font: 600 .62rem/1.35 var(--mono); color: var(--muted); letter-spacing: .07em; text-transform: uppercase; }
  .operator-link { vertical-align: middle; max-width: 100%; }
}
@media(max-width: 850px) {
  .topic-list { grid-template-columns: repeat(2,1fr); }
  .desktop-nav { gap: .9rem; }
  .bar { min-height: 62px; }
}
@media(max-width: 710px) {
  .bar { position: relative; }
  .desktop-nav { display: none; }
  .mobile-nav { display: block; }
  .mobile-nav summary { display: flex; align-items: center; gap: .55rem; min-height: 44px; font-weight: 600; list-style: none; }
  .mobile-nav summary::-webkit-details-marker { display:none; }
  .mobile-nav nav { position: absolute; z-index: 5; inset: 100% -1px auto; background: var(--ink); display: grid; gap: 0; border: 1px solid #617c6d; padding: .25rem 1rem .5rem; }
  .mobile-nav nav a + a { border-top: 1px solid #557264; }
  .filterbar { align-items: stretch; }
  .lookup { width: 100%; }
  .lookup input { width: 100%; min-width: 0; }
  .mode { padding: .5rem .7rem; }
  .city-index { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .topic-list, .city-index { column-gap: 1.1rem; }
}
@media(max-width: 430px) {
  .modes { gap: .35rem; }
  .mode { font-size: .82rem; padding-inline: .56rem; }
  .mode .icon { width:16px; }
  .topic-list { grid-template-columns: 1fr; gap: 1.25rem; }
  .count { font-size: .67rem; }
  .brand { font-size:1.8rem; }
}
@media(prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
