/* The Journal Library (/journals): adult journals. Its own look, apart from the
   main site and /kids: warm paper, deep ink, clay accents, an editorial serif. */
:root {
  --paper: #f4efe5;
  --paper-2: #ebe3d4;
  --card: #fbf8f2;
  --ink: #1e2b25;
  --ink-2: #47544d;
  --clay: #a4513a;
  --clay-2: #8a412d;
  --brass: #8c7136;
  --line: rgba(30, 43, 37, 0.16);
  --shadow: 0 1px 0 rgba(30, 43, 37, 0.06), 0 18px 40px -22px rgba(30, 43, 37, 0.45);
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Instrument Sans", "Avenir Next", system-ui, sans-serif;
  --wrap: 1180px;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.6 var(--sans); }
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }
.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; z-index: 50; }
.skip:focus { left: 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header */
.top { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 20; }
.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.brand img { height: 34px; width: auto; }
.brand span { font: italic 400 1.05rem/1 var(--serif); color: var(--ink-2); padding-left: 12px; border-left: 1px solid var(--line); }
.nav { margin-left: auto; display: flex; gap: 22px; font-size: 0.94rem; }
.nav a { text-decoration: none; padding: 6px 0; border-bottom: 1px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-color: var(--clay); }
.menu-btn { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; min-height: 44px; cursor: pointer; }
@media (max-width: 760px) {
  .brand span { display: none; }
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--line); flex-direction: column; gap: 0; padding: 8px 16px 16px; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
}

/* ---------- type */
.eyebrow { font: 600 0.74rem/1.2 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--clay); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: -0.01em; }
.display { font: 300 clamp(2.9rem, 8vw, 6.4rem)/0.95 var(--serif); font-variation-settings: "opsz" 144, "SOFT" 60; letter-spacing: -0.03em; }
.display em { font-style: italic; color: var(--clay); }
.lede { font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: var(--ink-2); max-width: 36em; }

/* ---------- masthead */
.mast { padding: clamp(40px, 8vw, 96px) 0 clamp(32px, 6vw, 64px); border-bottom: 1px solid var(--line); }
.mast-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(24px, 5vw, 72px); align-items: end; }
.mast .eyebrow { margin-bottom: 20px; }
.mast .lede { margin: 28px 0 0; }
.facts { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.facts li { padding: 18px 0; border-bottom: 1px solid var(--line); }
.facts li:nth-child(odd) { padding-right: 16px; border-right: 1px solid var(--line); }
.facts li:nth-child(even) { padding-left: 20px; }
.facts b { display: block; font: 400 2rem/1 var(--serif); }
.facts span { font-size: 0.88rem; color: var(--ink-2); }
@media (max-width: 860px) { .mast-grid { grid-template-columns: 1fr; } }

/* ---------- shelf */
.shelf { padding: 40px 0 88px; }
.shelf-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.shelf-head h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); }
.count { color: var(--ink-2); font-size: 0.92rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 36px; padding: 0; list-style: none; }
.chip { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 9px 16px; min-height: 44px; cursor: pointer; font-size: 0.92rem; transition: background .2s, color .2s, border-color .2s; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip small { opacity: .65; margin-left: 4px; }
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 44px 28px; }
.book { position: relative; }
.book[hidden] { display: none; }
.book a { text-decoration: none; display: block; }
.cover { position: relative; aspect-ratio: 5 / 4; background: var(--paper-2); border-radius: 3px; overflow: hidden; box-shadow: var(--shadow); transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.book a:hover .cover { transform: translateY(-6px) rotate(-0.4deg); box-shadow: 0 1px 0 rgba(30,43,37,.06), 0 28px 50px -24px rgba(30,43,37,.55); }
.no { display: flex; justify-content: space-between; gap: 12px; margin: 18px 0 6px; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.no b { color: var(--clay); font-weight: 600; }
.book h3 { font-size: 1.45rem; line-height: 1.15; }
.book .sub { margin: 6px 0 10px; color: var(--ink-2); font-size: 0.95rem; line-height: 1.45; }
.price { font-size: 0.9rem; border-top: 1px solid var(--line); padding-top: 10px; display: flex; gap: 14px; flex-wrap: wrap; }
.price span { white-space: nowrap; }
.price b { font-weight: 600; }
.empty { padding: 40px 0; color: var(--ink-2); }

/* ---------- how it works */
.how { background: var(--paper-2); padding: clamp(56px, 8vw, 96px) 0; }
.how h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); max-width: 16em; }
.steps { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; counter-reset: s; }
.steps li { border-top: 1px solid var(--ink); padding-top: 18px; counter-increment: s; }
.steps li::before { content: counter(s, upper-roman); font: italic 400 1.6rem/1 var(--serif); color: var(--clay); display: block; margin-bottom: 14px; }
.steps h3 { font-size: 1.3rem; margin-bottom: 6px; }
.steps p { margin: 0; color: var(--ink-2); }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* ---------- product page */
.crumbs { padding: 22px 0 0; font-size: 0.86rem; color: var(--ink-2); }
.crumbs a { text-decoration: none; border-bottom: 1px solid var(--line); }
.item { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(28px, 5vw, 72px); padding: 28px 0 80px; align-items: start; }
@media (max-width: 900px) { .item { grid-template-columns: 1fr; } }
.gallery { position: sticky; top: 92px; }
@media (max-width: 900px) { .gallery { position: static; } }
.gallery .main { margin: 0; aspect-ratio: 5 / 4; background: var(--paper-2); box-shadow: var(--shadow); border-radius: 3px; overflow: hidden; }
.gallery .main img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin: 14px 0 0; padding: 0; }
.thumbs button { padding: 0; border: 1px solid transparent; background: var(--paper-2); border-radius: 2px; cursor: pointer; aspect-ratio: 5 / 4; overflow: hidden; opacity: .7; transition: opacity .2s, border-color .2s; width: 100%; }
.thumbs button[aria-pressed="true"], .thumbs button:hover { opacity: 1; border-color: var(--ink); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.detail .no { margin-top: 0; }
.detail h1 { font: 300 clamp(2.4rem, 5.6vw, 4.2rem)/1 var(--serif); font-variation-settings: "opsz" 144; letter-spacing: -0.025em; }
.detail .subtitle { font: italic 400 clamp(1.1rem, 2.2vw, 1.35rem)/1.35 var(--serif); color: var(--ink-2); margin: 14px 0 0; }
.hook { margin: 28px 0; padding: 20px 0 20px 22px; border-left: 2px solid var(--clay); font: 400 1.2rem/1.45 var(--serif); }
.detail p { margin: 0 0 16px; }
.inside { margin: 26px 0; }
.inside h2 { font: 600 0.78rem/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--clay); margin-bottom: 12px; }
.inside ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.inside li { padding: 11px 0 11px 28px; border-bottom: 1px solid var(--line); position: relative; }
.inside li::before { content: "❧"; position: absolute; left: 2px; top: 10px; color: var(--brass); }
.for { color: var(--ink-2); font-style: italic; font-family: var(--serif); font-size: 1.08rem; }

.formats { border: 0; padding: 0; margin: 30px 0 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.formats legend { font: 600 0.78rem/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--clay); margin-bottom: 12px; padding: 0; }
.format { position: relative; display: block; cursor: pointer; border: 1px solid var(--line); background: var(--card); border-radius: 4px; padding: 16px 16px 14px; transition: border-color .2s, box-shadow .2s; }
.format input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.format:hover { border-color: var(--ink-2); }
.format:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.format:has(input:focus-visible) { outline: 2px solid var(--clay); outline-offset: 3px; }
.format .name { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.format .name b { font: 400 1.3rem/1 var(--serif); }
.format small { display: block; color: var(--ink-2); margin-top: 6px; font-size: 0.85rem; line-height: 1.4; }
@media (max-width: 420px) { .formats { grid-template-columns: 1fr; } }
.buy { width: 100%; min-height: 56px; border: 0; border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 600; font-size: 1.02rem; letter-spacing: 0.02em; cursor: pointer; transition: background .2s; }
.buy:hover { background: var(--clay-2); }
.buy:disabled { opacity: .7; cursor: progress; }
.msg { margin: 14px 0 0; padding: 12px 14px; background: var(--paper-2); border-radius: 4px; font-size: 0.95rem; }
.msg[hidden] { display: none; }
.perks { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.86rem; color: var(--ink-2); }
.perks li::before { content: "✓ "; color: var(--brass); }
.note { font-size: 0.82rem; color: var(--ink-2); margin-top: 26px; border-top: 1px solid var(--line); padding-top: 14px; }
.more { border-top: 1px solid var(--line); padding: 56px 0 88px; }
.more h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); margin-bottom: 28px; }

/* ---------- footer */
.foot { background: var(--ink); color: var(--paper); padding: 56px 0 40px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.foot h2 { font: italic 300 2rem/1.1 var(--serif); }
.foot p { color: rgba(244,239,229,.75); margin: 12px 0 0; max-width: 28em; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin: 0 0 8px; }
.foot a { text-decoration: none; border-bottom: 1px solid rgba(244,239,229,.25); }
.foot a:hover { border-color: var(--paper); }
.foot .fine { grid-column: 1 / -1; border-top: 1px solid rgba(244,239,229,.18); padding-top: 18px; font-size: 0.82rem; color: rgba(244,239,229,.6); }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* Phones: two books per row so the shelf stays browsable. */
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr 1fr; gap: 32px 14px; }
  .no { margin-top: 12px; }
  .no span { display: none; }
  .book h3 { font-size: 1.12rem; }
  .book .sub { font-size: 0.84rem; }
  .price { flex-direction: column; gap: 2px; font-size: 0.84rem; }
  .facts span { line-height: 1.4; }
}
