/* ==========================================================================
   Drama Stories — editorial design system
   Fraunces (display) + Inter (UI/body support) · warm paper + crimson accent
   ========================================================================== */

:root {
  --paper: #faf7f2;
  --paper-2: #f3eee6;
  --ink: #1a1614;
  --ink-2: #4a423d;
  --ink-3: #857a72;
  --line: #e7dfd4;
  --accent: #c8322b;
  --accent-2: #a02620;
  --accent-soft: #fbeae8;
  --card: #fffdf9;
  --shadow-sm: 0 1px 2px rgba(26, 22, 20, .06), 0 2px 8px rgba(26, 22, 20, .05);
  --shadow-md: 0 2px 6px rgba(26, 22, 20, .07), 0 12px 32px rgba(26, 22, 20, .10);
  --shadow-lg: 0 4px 12px rgba(26, 22, 20, .10), 0 24px 64px rgba(26, 22, 20, .16);
  --radius: 18px;
  --radius-sm: 12px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16130f;
    --paper-2: #1e1a15;
    --ink: #f1eae2;
    --ink-2: #c8beb4;
    --ink-3: #92887e;
    --line: #2c261f;
    --accent: #e14b43;
    --accent-2: #f0655d;
    --accent-soft: #2b1a18;
    --card: #1d1914;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, .45);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, .55);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 22px; }
.wrap-narrow { max-width: 740px; margin: 0 auto; padding: 0 22px; }

/* --------------------------------------------------------------------------
   Kickers, chips, buttons
   -------------------------------------------------------------------------- */
.kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--accent);
}
.kicker--light { color: #ffd9d6; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
  background: rgba(22, 18, 15, .72);
  color: #fff;
  backdrop-filter: blur(6px);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 14px 26px;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 15.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
}
.btn .arrow { transition: transform .18s ease; display: inline-block; }
.btn:hover .arrow { transform: translateX(4px); }

.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 6px 20px rgba(200, 50, 43, .32);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(200, 50, 43, .42); }

.btn--ghost {
  background: transparent;
  color: var(--ink-2);
  border-color: var(--line);
}
.btn--ghost:hover { border-color: var(--ink-3); color: var(--ink); }

/* --------------------------------------------------------------------------
   Reading progress bar
   -------------------------------------------------------------------------- */
.progress-track {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 60;
  background: transparent;
}
.progress-bar {
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--accent), #e8703f);
  will-change: transform;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.site-header.scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 4px 24px rgba(26, 22, 20, .06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -.01em;
}
.wordmark-mask { font-size: 22px; }

.site-nav {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a { white-space: nowrap; }
.site-nav a {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-2);
  position: relative;
  padding: 6px 0;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%; bottom: 0;
  height: 2px;
  background: var(--accent);
  transition: right .2s ease;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a:hover::after { right: 0; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero { padding: 34px 0 10px; }

.hero-card {
  position: relative;
  display: block;
  border-radius: calc(var(--radius) + 6px);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  isolation: isolate;
  transition: transform .25s ease;
}
.hero-card:hover { transform: translateY(-3px); }

.hero-media {
  position: relative;
  height: min(62vh, 560px);
  overflow: hidden;
  background: #17120f;
}
.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(34px) brightness(.6) saturate(1.2);
  transform: scale(1.2);
}
.hero-img {
  position: relative;
  width: auto;
  max-width: 100%;
  height: min(62vh, 560px);
  margin: 0 auto;
  object-fit: contain;
  transition: transform .6s ease;
}
.hero-card:hover .hero-img { transform: scale(1.025); }

.hero-img--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1200px 500px at 20% 0%, #3a2320, transparent),
    linear-gradient(135deg, #241a17, #16110f);
}
.hero-img--placeholder span { font-size: 96px; opacity: .85; }

.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(12, 8, 7, .88) 0%, rgba(12, 8, 7, .38) 46%, rgba(12, 8, 7, .05) 75%);
}

.hero-body {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: clamp(22px, 4.5vw, 52px);
  color: #fff;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.7rem, 4.4vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -.02em;
  margin: 12px 0 10px;
  max-width: 18ch;
  text-wrap: balance;
}
.hero-excerpt {
  max-width: 60ch;
  margin: 0 0 18px;
  font-size: clamp(.95rem, 1.6vw, 1.08rem);
  color: rgba(255, 255, 255, .85);
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  color: #ffd9d6;
}
.hero-cta .arrow { transition: transform .18s ease; }
.hero-card:hover .hero-cta .arrow { transform: translateX(5px); }

/* --------------------------------------------------------------------------
   Story cards grid
   -------------------------------------------------------------------------- */
.stories { padding: 44px 0 70px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  letter-spacing: -.015em;
  margin: 0;
}
.section-count { font-size: 13.5px; color: var(--ink-3); font-weight: 600; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 26px;
}

.story-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .22s ease, box-shadow .22s ease;
}
.story-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--paper-2);
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.story-card:hover .card-media img { transform: scale(1.05); }

.card-media--placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2c211d, #191310);
}
.card-media--placeholder span { font-size: 46px; opacity: .8; }

.chip--part { position: absolute; top: 12px; left: 12px; }
.chip--time { position: absolute; top: 12px; right: 12px; }

.card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px 20px;
  flex: 1;
}
.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.18rem;
  line-height: 1.28;
  letter-spacing: -.012em;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.story-card:hover .card-title { color: var(--accent); }
.card-excerpt {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta { margin-top: auto; padding-top: 6px; font-size: 12.5px; color: var(--ink-3); font-weight: 500; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 44px;
}
.page-btn {
  padding: 10px 20px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-2);
  transition: border-color .18s ease, color .18s ease;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-info { font-size: 13.5px; color: var(--ink-3); font-weight: 600; }

/* --------------------------------------------------------------------------
   Story page
   -------------------------------------------------------------------------- */
.story { padding: 40px 22px 30px; }

.story-head { text-align: center; margin-bottom: 28px; }
.story-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.9rem, 5vw, 3.2rem);
  line-height: 1.12;
  letter-spacing: -.022em;
  margin: 14px 0 16px;
  text-wrap: balance;
}
.story-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-3);
  font-weight: 500;
}
.story-meta .dot { opacity: .6; }
.part-chip {
  padding: 4px 13px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: .03em;
}

.story-figure { margin: 0 0 30px; }
.figure-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  background: #17120f;
}
.figure-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(30px) brightness(.62) saturate(1.2);
  transform: scale(1.2);
}
.figure-main {
  position: relative;
  height: 100%;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  object-fit: contain;
}
.story-figure figcaption {
  margin-top: 10px;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-3);
}

.recap {
  margin: 0 0 26px;
  padding: 14px 20px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 14.5px;
  color: var(--ink-2);
}

/* Prose (story body + static pages) */
.prose {
  font-size: 19px;
  line-height: 1.78;
  color: var(--ink);
}
.prose p { margin: 0 0 1.35em; }
.prose h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -.015em;
  line-height: 1.25;
  margin: 1.9em 0 .7em;
}
.prose strong { font-weight: 700; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.prose--story blockquote {
  margin: 2em 0;
  padding: 0 0 0 26px;
  border-left: 3px solid var(--accent);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 1.32rem;
  line-height: 1.45;
  color: var(--ink);
  letter-spacing: -.01em;
}
.prose--story blockquote p { margin: 0; }

.prose--dropcap > p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 3.6em;
  line-height: .82;
  float: left;
  padding: 8px 12px 0 0;
  color: var(--accent);
}

/* Ad boxes — reserved height, labeled */
.ad-box {
  margin: 34px 0;
  padding: 14px 0 6px;
  min-height: 280px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.ad-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
}

/* End-of-part navigation */
.part-end { margin: 46px 0 30px; }

.cliffhanger {
  position: relative;
  margin: 0 0 34px;
  padding: 30px 34px 26px 66px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.cliffhanger-mark {
  position: absolute;
  top: 6px;
  left: 20px;
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 900;
  line-height: 1;
  color: var(--accent);
  opacity: .85;
}
.cliffhanger p {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--ink);
}

.part-pills {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0 0 24px;
}
.pill {
  padding: 8px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-3);
  transition: all .18s ease;
}
.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill--active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.pill--done {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
}

.part-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.btn--continue { font-size: 16.5px; padding: 16px 32px; }

/* The End */
.story-end { margin: 50px 0 20px; }
.end-mark {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 26px;
}
.end-mark span { flex: 1; height: 1px; background: var(--line); }
.end-mark em {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: .02em;
  color: var(--accent);
}

.share-row {
  margin: 30px 0 10px;
  padding: 22px 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.share-label { font-weight: 700; font-size: 15px; }
.share-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.share-btn {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s ease;
}
.share-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

.related { margin-top: 46px; }
.related .section-title { margin-bottom: 20px; }
.card-grid--related { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.card-grid--related .card-body { padding: 14px 16px 16px; }
.card-grid--related .card-title { font-size: 1.02rem; }

.end-home { margin-top: 36px; text-align: center; }

/* --------------------------------------------------------------------------
   Static pages / empty states
   -------------------------------------------------------------------------- */
.page { padding: 48px 22px 70px; }
.page-head { text-align: center; margin-bottom: 30px; }
.page-head--category { margin: 34px 0 12px; }
.page-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.8rem, 4.5vw, 2.7rem);
  letter-spacing: -.02em;
  margin: 12px 0 0;
}
.page .prose { font-size: 17.5px; }

.empty-state {
  text-align: center;
  padding: 90px 20px 100px;
}
.empty-state--404 { padding: 110px 20px 130px; }
.empty-emoji { font-size: 64px; margin-bottom: 18px; }
.empty-state h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  letter-spacing: -.02em;
  margin: 0 0 10px;
}
.empty-state p { color: var(--ink-2); margin: 0 0 26px; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: 60px;
  background: #16110e;
  color: #cfc5bb;
}
@media (prefers-color-scheme: dark) {
  .site-footer { background: #100d0a; border-top: 1px solid var(--line); }
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding: 52px 22px 34px;
}
.footer-wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  color: #fff;
  margin-bottom: 10px;
}
.footer-brand p { margin: 0 0 10px; font-size: 14px; line-height: 1.6; }
.footer-note { font-size: 12.5px; color: #8d8178; }

.footer-col h4 {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #8d8178;
}
.footer-col a {
  display: block;
  padding: 5px 0;
  font-size: 14px;
  color: #cfc5bb;
  transition: color .15s ease;
}
.footer-col a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .09);
  padding-top: 20px;
  padding-bottom: 26px;
  font-size: 13px;
  color: #8d8178;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .header-inner { height: 58px; }
  .site-nav { gap: 16px; }
  .site-nav a { font-size: 13.5px; }
  .wordmark { font-size: 18px; }
  .hero { padding-top: 18px; }
  .hero-img { height: 58vh; }
  .card-grid { grid-template-columns: 1fr; gap: 20px; }
  .prose { font-size: 17.5px; }
  .prose--story blockquote { font-size: 1.16rem; padding-left: 20px; }
  .story { padding-top: 26px; }
  .part-nav { flex-direction: column-reverse; }
  .part-nav .btn { width: 100%; justify-content: center; }
  .share-row { flex-direction: column; align-items: flex-start; }
  .cliffhanger { padding: 26px 22px 22px 54px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ==== Recherche (page monétisée) ==== */
.search-bar { display: flex; gap: 10px; margin: 18px 0 26px; }
.search-input { flex: 1; min-width: 0; padding: 12px 16px; font: inherit; color: inherit;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14);
  border-radius: 12px; outline: none; }
.search-input:focus { border-color: rgba(255,255,255,.35); }
@media (max-width: 560px) { .search-bar { flex-direction: column; } }

/* ==== Conteneurs publicitaires HB ====
   AUCUNE règle de masquage ici : le script HB vérifie la visibilité
   (isVisible) avant de remplir un emplacement — un conteneur caché ne serait
   JAMAIS rempli. On se contente d'un espacement. */
.hb-ad-inpage { margin: 22px auto; text-align: center; }
