/* voodoochile.at: the logbook as a website. Same language as the printed logbook: paper, serif, the triple
   rule of old logbook column heads, a compass rose. Colours of the boat: hull red (#a21514 measured on the
   launch photos, #a3211b here) as the accent, sea blue for links and headings. */

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url(fonts/source-serif-4-latin-opsz-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-display: swap;
  font-weight: 200 900;
  src: url(fonts/source-serif-4-latin-opsz-italic.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url(fonts/source-serif-4-latin-ext-opsz-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-display: swap;
  font-weight: 200 900;
  src: url(fonts/source-serif-4-latin-ext-opsz-italic.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --red: #a3211b;
  --red-2: #c23a2f;
  --sea: #1d4e6e;
  --sea-2: #3b6d8f;
  --paper: #faf7f0;
  --paper-2: #f1ece0;
  --ink: #1f2428;
  --muted: #5d6a73;
  --rule: #cfd9df;
  --card: #fffdf8;
  --shadow: 0 1px 2px rgb(29 78 110 / 0.08), 0 8px 24px -12px rgb(29 78 110 / 0.25);
  --measure: 40rem;
  --wide: 76rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --red: #ec7d70;
    --red-2: #f29a8f;
    --sea: #8db9d8;
    --sea-2: #a9cbe3;
    --paper: #10171d;
    --paper-2: #17212a;
    --ink: #e6e2d9;
    --muted: #9aa8b2;
    --rule: #2c3a45;
    --card: #15202a;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px -12px rgb(0 0 0 / 0.6);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 4rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Source Serif 4", Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  font-size: clamp(1.06rem, 1rem + 0.3vw, 1.2rem);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: var(--sea); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--red); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--paper); padding: 0.4rem 0.8rem; }

/* Logbook elements ---------------------------------------------------------------- */

.triple {
  height: 8px;
  background:
    linear-gradient(var(--red), var(--red)) 0 0 / 100% 2px no-repeat,
    linear-gradient(var(--red), var(--red)) 0 4px / 100% 1px no-repeat,
    linear-gradient(var(--red), var(--red)) 0 7px / 100% 1px no-repeat;
}
.label, .kicker, dt {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 500;
}
.rose { width: 100%; height: 100%; color: var(--sea); display: block; }

/* Header and footer -------------------------------------------------------------- */

.site-header {
  position: sticky; top: 0; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.3rem 1.5rem;
  padding: 0.55rem var(--gutter);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: center; gap: 0.55rem; text-decoration: none; color: var(--ink); }
.brand .rose { width: 1.9rem; height: 1.9rem; }
.brand span { font-size: 1.25rem; letter-spacing: 0.02em; font-weight: 600; }
.site-nav { display: flex; gap: 0.2rem 1.1rem; flex-wrap: wrap; font-size: 0.95rem; }
.site-nav a { text-decoration: none; color: var(--muted); }
.site-nav a:hover { color: var(--red); }

.site-footer { margin-top: 5rem; padding: 0 var(--gutter) 3rem; max-width: var(--wide); margin-inline: auto; color: var(--muted); }
.footer-row { display: flex; align-items: center; gap: 0.8rem; margin-top: 1.2rem; }
.footer-rose { width: 2.2rem; height: 2.2rem; flex: none; opacity: 0.7; }
.site-footer p { margin: 0.2rem 0; }
.small { font-size: 0.85rem; }

/* Home ---------------------------------------------------------------------------- */

.hero { position: relative; min-height: min(82vh, 46rem); display: grid; align-items: end; overflow: hidden; }
/* Bottom-aligned crop: the name on the bow stays above the title block */
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; }
/* Very wide screens crop a lot more from the top: keep the face in, the name still clears the title */
@media (min-width: 100rem) { .hero img { object-position: 50% 28%; } }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgb(10 25 35 / 0) 35%, rgb(10 25 35 / 0.72) 100%);
}
.hero-text {
  position: relative; z-index: 1; color: #fdfbf6;
  padding: 2rem var(--gutter) clamp(2rem, 6vh, 4rem); max-width: 46rem;
}
.hero .kicker { color: #fdfbf6; opacity: 0.9; margin: 0; }
.hero h1 { font-size: clamp(2.8rem, 1.6rem + 4.6vw, 5.4rem); line-height: 1; margin: 0.15em 0 0.25em; font-weight: 500; letter-spacing: -0.01em; }
.hero .triple { width: min(18rem, 70%); --red: #fdfbf6; }
.hero .lede { font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.3rem); max-width: 34rem; margin: 1.1rem 0 0; text-shadow: 0 1px 12px rgb(0 0 0 / 0.4); }
/* Narrow screens: photo above, text below on paper; over a tall crop the title would cover the boat's name */
@media (max-width: 40rem) {
  .hero { min-height: 0; display: block; }
  .hero img { position: static; width: 100%; height: auto; aspect-ratio: 4 / 3; object-position: 35% 50%; }
  .hero::after { display: none; }
  .hero-text { color: var(--ink); padding-top: 1.3rem; padding-bottom: 1.5rem; }
  .hero .kicker { color: var(--red); opacity: 1; }
  .hero .triple { --red: inherit; }
  .hero .lede { text-shadow: none; }
}

.years {
  position: sticky; top: 3.1rem; z-index: 4;
  display: flex; gap: 0.4rem; overflow-x: auto; scrollbar-width: none;
  padding: 0.6rem var(--gutter); background: var(--paper); border-bottom: 1px solid var(--rule);
}
.years a {
  flex: none; text-decoration: none; padding: 0.15rem 0.75rem; border: 1px solid var(--rule); border-radius: 99px;
  font-size: 0.9rem; color: var(--sea); background: var(--card);
}
.years a:hover { border-color: var(--red); color: var(--red); }

.year { max-width: var(--wide); margin: 0 auto; padding: 3.5rem var(--gutter) 0; }
.year-title {
  display: flex; align-items: center; gap: 0.8rem; margin: 0 0 1.5rem;
  font-size: clamp(2.2rem, 1.6rem + 2.5vw, 3.4rem); font-weight: 500; color: var(--sea); line-height: 1;
}
.year-title small { font-size: 0.9rem; color: var(--muted); font-weight: 400; margin-left: auto; }
.year-rose { width: 2.6rem; height: 2.6rem; flex: none; opacity: 0.55; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 1.4rem; }
.card {
  display: flex; flex-direction: column; text-decoration: none; color: var(--ink);
  background: var(--card); border-radius: 6px; overflow: hidden; box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-3px); color: var(--ink); }
.card:hover h3 { color: var(--red); }
.card img, .card-noimg { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; background: var(--paper-2); }
.card-noimg { display: grid; place-items: center; }
.card-noimg .rose { width: 38%; height: auto; opacity: 0.35; }
.card-body { padding: 0.9rem 1.05rem 1.1rem; display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.card-body .label { margin: 0; }
.card h3 { margin: 0; font-size: 1.28rem; line-height: 1.25; font-weight: 600; }
.card .excerpt {
  margin: 0; color: var(--muted); font-size: 0.95rem; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card .count { margin: auto 0 0; padding-top: 0.4rem; font-size: 0.82rem; color: var(--red); }

/* Entries and pages --------------------------------------------------------------- */

.entry { padding: clamp(2rem, 6vw, 4rem) var(--gutter) 0; }
.entry-head { max-width: var(--measure); margin: 0 auto 2rem; }
.entry-head h1 { font-size: clamp(2rem, 1.5rem + 2.4vw, 3.2rem); line-height: 1.12; margin: 0.6rem 0 0; font-weight: 600; letter-spacing: -0.005em; }
.logrow { display: grid; grid-template-columns: minmax(9rem, auto) 1fr; margin: 0; border-bottom: 1px solid var(--sea); }
.logrow > div { padding: 0.45rem 0.8rem 0.5rem; }
.logrow > div:first-child { padding-left: 0; }
.logrow > div + div { border-left: 1px solid var(--sea); }
.logrow dd { margin: 0.1rem 0 0; font-size: 1rem; }

.prose {
  display: grid;
  grid-template-columns: 1fr min(var(--measure), 100%) 1fr;
}
.prose > * { grid-column: 2; }
.prose > .gallery { grid-column: 1 / -1; width: min(100%, var(--wide)); justify-self: center; }
.prose p { margin: 0 0 1.05em; hyphens: auto; }
.prose h3 { font-size: 1.35rem; margin: 1.8rem 0 0.6rem; line-height: 1.3; }
.prose ul, .prose ol { padding-left: 1.2rem; margin: 0 0 1.05em; }
.prose blockquote { margin: 0 0 1.05em; padding-left: 1rem; border-left: 3px solid var(--rule); color: var(--muted); }

/* Justified photo rows without JavaScript: every photo grows in proportion to its aspect ratio,
   so all photos in a row end up equally high. The ::after spacer keeps the last row unstretched. */
.gallery { --row: 115px; display: flex; flex-wrap: wrap; gap: 4px; margin: 1.6rem 0 2rem; }
.gallery .ph {
  flex: calc(var(--r) * 1000) 1 calc(var(--r) * var(--row));
  aspect-ratio: var(--r); overflow: hidden; background: var(--paper-2); border-radius: 2px;
}
.gallery .ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.35s ease, filter 0.35s ease; }
.gallery .ph:hover img { transform: scale(1.03); filter: brightness(1.05); }
.gallery::after { content: ""; flex: 1e6 1 0; }
.gallery.single { justify-content: center; }
.gallery.single::after { display: none; }
.gallery.single .ph { flex: 0 1 auto; width: min(100%, calc(var(--r) * 30rem)); }
@media (min-width: 40rem) { .gallery { --row: 200px; } }
@media (min-width: 70rem) { .gallery { --row: 240px; } }

.video { margin: 1.6rem 0 2rem; }
.video-play, .video iframe {
  display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; padding: 0; position: relative;
  background: #0b1720; cursor: pointer; border-radius: 4px; overflow: hidden;
}
.video-play img { width: 100%; height: 100%; object-fit: cover; opacity: 0.9; transition: opacity 0.2s; }
.video-play:hover img { opacity: 1; }
.play {
  position: absolute; left: 50%; top: 50%; width: 4.2rem; height: 4.2rem; margin: -2.1rem 0 0 -2.1rem;
  border-radius: 50%; background: rgb(250 247 240 / 0.92); box-shadow: 0 4px 18px rgb(0 0 0 / 0.35);
}
.play::after {
  content: ""; position: absolute; left: 54%; top: 50%; transform: translate(-50%, -50%);
  border-style: solid; border-width: 0.8rem 0 0.8rem 1.35rem; border-color: transparent transparent transparent #1d4e6e;
}
.video figcaption { margin-top: 0.5rem; font-size: 0.95rem; }
.video figcaption small { display: block; color: var(--muted); font-size: 0.8rem; }
.video-gone { color: var(--muted); font-style: italic; }

.contact { font-style: normal; margin: 1rem 0 2rem; }
.contact dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.9rem 1.5rem; margin: 0; }
.contact dl > div { display: contents; }
.contact dt { padding-top: 0.3rem; }
.contact dd { margin: 0; }

.comments { max-width: var(--measure); margin: 3rem auto 0; }
.comments h2 { font-size: 1.4rem; margin: 0 0 1rem; font-weight: 600; }
.comments h2 small { font-size: 0.85rem; color: var(--muted); font-weight: 400; }
.comment { border-left: 2px solid var(--rule); padding: 0.2rem 0 0.2rem 1rem; margin-bottom: 1.4rem; }
.comment .label { margin: 0 0 0.3rem; }
.comment p { margin: 0 0 0.6em; font-size: 0.98rem; }

.pager {
  max-width: var(--measure); margin: 3.5rem auto 0; padding-top: 1rem; border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
}
.pager a { text-decoration: none; display: flex; flex-direction: column; gap: 0.15rem; line-height: 1.3; }
.pager .next { text-align: right; }

.notfound .prose { text-align: center; }

/* Lightbox ----------------------------------------------------------------------- */

.lightbox {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgb(6 14 20 / 0.94); color: #fff;
}
.lightbox::backdrop { background: rgb(6 14 20 / 0.6); }
.lightbox img { position: absolute; inset: 0; margin: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox button {
  position: absolute; border: 0; background: rgb(255 255 255 / 0.12); color: #fff; cursor: pointer;
  font: inherit; font-size: 2rem; line-height: 1; width: 3rem; height: 3rem; border-radius: 50%;
}
.lightbox button:hover { background: rgb(255 255 255 / 0.25); }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; margin-top: -1.5rem; }
.lb-next { right: 1rem; top: 50%; margin-top: -1.5rem; }
.lb-count { position: absolute; bottom: 0.8rem; left: 0; right: 0; text-align: center; font-size: 0.85rem; opacity: 0.75; margin: 0; }
@media (max-width: 40rem) { .lb-prev, .lb-next { display: none; } }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
