/* illywhacker.com — clean, readable, a little bit nautical. */
:root {
  --ink: #33291c;
  --ink-soft: #6b5d48;
  --paper: #f7efdd;
  --card: #fffdf6;
  --sand: #efe3c8;
  --navy: #14506e;
  --navy-deep: #0e3a50;
  --sea: #2277a0;
  --rope: #b9812f;
  --line: #e0d2b4;
  --max: 46rem;
  --wide: 64rem;
  --hand: 'Bradley Hand', 'Segoe Print', 'Comic Sans MS', cursive;
}

* { box-sizing: border-box; }

html { font-size: 112.5%; } /* 18px base — older eyes welcome */
html[data-text-size="large"] { font-size: 131.25%; } /* ~21px */
html[data-text-size="xlarge"] { font-size: 150%; } /* 24px */

body {
  margin: 0;
  font-family: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
}
html[data-text-size="large"] body { line-height: 1.7; }
html[data-text-size="xlarge"] body { line-height: 1.75; }

/* High-contrast reading mode */
html[data-contrast="high"] {
  --ink: #1a1208;
  --ink-soft: #3d3224;
  --paper: #fff8e8;
  --card: #ffffff;
  --sand: #f0e4c4;
  --navy: #0a3a52;
  --navy-deep: #062636;
  --sea: #0b5f86;
  --rope: #8a5a12;
  --line: #c4b18a;
}
html[data-contrast="high"] body { font-weight: 500; }
html[data-contrast="high"] a { text-decoration: underline; text-underline-offset: .15em; }

h1, h2, h3, .site-nav, .brand, .meta, .btn, .chip {
  font-family: 'Avenir Next', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

h1 { font-size: 2rem; line-height: 1.2; margin: 0 0 .5rem; color: var(--navy); }
h2 { font-size: 1.4rem; line-height: 1.3; margin: 2.2rem 0 .6rem; color: var(--navy); }
h3 { font-size: 1.1rem; margin: 1.6rem 0 .4rem; color: var(--navy); }

a { color: var(--sea); }
a:hover { color: var(--navy); }

img { max-width: 100%; height: auto; border-radius: 4px; }

/* ---------- header ---------- */
.site-header {
  background: var(--navy-deep);
  color: #fff;
  padding: 1.1rem 1.2rem .9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .6rem 2rem;
}
.brand { text-decoration: none; color: #fff; display: flex; flex-direction: column; }
.brand-name { font-size: 1.7rem; font-weight: 700; letter-spacing: .02em; }
.brand-tag { font-size: .78rem; color: #9fc0d4; letter-spacing: .04em; }
.site-nav { display: flex; flex-wrap: wrap; gap: .2rem .4rem; margin-left: auto; }
.site-nav a {
  color: #d7e6ef;
  text-decoration: none;
  font-size: .95rem;
  padding: .35rem .7rem;
  border-radius: 5px;
}
.site-nav a:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.site-nav a[aria-current] { background: rgba(255, 255, 255, .16); color: #fff; }
.site-nav .nav-sale { background: var(--rope); color: #fff; font-weight: 600; }
.site-nav .nav-sale:hover { background: #a4762c; }

/* ---------- reading preferences ---------- */
.reader-bar {
  background: transparent;
  border-bottom: 1px solid var(--line);
  padding: .3rem 1.2rem;
}
.reader-inner {
  max-width: var(--wide);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .35rem .55rem;
}
.reader-label {
  font-family: 'Avenir Next', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.reader-sizes { display: flex; gap: .2rem; }
.reader-btn {
  font-family: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  font-size: .85rem;
  font-weight: 600;
  line-height: 1;
  min-width: 1.85rem;
  min-height: 1.85rem;
  padding: .2rem .4rem;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}
.reader-btn:hover {
  color: var(--navy);
  background: rgba(20, 80, 110, .06);
}
.reader-btn:focus-visible {
  outline: 2px solid var(--sea);
  outline-offset: 1px;
}
.reader-btn[aria-pressed="true"] {
  background: transparent;
  color: var(--navy);
  border-color: var(--line);
  box-shadow: inset 0 0 0 1px var(--line);
}
.reader-btn-lg { font-size: 1rem; }
.reader-btn-xl { font-size: 1.2rem; }
.reader-sep {
  width: 1px;
  height: 1rem;
  background: var(--line);
  margin: 0 .15rem;
}
.reader-contrast {
  font-family: 'Avenir Next', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  min-width: auto;
  padding: .3rem .55rem;
}
.reader-contrast[aria-pressed="true"] {
  background: rgba(20, 80, 110, .1);
  border-color: var(--line);
  color: var(--navy);
  box-shadow: none;
}

/* ---------- layout ---------- */
main { max-width: var(--max); margin: 0 auto; padding: 2rem 1.2rem 4rem; }
main.wide { max-width: var(--wide); }

.lede { font-size: 1.15rem; color: var(--ink-soft); }

.meta {
  color: var(--ink-soft);
  font-size: .85rem;
  letter-spacing: .03em;
  text-transform: uppercase;
  margin: 0 0 1.4rem;
}

hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

/* ---------- buttons & chips ---------- */
.btn {
  display: inline-block;
  background: var(--navy);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: .65rem 1.2rem;
  border-radius: 6px;
}
.btn:hover { background: var(--sea); color: #fff; }
.btn.gold { background: var(--rope); }
.btn.gold:hover { background: #a4762c; }

/* ---------- polaroids & photo frames ---------- */
.polaroid {
  background: #fff;
  padding: .55rem .55rem 0;
  box-shadow: 0 3px 14px rgba(60, 40, 10, .22);
  border-radius: 2px;
  display: inline-block;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  transition: transform .18s ease;
}
.polaroid img { display: block; border-radius: 0; }
.polaroid .cap {
  font-family: var(--hand);
  font-size: .92rem;
  color: #4c4232;
  padding: .4rem .2rem .55rem;
  display: block;
  line-height: 1.25;
}
.polaroid:hover { transform: scale(1.04) rotate(0deg) !important; z-index: 3; position: relative; }

/* ---------- home ---------- */
.hero {
  background:
    radial-gradient(60rem 30rem at 110% -20%, #dbe9f0 0%, transparent 60%),
    linear-gradient(180deg, #f2e9d4, var(--paper));
  margin: -2rem -1.2rem 2rem;
  padding: 3rem 1.4rem 2.6rem;
  border-bottom: 1px solid var(--line);
}
.hero-inner {
  max-width: var(--wide);
  margin: 0 auto;
  display: flex;
  gap: 2.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.hero-text { flex: 1 1 24rem; }
.hero h1 { font-size: 2.5rem; margin-bottom: .8rem; }
.hero p { color: var(--ink-soft); font-size: 1.12rem; margin: 0 0 1.4rem; }
.hero .btn { margin: .2rem .5rem .2rem 0; }
.hero-photos {
  flex: 1 1 22rem;
  position: relative;
  min-height: 28rem;
  min-width: 20rem;
}
.hero-photos .polaroid { position: absolute; }
.hero-photos .p1 { transform: rotate(-4deg); top: 0; left: 0; z-index: 2; }
.hero-photos .p2 { transform: rotate(3deg); top: 8.5rem; left: 13rem; }
.hero-photos .p3 { transform: rotate(-2deg); top: 15rem; left: 1.5rem; z-index: 1; }
@media (max-width: 52rem) {
  .hero-photos { min-height: 0; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
  .hero-photos .polaroid { position: static; }
}

/* ship's stats — quiet strip under the hero */
.ship-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 0 0 2rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.ship-stat {
  text-align: center;
  padding: 1.1rem .8rem;
  border-right: 1px solid var(--line);
}
.ship-stat:last-child { border-right: 0; }
.ship-stat-num {
  display: block;
  font-family: 'Avenir Next', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.1;
}
.ship-stat-label {
  display: block;
  margin-top: .3rem;
  font-family: 'Avenir Next', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* on this day */
.on-this-day {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.4rem 1.6rem 1.5rem;
  margin: 2rem 0;
}
.on-day-kicker {
  font-family: 'Avenir Next', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--rope);
  margin: 0 0 .55rem;
}
.on-this-day h2 {
  margin: 0 0 .4rem;
  font-size: 1.35rem;
}
.on-this-day h2 a { text-decoration: none; }
.on-this-day h2 a:hover { text-decoration: underline; }
.on-day-loc {
  display: block;
  font-size: .95rem;
  color: var(--ink-soft);
  margin-bottom: .6rem;
}
.on-day-excerpt {
  margin: 0 0 .9rem;
  color: var(--ink-soft);
  font-size: 1.02rem;
}
.on-day-more { font-weight: 600; }
.on-day-loading { color: var(--ink-soft); margin: 0; }

.sale-banner {
  background: linear-gradient(105deg, #f3e7cd, #ecd9b2);
  border: 1px solid #cda45e;
  border-radius: 10px;
  padding: 1.3rem 1.5rem;
  margin: 1.8rem 0;
  display: flex;
  gap: 1.4rem;
  align-items: center;
  flex-wrap: wrap;
}
.sale-banner .sale-text { flex: 1 1 18rem; }
.sale-banner h2 { margin: 0 0 .3rem; }
.sale-banner .polaroid { transform: rotate(2deg); flex: 0 0 auto; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1.2rem;
  margin: 1.5rem 0;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(60, 40, 10, .08);
  transition: transform .18s ease, box-shadow .18s ease;
  text-decoration: none;
  color: var(--ink);
  display: block;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(60, 40, 10, .16); color: var(--ink); }
.card img.card-photo {
  width: 100%;
  height: 10.5rem;
  object-fit: cover;
  border-radius: 0;
  display: block;
  border-bottom: 1px solid var(--line);
}
.card .card-body { padding: 1rem 1.2rem 1.1rem; }
.card h3 { margin-top: 0; }
.card p { margin: .4rem 0 .6rem; font-size: .95rem; color: var(--ink-soft); }

/* postcard strip */
.postcards {
  display: flex;
  gap: 1.3rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: 1.2rem 0 0;
  padding: 1.8rem 1rem;
  background: var(--sand);
  border-radius: 12px;
}
.postcards .polaroid:nth-child(odd) { transform: rotate(-2.5deg); }
.postcards .polaroid:nth-child(even) { transform: rotate(2deg); }
.postcards img { height: 9.5rem; width: auto; max-width: 14rem; object-fit: cover; }
a.polaroid { cursor: pointer; }
a.polaroid:hover { color: var(--ink); }

/* crew block */
.crew-block {
  display: flex;
  gap: 1.8rem;
  align-items: center;
  flex-wrap: wrap;
  margin: 2.4rem 0;
  padding: 1.6rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.crew-block .polaroid { transform: rotate(-2deg); flex: 0 0 auto; }
.crew-block .crew-text { flex: 1 1 18rem; }
.crew-block h2 { margin-top: 0; }

/* ---------- diary ---------- */
.chapter { margin: 2.6rem 0; }
.chapter-head { display: flex; gap: 1.4rem; align-items: flex-start; }
.chapter-head .polaroid { flex: 0 0 auto; transform: rotate(2.5deg); margin-top: .4rem; }
.chapter-head .polaroid img { width: 10rem; height: auto; }
.chapter:nth-of-type(even) .chapter-head .polaroid { transform: rotate(-2.5deg); }
.chapter-blurb { color: var(--ink-soft); margin: .3rem 0 1rem; }
.entry-list .thumb {
  width: 4.6rem; height: 3.4rem; object-fit: cover;
  border-radius: 4px; flex-shrink: 0; border: 2px solid #fff;
  box-shadow: 0 1px 5px rgba(60,40,10,.25);
}
.entry-list { list-style: none; padding: 0; margin: 0; }
.entry-list li {
  padding: .55rem 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 1rem;
  align-items: baseline;
}
.entry-list .d {
  font-family: 'Avenir Next', 'Segoe UI', sans-serif;
  font-size: .8rem;
  color: var(--ink-soft);
  min-width: 6.6rem;
  flex-shrink: 0;
}
.entry-list a { text-decoration: none; font-weight: 600; }
.entry-list .x { color: var(--ink-soft); font-size: .9rem; display: block; font-weight: 400; }

.entry-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-family: 'Avenir Next', 'Segoe UI', sans-serif;
  font-size: .92rem;
}
.entry-nav a { text-decoration: none; max-width: 46%; }
.entry-nav .next { text-align: right; margin-left: auto; }

.entry-body p:first-of-type::first-letter {
  font-size: 1.6em;
  color: var(--navy);
}

/* ---------- boat for sale ---------- */
.spec-table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; }
.spec-table td, .spec-table th {
  text-align: left;
  padding: .5rem .6rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.spec-table th { font-family: 'Avenir Next', 'Segoe UI', sans-serif; font-size: .9rem; white-space: nowrap; color: var(--navy); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .7rem; margin: 1.4rem 0; }
.gallery img { width: 100%; height: 10rem; object-fit: cover; }

/* ---------- map ---------- */
.map-shell {
  display: grid;
  grid-template-columns: 20rem 1fr;
  gap: 1.2rem;
  align-items: start;
  margin: 1.5rem 0;
}
#voyage-map { height: 74vh; min-height: 26rem; border-radius: 8px; border: 1px solid var(--line); }

.map-legs { display: flex; flex-direction: column; gap: .7rem; max-height: 74vh; overflow-y: auto; padding-right: .2rem; }
.map-all { font-size: .85rem; padding: .5rem .9rem; }
.leg-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .7rem .85rem;
}
.leg-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  font-family: 'Avenir Next', 'Segoe UI', sans-serif;
}
.leg-head input { accent-color: var(--navy); }
.leg-chip { width: .85rem; height: .85rem; border-radius: 50%; flex-shrink: 0; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.leg-title {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-weight: 700; color: var(--navy); text-align: left; flex: 1;
}
.leg-title:hover { color: var(--sea); text-decoration: underline; }
.leg-years { font-size: .75rem; color: var(--ink-soft); white-space: nowrap; }
.leg-blurb { font-size: .85rem; color: var(--ink-soft); margin: .45rem 0 .3rem; line-height: 1.45; }
.leg-stories summary {
  font-family: 'Avenir Next', 'Segoe UI', sans-serif;
  font-size: .78rem; letter-spacing: .04em; text-transform: uppercase;
  color: var(--sea); cursor: pointer;
}
.leg-stories ul { margin: .35rem 0 .1rem; padding-left: 1.1rem; font-size: .9rem; }
.leg-stories li { margin: .15rem 0; }

/* leaflet popup, restyled to match the site */
.leaflet-popup-content-wrapper {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(60, 40, 10, .3);
  font-family: Georgia, serif;
}
.leaflet-popup-content { margin: 0; line-height: 1.45; }
.leaflet-popup-tip { background: var(--card); }
.wp-pop { width: 240px; }
.wp-pop img { width: 100%; height: 130px; object-fit: cover; display: block; border-radius: 7px 7px 0 0; }
.wp-pop .wp-body { padding: .6rem .75rem .7rem; display: flex; flex-direction: column; gap: .15rem; }
.wp-pop .wp-leg {
  font-family: 'Avenir Next', 'Segoe UI', sans-serif;
  font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700;
}
.wp-pop strong { font-size: 1rem; color: var(--navy); }
.wp-pop .wp-meta { font-size: .8rem; color: var(--ink-soft); }
.wp-pop a { font-size: .9rem; margin-top: .25rem; }


/* ---------- footer ---------- */
.site-footer {
  background: var(--navy-deep);
  color: #b9cfdd;
  padding: 1.6rem 1.2rem 2rem;
  text-align: center;
  font-size: .9rem;
}
.site-footer a { color: #d7e6ef; }
.footer-fine { color: #7d9cb0; font-size: .8rem; }

@media (max-width: 40rem) {
  html:not([data-text-size]),
  html[data-text-size="normal"] { font-size: 106%; }
  html[data-text-size="large"] { font-size: 118%; }
  html[data-text-size="xlarge"] { font-size: 137.5%; }
  .hero h1 { font-size: 1.8rem; }
  .entry-list li { flex-direction: column; gap: .1rem; }
  .map-shell { grid-template-columns: 1fr; }
  .map-legs { max-height: none; order: 2; }
  #voyage-map { height: 60vh; }
  .reader-inner { justify-content: flex-start; }
  .ship-stats { grid-template-columns: repeat(2, 1fr); }
  .ship-stat:nth-child(2) { border-right: 0; }
  .ship-stat:nth-child(1),
  .ship-stat:nth-child(2) { border-bottom: 1px solid var(--line); }
}
