/* OYOTTA Publications — book catalog, landing pages and sample reader.
   Additive layer over publications.css; inherits its palette tokens. */

:root {
  --scroll-ink: #14100b;
  --scroll-gold: #c0a453;
  --shadow: 0 1px 2px rgba(22, 18, 12, .07), 0 8px 24px rgba(22, 18, 12, .06);
}

/* ---------- shared ---------- */

.book-main { max-width: 1040px; }

.eyebrow {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .5rem;
}

.rule { border: 0; border-top: 1px solid var(--rule); margin: 2.75rem 0; }

.byline {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: .82rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.btn-row { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.4rem 0 0; }

.btn {
  display: inline-block;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: .82rem;
  letter-spacing: .06em;
  text-decoration: none;
  padding: .68rem 1.15rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
}
.btn:hover { background: var(--accent); border-color: var(--accent); }
.btn.secondary { background: transparent; color: var(--ink); }
.btn.secondary:hover { background: var(--ink); color: var(--paper); }
.btn:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- catalog ---------- */

.catalog {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(288px, 1fr));
  gap: 1.75rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.book-card {
  background: var(--card);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.book-card .art { display: block; text-decoration: none; }
.book-card .art img { width: 100%; height: auto; display: block; }
.book-card .body { padding: 1.15rem 1.25rem 1.4rem; display: flex; flex-direction: column; flex: 1; }
.book-card h3 { margin: 0 0 .2rem; font-size: 1.22rem; line-height: 1.25; }
.book-card h3 a { color: inherit; text-decoration: none; }
.book-card h3 a:hover { color: var(--accent); }
.book-card .sub { font-style: italic; color: var(--muted); margin: 0 0 .8rem; font-size: .95rem; }
.book-card p.blurb { margin: 0 0 1rem; font-size: .96rem; }
.book-card .btn-row { margin-top: auto; }

/* Typographic cover panel */
.type-cover {
  aspect-ratio: 2 / 3;
  background: linear-gradient(168deg, #14100b 0%, #1d1710 55%, #241c12 100%);
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem 1.6rem;
  position: relative;
}
.type-cover::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(192, 164, 83, .5);
  pointer-events: none;
}
.type-cover .tc-title {
  color: #f3ece0;
  font-size: clamp(1.35rem, 3.4vw, 1.85rem);
  line-height: 1.18;
  letter-spacing: .01em;
  margin: 0;
  text-transform: uppercase;
}
.type-cover .tc-of { color: var(--scroll-gold); font-size: .82em; display: block; margin: .2em 0; }
.type-cover .tc-sub {
  color: var(--scroll-gold);
  font-style: italic;
  font-size: .92rem;
  line-height: 1.45;
  margin: 1.1rem 0 0;
  max-width: 22ch;
}
.type-cover .tc-author {
  color: #f3ece0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: .78rem;
  letter-spacing: .3em;
  margin: 1.8rem 0 0;
}

/* ---------- landing hero ---------- */

.hero { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 2.25rem; align-items: start; margin: 1rem 0 0; }
.hero .art { box-shadow: var(--shadow); border: 1px solid var(--rule); }
.hero .art img { width: 100%; height: auto; display: block; }
.hero h1 { margin-top: 0; font-size: clamp(1.9rem, 4.4vw, 2.7rem); }
.hero .subtitle { font-style: italic; font-size: 1.12rem; color: var(--muted); margin: -.45rem 0 1rem; }

/* ---------- content blocks ---------- */

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem 1.5rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 1.1rem 0;
  margin: 2rem 0;
}
.facts dt {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: .7rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted); margin: 0 0 .2rem;
}
.facts dd { margin: 0; font-size: .98rem; }

.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; margin: 1.5rem 0 0; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; height: auto; display: block; border: 1px solid var(--rule); }
.gallery figcaption { margin-top: .55rem; font-style: italic; }

figure.plate { margin: 2rem 0; }
figure.plate img { width: 100%; height: auto; display: block; border: 1px solid var(--rule); }
figure.plate figcaption { margin-top: .6rem; font-style: italic; text-align: center; }

.panel {
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  padding: 1.1rem 1.25rem;
  margin: 2rem 0;
}
.panel h2, .panel h3 { border: 0; margin-top: 0; padding: 0; }
.panel p:last-child { margin-bottom: 0; }

.contents { columns: 2; column-gap: 2.5rem; padding-left: 1.15rem; }
.contents li { margin-bottom: .35rem; break-inside: avoid; }

.author-row { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 1.4rem; align-items: start; }
.author-row img { width: 100%; height: auto; display: block; border: 1px solid var(--rule); }

/* ---------- sample reader ---------- */

.reader { max-width: 40rem; }
.reader h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); }
.reader h2 { font-size: 1.32rem; margin-top: 2.6rem; }
.reader h3 { font-size: 1.06rem; margin-top: 1.9rem; border: 0; color: var(--accent); }
.reader p { margin: 0 0 1.05rem; }
.reader figure { margin: 2.2rem 0; }
.reader figure img { width: 100%; height: auto; display: block; border: 1px solid var(--rule); }
.reader figcaption { margin-top: .55rem; font-style: italic; text-align: center; }

.sample-banner {
  background: #efe4c8;
  border-left: 4px solid var(--accent);
  padding: .75rem 1rem;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: .88rem;
  margin: 0 0 2rem;
}

.sample-end {
  border-top: 2px solid var(--ink);
  margin-top: 3rem;
  padding-top: 1.5rem;
}

.crumbs {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: .8rem;
  color: var(--muted);
  margin: 0 0 1.25rem;
}
.crumbs a { color: var(--muted); }

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero .art { max-width: 260px; }
  .contents { columns: 1; }
  .author-row { grid-template-columns: 96px minmax(0, 1fr); gap: 1rem; }
  .btn { width: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ============================================================
   Showcase layer: film wallpaper, interactive covers,
   sample-reader overlay, chapter navigation.
   ============================================================ */

/* ---------- film wallpaper ---------- */

html.has-film { background: #0d0a06; }
body.has-film { background: transparent; }

.film {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background: #0d0a06 center / cover no-repeat;
}
.film video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .5;
}
/* Hero scrim */
.film::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10,8,5,.62) 0%, rgba(10,8,5,.42) 38%, rgba(10,8,5,.72) 100%),
    radial-gradient(120% 80% at 50% 12%, rgba(10,8,5,0) 0%, rgba(10,8,5,.5) 100%);
}

.film-controls {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 40;
}
.film-toggle {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #f3ece0;
  background: rgba(13, 10, 6, .78);
  border: 1px solid rgba(192, 164, 83, .55);
  padding: .5rem .8rem;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.film-toggle:hover { background: rgba(13, 10, 6, .94); border-color: var(--scroll-gold); }
.film-toggle:focus-visible { outline: 3px solid var(--scroll-gold); outline-offset: 2px; }

/* ---------- film hero ---------- */

.film-hero {
  min-height: min(74vh, 620px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 4rem 1.5rem 3rem;
  max-width: 1040px;
  margin: 0 auto;
  color: #f3ece0;
}
.film-hero .eyebrow { color: var(--scroll-gold); }
.film-hero h1 {
  color: #fbf6ec;
  font-size: clamp(2rem, 5.6vw, 3.4rem);
  margin: 0 0 .35rem;
  text-shadow: 0 2px 20px rgba(0, 0, 0, .55);
}
.film-hero .subtitle {
  color: var(--scroll-gold);
  font-style: italic;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  margin: 0 0 .9rem;
  max-width: 44ch;
}
.film-hero .lede { color: #ece3d4; max-width: 56ch; text-shadow: 0 1px 12px rgba(0, 0, 0, .5); }
.film-hero .byline { color: rgba(243, 236, 224, .8); }
.film-hero .btn { border-color: var(--scroll-gold); background: var(--scroll-gold); color: #14100b; }
.film-hero .btn:hover { background: #d4bb6e; border-color: #d4bb6e; }
.film-hero .btn.secondary {
  background: rgba(13, 10, 6, .5);
  color: #f3ece0;
  border-color: rgba(243, 236, 224, .55);
}
.film-hero .btn.secondary:hover { background: rgba(13, 10, 6, .85); border-color: var(--scroll-gold); }

/* ---------- content sheet over the film ---------- */

.sheet {
  background: rgba(244, 239, 228, .962);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  border-top: 1px solid rgba(201, 185, 154, .8);
  box-shadow: 0 -18px 60px rgba(0, 0, 0, .42);
  position: relative;
}
.has-film header.site { background: rgba(244, 239, 228, .93); backdrop-filter: blur(7px); }
.has-film .notice { background: rgba(239, 228, 200, .94); backdrop-filter: blur(7px); }
.has-film footer.site { background: rgba(244, 239, 228, .962); backdrop-filter: blur(7px); }

/* ---------- interactive covers ---------- */

.book-card { transition: transform .35s cubic-bezier(.2, .7, .3, 1), box-shadow .35s ease; }
.book-card:hover, .book-card:focus-within {
  transform: translateY(-6px);
  box-shadow: 0 2px 4px rgba(22, 18, 12, .09), 0 22px 48px rgba(22, 18, 12, .2);
}
.book-card .art { position: relative; overflow: hidden; }
.book-card .art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .3) 50%, transparent 62%);
  transform: translateX(-120%);
  transition: transform .75s cubic-bezier(.2, .7, .3, 1);
  pointer-events: none;
}
.book-card:hover .art::after, .book-card:focus-within .art::after { transform: translateX(120%); }
.book-card .art img, .book-card .art .type-cover { transition: transform .5s cubic-bezier(.2, .7, .3, 1); }
.book-card:hover .art img, .book-card:hover .art .type-cover { transform: scale(1.035); }

.hero .art img { transition: transform .5s cubic-bezier(.2, .7, .3, 1); }
.hero .art:hover img { transform: scale(1.02); }

/* ---------- sample-reader overlay ---------- */

.overlay[hidden] { display: none !important; }
.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(10, 8, 5, .74);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: clamp(0px, 3vh, 32px) clamp(0px, 3vw, 32px);
}
.overlay-panel {
  background: var(--paper);
  border: 1px solid var(--rule);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
  width: min(1080px, 100%);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}
.overlay-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--rule);
  background: var(--card);
}
.overlay-bar h2 { margin: 0; border: 0; padding: 0; font-size: 1.02rem; }
.overlay-bar .meta { margin: 0; }
.overlay-close {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: .75rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
  padding: .45rem .8rem;
  cursor: pointer;
}
.overlay-close:hover { background: var(--ink); color: var(--paper); }
.overlay-body { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 0; }
.overlay-scroll { overflow-y: auto; padding: 1.6rem 2rem 3rem; scroll-behavior: smooth; }
.overlay-scroll .reader { max-width: 38rem; margin: 0 auto; }
.overlay-loading { padding: 2.5rem; text-align: center; }

/* ---------- chapter navigation ---------- */

.chapter-nav {
  border-right: 1px solid var(--rule);
  background: var(--card);
  overflow-y: auto;
  padding: 1.2rem 1rem;
  min-height: 0;
}
.chapter-nav h3 {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: .68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .7rem;
  border: 0;
}
.chapter-nav ol { list-style: none; margin: 0; padding: 0; }
.chapter-nav li { margin: 0 0 .1rem; }
.chapter-nav a {
  display: block;
  padding: .4rem .55rem;
  font-size: .87rem;
  line-height: 1.35;
  color: var(--ink);
  text-decoration: none;
  border-left: 2px solid transparent;
}
.chapter-nav a:hover { background: rgba(122, 31, 31, .07); }
.chapter-nav a[aria-current="true"] {
  border-left-color: var(--accent);
  color: var(--accent);
  background: rgba(122, 31, 31, .07);
  font-weight: 600;
}

/* Standalone (non-overlay) chapter rail on the sample pages */
.reader-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.reader-layout .chapter-nav {
  position: sticky;
  top: 1.25rem;
  max-height: calc(100vh - 2.5rem);
  border: 1px solid var(--rule);
}

@media (max-width: 900px) {
  .overlay-body { grid-template-columns: 1fr; }
  .overlay-body .chapter-nav { display: none; }
  .reader-layout { grid-template-columns: 1fr; gap: 1.25rem; }
  .reader-layout .chapter-nav { position: static; max-height: 17rem; }
}

@media (max-width: 720px) {
  .film-hero { min-height: min(66vh, 520px); padding: 3rem 1.25rem 2.25rem; }
  .film-controls { right: .6rem; bottom: .6rem; }
  .overlay { padding: 0; }
  .overlay-scroll { padding: 1.1rem 1.15rem 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .book-card, .book-card .art img, .book-card .art::after, .hero .art img { transition: none; }
  .book-card:hover { transform: none; }
  .book-card:hover .art img, .book-card:hover .art .type-cover, .hero .art:hover img { transform: none; }
  .overlay-scroll { scroll-behavior: auto; }
}

@media print {
  .film, .film-controls, .chapter-nav, .overlay { display: none !important; }
  html.has-film { background: #fff; }
  .sheet { background: #fff; box-shadow: none; }
}

/* Cover artwork floating inside the film hero */
.film-hero .hero { width: 100%; margin: 0; align-items: end; }
.film-hero .hero .art { box-shadow: 0 24px 60px rgba(0, 0, 0, .55); border-color: rgba(192, 164, 83, .45); }
.film-hero .hero .type-cover { border-bottom: 0; }
.film-hero .crumbs, .film-hero .crumbs a { color: rgba(243, 236, 224, .82); }
@media (max-width: 720px) { .film-hero .hero .art { max-width: 190px; } }

/* ---------- OYOTTA music player ---------- */

.music {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  max-width: min(30rem, calc(100vw - 2rem));
  background: rgba(13, 10, 6, .82);
  border: 1px solid rgba(192, 164, 83, .55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: .55rem .7rem;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: #f3ece0;
}
.music button {
  font-family: inherit;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #f3ece0;
  background: transparent;
  border: 1px solid rgba(243, 236, 224, .5);
  padding: .42rem .7rem;
  cursor: pointer;
  white-space: nowrap;
}
.music button:hover { border-color: var(--scroll-gold); color: var(--scroll-gold); }
.music button:focus-visible { outline: 3px solid var(--scroll-gold); outline-offset: 2px; }
.music button.primary { background: var(--scroll-gold); border-color: var(--scroll-gold); color: #14100b; }
.music button.primary:hover { background: #d4bb6e; border-color: #d4bb6e; color: #14100b; }
.music button[aria-pressed="true"] { border-color: var(--scroll-gold); color: var(--scroll-gold); }

.music .track {
  font-size: .74rem;
  letter-spacing: .04em;
  color: rgba(243, 236, 224, .92);
  min-width: 8rem;
  flex: 1 1 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.music .track b { font-weight: 600; color: var(--scroll-gold); display: block; font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; }
.music .vol { display: flex; align-items: center; gap: .35rem; }
.music .vol label { font-size: .64rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(243, 236, 224, .75); }
.music input[type="range"] { width: 5.5rem; accent-color: var(--scroll-gold); cursor: pointer; }
.music input[type="range"]:focus-visible { outline: 3px solid var(--scroll-gold); outline-offset: 2px; }
.music .collapsed-only { display: none; }
.music[data-state="idle"] .playing-only { display: none; }

@media (max-width: 720px) {
  .music { left: .6rem; right: .6rem; bottom: 3.4rem; max-width: none; padding: .5rem .6rem; gap: .45rem; }
  .music .track { flex-basis: 100%; order: -1; }
  .music input[type="range"] { width: 4.5rem; }
}

/* Official listening links */
.music .link-btn {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #f3ece0;
  background: transparent;
  border: 1px solid rgba(243, 236, 224, .5);
  padding: .42rem .7rem;
  text-decoration: none;
  white-space: nowrap;
}
.music .link-btn:hover { border-color: var(--scroll-gold); color: var(--scroll-gold); }
.music .link-btn:focus-visible { outline: 3px solid var(--scroll-gold); outline-offset: 2px; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- OYOTTA wordmark ---------- */
/* Only the OYOTTA half of the OYOTTA Publications wordmark is coloured;
   "Publications" stays in the surrounding text colour. */

:root { --oy-green: #176B45; --oy-green-light: #4FBF87; }

.oy {
  color: var(--oy-green);
  font-weight: 600;
  letter-spacing: inherit;
}

/* Dark grounds: the film hero and the music bar. */
.film-hero .oy,
.music .oy,
.type-cover .oy { color: var(--oy-green-light); }

@media (forced-colors: active) { .oy { color: LinkText; } }
