/* VisitLoreto — self-hosted rebuild.
   One stylesheet, no framework, no webfonts (nothing loads off-origin).
   Colours carry over from the original site: Sea of Cortez blue and desert
   sand, on warm paper. */

:root {
  color-scheme: light dark;

  --blue-900: #0b2c47;
  --blue-800: #10405f;
  --blue-700: #16557c;
  --blue-500: #2f6f9e;
  --sand-600: #a8853f;
  --sand-400: #c9a75f;
  --sand-200: #e8d9b8;

  --bg: #fbf8f3;
  --bg-soft: #f3ede3;
  --surface: #ffffff;
  --ink: #1d2733;
  --ink-soft: #4d5a68;
  --line: #e2dacd;
  --accent: var(--blue-700);
  --accent-ink: #ffffff;

  --measure: 68ch;
  --page: 1140px;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(16 40 60 / .06), 0 8px 24px rgb(16 40 60 / .08);
  --gutter: clamp(1rem, 4vw, 2.25rem);

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

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10171f;
    --bg-soft: #161f2a;
    --surface: #17212c;
    --ink: #e6ecf2;
    --ink-soft: #a6b4c2;
    --line: #26323f;
    --accent: #7db6e0;
    --accent-ink: #0b2c47;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px rgb(0 0 0 / .35);
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 clamp(1.02rem, .98rem + .2vw, 1.12rem)/1.68 var(--sans);
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-underline-offset: .16em; text-decoration-thickness: .07em; }
a:hover { text-decoration-thickness: .14em; }
img { max-width: 100%; height: auto; display: block; }

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

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--surface); color: var(--ink); padding: .7rem 1rem;
  border-radius: 0 0 var(--radius) 0;
}
.skip:focus { left: 0; }

.wrap { max-width: var(--page); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--blue-900);
  color: #fff;
  box-shadow: 0 1px 0 rgb(255 255 255 / .08), 0 6px 20px rgb(0 0 0 / .18);
}
.site-header a { color: #fff; text-decoration: none; }

.bar { display: flex; align-items: center; gap: 1rem; min-height: 64px; }

.brand { display: flex; align-items: center; margin-right: auto; padding: .4rem 0; }
.brand img { width: auto; height: clamp(30px, 3.2vw, 40px); object-fit: contain; }

.nav-toggle {
  display: none; background: none; border: 1px solid rgb(255 255 255 / .3);
  color: #fff; border-radius: 8px; padding: .5rem .7rem; font: inherit;
  font-size: .95rem; cursor: pointer; align-items: center; gap: .45rem;
}
.nav-toggle:hover { background: rgb(255 255 255 / .1); }

.menu, .menu ul { list-style: none; margin: 0; padding: 0; }
.menu { display: flex; align-items: stretch; gap: .1rem; }
.menu > li { position: relative; }
.menu > li > a, .menu > li > .top {
  display: flex; align-items: center; gap: .3rem; height: 100%;
  padding: .85rem .8rem; font-size: .95rem; font-weight: 500;
  background: none; border: 0; color: inherit; font-family: inherit; cursor: pointer;
  white-space: nowrap;
}
.menu > li > a:hover, .menu > li > .top:hover,
.menu > li:focus-within > .top { background: rgb(255 255 255 / .12); }
.menu > li[aria-current] > a { box-shadow: inset 0 -3px 0 var(--sand-400); }
.caret { width: .5em; height: .5em; border-right: 2px solid currentColor;
         border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-2px,-2px);
         opacity: .75; }

.menu .sub {
  position: absolute; top: 100%; left: 0; min-width: 250px;
  background: var(--blue-800); border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow); padding: .4rem 0;
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .13s ease, transform .13s ease, visibility .13s;
}
.menu > li:hover > .sub, .menu > li:focus-within > .sub { opacity: 1; visibility: visible; transform: none; }
.menu .sub a { display: block; padding: .55rem 1.1rem; font-size: .93rem; }
.menu .sub a:hover { background: rgb(255 255 255 / .13); }

@media (max-width: 940px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--blue-900); box-shadow: var(--shadow);
    max-height: min(78vh, 40rem); overflow-y: auto; padding: .5rem var(--gutter) 1.2rem;
  }
  .site-nav.open { display: block; }
  .menu { flex-direction: column; gap: 0; }
  .menu > li { border-bottom: 1px solid rgb(255 255 255 / .09); }
  .menu > li > a, .menu > li > .top { width: 100%; padding: .9rem .2rem; font-size: 1.03rem; }
  .menu > li > .top { justify-content: space-between; }
  .menu .sub {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; background: transparent; padding: 0 0 .5rem .2rem;
    display: none;
  }
  .menu > li.open > .sub { display: block; }
  .menu > li:hover > .sub, .menu > li:focus-within > .sub { display: none; }
  .menu > li.open > .sub { display: block; }
  .menu > li.open .caret { transform: rotate(-135deg) translate(-2px,-2px); }
  .menu .sub a { padding: .5rem .6rem; opacity: .92; }
}

/* ------------------------------------------------------------------ hero */

.hero { position: relative; background: var(--blue-900); overflow: hidden; }
.hero img { width: 100%; height: clamp(220px, 42vw, 460px); object-fit: cover; opacity: .82; }
.hero .hero-text {
  position: absolute; inset: auto 0 0 0; padding: clamp(1.4rem, 5vw, 3rem) 0;
  background: linear-gradient(to top, rgb(6 22 36 / .82), rgb(6 22 36 / 0));
  color: #fff;
}
.hero h1 { margin: 0; color: #fff; text-shadow: 0 2px 18px rgb(0 0 0 / .5); }

.page-head { padding: clamp(1.8rem, 5vw, 3rem) 0 0; }
h1 {
  font-family: var(--serif); font-weight: 600; line-height: 1.12;
  font-size: clamp(1.85rem, 1.3rem + 2.2vw, 2.9rem); margin: 0 0 .3rem;
  letter-spacing: -.01em;
}
.dateline { color: var(--ink-soft); font-size: .9rem; margin: .7rem 0 0; }
.dateline time { font-variant-numeric: tabular-nums; }

.tagline { color: var(--ink-soft); font-size: 1.06rem; margin: .1rem 0 0; max-width: var(--measure); }
.hero .tagline { color: rgb(255 255 255 / .88); }

/* --------------------------------------------------------------- content */

main { display: block; padding-bottom: 4rem; }
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: 1.05em; }
.prose h2, .prose h3, .prose h4 {
  font-family: var(--serif); line-height: 1.22; margin-top: 2.1em; margin-bottom: .1em;
  letter-spacing: -.005em;
}
.prose h2 { font-size: 1.62rem; }
.prose h3 { font-size: 1.32rem; }
.prose h4 { font-size: 1.14rem; }
.prose p { margin: 0; }
.prose ul { margin: 0; padding-left: 1.2rem; }
.prose li + li { margin-top: .35em; }

section.block { margin-top: 1.6rem; }

figure { margin: 2rem 0; }
figure img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--bg-soft); }
figure.wide { max-width: none; }
figcaption { color: var(--ink-soft); font-size: .92rem; margin-top: .55rem; }

.embed {
  margin: 2rem 0; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); background: var(--bg-soft); aspect-ratio: 16 / 9;
}
.embed.map { aspect-ratio: 4 / 3; }
.embed iframe, .embed video { width: 100%; height: 100%; border: 0; display: block; }

/* Link hubs: an image paired with a heading that is just a link. */
.cards { display: grid; gap: 1.4rem; margin: 2rem 0;
         grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.card {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); text-decoration: none; color: inherit;
  transition: transform .14s ease, box-shadow .14s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 4px 8px rgb(16 40 60 / .1), 0 16px 34px rgb(16 40 60 / .14); }
.card img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.card b { font-family: var(--serif); font-size: 1.12rem; font-weight: 600; padding: .85rem 1rem 1rem; }

/* Sibling-page navigation at the foot of a section */
.siblings { margin-top: 3rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.siblings h2 { font-family: var(--serif); font-size: 1.1rem; margin: 0 0 .8rem; color: var(--ink-soft); font-weight: 600; }
.siblings ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.siblings a {
  display: inline-block; padding: .42rem .8rem; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface); text-decoration: none;
  font-size: .92rem;
}
.siblings a:hover { border-color: var(--accent); }

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

.site-footer {
  background: var(--blue-900); color: rgb(255 255 255 / .82);
  padding: 3rem 0 2rem; margin-top: 4rem; font-size: .94rem;
}
.site-footer a { color: #fff; text-decoration: none; opacity: .85; }
.site-footer a:hover { opacity: 1; text-decoration: underline; }
.foot-cols { display: grid; gap: 1.8rem 2rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.foot-cols h2 { font-family: var(--serif); font-size: 1rem; color: var(--sand-400); margin: 0 0 .6rem; }
.foot-cols ul { list-style: none; margin: 0; padding: 0; }
.foot-cols li + li { margin-top: .35rem; }
.foot-bottom {
  margin-top: 2.4rem; padding-top: 1.4rem; border-top: 1px solid rgb(255 255 255 / .14);
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between;
  color: rgb(255 255 255 / .6);
}
.social { display: flex; gap: .9rem; align-items: center; }
.social a { display: inline-flex; }
.social svg { width: 22px; height: 22px; fill: currentColor; opacity: .85; }
.social a:hover svg { opacity: 1; }
