/* /stories — hub, slider and article (templates/themes/global/stories_index.html, story_view.html,
   story_article.html). Shared by QuizTheme and the content themes, so everything is self-contained. */

:root {
  --story-accent: #b3134f;
  --story-accent-2: #8c0f3e;
  --story-ink: #1c1418;
  --story-text: #2e2a2c;
  --story-pill-bg: #fde3ec;
  --story-card: #fff7fa;
  --story-serif: 'Lora', Georgia, 'Times New Roman', serif;
}

/* ── Player stage ─────────────────────────────────────────────────────────── */
.story-stage { position: relative; overflow: hidden; padding: 28px 0 34px; background: #f3e9ec; }
.story-stage__bg {
  position: absolute; inset: -40px; background-size: cover; background-position: center;
  filter: blur(28px) saturate(.9) brightness(1.08); opacity: .55; transform: scale(1.05);
  transition: background-image .4s ease;
}
.story-stage::after { content: ''; position: absolute; inset: 0; background: rgba(255, 255, 255, .35); pointer-events: none; }
.story-container { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 0 16px; }

.story-top-ad { display: flex; justify-content: center; margin: 0 auto 18px; min-height: 50px; }
.story-top-ad:empty { display: none; }

.story-player {
  position: relative; background: #fff; border-radius: 22px; overflow: hidden;
  box-shadow: 0 18px 50px rgba(80, 20, 40, .18), 0 0 0 1px rgba(255, 255, 255, .7);
  touch-action: pan-y;
}

.story-slide { display: none; }
.story-slide.is-active { display: grid; animation: story-in .35s ease both; }
.story-slide.is-active.from-left { animation-name: story-in-left; }
@keyframes story-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes story-in-left { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .story-slide.is-active { animation: none; } }

/* Story slide: image left, text right (desktop) */
.story-slide[data-kind="story"] { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 560px; }
.story-media { position: relative; background: #eadde2; min-height: 260px; }
.story-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.story-text {
  position: relative; padding: 34px 44px 34px 40px; display: flex; flex-direction: column; justify-content: center;
  background: linear-gradient(160deg, #fff 0%, var(--story-card) 60%, #fbeef4 100%);
}
@media (min-width: 900px) {
  /* The slanted edge between photo and text, like the reference design. */
  .story-text::before {
    content: ''; position: absolute; top: 0; bottom: 0; left: -60px; width: 90px;
    background: linear-gradient(160deg, #fff 0%, var(--story-card) 100%);
    clip-path: polygon(66% 0, 100% 0, 100% 100%, 0 100%);
  }
  .story-text > * { position: relative; }
}

.story-pill {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px;
  background: var(--story-pill-bg); color: var(--story-accent); font-weight: 600; font-size: 15px;
  padding: 6px 16px; border-radius: 999px; margin-bottom: 18px;
}
.story-part { font-size: 13px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--story-accent); margin-bottom: 10px; }
.story-headline {
  font-family: var(--story-serif); font-weight: 700; color: var(--story-ink);
  font-size: clamp(24px, 2.6vw, 38px); line-height: 1.18; margin: 0 0 20px;
  border-left: 4px solid var(--story-accent); padding-left: 16px;
}
.story-headline--sm { font-size: clamp(22px, 2.1vw, 30px); }
.story-highlight { color: var(--story-accent); font-weight: 600; font-size: clamp(17px, 1.45vw, 21px); line-height: 1.4; margin: 0 0 12px; }
.story-body { color: var(--story-text); font-size: 18.5px; line-height: 1.55; margin: 0 0 12px; }
.story-cta {
  align-self: center; margin-top: 14px; display: inline-flex; align-items: center; gap: 12px; cursor: pointer;
  border: 0; border-radius: 999px; padding: 13px 34px; font-family: inherit; font-weight: 600; font-size: 18px; line-height: 1.2; color: #fff;
  background: linear-gradient(180deg, var(--story-accent) 0%, var(--story-accent-2) 100%);
  box-shadow: 0 8px 20px rgba(140, 15, 62, .3); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease;
}
.story-cta:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(140, 15, 62, .38); }

/* Ad slide */
.story-slide--ad.is-active, .story-slide--end.is-active { display: flex; }
/* Ad + end slides are requested before the reader gets there: keep them laid
   out but invisible (not display:none) so GPT can render and size the creative. */
.story-slide--ad:not(.is-active), .story-slide--end:not(.is-active) {
  display: flex; position: absolute; left: 0; right: 0; top: 0; visibility: hidden; pointer-events: none; z-index: -1;
}
.story-slide--ad { min-height: 560px; align-items: center; justify-content: center; background: #faf6f8; }
.story-ad { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px 12px; max-width: 100%; }
.story-ad__label { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: #8a7f84; }
.story-ad__slot { min-width: 300px; min-height: 250px; display: flex; align-items: center; justify-content: center; }
.story-ad__wait { font-size: 13px; color: #8a7f84; }

/* End card */
.story-slide--end { min-height: 560px; align-items: center; justify-content: center; background: linear-gradient(160deg, #fff, var(--story-card)); }
.story-end { width: 100%; max-width: 860px; padding: 36px 24px; text-align: center; }
.story-end__title { font-family: var(--story-serif); font-size: 38px; color: var(--story-ink); margin: 0 0 6px; }
.story-end__sub { color: var(--story-text); font-size: 17px; margin: 0 0 18px; }
.story-share { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 22px; }
.story-share__btn {
  border: 1.5px solid #e9c8d5; background: #fff; color: var(--story-ink); border-radius: 999px; padding: 9px 18px;
  font-family: inherit; font-weight: 600; font-size: 14px; line-height: 1; cursor: pointer; text-decoration: none;
}
.story-share__btn:hover { border-color: var(--story-accent); color: var(--story-accent); }
.story-share__btn--wa { background: #25d366; border-color: #25d366; color: #fff; }
.story-share__btn--fb { background: #1877f2; border-color: #1877f2; color: #fff; }
.story-share__btn--wa:hover, .story-share__btn--fb:hover { color: #fff; opacity: .9; }
.story-end__ad { display: flex; justify-content: center; margin: 0 0 22px; }
.story-end__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; text-align: left; }
.story-mini { display: block; border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 4px 14px rgba(80, 20, 40, .1); text-decoration: none; }
.story-mini img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.story-mini span {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  padding: 8px 10px 10px; font: 600 13.5px/1.35 var(--story-serif); color: var(--story-ink);
}

/* Navigation */
.story-nav { display: flex; align-items: center; justify-content: center; gap: clamp(40px, 22vw, 480px); margin-top: 20px; }
.story-nav__btn {
  width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer; display: flex; align-items: center; justify-content: center;
  background: #fbd3e1; color: var(--story-accent); box-shadow: 0 6px 16px rgba(140, 15, 62, .18); transition: transform .15s ease, opacity .15s;
}
.story-nav__btn:hover:not(:disabled) { transform: scale(1.06); }
.story-nav__btn:disabled { opacity: .4; cursor: default; }
.story-nav__btn.is-waiting { opacity: .55; cursor: progress; }
.story-nav__mid { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.story-nav__count { font-size: 18px; font-weight: 500; color: var(--story-ink); min-width: 70px; text-align: center; }
.story-nav__dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 320px; }
.story-dot { width: 14px; height: 14px; border-radius: 50%; border: 0; padding: 0; background: #e6dde1; cursor: pointer; }
.story-dot.is-on { background: var(--story-accent); }

/* ── Mobile: image on top, text below ─────────────────────────────────────── */
@media (max-width: 899px) {
  .story-stage { padding: 12px 0 22px; }
  .story-container { padding: 0 10px; }
  .story-player { border-radius: 16px; }
  .story-slide[data-kind="story"] { grid-template-columns: 1fr; min-height: 0; }
  .story-media { aspect-ratio: 4 / 3; min-height: 0; }
  .story-text { padding: 20px 18px 22px; }
  .story-pill { font-size: 13px; margin-bottom: 12px; }
  .story-headline { margin-bottom: 14px; padding-left: 12px; }
  .story-body { font-size: 16px; }
  .story-cta { font-size: 16px; padding: 12px 24px; }
  .story-slide--ad, .story-slide--end { min-height: 420px; }
  .story-end__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .story-end__title { font-size: 30px; }
  .story-nav { gap: 24px; margin-top: 14px; }
  .story-nav__btn { width: 50px; height: 50px; }
  .story-dot { width: 11px; height: 11px; }
  .story-nav__dots { gap: 8px; }
}

/* ── Hub + cards ──────────────────────────────────────────────────────────── */
.story-hub, .story-more { padding: 30px 0 40px; }
.story-hub .section-title, .story-more .section-title { margin-top: 34px; }
.story-empty { text-align: center; padding: 60px 0; color: #777; font-size: 17px; }

.story-lead {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); border-radius: 22px; overflow: hidden;
  background: #fff; box-shadow: 0 14px 40px rgba(80, 20, 40, .14); text-decoration: none;
}
.story-lead__img { position: relative; min-height: 340px; background: #eadde2; }
.story-lead__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.story-lead__text { padding: 34px 40px; display: flex; flex-direction: column; justify-content: center; background: linear-gradient(160deg, #fff, var(--story-card)); }
.story-lead .story-cta { align-self: flex-start; }
@media (max-width: 899px) {
  .story-lead { grid-template-columns: 1fr; }
  .story-lead__img { min-height: 0; aspect-ratio: 4 / 3; }
  .story-lead__text { padding: 20px 18px 24px; }
}

.story-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; margin-top: 18px; }
.story-card {
  display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; background: #fff; text-decoration: none;
  box-shadow: 0 6px 20px rgba(80, 20, 40, .1); transition: transform .15s ease, box-shadow .15s ease;
}
.story-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(80, 20, 40, .16); }
.story-card__img { position: relative; aspect-ratio: 4 / 3; background: #eadde2; }
.story-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.story-card__pill {
  position: absolute; left: 12px; top: 12px; background: rgba(255, 255, 255, .92); color: var(--story-accent);
  font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
}
.story-card__body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.story-card__body h3 { font: 700 18px/1.3 var(--story-serif); color: var(--story-ink); margin: 0 0 8px; }
.story-card__body p {
  color: #5a5256; font-size: 14px; line-height: 1.5; margin: 0 0 12px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.story-card__cta { margin-top: auto; color: var(--story-accent); font-weight: 700; font-size: 14px; }

/* Home page row */
.stories-home-section { padding: 10px 0 30px; }
.stories-home-section .story-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.stories-home-more { text-align: center; margin-top: 18px; }
.stories-home-more a { color: var(--story-accent); font-weight: 700; text-decoration: none; }

/* ── Article layout (story_article.html, story-article.js) ────────────────── */
.sa-progress { position: sticky; top: 0; z-index: 30; height: 4px; background: transparent; }
.sa-progress span {
  display: block; height: 100%; transform: scaleX(0); transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--story-accent), #e0558a); transition: transform .1s linear;
}

.sa { max-width: 780px; margin: 0 auto; padding: 34px 20px 10px; }
.sa-head { margin-bottom: 26px; }
.sa-title { font-size: clamp(28px, 4vw, 46px); margin-bottom: 16px; }
.sa-lede { font-family: var(--story-serif); font-size: clamp(18px, 2vw, 22px); line-height: 1.5; color: #5a4a51; margin: 0 0 18px; }
.sa-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: #8a7f84; font-size: 14px; font-weight: 600;
  padding: 12px 0; border-top: 1px solid #f0dfe6; border-bottom: 1px solid #f0dfe6;
}
.sa-meta__share { margin-left: auto; display: flex; gap: 8px; }
.sa-ico {
  width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid #ecd3dd; background: #fff; color: var(--story-ink); cursor: pointer; padding: 0; text-decoration: none;
}
.sa-ico:hover { border-color: var(--story-accent); color: var(--story-accent); }
.sa-ico--wa { color: #1fa855; }
.sa-ico--fb { color: #1877f2; }
.sa-ico.is-copied { background: var(--story-accent); border-color: var(--story-accent); color: #fff; }

.sa-part { margin: 0 0 34px; }
.sa-figure { margin: 0 0 22px; border-radius: 18px; overflow: hidden; background: #eadde2; box-shadow: 0 12px 34px rgba(80, 20, 40, .14); }
.sa-figure img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.sa-figure--hero img { aspect-ratio: 16 / 10; }
.sa-h2 {
  font-family: var(--story-serif); font-weight: 700; color: var(--story-ink); font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.25; margin: 0 0 14px; border-left: 4px solid var(--story-accent); padding-left: 14px;
}
.sa-highlight {
  font-family: var(--story-serif); font-style: italic; color: var(--story-accent); font-weight: 600;
  font-size: clamp(19px, 2vw, 23px); line-height: 1.45; margin: 0 0 16px;
  background: var(--story-pill-bg); border-radius: 12px; padding: 14px 18px;
}
.sa-p { color: var(--story-text); font-size: 20px; line-height: 1.7; margin: 0 0 18px; }
.sa-p--drop::first-letter {
  float: left; font-family: var(--story-serif); font-weight: 700; color: var(--story-accent);
  font-size: 3.4em; line-height: .9; padding: 6px 10px 0 0;
}

/* In-content ad: collapsed (but laid out, so GPT can render) until filled. */
.sa-ad { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0 -20px 34px; padding: 16px 0;
  background: #faf6f8; border-top: 1px solid #f0dfe6; border-bottom: 1px solid #f0dfe6; }
.sa-ad:not(.is-filled) { height: 0; padding: 0; margin-bottom: 0; border: 0; overflow: hidden; }
.sa-ad .gam-slot { min-width: 300px; display: flex; justify-content: center; }

.sa-end { text-align: center; padding: 10px 0 20px; }
.sa-end__mark { color: var(--story-accent); font-size: 28px; margin-bottom: 4px; }

@media (max-width: 899px) {
  .sa { padding: 20px 16px 6px; }
  .sa-meta__share { margin-left: 0; width: 100%; }
  .sa-figure { border-radius: 14px; margin-left: -4px; margin-right: -4px; }
  .sa-p { font-size: 18px; line-height: 1.65; }
  .sa-ad { margin-left: -16px; margin-right: -16px; }
}

/* ── Theme-independent page chrome (content themes have no .container / .section-title) ── */
.story-wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; box-sizing: border-box; }
.story-section-title {
  font-family: var(--story-serif); font-weight: 700; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.2;
  color: var(--story-ink); margin: 34px 0 6px;
}
.story-section-title span { color: var(--story-accent); }
.story-hero { padding: 38px 0 6px; text-align: center; background: linear-gradient(180deg, #fbeef4 0%, rgba(251, 238, 244, 0) 100%); }
.story-hero h1 { font-family: var(--story-serif); font-weight: 700; font-size: clamp(30px, 4vw, 46px); color: var(--story-ink); margin: 0 0 8px; }
.story-hero p { color: #6b5d63; font-size: 17px; margin: 0; }
.story-taboola { margin-top: 28px; }
.story-stage *, .sa *, .story-hub *, .story-more * { box-sizing: border-box; }
.story-card, .story-mini, .story-lead { color: inherit; }
.story-card:hover, .story-lead:hover, .story-mini:hover { text-decoration: none; }
