/* J. J. Coombe and Tales of Wending Vale: one stylesheet for every page. */

:root {
  --paper: #f5ecd7;
  --paper-2: #efe2c4;
  --card: #fbf5e7;
  --ink: #2e2217;
  --ink-soft: #5c4a37;
  --rule: #cdb78f;
  --accent: #8a4b22;
  --accent-ink: #fff8ec;
  --focus: #1f5f99;
  --shadow: 0 1px 2px rgba(60, 40, 20, .08), 0 6px 18px rgba(60, 40, 20, .10);
  --zac: #a8401f;      /* the dragon thread */
  --lauren: #275a86;   /* the night-mail thread */
  --lainey: #6d3f86;   /* the knot thread */
  --map-dim: 1;
  --radius: 10px;
  --gutter: 16px;
  --measure: 38rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1b1712; --paper-2: #221d17; --card: #29231c; --ink: #ede2cb; --ink-soft: #c2b296;
    --rule: #4a3f31; --accent: #e09a62; --accent-ink: #1b1712; --focus: #8cc4ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .35);
    --zac: #ee8a62; --lauren: #7fb2e0; --lainey: #c49ae0; --map-dim: .82; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1b1712; --paper-2: #221d17; --card: #29231c; --ink: #ede2cb; --ink-soft: #c2b296;
  --rule: #4a3f31; --accent: #e09a62; --accent-ink: #1b1712; --focus: #8cc4ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .35);
  --zac: #ee8a62; --lauren: #7fb2e0; --lainey: #c49ae0; --map-dim: .82; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0;
  background: var(--paper);
  background-image: radial-gradient(ellipse at 20% 0%, var(--paper-2), transparent 60%), radial-gradient(ellipse at 90% 100%, var(--paper-2), transparent 55%);
  color: var(--ink);
  font-family: "EB Garamond", Georgia, "Times New Roman", serif;
  font-size: 1.1875rem;
  line-height: 1.6;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: .15em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: var(--gutter); top: -100px; background: var(--card); padding: .4rem .8rem; z-index: 10; border-radius: 6px; }
.skip:focus { top: .5rem; }

h1, h2, h3 { font-weight: 500; line-height: 1.15; letter-spacing: .005em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 6vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 4.2vw, 2.4rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
.smallcaps { font-variant: small-caps; letter-spacing: .06em; }
.wrap { width: 100%; max-width: 72rem; margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: var(--measure); }
section { padding: 2.5rem 0; }
.lede { font-size: 1.25rem; color: var(--ink-soft); max-width: var(--measure); }

/* ornament rule */
.flourish { display: flex; align-items: center; gap: .8rem; color: var(--rule); margin: 0 auto; max-width: 20rem; }
.flourish::before, .flourish::after { content: ""; flex: 1; height: 1px; background: currentColor; }
.flourish svg { width: 22px; height: 22px; color: var(--accent); opacity: .8; }

/* header and footer */
.site-head { border-bottom: 1px solid var(--rule); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1rem; padding-top: .8rem; padding-bottom: .8rem; }
.brand { font-size: 1.5rem; color: var(--ink); text-decoration: none; letter-spacing: .04em; white-space: nowrap; }
.brand small { display: block; font-size: .8rem; color: var(--ink-soft); font-style: italic; letter-spacing: .02em; }
.nav { display: flex; flex-wrap: wrap; gap: .2rem .9rem; align-items: center; margin: 0; padding: 0; list-style: none; font-size: 1.05rem; }
.nav a { color: var(--ink); text-decoration: none; padding: .2rem 0; border-bottom: 1px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--accent); }
.theme-btn { font: inherit; font-size: .95rem; background: none; border: 1px solid var(--rule); color: var(--ink-soft); border-radius: 999px; padding: .1rem .7rem; cursor: pointer; }
.theme-btn:hover { color: var(--ink); border-color: var(--ink-soft); }
.site-foot { border-top: 1px solid var(--rule); margin-top: 2rem; padding: 1.6rem 0 2.4rem; color: var(--ink-soft); font-size: 1rem; }
.site-foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem 1.4rem; }
.site-foot a { color: var(--ink-soft); }

/* hero */
.hero { padding: 3rem 0 2rem; text-align: center; }
.hero .kicker { font-style: italic; color: var(--ink-soft); font-size: 1.15rem; margin-bottom: .3rem; }
.hero h1 { margin-bottom: .3rem; }
.hero .tagline { font-size: 1.3rem; color: var(--ink-soft); max-width: 34rem; margin: 0 auto 1rem; }

/* book badges and icons */
.ico { width: 1.2em; height: 1.2em; vertical-align: -.22em; flex: none; }
.ico--zac { color: var(--zac); } .ico--lauren { color: var(--lauren); } .ico--lainey { color: var(--lainey); }
.ages { display: inline-block; font-size: .95rem; border: 1px solid var(--rule); border-radius: 999px; padding: 0 .65rem; color: var(--ink-soft); white-space: nowrap; }
.soon { display: inline-block; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: .05rem .7rem; white-space: nowrap; }
.btn { display: inline-block; font: inherit; font-size: 1.05rem; text-decoration: none; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 999px; padding: .45rem 1.2rem; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn--ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }

/* book cards (home) */
.books { display: grid; gap: 1.6rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }
.book-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; border-top: 5px solid var(--thread, var(--accent)); }
.book-card[data-book="zac"] { --thread: var(--zac); }
.book-card[data-book="lauren"] { --thread: var(--lauren); }
.book-card[data-book="lainey"] { --thread: var(--lainey); }
.book-card .art { aspect-ratio: 16 / 10; overflow: hidden; background: #241a12; }
.book-card .art img { width: 100%; height: 100%; object-fit: cover; }
.book-card .body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.book-card h3 { margin: 0; font-size: 1.55rem; }
.book-card h3 a { color: var(--ink); text-decoration: none; }
.book-card h3 a:hover { text-decoration: underline; }
.book-card .meta { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.book-card .blurb { margin: .2rem 0 .4rem; }
.book-card .more { margin-top: auto; }

/* Lainey's typographic panel (no art yet) */
.knot-panel { position: relative; height: 100%; min-height: 12rem; display: grid; place-items: center; text-align: center; color: #f6ecff;
  background: radial-gradient(circle at 50% 40%, #7d4c98, #432556 75%); overflow: hidden; }
.knot-panel .knot-bg { position: absolute; inset: 0; width: 100%; height: 100%; color: rgba(255, 255, 255, .09); }
.knot-panel .knot-main { display: block; width: 4.2rem; height: 4.2rem; color: #f0dcff; margin: 0 auto .4rem; }
.knot-panel .t { position: relative; font-size: clamp(1.4rem, 3.4vw, 2rem); font-style: italic; line-height: 1.1; padding: 0 1rem; }
.knot-panel .s { position: relative; display: block; font-size: .95rem; font-style: normal; letter-spacing: .14em; text-transform: uppercase; opacity: .8; margin-top: .4rem; }

/* welcome teaser and text */
.welcome { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(1.2rem, 4vw, 2.4rem); position: relative; }
.welcome p:first-of-type::first-letter { float: left; font-size: 3.3em; line-height: .85; padding: .06em .08em 0 0; color: var(--accent); }
.welcome .booklist { list-style: none; padding: 0; margin: 1rem 0; }
.welcome .booklist li { margin: .35rem 0; padding-left: 1.8rem; text-indent: -1.8rem; }
.welcome .booklist .ico { margin-right: .5rem; }
.about { text-align: center; font-style: italic; font-size: 1.25rem; color: var(--ink-soft); max-width: 36rem; margin: 0 auto; }

/* map */
.map-layout { display: grid; gap: 1.2rem; grid-template-columns: minmax(0, 1fr); }
.map-layout > * { min-width: 0; }
@media (min-width: 1000px) { .map-layout { grid-template-columns: minmax(0, 1fr) 19rem; align-items: start; } }
.map-scroller { border-radius: var(--radius); box-shadow: var(--shadow); overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; background: #ece2c8; border: 1px solid var(--rule); }
.map { position: relative; width: 100%; min-width: 760px; }
@media (min-width: 761px) { .map { min-width: 0; } }
.map img { width: 100%; height: auto; filter: brightness(var(--map-dim)); user-select: none; }
.map-hint { font-size: .95rem; color: var(--ink-soft); font-style: italic; margin: .4rem 0 0; }
@media (min-width: 761px) { .map-hint--phone { display: none; } }
.pin { position: absolute; transform: translate(-50%, -50%); background: none; border: 0; padding: 0; margin: 0; cursor: pointer; font: inherit; color: #2e2217; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.pin-dot { width: 15px; height: 15px; border-radius: 50%; background: #fbf3df; border: 2.5px solid #5a2f15; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); transition: transform .12s; }
.pin--major .pin-dot { width: 18px; height: 18px; background: #8a4b22; border-color: #fbf3df; }
.pin:hover .pin-dot, .pin:focus-visible .pin-dot { transform: scale(1.25); }
.pin[aria-pressed="true"] .pin-dot { background: #a8401f; border-color: #fff; transform: scale(1.35); }
.pin-label { position: absolute; left: 100%; top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: .95rem; font-style: italic; line-height: 1; padding: .15rem .35rem; margin-left: 1px;
  color: #2e2217; background: rgba(251, 245, 231, .82); border-radius: 4px; pointer-events: none; opacity: 0; transition: opacity .12s; }
.pin--label-left .pin-label { left: auto; right: 100%; margin: 0 1px 0 0; }
.pin--label-below .pin-label { left: 50%; top: 100%; transform: translateX(-50%); margin: 0; }
.pin--major .pin-label, .pin:hover .pin-label, .pin:focus-visible .pin-label, .pin[aria-pressed="true"] .pin-label { opacity: 1; }
.pin--major .pin-label { font-style: normal; font-size: 1.02rem; }
@media (min-width: 1200px) { .pin-label { opacity: 1; } }
.pin:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.pin:hover, .pin:focus-visible, .pin[aria-pressed="true"] { z-index: 3; }
.pin.is-dim { opacity: .28; }
.pin.is-dim .pin-label { opacity: 0; }
.pin--north .pin-dot, .pin--west .pin-dot { border-radius: 3px; width: 0; height: 0; border: 0; background: none; box-shadow: none; }
.pin--north::before, .pin--west::before { content: ""; width: 0; height: 0; border-left: 11px solid transparent; border-right: 11px solid transparent; border-bottom: 18px solid #5a2f15; filter: drop-shadow(0 1px 1px rgba(0,0,0,.3)); }
.pin--west::before { transform: rotate(-90deg); }
.pin--north[aria-pressed="true"]::before, .pin--west[aria-pressed="true"]::before { border-bottom-color: #a8401f; }

.map-side { display: flex; flex-direction: column; gap: 1rem; }
.filters { display: flex; flex-wrap: wrap; gap: .4rem; }
.filters button { font: inherit; font-size: .98rem; display: inline-flex; align-items: center; gap: .35rem; background: var(--card); color: var(--ink); border: 1px solid var(--rule); border-radius: 999px; padding: .2rem .75rem; cursor: pointer; }
.filters button[aria-pressed="true"] { border-color: var(--ink); background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--ink); }
.place-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.2rem; border-left: 5px solid var(--accent); min-height: 9rem; }
.place-card h3 { margin-bottom: .3rem; }
.place-card .in { font-size: 1rem; color: var(--ink-soft); margin: .6rem 0 0; }
.place-card .in ul { list-style: none; padding: 0; margin: .2rem 0 0; }
.place-card .in li { display: flex; gap: .45rem; align-items: center; margin: .15rem 0; }
.key { font-size: 1rem; color: var(--ink-soft); }
.key ul { list-style: none; margin: .3rem 0 0; padding: 0; }
.key li { display: flex; align-items: center; gap: .5rem; margin: .2rem 0; }
details.all-places { margin-top: 1.4rem; background: var(--card); border-radius: var(--radius); padding: .8rem 1.2rem; box-shadow: var(--shadow); }
details.all-places summary { cursor: pointer; font-size: 1.15rem; }
.place-list { columns: 2 22rem; column-gap: 2rem; padding: 0; list-style: none; margin: 1rem 0 .4rem; }
.place-list li { break-inside: avoid; margin-bottom: .8rem; font-size: 1.02rem; }
.place-list .place-books { white-space: nowrap; margin-left: .2rem; }

/* timeline: one autumn, three stories */
.timeline { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; margin-top: 1rem; }
.timeline caption { text-align: left; }
.timeline th, .timeline td { vertical-align: top; text-align: left; }
.timeline thead th { font-weight: 500; font-size: 1.1rem; padding: 0 .6rem .8rem; }
.timeline thead th .ico { width: 1.5em; height: 1.5em; display: block; margin-bottom: .2rem; }
.timeline thead th:first-child { width: 9.5rem; }
.timeline tbody th { font-weight: 500; font-style: italic; padding: 1rem .8rem 1rem 0; font-size: 1.1rem; color: var(--ink-soft); }
.timeline td { position: relative; padding: .7rem .6rem 1rem; }
.timeline td::before { content: ""; position: absolute; top: 0; bottom: 0; left: 1.35rem; width: 4px; border-radius: 2px; background: var(--thread); opacity: .85; }
.timeline .t-zac { --thread: var(--zac); } .timeline .t-lauren { --thread: var(--lauren); } .timeline .t-lainey { --thread: var(--lainey); }
.beat { position: relative; background: var(--card); border-radius: 8px; box-shadow: var(--shadow); padding: .55rem .8rem; margin-left: .3rem; border-left: 4px solid var(--thread); font-size: 1.02rem; line-height: 1.45; }
.beat.quiet { background: transparent; box-shadow: none; border-left-color: transparent; color: var(--ink-soft); font-style: italic; padding-left: 2rem; }
.timeline td.together::before { display: none; }
.together .braid { display: block; width: 100%; height: 34px; }
.together .beat { margin: .2rem auto 0; max-width: 34rem; text-align: center; border-left: 0; border-top: 4px solid var(--accent); font-size: 1.12rem; }
@media (max-width: 700px) {
  .timeline, .timeline tbody, .timeline tr, .timeline th, .timeline td { display: block; width: 100%; }
  .timeline thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .timeline tbody th { padding: 1.2rem 0 .3rem; border-top: 1px solid var(--rule); }
  .timeline td { padding: .3rem 0 .3rem 1.4rem; }
  .timeline td::before { left: .3rem; }
  .timeline td[data-empty] { display: none; }
  .timeline td .beat::before { content: attr(data-book); display: block; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--thread); margin-bottom: .1rem; }
  .together .beat::before { display: none !important; }
  .timeline td.together { padding-left: 0; }
}

/* who's who */
.people { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); margin-top: 1rem; }
.person { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: .35rem; border-top: 4px solid var(--thread, var(--accent)); }
.person[data-home="zac"] { --thread: var(--zac); } .person[data-home="lauren"] { --thread: var(--lauren); } .person[data-home="lainey"] { --thread: var(--lainey); }
.person header { display: flex; gap: .75rem; align-items: center; }
.monogram { flex: none; width: 2.6rem; height: 2.6rem; border-radius: 50%; display: grid; place-items: center; font-size: 1.4rem; color: var(--card); background: var(--thread); }
.person h3 { margin: 0; font-size: 1.3rem; }
.person .role { margin: 0; font-style: italic; color: var(--ink-soft); font-size: 1rem; line-height: 1.3; }
.person p { margin: 0; font-size: 1.02rem; line-height: 1.45; }
.person .in { margin-top: auto; padding-top: .5rem; display: flex; flex-wrap: wrap; gap: .3rem .8rem; font-size: .92rem; color: var(--ink-soft); }
.person .in span { display: inline-flex; align-items: center; gap: .25rem; }

/* book pages */
.book-hero { padding: 2rem 0 1rem; }
.book-hero .grid { display: grid; gap: 1.6rem; align-items: center; }
.book-hero .grid > * { min-width: 0; }
@media (min-width: 860px) { .book-hero .grid { grid-template-columns: 1.15fr 1fr; } }
.book-hero figure, .figure { margin: 0; }
.book-hero img, .figure img, .book-hero .knot-panel { border-radius: var(--radius); box-shadow: var(--shadow); }
.book-hero .knot-panel { aspect-ratio: 16 / 10; height: auto; width: 100%; }
.series-line { font-style: italic; color: var(--ink-soft); margin: 0 0 .2rem; display: flex; gap: .5rem; align-items: center; }
.book-hero h1 { margin-bottom: .6rem; }
.book-hero .meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.book-hero .blurb { font-size: 1.25rem; }
figcaption { font-size: .98rem; color: var(--ink-soft); font-style: italic; margin-top: .5rem; }
.crosses { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.cross { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.2rem; border-left: 5px solid var(--thread); }
.cross[data-book="zac"] { --thread: var(--zac); } .cross[data-book="lauren"] { --thread: var(--lauren); } .cross[data-book="lainey"] { --thread: var(--lainey); }
.cross h3 { display: flex; gap: .5rem; align-items: center; font-size: 1.3rem; }
.cross h3 a { color: var(--ink); }
.cross p { margin: 0; font-size: 1.05rem; }
.notice { border: 1px dashed var(--rule); border-radius: var(--radius); padding: .9rem 1.1rem; color: var(--ink-soft); font-size: 1.05rem; }
