/* ============================================================
   Southern Flight — preserved logbook
   Self-contained: no web fonts, no CDN, nothing to host.
   ============================================================ */

:root {
  color-scheme: light dark;

  --paper:      #f4efe4;
  --card:       #fffdf8;
  --ink:        #17232e;
  --ink-soft:   #4d5a66;
  --ink-faint:  #6b7883;
  --rule:       #ded4c0;
  --rule-soft:  #ece4d5;
  --brass:      #8a6216;
  --brass-lit:  #a67c2e;
  --navy:       #14304a;
  --navy-deep:  #0d2236;
  --sea:        #2a5754;
  --link:       #1a5578;
  --link-hover: #0d3450;
  --focus:      #b8791a;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans:  ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --measure: 36rem;
  --shell:   74rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #10171d;
    --card:       #17212a;
    --ink:        #e9e3d6;
    --ink-soft:   #b3bcc4;
    --ink-faint:  #8d97a1;
    --rule:       #2e3b47;
    --rule-soft:  #232f3a;
    --brass:      #d7a94e;
    --brass-lit:  #e0b968;
    --navy:       #0b1620;
    --navy-deep:  #070f16;
    --sea:        #7fbdb6;
    --link:       #86bcd8;
    --link-hover: #b3d7ea;
    --focus:      #e0b968;
  }
}

/* ---------- reset ---------- */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

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

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.14em; }
a:hover { color: var(--link-hover); }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--card);
  color: var(--ink);
  padding: 0.75rem 1.25rem;
  z-index: 100;
  font-family: var(--sans);
  border: 2px solid var(--brass);
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* ---------- masthead ---------- */

.masthead {
  background: var(--navy);
  background-image: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
  color: #f1ece1;
  border-bottom: 3px solid var(--brass-lit);
}

.masthead__inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 1.75rem 1.5rem 1.25rem;
}

.masthead__title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 1.1rem + 2.6vw, 2.9rem);
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  line-height: 1.1;
  color: #fbf7ee;
}

.masthead__title a { color: inherit; text-decoration: none; }
.masthead__title a:hover { color: #fff; }

.masthead__standfirst {
  margin: 0.55rem 0 0;
  font-family: var(--sans);
  font-size: 0.8125rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #b9c6d3;
}

/* ---------- primary nav ---------- */

.globalnav {
  background: var(--navy-deep);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.globalnav__list {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 1rem;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
}

.globalnav a {
  display: block;
  padding: 0.85rem 1rem;
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c6d3df;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}

.globalnav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.globalnav a[aria-current="page"] {
  color: #fff;
  border-bottom-color: var(--brass-lit);
}

/* ---------- shell ---------- */

.shell {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 1rem 4rem;
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 56rem) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
    padding: 0 0.75rem 3rem;
  }
}

/* ---------- section nav ---------- */

.sectionnav {
  margin-top: 2.5rem;
  padding: 1.1rem 1.25rem 1.35rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 3px;
  position: sticky;
  top: 1rem;
}

@media (max-width: 56rem) {
  .sectionnav { position: static; margin-top: 1.25rem; }
}

.sectionnav__heading {
  margin: 0 0 0.75rem;
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass);
}

.sectionnav__list { list-style: none; margin: 0; padding: 0; }

.sectionnav__list li + li { border-top: 1px solid var(--rule-soft); }

.sectionnav a {
  display: block;
  padding: 0.5rem 0.35rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
  text-decoration: none;
  color: var(--ink-soft);
}

.sectionnav a:hover {
  color: var(--link-hover);
  background: var(--rule-soft);
}

.sectionnav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--brass-lit);
  padding-left: 0.75rem;
}

@media (max-width: 56rem) {
  .sectionnav__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .sectionnav__list li + li { border-top: 0; }
  .sectionnav a {
    border: 1px solid var(--rule);
    border-radius: 2px;
    padding: 0.4rem 0.7rem;
  }
  .sectionnav a[aria-current="page"] {
    box-shadow: none;
    border-color: var(--brass-lit);
    padding-left: 0.7rem;
  }
}

/* ---------- main / log sheet ---------- */

.sheet {
  margin-top: 2.5rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 2.75rem clamp(1rem, 0.4rem + 2.4vw, 3rem) 3rem;
}

@media (max-width: 56rem) {
  .sheet { margin-top: 1.25rem; padding: 1.75rem 1.15rem 2.25rem; }
}

.sheet__header {
  border-bottom: 2px solid var(--rule);
  padding-bottom: 1.15rem;
  margin-bottom: 2rem;
}

.sheet__eyebrow {
  display: block;
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 0.5rem;
}

.sheet__title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.005em;
}

/* body copy */

.prose { max-width: var(--measure); }

.prose > p {
  margin: 0 0 1.15rem;
  hyphens: auto;
}

.prose > p:first-of-type::first-line { letter-spacing: 0.005em; }

.prose h2, .prose h3, .prose h4, .prose h5 {
  font-family: var(--serif);
  line-height: 1.25;
  color: var(--ink);
  margin: 2.5rem 0 0.85rem;
}

.prose h2 { font-size: 1.6rem; font-weight: 600; }
.prose h3 { font-size: 1.3rem; font-weight: 600; }
.prose h4 { font-size: 1.15rem; font-weight: 600; }
.prose h6 { font-size: 1.05rem; font-weight: 600; }

/* The log's dated entries — the real structure of the trip pages.
   Ruled off like a ledger line. */
.prose .log-entry {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--sea);
  margin: 2.4rem 0 0.9rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
}

.prose .log-entry strong { font-weight: 700; }

.prose .u-center {
  text-align: center;
  max-width: none;
  color: var(--ink-soft);
}

.prose blockquote {
  margin: 1.5rem 0;
  padding-left: 1.1rem;
  border-left: 3px solid var(--brass-lit);
  color: var(--ink-soft);
  font-style: italic;
}

.prose ul { padding-left: 1.2rem; }

.prose a { font-weight: 500; }

/* ---------- photographic plates ---------- */

.plates {
  max-width: none;
  margin: 2rem 0 2.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem;
}

.plates--single { grid-template-columns: minmax(0, 30rem); }

.plate { margin: 0; }

.plate a {
  display: block;
  border: 1px solid var(--rule);
  padding: 0.4rem;
  background: var(--paper);
  border-radius: 2px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.plate a:hover {
  border-color: var(--brass-lit);
  transform: translateY(-2px);
}

.plate img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--rule-soft);
}

.plate figcaption {
  margin-top: 0.45rem;
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

/* the single hero image on section landing pages */
.plate--feature { margin: 0 0 2rem; }

/* ---------- lightbox (progressive; links still work without JS) ---------- */

/* The display rule must be scoped to [open], otherwise it overrides the
   browser's own `dialog:not([open]) { display: none }` and the closed
   dialog keeps rendering in the page flow. */
.lightbox {
  border: 0;
  padding: 0;
  margin: 0;
  max-width: 100vw;
  max-height: 100vh;
  width: 100%;
  height: 100%;
  background: transparent;
  overflow: hidden;
}

.lightbox:not([open]) { display: none; }

.lightbox[open] {
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 3vw, 2.5rem);
}

.lightbox::backdrop { background: rgba(8, 14, 20, 0.93); }

.lightbox img {
  max-width: 100%;
  max-height: 85vh;
  width: auto;
  height: auto;
  border: 3px solid #f1ece1;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

/* Sits over unpredictable photographs, so it carries its own dark plate
   rather than relying on the image behind it for contrast. */
.lightbox__close {
  position: fixed;
  top: clamp(0.75rem, 2vw, 1.5rem);
  right: clamp(0.75rem, 2vw, 1.5rem);
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: #0d1620;
  color: #f4f0e6;
  border: 1px solid rgba(244, 240, 230, 0.75);
  border-radius: 3px;
  padding: 0.7rem 1.1rem;
  min-height: 44px;
  cursor: pointer;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.6);
}

.lightbox__close:hover {
  background: #1b2a38;
  border-color: #f4f0e6;
}

.lightbox__close:focus-visible {
  outline: 3px solid var(--brass-lit);
  outline-offset: 2px;
}

/* ---------- footer ---------- */

.sitefoot {
  background: var(--navy-deep);
  color: #a9b8c6;
  border-top: 3px solid var(--brass-lit);
  font-family: var(--sans);
  font-size: 0.875rem;
}

.sitefoot__inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 2rem 1.5rem 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  justify-content: space-between;
  align-items: baseline;
}

.sitefoot a { color: #cfe0ee; }
.sitefoot a:hover { color: #fff; }

.sitefoot__note {
  margin: 0;
  max-width: 34rem;
  line-height: 1.6;
}

.sitefoot__mark {
  margin: 0;
  font-family: var(--serif);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #e3ebf2;
}

/* ---------- print ---------- */

@media print {
  .globalnav, .sectionnav, .skip-link, .lightbox { display: none; }
  body { background: #fff; color: #000; }
  .sheet { border: 0; padding: 0; }
  .masthead { background: #fff; color: #000; border-bottom: 2px solid #000; }
  .masthead__title, .masthead__standfirst { color: #000; }
  .prose { max-width: none; }
  a { text-decoration: underline; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .plate a:hover { transform: none; }
}

/* ---------- styles offered by the site editor ---------- */

/* Heading: starts a new section of a page. Sized like the original
   section headings; the class lets the editor recognise its own. */
.prose .section-heading {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--ink);
}

/* Highlight: a note that should stand out. Brass passes WCAG AA on the
   sheet in both themes (5.38:1 light, 7.35:1 dark). */
.prose .highlight {
  color: var(--brass);
  border-left: 3px solid var(--brass);
  padding-left: 0.9rem;
}

/* Small print: notes and credits. */
.prose .small-print {
  font-size: 0.9rem;
  color: var(--ink-soft);
}
