:root {
  --bg: #f7f7f7;
  --surface: #ffffff;
  --ink: #222;
  --muted-ink: #555;
  --line: #e5e5e5;
  --container-max: 1440px;
  --pad: clamp(8px, 2vw, 16px);
  --gap: 10px;
  --radius: 8px;
  --nav-h: 40px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html {
  overflow-y: scroll;
}

body {
  color: var(--ink, #222);
  background: #08031A repeat;
  background-size: 300px 300px;
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell,
               Noto Sans, Helvetica, Arial, "Apple Color Emoji",
               "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
  line-height: 1.6;
  
}

/* Canvas layer for background animation */
#bgCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#container {
  position: relative;
  z-index: 1;
  max-width: var(--container-max, 1440px);
  margin: 0 auto;
  padding: 0 var(--pad, 20px);
}

/* Optional global safety so images don't overflow */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* =========================== */
/* Header (hero)               */
/* =========================== */

#header {
  position: relative;
  width: 100%;
  border: 0px solid var(--line, #e5e5e5);
  border-radius: var(--radius, 8px);
  background: var(--surface, #fff);
  overflow: hidden;
}

/* Visual region wrapper */
#header .header-media {
  position: relative;
  width: 100%;
  aspect-ratio: 7/1; /* desktop/tablet shape */
}

/* Fill the media box */
#header .header-image,
#header .header-overlay,
#header .header-content {
  position: absolute;
  inset: 0;
}

/* Image/video styling */
#header .header-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--hero-focus, 30% 80%);
  filter: brightness(1.1);
}

/* Overlay for contrast */
#header .header-overlay {
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(0,0,0,0.30) 0%,
    rgba(0,0,0,0.20) 40%,
    rgba(0,0,0,0.45) 100%
  );
}

/* Content layer */
#header .header-content {
  left: var(--pad, 20px);
  right: auto;
  top: var(--pad, 40px);
  bottom: auto;
  z-index: 1;
  color: #fff;
  max-width: min(700px, 92%);
  display: grid;
  gap: 6px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Typography */
#header .header-content h1 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-size: clamp(1.5rem, 2.2rem + 1.2vw, 3rem);
}

#header .header-content .kicker {
  margin: 0;
  color: rgba(255,255,255,0.9);
  font-size: clamp(0.95rem, 0.9rem + 0.5vw, 1.25rem);
}

/* Mobile header adjustments */
@media (max-width: 800px) {
  #header .header-media {
    aspect-ratio: auto;
    min-height: clamp(160px, 20dvh, 320px);
  }
  #header .header-image { object-position: 50% 30%; }
  #header .header-content {
    top: clamp(12px, 3vw, 24px);
    max-width: 94%;
  }
}

@media (max-width: 360px) {
  #header .header-media { min-height: clamp(160px, 24dvh, 340px); }
}

/* =========================== */
/* Navbar                      */
/* =========================== */

#navbar {
  margin-top: var(--gap, 10px);
  height: var(--nav-h, 40px);
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e5e5e5);
  border-radius: var(--radius, 8px);

  display: flex;
  align-items: center;

  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#navbar ul {
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: var(--pad, 10px);
  padding: 0 var(--pad, 20px);
  margin: 0;
  list-style: none;
  white-space: nowrap;
  min-width: max-content; /* critical */
}

#navbar li {
  flex: 0 0 auto;
}

#navbar li.nav-right {
  margin-left: auto;
}

#navbar a {
  display: inline-flex;
  align-items: center;

  padding: 6px;
  border-radius: 4px;

  color: var(--muted-ink, #555);
  font-weight: 600;
  text-decoration: none;
}

#navbar a:hover,
#navbar a:focus {
  color: var(--ink, #222);
  text-decoration: underline;
  text-underline-offset: 2px;
}

#navbar a.is-active {
  color: var(--ink, #222);
  text-decoration: underline;
}
/* =========================== */
/* Mobile navbar — single row  */
/* =========================== */

@media (max-width: 840px) {

  #navbar {
    height: var(--nav-h, 40px);
    overflow-x: auto;
    overflow-y: hidden;
  }

  #navbar ul {
    flex-wrap: nowrap;       /* 🔑 prevents second row */
    white-space: nowrap;
    gap: 6px;
    padding: 0 8px;
  }

  #navbar a {
    padding: 6px 6px;        /* readable, tappable */
  }

  /* Hide desktop-only */
  #navbar li.nav-desktop-only,
  #navbar li > a.nav-desktop-only {
    display: none;
  }

  /* Disable line breaks */
  #navbar li.nav-break {
    display: none;
  }

  /* nav-right stays normal on mobile */
  #navbar li.nav-right {
    margin-left: auto;
    flex: 0 0 auto;
  }
}

@media (min-width: 841px) {
  #navbar li.nav-mobile-only {
    
    display: none;
  }
  @media (min-width: 841px) {
  #navbar ul {
    min-width: 100%;    /* 👈 desktop: stretch */
    width: auto;
  }

  #navbar li.nav-right {
    margin-left: auto;
  }
}

}


/* =========================== */
/* Main row: sidebars + main   */
/* =========================== */

#flex {
  display: flex;
  gap: var(--gap, 10px);
  margin: var(--pad, 20px) 0;
}

aside {
  width: 22%;
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e5e5e5);
  border-radius: var(--radius, 8px);
  padding: var(--pad, 20px);
  font-size: 0.8rem;
}

#content {
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e5e5e5);
  border-radius: var(--radius, 8px);
  padding: var(--pad, 20px);
  flex: 1;
  order: 2;
}

/* Preserve left/right ordering */
#leftSidebar  { order: 1; }
#rightSidebar { order: 3; }

/* Simple box component */
.box {
  border: 1px solid var(--line, #e5e5e5);
  border-radius: var(--radius, 8px);
  padding: var(--pad, 20px);
  background: #fafafa;
}

/* Hide filtered-out figures */
.gallery figure[hidden] { display: none !important; }

/* Optional: style active nav link */
#navbar a.is-active { color: var(--ink, #222); text-decoration: underline; }

/* Footer */
#footer {
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e5e5e5);
  border-radius: var(--radius, 8px);
  margin: 0 0 var(--pad, 20px) 0;
  padding: 10px;
  text-align: center;
  color: var(--muted-ink, #555);
}

/* Responsive main layout */
@media screen and (max-width: 800px) {
  #flex { display: flex; flex-wrap: wrap; }
  aside { width: 100%; }
  #content      { order: 1; }
  #leftSidebar  { order: 2; }
  #rightSidebar { order: 3; }
  #navbar ul { flex-wrap: wrap; gap: 16px; padding-left: 12px; padding-right: 12px; }
}

/* =========================== */
/* Gallery (Grid)              */
/* =========================== */
.gallery-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.gallery-header h2 {
  margin: 0;
}

.gallery-filters {
  display: flex;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.gallery-filters a {
  text-decoration: none;
  color: var(--muted-ink, #555);
  padding: 2px 4px;
}

.gallery-filters a:hover,
.gallery-filters a:focus {
  color: var(--ink, #222);
  text-decoration: underline;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.gallery figure { margin: 0; }

.gallery button.thumb {
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  display: block;
  border-radius: 6px;
  overflow: hidden;
}

.gallery img.thumb {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
}

/* Responsive thumbnail heights */
@media (max-width: 1000px) { .gallery img.thumb { height: 120px; } }
@media (max-width: 600px)  { .gallery img.thumb { height: 100px; } }
@media (max-width: 400px)  { .gallery img.thumb { height: 90px; } }
@media (pointer: coarse)   { .gallery img.thumb { height: 160px; } }

/* =========================== */
/* Lightbox                    */
/* =========================== */

#lightbox[hidden] { display: none !important; }

#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 9999;
}

.lightbox-dialog {
  position: relative;
  max-width: min(92vw, 1000px);
  max-height: 90vh;
  width: 100%;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  grid-template-rows: 1fr auto;
}

.lightbox-stage { position: relative; background: #000; }
.lightbox-stage img {
  display: block; max-width: 100%; max-height: 80vh;
  margin: 0 auto; object-fit: contain; background: #000;
}

.lightbox-caption { color: #eee; background: rgba(0,0,0,0.6); padding: 10px 14px; font-size: 0.95rem; }

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute; border: 0; background: rgba(255,255,255,0.15);
  color: #fff; width: 40px; height: 40px; border-radius: 999px;
  display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(2px);
}

.lightbox-close { top: 10px; right: 10px; }
.lightbox-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 10px; top: 50%; transform: translateY(-50%); }

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(255,255,255,0.25); }

.lightbox-prev::before, .lightbox-next::before, .lightbox-close::before {
  display: inline-block; font-size: 20px; line-height: 1;
}
.lightbox-prev::before  { content: "◀"; }
.lightbox-next::before  { content: "▶"; }
.lightbox-close::before { content: "✕"; }

@media (pointer: coarse) {
  .lightbox-close, .lightbox-prev, .lightbox-next { width: 48px; height: 48px; }
}

#viewport {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 10;
}

.walker {
  position: absolute;
  left: 0; top: 0;
}

.walker[data-dir="-1"] {
  transform-origin: center;
}

.flash {
  position: absolute;
  inset: -40px;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 60%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease-out;
}
.flash.is-on { opacity: 1; }

/* Ensure no responsive scaling applies to walker sprites */
.walker > img {
  display: block;

  /* Hard lock to pixel size; JS also sets width/height attributes */
  width: auto;          /* prevents width:100% from global rules */
  height: auto;
  max-width: none;      /* prevents max-width:100% rules */
  max-height: none;

  image-rendering: auto; /* or pixelated if you want crisp sprites */
  backface-visibility: hidden;
  transform: var(--flip, none) translateZ(0);
}

/* Flip only the image for leftward direction */
.walker[data-dir="-1"] > img {
  --flip: scaleX(-1);
}

.walker {
  position: absolute;
  left: 0;
  top: 0;

  /* We’ll set width/height from JS per sprite spec */
  contain: size layout paint;
  will-change: transform;
  transform-style: flat; /* no 3D weirdness */
}

/* ================================================= */
/* THEOLOGY LIBRARY — COMPACT BOOKSHELF STYLES      */
/* ================================================= */

/* ---------- MAIN CONTAINER ---------- */
#content {
  margin: 0;
  padding: 0 1rem; /* minimal horizontal padding */
}

/* ---------- LIBRARY MAIN HEADING ---------- */
.bookshelf-library {
  padding: 0; /* no top/bottom padding */
}

.bookshelf-library h2 {
  margin: 0.2rem 0 0.5rem 0; /* tiny spacing above/below */
  font-size: 1.5rem;
}

/* ---------- SHELF ROW ---------- */
.shelf {
  display: flex;
  align-items: flex-end;
  gap: 6px; /* space between books */
  padding: 14px 12px 18px; /* shelf background padding */
  background: linear-gradient(#e6e2dc, #d7d2ca);
  border-bottom: 6px solid #a37b4f;
  border-radius: 4px;
  /* Keep horizontal scroll; allow vertical lift to show */
  overflow-x: auto;
  overflow-y: visible;
  margin: 0; /* no extra space below */
  flex-wrap: nowrap;
}

/* ---------- INDIVIDUAL BOOK ---------- */
.book {
  --base-width: 42px;
  width: calc(var(--base-width) * var(--book-width, 1));
  height: 180px;

  background:
    linear-gradient(to right, rgba(0,0,0,0.18), rgba(255,255,255,0.18)),
    #6b4e2e;

  border-radius: 3px 3px 2px 2px;
  box-shadow:
    inset -2px 0 0 rgba(255,255,255,0.15),
    inset 2px 0 0 rgba(0,0,0,0.25),
    0 2px 4px rgba(0,0,0,0.3);

  /* Transitions only on the book wrapper (not text) */
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  flex: 0 0 auto; /* prevent stretching */

  position: relative; /* for stacking and the edge cue */
  z-index: 0;
}

/* Link and text: CONTENT ONLY — do not move or restyle fonts */
.book a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 8px 4px;
  color: #f6f2eb;
  text-decoration: none;

  /* keep typography stable */
  font: inherit;
  text-shadow: none;
  transform: none;
  filter: none;
}

.spine-title {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-align: center;
  line-height: 1;
  font-family: inherit;
  color: inherit;
  text-shadow: none;
}

/* ---------- HOVER STATE (original behavior) ---------- */
.book:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 14px rgba(0,0,0,0.4);
}

/* ---------- SELECTED STATE (same lift as hover, deeper shadow) ---------- */
.book.is-selected {
  transform: translateY(-6px);
  z-index: 2;
  box-shadow: 0 12px 20px rgba(0,0,0,0.45);
}

/* Optional: slightly stronger while hovered and selected */
.book.is-selected:hover {
  box-shadow: 0 14px 24px rgba(0,0,0,0.5);
}

/* ---------- DIVIDER BETWEEN OT & NT (keep) ---------- */
.divider {
  width: 4px;
  height: 180px; /* match book height */
  background: linear-gradient(
    180deg,
    #a37b4f 0%,
    #8c6239 25%,
    #a37b4f 50%,
    #8c6239 75%,
    #a37b4f 100%
  ); /* subtle wood grain effect */
  border-radius: 2px;
  margin: 0 8px; /* spacing between books and divider */
  flex-shrink: 0;
}

/* ---------- ARTICLES / BOOK ARTICLES ---------- */
#book-articles {
  margin: 0;
  padding: 0;
}

#book-articles h3 {
  margin: 0.2rem 0 0.5rem 0;
  font-size: 1rem;
}

#book-articles-list {
  margin: 0;
  padding-left: 1em; /* keep bullet indentation */
  line-height: 1.2em;
}

/* ---------- SECONDARY SECTIONS ---------- */
.library-secondary {
  margin-top: 1.5rem; /* minimal spacing from main library */
}

.section-divider {
  border: none;
  height: 4px;
  width: 100%;
  margin: 2rem auto;
  background: linear-gradient(
    90deg,
    #a37b4f 0%,
    #c9a67e 50%,
    #a37b4f 100%
  );
  border-radius: 2px;
  opacity: 0.8;
}

.card h3 {
  margin: 0;
  font-size: 1.25rem;
  color: #3a2e22;
}

.card p {
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
  color: #6b635b;
}
.library-secondary section {
  margin-bottom: 1rem;
}

.library-secondary h3 {
  margin-bottom: 0.5rem;
}

/* ---------- CARDS ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.card {
  padding: 1rem;
  height: auto;
  border-radius: 6px;
  background: var(--surface, #fff);
  box-shadow: 2px 2px 8px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.1)
}

.card a {
  text-decoration: none;
  font-weight: 600;
}

/* ---------- ACCESSIBILITY: KEYBOARD FOCUS ---------- */
.book a:focus-visible {
  outline: 2px solid #d8a15d;
  outline-offset: 3px;
  border-radius: 2px;
}
/* =============================================== */
/* 3D BOOK LOOK: spine bevel + visible top pages   */
/* =============================================== */

/* Make sure vertical overflow is visible so the top pages can show */
.shelf {
  overflow-y: visible;
}

/* Base: ensure we can position page/spine accents */
.book {
  position: relative; /* already set, just reaffirming */
  isolation: isolate; /* keep shadows/pseudos self-contained (nice-to-have) */
}

/* --- TOP PAGES (white paper) --- */
/* ===================================================== */
/* BOOK: realistic top pages edge (correct layer order)  */
/* ===================================================== */

/* Make sure the shelf doesn’t clip the top pages strip */
.shelf {
  overflow-y: visible; /* keep your existing overflow-x: auto; */
}

.book {
  position: relative;
  isolation: isolate; /* keeps pseudo shadows self-contained (nice-to-have) */
}

/* TOP PAGES STRIP */
.book::before {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: -5px;               /* visible above the book */
  height: 6px;             /* page thickness */
  border-radius: 4px 4px 0 0;
  pointer-events: none;
  z-index: 1;

  /* Backgrounds are painted TOP → BOTTOM (first is topmost!) */
  background-image:
    /* 1) Fine horizontal page lines (very subtle) — TOPMOST */
    repeating-linear-gradient(
      180deg,
      rgba(0,0,0,0.10) 0px,
      rgba(0,0,0,0.10) 0.5px,
      rgba(0,0,0,0.00) 1.3px,
      rgba(0,0,0,0.00) 2.6px
    ),
    /* 2) Spine gutter (left) and far edge fade (right) */
    linear-gradient(90deg,
      rgba(0,0,0,0.12) 0%,
      rgba(0,0,0,0.06) 6%,
      rgba(0,0,0,0.00) 18%,
      rgba(0,0,0,0.00) 82%,
      rgba(0,0,0,0.08) 100%
    ),
    /* 3) Gentle curved highlight/bulge across the middle */
    radial-gradient(120% 180% at 50% -20%,
      rgba(255,255,255,0.70) 0%,
      rgba(255,255,255,0.32) 42%,
      rgba(0,0,0,0.03) 78%,
      rgba(0,0,0,0.08) 100%
    ),
    /* 4) Base paper — BOTTOMMOST */
    linear-gradient(#fbfbfa, #f3f1ec);

  /* Soft separation and depth */
  box-shadow:
    0 1px 0 rgba(0,0,0,0.12),        /* cast onto air above cover */
    inset 0 -1px 0 rgba(0,0,0,0.06); /* tiny inner shadow at page bottom */

  /* Subtle change when “lifted” */
  transition: height 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.book:hover::before,
.book.is-selected::before {
  height: 7px; /* feels a tad thicker when lifted */
  box-shadow:
    0 2px 0 rgba(0,0,0,0.14),
    inset 0 -1px 0 rgba(0,0,0,0.08);
  filter: contrast(1.02) brightness(1.01);
}

/* Optional (but recommended): cover bevel for a touch more curvature */
.book::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 3px 3px 2px 2px;
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      rgba(255,255,255,0.18) 0%,
      rgba(255,255,255,0.08) 10%,
      rgba(255,255,255,0.00) 22%,
      rgba(0,0,0,0.00) 78%,
      rgba(0,0,0,0.14) 100%
    );
}

/* Slightly “thicker” pages and deeper shadow on hover/selected */
.book:hover::before,
.book.is-selected::before {
  height: 7px;
  box-shadow:
    0 2px 0 rgba(0,0,0,0.14),
    inset 0 -1px 0 rgba(0,0,0,0.08);
  /* a touch more contrast to sell lift */
  filter: contrast(1.02) brightness(1.01);
}

/* Slightly “thicker” page edge when hovered/selected for extra depth */
.book:hover::before,
.book.is-selected::before {
  height: 7px;
  box-shadow:
    0 2px 0 rgba(0,0,0,0.12),
    inset 0 -1px 0 rgba(0,0,0,0.08);
}

/* --- SPINE BEVEL / RIM LIGHT --- */
.book::after {
  content: "";
  position: absolute;
  inset: 0;                 /* covers the book face */
  border-radius: 3px 3px 2px 2px;
  /* Bevel: soft highlight on the left + subtle shadow on the right */
  background:
    linear-gradient(
      90deg,
      rgba(255,255,255,0.22) 0%,
      rgba(255,255,255,0.10) 8%,
      rgba(255,255,255,0.00) 18%,
      rgba(0,0,0,0.00) 82%,
      rgba(0,0,0,0.16) 100%
    );
  mix-blend-mode: normal;   /* safe for all backgrounds */
  pointer-events: none;
  z-index: 0;
}

/* Optional: a tiny inner edge to crispen the cover */
.book {
  box-shadow:
    inset -2px 0 0 rgba(255,255,255,0.15),
    inset 2px 0 0 rgba(0,0,0,0.25),
    0 2px 4px rgba(0,0,0,0.3);
}

/* Lifted states: deepen the base shadow to sell the 3D feel */
.book:hover {
  /* already lifts via transform; just increase the shadow a touch */
  box-shadow:
    0 10px 18px rgba(0,0,0,0.40);
}

.book.is-selected {
  /* same lift as hover (per your choice), slightly stronger shadow */
  box-shadow:
    0 14px 22px rgba(0,0,0,0.45);
}

.book.is-selected:hover {
  box-shadow:
    0 16px 26px rgba(0,0,0,0.50);
}

/* =============================================== */
/* Optional: color variants for variety (if you want) */
/* Add these classes to .book for different covers */
/* =============================================== */
.book.book--oxblood { background: linear-gradient(to right, rgba(0,0,0,0.18), rgba(255,255,255,0.18)), #5a2c2c; }
.book.book--navy   { background: linear-gradient(to right, rgba(0,0,0,0.18), rgba(255,255,255,0.18)), #24324a; }
.book.book--green  { background: linear-gradient(to right, rgba(0,0,0,0.18), rgba(255,255,255,0.18)), #2d4a3a; }
.book.book--tan    { background: linear-gradient(to right, rgba(0,0,0,0.18), rgba(255,255,255,0.18)), #7a5b35; }

/* ===============================================
   NOW — Left Sidebar
   =============================================== */

#leftSidebar {
  padding: 8px;
}

/* Reset noisy defaults */
#leftSidebar section,
#leftSidebar h3,
#leftSidebar figure,
#leftSidebar p {
  margin: 0;
}

/* ===============================================
   Section Blocks
   =============================================== */

#leftSidebar .now-block {
  padding: 6px;
  margin: 0 0 16px;
  background: #eaeaea;
  border-radius: var(--radius, 8px);
  border: 1px solid #ececec;
  overflow: hidden;
  text-align: left;
  border: 1px solid #000;
}

/* Section header */
#leftSidebar .now-block > h3 {
  
  font-size: 1rem;
  font-weight: 700;
  color: #222;
  border-bottom: 1px solid #eee;
  margin-bottom: 2px;
}

#leftSidebar .now-block > h3 u {
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* ===============================================
   Cover Card
   =============================================== */

#leftSidebar .now-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin-bottom: 8px;
  border-radius: 5px;
  overflow: hidden;
  background: #0a0a0a; /* darker contrast */

  
}

/* Clickable cover */
#leftSidebar .now-card .now-link {
  position: absolute;
  inset: 0;
  display: block;
  z-index: 0;
  text-decoration: none;
  color: inherit;
}

/* Image: full-bleed, no border here */
#leftSidebar .now-card img,
#leftSidebar .now-card .now-link > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ✅ GUARANTEED BLACK BORDER */
#leftSidebar .now-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid #000;
  border-radius: inherit;
  box-sizing: border-box;
  pointer-events: none;
  z-index: 1; /* above image, below overlay */
}

/* ===============================================
   Overlay (bottom text + veil)
   =============================================== */

#leftSidebar .now-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  color: #fff;
  pointer-events: none;
  z-index: 2;
}

/* Readability veil */
#leftSidebar .now-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 100ms ease;
  z-index: 0;
}

#leftSidebar .now-card:hover .now-overlay::before {
  opacity: 1;
}

/* Bottom-aligned overlay text */
#leftSidebar .now-overlay .meta {
  position: relative;
  z-index: 1;
  padding: 10px;
  align-self: end;
}

#leftSidebar .now-overlay .title {
  font-weight: 700;
  font-size: 0.93rem;
  line-height: 1.15;
  text-shadow: 0 1px 2px rgba(0,0,0,0.45);
}

#leftSidebar .now-overlay .sub {
  margin-top: 2px;
  font-weight: 500;
  font-size: 0.82rem;
  line-height: 1.2;
  color: rgba(255,255,255,0.92);
}

/* ===============================================
   Favorite Song Chip
   =============================================== */

#leftSidebar .now-fav-below {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 10px 10px 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,213,74,0.14);
  color: #8a6b00;
  font-size: 0.8rem;
  line-height: 1;
}

#leftSidebar .now-fav-below .star {
  color: #e7b400;
}

/* ===============================================
   Description & Embeds
   =============================================== */

#leftSidebar .now-desc {
  margin: 6px 10px 8px;
  font-size: 0.85rem;
  line-height: 1.3;
  color: var(--text-muted, #656);
}

#leftSidebar .now-embed {
  display: block;
  margin: 8px 10px 10px;
}

#leftSidebar iframe {
  width: 100%;
  border: 0;
  display: block;
}

/* Bandcamp */
#leftSidebar .now-embed--bc {
  height: 44px;
  width:96%;
  font-size: 0.6rem;
  border: 1px solid #ececec;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(0,0,0,0.03);
}

/* YouTube */
#leftSidebar .now-embed--yt {
  height: 200px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
}

/* ===============================================
   Minor Typography
   =============================================== */

#leftSidebar strong {
  font-weight: 600;
}

/* Accessibility helper */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}
/* Inline favorite in overlay next to artist (Listening card) */
#leftSidebar .now-overlay .fav-inline {
  color: rgba(255,255,255,0.95);
  font-weight: 600;     /* a touch of emphasis */
  white-space: nowrap;  /* keep star + title together */
}

#leftSidebar .now-overlay .fav-inline .star {
  color: #ffd54a;       /* same star color as your chip */
  margin-right: 4px;    /* small gap before the song title */
  
}
/* Inline favorite in overlay next to artist (Listening card) */
#leftSidebar .now-overlay .sub {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;           /* small gap between artist and the favorite chip */
  align-items: center;
}

#leftSidebar .now-overlay .fav-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;                      /* pill shape */
  background: rgba(255, 213, 74, 0.18);      /* subtle yellow wash */
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;                       /* keep star + title together */
  backdrop-filter: saturate(120%);           /* slight pop on modern browsers */
}

#leftSidebar .now-overlay .fav-inline .star {
  color: #ffd54a;                            /* same star hue as your chip */
  margin-right: 2px;
}
/* Archive link styled as button at the bottom */
.now-archive-link {
  display: block;            
  width: 100%;
  margin-top: auto;          /* pushes it to bottom of sidebar */
  padding: 0.75rem 1rem;     
  border-top: 1px solid #999; /* darker, thinner border */
  background-color: #e0e0e0;  /* light gray background */
  color: var(--link-color, #378783);
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  border-radius: 6px 6px 6px 6px;
  cursor: pointer;
}

.now-archive-link:hover,
.now-archive-link:focus {
  background-color: #d5d5d5; /* slightly darker gray on hover */
  color: var(--link-color, #2a6a69);
}

/* Make sure the <a> inside inherits styles */
.now-archive-link a {
  text-decoration: none;
  color: inherit;
  display: block;
  width: 100%;
  height: 100%;
}



/* Tiny square thumbs inside archive list items */
.now-archive-list {
  margin: 0.25rem 0 0;
  padding-left: 0;
  list-style: none; /* no bullets */
}
.now-archive-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.35rem 0;
  min-height: 24px;
}


.contact-iframe {
  width: 100%;
  height: 400px;              /* fixed height = no reflow */
  border: 1px solid var(--line, #e5e5e5);
  border-radius: 10px;
  overflow: hidden;           /* hide scrollbars */
  display: block;
}

/* extra safety for iframe internals */
.contact-iframe::-webkit-scrollbar {
  display: none;
}

#rightSidebar {
  display: flex;
  flex-direction: column;
  gap: 0px;
}

/* Contact section spacing */
.contact-section h2 {
  margin-bottom: 10px;
}
/* ======================= */
/* Image of the Week Frame  */
/* ======================= */
/* Sidebar Image of the Week - compact spacing, readable size */
.image-of-week {
  text-align: center;
  margin: 0.25rem 0 1rem 0; /* top smaller, bottom a bit more */
  font-family: system-ui, sans-serif;
}

.image-of-week h2 {
  font-size: 1.25rem;       
  margin: 0 0 0 0;     /* remove top margin, small bottom margin */
  color: #000;              
  font-weight: 600;
}

/* Dark frame around the image */
.image-of-week figure {
  margin: 0 auto;            /* center */
  padding: 8px;              /* keep frame thickness readable */
  max-width: 100%;
  background: #1a1a1a;       /* dark frame */
  border-radius: 10px;       /* nice rounded corners */
  display: inline-block;
}

/* Image inside the frame */
.image-of-week img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;        /* rounding to fit frame */
}

/* Caption styling */
.image-of-week figcaption {
  margin-top: 4px;           /* tighter spacing above caption */
  font-size: 0.85rem;        /* readable but small */
  color: #fff;               /* white caption */
  text-align: center;
  line-height: 1.2;
}


/* ===============================================
   Main Page Articles
   =============================================== */
.article-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.article-card {
  display: block;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.article-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.article-card h3 {
  margin: 0.5rem;
  font-size: 1.1rem;
}

.article-card time {
  margin: 0 0.5rem 0.75rem;
  display: block;
  font-size: 0.85rem;
  opacity: 0.6;
}

@media (max-width: 700px) {
  .article-grid {
    grid-template-columns: 1fr;
  }
}
#recent-articles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

/* kill default link styling */
.article-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

/* image */
.article-thumb img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

/* text */
.article-meta {
  padding: 0.75rem;
}

.article-meta h3 {
  margin: 0 0 0rem;
  font-size: 1rem;
}

.article-meta time {
  display: block;
  margin: 0;              /* kill default spacing */
  padding: 0;             /* just in case */
  font-size: 0.8rem;
  line-height: 1.1;       /* tighter */
  opacity: 0.6;
}


@media (max-width: 700px) {
  #recent-articles {
    grid-template-columns: 1fr;
  }
}

.article-desc {
  margin: 0.25rem 0 0.4rem;
  font-size: 0.85rem;
  line-height: 1.35;
  color: #555;
}
.article-meta {
  padding-bottom: 0.5rem;
}

#rightSidebar .sidebar-article-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}

#rightSidebar .sidebar-article-list li {
  margin: 0 0 0.5rem;
}

#rightSidebar .sidebar-article-list a {
  display: block;
  text-decoration: none;
  color: inherit;
}

#rightSidebar .sidebar-title {
  display: block;
  font-size: 0.9rem;
  line-height: 1.3;
}

#rightSidebar .sidebar-date {
  display: block;
  font-size: 0.75rem;
  opacity: 0.6;
}

/* Tighten the "About this album" box */
.sidebar-about {
  margin-bottom: 0.5rem;  /* reduce gap below box */
  padding: 0.5rem 0.6rem; /* reduce padding inside box */
}

/* Optional: tighten tips box too */
.sidebar-tips {
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.6rem;
}

/* Section header for articles */
.sidebar-section-header {
  margin: 0.5rem 0 0.4rem;
  font-size: 1rem;
  font-weight: 600;
  border-bottom: 1px solid #ddd; /* subtle divider */
  padding-bottom: 0.25rem;
}

/* Optional: remove extra margin/padding for all sidebar boxes */
#rightSidebar .box {
  padding: 0.5rem 0.6rem;
  margin-bottom: 0.5rem;
}
.sidebar-article-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

.sidebar-card {
  display: block;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: #fff;
}

.sidebar-thumb img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

/* Target the main header and paragraph */
#content h1 {
  margin: 0 0; /* Reduce top/bottom space */
  font-size: 2rem; /* Optional: adjust size */
}

#content p {
  margin: 0.2em 0 1em; /* Less space above, some space below */
  line-height: 1.3;
}

/* Optional: reduce padding of main itself */
#content {
  padding-top: 1em;
  padding-bottom: 1em;
}
@media (max-width: 768px) {
  #recent-articles > *:nth-child(n+5) {
    display: none;
  }
}
#saint-audio {
  width: 240px;
  max-width: 100%;
  display: block;
  margin: 0 auto;
}
audio::-webkit-media-controls-panel {
  font-size: 4px;
}

/* Entire article column */
#article-container {
  max-width: 850px;
  margin: 0px auto;
  padding: 0 16px;
  background:white;
  border-radius:8px;
}
/* =========  ARTICLE PAGE (container-as-card)  ========= */

/* Keep your site background visible; center a narrow white reading column */
#article-container {
  background: #fff;
  color: #111;
  margin-left: auto;
  margin-right: auto;
            /* center it */
  padding: 36px;                 /* comfortable inner spacing */
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  line-height: 1.65;
  font-size: 1.05rem;
}

/* Title + meta */
#article-container h1 {
  font-size: 2.2rem;
  line-height: 1.25;
  margin: 0 0 0.75rem;
}
#article-container .article-meta {
  margin: 0 0 1.25rem;
  color: #6b7280;                /* neutral-500 */
  font-size: 0.95rem;
}

/* Body content */
#article-container .article-content p {
  margin: 1rem 0;
}
#article-container .article-content img,
#article-container .article-content video,
#article-container .article-content iframe {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  margin: auto;
}
#article-container .article-content figure {
  margin:  0;
  text-align: center;
}
#article-container .article-content figcaption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #6b7280;
}

/* Related articles (below the white box) */
#related-articles {
  max-width: 950px;              /* a bit wider than the article container */
  margin: 16px auto 48px;
  padding: 0 16px;
}
#related-articles h2 {
  font-size: 1.25rem;
  margin: 0 0 0.75rem;
}
#related-articles .related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
#related-articles .related-card {
  display: block;
  background: #fff;
  color: inherit;
  text-decoration: none;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
#related-articles .related-card .thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}
#related-articles .related-card .body {
  padding: 10px 12px;
}
#related-articles .related-card .title {
  font-size: 1rem;
  margin: 0 0 0.25rem;
}
#related-articles .related-card time {
  font-size: 0.8rem;
  color: #6b7280;
}

@media (max-width: 820px) {
  #article-container {
    padding: 24px;
    margin: 28px auto;
  }
  #related-articles .related-grid {
    grid-template-columns: 1fr;
  }
}

/* If you have a fixed background canvas, keep it behind content */
#bgCanvas { position: fixed; inset: 0; z-index: 0; }
#container, #article-container, #related-articles { position: relative; z-index: 1; }

/* Tables */
#article-container table.md-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background: #fff;
}
#article-container .md-table th,
#article-container .md-table td {
  border: 1px solid #e5e7eb;
  padding: 8px 10px;
  vertical-align: top;
}
#article-container .md-table thead th {
  background: #f8fafc;
  font-weight: 600;
}

/* Footnotes */
#article-container .footnotes {
  margin-top: 2rem;
  border-top: 1px solid #e5e7eb;
  padding-top: 1rem;
}
#article-container .footnotes ol {
  padding-left: 1.25rem;
}
#article-container .footnote-ref a,
#article-container .footnote-backref {
  text-decoration: none;
}

/* Responsive YouTube wrapper */
#article-container .yt-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  margin: 1rem 0;
}
#article-container .yt-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Related grid */
#related-articles {
  max-width: 950px;
  margin: 16px auto 48px;
  padding: 0 16px;
}
#related-articles h2 {
  font-size: 1.25rem;
  margin: 0 0 0.75rem;
}
#related-articles .related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
#related-articles .related-card {
  display: block;
  background: #fff;
  color: inherit;
  text-decoration: none;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
#related-articles .related-card .thumb {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}
#related-articles .related-card .body {
  padding: 10px 12px;
}
#related-articles .related-card .title {
  font-size: 1rem;
  margin: 0 0 0.25rem;
}
#related-articles .related-card time {
  font-size: 0.8rem;
  color: #6b7280;
}

@media (max-width: 820px) {
  #related-articles .related-grid {
    grid-template-columns: 1fr;
  }
}

/* Optional: nicer code + quotes */
#article-container pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px 14px;
  border-radius: 8px;
  overflow-x: auto;
}
#article-container blockquote {
  border-left: 4px solid #e5e7eb;
  background: #fafafa;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin: 1.2rem 0;
}
/* Block images */
#article-container .img-figure {
  margin: 1rem 0;
  display: block;
}
#article-container .img-figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
#article-container .img-figure figcaption {
  font-size: 0.9rem;
  color: #6b7280;
  margin-top: 0.4rem;
}

/* Alignment for block images */
#article-container .img-figure.align-left {
  float: left;
  margin: 0rem 1rem 0rem 0;
  max-width: min(50%, 420px);
}
#article-container .img-figure.align-right {
  float: right;
  margin: 0.25rem 0 1rem 1rem;
  max-width: min(50%, 420px);
}
#article-container .img-figure.align-center {
  margin: 1rem auto;
  text-align: center;
}

/* Inline images (inside paragraphs) */
#article-container img.img-inline {
  vertical-align: text-bottom;
  max-height: 1.4em;           /* Inline-sized by default */
  border-radius: 4px;
  margin: 0 0.2em;
}
#article-container img.img-inline.align-left { float: none; }
#article-container img.img-inline.align-right { float: none; }
#article-container img.img-inline.align-center {
  display: inline-block;
}

/* Clear floats before/after sections to prevent wrap issues */
#article-container .article-content::after {
  content: "";
  display: table;
  clear: both;
}

/* Responsive: remove floats on small screens */
@media (max-width: 820px) {
  #article-container .img-figure.align-left,
  #article-container .img-figure.align-right {
    float: none;
    margin: 0.75rem 0;
    max-width: 100%;
  }
}

/* YouTube responsive wrapper */
#article-container .yt-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  margin: 1rem 0;
}
#article-container .yt-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Tables */
#article-container table.md-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}
#article-container .md-table th,
#article-container .md-table td {
  border: 1px solid #e5e7eb;
  padding: 8px 10px;
  vertical-align: top;
}
#article-container .md-table thead th {
  background: #f8fafc;
  font-weight: 600;
}

/* Footnotes */
#article-container .footnotes {
  margin-top: 2rem;
  border-top: 1px solid #e5e7eb;
  padding-top: 1rem;
}
#article-container .footnotes ol {
  padding-left: 1.25rem;
}
#article-container .footnote-ref a,
#article-container .footnote-backref {
  text-decoration: none;
}