/* Unwritten Timeline — sailing journal archive */
:root {
  --ink: #2c241c;
  --ink-soft: #4a4238;
  --muted: #6b6258;
  --paper: #f7f1e6;
  --paper-2: #efe6d6;
  --cream: #fffcf7;
  --espresso: #2a120a;
  --espresso-2: #3d1c10;
  --footer: #420f03;
  --rust: #ae571f;
  --rust-deep: #8a4318;
  --lime: #6c950c;
  --lime-bright: #99cb23;
  --line: #e0d4c2;
  --shadow: 0 10px 30px rgba(42, 18, 10, 0.08);
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Helvetica Neue", system-ui, sans-serif;
  --script: "Pacifico", cursive;
  --max: 72rem;
  --prose: 46rem;
  --radius: 14px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--lime); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--rust); }
h1, h2, h3, h4 { color: var(--espresso); line-height: 1.25; font-weight: 600; }
h1.script, h2.script, .script { font-family: var(--script); font-weight: 400; color: var(--rust); }
p { margin: 0 0 1.1em; }
figure { margin: 1.4rem 0; }
figcaption, .caption {
  font-family: var(--sans);
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
  margin-top: 0.45rem;
  font-style: italic;
}

/* Header */
.site-header {
  background: linear-gradient(180deg, var(--espresso) 0%, var(--espresso-2) 100%);
  color: var(--cream);
  position: relative;
}
.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.1rem 1.25rem 0.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.brand img {
  width: 86px;
  height: auto;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
  font-family: var(--script);
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  line-height: 1.15;
  color: #fff;
  text-shadow: 0 2px 3px rgba(0,0,0,0.45);
}
.brand-tag {
  font-family: var(--sans);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: #f0e0c8;
  opacity: 0.9;
}
.header-tools {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-shrink: 0;
}
.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  color: #fff;
  background: rgba(255,255,255,0.08);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.12);
}
.social a:hover { background: var(--lime); color: #fff; }
.social svg { width: 15px; height: 15px; fill: currentColor; }

.nav-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.35rem 0.75rem 0.9rem;
}
.nav-toggle {
  display: none;
  font-family: var(--sans);
  font-weight: 600;
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
}
.nav {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.15rem;
  justify-content: center;
}
.nav > li { position: relative; }
.nav > li > a {
  display: block;
  font-family: var(--script);
  font-size: 1.12rem;
  color: #fff;
  text-decoration: none;
  padding: 0.35rem 0.85rem;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
  white-space: nowrap;
}
.nav > li > a:hover,
.nav > li > a[aria-current="page"],
.nav > li:hover > a,
.nav > li.is-active > a { color: var(--lime-bright); }
.nav .dropdown {
  display: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 100%;
  min-width: 220px;
  background: var(--cream);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 0.4rem 0;
  z-index: 30;
  border: 1px solid var(--line);
}
.nav li:hover > .dropdown,
.nav li:focus-within > .dropdown { display: block; }
.nav .dropdown a {
  display: block;
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--espresso);
  text-decoration: none;
  padding: 0.4rem 0.95rem;
  text-align: left;
}
.nav .dropdown a:hover { background: var(--paper-2); color: var(--rust); }

/* Layout */
.page-main { max-width: var(--max); margin: 0 auto; padding: 1.75rem 1.25rem 3.5rem; }
.prose { max-width: var(--prose); margin: 0 auto; }
.archive-banner {
  background: #efe3c4;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 0.92rem;
  text-align: center;
  padding: 0.55rem 1rem;
}
.kicker {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rust);
  font-weight: 600;
  margin: 0 0 0.35rem;
}
.page-title {
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(2rem, 4.5vw, 3.15rem);
  color: var(--rust);
  margin: 0 0 0.35rem;
}
.page-lede { color: var(--ink-soft); font-size: 1.15rem; margin-bottom: 1.6rem; }
.post-date, .meta {
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--muted);
}
.crumbs {
  font-family: var(--sans);
  font-size: 0.88rem;
  margin: 0 0 1rem;
  color: var(--muted);
}
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--rust); }

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  align-items: center;
  margin-bottom: 2.5rem;
}
.hero img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 6px solid #fff;
}
.hero h1 { margin: 0.2rem 0 0.6rem; }

/* Cards */
.card-grid, .post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.25rem;
}
.post-card, .info-card {
  background: var(--cream);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
a.post-card:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(42,18,10,0.12); }
.post-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--paper-2); }
.post-card-body, .info-card { padding: 1rem 1.1rem 1.15rem; }
.info-card { padding: 1.2rem 1.25rem; }
.post-card h3, .info-card h3 {
  font-family: var(--serif);
  font-size: 1.12rem;
  margin: 0.15rem 0 0.4rem;
  color: var(--espresso);
}
.post-card p, .info-card p { font-size: 0.98rem; color: var(--ink-soft); margin: 0; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 2.2rem 0 1rem;
}
.section-head h2 {
  font-family: var(--script);
  font-weight: 400;
  font-size: 2rem;
  color: var(--rust);
  margin: 0;
}

/* Article body */
.article, .page-body {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: clamp(1.15rem, 3vw, 2.4rem);
}
.article .post-title {
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(1.85rem, 4vw, 2.7rem);
  color: var(--rust);
  margin: 0 0 0.3rem;
}
.post-body h2, .page-body h2 {
  font-family: var(--script);
  font-weight: 400;
  color: var(--rust);
  font-size: 1.85rem;
  margin: 1.4rem 0 0.4rem;
}
.post-body h3, .page-body h3 { font-size: 1.3rem; margin: 1.2rem 0 0.35rem; }
.post-body p, .page-body p { overflow-wrap: anywhere; }
.post-body ul, .page-body ul, .post-body ol, .page-body ol { padding-left: 1.25rem; }
.post-body li, .page-body li { margin: 0.25rem 0; }
.post-body table, .page-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
  margin: 1rem 0;
}
.post-body th, .page-body th, .post-body td, .page-body td {
  border-bottom: 1px solid var(--line);
  padding: 0.35rem 0.5rem;
  text-align: left;
  vertical-align: top;
}
.media-image, .post-body figure.media-image { margin: 1.3rem auto; }
.post-body img:not(.gallery-item img) {
  border-radius: 8px;
  margin: 0.4rem auto;
}
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin: 1.25rem 0;
}
.gallery-item { margin: 0; }
.gallery-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 8px;
  background: var(--paper-2);
}
.video-embed, .map-embed {
  position: relative;
  width: 100%;
  margin: 1.3rem 0;
  border-radius: 10px;
  overflow: hidden;
  background: #111;
}
.video-embed { padding-bottom: 56.25%; height: 0; }
.map-embed { padding-bottom: 56%; height: 0; }
.video-embed iframe, .map-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.expense-sheet, .expense-sheet p, .expense-sheet .body-block {
  font-family: "Source Serif 4", ui-monospace, Georgia, serif;
  white-space: pre-wrap;
  font-variant-numeric: tabular-nums;
  line-height: 1.55;
}
.cats { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.7rem 0 1.1rem; }
.cat-pill, .year-pill {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--espresso);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
}
.cat-pill:hover { background: #e6f0c8; color: var(--lime); }

/* Comments */
.comments {
  margin-top: 2.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.comments h2 { font-family: var(--script); font-weight: 400; color: var(--rust); }
.comment {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
.comment.is-reply { margin-left: 1.5rem; }
.comment-meta { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); }
.comment-author { font-weight: 600; color: var(--espresso); }

/* Lists / archive */
.year-block { margin: 0 0 2rem; }
.year-block h2 {
  font-family: var(--script);
  font-weight: 400;
  color: var(--rust);
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.3rem;
}
.archive-list { list-style: none; margin: 0; padding: 0; }
.archive-list li {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 0.8rem;
  padding: 0.45rem 0;
  border-bottom: 1px dashed var(--line);
  align-items: baseline;
}
.archive-list time { font-family: var(--sans); font-size: 0.88rem; color: var(--muted); }
.archive-list a { text-decoration: none; color: var(--espresso); font-weight: 600; }
.archive-list a:hover { color: var(--rust); }

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.8rem;
  font-family: var(--sans);
  font-size: 0.95rem;
}
.pager a { text-decoration: none; }

/* Mailchimp / contact */
.newsletter, .contact-card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.3rem;
  box-shadow: var(--shadow);
}
.newsletter h2, .contact-card h2 {
  font-family: var(--script);
  font-weight: 400;
  color: var(--rust);
  margin-top: 0;
}
.mc-form, .contact-actions { display: grid; gap: 0.55rem; }
.mc-form input[type="email"], .mc-form input[type="text"] {
  font: inherit;
  font-family: var(--sans);
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 600;
  background: var(--lime);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--rust); color: #fff; }
.btn-secondary { background: var(--espresso); }

.recipe-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.recipe-card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem;
  box-shadow: var(--shadow);
}
.recipe-card h3 { margin: 0 0 0.4rem; font-size: 1.15rem; }

/* Footer */
.site-footer {
  background: var(--footer);
  color: #f3d9c8;
  padding: 2.2rem 1.25rem 1.6rem;
  font-family: var(--sans);
  font-size: 0.92rem;
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 1.5rem;
}
.site-footer a { color: var(--lime-bright); text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer h3 {
  font-family: var(--script);
  font-weight: 400;
  color: #fff;
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0.25rem 0; }
.footer-bottom {
  max-width: var(--max);
  margin: 1.4rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.12);
  color: #d9b09a;
  font-size: 0.85rem;
}

/* Lightbox */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 10, 6, 0.92);
  z-index: 80;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem 3.5rem;
}
.lightbox-overlay.is-open { display: flex; }
.lightbox-overlay img {
  max-width: min(1200px, 96vw);
  max-height: 86vh;
  object-fit: contain;
  box-shadow: 0 10px 40px rgba(0,0,0,0.45);
}
.lightbox-caption {
  position: absolute;
  bottom: 1rem;
  left: 0; right: 0;
  text-align: center;
  color: #f3e6d6;
  font-family: var(--sans);
  font-size: 0.95rem;
}
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: absolute;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
}
.lightbox-close { top: 0.6rem; right: 1rem; }
.lightbox-prev { left: 0.6rem; top: 50%; }
.lightbox-next { right: 0.6rem; top: 50%; }

/* Misc */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: #fff;
  color: var(--espresso);
  padding: 0.4rem 0.7rem;
  z-index: 100;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
}

@media (max-width: 840px) {
  .hero { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .photo-gallery { grid-template-columns: repeat(2, 1fr); }
  .archive-list li { grid-template-columns: 1fr; gap: 0.15rem; }
  .nav-toggle { display: inline-block; }
  .header-inner { flex-wrap: wrap; }
  .nav { display: none; flex-direction: column; align-items: stretch; }
  body.nav-open .nav { display: flex; }
  .nav .dropdown {
    position: static;
    transform: none;
    display: block;
    box-shadow: none;
    background: transparent;
    border: 0;
    padding: 0 0 0.4rem 0.8rem;
  }
  .nav .dropdown a { color: #f3e6d6; }
  .brand img { width: 68px; }
}
@media (max-width: 560px) {
  .photo-gallery { grid-template-columns: 1fr; }
  .social { display: none; }
}
