/* =====================================================
   Stories Pages — list + detail
   ----------------------------------------------------
   Shared visual language across stories.html and story.html.
   Matches Figma: Stories_List_Page.png + Story_Page.png.
   ===================================================== */

:root {
  --story-gap: 28px;
  --story-pad-x: 20px;
}

/* Do NOT set body{background} here. layout.css owns it so the desktop
   grey frame (#212121) works consistently across all pages. */

/* =====================================================
   TOP BAR — 3-column grid like event page
   ===================================================== */
.topbar {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 8px;
}
.topbar-icon-btn {
  width: 40px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  border-radius: 10px;
  transition: background 0.15s ease;
  background: transparent;
  border: none;
  cursor: pointer;
}
.topbar-icon-btn:hover { background: rgba(255, 255, 255, 0.08); }
.topbar-icon-btn img { display: block; }
.topbar-title {
  text-align: center;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2.8px;
  color: var(--color-yellow-light);
  text-transform: uppercase;
}

/* =====================================================
   HERO — shared between list + detail pages
   ===================================================== */
.stories-hero,
.story-hero {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding-top: 48px;
  isolation: isolate;
}

.stories-hero-motive,
.story-hero-motive {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 360px;
  max-width: 120%;
  aspect-ratio: 1 / 1;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.9) 20%, rgba(0,0,0,0.5) 40%, rgba(0,0,0,0) 60%);
          mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0.9) 20%, rgba(0,0,0,0.5) 40%, rgba(0,0,0,0) 60%);
}
.stories-hero-motive img,
.story-hero-motive img {
  width: 100%;
  height: 100%;
  animation: story-motive-spin 60s linear infinite;
  transform-origin: 50% 50%;
}
@keyframes story-motive-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.stories-hero-glow,
.story-hero-glow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 300px;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(ellipse 60% 70% at 50% 0%,
              rgba(206, 161, 85, 0.35) 0%,
              rgba(186, 141, 66, 0.12) 35%,
              transparent 70%);
}

.stories-hero-text,
.story-hero-text {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 40px 20px 28px;
}

.stories-hero-name,
.story-hero-name {
  font-family: 'Savor', 'Montserrat', serif;
  font-weight: 400;
  font-size: 28px;
  line-height: 1.15;
  color: var(--color-white);
  margin: 0 auto 10px;
  max-width: 320px;
}

/* Gold brush-stroke underline (SVG-drawn via CSS) */
.stories-hero-stroke,
.story-hero-stroke {
  width: 80px;
  height: 3px;
  margin: 0 auto 16px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--color-yellow-light) 20%,
    var(--color-yellow) 50%,
    var(--color-yellow-light) 80%,
    transparent 100%);
  border-radius: 2px;
  opacity: 0.85;
}

.stories-hero-subtitle,
.story-hero-teaser {
  font-family: 'Cormorant Garamond', 'Georgia', serif;
  font-style: italic;
  font-size: 20px;
  line-height: 1.4;
  color: var(--color-offwhite);
  max-width: 320px;
  margin: 0 auto;
}

/* =====================================================
   FILTER PILLS (list page only)
   ===================================================== */
.stories-filter-wrap {
  margin-top: 8px;
  width: 100%;
  overflow: hidden;
}
.stories-filter-scroll {
  display: flex;
  gap: 10px;
  padding: 0 var(--story-pad-x);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-padding-left: var(--story-pad-x);
}
.stories-filter-scroll::-webkit-scrollbar { display: none; }

.stories-filter-pill {
  flex-shrink: 0;
  padding: 9px 18px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 100px;
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}
.stories-filter-pill:hover { background: rgba(255, 255, 255, 0.06); }
.stories-filter-pill.is-active {
  background: rgba(186, 141, 66, 0.28);
  border-color: var(--color-yellow);
  color: var(--color-white);
}

/* =====================================================
   STORY GRID — 2-column
   ===================================================== */
.stories-main {
  padding: 0 var(--story-pad-x);
  margin-top: var(--story-gap);
}

.stories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.story-card {
  display: block;
  width: 100%;
  aspect-ratio: 165 / 200; /* matches the story-card.png proportions */
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}
.story-card:hover {
  border-color: rgba(206, 161, 85, 0.4);
}
.story-card:active {
  transform: scale(0.98);
}
.story-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.stories-empty {
  grid-column: 1 / -1;
  text-align: center;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-offwhite);
  padding: 40px 20px;
  opacity: 0.6;
}

/* =====================================================
   READING PROGRESS BAR (story page)
   ----------------------------------------------------
   Positioned absolute INSIDE the .app-shell so it
   automatically follows the 9:16 phone-frame width on
   desktop. Stays pinned to the top of the shell's
   visible area using sticky positioning.
   ===================================================== */
.story-progress {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  width: 108%;
  height: 2px;
  z-index: 60;
  background: transparent;
  pointer-events: none;
}
.story-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--color-yellow), var(--color-yellow-light));
  transition: width 0.08s linear;
}

/* =====================================================
   STORY DETAIL — hero image
   ===================================================== */
.story-hero-image {
  width: 100%;
  line-height: 0;
}
.story-hero-image img {
  width: 100%;
  height: auto;
  display: block;
}
.story-hero-image img:not([src]),
.story-hero-image img[src=""] {
  display: none;
}

/* =====================================================
   GENRE STRIP (below hero image, before read-for-me)
   Same visual language as event-page map button but
   label-only, non-interactive.
   ===================================================== */
.story-genre-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 16px;
  background: rgba(206, 161, 85, 0.24);
  border-top: 4px solid var(--color-yellow-light);
}
.story-genre-label {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-white);
  letter-spacing: 0.4px;
}

/* =====================================================
   READ FOR ME CTA
   ===================================================== */
.story-readcta-wrap {
  display: flex;
  justify-content: center;
  margin-top: var(--story-gap);
  padding: 0 var(--story-pad-x);
}
.story-readcta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--glass-fill-strong);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
          backdrop-filter: blur(12px) saturate(140%);
  border: 0.64px solid var(--glass-border);
  box-shadow: var(--shadow-inner-light), var(--shadow-inner-dark);
  border-radius: 100px;
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.story-readcta:hover { opacity: 0.9; }
.story-readcta[aria-pressed="true"] { background: rgba(206, 161, 85, 0.28); }
.story-readcta-icon { flex-shrink: 0; }

/* =====================================================
   STORY MAIN — section stack
   ===================================================== */
.story-main {
  display: flex;
  flex-direction: column;
  gap: var(--story-gap);
  margin-top: var(--story-gap);
  padding: 0 var(--story-pad-x);
}
.story-section { margin: 0; }
.story-section[hidden] { display: none; }

.story-h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-family: 'Savor', 'Montserrat', serif;
  font-weight: 400;
  font-size: 20px;
  color: var(--color-white);
}
.story-h2-icon {
  width: 10px;
  height: 19px;
  flex-shrink: 0;
}

/* =====================================================
   STORY PROSE — with drop cap on first paragraph
   ===================================================== */
.story-prose {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--color-offwhite);
}
.story-prose p {
  margin: 0 0 14px;
}
.story-prose p:last-child { margin-bottom: 0; }
.story-prose strong { color: var(--color-white); font-weight: 600; }
.story-prose em { color: var(--color-yellow-light); font-style: italic; }

/* Drop cap — applied to first paragraph except on pocket stories */
.story-prose.has-dropcap > p:first-of-type::first-letter {
  font-family: 'Savor', 'Montserrat', serif;
  font-size: 56px;
  font-weight: 400;
  line-height: 0.85;
  float: left;
  padding: 4px 10px 0 0;
  color: var(--color-yellow-light);
}

/* =====================================================
   ORNAMENT (end of story body)
   ===================================================== */
.story-ornament {
  display: flex;
  justify-content: center;
  margin-top: 24px;
  opacity: 1;
}
.story-ornament img {
  width: 28px;
  height: auto;
  transform: scale(1.1);
}

/* =====================================================
   PREV / NEXT NAVIGATION (story hero section)
   ===================================================== */
.story-nav-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.story-nav-title-block {
  flex: 1;
  text-align: center;
  min-width: 0;
}

/* =====================================================
   SPACERS
   ===================================================== */
.stories-bottom-spacer,
.story-bottom-spacer {
  height: 140px;
}

/* =====================================================
   Reduced motion
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
  .stories-hero-motive img,
  .story-hero-motive img { animation: none; }
  .story-progress-fill { transition: none; }
}
