/* Flight Log. Dark page, paper cards, claret and foil gold; Playfair Display for names, Inter for everything else.
   Phone first: the layout is one column and every control is at least 44px tall. */

:root {
    --page: #171013;
    --text: #f3e9dc;
    --muted: #b9a7a0;
    --line: #3a2a2f;
    --line-strong: #5a4549;
    --paper: #f2e8d5;
    --ink: #2b1a1f;
    --ink-soft: #4d3a3f;
    --ink-muted: #6d5a5c;
    --claret: #8e2441;
    --gold: #d9b25f;
    --gold-light: #ecd08e;
    --green: #2f7a2a;
    --serif: 'Playfair Display', Georgia, serif;
    --sans: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html { font-size: 16px; }
body { background: var(--page); color: var(--text); font-family: var(--sans); margin: 0; }
a { color: var(--gold); }
a:hover { color: var(--gold-light); }
h1, h2 { font-family: var(--serif); font-weight: 800; margin: 0; }

.container { max-width: 720px; padding-left: 16px; padding-right: 16px; }
.page { display: flex; flex-direction: column; gap: 16px; padding-top: 16px; padding-bottom: 40px; }

/* ---- header ---- */
.site-header { border-bottom: 1px solid var(--line); }
.site-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-family: var(--serif); font-weight: 800; font-size: 1.375rem; letter-spacing: 0.02em; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.brand { flex: 0 0 auto; white-space: nowrap; }
.brand svg { width: 18px; height: 24px; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who form { margin: 0; }
.who-name { flex: 0 1 auto; min-width: 0; font-size: 0.875rem; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* On a phone the admin has three things beside the name of the site; the buttons keep their size and the name gives way. */
@media (max-width: 420px) { .who { gap: 8px; } .who .btn-line { padding: 0 10px; } }

/* ---- buttons ---- */
.btn-line, .btn-ink {
    display: inline-flex; align-items: center; justify-content: center; min-height: 44px; box-sizing: border-box;
    padding: 0 14px; border-radius: 10px; font: inherit; font-weight: 800; font-size: 0.875rem; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn-line { background: transparent; border: 1px solid var(--line-strong); color: var(--text); }
.btn-line:hover { border-color: var(--gold); color: var(--gold-light); }
.btn-ink { background: transparent; border: 2px solid var(--ink); color: var(--ink); }
.btn-ink:hover { background: var(--ink); color: var(--paper); }
:is(.btn-line, .btn-ink, .brand):focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---- paper cards ---- */
.card-paper { background: var(--paper); color: var(--ink); border-radius: 16px; padding: 16px; }
.eyebrow { display: flex; align-items: center; gap: 8px; font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--claret); }
.eyebrow .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(47, 122, 42, 0.2); }
.label { font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-muted); }
.fine { font-size: 0.75rem; color: var(--muted); margin: 0; }
.alert-ink { margin: 0; padding: 10px 12px; border: 2px solid var(--claret); border-radius: 10px; font-weight: 600; color: var(--claret); }

.hero { border-top: 16px solid var(--gold); display: flex; flex-direction: column; gap: 10px; }
.hero h1 { font-size: 2.5rem; line-height: 1; }
.hero-sub { margin: 0; font-size: 0.875rem; line-height: 1.45; color: var(--ink-muted); }

.next-stop { display: flex; align-items: center; gap: 12px; border: 2px solid var(--ink); border-radius: 12px; padding: 10px 12px; }
.next-body { flex: 1; min-width: 0; }
.next-name { font-family: var(--serif); font-weight: 700; font-size: 1.25rem; line-height: 1.15; }
.next-detail { font-size: 0.8125rem; color: var(--ink-soft); }

.stop-no {
    flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; background: var(--claret); color: var(--paper);
    font-family: var(--serif); font-weight: 800; font-size: 1.0625rem; display: flex; align-items: center; justify-content: center;
}

/* ---- a day of the schedule ---- */
.day { display: flex; flex-direction: column; gap: 10px; }
.day h2 { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 1.5rem; border-bottom: 3px double var(--line-strong); padding-bottom: 4px; }
.day-side { display: flex; align-items: baseline; gap: 12px; }
/* On a phone the day's name, the count and the route link do not fit on one line; the route link is the one to keep. */
@media (max-width: 480px) { .day-side.has-route small { display: none; } }
.day-route { display: inline-flex; align-items: center; min-height: 44px; margin: -12px 0; padding: 0 2px; font-family: var(--sans); font-size: 0.8125rem; font-weight: 800; white-space: nowrap; }
.day h2 small { font-family: var(--sans); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.day.today h2 { color: var(--gold); }

.stops { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.stops > li { display: flex; gap: 10px; align-items: stretch; }
.stop-time { flex: 0 0 68px; text-align: right; padding-top: 12px; font-weight: 800; font-size: 0.875rem; white-space: nowrap; }
.stop.break .stop-time { color: var(--muted); }
.stop.next .stop-time { color: var(--gold); }

.stop-card { flex: 1; min-width: 0; border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.stop.tasting .stop-card { background: var(--paper); color: var(--ink); }
.stop.break .stop-card { border: 1px dashed var(--line-strong); padding: 10px 12px; }
.stop.next .stop-card { box-shadow: 0 0 0 3px var(--gold); }
.stop-head { display: flex; align-items: center; gap: 10px; }
.stop-title { flex: 1; min-width: 0; }
.stop-name { font-family: var(--serif); font-weight: 700; font-size: 1.25rem; line-height: 1.15; overflow-wrap: anywhere; }
.stop.break .stop-name { font-family: var(--sans); font-size: 0.9375rem; }
.stop-sub { font-size: 0.8125rem; color: var(--ink-muted); }
.stop.break .stop-sub { color: var(--muted); }
.stop-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stop.tasting .stop-foot { border-top: 3px double var(--ink); padding-top: 8px; }
.stop-state { font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--claret); }
.stop.break .btn-ink { border: 1px solid var(--line-strong); color: var(--text); }
.stop.break .btn-ink:hover { background: transparent; border-color: var(--gold); color: var(--gold-light); }

/* Whether a stop is booked. Outlined = still to reserve (the one to act on), filled = booked, dashed = walk-in.
   The word carries the meaning; the shape and colour only help the eye find the ones still to do. */
.booking {
    display: inline-flex; align-items: center; margin: 4px 0 3px; padding: 2px 9px; border-radius: 999px; border: 1.5px solid currentColor;
    font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.1em; line-height: 1.4; text-transform: uppercase; white-space: nowrap;
}
.booking.reserve { color: var(--claret); }
.booking.booked { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.booking.walkin { border-style: dashed; color: var(--ink-muted); }
.stop.break .booking.reserve { color: var(--gold); }
.stop.break .booking.booked { background: var(--text); border-color: var(--text); color: var(--page); }
.stop.break .booking.walkin { color: var(--muted); }
.hero .booking { margin: 0; }

.travel-note { display: flex; align-items: center; gap: 8px; padding: 0 4px; font-size: 0.8125rem; color: var(--muted); }
.travel-note svg { width: 16px; height: 16px; flex: 0 0 16px; }

.notes { display: flex; flex-direction: column; gap: 6px; }
.notes p { margin: 0; font-size: 0.875rem; line-height: 1.45; color: var(--ink-soft); }

@media (max-width: 380px) {
    .stop-time { flex-basis: 60px; font-size: 0.8125rem; }
    .hero h1 { font-size: 2.125rem; }
}

/* ---- the note about what just happened ----
   Sticky, because a save often lands on an anchor further down the page and the note would be off screen. */
.flash {
    position: sticky; top: 8px; z-index: 20; display: flex; align-items: flex-start; gap: 10px;
    background: var(--paper); color: var(--ink); border: 2px dashed var(--claret); border-radius: 10px; padding: 10px 12px;
    font-weight: 600; font-size: 0.9375rem; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.flash > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.flash-close { flex: 0 0 auto; width: 32px; height: 32px; margin: -4px -6px -4px 0; border: 0; background: none; color: var(--claret); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.stop, .adm-stop { scroll-margin-top: 76px; }

.btn-gold {
    display: inline-flex; align-items: center; justify-content: center; min-height: 44px; box-sizing: border-box;
    padding: 0 16px; border-radius: 10px; border: 1px solid var(--gold); background: var(--gold); color: var(--ink);
    font: inherit; font-weight: 800; font-size: 0.875rem; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn-gold:hover { background: var(--gold-light); border-color: var(--gold-light); color: var(--ink); }
:is(.btn-gold, .flash-close):focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn-gold:focus-visible { outline-color: var(--text); }

/* The admin's own controls on a stop card of the trip page. */
.adm-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.adm-row form { margin: 0; }

/* ---- admin pages ---- */
.adm-title { font-size: 2rem; line-height: 1.1; overflow-wrap: anywhere; }
.adm-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 0.875rem; color: var(--muted); }
.adm-crumbs a { display: inline-flex; align-items: center; min-height: 44px; }
.adm-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.adm-panel { border: 1px solid var(--line-strong); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.adm-panel h2 { font-size: 1.375rem; }
.adm-note { margin: 0; font-size: 0.8125rem; line-height: 1.45; color: var(--muted); }
.adm-day { margin: 6px 0 0; font-family: var(--sans); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold); }
.adm-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.adm-link { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--text); text-decoration: none; }
.adm-link:hover { border-color: var(--gold); color: var(--text); }
.adm-link-name { font-family: var(--serif); font-weight: 700; font-size: 1.25rem; line-height: 1.15; }
.adm-link-sub { font-size: 0.8125rem; color: var(--muted); }

.adm-stop { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.adm-stop:target { border-color: var(--gold); }
.adm-stop-top { display: flex; align-items: center; gap: 10px; }
.adm-stop-time { flex: 0 0 68px; font-weight: 800; font-size: 0.875rem; white-space: nowrap; }
.adm-stop-body { flex: 1; min-width: 0; }
.adm-stop-name { font-weight: 700; overflow-wrap: anywhere; }
.adm-stop-sub { font-size: 0.8125rem; color: var(--muted); }

/* Four booking states side by side; the one that holds is filled. One tap changes it. */
.adm-seg { display: flex; margin: 0; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.adm-seg button {
    flex: 1 1 0; min-width: 0; min-height: 44px; padding: 0 4px; border: 0; border-left: 1px solid var(--line-strong);
    background: transparent; color: var(--muted); font: inherit; font-weight: 700; font-size: 0.75rem; cursor: pointer;
}
.adm-seg button:first-of-type { border-left: 0; }
.adm-seg button:hover { color: var(--gold-light); }
.adm-seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); font-weight: 800; }
.adm-seg button:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }

.adm-problems { border: 2px solid var(--gold); border-radius: 10px; padding: 10px 12px; font-size: 0.9375rem; }
.adm-problems ul { margin: 4px 0 0; padding-left: 1.2rem; }
.adm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.adm-danger { border-color: var(--claret); color: #f0a9b8; }
.adm-danger:hover { border-color: #f0a9b8; color: #f8d3da; }

/* Bootstrap's form controls, re-inked for this page. Scoped to the admin panels so nothing else changes. */
.adm-panel .form-label { margin-bottom: 4px; font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.adm-panel :is(.form-control, .form-select) { min-height: 44px; background-color: #221a1d; border: 1px solid var(--line-strong); color: var(--text); }
.adm-panel :is(.form-control, .form-select):focus { background-color: #221a1d; border-color: var(--gold); color: var(--text); box-shadow: 0 0 0 0.2rem rgba(217, 178, 95, 0.3); }
.adm-panel .form-control::placeholder { color: #8a7a76; }
.adm-panel .form-text { margin-top: 4px; font-size: 0.75rem; line-height: 1.4; color: var(--muted); }
.adm-panel input[type="date"], .adm-panel input[type="time"] { color-scheme: dark; }

/* Voters, and the short one-line "add" forms. */
.adm-voter { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; }
.adm-voter form { margin: 0; }
.adm-voter-form { flex: 1 1 260px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; min-width: 0; }
.adm-voter-name { flex: 1 1 100%; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
@media (min-width: 620px) { .adm-voter-name { flex: 1 1 120px; } }
.adm-check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 0.875rem; white-space: nowrap; cursor: pointer; }
.adm-check .form-check-input { width: 1.25rem; height: 1.25rem; margin: 0; background-color: #221a1d; border: 1px solid var(--line-strong); }
.adm-check .form-check-input:checked { background-color: var(--gold); border-color: var(--gold); }
.adm-check .form-check-input:focus { border-color: var(--gold); box-shadow: 0 0 0 0.2rem rgba(217, 178, 95, 0.3); }
.adm-add { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 14px; margin: 0; }
.adm-grow { flex: 1 1 200px; min-width: 0; }
.adm-invite { border: 2px solid var(--gold); border-radius: 12px; padding: 10px 12px; }
.adm-invite-row { display: flex; gap: 8px; }
.adm-invite-row .form-control { flex: 1; min-width: 0; font-size: 0.8125rem; }

/* A tasting's wines in pouring order. The handle is the only part that drags (touch-action: none),
   so a finger anywhere else on a row still scrolls the page. */
.adm-pours { display: flex; flex-direction: column; gap: 8px; }
.adm-pour { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--page); }
.adm-handle {
    flex: 0 0 44px; align-self: stretch; min-height: 60px; border: 0; border-right: 1px solid var(--line); border-radius: 11px 0 0 11px;
    background: transparent; color: var(--muted); cursor: grab; touch-action: none; display: flex; align-items: center; justify-content: center;
}
.adm-handle svg { fill: currentColor; }
.adm-handle:hover, .adm-handle:focus-visible { background: var(--gold); color: var(--ink); outline: 0; }
.adm-pour.dragging { position: relative; z-index: 10; box-shadow: 0 0 0 3px var(--gold), 0 14px 28px rgba(0, 0, 0, 0.55); }
.adm-pour.dragging .adm-handle { cursor: grabbing; background: var(--gold); color: var(--ink); }
.adm-pours.reordering .adm-pour-actions { display: none; }
.adm-pour-body { flex: 1; min-width: 0; }
.adm-pour-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.adm-pour-actions form { margin: 0; }
.adm-thumb { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--paper); }
.adm-thumb-big { flex-basis: 96px; width: 96px; height: 96px; }
.adm-photo { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.adm-order-error { color: #f0a9b8; font-weight: 700; }

/* ---- the map of a trip's stops (js/tripmap.js) and the map in the admin forms (js/mappick.js) ----
   isolation keeps Leaflet's own stacking (its controls sit at z-index 1000) inside the card, under the sticky note. */
.map-card { padding: 0; overflow: hidden; isolation: isolate; }
.map-days { display: flex; gap: 8px; padding: 12px 12px 10px; overflow-x: auto; scrollbar-width: none; }
.map-day {
    flex: 0 0 auto; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 2px solid var(--ink); background: transparent; color: var(--ink);
    font: inherit; font-weight: 700; font-size: 0.8125rem; white-space: nowrap; cursor: pointer;
}
.map-day[aria-pressed="true"] { background: var(--ink); color: var(--paper); font-weight: 800; }
.map-day:focus-visible { outline: 3px solid var(--claret); outline-offset: 2px; }
.map-box { height: 260px; z-index: 0; }
.map-box.leaflet-container { background: #e7dcc0; font-family: var(--sans); }
/* The tiles are tinted towards the paper; only the tile pane, so the pins and the line keep their colours. */
.map-box .leaflet-tile-pane { filter: sepia(0.35) saturate(0.75) brightness(1.02); }
.map-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 12px 12px; }
.map-note { flex: 1 1 200px; margin: 0; font-size: 0.8125rem; line-height: 1.4; color: var(--ink-soft); }
@media (min-width: 620px) { .map-box { height: 380px; } }

/* Leaflet's stylesheet loads after this one and gives every marker display: block; two classes here win over its one. */
.leaflet-marker-icon.map-pin {
    box-sizing: border-box; border-radius: 50%; border: 2px solid var(--ink); box-shadow: 0 0 0 2px var(--paper);
    display: flex; align-items: center; justify-content: center; background: var(--claret); color: var(--paper);
    font-family: var(--sans); font-weight: 800; font-size: 0.8125rem; line-height: 1;
}
.leaflet-marker-icon.map-pin-meal { background: var(--paper); }
.leaflet-marker-icon.map-pin-hotel, .leaflet-marker-icon.map-pin-airport { background: var(--paper); color: var(--ink); }
.map-pin svg { width: 18px; height: 18px; display: block; }
.leaflet-marker-icon.map-pin-next { background: var(--gold); color: var(--ink); }
.leaflet-marker-icon.map-pin-pick { background: var(--gold); cursor: grab; }
.map-pin:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.map-pop { display: flex; flex-direction: column; gap: 2px; font-size: 0.8125rem; color: var(--ink); }
.map-pop strong { font-family: var(--serif); font-size: 1rem; line-height: 1.15; }
.map-pop a { display: inline-flex; align-items: center; min-height: 36px; color: var(--claret); font-weight: 800; }
.map-box .leaflet-popup-content-wrapper, .map-box .leaflet-popup-tip { background: var(--paper); color: var(--ink); }
.map-box .leaflet-popup-content { margin: 10px 12px 6px; }
.map-box .leaflet-control-attribution { font-size: 0.625rem; }
.map-box .leaflet-control-attribution a { color: var(--claret); }

/* The map in the admin forms, behind its button. */
.map-pick { margin-top: 8px; isolation: isolate; }
.map-pick > summary { list-style: none; width: fit-content; }
.map-pick > summary::-webkit-details-marker { display: none; }
.map-pick[open] > summary { border-color: var(--gold); color: var(--gold-light); }
.map-pick-box.map-box { height: 280px; margin-top: 8px; border-radius: 12px; overflow: hidden; cursor: crosshair; }
.map-pick-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.map-pick-foot .adm-note { flex: 1 1 180px; }
