/* ============================================================
   Golden Elixir – style.css
   Single-column layout, mobile-friendly
   ============================================================ */

/* --- Variables & Reset --- */
:root {
  /* --color-bg:      #faf8f4; */
  /* --color-bg:      #ffffff; */
  --color-bg:         #ffffff;
  --color-text:       #2c2416;
  --color-heading:    #4a2e0a;
  --color-link:       #7f212b;
  --color-link-hover: #b05a10;
  --color-muted:      #7a6e5f;
  --color-border:     #d9cfc0;
  /* --color-accent-bg:  #f0ebe0; */
  --color-accent-bg:  #f0ebe0;
  --color-card-bg:    #ffffff;
  --font-body:        Georgia, 'Times New Roman', serif;
  --font-ui:          'Segoe UI', Helvetica, Arial, sans-serif;
  --max-width:        760px;
  --gap:              1.4rem;
  --card-radius:      10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 17px; scroll-behavior: smooth; }

body {
  /* background: var(--color-bg); */
  background: #E8E8E8;
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.6;
  margin-top: 0.5rem;
}

/* NEW Background from here */

header, main, body > footer {
  background: #ffffff;
  /* max-width: 920px; */
  max-width: 1000px;
  margin: 0 auto;
  padding-left: 8rem;
  padding-right: 8rem;
}

main {
  padding-top: 1.6rem;
  padding-bottom: 2.5rem;
}

/* NEW Background until here */

a { color: var(--color-link); text-decoration: none; }
a:hover { color: var(--color-link-hover); text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

hr { border: none; border-top: 1px solid var(--color-border); margin: 2rem 0; }

h1 {
  color: var(--color-heading);
  font-family: var(--font-body);
  /* font-family: Optima, Candara, sans-serif; */
  line-height: 1.3;
}

h2, h3, h4, h5 {
  color: var(--color-heading);
  /* font-family: var(--font-body); */
  font-family: Optima, Candara, sans-serif;
  line-height: 1.3;
}

h2[id], h3[id] {
  scroll-margin-top: 100px;
}

h3.subsection {
  font-size: 1.05rem;
  font-style: italic;
  font-weight: normal;
  border-bottom: none;
  margin-top: 1.4rem;
  margin-bottom: 0.4rem;
  padding-bottom: 0;
}

h1 { font-size: 2.1rem; }
h2 { font-size: 1.4rem; margin-bottom: 0.5rem; }
h3 { font-size: 1.2rem; margin-bottom: 0.6rem; }
h4 { font-size: 1.05rem; margin-bottom: 0.25rem; }
h5 { font-size: 0.95rem; font-weight: normal; font-style: italic; color: var(--color-muted); }

p { margin-bottom: 0.9rem; }
p:last-child { margin-bottom: 0; }

/* ============================================================
   HEADER  – centered, constrained to page width
   ============================================================ */
header {
  /* max-width: var(--max-width); [REMOVED for background change] */
  margin: 0 auto;
  padding: 0.8rem 8rem 0;
  /* border: 1px solid var(--color-border); */
  border-radius: 6px;
  /* background: var(--color-accent-bg); */
  background: #ffffff;
  /* box-shadow: 0 2px 8px rgba(0,0,0,0.10); */
  position: sticky;
  top: 0;
  z-index: 50;
transition: padding-top 0.4s ease;
}

/* Top row: logo+title on the left, search on the right */

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.2rem;
  text-align: left;
  max-height: 200px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 1s ease, opacity 1s ease;
}

header.header-compact {
  padding-top: 0;
}

header.header-compact .header-top {
 max-height: 0;
  opacity: 0;
}

header.header-compact .nav-item:nth-child(5),
header.header-compact .nav-item:nth-child(6) {
  display: none;
}

.nav-logo-compact {
  display: none;
}

header.header-compact .nav-logo-compact {
  display: inline-flex;
  align-items: center;
  opacity: 0;
  animation: fadeInLogo 0.3s ease forwards;
  animation-delay: 1s;
}

@keyframes fadeInLogo {
  to { opacity: 1; }
}

header.header-compact .nav-logo-compact img {
  height: 32px;
  width: auto;
  border-radius: 50%;
  mix-blend-mode: multiply;
  margin-top: -8px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.header-logo img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  mix-blend-mode: multiply;
}
.header-logo h1 a {
  /* color: var(--color-heading); */
  color: #7F212B;
  text-decoration: none;
}

/* Google search box */
.header-search {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}
.header-search input[type="text"] {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: #fff;
  color: var(--color-text);
  width: 180px;
}
.header-search input[type="text"]:focus {
  outline: none;
  border-color: var(--color-link);
}
.header-search button {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.35rem 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--color-muted);
  line-height: 1;
}
.header-search button:hover {
  border-color: var(--color-link);
  color: var(--color-link);
}

/* ---- Nav bar ---- */
.main-nav {
  display: flex;
  justify-content: stretch;
  /* border-top: 0px solid var(--color-border); */
  padding-top: 0.5rem;
  padding-bottom: 0rem;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);

}

.nav-item {
  flex: 1;
  position: relative;
}

.nav-top {
  display: block;
  width: 100%;
  padding: 0rem 0.5rem 0.65rem ;
  text-align: center;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  /* font-weight: bold; */
  color: var(--color-muted);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s;
}
.nav-top:hover,
.nav-item.open .nav-top {
  color: var(--color-link-hover);
  text-decoration: none;
}

.nav-top {
  font-family: Georgia, 'Times New Roman', serif;
  color: #7F212B;
}

/* Drop-down panel */
.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--color-accent-bg);
  list-style: none;
  z-index: 100;
  border: 1px solid var(--color-border);
  border-top: 2px solid var(--color-link-hover);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.nav-item.open .dropdown {
  display: block;
}
.dropdown li a {
  display: block;
  padding: 0.55rem 1rem;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
}
.dropdown li:last-child a { border-bottom: none; }
.dropdown li a:hover {
  background: var(--color-bg);
  color: var(--color-link-hover);
}

/* ============================================================
   MAIN
   ============================================================ */

/* [These were the rules before the background change]
  main, footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.2rem;
}
main { 
  padding-top: 1.6rem;
  padding-bottom: 2.5rem;
  padding-left: 0;
  padding-right: 0;
} */

/* Welcome */
.welcome { font-size: 1.05rem; text-align: center; }

/* --- Featured book: float image left, text wraps --- */
.featured-book::after { content: ""; display: table; clear: both; }
.featured-book-img { float: left; margin: 0 1.4rem 0.8rem 0; }
.featured-book-img img { width: 200px; box-shadow: 2px 4px 12px rgba(0,0,0,0.15); }

/* --- Quote: big centred image, centred text below --- */
.quote-section { text-align: center; }
.quote-section > img { width: 100%; max-width: 600px; margin: 0 auto 1.2rem; border-radius: 12px; }

.quote-section blockquote { font-style: italic; max-width: 600px; margin: 0 auto; }
.quote-section blockquote footer {
  margin-top: 0.6rem; font-style: normal;
  font-size: 0.9rem; color: var(--color-muted);
}
.tweet-btn { margin-top: 0.9rem; }
.tweet-btn a {
  font-family: var(--font-ui); font-size: 0.85rem;
  background: #1da1f2; color: #fff;
  padding: 0.3rem 0.9rem; border-radius: 4px;
}
.tweet-btn a:hover { background: #0c85d0; }

/* ============================================================
   INNER PAGE COMPONENTS
   ============================================================ */

/* Page title + section sub-nav */

.page-title-block {
  padding: 0rem 0 0.4rem;
}
.page-title {
  font-size: 1.7rem;
  margin-bottom: 0.6rem;
}

.page-title-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.4rem 0 0rem;
}

.page-title-author {
  font-family: var(--font-ui);
  font-size: 1.1rem;
  color: var(--color-muted);
  margin-top: 0.3rem;
  margin-bottom: 0rem;
  margin-left: 3rem;
}

.subtitle {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--color-heading);
  margin-top: -0.3rem;
  margin-bottom: 0rem;
  margin-left: 3rem;
}

.subnav-hamburger {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.35rem 0.45rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 0.3rem;
}

.subnav-hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--color-muted);
  border-radius: 2px;
}
.subnav-hamburger:hover span {
  background: var(--color-heading);
}

.subnav-dropdown {
  background: var(--color-accent-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.4rem 0;
  margin-bottom: 0.8rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.10);
}
.subnav-dropdown a {
  display: block;
  padding: 0.4rem 1rem;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
}
.subnav-dropdown a:last-child { border-bottom: none; }
.subnav-dropdown a:hover { background: var(--color-bg); color: var(--color-link-hover); text-decoration: none; }
.subnav-dropdown a.subnav-current { font-weight: bold; color: var(--color-heading); }

/* Article body */
.page-body {
  margin-top: 1.4rem;
}
.page-body h3 {
  margin-top: 1.6rem;
  margin-bottom: 0.5rem;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--color-border);
}

.page-body ol {
  margin-left: 1.5rem;
  padding-left: 0rem;
  margin-bottom: 0rem;
}

.page-body ul {
  margin-left: 1rem;
  padding-left: 0rem;
  margin-bottom: 0rem;
}

/* Floated figures */
figure.img-right,
figure.img-left {
  display: table;
  width: fit-content;
  max-width: 50%;
  margin-bottom: 0.8rem;
}

figure.img-right { float: right; margin-left: 1.4rem; }
figure.img-left  { float: left;  margin-right: 1.4rem; }

figure.img-small {
  display: table;
  width: fit-content;
  max-width: 180px;
  margin-bottom: 0.8rem;
}
figure.img-small img {
  display: block;
  width: 100%;
}

figure.img-right img,
figure.img-left img {
  display: block;
  width: 100%;
}

figcaption {
  width: 100%;
  font-size: 0.82rem;
  color: var(--color-muted);
  font-style: italic;
  margin-top: 0.35rem;
  line-height: 1.4;
}

/* Centered figures */
figure.img-center {
  display: table;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 0.8rem;
}

figure.img-center img {
  display: block;
  width: 100%;
}

/* Clear floats after article */
.page-body::after { content: ""; display: table; clear: both; }

/* Verse / block quotation — default (full width) */
blockquote.verse {
  padding: 0.6rem 1.2rem 0.3rem;
  border-left: 3px solid var(--color-border);
  font-style: italic;
  line-height: 1.7;
  background: var(--color-accent-bg);
  border-radius: 10px;
  margin: 0.5rem 0 1rem ;
}

blockquote.verse p {
  color: #3a5a8a;
}

blockquote.verse p {
  margin-bottom: 0.5rem;
}

blockquote.verse footer {
  margin-top: 0.2rem;
  margin-bottom: 0;
  padding-left: 0rem;
  padding-bottom: 0.3rem;
  font-style: normal;
  font-size: 0.82rem;
  color: var(--color-muted);
  text-align: left;
  text-indent: 0;
}

blockquote.verse footer a {
  color: var(--color-link);
}

blockquote.verse footer img {
  display: inline;
  vertical-align: middle;
  margin-right: 0.3rem;
}

/* Floated variants — add class="verse verse-left" or "verse verse-right" */
blockquote.verse.verse-left,
blockquote.verse.verse-right {
  width: 48%;
  margin-bottom: 0.8rem;
}

blockquote.verse.verse-full {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

blockquote.verse.verse-left  { float: left;  margin-right: 1.6rem; margin-left: 0; }
blockquote.verse.verse-right { float: right; margin-left: 1.6rem;  margin-right: 0; }

/* Centered blockquote */
.blockquote-plain {
  margin: 1rem 2rem;
  padding: 0;
  background: none;
  border: none;
  font-style: normal;
}

/* See-also aside */
.see-also {
  background: var(--color-accent-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.8rem 1rem;
  margin: 1.4rem 0;
  font-size: 0.92rem;
}

.see-also ol,
.see-also ul {
  margin: 0.4rem 0 0 1.2rem;
  line-height: 1.9;
  columns: 2;
  column-gap: 2rem;
}

/* Quote source (with book icon) */
.source-line {
  padding-top: 0.85rem;
  font-size: 0.85rem;
}

/* EOT Sample entries list (placeholder, to be replaced later with a dropdown) */
.eot-sample-entries {
  margin: 0.8rem 0 1.2rem;
  padding-left: 1.4rem;
}
.eot-sample-entries li {
  margin-bottom: 0.3rem;
}

/* Table of Contents */
.toc-volume {
  font-weight: bold;
  margin-top: 1.2rem;
  margin-bottom: 0.3rem;
}
.toc-list {
  margin: 0 0 1rem;
}
.toc-list dt {
  display: inline;
}
.toc-list dd {
  display: inline;
  float: right;
  margin: 0;
  color: var(--color-muted);
}
.toc-list dt::after {
  content: "";
  display: inline-block;
  width: 1rem;
}
.toc-list > dt, .toc-list > dd {
  display: block;
  overflow: hidden;
}
.toc-list dd {
  margin-top: -1.3rem;
}

/* EOT Contributors table */
.contributors-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 0.8rem 0 1.2rem;
}
.contributors-table td {
  vertical-align: top;
  padding: 0.15rem 1rem 0.15rem 0;
}

/* EoT data tables (Celestial Masters, textual corpora, patriarchs, etc.) */
.eot-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1rem 0 1.4rem;
}
.eot-table th {
  text-align: left;
  font-weight: bold;
  background: var(--color-accent-bg);
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid var(--color-border);
}
.eot-table td {
  vertical-align: top;
  padding: 0.3rem 0.6rem;
  border-bottom: 1px solid var(--color-border);
}
.eot-table tr:last-child td {
  border-bottom: none;
}

/* Narrow first column for numbered entries (NO. / item number) */
.eot-table td:first-child,
.eot-table th:first-child {
  white-space: nowrap;
  width: 1%;
  font-variant-numeric: tabular-nums;
}

/* 4-column variant (e.g. two side-by-side numbered lists) */
.eot-table-4col td:nth-child(1),
.eot-table-4col td:nth-child(3),
.eot-table-4col th:nth-child(1),
.eot-table-4col th:nth-child(3) {
  width: 1%;
  white-space: nowrap;
}

/* Read-more and copyright lines */
.read-more {
  margin-top: 1.4rem;
  font-size: 0.95rem;
}
.copyright,
.picture-credit {
  font-size: 0.82rem;
  color: var(--color-muted);
  margin-top: 0.5rem;
}

/* ============================================================
   POEM TRANSLATION  (.poem-translation)
   ============================================================ */

.poem-translation {
  margin: 1.2rem 0;
}

.poem-stanza {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.15rem;
}

.poem-linenum {
  flex: 0 0 3rem;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--color-muted);
  text-align: right;
  padding-top: 0.05rem;
}

.poem-line {
  flex: 1;
  text-align: center;
  font-style: normal;
  line-height: 1.7;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  border-top: 1px solid var(--color-border);
  padding-top: 1rem;
  padding-bottom: 1.5rem;
  margin-top: 0rem;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--color-muted);
  text-align: center;
}
footer a { color: var(--color-muted); }
footer a:hover { color: var(--color-link-hover); }

.social-links {
  display: flex; gap: 0.5rem;
  align-items: center; justify-content: center;
  margin-top: 0.7rem;
}
.social-links img { width: 28px; height: 28px; }

/* ============================================================
   ILLUSTRATIONS GRID  — add after ACCORDION section in style.css
   ============================================================ */

/* "See also" line just below the page title block */
.see-also-line {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin: 0.6rem 0 0;
}

.illus-section {
  margin-bottom: 1rem;
}

/* Responsive grid: 3 columns on desktop, 2 on tablet, 1 on phone */
.illus-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  margin-top: 1rem;
}

/* Individual card */
.illus-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s;
}
.illus-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* Thumbnail fills the card width, fixed height, cropped */
.illus-card > a {
  display: block;
  overflow: hidden;
  background: var(--color-accent-bg);
}
.illus-card > a img {
  width: 100%;
  height: 110px;
  object-fit: contain;
  display: block;
  transition: transform 0.2s ease;
}
.illus-card:hover > a img {
  transform: scale(1.04);
}

/* Text below the image */
.illus-card-text {
  padding: 0.7rem 0.8rem 0.8rem;
  flex: 1 1 auto;
}
.illus-card-text h4 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}
.illus-card-text p {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 0;
  line-height: 1.4;
}

/* ============================================================
   DICTIONARY — index page (.dict-table)
   ============================================================ */

.dict-intro {
  font-size: 0.92rem;
  color: var(--color-muted);
  margin-bottom: 1rem;
}

.dict-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.dict-table thead th {
  text-align: left;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--color-muted);
  font-weight: normal;
  padding: 0.4rem 0.8rem 0.4rem 0;
  border-bottom: 2px solid var(--color-border);
}
.dict-table tbody tr {
  border-bottom: 1px solid var(--color-border);
}
.dict-table tbody tr:hover {
  background: var(--color-accent-bg);
}
.dict-table td {
  padding: 0.5rem 0.8rem 0.5rem 0;
  vertical-align: top;
}
.dict-table td:first-child {
  white-space: nowrap;
  font-style: italic;
  width: 22%;
}
.dict-chinese {
  font-size: 1.05rem;
  width: 20%;
  color: var(--color-heading);
}

/* ============================================================
   DICTIONARY — term page (.dict-entry)
   ============================================================ */

.dict-back {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  margin-bottom: 0.4rem;
  font-weight: bold;
  display: inline-block;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.2rem 0.6rem;
}
.dict-entry {
  margin-top: 0.6rem;
}
.dict-headword {
  font-size: 1.5rem;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0.4rem;
  margin-bottom: 0.3rem;
}
.dict-hanzi {
  font-weight: normal;
  color: var(--color-muted);
  margin-left: 0.4rem;
}
.dict-translation {
  font-style: italic;
  color: var(--color-muted);
  font-size: 1rem;
  margin-bottom: 1.4rem;
}
.dict-sense {
  margin-bottom: 1.4rem;
}
.dict-sense-num {
  font-weight: bold;
  color: var(--color-heading);
  margin-right: 0.3rem;
}
.dict-quote {
  margin: 0.8rem 0 0 1.2rem;
  padding: 0.7rem 1rem 0.1rem 1.2rem;
  border-left: 3px solid var(--color-border);
  background: var(--color-accent-bg);
  border-radius: 0 6px 6px 0;
  font-size: 0.93rem;
}
.dict-quote p {
  margin-bottom: 0;
  line-height: 1.65;
}
.dict-quote footer {
  font-size: 0.85rem;
  color: var(--color-muted);
  font-style: normal;
  margin-bottom: 0;
  border-top: none;
  padding-top: 0;
  margin-top: 0.5rem;
  text-align: left;
}
.dict-quote cite {
  font-style: italic;
}
.dict-quote footer a {
  color: var(--color-link);
}
.dict-quote footer a:hover {
  color: var(--color-link-hover);
}

/* DICTIONARY — index page table (.dict-table) */
.dict-table td:first-child { width: 30%; }
.dict-chinese { width: 25%; }

/* ============================================================
   CATALOGUE PAGE  (.cat-card / .fmt-badge)
   ============================================================ */

.cat-heading {
  margin-top: 2rem;
  margin-bottom: 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 0px solid var(--color-border);
  font-size: 1.5rem;
}

.page-body h3.cat-heading {
  border-bottom: none !important;
}

.cat-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cat-card {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  transition: box-shadow 0.15s;
}

.cat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.11); }

.cat-card-cover {
  flex: 0 0 auto;
}
.cat-card-cover img {
  width: 90px;
  height: auto;
  display: block;
  box-shadow: 1px 2px 8px rgba(0,0,0,0.15);
  border-radius: 3px;
}

.cat-card-body {
  flex: 1 1 0;
}
.cat-card-body h4 {
  font-size: 1rem;
  margin-bottom: 0.2rem;
  line-height: 1.35;
}
.cat-card-author {
  font-size: 0.88rem;
  color: var(--color-muted);
  margin-bottom: 0.4rem;
}
.cat-card-desc {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  line-height: 1.55;
}
.cat-card-formats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}
.cat-card-more {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: bold;
}

/* Format badges — shared by catalogue and book pages */
.fmt-badge {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: bold;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.fmt-paper  { background: #e8f0e0; color: #3a6020; border: 1px solid #b8d0a0; }
.fmt-kindle { background: #e0eaf8; color: #1a4a80; border: 1px solid #a0c0e8; }
.fmt-pdf    { background: #fde8e0; color: #802010; border: 1px solid #e8b0a0; }
.fmt-free   { background: #fff3cc; color: #7a5500; border: 1px solid #e0c060; }

/* Subnav divider */
.subnav-divider {
  display: inline-block;
  width: 1px;
  background: var(--color-border);
  margin: 0 0.4rem;
  align-self: stretch;
}

/* ============================================================
   BOOK PAGE  (.book-layout / .book-acc-*)
   ============================================================ */

.book-layout {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  margin-top: 1.4rem;
}

/* Sidebar */
.book-sidebar {
  flex: 0 0 160px;
  position: sticky;
  top: 1rem;
}
.book-cover {
  width: 100%;
  box-shadow: 2px 4px 14px rgba(0,0,0,0.18);
  border-radius: 3px;
  margin-bottom: 1rem;
}
.book-meta {
  font-size: 0.88rem;
  line-height: 1.5;
}
.book-meta-author {
  font-weight: bold;
  color: var(--color-heading);
  margin-bottom: 0.1rem;
}
.book-meta-sub {
  font-style: italic;
  color: var(--color-muted);
  margin-bottom: 0.5rem;
  font-size: 0.83rem;
}
.book-meta-details {
  color: var(--color-muted);
  font-size: 0.82rem;
  margin-bottom: 0.6rem;
}
.book-meta-formats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.8rem;
}
.book-buy-btn {
  display: block;
  text-align: center;
  background: var(--color-heading);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: bold;
  padding: 0.45rem 0.6rem;
  border-radius: 5px;
  margin-bottom: 0.4rem;
  text-decoration: none;
}
.book-buy-btn:hover { background: var(--color-link-hover); color: #fff; text-decoration: none; }
.book-preview-btn {
  display: block;
  text-align: center;
  background: var(--color-accent-bg);
  border: 1px solid var(--color-border);
  color: var(--color-link);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  padding: 0.35rem 0.6rem;
  border-radius: 5px;
  margin-bottom: 0.35rem;
  text-decoration: none;
}
.book-preview-btn:hover { border-color: var(--color-link); text-decoration: none; }

/* Main content */
.book-content { flex: 1 1 0; min-width: 0; }

.book-title {
  font-size: 1.25rem;
  margin-bottom: 1.2rem;
  line-height: 1.35;
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0.6rem;
}

/* Accordion */
.book-acc-item {
  border-bottom: 1px solid var(--color-border);
}
.book-acc-item:first-of-type {
  border-top: 1px solid var(--color-border);
}

.book-acc-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.8rem;
  background: var(--color-accent-bg);
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.book-acc-trigger:hover { background: var(--color-border); }
.book-acc-item.book-acc-open .book-acc-trigger {
  background: #e0d5c5;
}

.book-acc-label {
  font-family: var(--font-ui);
  font-size: 0.95rem;
  font-weight: bold;
  color: var(--color-heading);
  letter-spacing: 0.02em;
}
.book-acc-arrow {
  font-size: 0.75rem;
  color: var(--color-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.book-acc-item.book-acc-open .book-acc-arrow {
  transform: rotate(180deg);
}

.book-acc-body {
  padding: 1rem 0.8rem 1.2rem;
}
.book-acc-note {
  font-size: 0.88rem;
  color: var(--color-muted);
  font-style: italic;
  margin-bottom: 0.8rem;
}
.book-orig-title {
  font-size: 0.88rem;
  color: var(--color-muted);
  margin-top: 0.6rem;
}

.book-catalogue-link {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  margin-top: 0.3rem;
  display: inline-block;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.2rem 0.6rem;
}

/* Table of contents */
.book-toc {
  font-size: 0.92rem;
  line-height: 1.7;
}
.book-toc p { margin-bottom: 0.6rem; }

/* Reviews */
.book-review {
  border-left: 3px solid var(--color-border);
  padding: 0.6rem 0.8rem 0.6rem 1rem;
  margin-bottom: 1rem;
  background: var(--color-accent-bg);
  border-radius: 0 6px 6px 0;
}
.book-review p { font-size: 0.92rem; margin-bottom: 0.3rem; }
.book-review-stars {
  color: #b07020;
  letter-spacing: 0.1em;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}
.book-review-source {
  font-size: 0.83rem;
  color: var(--color-muted);
  font-style: italic;
}

/* Samples list */
.book-samples-list {
  margin: 0 0 0 1.2rem;
  line-height: 2;
  font-size: 0.93rem;
}

/* Buy section */
.book-buy-section {
  margin-bottom: 1.4rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px dashed var(--color-border);
}
.book-buy-section:last-child { border-bottom: none; margin-bottom: 0; }

.book-buy-heading {
  font-size: 1rem;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.book-buy-note {
  font-size: 0.88rem;
  color: var(--color-muted);
  margin-bottom: 0.5rem;
}
.book-buy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.book-buy-link {
  display: inline-block;
  background: var(--color-heading);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: bold;
  padding: 0.4rem 0.9rem;
  border-radius: 5px;
  text-decoration: none;
}
.book-buy-link:hover { background: var(--color-link-hover); color: #fff; text-decoration: none; }
.book-buy-link-secondary {
  background: var(--color-accent-bg);
  color: var(--color-link);
  border: 1px solid var(--color-border);
}
.book-buy-link-secondary:hover { background: var(--color-border); color: var(--color-heading); }

.book-paypal-logo {
  margin-top: 0.6rem;
  height: 28px;
  width: auto;
}

.book-amazon-stores { margin-top: 0.3rem; }

.book-amazon-main {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.book-amazon-main img {
  height: 18px;
  width: auto;
  vertical-align: middle;
  margin-left: 0.3rem;
  opacity: 0.85;
}

.book-amazon-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.book-amazon-flags img {
  height: 18px;
  width: auto;
  display: inline;
  opacity: 0.85;
  transition: opacity 0.15s;
}
.book-amazon-flags img:hover { opacity: 1; }

.book-amazon-other {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: bold;
  color: var(--color-text);
}

.book-discount-note {
  background: #fff8e0;
  border: 1px solid #e0c060;
  border-radius: 6px;
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
}

/* ============================================================
   ARTICLE SOURCE STRIP
   ============================================================ */

.article-source-strip {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  padding: 0.7rem 1rem;
  margin: 1.4rem 0;
}

.article-source-strip img {
  flex: 0 0 auto;
  height: 100px;
  width: auto;
  border-radius: 3px;
  box-shadow: 1px 2px 6px rgba(0,0,0,0.12);
}

.article-source-text {
  flex: 1 1 0;
  font-size: 0.88rem;
  color: var(--color-muted);
  line-height: 1.5;
}
.article-source-text p {
  margin-bottom: 0.2rem;
}
.article-source-text p:last-child {
  margin-bottom: 0;
}

/* ============================================================
   TOPICS STRIP  (Taoism / Taoist Alchemy with expand lists)
   ============================================================ */
.topics-strip {
  display: flex;
  gap: var(--gap);
}

.topic-block {
  flex: 1 1 0;
  text-align: center;
}

.topic-block .topic-item img {
  width: 100%;
  max-width: 300px;
  margin: 0 auto 0.5rem;
  display: block;
  border-radius: 12px;
}

.topic-label-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: center;
  margin-bottom: 0.4rem;
}

a.topic-label {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--color-heading);
}
a.topic-label:hover { color: var(--color-link-hover); text-decoration: underline; }

.topic-toggle {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  color: var(--color-muted);
  font-size: 0.85rem;
  padding: 0.25rem 0.7rem;
  cursor: pointer;
  line-height: 1.4;
}
.topic-toggle:hover { background: var(--color-accent-bg); }

.topic-links {
  list-style: none;
  margin: 0.3rem auto 0;
  padding: 0.5rem 0.8rem;
  background: var(--color-accent-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  text-align: left;
  max-width: 280px;
}
.topic-links li { padding: 0.25rem 0; border-bottom: 1px solid var(--color-border); }
.topic-links li:last-child { border-bottom: none; }
.topic-links a { font-size: 0.9rem; }

/* ============================================================
   FEATURE STRIP  (reusable)
   ============================================================ */
.feature-strip { display: flex; gap: var(--gap); flex-wrap: wrap; }

.feature-card {
  flex: 1 1 160px;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.feature-card img { width: 100%; max-width: 140px; margin: 0 auto; box-shadow: 1px 2px 6px rgba(0,0,0,0.12); }
.feature-card-text h4 { margin-bottom: 0.3rem; }
.feature-card-text p { font-size: 0.9rem; color: var(--color-muted); margin-bottom: 0; }

.press-strip > h3 { margin-bottom: 0.8rem; }

/* --- Smaller variant of feature-card for secondary lists --- */
.feature-strip.list-strip .feature-card img {
  max-width: 140px;
}

/* New releases */
.new-releases {
  background: var(--color-accent-bg);
  border-left: 3px solid var(--color-border);
  padding: 1rem 1.2rem;
  border-radius: 2px;
}
.new-releases h3 { margin-bottom: 0.8rem; }

/* Cantong note */
.cantong-note { font-style: italic; color: var(--color-muted); font-size: 0.95rem; }

/* ============================================================
   FEATURE STRIP — HORIZONTAL
   ============================================================ */
.feature-strip-h {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.feature-card-h {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.feature-card-h img {
  flex: 0 0 auto;
  height: 150px;
  width: auto;
  border-radius: 4px;
  box-shadow: 1px 2px 6px rgba(0,0,0,0.12);
}

.feature-card-h-text {
  flex: 1 1 0;
}
.feature-card-h-text h4 {
  margin-bottom: 0.3rem;
}
.feature-card-h-text p {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-bottom: 0;
}

/* ============================================================
   PICTURE GALLERY (illustration pages)
   ============================================================ */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem 1.2rem;
  margin: 1.4rem 0;
}

.gallery-item {
  display: flex;
  flex-direction: column;
}

.gallery-item img {
  width: 100%;
  display: block;
  border-radius: 6px;
  box-shadow: 1px 2px 6px rgba(0,0,0,0.12);
  cursor: zoom-in;
}

.gallery-caption {
  font-size: 0.88rem;
  color: var(--color-muted);
  margin-top: 0.5rem;
  line-height: 1.4;
}
.gallery-caption .gallery-num {
  font-weight: bold;
  color: var(--color-text);
}

/* Single-picture pages: one big centered image, no grid needed */
.gallery-grid.gallery-single {
  grid-template-columns: 1fr;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================================
   STANDALONE FEATURE CARD
   ============================================================ */

.feature-card-standalone {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--card-radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  width: 240px;
  margin-bottom: 1rem;
}
.feature-card-standalone img {
  width: 100%;
  max-width: 140px;
  margin: 0 auto;
  box-shadow: 1px 2px 6px rgba(0,0,0,0.12);
}
.feature-card-standalone .feature-card-text h4 {
 margin-bottom: 0.3rem;
   font-size: 0.8rem;
 }

.feature-card-standalone .feature-card-text p {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-bottom: 0;
  line-height: 1.4;
}

.feature-card-standalone.float-left  { float: left;  margin-right: 1.4rem; }
.feature-card-standalone.float-right { float: right; margin-left: 1.4rem; }

/* ============================================================
   LIGHTBOX
   ============================================================ */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 500;
  align-items: center;
  justify-content: center;
  /* fade-in animation */
  opacity: 0;
  transition: opacity 0.25s ease;
}
.lightbox.lb-open {
  display: flex;
  opacity: 1;
}

.lightbox-inner {
  background: #fff;
  border-radius: 10px;
  padding: 1.2rem;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  /* slide-up animation */
  transform: translateY(30px);
  transition: transform 0.25s ease;
  overflow-y: auto;
}
.lightbox.lb-open .lightbox-inner {
  transform: translateY(0);
}

.lightbox-img {
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}

.lightbox-caption {
  width: 100%;
  text-align: center;
  border-top: 1px solid var(--color-border);
  padding-top: 0.6rem;
}
.lightbox-desc {
  font-size: 0.9rem;
  color: var(--color-text);
  margin-bottom: 0.3rem;
}
.lightbox-link {
  font-size: 0.85rem;
  font-family: var(--font-ui);
}

.lightbox-link:empty {
  display: none;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
}
.lightbox-close:hover { opacity: 1; }

/* Make trigger images show a pointer */
img.lb-trigger {
  cursor: zoom-in;
}

/* ============================================================
   ACCORDION
   ============================================================ */

.acc-section {
  margin-bottom: 1.8rem;
}

.acc-section-heading {
  margin-top: 0;
  margin-bottom: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--color-border);
  font-size: 1.1rem;
}

.acc-item {
  /* no border */
}

.acc-trigger {
  display: block;
  width: 100%;
/*   padding: 0.45rem 0; */
  padding: 0.30rem 0;
  background: none;
  border: none;
  border-top: none;
  border-bottom: none;
  outline: none;
  cursor: pointer;
  text-align: left; 
  font-size: 1rem;
  font-family: var(--font-body);
  color: var(--color-link);
}

.acc-trigger-inner {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.6rem;
}

/* .acc-trigger-bullet {
  display: block;
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2e4d7a;
  margin-top: 0.5rem;
} */

.acc-trigger-bullet {
  display: block;
  flex-shrink: 0;
  width: 13px;
  height: 16px;
  background: url('https://www.goldenelixir.com/pics/chrome_ball.png') no-repeat center center;
  background-size: contain;
  margin-top: 0.3rem;
}

.acc-trigger-arrow {
  flex-shrink: 0;
  display: block;
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-top: 0.3rem;
  transition: transform 0.2s ease;
}

.acc-item.acc-open .acc-trigger-arrow {
  transform: rotate(180deg);
}

.acc-trigger-text {
  flex: 1 1 auto;
  font-family: var(--font-body);
  font-size: 1rem;
  text-align: left;
  line-height: 1.5;
}

.acc-trigger-text em {
  font-style: italic;
}

.acc-trigger:hover .acc-trigger-text {
}

.acc-body {
  padding: 0.6rem 1rem 1rem 1.8rem;
  background: var(--color-accent-bg);
  border-radius: 10px 10px 10px 10px;
  margin-bottom: 0.3rem;
}

.acc-body p {
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

.acc-source {
  font-size: 0.85rem;
  color: var(--color-muted);
  font-style: italic;
  margin-bottom: 0.6rem;
}

.acc-link {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: bold;
}

.acc-list {
  margin: 0.4rem 0 0 1.2rem;
  line-height: 2;
}
.acc-list li a {
  font-size: 0.9rem;
}

/* ============================================================
   POPOVERS
   ============================================================ */

.popover-trigger {
  cursor: pointer;
  border-bottom: 1px dashed var(--color-link);
  color: var(--color-link);
  position: relative;
}

.popover-box {
  display: none;
  position: absolute;
  top: 1.6em;
  left: 0;
  width: max-content;
  max-width: min(30vw, 280px);
  background: #fffbe6;
  border: 1px solid #e0c060;
  border-radius: 6px;
  padding: 0.7rem 0.9rem;
  font-size: 0.88rem;
  font-style: normal;
  color: var(--color-text);
  line-height: 1.6;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  z-index: 200;
  cursor: auto;
  font-weight: normal;
}

.popover-box.popover-open {
  display: block;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* --- Mobile: max 640px --- */
@media (max-width: 640px) {

  header, main, body > footer {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Header */
  .header-top { flex-direction: column; align-items: stretch; flex-wrap: nowrap; overflow: visible; }
  .header-logo { flex-direction: column; }
  .header-search { width: 100%; box-sizing: border-box; display: flex; flex-shrink: 1; }
  .header-search input[type="text"] { flex: 1; min-width: 0; width: 100%; box-sizing: border-box; padding-bottom: 0.5rem; }
  .header-search button { flex-shrink: 0; }

  /* Navigation */
.nav-top {
  text-align: center;
  overflow: visible;
  text-overflow: clip;
  padding-left: 0;
  padding-right: 0;
}

  .main-nav { flex-direction: column; }
  .nav-top { text-align: center; }
  .dropdown { position: static; box-shadow: none; border-top: none; border-left: 3px solid var(--color-link-hover); }

.nav-item { flex: none; width: 100%; }

  /* Sticky header */
  header.header-compact .nav-item { display: none; }
  header.header-compact .main-nav { justify-content: center; }
  header.header-compact .nav-logo-compact { margin: 0 auto; }

  /* Header/footer border radius */
  header { border-radius: 0; margin-top: 0; }
  footer { border-radius: 0; margin-bottom: 0; }

  /* Layout */
  .feature-strip { flex-direction: column; }
  .topics-strip { flex-direction: column; }
  .topic-links { max-width: 100%; }
  .feature-card-standalone.float-left,
  .feature-card-standalone.float-right { float: none; width: 100%; max-width: 280px; margin: 0 auto 1rem; }

  /* Images */
  .featured-book-img { float: none; margin: 0 auto 1rem; }
  .featured-book-img img { margin: 0 auto; }
  .quote-section > img { max-width: 280px; }
  figure.img-right,
  figure.img-left { float: none; max-width: 100%; margin: 0 auto 1rem; }

  /* Verse blockquotes */
  blockquote.verse.verse-left,
  blockquote.verse.verse-right { float: none; width: 100%; margin: 1.4rem 0; padding-left: 1rem; padding-right: 1rem; }

  /* See also */
  .see-also ol,
  .see-also ul { columns: 1; }

  /* Gallery */
  .gallery-grid { grid-template-columns: 1fr; gap: 1.4rem; }
  .illus-grid { grid-template-columns: repeat(2, 1fr); }

  /* Book layout */
  .book-layout { flex-direction: column; }
  .book-sidebar { position: static; flex: none; width: 100%; display: flex; gap: 1rem; align-items: flex-start; }
  .book-cover { width: 120px; flex-shrink: 0; }
  .book-meta { flex: 1; }

  /* Cat card */
  .cat-card { flex-direction: column; }
  .cat-card-cover img { width: 100px; }

  /* Feature card horizontal */
  .feature-card-h {
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.feature-card-h img {
  height: auto;
  width: 80%;
  max-width: 200px;
  margin: 0 auto;
}
/* Dict table for mobile */
@media (max-width: 640px) {
  .dict-table, .dict-table tbody, .dict-table tr, .dict-table td {
    display: block;
    width: 100% !important;
  }
  .dict-table thead { display: none; }
  .dict-table tr {
    padding: 0.3rem 0;
    border-bottom: 1px solid var(--color-border);
  }
  .dict-table td:first-child {
    font-weight: bold;
  }
  .dict-table td:last-child {
    display: block;
    color: var(--color-muted);
    font-size: 0.9rem;
    margin-top: 0.2rem;
  }
}

  /* Popover */
  .popover-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    max-width: 360px;
    max-height: 70vh;
    overflow-y: auto;
  }

  /* EOT tables */
  .contributors-table, .contributors-table tbody, .contributors-table tr, .contributors-table td {
    display: block; width: 100%;
  }
  .contributors-table td { padding: 0.1rem 0; }
  .toc-list dd { float: none; display: block; margin-top: 0; margin-bottom: 0.4rem; }
  .eot-table, .eot-table tbody, .eot-table tr, .eot-table td, .eot-table th {
    display: block; width: 100% !important;
  }
  .eot-table td, .eot-table th { padding: 0.2rem 0; border-bottom: none; }
  .eot-table tr { padding-bottom: 0.5rem; border-bottom: 1px solid var(--color-border); }
  .eot-table th[colspan] { background: var(--color-accent-bg); padding: 0.4rem 0.6rem; margin: 0.6rem 0 0.3rem; }
}

/* --- Very narrow: max 380px --- */
@media (max-width: 380px) {
  .illus-grid { grid-template-columns: 1fr; }
}

/* --- Tablet: 641px–1024px --- */
@media (min-width: 641px) and (max-width: 1024px) {
  header, main, body > footer {
    padding-left: 4rem !important;
    padding-right: 4rem !important;
  }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

/* --- Desktop: min 640px --- */
@media (min-width: 640px) {
  header { border-radius: 8px 8px 0 0; margin-top: 1.5rem; }
  footer { border-radius: 0 0 8px 8px; margin-bottom: 1.5rem; }
}
