/* Minimal, readable styles without any build tools */
:root {
  --bg: #f7f7f7;
  --fg: #1f2937;  /* gray-800 */
  --muted: #6b7280; /* gray-500 */
  --brand: #0f766e; /* teal-700 */
  --card: #ffffff;
  --border: #e5e7eb; /* gray-200 */
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.site {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.65;
}

.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 1rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar .brand {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.topbar .nav a {
  margin-left: 1rem;
  color: var(--fg);
  text-decoration: none;
}
.topbar .nav a:hover { text-decoration: underline; }

.hero {
  text-align: center;
  padding: 2rem 0 1rem;
}

.hero h1 {
  font-size: 2rem;
  margin: 0 0 0.5rem;
}

.hero .tagline {
  /* color: var(--muted); */
  margin-bottom: 1rem;

}

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


.qr img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  border: 6px solid #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  background: #fff;
}

.qr-note {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.content {
  margin-top: 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.post h1 { margin-top: 0; }
.post .meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 1rem; }
.post-body p { margin: 0.75rem 0; }
.back-home a { color: var(--brand); text-decoration: none; }
.back-home a:hover { text-decoration: underline; }

.footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
}


/* --- Tiles Grid --- */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  padding: 1rem 0 2rem;
}

/* Mobile: force single column */
@media (max-width: 600px) {
  .tiles {
    grid-template-columns: 1fr;
    /* center align-items: center; */
    align-items: center;
  }
}

.tile {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  text-decoration: none;
  color: var(--fg);
  transition: transform .06s ease, box-shadow .2s ease;
}
.tile:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.06); }
.tile-title { font-weight: 700; margin-bottom: .25rem; }
.tile-sub { color: var(--muted); font-size: .95rem; }

/* --- Buttons --- */
.btn {
  display: inline-block;
  font-size: 0.8em;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  margin: .25rem;
}
.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.btn-secondary:hover,
.btn-primary:hover { opacity: .95; }

.cta-row { margin-top: .75rem; }

/* --- Card --- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

/* --- Sticky QR Footer --- */
.sticky-qr {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  justify-content: center;
  padding: .5rem;
  background: rgba(255,255,255,.92);
  border-top: 1px solid var(--border);
  backdrop-filter: saturate(180%) blur(8px);
}
.sticky-qr__btn {
  display: inline-block;
  padding: .6rem .9rem;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

/* --- Muted helper --- */
.muted { color: var(--muted); font-size: .95rem; }

/* Accessible hide */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* Modal base (hidden by default) */
.modal { 
  position: fixed; inset: 0; display: none;
}
.modal:target { 
  display: block; 
}
.modal__overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,.5);
}
.modal__content {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  background: #fff; border-radius: 16px;
  padding: 1rem; width: min(92vw, 520px);
  box-shadow: 0 10px 40px rgba(0,0,0,.2);
  text-align: center;
}
.modal__img {
  width: 100%; height: auto; border-radius: 8px; background: #fff;
}
.modal__hint { margin-top: .5rem; color: var(--muted); }
.modal__close {
  position: absolute; top: .5rem; right: .75rem;
  text-decoration: none; font-size: 1.1rem; color: #666;
}
.modal__close:hover { color: #000; }


.tile-img img {
  /* max-width: 100px;   or whatever size you want */
  max-height: 100px; /* maintain aspect ratio */
  height: auto;
  display: block;
  /* margin: 0 auto;      */
}


.tile {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #eee;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  transition: background 0.2s;
}


.tile-img img {
  max-width: 200px; /* thumbnail size */
  height: auto;
  border-radius: 4px;
  display: block;
}

.game-list-img {
  max-width: 300px; /* thumbnail size */
  height: auto;
  border-radius: 4px;
  display: block;
  margin: 0 auto;
}

/* Home tiles only */
.tiles-home {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}

/* Card */
.tiles-home .tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  padding: 1rem;
  text-align: center;
  height: 300px;               /* equal height on desktop */
}

/* Image */
.tiles-home .tile-img img {
  max-width: 120px;
  max-height: 120px;
  margin-bottom: 0.75rem;
  object-fit: contain;
}

.tile-img img {
  max-width: 300px; /* thumbnail size */
  height: auto;
  border-radius: 4px;
  display: block;
}

/* Text */
.tiles-home .tile-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.tiles-home .tile-sub {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.35;
  display: -webkit-box;        /* optional: clamp to 3 lines */
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Responsive breakpoints ---------- */

/* Large tablets: 3 across */
@media (max-width: 1200px) {
  .tiles-home { grid-template-columns: repeat(3, 1fr); }
}

/* Tablets: 1 per row */
@media (max-width: 900px) {
  .tiles-home { grid-template-columns: 1fr; }
  .tiles-home .tile { height: auto; padding: 1rem 1.25rem; }
  .tiles-home .tile-img img { max-width: 64px; max-height: 64px; }
  .tiles-home .tile-sub { -webkit-line-clamp: unset; }  /* let it wrap on phones */

  /* .tiles-home { grid-template-columns: repeat(2, 1fr); }
  .tiles-home .tile { height: 240px; }
  .tiles-home .tile-img img { max-width: 72px; max-height: 72px; } */
}

/* Phones: 1 per row */
@media (max-width: 560px) {
  .tiles-home { grid-template-columns: 1fr; }
  .tiles-home .tile { height: auto; padding: 1rem 1.25rem; }
  .tiles-home .tile-img img { max-width: 64px; max-height: 64px; }
  .tiles-home .tile-sub { -webkit-line-clamp: unset; }  /* let it wrap on phones */
}

/* Hero with background image */
.hero--landing.has-bg{
  position: relative;
  min-height: 90vh;              /* good on mobile */
  display: grid;
  place-items: center;
  padding: 3rem 1rem;
  color: #fff;
  background: center/cover no-repeat url("/img/lantern.jpg");
  border-radius: 16px;
  overflow: hidden;
}

/* dark gradient overlay for readability */
.hero--landing.has-bg .hero__overlay{
  position:absolute; inset:0;
  background: linear-gradient(180deg, rgba(0,0,0,.1), rgba(0,0,0,.1));
}

/* keep text above overlay */
.hero--landing.has-bg .hero__content{ 
  position: relative; 
  text-align: center;
  max-width: 720px;
}
.hero--landing.has-bg h1{ margin: 0 0 .5rem; }
.hero--landing.has-bg .tagline{ margin:.1rem 0; opacity:.95 }

/* CTA row */
.hero--landing.has-bg .cta-row{
  margin-top: 1rem;
  display: flex; gap:.6rem; flex-wrap: wrap; justify-content: center;
}

/* Audio button state */
.btn-audio[aria-pressed="true"]{ 
  background:#1a915a; color:#fff; 
}

.lang-switch{display:flex;gap:.5rem;margin:.5rem 0 1rem}
.lang-switch a{padding:.15rem .5rem;border-radius:.5rem;text-decoration:none;opacity:.8}
.lang-switch a.active{font-weight:600;opacity:1;outline:1px solid currentColor}


/* Collapsed remainder */
.collapsed-body { position: relative; }

/* Clamp when collapsed */
.collapsed-body.is-collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 6;      /* show first N lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Soft fade at the bottom */
.collapsed-body.is-collapsed::after {
  content: "";
  position: absolute; inset: auto 0 0 0;
  height: 3.25rem;
  background: linear-gradient(to bottom, rgba(255,255,255,0), #fff);
  pointer-events: none;
}

/* Toggle button sits on the fade when collapsed */
.collapsed-body .continue-btn {
  position: absolute;
  bottom: .5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  padding: .35rem .75rem;
  border-radius: .75rem;
  cursor: pointer;
}

/* When expanded, make the button flow below the content */
.collapsed-body:not(.is-collapsed) .continue-btn {
  position: static;
  transform: none;
  margin-top: .75rem;
}

/* ---- Recommended (scoped) ---- */
.rec { margin-top: 1.5rem; }
.rec__heading { margin: 0 0 .75rem; font-size: 1.125rem; font-weight: 700; }

/* mobile-first: single column */
.rec__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem;
}

/* cards */
.rec__card {
  display: grid;
  grid-template-columns: 96px 1fr;        /* image + text */
  gap: .75rem;
  align-items: start;
  padding: .75rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
}

/* image */
.rec__media { width: 96px; height: 96px; overflow: hidden; border-radius: 8px; }
.rec__img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* text */
.rec__body { min-width: 0; }
.rec__title { margin: 0 0 .25rem; font-size: 1rem; line-height: 1.3; font-weight: 700; }
.rec__date { font-size: .82rem; opacity: .7; margin-bottom: .25rem; }
.rec__summary {
  margin: 0;
  font-size: .92rem; line-height: 1.35;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}

/* widen at breakpoints */
@media (min-width: 480px) {
  .rec__grid { grid-template-columns: repeat(2, 1fr); }
  .rec__card { grid-template-columns: 110px 1fr; }
  .rec__media { width: 110px; height: 110px; }
}
@media (min-width: 768px) {
  .rec__grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1024px) {
  .rec__grid { grid-template-columns: repeat(4, 1fr); }
}


/* ---- Chapter page (scoped) ---- */
.chap__title { 
  text-align: center;
  margin-bottom: 1rem; 
}
.chap__pager {
  display: flex; justify-content: space-between; gap: .75rem;
  margin: 1rem 0 1.25rem;
}
.chap__pager a { text-decoration: none; }

.chap__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .5rem;
  margin: 1rem 0 1.5rem;
}
@media (min-width: 640px) { .chap__grid { grid-template-columns: repeat(7, 1fr); } }
@media (min-width: 1024px){ .chap__grid { grid-template-columns: repeat(14, 1fr);} }

.chap__cell {
  display: block;
  text-align: center;
  padding: .5rem .25rem;
  border: 1px solid #e5e7eb;
  border-radius: .5rem;
  text-decoration: none;
  color: inherit;
  background: #fff;
}
.chap__cell.is-active {
  font-weight: 700;
  outline: 1px solid currentColor;
}

/* ---- Section/list pages (scoped) ---- */
.sec__title { margin: .25rem 0 .5rem; }
.sec__intro { margin-bottom: 1rem; }

/* cards for subsections */
.sec__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem;
}
.sec__card {
  display: block;
  padding: .9rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  background: #fff;
  transition: transform .06s ease, box-shadow .2s ease;
}
.sec__card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.06); }
.sec__cardTitle { margin: 0 0 .25rem; font-size: 1.05rem; font-weight: 700; }
.sec__cardSummary { margin: 0; opacity: .85; }

@media (min-width: 640px) { .sec__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px){ .sec__grid { grid-template-columns: repeat(3, 1fr); } }

/* chapter grid */
.sec__gridChapters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .5rem;
  margin-top: 1rem;
}
@media (min-width: 640px) { .sec__gridChapters { grid-template-columns: repeat(7, 1fr); } }
@media (min-width: 1024px){ .sec__gridChapters { grid-template-columns: repeat(14, 1fr); } }

.sec__cell {
  display: block; text-align: center;
  padding: .5rem .25rem;
  border: 1px solid #e5e7eb; border-radius: .5rem;
  background: #fff; text-decoration: none; color: inherit;
}
.sec__cell.is-active { font-weight: 700; outline: 1px solid currentColor; }


/* /css/style.css */
.verse { scroll-margin-top: 80px; border-radius: .25rem; }
.verse.hl { background: #fff2a8; box-shadow: 0 0 0 .1rem #fff2a8; }
.verse-num { font-variant-numeric: tabular-nums; opacity: .6; margin-right:.15em; }


/* ===== Modern Audio Player (ap) ===== */
.ap {
  /* design tokens */
  --ap-accent: #2bd27e;           /* accent for play/progress */
  --ap-bg: rgba(28, 31, 36, 0.6); /* glass */
  --ap-border: rgba(255,255,255,0.10);
  --ap-text: #f4f7fb;
  --ap-muted: #b7c0cc;
  --ap-track: rgba(255,255,255,0.18);
  --ap-buffer: rgba(255,255,255,0.28);

  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  color: var(--ap-text);
  background: var(--ap-bg);
  border: 1px solid var(--ap-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 12px 30px rgba(0,0,0,0.25);
}

/* Primary play button a bit larger */
.ap-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 10px 12px;
  min-width: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  font-size: 14px;
  color: var(--ap-text);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(0,0,0,0.12)),
    #909aac;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.05) inset,
    0 8px 18px rgba(0,0,0,0.25);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, opacity .2s ease;
}
.ap-btn:hover { transform: translateY(-1px); }
.ap-btn:active { transform: translateY(0); box-shadow: 0 6px 14px rgba(0,0,0,0.25); }
.ap-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ap-play {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.10), rgba(0,0,0,0.18)),
    var(--ap-accent);
  color: #071a10;
  font-weight: 700;
  min-width: 48px;
  min-height: 48px;
  font-size: x-large;
}

/* Progress chunk */
.ap-progress { position: relative; flex: 1 1 auto; min-width: 240px; margin-top: 20px;}
.ap-track {
  position: relative;
  height: 10px;
  background: var(--ap-track);
  border-radius: 999px;
  overflow: hidden;
}
.ap-fill {
  position: absolute; inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--ap-accent), #70ffb8);
}
.ap-buffer {
  position: absolute; inset: 0 auto 0 0;
  width: 0%;
  background: var(--ap-buffer);
}

/* Seek slider sits on top and shows a visible thumb */
.ap-seek{
  position:absolute; inset:-6px 0 -6px 0;  /* larger hit area */
  width:100%;
  height:22px;
  background:transparent;
  appearance:none;
  -webkit-appearance:none;
  cursor:pointer;
}

/* Hide the slider's own track so our custom .ap-track is visible */
.ap-seek::-webkit-slider-runnable-track{ background:transparent; height:10px; }
.ap-seek::-moz-range-track{ background:transparent; height:10px; }

/* Visible thumb/handle */
.ap-seek::-webkit-slider-thumb{
  -webkit-appearance:none;
  width:16px; height:16px; border-radius:50%;
  background: var(--ap-accent, #2bd27e);
  box-shadow: 0 0 0 4px rgba(43,210,126,.25), 0 2px 8px rgba(0,0,0,.35);
}
.ap-seek::-moz-range-thumb{
  width:16px; height:16px; border:0; border-radius:50%;
  background: var(--ap-accent, #2bd27e);
  box-shadow: 0 0 0 4px rgba(43,210,126,.25), 0 2px 8px rgba(0,0,0,.35);
}


/* Times */
.ap-times {
  display: flex; justify-content: space-between;
  gap: 8px; margin-top: 8px;
  font-variant-numeric: tabular-nums;
  font-size: 12px; color: var(--ap-muted);
}

/* Volume slider */
.ap-volume {
  width: 140px; height: 28px;
  background: transparent; cursor: pointer;
}
.ap-volume:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Range styling */
.ap-volume,
.ap-volume::-webkit-slider-runnable-track {
  background: var(--ap-track);
  height: 6px; border-radius: 999px;
}
.ap-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px; margin-top: -5px;
  border-radius: 50%;
  background: var(--ap-accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
.ap-volume::-moz-range-track {
  background: var(--ap-track); height: 6px; border-radius: 999px;
}
.ap-volume::-moz-range-thumb {
  width: 16px; height: 16px; border: 0;
  border-radius: 50%;
  background: var(--ap-accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

/* Muted hint */
.ap.is-muted .ap-mute { opacity: .6; }

/* Compact on phones */
@media (max-width: 560px) {
  .ap { flex-wrap: wrap; gap: 10px; padding: 12px; }
  .ap-progress { order: 3; width: 100%; min-width: 0; margin-top: 0;}
  .ap-volume { width: 100px; }
}

/* Light theme */
@media (prefers-color-scheme: light) {
  .ap {
    --ap-bg: rgba(255,255,255,0.7);
    --ap-border: rgba(0,0,0,0.08);
    --ap-text: #101418;
    --ap-muted: #4d5a6a;
    --ap-track: rgba(0,0,0,0.08);
    --ap-buffer: rgba(0,0,0,0.18);
    box-shadow:
      0 1px 0 rgba(255,255,255,0.5) inset,
      0 8px 18px rgba(0,0,0,0.08);
  }
  .ap-btn { color: #475666; }
  .ap-play { color: #052816; }
}

/* Reduced motion kindness */
@media (prefers-reduced-motion: reduce) {
  .ap-btn { transition: none; }
}

.verse--active { background: rgba(255, 232, 115, .45); transition: background .15s; }

[data-verse].verse--active,
[data-v].verse--active,
.verse.verse--active {
  background: rgba(255,235,59,.35);
  outline: 1px solid rgba(255,193,7,.6);
  border-radius: .2rem;
  transition: background .12s ease-in;
}

.verse--active   { background: rgba(255, 230, 120, 0.6); transition: background 120ms; }
/* .verse--adjacent { background: rgba(255, 230, 120, 0.6); } */

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  cursor: pointer;
  text-decoration: none;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  min-width: 200px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  border: 1px solid #ddd;
  border-radius: 4px;
  z-index: 1000;
  padding: 8px 0;
}

.dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-section {
  padding: 4px 0;
}

.dropdown-section + .dropdown-section {
  border-top: 1px solid #eee;
  margin-top: 4px;
  padding-top: 8px;
}

.dropdown-header {
  font-weight: bold;
  color: #333;
  padding: 8px 16px;
  display: block;
  text-decoration: none;
  background: #f8f9fa;
}

.dropdown-menu a:not(.dropdown-header) {
  padding: 6px 16px 6px 24px;
  display: block;
  text-decoration: none;
  color: #666;
  font-size: 0.9em;
}

.dropdown-menu a:hover {
  background: #f0f0f0;
  color: #000;
}

/* Enhanced chapter submenu styling */
.book-item {
  position: relative;
}

.book-item > a {
  padding: 6px 16px;
  display: block;
  text-decoration: none;
  color: #666;
  font-size: 0.9em;
}

.book-item > a:hover {
  background: #f0f0f0;
  color: #000;
}

.chapters-submenu {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  background: white;
  min-width: 320px;
  max-width: 400px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 12px;
  z-index: 1001;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.book-item:hover .chapters-submenu {
  display: grid;
}

.chapters-submenu a {
  padding: 6px 8px;
  text-align: center;
  text-decoration: none;
  color: #666;
  border-radius: 4px;
  font-size: 0.85em;
  border: 1px solid #e5e7eb;
  background: #f9f9f9;
  transition: all 0.15s ease;
}

.chapters-submenu a:hover {
  background: #e9ecef;
  color: #000;
  border-color: #ccc;
  transform: translateY(-1px);
}

/* Responsive adjustments for the submenu */
@media (max-width: 768px) {
  .chapters-submenu {
    position: fixed;
    left: 20px;
    right: 20px;
    top: 80px;
    min-width: auto;
    max-width: none;
    grid-template-columns: repeat(5, 1fr);
  }
}

/* Mobile-first hamburger menu */
.topbar {
  position: relative;
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1002;
}

.hamburger-line {
  width: 24px;
  height: 3px;
  background: var(--fg);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: 3px 1px;
}

/* Hamburger animation */
.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: rotate(-45deg);
}

/* Mobile menu */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: white;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 1001;
  padding: 80px 20px 20px;
  overflow-y: auto;
  box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.nav.is-open {
  transform: translateX(0);
}

.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
}

.nav-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* Navigation sections */
.nav-section {
  margin-bottom: 2rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 1.5rem;
}

.nav-header {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brand);
  margin: 0 0 1rem 0;
  padding: 0;
}

.nav-subsection {
  margin-bottom: 1rem;
}

.nav-subheader {
  display: block;
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
  padding: 8px 0;
  margin-bottom: 4px;
  border-bottom: 1px solid #f0f0f0;
}

.nav-item {
  display: block;
  color: #666;
  text-decoration: none;
  padding: 8px 0 8px 16px;
  font-size: 0.95em;
}

.nav-link {
  display: block;
  color: var(--fg);
  text-decoration: none;
  padding: 12px 0;
  font-size: 1.1rem;
  border-bottom: 1px solid #f0f0f0;
}

.nav-item:hover,
.nav-link:hover,
.nav-subheader:hover {
  color: var(--brand);
  background: rgba(15, 118, 110, 0.05);
  margin: 0 -8px;
  padding-left: 16px;
  padding-right: 8px;
  border-radius: 4px;
}

/* Book expandable sections */
.nav-book-item {
  margin-bottom: 8px;
}

.nav-book-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8f9fa;
  border-radius: 4px;
  padding: 4px;
}

.nav-book-link {
  flex: 1;
  color: #666;
  text-decoration: none;
  padding: 8px 12px;
  font-size: 0.95em;
}

.nav-expand-btn {
  background: none;
  border: none;
  padding: 8px 12px;
  color: #666;
  cursor: pointer;
  font-size: 0.8em;
  transition: transform 0.2s ease;
  border-radius: 4px;
}

.nav-expand-btn:hover {
  background: rgba(0,0,0,0.05);
}

.nav-expand-btn.is-expanded {
  transform: rotate(180deg);
}

.nav-chapters {
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px;
  margin-top: 4px;
  background: #f0f0f0;
  border-radius: 4px;
}

.nav-chapters.is-expanded {
  display: grid;
}

.nav-chapter {
  padding: 6px 8px;
  text-align: center;
  text-decoration: none;
  color: #666;
  border-radius: 3px;
  font-size: 0.85em;
  background: white;
  border: 1px solid #e0e0e0;
  transition: all 0.15s ease;
}

.nav-chapter:hover {
  background: var(--brand);
  color: white;
  transform: translateY(-1px);
}

.nav-book-link:hover {
  color: var(--brand);
}

/* Desktop responsive menu behavior */
@media (min-width: 768px) {
  .nav {
    width: 320px; /* Fixed width instead of full screen */
    height: auto; /* Auto height instead of full screen */
    max-height: 80vh; /* Limit height */
    top: 60px; /* Below header */
    left: 0;
    border-radius: 0 8px 8px 0; /* Rounded right corners */
    box-shadow: 2px 0 15px rgba(0,0,0,0.15); /* Enhanced shadow */
  }
  
  .nav-overlay.is-open {
    opacity: 0.3; /* Lighter overlay on desktop */
  }
  
  .nav-chapters {
    grid-template-columns: repeat(5, 1fr); /* More columns on desktop */
  }
}

#english-translation { display: none; }
.hidden{display:none}

.tiles.tiles--more {
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
  gap:1rem;
}

.verse-chip {
  font-size: .78rem;
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .15s;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
