/* =========================================================
   The Herbalist Who Reads — base styles
   Palette sampled from @jewishherbalist Canva designs
   ========================================================= */

:root {
  /* paper + sage backgrounds */
  --paper:        #d1cdbd;   /* mandala-pattern sage paper */
  --paper-light:  #e4e0d1;
  --paper-deep:   #c3c3af;
  --cream:        #ece8da;
  --pale-sage:    #d6d6b0;   /* light callout boxes */

  /* greens */
  --olive:        #737155;   /* "Part 2" background */
  --olive-deep:   #5c5b42;
  --sage:         #9da88b;   /* watercolor leaves */
  --forest:       #2f4a26;   /* Bree Serif body text */

  /* warm accents */
  --bark:         #4a2f1c;   /* handwritten headings */
  --blush:        #cfb4a1;   /* dusty-rose callout boxes */
  --gold:         #96723a;   /* geometric line pattern */
  --star:         #e3b23c;
  --chili:        #b0412c;

  --ink-muted:    #5d5a45;

  --radius:       18px;
  --radius-sm:    10px;
  --shadow:       0 1px 2px rgba(74,47,28,.08), 0 8px 24px -12px rgba(74,47,28,.25);

  --f-hand:  "Patrick Hand", "Comic Neue", cursive;
  --f-slab:  "Bree Serif", Georgia, serif;
  --f-body:  "Lora", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--forest);
  font: 400 17px/1.65 var(--f-body);
  background-color: var(--paper);
  /* Olive branch wallpaper (assets/pattern-olive.svg, generated by tools/pattern-olive.py) */
  background-image: url("../assets/pattern-olive.svg");
  background-size: 320px 320px;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
svg { display: block; }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2 { font-family: var(--f-hand); color: var(--bark); font-weight: 400; line-height: 1.05; margin: 0 0 .4em; letter-spacing: -.01em; }
h2 { font-size: clamp(2rem, 4vw, 2.75rem); }
h3 { font-family: var(--f-slab); font-weight: 400; color: var(--forest); margin: 0 0 .2em; line-height: 1.25; }
p { margin: 0 0 1em; }

.muted { color: var(--ink-muted); }
.small { font-size: .85rem; }

/* ---------- Buttons, tags, chips ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  font: 1.15rem/1 var(--f-hand); text-decoration: none;
  padding: .75em 1.4em; border-radius: 999px; border: 1.5px solid transparent;
  cursor: pointer; transition: transform .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--forest); color: var(--cream); }
.btn-primary:hover { background: #24391d; }
.btn-ghost { border-color: var(--bark); color: var(--bark); }
.btn-ghost:hover { background: rgba(74,47,28,.06); }
.btn-cream { background: var(--cream); color: var(--forest); }

.tag {
  display: inline-block; font: .95rem/1 var(--f-hand); color: var(--bark);
  background: var(--pale-sage); padding: .45em .9em; border-radius: 999px; margin-bottom: .8rem;
}
.tag-blush { background: var(--blush); }
.tag-pale  { background: var(--pale-sage); }

.chip {
  font: 1.05rem/1 var(--f-hand); color: var(--bark); background: transparent;
  border: 1.5px solid rgba(74,47,28,.35); padding: .5em 1em; border-radius: 999px; cursor: pointer;
}
.chip.is-active, .chip:hover { background: var(--bark); color: var(--cream); border-color: var(--bark); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(209,205,189,.88); backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(74,47,28,.12);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 8px; font: 1.6rem/1 var(--f-hand); color: var(--bark); text-decoration: none; white-space: nowrap; }
.brand-mark { width: 26px; height: 26px; color: var(--forest); }
.nav { display: flex; gap: 26px; margin-left: auto; }
.nav a { font-family: var(--f-slab); font-size: .98rem; text-decoration: none; color: var(--forest); position: relative; }
.nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -4px; height: 2px; background: var(--gold); transition: right .2s ease; }
.nav a:hover::after { right: 0; }
.header-tools { display: flex; gap: 6px; }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: none; border: 0; color: var(--bark); cursor: pointer; }
.icon-btn:hover { background: rgba(74,47,28,.08); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 72px 0 110px; }
.hero-inner { display: grid; grid-template-columns: 1.25fr .9fr; gap: 56px; align-items: center; position: relative; z-index: 1; }
.eyebrow { font: 1.1rem/1 var(--f-hand); color: var(--olive-deep); letter-spacing: .02em; margin-bottom: 18px; }
.hero h1 { font-size: clamp(3.4rem, 8vw, 6.2rem); line-height: .95; margin-bottom: 18px; }
.hebrew { font-family: var(--f-slab); color: var(--olive-deep); font-size: 1.15rem; text-align: left; margin-bottom: 22px; }
.hebrew .he { font-size: 1.3rem; color: var(--bark); margin-right: .5em; }
.hebrew .translit { font-family: var(--f-hand); font-size: 1.05rem; }
.lede { font-family: var(--f-slab); font-size: 1.2rem; line-height: 1.55; max-width: 34em; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

.hero-botanical { display: none; }
.hero-botanical.right { width: 260px; height: 520px; right: -40px; top: -40px; }
.hero-botanical.left  { width: 180px; height: 360px; left: -70px; bottom: -40px; transform: scaleX(-1); opacity: .22; }
.open-book { position: absolute; width: 170px; height: 85px; right: 8%; bottom: 22px; color: var(--bark); opacity: .55; }

.now-reading {
  background: var(--cream); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
  transform: rotate(1.2deg);
}
.now-reading-body { display: grid; grid-template-columns: 110px 1fr; gap: 18px; align-items: start; }
.now-reading h3 { font-size: 1.3rem; }
.now-reading .muted { font-size: .9rem; margin-bottom: 10px; }
.progress { height: 8px; border-radius: 99px; background: var(--paper-deep); overflow: hidden; margin-bottom: 12px; }
.progress span { display: block; height: 100%; background: var(--sage); }
.note { font: 1.1rem/1.35 var(--f-hand); color: var(--bark); margin: 0; }

/* ---------- Placeholder book covers ---------- */
.cover {
  aspect-ratio: 2 / 3; border-radius: 4px 10px 10px 4px; position: relative;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 14% 10% 10%; color: #f2ecdc; text-align: center;
  box-shadow: inset 6px 0 0 rgba(0,0,0,.12), inset 7px 0 0 rgba(255,255,255,.08), 0 10px 22px -10px rgba(40,30,15,.55);
  overflow: hidden;
}
.cover::before { /* gold frame */
  content: ""; position: absolute; inset: 7%; border: 1px solid rgba(232,205,150,.55); border-radius: 3px; pointer-events: none;
}
.cover::after { /* sprig motif */
  content: ""; position: absolute; left: 50%; top: 52%; width: 36%; aspect-ratio: 1; transform: translate(-50%,-50%);
  background: currentColor; opacity: .55;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 22V4M12 6c2-3 5-3 6-2-1 3-4 3-6 2M12 10c-2-2-4-4-4-6 2 0 4 2 4 6M12 12c2-2 5-2 6-1-1 2-4 3-6 1M12 16c-2-1-4-3-4-5 2 0 4 2 4 5M12 18c2-2 5-2 6-1-1 2-4 3-6 1' stroke='black' stroke-width='1.2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 22V4M12 6c2-3 5-3 6-2-1 3-4 3-6 2M12 10c-2-2-4-4-4-6 2 0 4 2 4 6M12 12c2-2 5-2 6-1-1 2-4 3-6 1M12 16c-2-1-4-3-4-5 2 0 4 2 4 5M12 18c2-2 5-2 6-1-1 2-4 3-6 1' stroke='black' stroke-width='1.2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
}
.cover-title { font-family: var(--f-slab); font-size: clamp(.95rem, 1.6vw, 1.25rem); line-height: 1.15; position: relative; z-index: 1; }
.cover-author { font-family: var(--f-hand); font-size: .9rem; opacity: .85; position: relative; z-index: 1; }
.cover.small { padding: 16% 10% 12%; }
.cover.small .cover-title { font-size: .82rem; }
.cover.small .cover-author { font-size: .7rem; }
.review-card:not(.featured) .cover { padding: 16% 9% 12%; }
.review-card:not(.featured) .cover-title { font-size: .78rem; }
.review-card:not(.featured) .cover-author { font-size: .66rem; }

.cover-forest { background: linear-gradient(160deg, #3c5a30, #26381e); }
.cover-rust   { background: linear-gradient(160deg, #9a5436, #6e3522); }
.cover-olive  { background: linear-gradient(160deg, #858361, #5c5b42); }
.cover-plum   { background: linear-gradient(160deg, #5e3f4b, #3b2730); }
.cover-ochre  { background: linear-gradient(160deg, #b38a45, #85622b); }

/* ---------- Sections ---------- */
.section { padding: 84px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.section-head.center { flex-direction: column; align-items: center; text-align: center; }
.section-head.center p { max-width: 36em; font-family: var(--f-slab); }
.link-more { font: 1.2rem/1 var(--f-hand); color: var(--bark); text-decoration: none; }
.link-more:hover { text-decoration: underline; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 30px; }

/* ---------- Review cards ---------- */
.review-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.review-card {
  background: var(--cream); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  display: grid; grid-template-columns: 96px 1fr; gap: 18px; align-items: start;
  transition: transform .2s ease;
}
.review-card:hover { transform: translateY(-3px); }
.review-card.featured { grid-column: 1 / -1; grid-template-columns: 200px 1fr; padding: 28px; gap: 32px; background: var(--paper-light); }
.review-card.featured h3 { font-size: 1.9rem; }
.review-card h3 a { text-decoration: none; }
.review-card h3 a:hover { text-decoration: underline; text-decoration-color: var(--gold); }
.review-card .tag { font-size: .85rem; margin-bottom: .6rem; }
.byline { font-family: var(--f-hand); color: var(--ink-muted); font-size: 1.05rem; margin-bottom: .7rem; }
.excerpt { font-size: .95rem; margin: .8rem 0 0; }
.featured .excerpt { font-size: 1.05rem; max-width: 40em; }
.plants { margin: .9rem 0 0; font: 1.08rem/1.4 var(--f-hand); color: var(--bark); }
.plants span { background: var(--blush); padding: .1em .55em; border-radius: 6px; margin-right: .3em; }

.ratings { display: grid; gap: 4px; margin: 0; }
.ratings > div { display: flex; align-items: center; gap: 10px; }
.ratings dt { width: 50px; font: .95rem/1 var(--f-hand); color: var(--ink-muted); }
.ratings dd { margin: 0; display: flex; gap: 2px; }
.ratings svg { width: 17px; height: 17px; }
.featured .ratings svg { width: 21px; height: 21px; }
.r-stars { color: var(--star); }
.r-herb  { color: #4f7a3a; }
.r-spice { color: var(--chili); }
.ratings svg.off { opacity: .18; filter: grayscale(1); }

/* ---------- Plant feature ---------- */
.band-olive {
  background-color: var(--olive);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%2396723a' stroke-width='1' opacity='.55'%3E%3Cpath d='M32 4l12 12-12 12-12-12zM32 36l12 12-12 12-12-12zM0 20l12 12L0 44M64 20L52 32l12 12'/%3E%3Cpath d='M32 16v-12M32 60v-12'/%3E%3C/g%3E%3C/svg%3E");
  color: var(--cream);
}
.plant-feature { display: grid; grid-template-columns: 1.3fr .7fr; gap: 56px; align-items: center; max-width: 980px; }
.plant-card h2 { color: var(--cream); font-size: clamp(2.6rem, 5vw, 3.6rem); margin-bottom: .1em; }
.plant-card .latin { font-family: var(--f-slab); color: var(--pale-sage); margin-bottom: 1.2em; }
.plant-card p { font-family: var(--f-slab); line-height: 1.6; }
.plant-card a:not(.btn) { color: var(--pale-sage); }
.plant-meta { font-family: var(--f-hand) !important; font-size: 1.15rem; color: var(--pale-sage); }
.plant-meta span { color: var(--blush); }
.plant-post img { border-radius: var(--radius); box-shadow: 0 18px 40px -16px rgba(0,0,0,.5); transform: rotate(-2deg); }
.plant-post { margin: 0; }
.plant-index { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plant-index a {
  display: flex; justify-content: space-between; gap: 10px; text-decoration: none;
  background: rgba(236,232,218,.12); border: 1px solid rgba(236,232,218,.25);
  padding: 10px 14px; border-radius: var(--radius-sm); font: 1.15rem/1.2 var(--f-hand);
}
.plant-index a:hover { background: rgba(236,232,218,.22); }
.plant-index span { color: var(--pale-sage); font-size: .95rem; white-space: nowrap; }

/* ---------- Rating systems ---------- */
.rating-systems { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.rs-card { background: var(--cream); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.rs-herbal { background: var(--pale-sage); }
.rs-icon { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--paper-light); margin-bottom: 14px; }
.rs-icon svg { width: 26px; height: 26px; }
.rs-card h3 { font-family: var(--f-hand); color: var(--bark); font-size: 1.7rem; margin-bottom: .5em; }
.rs-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-family: var(--f-slab); font-size: .93rem; line-height: 1.45; }
.rs-list li { display: grid; grid-template-columns: 26px 1fr; }
.rs-list b { font-family: var(--f-hand); font-weight: 400; color: var(--bark); font-size: 1.25rem; line-height: 1.1; }

/* ---------- About ---------- */
.about { background: linear-gradient(transparent, rgba(207,180,161,.25)); }
.about-inner { display: grid; grid-template-columns: .8fr 1.2fr; gap: 56px; align-items: center; }
.about-img { margin: 0; }
.about-img img { border-radius: var(--radius); box-shadow: var(--shadow); transform: rotate(-1.5deg); }
.about-copy p { font-family: var(--f-slab); font-size: 1.08rem; max-width: 34em; }

/* ---------- Instagram strip ---------- */
.insta-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.insta-row img { border-radius: 12px; box-shadow: var(--shadow); transition: transform .2s ease; }
.insta-row img:hover { transform: scale(1.02) rotate(-.5deg); }

/* ---------- Newsletter ---------- */
.newsletter { padding-top: 20px; padding-bottom: 20px; }
.news-inner {
  background: var(--blush); border-radius: 28px; padding: 54px 32px; text-align: center;
}
.news-inner p { font-family: var(--f-slab); }
.news-form { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.news-form input {
  font: 1rem var(--f-body); padding: .8em 1.2em; border-radius: 999px; border: 1.5px solid rgba(74,47,28,.3);
  background: var(--cream); color: var(--forest); min-width: min(320px, 100%);
}
.news-form input:focus { outline: 2px solid var(--forest); outline-offset: 2px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--olive-deep); color: var(--cream); padding: 40px 0; margin-top: 60px; }
.footer-inner { text-align: center; }
.footer-inner .muted { color: var(--pale-sage); margin-bottom: .4em; }
.brand-foot { font: 1.8rem/1 var(--f-hand); margin-bottom: .4em; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .nav { display: none; }
  .header-tools { margin-left: auto; }
  .hero-inner { grid-template-columns: 1fr; }
  .now-reading { max-width: 460px; }
  .review-grid { grid-template-columns: 1fr 1fr; }
  .plant-feature { grid-template-columns: 1fr 1fr; }
  .rating-systems { grid-template-columns: 1fr; max-width: 560px; margin-inline: auto; }
  .about-inner { grid-template-columns: 1fr; }
  .about-img { max-width: 340px; }
  .insta-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .brand { font-size: 1.35rem; }
  .hero { padding: 44px 0 100px; }
  .hero-botanical.right { width: 160px; height: 320px; right: -50px; opacity: .2; }
  .review-grid { grid-template-columns: 1fr; }
  .review-card.featured { grid-template-columns: 1fr; }
  .review-card.featured .cover { max-width: 170px; }
  .plant-feature { grid-template-columns: 1fr; }
  .plant-post { max-width: 300px; }
  .section { padding: 60px 0; }
}

/* ---------- Real covers, tags, tropes ---------- */
.cover-img { display: block; }
.cover-img img, .review-cover img {
  width: 100%; height: auto; border-radius: 4px 10px 10px 4px;
  box-shadow: inset 6px 0 0 rgba(0,0,0,.12), 0 14px 30px -12px rgba(40,30,15,.6);
}
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: .8rem; }
.tag-row .tag { margin: 0; }
.tag-outline { background: transparent; border: 1.5px solid rgba(74,47,28,.3); }
.ratings dd.r-label { font: .98rem/1 var(--f-hand); color: var(--ink-muted); margin-left: 6px; }
.tropes { list-style: none; padding: 0; margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tropes li { font: .98rem/1 var(--f-hand); color: var(--forest); background: rgba(157,168,139,.28); padding: .45em .8em; border-radius: 6px; }
.fans { font-size: .95rem; margin: 1rem 0 1.2rem; color: var(--ink-muted); }
.fans b { font-family: var(--f-hand); font-weight: 400; color: var(--bark); font-size: 1.1rem; margin-right: .3em; }
.shelf-links { display: flex; gap: 8px; flex-wrap: wrap; }
.shelf-links .chip { text-decoration: none; }
.small-meta { font-size: .9rem; margin: 0 0 4px; }
.cover.arc::after { opacity: .4; }
.cover.arc .cover-author::before { content: "Advance copy"; display: block; font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; opacity: .8; margin-bottom: 4px; }
.review-card.featured { grid-template-columns: 230px 1fr; align-items: start; }
.featured .plants { font-size: 1.12rem; }
.footer-links { font-family: var(--f-hand); font-size: 1.15rem; color: var(--pale-sage); }
.footer-links a { color: var(--cream); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }

/* ---------- Review page ---------- */
.review-page { padding: 28px 0 40px; }
.crumbs { font: 1.05rem/1 var(--f-hand); color: var(--ink-muted); margin-bottom: 28px; }
.crumbs a { text-decoration: none; color: var(--bark); }
.review-hero { display: grid; grid-template-columns: 280px 1fr; gap: 48px; align-items: center; margin-bottom: 56px; }
.review-cover { margin: 0; transform: rotate(-1.5deg); }
.review-head h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); text-wrap: balance; margin-bottom: .15em; }
.byline.big { font-size: 1.3rem; margin-bottom: 1.4rem; }
.ratings.big { gap: 10px; }
.ratings.big svg { width: 24px; height: 24px; }
.ratings.big dt { font-size: 1.1rem; width: 64px; }
.ratings.big dd.r-label { font-size: 1.1rem; }
.review-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: start; }
.review-text { background: var(--cream); border-radius: var(--radius); padding: clamp(22px, 4vw, 44px); box-shadow: var(--shadow); min-width: 0; }
.review-text p { font-size: 1.08rem; max-width: 62ch; }
.review-text h2 { font-size: 2rem; margin-top: 1.4em; }
.series-note { font-family: var(--f-slab); background: var(--pale-sage); padding: 14px 18px; border-radius: var(--radius-sm); }
.herbal-box { background: rgba(157,168,139,.25); border-radius: var(--radius-sm); padding: 18px 22px; margin: 1.6em 0; }
.herbal-box h2 { margin-top: 0; font-size: 1.7rem; }
.herbal-box p { margin: 0; }
.table-wrap { overflow-x: auto; }
.judge { width: 100%; border-collapse: collapse; font-size: .95rem; }
.judge th { font: 1.05rem/1.2 var(--f-hand); color: var(--bark); text-align: left; padding: 8px 10px; border-bottom: 1.5px solid rgba(74,47,28,.25); font-weight: 400; }
.judge td { padding: 10px; border-bottom: 1px solid rgba(74,47,28,.12); vertical-align: top; }
.judge td:first-child { font-family: var(--f-slab); white-space: nowrap; }
.pill { display: inline-block; font: .95rem/1 var(--f-hand); padding: .35em .7em; border-radius: 999px; white-space: nowrap; }
.pill-hit { background: #c9d6b4; color: #2f4a26; }
.pill-mid { background: var(--pale-sage); color: var(--bark); }
.pill-light { background: var(--blush); color: var(--bark); }
.review-side { display: grid; gap: 16px; }
.side-card { background: var(--paper-light); border-radius: var(--radius); padding: 20px 22px; }
.side-card h3 { font-family: var(--f-hand); color: var(--bark); font-size: 1.45rem; margin: 0; }
.side-card .tropes { margin-top: .7rem; }
.cw summary { display: flex; justify-content: space-between; align-items: baseline; cursor: pointer; list-style: none; }
.cw summary::-webkit-details-marker { display: none; }
.cw summary span { font: .95rem/1 var(--f-hand); color: var(--ink-muted); }
.cw[open] summary span { visibility: hidden; }
.cw ul { margin: .8rem 0 0; padding-left: 1.1em; font-size: .95rem; }
.facts { margin: .7rem 0 0; display: grid; gap: 6px; font-size: .95rem; }
.facts div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed rgba(74,47,28,.18); padding-bottom: 6px; }
.facts dt { font-family: var(--f-hand); color: var(--ink-muted); font-size: 1.05rem; }
.facts dd { margin: 0; text-align: right; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--forest); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

@media (max-width: 980px) {
  .review-card.featured { grid-template-columns: 180px 1fr; }
  .review-hero { grid-template-columns: 200px 1fr; gap: 32px; }
  .review-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .review-card.featured { grid-template-columns: 1fr; }
  .review-card.featured .cover-img { max-width: 180px; }
  .review-hero { grid-template-columns: 1fr; }
  .review-cover { max-width: 200px; }
  .ratings.big svg { width: 19px; height: 19px; }
  .ratings.big dt { width: 52px; }
  .ratings dd.r-label { font-size: .9rem !important; }
}

/* ---------- Bookshelves (generated from Goodreads) ---------- */
.shelves { padding-top: 20px; }
.year-count { font: 1.3rem/1.3 var(--f-hand); color: var(--bark); margin: -8px 0 22px; }
.year-count b { font-family: var(--f-slab); font-weight: 400; color: var(--forest); font-size: 1.45rem; }
.section-head.sub { margin: 52px 0 18px; align-items: baseline; }
.shelf-heading { font-family: var(--f-hand); color: var(--bark); font-size: 1.9rem; margin: 0; }
.shelf-note { margin: 0; font-size: .92rem; }
.shelf-row { list-style: none; margin: 0; padding: 0; display: grid; gap: 26px 20px; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
.shelf-row.current { grid-template-columns: repeat(auto-fill, minmax(150px, 190px)); }
.shelf-book { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.shelf-book > a { position: relative; display: block; aspect-ratio: 2 / 3; margin-bottom: 8px; border-radius: 3px 8px 8px 3px; overflow: hidden;
  box-shadow: inset 5px 0 0 rgba(0,0,0,.12), 0 10px 22px -12px rgba(40,30,15,.6); transition: transform .2s ease; }
.shelf-book > a:hover { transform: translateY(-3px) rotate(-.6deg); }
.shelf-book > a img { width: 100%; height: 100%; object-fit: cover; }
.shelf-book > a .remote-cover { position: absolute; inset: 0; }
.shelf-book > a .cover { height: 100%; border-radius: 0; padding: 18% 10% 12%; }
.shelf-book > a .cover-title { font-size: .85rem; }
.shelf-book > a .cover-author { font-size: .72rem; }
.shelf-flag { position: absolute; left: 8px; bottom: 8px; margin: 0; font-size: .8rem; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.shelf-title { font-family: var(--f-slab); font-size: .95rem; line-height: 1.25; color: var(--forest);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shelf-author { font: 1rem/1.2 var(--f-hand); color: var(--ink-muted); }
.shelf-series { font-size: .78rem; color: var(--ink-muted); font-style: italic; }
.mini-stars { display: flex; gap: 1px; margin-top: 3px; }
.mini-stars svg { width: 14px; height: 14px; }
.mini-stars svg.off { opacity: .18; filter: grayscale(1); }
.unrated { font: .92rem/1 var(--f-hand); color: var(--ink-muted); margin-top: 3px; }
.herbal-shelf { margin-top: 56px; background: var(--pale-sage); border-radius: var(--radius); padding: clamp(20px, 4vw, 36px);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 32px; align-items: center; }
.herbal-shelf-head p { font-family: var(--f-slab); margin: .6em 0 0; }
.herbal-shelf .shelf-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.shelf-now { align-self: flex-start; margin: 6px 0 0; font-size: .8rem; }
@media (max-width: 760px) {
  .herbal-shelf { grid-template-columns: 1fr; }
  .shelf-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 16px; }
  .shelf-row.current { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .shelf-row.current .shelf-series { display: none; }
}
.goal-bar { display: inline-block; vertical-align: middle; width: 120px; height: 8px; margin-left: 10px; border-radius: 99px; background: var(--paper-deep); overflow: hidden; }
.goal-bar span { display: block; height: 100%; background: var(--sage); }
.about-book { border-left: 3px solid var(--olive); padding-left: 16px; margin-bottom: 1.4em; }
.about-book h2 { margin-top: 0; font-size: 1.6rem; }
.about-book p { font-style: italic; }
/* All reviews */
.library h1 { font-size: clamp(2.4rem, 6vw, 3.4rem); margin: 0; }
.lib-count { margin: 0; color: var(--olive); }
.lib-tools { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 14px; }
.lib-tools input, .lib-tools select { font: inherit; padding: .55em .8em; border-radius: 10px; border: 1.5px solid rgba(74,47,28,.25); background: var(--cream); color: var(--bark); }
.lib-tools input { flex: 1 1 260px; min-width: 0; }
.lib-filters { flex-wrap: wrap; margin-bottom: 22px; }
.lib-filters .chip { cursor: pointer; font: inherit; }
.lib-filters .chip-light { opacity: .85; }
.lib-card .review-body h3 { font-size: 1.25rem; }
.lib-card .excerpt { font-size: .95rem; }
.lib-empty { text-align: center; color: var(--olive); }

/* ---------- Phone menu ---------- */
.menu { position: relative; display: none; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-bars, .menu-bars::before, .menu-bars::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative; }
.menu-bars::before, .menu-bars::after { content: ""; position: absolute; left: 0; }
.menu-bars::before { top: -6px; }
.menu-bars::after { top: 6px; }
.menu[open] .menu-bars { background: transparent; }
.menu[open] .menu-bars::before { top: 0; transform: rotate(45deg); }
.menu[open] .menu-bars::after { top: 0; transform: rotate(-45deg); }
.menu-panel { position: absolute; right: 0; top: calc(100% + 10px); z-index: 20; min-width: 210px; display: grid; padding: 8px;
  background: var(--cream); border-radius: 14px; box-shadow: var(--shadow); border: 1px solid rgba(74,47,28,.12); }
.menu-panel a { font-family: var(--f-slab); color: var(--forest); text-decoration: none; padding: 10px 12px; border-radius: 8px; }
.menu-panel a:hover { background: var(--pale-sage); }
@media (max-width: 980px) { .menu { display: block; } }
@media (max-width: 420px) { .header-tools [data-goodreads] { display: none; } }

/* Links that look like tags or bylines */
a.tag { text-decoration: none; color: inherit; }
a.tag:hover { filter: brightness(.95); }
.byline a { color: inherit; text-decoration: none; border-bottom: 1px dotted currentColor; }
.byline a:hover { color: var(--forest); }

/* ---------- Currently reading (hero) ---------- */
.reading-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 14px; }
.reading-list li { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; }
.reading-list li > a { display: block; aspect-ratio: 2 / 3; border-radius: 3px 6px 6px 3px; overflow: hidden; box-shadow: 0 6px 14px rgba(74,47,28,.18); }
.reading-list img, .reading-list .cover { width: 100%; height: 100%; object-fit: cover; }
.reading-list .cover { padding: 14% 8%; border-radius: 0; }
.reading-list .cover-title { font-size: .6rem; }
.reading-list .cover-author { display: none; }
.reading-list h3 { font-size: 1.12rem; margin: 0; line-height: 1.2; }
.reading-list h3 a { color: var(--bark); text-decoration: none; }
.reading-list .small-meta { margin: 2px 0 0; }
.now-reading .year-count { margin: 16px 0 0; font-size: .92rem; }

/* ---------- Top 5 ---------- */
.top-row { counter-reset: none; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.top-book { position: relative; list-style: none; }

.top-rank { position: absolute; z-index: 2; top: -12px; left: -8px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold); color: var(--cream); font: 1.2rem/1 var(--f-hand); box-shadow: var(--shadow); }
@media (max-width: 760px) { .top-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Herbal shelf section ---------- */
.herbal-section .herbal-shelf { margin-top: 0; }
.herbal-section .shelf-row.herbal { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }

/* ---------- Browse pages: genres and authors ---------- */
.browse h1, .prose-page h1 { font-size: clamp(2.4rem, 6vw, 3.4rem); margin: 0; }
.browse-intro { font-size: 1.08rem; max-width: 62ch; margin: 4px 0 18px; }
.browse-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; margin-top: 18px; }
.browse-card { display: grid; gap: 4px; background: var(--cream); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  text-decoration: none; color: var(--bark); transition: transform .15s ease; }
.browse-card:hover { transform: translateY(-3px); }
.browse-covers { display: flex; height: 120px; margin-bottom: 10px; }
.browse-covers img, .browse-covers .cover { width: 80px; height: 120px; object-fit: cover; border-radius: 3px 6px 6px 3px; box-shadow: 0 6px 14px rgba(74,47,28,.18); }
.browse-covers > * + * { margin-left: -26px; }
.browse-covers .cover { padding: 12% 8%; }
.browse-covers .cover-title { font-size: .58rem; }
.browse-covers .cover-author { display: none; }
.browse-name { font: 1.6rem/1.1 var(--f-hand); }
.browse-count { color: var(--olive); font-size: .92rem; }
.author-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px 18px; }
.author-list a { display: flex; justify-content: space-between; gap: 10px; padding: 12px 14px; background: var(--cream); border-radius: 10px; text-decoration: none; color: var(--bark); }
.author-list a:hover { background: var(--pale-sage); }
.author-list b { font-family: var(--f-slab); font-weight: 400; color: var(--forest); }
.author-list span { color: var(--olive); font-size: .9rem; white-space: nowrap; }
.series-head { font-size: 1.8rem; margin: 30px 0 12px; }

/* ---------- About page ---------- */
.about-page { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: clamp(22px, 4vw, 48px); align-items: start; margin-top: 10px; }
.about-page .about-img img { width: 100%; height: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
.prose { background: var(--cream); border-radius: var(--radius); padding: clamp(22px, 4vw, 44px); box-shadow: var(--shadow); min-width: 0; }
.prose p { font-size: 1.08rem; max-width: 64ch; }
.prose h2 { font-size: 1.9rem; margin-top: 1.2em; }
@media (max-width: 760px) { .about-page { grid-template-columns: 1fr; } .about-page .about-img { max-width: 280px; } }

/* ---------- Search ---------- */
.search-form { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 12px; }
.search-form input { flex: 1 1 260px; min-width: 0; font: inherit; padding: .6em .9em; border-radius: 12px; border: 1.5px solid rgba(74,47,28,.25); background: var(--cream); color: var(--bark); }
.search-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.search-links .chip { text-decoration: none; }
