/* =====================================================================
   chapter.css — chapter-opener page styles (full-bleed painting +
   chapter title overlay). Verbatim from V4 prototype lines 643–716.
   ===================================================================== */

/* =====================================================================
   CHAPTER OPENER (full-bleed painting + chapter title)
   ===================================================================== */

.chapter-opener {
  position: relative;
  min-height: 75vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 4rem var(--gutter) 5rem;
  margin-top: 0;
  margin-bottom: 0;
}

.chapter-opener-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.chapter-opener-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom,
    rgba(245, 239, 227, 0.12) 0%,
    rgba(43, 31, 20, 0.05) 50%,
    rgba(43, 31, 20, 0.45) 100%);
}

.chapter-opener-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: var(--paper);
  max-width: 50rem;
  padding: 2rem 2rem 1rem;
  background: rgba(43, 31, 20, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.chapter-opener-content h5 {
  color: var(--gold-pale);
  letter-spacing: 0.25em;
}

.chapter-opener-content h2 {
  color: var(--paper);
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  font-style: italic;
  font-weight: 400;
  margin: 0.875rem 0 0.625rem;
}

.chapter-opener-content .chapter-han {
  color: var(--gold-pale);
  font-size: 1.5rem;
  margin: 0.5rem 0 1rem;
}

.chapter-opener-content p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--paper);
  opacity: 0.92;
  max-width: 38rem;
  margin: 0 auto;
}


/* =====================================================================
   chapter index — recipe-card grid below the chapter opener
   New in V1 production build (chapter pages didn't exist as separate
   pages in the prototype — they all lived on one giant page).
   Styled to match the prototype's chapter-card aesthetic on the TOC.
   ===================================================================== */

.chapter-index {
  padding: var(--space-2xl) 0 var(--space-xl);
  background: var(--paper);
}

.chapter-index-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.chapter-index-header h5 {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: var(--space-sm);
}

.chapter-index-header h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 500;
  font-style: italic;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.chapter-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-lg);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.recipe-card {
  display: block;
  background: var(--paper-deep);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  box-shadow: 0 2px 12px var(--shadow);
}

.recipe-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px var(--shadow-deep);
  border-color: var(--terracotta);
}

.recipe-card-image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--paper-shadow);
}

.recipe-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.recipe-card:hover .recipe-card-image img {
  transform: scale(1.04);
}

.recipe-card-content {
  padding: var(--space-md);
}

.recipe-card-num {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 0.5rem;
}

.recipe-card-content h3 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 500;
  font-style: italic;
  color: var(--ink);
  margin-bottom: 0.25rem;
  line-height: 1.1;
}

.recipe-card-han {
  font-family: var(--font-han);
  font-size: 1.05rem;
  color: var(--jade);
  margin-bottom: var(--space-sm);
  letter-spacing: 0.05em;
}

.recipe-card-content p {
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

@media (max-width: 600px) {
  .chapter-index { padding: var(--space-xl) 0 var(--space-lg); }
  .chapter-index-grid { grid-template-columns: 1fr; gap: var(--space-md); }
}

/* =====================================================================
   recipe prev/next navigation — bottom-of-recipe pagination
   ===================================================================== */

.recipe-prev-next {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  max-width: var(--wide-width);
  margin: var(--space-2xl) auto var(--space-xl);
  padding: 0 var(--gutter);
}

.recipe-prev-next a,
.recipe-prev-next .disabled {
  display: flex;
  flex-direction: column;
  padding: var(--space-md);
  background: var(--paper-deep);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.recipe-prev-next .disabled {
  visibility: hidden;
}

.recipe-prev-next .recipe-next {
  text-align: right;
  align-items: flex-end;
}

.recipe-prev-next a:hover {
  border-color: var(--terracotta);
  transform: translateY(-2px);
}

.recipe-prev-next .dir {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 0.4rem;
}

.recipe-prev-next .title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-style: italic;
  color: var(--ink);
}

@media (max-width: 600px) {
  .recipe-prev-next { grid-template-columns: 1fr; }
  .recipe-prev-next .recipe-next { text-align: left; align-items: flex-start; }
}

/* =====================================================================
   site-footer (every page except cover)
   ===================================================================== */

.site-footer {
  background: var(--ink);
  color: var(--paper-deep);
  padding: var(--space-xl) var(--gutter) var(--space-lg);
  margin-top: var(--space-2xl);
}

.site-footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.site-footer-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-style: italic;
  color: var(--paper);
  margin-bottom: 0.5rem;
}

.site-footer-brand .han {
  font-family: var(--font-han);
  font-style: normal;
  color: var(--gold);
  margin-right: 0.4rem;
}

.site-footer-tagline {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-style: italic;
  color: var(--paper-shadow);
  letter-spacing: 0.1em;
  max-width: 60ch;
  margin: 0 auto var(--space-md);
  line-height: 1.6;
}

.site-footer-links {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  padding: 0;
}

.site-footer-links a {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-pale);
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-footer-links a:hover {
  color: var(--gold);
}

.site-footer-fineprint {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--paper-shadow);
  opacity: 0.7;
  max-width: 60ch;
  margin: 0 auto;
  line-height: 1.6;
}

/* =====================================================================
   Disabled recipe-card (chapter index) — recipe in manifest but not
   yet written. Gray out, dim image, "Coming soon" pill.
   ===================================================================== */
.recipe-card.disabled {
  pointer-events: none;
  opacity: 0.55;
  background: var(--paper-deep);
  border-style: dashed;
  filter: grayscale(0.4);
  position: relative;
  cursor: not-allowed;
}

.recipe-card.disabled .recipe-card-image img {
  filter: grayscale(0.6) brightness(0.95);
}

.recipe-card-coming {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-style: italic;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
}
