/* =============================================================
   Shannon J. Linning — main site styles
   Editorial academic aesthetic in deep navy with gold accents.
   ============================================================= */

:root {
  --navy-900: #06152e;
  --navy-800: #0b1e3f;
  --navy-700: #122a55;
  --navy-600: #1d3c75;
  --navy-500: #2c4f93;
  --navy-300: #6b85b8;

  --gold:     #c9a55a;
  --gold-dim: #a3853e;

  --paper:    #f7f5ef;
  --ivory:    #fbfaf6;
  --ink:      #0b1424;
  --muted:    #5a6a82;
  --rule:     rgba(11,30,63,0.12);

  --serif:    'Cormorant Garamond', 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans:     'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono:     'JetBrains Mono', ui-monospace, Menlo, monospace;

  --maxw: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  font-size: 17px;
}

a { color: var(--navy-600); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color .2s ease, color .2s ease; }
a:hover { color: var(--t-heading, var(--navy-800)); border-bottom-color: var(--t-accent, var(--gold)); }

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

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; color: var(--navy-800); line-height: 1.15; margin: 0 0 0.5em; }
h2 { font-size: clamp(2rem, 4vw, 2.85rem); letter-spacing: -0.01em; }
h3 { font-size: 1.35rem; }

p { margin: 0 0 1em; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ----- Top nav ----------------------------------------------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(6, 21, 46, 0.78);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: background .25s ease;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
}
.nav-brand {
  color: #fff;
  font-family: var(--serif);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  border: 0;
}
.nav-brand .accent { color: var(--gold); }
.nav-links { display: flex; gap: 22px; }
.nav-links a {
  color: #cdd6e6;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 0;
  padding: 4px 0;
  position: relative;
}
.nav-links a:hover { color: #fff; }
.nav-links a::after {
  content: ''; position: absolute; left: 0; bottom: -4px; width: 0; height: 2px; background: var(--gold);
  transition: width .25s ease;
}
.nav-links a:hover::after { width: 100%; }
.nav-toggle { display: none; background: transparent; border: 1px solid rgba(255,255,255,0.3); color: #fff; padding: 8px 12px; border-radius: 3px; cursor: pointer; font-size: 14px; }

/* ----- Hero -------------------------------------------------- */
.hero {
  min-height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(6,21,46,0.92) 0%, rgba(11,30,63,0.86) 50%, rgba(18,42,85,0.88) 100%),
    radial-gradient(circle at 80% 20%, rgba(201,165,90,0.25), transparent 50%),
    var(--navy-900);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 80px),
    repeating-linear-gradient(0deg,  rgba(255,255,255,0.025) 0 1px, transparent 1px 80px);
  pointer-events: none;
}
.hero::after {
  /* Subtle noise/grain */
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 3px 3px;
  opacity: 0.4;
  pointer-events: none;
}
.hero-bg-photo {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.18;
  mix-blend-mode: luminosity;
}
.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  align-items: center;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 120px 24px 80px;
}
.hero-eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  border-bottom: 1px solid var(--gold);
  padding-bottom: 6px;
  margin-bottom: 24px;
}
.hero h1 {
  color: #fff;
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  margin-bottom: 18px;
}
.hero h1 .role {
  display: block;
  font-size: 0.45em;
  font-family: var(--sans);
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #b8c4d9;
  margin-top: 18px;
}
.hero-lead {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-style: italic;
  color: #d8e0ee;
  max-width: 520px;
}
.hero-cta { margin-top: 32px; display: flex; gap: 14px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 14px 24px;
  font-family: var(--sans);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .25s ease;
  text-decoration: none;
}
.btn-gold { background: var(--gold); color: var(--navy-900); border-color: var(--gold); }
.btn-gold:hover { background: transparent; color: var(--gold); border-color: var(--gold); }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.4); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

.hero-portrait {
  position: relative;
  aspect-ratio: 3 / 4;
  background: linear-gradient(160deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid rgba(201,165,90,0.4);
  background-size: cover;
  background-position: center;
}
.hero-portrait::before {
  content: '';
  position: absolute; inset: -14px -14px auto auto;
  width: 110px; height: 110px;
  border: 1px solid var(--gold);
  z-index: -1;
}
.hero-portrait::after {
  content: '';
  position: absolute; inset: auto auto -14px -14px;
  width: 110px; height: 110px;
  border: 1px solid var(--gold);
  z-index: -1;
}
.hero-portrait .placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.5);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  text-align: center;
  padding: 20px;
}

.scroll-cue {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.5);
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  z-index: 2;
}
.scroll-cue::after {
  content: ''; display: block; width: 1px; height: 32px; background: rgba(255,255,255,0.4); margin: 10px auto 0;
  animation: scroll-pulse 2s ease-in-out infinite;
}
@keyframes scroll-pulse {
  0%, 100% { transform: scaleY(1); opacity: 0.4; }
  50%      { transform: scaleY(0.6); opacity: 1; }
}

/* ----- Sections ---------------------------------------------- */
section {
  padding: 110px 0;
  position: relative;
}
section + section { border-top: 1px solid var(--rule); }

.section-eyebrow {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  color: var(--gold-dim);
  margin-bottom: 14px;
}
.section-title {
  position: relative;
  padding-bottom: 18px;
  margin-bottom: 40px;
}
.section-title::after {
  content: ''; position: absolute; left: 0; bottom: 0;
  width: 60px; height: 2px; background: var(--gold);
}

/* ----- Bio --------------------------------------------------- */
.bio-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 60px;
  align-items: start;
}
.bio-image {
  position: sticky; top: 100px;
  aspect-ratio: 4/5;
  background: linear-gradient(180deg, #d8d4c7, #b3aea0);
  background-size: cover; background-position: center;
  border: 1px solid var(--rule);
}
.bio-image .placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-style: italic;
  color: var(--t-muted, #6c6859);
  text-align: center; padding: 24px;
}
.bio-text { font-size: 1.08rem; }
.bio-text p { color: var(--t-fg, #2a3a55); }
.bio-text p:first-of-type::first-letter {
  font-family: var(--serif);
  font-size: 3.6rem;
  float: left;
  line-height: 0.9;
  padding: 6px 12px 0 0;
  color: var(--t-accent, var(--gold-dim));
}

/* ----- Gallery strip ---------------------------------------- */
.gallery {
  padding: 80px 0;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 30px;
}
.gallery-item {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: color-mix(in srgb, currentColor 10%, transparent);
  border: 1px solid color-mix(in srgb, currentColor 12%, transparent);
}
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s ease;
  filter: brightness(0.9);
}
.gallery-item:hover img { transform: scale(1.05); filter: brightness(1); }
.gallery-item .placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.5);
  font-family: var(--serif); font-style: italic;
  text-align: center; padding: 20px;
}
.gallery-item .caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 16px;
  font-size: 0.85rem;
  color: #fff;
  background: linear-gradient(180deg, transparent, rgba(6,21,46,0.85));
  letter-spacing: 0.05em;
}
.gallery-tag {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}

/* ----- Article / book lists --------------------------------- */
.items-list { list-style: none; padding: 0; margin: 0; }
.items-list li {
  padding: 26px 0;
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
  align-items: baseline;
}
.items-list li:last-child { border-bottom: 0; }
.items-list .year {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--t-accent, var(--gold-dim));
  font-weight: 600;
}
.items-list .title {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--t-heading, var(--navy-800));
  margin: 0 0 6px;
  line-height: 1.3;
}
.items-list .meta {
  color: var(--t-muted, var(--muted));
  font-size: 0.95rem;
  font-style: italic;
}
.items-list .summary {
  margin-top: 8px;
  color: var(--t-fg, #2a3a55);
  font-size: 0.98rem;
}
.items-list .link {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.82rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--t-accent, var(--navy-600));
  border-bottom: 1px solid var(--t-accent, var(--gold));
}

/* ----- Books grid ------------------------------------------- */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 36px;
}
.book-card {
  display: flex;
  flex-direction: column;
}
.book-cover {
  aspect-ratio: 2/3;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-800));
  background-size: cover; background-position: center;
  border: 1px solid var(--rule);
  box-shadow: 0 16px 40px -20px rgba(11,30,63,0.4);
  margin-bottom: 18px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.5);
  font-family: var(--serif); font-style: italic; padding: 20px; text-align: center;
}
.book-card h3 {
  font-size: 1.2rem;
  margin-bottom: 6px;
}
.book-card .meta { color: var(--t-muted, var(--muted)); font-size: 0.9rem; font-style: italic; margin-bottom: 8px; }
.book-card .desc { font-size: 0.95rem; color: var(--t-fg, #2a3a55); }
.book-status {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 4px 8px;
  margin-bottom: 10px;
  background: var(--navy-800); color: var(--gold);
}
.book-status.incoming { background: var(--gold); color: var(--navy-900); }

/* ----- Blog -------------------------------------------------- */
.blog-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 36px;
}
.blog-card {
  border: 1px solid var(--rule);
  background: #fff;
  padding: 28px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.blog-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -20px rgba(11,30,63,0.25); }
.blog-card h3 { font-size: 1.2rem; }
.blog-card .date { font-size: 0.8rem; color: var(--gold-dim); letter-spacing: 0.15em; text-transform: uppercase; }
.blog-card .excerpt { color: #2a3a55; }

/* ----- Contact ---------------------------------------------- */
.contact-grid {
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 60px; align-items: start;
}
.contact-info p { color: var(--t-fg, #c4cee0); }
.contact-info a {
  color: var(--t-accent, var(--gold));
  border-bottom-color: color-mix(in srgb, var(--t-accent, var(--gold)) 40%, transparent);
}
.contact-info a:hover {
  color: var(--t-heading, #fff);
  border-bottom-color: currentColor;
}
.contact-form { display: grid; gap: 16px; }
.contact-form label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--t-muted, #b8c4d9);
  margin-bottom: 6px;
}
.contact-form input, .contact-form textarea {
  width: 100%;
  background: color-mix(in srgb, currentColor 6%, transparent);
  border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
  color: var(--t-fg, #fff);
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 1rem;
  border-radius: 0;
  transition: border-color .2s ease, background .2s ease;
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: none;
  border-color: var(--t-accent, var(--gold));
  background: color-mix(in srgb, currentColor 12%, transparent);
}
.contact-form textarea { min-height: 160px; resize: vertical; }
.contact-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.flash {
  padding: 14px 18px; margin-bottom: 20px;
  border-left: 3px solid var(--t-accent, var(--gold));
  background: color-mix(in srgb, currentColor 8%, transparent);
  color: var(--t-fg, #fff);
}
.flash.error { border-color: #e57373; }

/* ----- Footer ------------------------------------------------ */
footer {
  background: var(--navy-900);
  color: #8995ad;
  padding: 30px 0;
  font-size: 0.85rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
footer .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
footer a { color: #b8c4d9; border: 0; }
footer a:hover { color: var(--gold); }

/* ----- Reveal on scroll ------------------------------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ----- Responsive ------------------------------------------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; padding-top: 110px; padding-bottom: 60px; }
  .hero-portrait { max-width: 360px; margin: 0 auto; }
  .bio-grid { grid-template-columns: 1fr; gap: 30px; }
  .bio-image { position: static; max-width: 320px; }
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  section { padding: 80px 0; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; gap: 14px;
    position: absolute; top: 100%; left: 0; right: 0;
    background: rgba(6,21,46,0.95);
    padding: 20px 24px;
    border-top: 1px solid rgba(255,255,255,0.06);
  }
  .nav-toggle { display: inline-block; }
  .gallery-grid { grid-template-columns: 1fr; }
  .items-list li { grid-template-columns: 60px 1fr; gap: 14px; }
  .items-list .year { font-size: 1.1rem; }
  .contact-form .row { grid-template-columns: 1fr; }
  section { padding: 60px 0; }
  .hero h1 { font-size: 2.4rem; }
}

/* =============================================================
   Custom sections + alternative display types
   ============================================================= */

/* ---- Custom section base ---- */
.custom-section { /* inherits default section padding */ }
.custom-section-intro {
  max-width: 760px;
  margin: 0 auto 36px;
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.7;
  color: var(--t-fg, var(--ink));
}
.custom-section-intro p { margin: 0 0 1em 0; }

/* ---- Links grid (for custom sections) ---- */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}
.link-card {
  background: #fff;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--gold);
  padding: 20px 22px;
  text-decoration: none;
  color: var(--ink);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  display: block;
}
.link-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(11,30,63,0.08);
  border-left-color: var(--navy-800);
}
.link-card-title {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--navy-800);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.link-arrow {
  color: var(--gold);
  font-size: 1.4rem;
  font-weight: 400;
  transition: transform .2s ease;
}
.link-card:hover .link-arrow { transform: translateX(4px); }
.link-card-desc {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ---- Article cards grid (display=cards) ---- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.article-card {
  background: #fff;
  border: 1px solid var(--rule);
  padding: 28px 26px;
  position: relative;
  transition: transform .2s ease, box-shadow .2s ease;
}
.article-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(11,30,63,0.1);
}
.article-card .year-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--gold-dim);
  background: rgba(201,165,90,0.1);
  padding: 4px 10px;
  border-radius: 2px;
  margin-bottom: 14px;
}
.article-card h3 {
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.3;
  color: var(--navy-800);
  margin: 0 0 10px 0;
  font-weight: 600;
}
.article-card .meta {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 12px;
  line-height: 1.5;
}
.article-card .summary {
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.6;
  margin: 12px 0 16px 0;
}

/* ---- Carousel (display=carousel) ---- */
.carousel-wrap {
  position: relative;
  margin: 0 -16px; /* let items breathe at viewport edges */
}
.carousel {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 12px 16px 24px 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--gold) transparent;
}
.carousel::-webkit-scrollbar { height: 8px; }
.carousel::-webkit-scrollbar-track { background: transparent; }
.carousel::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 4px;
}
.carousel-item {
  flex: 0 0 320px;
  scroll-snap-align: start;
}
.article-carousel .carousel-item { flex-basis: 340px; }
.books-carousel  .carousel-item { flex-basis: 220px; }

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--navy-800);
  color: #fff;
  border: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.5rem;
  font-family: var(--serif);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  box-shadow: 0 6px 20px rgba(11,30,63,0.25);
  transition: background .2s ease, transform .2s ease;
}
.carousel-nav:hover { background: var(--navy-700); transform: translateY(-50%) scale(1.05); }
.carousel-nav.prev { left: -8px; }
.carousel-nav.next { right: -8px; }
.carousel-nav:active { transform: translateY(-50%) scale(0.95); }

/* Brief visual pulse when the carousel wraps from end → start (or back).
   Lets the eye notice the loop happened. */
.carousel.did-loop {
  animation: carouselLoopPulse 0.4s ease-out;
}
@keyframes carouselLoopPulse {
  0%   { box-shadow: inset 0 0 0 0 rgba(201,165,90,0); }
  40%  { box-shadow: inset 0 0 0 3px rgba(201,165,90,0.35); }
  100% { box-shadow: inset 0 0 0 0 rgba(201,165,90,0); }
}

/* ---- Books grid (compact / cover-focused) ---- */
.books-grid-compact {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 32px 24px;
}
.book-tile { text-align: left; }
.book-cover-tile {
  width: 100%;
  aspect-ratio: 2 / 3;
  background-color: var(--navy-800);
  background-size: cover;
  background-position: center;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  position: relative;
  box-shadow: 0 8px 24px rgba(11,30,63,0.15), 0 2px 6px rgba(11,30,63,0.1);
  transition: transform .25s ease, box-shadow .25s ease;
}
.book-tile:hover .book-cover-tile {
  transform: translateY(-4px);
  box-shadow: 0 14px 36px rgba(11,30,63,0.22), 0 4px 10px rgba(11,30,63,0.12);
}
.book-cover-tile .cover-fallback {
  color: rgba(255,255,255,0.5);
  font-family: var(--serif);
  font-size: 0.9rem;
  text-align: center;
  padding: 10px;
  font-style: italic;
}
.book-tile h4 {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--t-heading, var(--navy-800));
  margin: 0 0 4px 0;
  line-height: 1.3;
}
.book-tile .meta-sm {
  font-size: 0.82rem;
  color: var(--t-muted, var(--muted));
  margin-bottom: 8px;
}
.book-tile .book-status {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--t-accent, var(--gold-dim));
  margin-bottom: 6px;
}
.book-tile .book-status.incoming {
  color: #b85a1a;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .cards-grid { grid-template-columns: 1fr; }
  .links-grid { grid-template-columns: 1fr; }
  .books-grid-compact { grid-template-columns: repeat(2, 1fr); }
  .carousel-nav.prev { left: 0; }
  .carousel-nav.next { right: 0; }
}
@media (max-width: 640px) {
  .books-grid-compact { grid-template-columns: repeat(2, 1fr); gap: 24px 16px; }
  .carousel-item { flex-basis: 80%; }
  .books-carousel .carousel-item { flex-basis: 55%; }
  .carousel-nav { display: none; } /* swipe on mobile */
}

/* =============================================================
   Themes (per-section) — colours come from CSS variables set
   per .theme-{slug} class by a dynamic <style> block in <head>.
   Uses :where() to keep specificity low so card-internal rules
   (.article-card h3, .blog-card .excerpt, etc.) win and keep
   their dark text on their own white card backgrounds.
   ============================================================= */
:where(.themed) {
  background: var(--t-bg, var(--paper));
  color:      var(--t-fg, var(--ink));
}
:where(.themed) h2,
:where(.themed) h3,
:where(.themed) h4,
:where(.themed) .section-title {
  color: var(--t-heading, var(--navy-800));
}
:where(.themed) .section-title::after {
  background: var(--t-accent, var(--gold));
}
:where(.themed) .section-eyebrow {
  color: var(--t-accent, var(--gold-dim));
}
:where(.themed) a {
  color: var(--t-accent, var(--gold));
}
:where(.themed) .muted,
:where(.themed) .role,
:where(.themed) .meta {
  color: var(--t-muted, var(--muted));
}

/* Cards inside themed sections — these have their OWN white bg,
   so their internal text must stay dark regardless of theme.
   Made explicit so they always win even on heavy themes. */
.themed .article-card h3,
.themed .blog-card h3,
.themed .link-card .link-card-title { color: var(--navy-800); }
.themed .article-card .meta,
.themed .article-card .summary,
.themed .article-card .year-tag,
.themed .blog-card .excerpt,
.themed .blog-card .date,
.themed .link-card .link-card-desc { /* keep their own hardcoded colors from card rules */ }
.themed .article-card a,
.themed .blog-card a,
.themed .link-card { color: inherit; }
/* …but the explicit accent on "Read article →" inside a card */
.themed .article-card a.link { color: var(--gold-dim); }

/* =============================================================
   layout-grid — section-level text/image split.

   Ratio NAMING CONVENTION (image : text).  "1:2" → image takes
   1 unit of width, text takes 2 → image is the SMALLER block.
   "2:1" → image is the LARGER block.  The proportions are
   preserved no matter which side the image is on:

   ratio-1-2 + img-side-left   →  [small image | large text]
   ratio-1-2 + img-side-right  →  [large text | small image]   ← columns swap
   ============================================================= */
.layout-grid {
  display: grid;
  gap: 50px;
  align-items: start;
}

/* Equal split — symmetric, same regardless of side */
.layout-grid.ratio-1-1 { grid-template-columns: 1fr 1fr; }

/* Image on the LEFT — first column is the image, so its width matches
   the first half of the ratio name. */
.layout-grid.img-side-left.ratio-1-2 { grid-template-columns: 1fr 2fr; } /* small image */
.layout-grid.img-side-left.ratio-2-1 { grid-template-columns: 2fr 1fr; } /* large image */
.layout-grid.img-side-left.ratio-1-3 { grid-template-columns: 1fr 3fr; } /* tiny image  */
.layout-grid.img-side-left.ratio-3-1 { grid-template-columns: 3fr 1fr; } /* huge image  */

/* Image on the RIGHT — first column is the text, so the columns
   are FLIPPED compared to img-side-left, but the image's proportion
   relative to the text is identical. */
.layout-grid.img-side-right.ratio-1-2 { grid-template-columns: 2fr 1fr; } /* small image (still small) */
.layout-grid.img-side-right.ratio-2-1 { grid-template-columns: 1fr 2fr; } /* large image (still large) */
.layout-grid.img-side-right.ratio-1-3 { grid-template-columns: 3fr 1fr; } /* tiny image  (still tiny)  */
.layout-grid.img-side-right.ratio-3-1 { grid-template-columns: 1fr 3fr; } /* huge image  (still huge)  */

.layout-grid.ratio-text_only,
.layout-grid.ratio-image_only { grid-template-columns: 1fr; }

/* DOM order swap so the image visually sits on the chosen side */
.layout-grid.img-side-left  .layout-image-block { order: 1; }
.layout-grid.img-side-left  .layout-text-block  { order: 2; }
.layout-grid.img-side-right .layout-text-block  { order: 1; }
.layout-grid.img-side-right .layout-image-block { order: 2; }

/* Top / bottom — single column, image position via order */
.layout-grid.img-side-top,
.layout-grid.img-side-bottom {
  grid-template-columns: 1fr !important;
}
.layout-grid.img-side-top    .layout-image-block { order: 1; }
.layout-grid.img-side-top    .layout-text-block  { order: 2; }
.layout-grid.img-side-bottom .layout-text-block  { order: 1; }
.layout-grid.img-side-bottom .layout-image-block { order: 2; }

.layout-text-block  { min-width: 0; }
.layout-image-block { min-width: 0; }

/* =============================================================
   Image blocks — single / grid / carousel / slider
   ============================================================= */
.image-single figure {
  margin: 0;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(11,30,63,0.16);
}
.image-single img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.image-single figcaption,
.image-grid figcaption,
.image-carousel figcaption,
.slider-slide figcaption {
  font-size: .85rem;
  color: var(--t-muted, var(--muted));
  padding: 8px 4px 0;
  font-style: italic;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.image-grid figure { margin: 0; }
.image-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  border-radius: 3px;
  box-shadow: 0 6px 18px rgba(11,30,63,0.1);
}

.image-carousel .carousel-item { flex-basis: 320px; }
.image-carousel figure { margin: 0; }
.image-carousel img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  border-radius: 3px;
  box-shadow: 0 8px 22px rgba(11,30,63,0.12);
}

/* Slider — one slide at a time with fade */
.image-slider {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
}
.image-slider .slider-track {
  position: relative;
  aspect-ratio: 4 / 3;
  background: rgba(11,30,63,0.05);
}
.image-slider .slider-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity .5s ease;
  pointer-events: none;
}
.image-slider .slider-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}
.image-slider img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.image-slider figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 14px 20px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.6) 100%);
  color: #fff;
  font-style: italic;
  font-size: .9rem;
}
.image-slider .slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(11,30,63,0.6);
  color: #fff;
  border: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease;
}
.image-slider .slider-nav:hover { background: var(--navy-800); }
.image-slider .slider-nav.prev { left: 12px; }
.image-slider .slider-nav.next { right: 12px; }
.image-slider .slider-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 5;
}
.image-slider .slider-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.45);
  border: 0;
  cursor: pointer;
  transition: background .2s ease;
  padding: 0;
}
.image-slider .slider-dot.is-active {
  background: var(--gold);
}

/* =============================================================
   Speed tweaks
   ============================================================= */
.reveal { transition: opacity .35s ease, transform .35s ease; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}
section { content-visibility: auto; contain-intrinsic-size: 800px; }
.hero { content-visibility: visible; } /* hero always painted */

/* =============================================================
   Responsive
   ============================================================= */
@media (max-width: 900px) {
  /* Collapse every ratio + side combination to a single column on mobile.
     Uses !important to defeat the more-specific desktop selectors
     (.img-side-left.ratio-1-2 etc.) without spelling each one out. */
  .layout-grid {
    grid-template-columns: 1fr !important;
    gap: 30px;
  }
  .image-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .image-grid { grid-template-columns: 1fr; }
  .image-slider .slider-nav { width: 34px; height: 34px; }
}

/* =============================================================
   Admin layout page extras
   ============================================================= */
.layout-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.layout-fieldset {
  border: 1px solid #e7e2d6;
  border-radius: 4px;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
}
.layout-fieldset legend {
  font-size: .75rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: #666;
  padding: 0 .5rem;
}

/* =============================================================
   Clickable images (when picture has a link_url)
   ============================================================= */
.img-link {
  display: block;
  position: relative;
  cursor: pointer;
  overflow: hidden;
}
.img-link img {
  transition: transform .35s ease, filter .35s ease;
}
.img-link:hover img {
  transform: scale(1.03);
  filter: brightness(1.05);
}
.img-link::after {
  content: "↗";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11,30,63,0.65);
  color: var(--gold);
  border-radius: 50%;
  font-size: 1rem;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
.img-link:hover::after {
  opacity: 1;
  transform: translateY(0);
}

/* =============================================================
   Content sizing (per-section)
   ============================================================= */

/* ---- Books grid (compact tiles) ---- */
.size-small  .books-grid-compact { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 24px 16px; }
.size-medium .books-grid-compact { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 32px 24px; }
.size-large  .books-grid-compact { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 40px 28px; }

/* ---- Books grid (detailed/list) ---- */
.size-small  .books-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.size-medium .books-grid { /* uses defaults */ }
.size-large  .books-grid { grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 48px; }

/* ---- Books carousel item width ---- */
.size-small  .books-carousel .carousel-item { flex-basis: 160px; }
.size-medium .books-carousel .carousel-item { flex-basis: 220px; }
.size-large  .books-carousel .carousel-item { flex-basis: 300px; }

/* ---- Article cards grid ---- */
.size-small  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.size-medium .cards-grid { /* uses defaults */ }
.size-large  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 32px; }

/* ---- Article carousel item width ---- */
.size-small  .article-carousel .carousel-item { flex-basis: 260px; }
.size-medium .article-carousel .carousel-item { flex-basis: 340px; }
.size-large  .article-carousel .carousel-item { flex-basis: 440px; }

/* ---- Article list (compact list) — adjust font scale ---- */
.size-small  .items-list li { padding: 18px 0; gap: 20px; }
.size-small  .items-list .title { font-size: 1.1rem; }
.size-small  .items-list .meta { font-size: 0.82rem; }
.size-large  .items-list li { padding: 36px 0; }
.size-large  .items-list .title { font-size: 1.55rem; }

/* ---- Blog cards ---- */
.size-small  .blog-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.size-large  .blog-grid { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 36px; }

/* =============================================================
   Theme-safe button overrides
   ============================================================= */

/* Gold button: keep solid contrast on hover instead of going
   transparent (which made text disappear over dark themes). */
.btn-gold {
  background: var(--gold);
  color: var(--navy-900);
  border-color: var(--gold);
}
.btn-gold:hover {
  background: var(--gold-dim);
  color: var(--navy-900);
  border-color: var(--gold-dim);
}

/* Ghost button: pick its colour from the theme so it stays
   readable across light AND dark themes. */
.btn-ghost {
  background: transparent;
  color: var(--t-fg, #ffffff);
  border-color: currentColor;
  opacity: 0.85;
}
.btn-ghost:hover {
  color: var(--t-accent, var(--gold));
  border-color: var(--t-accent, var(--gold));
  opacity: 1;
}

/* Hero always keeps its dramatic dark background and white text,
   regardless of theme — the theme system applies its accent colours
   to inner text but not the hero's background gradient. */
.hero.themed {
  background:
    linear-gradient(135deg, rgba(6,21,46,0.92) 0%, rgba(11,30,63,0.86) 50%, rgba(18,42,85,0.88) 100%),
    radial-gradient(circle at 80% 20%, rgba(201,165,90,0.25), transparent 50%),
    var(--navy-900);
  color: #ffffff;
}
.hero.themed .btn-ghost {
  color: #ffffff;
  border-color: rgba(255,255,255,0.4);
}
.hero.themed .btn-ghost:hover {
  color: var(--gold);
  border-color: var(--gold);
}

/* =============================================================
   Standalone pages — lock screen, page body, view-all links
   ============================================================= */
.lock-screen {
  text-align: center;
  padding: 80px 0;
  max-width: 480px;
  margin: 0 auto;
}
.lock-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.7;
}
.lock-form {
  margin-top: 30px;
  text-align: left;
  display: inline-block;
  width: 100%;
  max-width: 360px;
}
.lock-form .field { margin-bottom: 16px; }
.lock-form label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: var(--t-muted, var(--muted));
}
.lock-form input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  background: color-mix(in srgb, currentColor 6%, transparent);
  border: 1px solid color-mix(in srgb, currentColor 25%, transparent);
  color: var(--t-fg, var(--ink));
  font-family: var(--sans);
  font-size: 1rem;
  border-radius: 0;
  box-sizing: border-box;
}
.lock-form input[type="password"]:focus {
  outline: none;
  border-color: var(--t-accent, var(--gold));
}
.lock-form button { width: 100%; margin-top: 8px; }
.lock-error {
  color: #b94242;
  font-size: 0.88rem;
  margin: 10px 0;
}

/* Page body content */
.page-content {
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.7;
}
.page-content h2 {
  font-size: 1.6rem;
  margin: 1.6em 0 .6em;
  color: var(--t-heading, var(--navy-800));
}
.page-content h3 {
  font-size: 1.3rem;
  margin: 1.4em 0 .5em;
  color: var(--t-heading, var(--navy-800));
}
.page-content h4 {
  font-size: 1.1rem;
  margin: 1.2em 0 .4em;
  color: var(--t-heading, var(--navy-800));
}
.page-content p { margin: 0 0 1em; }
.page-content ul {
  padding-left: 1.5em;
  margin: 0 0 1em;
}
.page-content li { margin: 0.3em 0; }
.page-content a {
  color: var(--t-accent, var(--gold));
  border-bottom: 1px solid color-mix(in srgb, currentColor 30%, transparent);
}
.page-content a:hover {
  border-bottom-color: currentColor;
}
.page-content code {
  font-family: var(--mono, monospace);
  font-size: 0.92em;
  background: color-mix(in srgb, currentColor 8%, transparent);
  padding: 1px 6px;
  border-radius: 2px;
}
.page-content hr {
  border: none;
  border-top: 1px solid color-mix(in srgb, currentColor 20%, transparent);
  margin: 2em 0;
}

/* "View all N articles" link at section bottom */
.view-all-link {
  margin-top: 32px;
  text-align: center;
}

/* =============================================================
   Page content — rich HTML from the Quill editor
   ============================================================= */
.page-content img {
  max-width: 100%;
  height: auto;
  margin: 24px 0;
  border-radius: 2px;
  box-shadow: 0 6px 24px rgba(11,30,63,0.08);
}
.page-content figure {
  margin: 24px 0;
}
.page-content figure img { margin: 0; }
.page-content figcaption {
  text-align: center;
  font-size: 0.88rem;
  font-style: italic;
  color: var(--t-muted, var(--muted));
  margin-top: 8px;
}
.page-content blockquote {
  border-left: 3px solid var(--t-accent, var(--gold));
  padding: 4px 20px;
  margin: 24px 0;
  font-style: italic;
  color: var(--t-muted, var(--muted));
}
.page-content pre {
  background: color-mix(in srgb, currentColor 8%, transparent);
  padding: 14px 18px;
  border-radius: 3px;
  overflow-x: auto;
  font-family: var(--mono, monospace);
  font-size: 0.92em;
  line-height: 1.5;
}
.page-content ol { padding-left: 1.6em; margin: 0 0 1em; }
.page-content ol li, .page-content ul li { margin: 0.3em 0; }
.page-content .ql-align-center { text-align: center; }
.page-content .ql-align-right  { text-align: right; }
.page-content .ql-align-justify{ text-align: justify; }
.page-content iframe {
  max-width: 100%;
  margin: 24px 0;
}

/* =============================================================
   Standalone pages (p.php, archive.php) — full-height layout
   so the footer hugs the bottom of the viewport when content
   is short, and a comfortable gap below the fixed nav bar.
   ============================================================= */
body.standalone-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
}
body.standalone-page .standalone-main {
  flex: 1 0 auto;
  padding-top: 130px;   /* clears the fixed nav (≈70px) + ~60px breathing room */
  padding-bottom: 80px; /* generous space before the footer rule */
}
body.standalone-page footer {
  flex-shrink: 0;
  margin-top: auto;
}

@media (max-width: 720px) {
  body.standalone-page .standalone-main {
    padding-top: 110px;
    padding-bottom: 60px;
  }
}
