/* ==========================================================================
   Black Griffin Athenaeum — Enhancement Layer (v2)
   Loaded after style.css. Adds: accessibility, motion design, mobile nav,
   scroll affordances, and signature micro-interactions.
   Everything here degrades gracefully and honours prefers-reduced-motion.
   ========================================================================== */

:root {
  --focus: #e7c878;          /* high-contrast focus ring */
  --gold-bright: #e3c585;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --------------------------------------------------------------------------
   1. ACCESSIBILITY FOUNDATIONS
   -------------------------------------------------------------------------- */

/* Visually-hidden utility (screen-reader only) */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link — appears on keyboard focus */
.skip-link {
  position: fixed;
  top: -120px;
  left: 16px;
  z-index: 1000;
  padding: 12px 20px;
  background: var(--gold);
  color: #090806;
  font-family: var(--sans);
  font-weight: 800;
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: top 220ms var(--ease-out);
}
.skip-link:focus {
  top: 0;
  outline: 3px solid #090806;
  outline-offset: -6px;
}

/* Unified, highly visible focus ring for keyboard users only */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible,
.button:focus-visible,
.wp-element-button:focus-visible,
.woocommerce a.button:focus-visible,
.woocommerce button.button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}
/* Remove the legacy non-visible outline only when focus-visible is supported */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}

/* Restore an underline affordance for in-content links (was relying on colour only) */
.entry-content a:not(.button),
.legend-bio a,
.narrative-text a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: rgba(197, 163, 94, 0.5);
}
.entry-content a:not(.button):hover {
  text-decoration-color: var(--gold);
}

/* Contrast fixes — bump text that previously fell below WCAG AA on dark.
   The brand red (#9e2f2f) is fine for white-on-red buttons but fails as small
   red TEXT on a dark ground (~2.6:1). Use a brighter accent for red text only,
   which clears 4.5:1 on every dark section background while staying on-brand. */
:root { --accent-text: #e2685c; }   /* ~5:1 on #12100d, ~5.6:1 on #090806 */

.eyebrow,
.book-genre,
.author-teaser-card p,
.spotlight-author + * .book-genre { color: var(--accent-text); }
.news-card time { color: var(--accent-text); }

.footer-copyright { color: rgba(245, 239, 226, 0.66); }
.footer-nav-col h2.footer-col-title,
.footer-nav-column h3,
.footer-nav-column .widget-title { color: rgba(245, 239, 226, 0.72); }
.brand-kicker { color: #cbbfa9; }
.book-author { color: #cbbfa9; }

/* Selection colour on-brand */
::selection { background: rgba(197, 163, 94, 0.32); color: #fff; }

/* --------------------------------------------------------------------------
   2. SCROLL PROGRESS BAR (gold meter under the sticky header)
   -------------------------------------------------------------------------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  z-index: 60;
  background: linear-gradient(90deg, var(--red), var(--gold) 60%, var(--gold-bright));
  box-shadow: 0 0 12px rgba(197, 163, 94, 0.6);
  will-change: transform;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   3. MOBILE NAVIGATION (the missing piece — accessible slide-in drawer)
   -------------------------------------------------------------------------- */
.nav-toggle {
  display: none;
  position: relative;
  z-index: 70;
  width: 48px; height: 48px;
  border: 1px solid var(--line);
  background: rgba(245, 239, 226, 0.04);
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
}
.nav-toggle-bars {
  position: relative;
  display: block;
  width: 22px; height: 2px;
  background: var(--ink);
  transition: background 160ms linear;
}
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 22px; height: 2px;
  background: var(--ink);
  transition: transform 240ms var(--ease-out), top 240ms var(--ease-out);
}
.nav-toggle-bars::before { top: -7px; }
.nav-toggle-bars::after  { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after  { top: 0; transform: rotate(-45deg); }

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(5, 4, 3, 0.6);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 280ms var(--ease-out), visibility 280ms;
}
body.nav-open .nav-backdrop { opacity: 1; visibility: visible; }

@media (max-width: 980px) {
  /* Off-canvas drawer is JS-driven; only engage it when JS is available so
     the menu never becomes unreachable without JavaScript. */
  .js .nav-toggle { display: inline-flex; }

  .js .header-inner {
    flex-direction: row !important;
    align-items: center !important;
    padding: 12px 0 !important;
  }

  /* Turn the nav shell into a right-side drawer */
  .js .nav-shell {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(86vw, 360px);
    z-index: 65;
    padding: 96px 28px 40px;
    background: linear-gradient(180deg, #14110d, #0b0a08);
    border-left: 1px solid rgba(197, 163, 94, 0.28);
    box-shadow: -30px 0 70px rgba(0, 0, 0, 0.6);
    transform: translateX(100%);
    transition: transform 360ms var(--ease-out);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  body.nav-open .js .nav-shell,
  .js body.nav-open .nav-shell { transform: translateX(0); }

  .main-nav {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 4px !important;
    font-size: 1.05rem;
    width: 100%;
  }
  .main-nav li { width: 100%; }
  .main-nav a {
    display: block;
    padding: 14px 12px;
    border-bottom: 1px solid rgba(245, 239, 226, 0.08);
    white-space: normal;
  }
  .main-nav a::after { display: none; }
  .main-nav a:hover,
  .main-nav .current-menu-item > a { color: var(--gold); }
  .cart-nav-link { padding: 14px 12px; }
}

/* Lock body scroll when drawer open (set via JS too, this is the visual) */
body.nav-open { overflow: hidden; }

/* --------------------------------------------------------------------------
   4. BACK TO TOP
   -------------------------------------------------------------------------- */
.to-top {
  position: fixed;
  right: clamp(16px, 3vw, 32px);
  bottom: clamp(16px, 3vw, 32px);
  z-index: 50;
  width: 50px; height: 50px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(197, 163, 94, 0.45);
  background: rgba(15, 13, 11, 0.85);
  backdrop-filter: blur(8px);
  color: var(--gold);
  cursor: pointer;
  opacity: 0;
  transform: translateY(16px) scale(0.9);
  visibility: hidden;
  transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-spring), visibility 300ms, background 200ms;
}
.to-top.is-visible { opacity: 1; transform: translateY(0) scale(1); visibility: visible; }
.to-top:hover { background: var(--gold); color: #090806; }
.to-top svg { width: 20px; height: 20px; }

/* --------------------------------------------------------------------------
   5. REVEAL-ON-SCROLL SYSTEM (richer than .fade-up; staggered)
   -------------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
[data-reveal="zoom"]  { transform: scale(0.94); }
[data-reveal="left"]  { transform: translateX(-32px); }
[data-reveal="right"] { transform: translateX(32px); }
[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* Page-load curtain reveal for the hero copy */
.is-loaded .hero-copy-block > * {
  animation: bgaRiseIn 900ms var(--ease-out) both;
}
.is-loaded .hero-copy-block > *:nth-child(1) { animation-delay: 80ms; }
.is-loaded .hero-copy-block > *:nth-child(2) { animation-delay: 180ms; }
.is-loaded .hero-copy-block > *:nth-child(3) { animation-delay: 300ms; }
.is-loaded .hero-copy-block > *:nth-child(4) { animation-delay: 420ms; }
@keyframes bgaRiseIn {
  from { opacity: 0; transform: translateY(26px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   6. SIGNATURE MICRO-INTERACTIONS
   -------------------------------------------------------------------------- */

/* Primary buttons: sweeping gold sheen + lift */
.button,
.wp-element-button,
.woocommerce a.button,
.woocommerce button.button,
.single_add_to_cart_button {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.button::before,
.wp-element-button::before,
.single_add_to_cart_button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.22) 50%, transparent 80%);
  transform: translateX(-120%);
  transition: transform 620ms var(--ease-out);
}
.button:hover::before,
.wp-element-button:hover::before,
.single_add_to_cart_button:hover::before { transform: translateX(120%); }

/* Hero floating covers: cursor-driven parallax tilt (JS sets --px/--py) */
.hero-covers {
  perspective: 1200px;
}
.artifact-card {
  transform: rotate(var(--r))
             translate3d(calc(var(--px, 0) * var(--depth, 6px)), calc(var(--py, 0) * var(--depth, 6px)), 0);
  transition: transform 320ms var(--ease-out), box-shadow 320ms var(--ease-out);
}
.artifact-card:nth-child(1) { --depth: 10px; }
.artifact-card:nth-child(2) { --depth: 18px; }
.artifact-card:nth-child(3) { --depth: 26px; }
.artifact-card:hover {
  transform: rotate(0deg) translate3d(0,0,0) scale(1.04);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.55), 0 0 40px rgba(197, 163, 94, 0.18);
  z-index: 20 !important;
}

/* Book cards: subtle 3D tilt toward cursor (JS-driven) + sheen */
.book-cover-wrap,
.book-card-visual {
  transform-style: preserve-3d;
  transition: transform 260ms var(--ease-out), box-shadow 260ms var(--ease-out);
}
.book-cover-wrap::after,
.book-card-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    220px circle at var(--mx, 50%) var(--my, 0%),
    rgba(255, 255, 255, 0.16), transparent 60%);
  opacity: 0;
  transition: opacity 240ms ease;
  mix-blend-mode: screen;
}
.book-card:hover .book-cover-wrap::after,
.woocommerce ul.products li.product:hover .book-card-visual::after { opacity: 1; }

/* "NEW" / availability ribbon hook (used if JS/markup adds it) */
.book-flag {
  position: absolute;
  top: 10px; left: 10px;
  z-index: 4;
  padding: 4px 10px;
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #090806;
  background: var(--gold);
}

/* Editorial card icon flourish */
.editorial-card { position: relative; overflow: hidden; }
.editorial-card::after {
  content: "";
  position: absolute;
  top: -40%; right: -30%;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(158, 47, 47, 0.18), transparent 70%);
  opacity: 0;
  transition: opacity 300ms ease;
}
.editorial-card:hover::after { opacity: 1; }

/* Animated underline for the brand wordmark on hover */
.brand:hover .brand-name { color: var(--gold-bright); }
.brand-name { transition: color 220ms ease; }

/* Author callout heading promoted h3 -> h2 for correct heading order;
   keep the original visual weight. */
.author-info .author-callout-name {
  font-family: var(--serif);
  font-size: 1.8rem;
  margin: 0 0 10px;
  color: #fff;
  line-height: 1.1;
}

/* Newsletter accessible field + button polish */
.newsletter-form { align-items: stretch; }
.newsletter-form .button { white-space: nowrap; }

/* Nicely styled native focus for the search/qty fields */
.woocommerce input.input-text:focus,
.woocommerce select:focus,
.woocommerce textarea:focus,
.newsletter-form input[type="email"]:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-color: transparent;
}

/* --------------------------------------------------------------------------
   7. THE CANDLE — a warm light pool bound to the cursor that actually *reveals*
   what it passes over (soft-light blend), turning the page into a dim athenaeum
   lit by a single flame. Desktop + fine pointer only.
   -------------------------------------------------------------------------- */
@media (hover: hover) and (pointer: fine) {
  .cursor-glow {
    position: fixed;
    top: 0; left: 0;
    width: 760px; height: 760px;
    border-radius: 50%;
    margin: -380px 0 0 -380px;
    pointer-events: none;
    z-index: 8;
    background: radial-gradient(circle,
      rgba(255, 224, 170, 0.40) 0%,
      rgba(197, 138, 70, 0.18) 32%,
      rgba(158, 47, 47, 0.10) 52%,
      transparent 66%);
    transform: translate3d(var(--cx, -9999px), var(--cy, -9999px), 0);
    transition: opacity 500ms ease;
    will-change: transform;
    mix-blend-mode: soft-light;
  }
}

/* Idle "breathing" hearth-light on the hero so the page feels alive before the
   pointer moves (and on touch devices where the candle never appears). */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(58% 50% at 50% 40%,
    rgba(255, 224, 170, 0.12), rgba(158, 47, 47, 0.06) 46%, transparent 70%);
  mix-blend-mode: soft-light;
}
@media (prefers-reduced-motion: no-preference) {
  .hero::before { animation: bgaHearth 6.5s ease-in-out infinite; }
  @keyframes bgaHearth { 0%, 100% { opacity: 0.65; } 50% { opacity: 1; } }
}

/* Ember field canvas (drifting motes) sits behind hero/section content */
.ember-field {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.hero-grid, .section-inner { position: relative; z-index: 1; }

/* --------------------------------------------------------------------------
   7b. CROSS-DOCUMENT VIEW TRANSITIONS (progressive enhancement)
   Smooth cinematic cross-fade between pages in supporting browsers.
   -------------------------------------------------------------------------- */
@view-transition { navigation: auto; }

::view-transition-old(root) { animation-duration: 320ms; animation-timing-function: var(--ease-out); }
::view-transition-new(root) { animation-duration: 420ms; animation-timing-function: var(--ease-out); }

/* The sticky header keeps its own identity so it doesn't cross-fade with content */
.site-header { view-transition-name: bga-header; }
::view-transition-group(bga-header) { animation-duration: 240ms; }

/* --------------------------------------------------------------------------
   8. REDUCED MOTION — disable all motion, keep all content visible
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal],
  .fade-up,
  .is-loaded .hero-copy-block > * {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
  .scroll-progress,
  .cursor-glow { display: none !important; }
  .artifact-card { transform: rotate(var(--r)) !important; }

  /* Neutralise cross-document view transition animations */
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}

/* --------------------------------------------------------------------------
   9. PRINT
   -------------------------------------------------------------------------- */
@media print {
  .site-header, .site-footer, .to-top, .scroll-progress, .cursor-glow, .nav-toggle { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  a { color: #000 !important; text-decoration: underline; }
}

/* ==========================================================================
   10. PER-PAGE ENHANCEMENTS (from template work — history, authors, contact,
       guild, blog/single/404/search, and WooCommerce cart/checkout/account)
   ========================================================================== */

/* Generic screen-reader helper used by WP core markup (search form etc.) */
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ---- History (/viografiko/) — editorial cadence ---- */
.narrative-row-lede {
  grid-template-columns: 1fr;
  margin-bottom: clamp(48px, 6vw, 88px);
}
.narrative-row-lede .narrative-text h2 { margin-bottom: 0; }
.narrative-row-image-left { direction: rtl; }
.narrative-row-image-left .narrative-text,
.narrative-row-image-left .narrative-sidecar { direction: ltr; }
.narrative-row-image-left .artifact-side-note { --r: 1deg; }
.narrative-row-image-right .artifact-side-note { --r: -1deg; }
.history-hero .eyebrow { letter-spacing: 0.35em; color: var(--accent-text); }
@media (max-width: 980px) {
  .narrative-row-image-left,
  .narrative-row-image-right { direction: ltr; }
}

/* ---- Authors (/syggrafeis/) — ordinal numeral ---- */
.legend-ordinal {
  display: block;
  font-family: var(--serif);
  font-size: 1.1rem;
  letter-spacing: 0.3em;
  color: var(--gold);
  opacity: 0.85;   /* keeps the subtle look while clearing WCAG AA (~6:1) */
  margin-bottom: 14px;
}
.author-legend:nth-child(even) .legend-ordinal { text-align: right; }
@media (max-width: 1080px) {
  .author-legend:nth-child(even) .legend-ordinal { text-align: center; }
}

/* ---- Contact (/epikoinonia/) ---- */
.template-contact .contact-lede {
  max-width: 42ch; margin: 18px auto 0;
  color: rgba(245, 239, 226, 0.78);
  font-size: clamp(1.05rem, 1.6vw, 1.22rem); line-height: 1.55;
}
.template-contact .contact-grid {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 28px;
  text-align: left; margin: 60px 0;
}
.template-contact .contact-info-block { padding: 48px; }
.template-contact .contact-response-note { margin: 20px 0 0; font-size: 0.92rem; }
.template-contact .contact-details {
  padding: 48px; border: 1px solid var(--line);
  background: rgba(197, 163, 94, 0.05);
}
.template-contact .contact-details-title {
  font-family: var(--serif); font-size: 1.6rem; margin: 0 0 24px; color: var(--gold);
}
.template-contact .contact-detail-list { margin: 0; }
.template-contact .contact-detail { padding: 14px 0; border-top: 1px solid var(--line); }
.template-contact .contact-detail:first-child { border-top: 0; padding-top: 0; }
.template-contact .contact-detail dt {
  font-family: var(--sans); font-size: 0.72rem; font-weight: 800;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 4px;
}
.template-contact .contact-detail dd { margin: 0; font-size: 1.05rem; }
.template-contact .contact-detail dd a { color: var(--ink); text-decoration-color: var(--gold); }
.template-contact .contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.template-contact .contact-signoff { text-align: center; margin-top: 16px; }
@media (max-width: 820px) {
  .template-contact .contact-grid { grid-template-columns: 1fr; }
  .template-contact .contact-info-block,
  .template-contact .contact-details { padding: 32px; }
}

/* ---- Guild (/fantasy-guild/) ---- */
.guild-hero-meta {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 16px;
  margin: 22px 0 0; font-family: var(--sans); font-weight: 700; letter-spacing: 0.04em;
  color: #f5efe2; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85);
}
.guild-hero-meta span[aria-hidden] { color: var(--gold); }
.guild-hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 34px; }
.guild-intro .guild-lead {
  font-family: var(--serif); font-size: clamp(1.3rem, 2.4vw, 1.7rem); line-height: 1.45; margin: 0 0 18px;
}
.guild-intro figure { margin: 36px auto 0; max-width: 640px; }
.guild-intro figure img { width: 100%; height: auto; border: 1px solid var(--line); }
.guild-section-head { text-align: center; margin: 0 0 40px; }
.guild-section-head .eyebrow { justify-content: center; }
.guild-section-title { font-family: var(--serif); font-size: clamp(2rem, 4vw, 3rem); margin: 0; }
.guild-cta {
  margin: 80px 0; padding: clamp(48px, 7vw, 80px) 32px; text-align: center;
  border: 1px solid var(--gold);
  background: linear-gradient(rgba(9, 8, 6, 0.55), rgba(9, 8, 6, 0.55)),
    radial-gradient(circle at center, rgba(197, 163, 94, 0.12), transparent 70%);
}
.guild-cta-title { font-family: var(--serif); font-size: clamp(2rem, 4vw, 2.8rem); margin: 0 0 16px; }
.guild-cta-text {
  max-width: 56ch; margin: 0 auto 28px; color: rgba(245, 239, 226, 0.82); font-size: 1.1rem; line-height: 1.55;
}
.guild-cta-actions { display: flex; justify-content: center; }

/* ---- Blog index / single post / 404 / search ---- */
.news-card h2 { margin: 10px 0 0; font-family: var(--serif); font-size: 1.6rem; line-height: 1.1; }
.featured-news h2 { margin: 0 0 12px; font-family: var(--serif); font-size: clamp(1.8rem, 3vw, 2.6rem); line-height: 1.05; }
.single-article-inner { max-width: 820px; margin: 0 auto; }
.entry-back-link {
  display: inline-flex; gap: 6px; align-items: center; color: var(--gold);
  text-decoration: none; font-family: var(--sans); font-size: 0.85rem; letter-spacing: 0.04em;
}
.entry-back-link:hover { color: var(--ink); }
.entry-eyebrow a { color: var(--accent-text); text-decoration: none; }
.entry-byline {
  margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  color: var(--muted); font-family: var(--sans); font-size: 0.9rem;
}
.byline-author-name { color: var(--ink); }
.byline-sep { color: var(--line); }
.entry-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 40px 0 0; }
.entry-tags li a {
  display: inline-block; padding: 6px 12px; border: 1px solid var(--line);
  color: var(--muted); text-decoration: none; font-size: 0.8rem; border-radius: 2px;
}
.entry-tags li a:hover { color: var(--gold); border-color: var(--gold); }
.page-links { margin-top: 28px; display: flex; gap: 10px; align-items: center; }
.post-navigation {
  max-width: 820px; margin: 56px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  border-top: 1px solid var(--line); padding-top: 32px;
}
.post-nav-link {
  display: block; padding: 18px 20px; border: 1px solid var(--line); background: var(--bg-panel);
  text-decoration: none; color: var(--ink); transition: border-color 200ms ease, transform 200ms ease;
}
.post-nav-link:hover { border-color: var(--gold); transform: translateY(-3px); }
.post-nav-next { text-align: right; }
.post-nav-dir { display: block; color: var(--gold); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
.post-nav-title { display: block; margin-top: 8px; font-family: var(--serif); font-size: 1.15rem; line-height: 1.2; }
@media (max-width: 640px) {
  .post-navigation { grid-template-columns: 1fr; }
  .post-nav-next { text-align: left; }
}
.error-404-inner { max-width: 760px; margin: 0 auto; text-align: center; padding: clamp(20px,4vw,40px) 0; }
.error-404-code { font-size: 1rem; letter-spacing: 0.4em; color: var(--accent-text); }
.error-404-title { font-size: clamp(2.2rem, 6vw, 4.4rem); }
.error-404-text { max-width: 60ch; margin: 20px auto 0; color: var(--muted); line-height: 1.7; }
.error-404-links { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 32px 0; }
.error-404-search { margin: 28px auto 8px; max-width: 480px; }
.error-404-recent { margin-top: 56px; text-align: left; border-top: 1px solid var(--line); padding-top: 40px; }
.error-404-recent-title { font-family: var(--serif); font-size: 1.6rem; margin-bottom: 24px; }
.bga-search-form, .error-404-search form, .search-form { display: flex; gap: 10px; margin-top: 24px; max-width: 560px; }
.error-404-inner .bga-search-form, .error-404-search form { margin-left: auto; margin-right: auto; }
.search-field {
  flex: 1; min-width: 0; padding: 12px 16px; background: var(--bg-panel);
  border: 1px solid var(--line); color: var(--ink); font-family: var(--sans); font-size: 1rem;
}
.search-field::placeholder { color: var(--muted); }
.search-field:focus { outline: none; border-color: var(--gold); }
.search-submit { white-space: nowrap; }
.search-count { margin-top: 14px; color: var(--gold); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
.search-type { color: var(--accent-text); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.search-empty { text-align: center; max-width: 60ch; margin: 40px auto; }
.search-empty-title { font-family: var(--serif); font-size: 1.8rem; }

/* ==========================================================================
   11. WOOCOMMERCE BLOCKS (Cart & Checkout) + ACCOUNT — dark theme
   ========================================================================== */
.wc-block-components-panel,
.wc-block-cart__totals-title,
.wp-block-woocommerce-cart-order-summary-block,
.wp-block-woocommerce-checkout-order-summary-block,
.wc-block-components-sidebar,
.wc-block-cart-items,
.wc-block-checkout__sidebar {
  background: var(--bg-panel); color: var(--ink); border-color: var(--line);
}
.wp-block-woocommerce-cart,
.wp-block-woocommerce-checkout,
.wc-block-components-totals-item,
.wc-block-components-totals-wrapper,
.wc-block-components-product-metadata,
.wc-block-cart__empty-cart__title,
.wc-block-components-title,
.wc-block-components-checkout-step__title,
.wc-block-components-order-summary__content { color: var(--ink); }
.wc-block-components-totals-item__label,
.wc-block-components-product-details,
.wc-block-components-checkout-step__description,
.wc-block-components-address-card,
.wc-block-components-form .wc-block-components-text-input label,
.wc-block-components-checkout-step__heading-content { color: var(--muted); }
.wc-block-cart-items__row,
.wc-block-components-totals-item,
.wc-block-components-panel { border-color: var(--line) !important; }
.wc-block-components-product-price,
.wc-block-components-totals-footer-item .wc-block-components-totals-item__value,
.wc-block-formatted-money-amount { color: var(--gold); }
.wc-block-components-text-input input,
.wc-block-components-text-input textarea,
.wc-block-components-select select,
.wc-block-components-select .components-custom-select-control__button,
.wc-block-components-combobox input,
.wc-block-components-quantity-selector input {
  background: rgba(245, 239, 226, 0.06) !important; color: var(--ink) !important; border: 1px solid var(--line) !important;
}
.wc-block-components-text-input input:focus,
.wc-block-components-text-input textarea:focus,
.wc-block-components-select select:focus,
.wc-block-components-combobox input:focus {
  border-color: var(--gold) !important; box-shadow: 0 0 0 1px var(--gold) !important; outline: none;
}
.wc-block-components-text-input label,
.wc-block-components-text-input.is-active label { color: var(--muted) !important; }
.wc-block-components-button:not(.is-link),
.wp-block-woocommerce-proceed-to-checkout-block .wc-block-components-button {
  background: var(--red); color: var(--ink); border: 1px solid var(--red); border-radius: 2px;
}
.wc-block-components-button:not(.is-link):hover { background: var(--red-dark); border-color: var(--red-dark); }
.wc-block-components-button.is-link { color: var(--gold); }
.wc-block-components-notice-banner {
  background: var(--bg-soft) !important; color: var(--ink) !important; border-color: var(--line);
}
.wc-block-components-notice-banner.is-error { border-color: var(--red); }
.wc-block-components-notice-banner.is-success { border-color: var(--green); }
.wc-block-components-notice-banner__content,
.wc-block-components-notice-banner a { color: var(--ink); }
.wc-block-grid__product .wp-block-button__link,
.wc-block-grid__product-add-to-cart .button {
  background: transparent; color: var(--gold) !important; border: 1px solid var(--gold); border-radius: 2px;
}
.wc-block-grid__product .wp-block-button__link:hover { background: var(--gold); color: var(--bg) !important; }
.wc-block-grid__product-title { color: var(--ink); }
.wc-block-grid__product-price,
.wc-block-grid__product-price .amount { color: var(--gold) !important; }
.woocommerce-account .woocommerce form .form-row label,
.woocommerce form.login label,
.woocommerce form.register label,
.woocommerce-EditAccountForm label { color: var(--ink); }
.woocommerce-account .woocommerce form .form-row input.input-text,
.woocommerce-account .woocommerce form .form-row select,
.woocommerce form.login input.input-text,
.woocommerce form.register input.input-text {
  background: rgba(245, 239, 226, 0.06); border: 1px solid rgba(245, 239, 226, 0.28); color: var(--ink);
}
.woocommerce-account .woocommerce form .form-row input.input-text:focus { border-color: var(--gold); outline: none; }
.woocommerce-account .woocommerce-MyAccount-navigation ul { border-color: var(--line); }
.woocommerce-account .woocommerce-MyAccount-navigation a { color: var(--ink); }
.woocommerce-account .woocommerce-MyAccount-navigation .is-active a { color: var(--gold); }

/* ==========================================================================
   12. v3 — DESIGNER PASS: typography, gold foil, cinematic atmosphere
   ========================================================================== */

/* ---- Display typeface: EB Garamond (full Greek) replaces generic Georgia ---- */
:root {
  --serif: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --display: 'EB Garamond', Georgia, serif;
}
/* Dramatic scale + weight for the big display moments */
.hero h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(3rem, 6vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: -0.015em;
  max-width: 12em;
}
.section-title,
.shop-title,
.authors-hero-title,
.history-hero-title,
.guild-title,
.guild-cta-title,
.authors-hero-intro,
.product-hero-header .product_title,
.legend-name,
.entry-title,
.product_title { font-weight: 600; letter-spacing: -0.012em; }

/* EB Garamond has a smaller x-height than Georgia — keep small headings sturdy on dark */
.book-card h3,
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.news-card h2, .news-card h3,
.editorial-card h3,
.footer-title,
.contact-details-title,
.author-info .author-callout-name,
.post-nav-title { font-weight: 600; }

.manifesto-mark, .spotlight-quote, .product-pull-quote { font-weight: 500; }

/* ---- Gold foil (specular metallic) for the masthead + hero title ---- */
.brand-name,
.hero h1 {
  background: linear-gradient(100deg,
    #6e5a2e 0%, #b9974f 26%, #e9d59a 44%, #fffaf0 50%,
    #e9d59a 56%, #b9974f 74%, #6e5a2e 100%);
  background-size: 260% 100%;
  background-position: 72% 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.brand-name {
  font-family: var(--display);
  letter-spacing: 0.005em;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.5)); /* engraved edge on the small wordmark only */
}
/* Solid-gold fallback where background-clip:text is unsupported */
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .brand-name, .hero h1 {
    background: none; color: var(--gold); -webkit-text-fill-color: currentColor; filter: none;
  }
}
/* Sweep the highlight across the wordmark on hover/focus (motion-gated) */
@media (prefers-reduced-motion: no-preference) {
  .brand:hover .brand-name { animation: bgaFoilSweep 1.3s var(--ease-out); }
  @keyframes bgaFoilSweep { from { background-position: 130% 0; } to { background-position: -20% 0; } }
}
.brand:hover .brand-name { color: transparent; } /* override legacy hover colour */

/* ---- Cinematic colour grade: warm key light + cool shadow floor ---- */
body {
  background:
    radial-gradient(100% 55% at 50% 118%, rgba(22, 42, 48, 0.16), transparent 60%),
    radial-gradient(circle at 24% 8%, rgba(158, 47, 47, 0.20), transparent 29rem),
    linear-gradient(145deg, #090806 0%, #15110e 45%, #080706 100%);
}

/* ---- Global vignette (fixed; edges only — plain alpha, no blend cost) ---- */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  background: radial-gradient(130% 100% at 50% -8%, transparent 62%, rgba(0, 0, 0, 0.5) 100%);
}

/* ---- Material depth on framed artifacts & panels ---- */
.artifact-card,
.editorial-card,
.testimonial-card,
.contact-info-block,
.contact-details,
.guild-feature,
.author-card {
  box-shadow:
    inset 0 1px 0 rgba(245, 239, 226, 0.06),
    inset 0 -34px 60px rgba(0, 0, 0, 0.35),
    0 26px 50px -22px rgba(0, 0, 0, 0.7);
}
/* Lacquer glare across hero artifact covers (static, in addition to pointer sheen) */
.artifact-card::after {
  content: "";
  position: absolute;
  inset: 12px;
  pointer-events: none;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.07) 0 16%, transparent 42%);
  mix-blend-mode: screen;
}

/* ---- Illuminated section dividers (gilded rule that glows at centre) ---- */
.home .section,
.section.philosophy,
.section.editorial-spine,
.section.news,
.section.catalog { position: relative; border-bottom: 0; }
.home .section::after,
.section.philosophy::after,
.section.editorial-spine::after,
.section.catalog::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(197, 163, 94, 0.45) 50%, transparent);
  box-shadow: 0 0 10px rgba(197, 163, 94, 0.18);
}

/* Gild the eyebrow accent rule */
.eyebrow::before {
  width: 34px;
  background: linear-gradient(90deg, var(--accent-text), var(--gold));
}

/* ---- Footer as an "ex-libris" bookplate: foil title + gilded frame feel ---- */
.footer-title {
  font-family: var(--display);
  font-weight: 600;
  background: linear-gradient(100deg, #6e5a2e, #b9974f 30%, #e9d59a 50%, #b9974f 70%, #6e5a2e);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .footer-title { background: none; color: var(--gold); -webkit-text-fill-color: currentColor; }
}
.site-footer { position: relative; }
.site-footer::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(197, 163, 94, 0.5) 50%, transparent);
}

/* Drop cap for the philosophy manifesto + author bios (editorial "tell") */
.manifesto-mark::first-letter,
.legend-bio > p:first-of-type::first-letter {
  font-family: var(--display);
  font-weight: 700;
  color: var(--gold);
}

/* ==========================================================================
   13. v4 — SPACING & HEADER NORMALIZATION
   Page headers had wildly inconsistent, oversized padding (up to 260px) and
   titles from 5.2rem to 8.5rem. This unifies them into one sane, consistent
   rhythm so no header eats a whole screen and spacing is predictable.
   ========================================================================== */
:root {
  --hdr-pt: clamp(52px, 7vw, 92px);     /* page-header padding-top    */
  --hdr-pb: clamp(28px, 4vw, 48px);     /* page-header padding-bottom */
  --title-xl: clamp(2.3rem, 4.6vw, 3.8rem); /* one size for all page hero titles */
  --grid-gap: clamp(22px, 2.4vw, 38px);
}

/* --- Tame the oversized page headers to one consistent scale --- */
.authors-hero,
.history-hero,
.product-hero-header,
.shop-header {
  padding-top: var(--hdr-pt) !important;
  padding-bottom: var(--hdr-pb) !important;
}
.shop-header { margin-bottom: clamp(20px, 3vw, 40px) !important; }
.guild-hero { padding: clamp(64px, 9vw, 120px) 0 !important; } /* image hero: a touch taller */

/* --- One title size across all page heroes (was 6.4–8.5rem) --- */
.authors-hero-title,
.history-hero-title,
.guild-title,
.shop-title,
.product-hero-header .product_title {
  font-size: var(--title-xl) !important;
  line-height: 1.04;
  margin: 0;
}
.authors-hero-intro,
.history-hero-intro { font-size: clamp(1.05rem, 1.6vw, 1.3rem); }
.entry-title { font-size: clamp(2.1rem, 4.2vw, 3.4rem); }

/* Home hero: strong but no longer overwhelming */
.hero h1 { font-size: clamp(2.6rem, 5vw, 4.4rem); }

/* --- Collapse the cavernous gaps inside the editorial pages --- */
.authors-gallery { padding: clamp(40px, 6vw, 72px) 0 !important; }
.author-legend { margin-bottom: clamp(56px, 8vw, 104px) !important; gap: clamp(40px, 5vw, 80px) !important; }
.history-narrative { padding: clamp(44px, 6vw, 76px) 0 clamp(56px, 8vw, 96px) !important; }
.narrative-row { margin-bottom: clamp(40px, 5vw, 60px) !important; }
.guild-features { margin: clamp(48px, 7vw, 80px) 0 !important; }
.guild-intro { margin: clamp(40px, 6vw, 64px) auto !important; }

/* --- Consistent section rhythm sitewide --- */
.section { padding-top: clamp(56px, 7vw, 92px); padding-bottom: clamp(56px, 7vw, 92px); }
.home .section,
.home section.philosophy,
.home section.catalog,
.home section.editorial-spine,
.home section.news { padding-top: clamp(56px, 7vw, 92px); padding-bottom: clamp(56px, 7vw, 92px); }

/* --- Consistent product-grid gaps everywhere (was 60/40 vs 28 vs 30) --- */
.woocommerce ul.products,
.related.products ul.products,
.product-rail {
  gap: var(--grid-gap) !important;
}
.woocommerce ul.products { margin: clamp(32px, 4vw, 48px) 0 !important; }
.related.products { margin: clamp(56px, 8vw, 88px) auto !important; }

/* ==========================================================================
   14. QA-ROUND FIXES (5-person QA pass)
   ========================================================================== */

/* [P0] Mobile nav toggle was clipped off-screen: .brand{min-width:max-content}
   forced the wordmark to full width, pushing the 48px hamburger past the edge
   on phones (≤~480px) — making the menu unreachable. Let the brand shrink and
   drop the strapline on small screens so the toggle always fits. */
@media (max-width: 600px) {
  .brand { min-width: 0 !important; flex: 0 1 auto; gap: 10px; }
  .brand-text { min-width: 0; }
  .brand-name { font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(100vw - 140px); }
  .brand-kicker { display: none; }
  .brand-logo, .brand-logo img, .custom-logo { width: 40px !important; height: 40px !important; }
  .js .header-inner { gap: 12px !important; }
  .nav-toggle { flex: 0 0 auto; }
}

/* [P1] Long Greek display headings clipped off the right edge on mobile.
   Allow wrapping everywhere and tame the fixed/oversized sizes at ≤600px. */
h1, h2, h3, .history-hero-title, .authors-hero-title, .guild-title, .shop-title,
.error-404-title, .narrative-text h2, .product_title, .entry-title, .hero h1,
.section-title, .legend-name, .search-empty-title {
  overflow-wrap: break-word;
  word-break: normal;
}
@media (max-width: 600px) {
  .hero h1,
  .history-hero-title, .authors-hero-title, .guild-title, .shop-title,
  .product-hero-header .product_title { font-size: clamp(1.9rem, 7.4vw, 2.7rem) !important; }
  .narrative-text h2 { font-size: clamp(1.5rem, 6vw, 2.1rem) !important; }
  .error-404-title { font-size: clamp(1.8rem, 7vw, 2.5rem) !important; }
  .entry-title { font-size: clamp(1.8rem, 7vw, 2.5rem) !important; }
  .legend-name { font-size: clamp(1.7rem, 6.5vw, 2.4rem) !important; }
  /* ensure centred page headers keep side gutters */
  .history-hero, .authors-hero, .product-hero-header, .shop-header,
  .error-404-inner, .guild-hero { padding-left: 16px; padding-right: 16px; }
}

/* [P2] Mobile product grid collapsed to ONE oversized column — keep 2 columns
   (portrait covers read fine at half-width) down to small phones. */
@media (max-width: 600px) {
  .product-rail,
  .woocommerce ul.products,
  .related.products ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 16px 14px !important;
  }
  .book-card h3,
  .woocommerce ul.products li.product .woocommerce-loop-product__title { font-size: 1.02rem !important; min-height: 0 !important; }
  .book-card-meta { grid-template-rows: auto auto auto !important; }
}

/* [P2] Author "legend" rows: name/portrait/bio collided when stacked on mobile. */
@media (max-width: 1080px) {
  .author-legend { gap: 28px !important; align-items: start !important; }
  .legend-media-stack { margin-bottom: 8px; }
  .legend-name { margin-top: 4px; margin-bottom: 24px; }
}

/* [P2] Long raw URLs in author bios overflowed the measure. */
.legend-bio, .legend-bio p, .author-bio, .entry-content { overflow-wrap: anywhere; }

/* [P2] Cross-sell / empty-cart "add to cart" buttons were ghost-outline —
   inconsistent with the solid-red primary CTAs used everywhere else. */
.wc-block-grid__product .wp-block-button__link,
.wc-block-grid__product-add-to-cart .button {
  background: var(--red) !important;
  color: var(--ink) !important;
  border: 1px solid var(--red) !important;
}
.wc-block-grid__product .wp-block-button__link:hover { background: var(--red-dark) !important; color: var(--ink) !important; }

/* [P2] Contact page: cavernous empty band on desktop — balance it. */
@media (min-width: 821px) {
  .template-contact .entry-content { margin: clamp(40px, 5vw, 64px) auto; }
}
