/* Design tokens shared by every site in sites/ (see README). Each build puts this in front of its own style.css. */
:root {
  --sign-blue: #1E4B8F; --ink: #16202B; --ink-2: #4A5763; --ink-3: #5E6B76;
  --page: #F5F5F2; --card: #FFFFFF; --line: #DDE0DB; --divider: #E6E8E3; --pill-border: #C9CEC8;
  --sky: #D6E2E2; --sky-top: #C7D7DA; --ridge-far: #2E6E73; --ridge-near: #1C4A50;
}
* { box-sizing: border-box }
body { margin: 0; background: var(--page); color: var(--ink); font-family: Barlow, system-ui, sans-serif; -webkit-text-size-adjust: 100% }
a { color: inherit }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px }
:is(a, button, select, input, summary):focus-visible { outline: 3px solid var(--sign-blue); outline-offset: 2px }
[hidden] { display: none !important }

/* Header: the small BYGSTAD sign (links home to bygstad.com) and the page name, as on kalender.bygstad.com */
.top { padding: calc(28px + env(safe-area-inset-top)) 16px 4px; text-align: center }
.sign { display: inline-block; background: var(--sign-blue); border-radius: 6px; padding: 3px; box-shadow: 0 3px 8px rgba(18, 52, 59, .25); text-decoration: none }
.sign-inner { display: block; border: 2px solid #fff; border-radius: 4px; padding: 4px 12px 3px }
.sign-text { display: block; font: 700 22px/.95 'Barlow Condensed', sans-serif; letter-spacing: .02em; color: #fff; text-transform: uppercase }
.top h1 { margin: 14px 0 0; font-size: 30px; font-weight: 600; line-height: 1.1 }
.tagline { margin: 4px 0 0; font-size: 17px; color: #2C3A44 }

/* "Oppdatert 14:32": always say how old the data is */
.status { margin: 18px 0 12px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: center }
.status .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--pill-border) }
.status.live .dot { background: #2E8B57; box-shadow: 0 0 0 0 rgba(46, 139, 87, .5); animation: pulse 2.4s ease-out infinite }
.status.stale { color: #8A4B08 }
.status.stale .dot { background: #D98E04 }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(46, 139, 87, .45) } 70%, 100% { box-shadow: 0 0 0 8px rgba(46, 139, 87, 0) } }
@media (prefers-reduced-motion: reduce) { .status.live .dot { animation: none } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px }

/* The map */
.map-card { position: relative; overflow: hidden }
.map { height: clamp(270px, 66vw, 470px); background: #DCE6E8 } /* wide rather than tall: the fjord runs west–east */
.map-fallback { margin: 0; padding: 14px 16px; font-size: 15px; color: var(--ink-2) }
.map-card.failed .map { display: none }
.maplibregl-ctrl-attrib { font: 11px Barlow, sans-serif }
.maplibregl-ctrl-group button { width: 36px; height: 36px }

/* Ship markers: a hull seen from above, turned to its course; a ring when it lies still */
.marker { position: relative; width: 0; height: 0; padding: 0; border: 0; background: none; cursor: pointer; color: var(--sign-blue) }
.marker-hull { position: absolute; left: 0; top: 0; width: var(--size, 26px); height: var(--size, 26px); transform: translate(-50%, -50%) rotate(var(--rot, 0deg)); filter: drop-shadow(0 1px 2px rgba(18, 52, 59, .45)); transition: transform .6s ease }
.marker-hull svg { display: block; width: 100%; height: 100% }
.marker-label { position: absolute; left: 0; top: calc(var(--size, 26px) / 2 + 2px); transform: translateX(-50%); white-space: nowrap; padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, .92); border: 1px solid var(--line); font: 600 12.5px/1.35 Barlow, sans-serif; color: var(--ink); box-shadow: 0 1px 3px rgba(18, 52, 59, .18); pointer-events: none }
.marker-label.hidden { visibility: hidden }
.marker:hover .marker-label.hidden, .marker:focus-visible .marker-label.hidden { visibility: visible; z-index: 1 }
.marker:hover .marker-label, .marker:focus-visible .marker-label { background: var(--sign-blue); border-color: var(--sign-blue); color: #fff }
.marker:focus-visible { outline: none }
.marker:focus-visible .marker-hull { outline: 3px solid var(--sign-blue); outline-offset: 3px; border-radius: 50% }

/* Section headings, as the list heading on bygstad.com */
.block { margin-top: 28px }
.block-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 4px 10px }
.block h2, .about h2 { margin: 0; font: 700 15px 'Barlow Condensed', sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2) }
.count { font-size: 14px; color: var(--ink-2) }
.day { margin: 18px 4px 8px; font-size: 14px; font-weight: 600; color: var(--ink-3) }
.day:first-child { margin-top: 0 }
.day::first-letter { text-transform: uppercase }
.empty { margin: 0; padding: 18px 16px; font-size: 16px; line-height: 1.45; color: var(--ink-2); text-align: center }

/* Ship rows: photo (or a drawing of the kind of ship), name, what it is, when */
.ships { margin: 0; padding: 0; list-style: none; overflow: hidden }
.ships li + li { border-top: 1px solid var(--divider) }
.ship-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 76px; padding: 10px 14px 10px 10px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer }
.ship-row:hover { background: #FAFAF8 }
.ship-row:focus-visible { outline-offset: -3px }
.thumb { flex: none; width: 76px; height: 54px; border-radius: 9px; overflow: hidden; background: #E7EDF3; display: grid; place-items: center }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block }
.thumb svg { width: 86%; height: auto; color: var(--sign-blue) }
.ship-text { flex: 1; min-width: 0 }
.ship-name { display: block; font-size: 17px; font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.ship-meta { display: block; margin-top: 2px; font-size: 14.5px; line-height: 1.35; color: var(--ink-2) }
.ship-when { flex: none; text-align: right; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; line-height: 1.35 }
.ship-when strong { display: block; font-size: 15px; font-weight: 600; color: var(--ink) }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #E3F1E8; color: #1F6B41; font-size: 12.5px; font-weight: 600; vertical-align: 1px }
.badge.visit { background: #E7EDF6; color: var(--sign-blue) }
.chevron { flex: none; color: var(--pill-border) }
.more { display: block; margin: 12px auto 0; }

/* Buttons and fields, as the pills on bygstad.com */
.button { min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--pill-border); background: var(--card); color: var(--ink); font: 600 15.5px Barlow, sans-serif; cursor: pointer }
.button:hover { background: var(--page) }
.button.primary { background: var(--sign-blue); border-color: var(--sign-blue); color: #fff }
.button.primary:hover { background: #183E77 }
.button.quiet { border-color: transparent; background: none; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px }
.button:disabled { opacity: .55; cursor: default }

/* Notifications */
.notify { margin-top: 28px; padding: 18px 18px 16px }
.notify h2 { margin: 0; font-size: 21px; font-weight: 600; line-height: 1.2 }
.notify-lead { margin: 6px 0 14px; font-size: 16px; line-height: 1.45; color: #2C3A44 }
.notify-options { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: end; margin-bottom: 14px }
.field { display: grid; gap: 5px; font-size: 14px; font-weight: 600; color: var(--ink-3) }
.field select { min-height: 42px; padding: 0 36px 0 12px; border-radius: 10px; border: 1px solid var(--pill-border); background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%234A5763' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center; color: var(--ink); font: 500 16px Barlow, sans-serif; appearance: none }
.check { display: flex; align-items: center; gap: 9px; min-height: 42px; font-size: 16px; cursor: pointer }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--sign-blue) }
.buttons { display: flex; flex-wrap: wrap; gap: 8px }
.push-status { margin: 10px 0 0; font-size: 15px; line-height: 1.45; color: var(--ink-2) }
.push-status:empty { display: none }
.hint { margin: 12px 0 0; padding: 12px 14px; border-radius: 10px; background: #EEF2F7; font-size: 15px; line-height: 1.5 }
.hint svg { vertical-align: -3px }

/* About + footer, as on kalender.bygstad.com */
.about { max-width: 580px; margin: 32px auto 0; padding: 0 8px; font-size: 16px; line-height: 1.5; text-align: center; color: #2C3A44 }
.about h2 { margin-bottom: 6px }
.about p { margin: 0 0 8px }
.about a, footer a, .ship-dialog .links a, .credit a { text-decoration: underline; text-decoration-color: var(--pill-border); text-underline-offset: 3px }
.about a:hover, footer a:hover, .ship-dialog .links a:hover, .credit a:hover { color: var(--sign-blue); text-decoration-color: currentColor }
footer { padding: 40px 8px calc(32px + env(safe-area-inset-bottom)); text-align: center; font-size: 14px; line-height: 1.5; color: #2C3A44 }

/* Ship details */
.ship-dialog { width: min(520px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: 0; border: 0; border-radius: 16px; color: var(--ink); background: var(--card); box-shadow: 0 12px 40px rgba(18, 52, 59, .3); overflow: auto }
.ship-dialog::backdrop { background: rgba(22, 32, 43, .45) }
.ship-dialog .close { position: absolute; top: 10px; right: 10px; z-index: 1; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .9); color: var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 1px 4px rgba(18, 52, 59, .25) }
.ship-dialog .close:hover { background: #fff }
.hero { position: relative; aspect-ratio: 16 / 9; background: #E7EDF3; display: grid; place-items: center; overflow: hidden }
.hero img { width: 100%; height: 100%; object-fit: cover; display: block }
.hero svg { width: 62%; height: auto; color: var(--sign-blue); opacity: .9 }
.credit { margin: 0; padding: 6px 20px 0; font-size: 12.5px; line-height: 1.4; color: var(--ink-3) }
.ship-body { padding: 14px 20px 20px }
.ship-dialog h2 { margin: 0; font-size: 26px; font-weight: 600; line-height: 1.15 }
.ship-sub { margin: 4px 0 14px; font-size: 16px; color: var(--ink-2) }
.ship-dialog dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 7px 16px; font-size: 16px; line-height: 1.4 }
.ship-dialog dt { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding-top: 3px }
.ship-dialog dd { margin: 0; font-variant-numeric: tabular-nums }
.ship-dialog .buttons { margin-top: 18px }
.ship-dialog .links { margin: 14px 0 0; font-size: 14.5px; color: var(--ink-2) }

@media (max-width: 480px) {
  .top h1 { font-size: 28px }
  .map-card { margin: 0 -8px; border-radius: 12px }
  .thumb { width: 64px; height: 48px }
  .ship-row { gap: 12px }
  .ship-name { font-size: 16.5px }
}
