/* ============================================
   STORIES CINEMATIC LIST v2
   Hover dramatic + Mobile card-with-thumb
   ============================================ */

/* ── Grain texture ── */
.stories-page::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

/* ── Ambient glows — mai lente ── */
.stories-ambient-glow {
  animation-duration: 45s !important;
  opacity: 0.07 !important;
  will-change: auto !important;
}

/* ════════════════
   VIEW SWITCHER
   ════════════════ */
.view-switcher {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 4px;
}

.view-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
}

.view-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

.view-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.view-btn i {
  font-size: 1.1rem;
}

/* ════════════════
   LIST CONTAINER
   ════════════════ */
.stories-container.view-grid .stories-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 3rem;
}

.stories-container.view-list .stories-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 3rem;
}

@media (min-width: 1024px) {
  .stories-container.view-grid .stories-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

/* ════════════════
   VIEW TOGGLING
   ════════════════ */
.stories-container.view-grid .story-row {
  display: none;
}
.stories-container.view-list .story-card {
  display: none;
}

/* ════════════════
   GRID VIEW - CARD
   ════════════════ */
.story-card {
  .stories-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

.story-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 420px;
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: white;
  background-color: #0a0f1a;
  transition:
    transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  isolation: isolate;
}

.story-card.is-active:hover {
  transform: translateY(-10px);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.4),
    0 0 0 2px var(--story-color);
}

.story-card-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.story-card-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.story-card.is-active:hover .story-card-bg img {
  transform: scale(1.05);
}

.story-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 20%,
    rgba(0, 0, 0, 0.4) 60%,
    rgba(0, 0, 0, 0.9) 100%
  );
  transition: background 0.4s ease;
}

.story-card.is-active:hover .story-card-overlay {
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.6) 50%,
    rgba(0, 0, 0, 0.95) 100%
  );
}

.story-card-content {
  position: relative;
  z-index: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  flex-grow: 1;
}

.story-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s ease;
}

.story-card.is-active:hover .story-card-header {
  opacity: 1;
  transform: translateY(0);
}

.story-card-chapter {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--story-color);
}

.story-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.story-card-badge.is-new {
  background: color-mix(in srgb, var(--story-color) 20%, transparent);
  border: 1px solid color-mix(in srgb, var(--story-color) 30%, transparent);
  color: var(--story-color);
}

.story-card-badge.is-soon {
  background: rgba(100, 116, 139, 0.15);
  border: 1px solid rgba(100, 116, 139, 0.2);
  color: #94a3b8;
}

.story-card-body {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.story-card-title {
  font-family: var(--font-display, "Playfair Display", serif);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.2;
  color: white;
  margin: 0 0 0.5rem;
  transition: color 0.3s ease;
}

.story-card.is-active:hover .story-card-title {
  color: var(--story-color);
}

.story-card-desc {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition:
    max-height 0.5s ease,
    opacity 0.5s ease,
    margin-top 0.5s ease;
}

.story-card.is-active:hover .story-card-desc {
  max-height: 100px; /* Adjust as needed */
  opacity: 1;
  margin-top: 0.5rem;
}

.story-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  margin-top: auto;
}

.story-card-duration {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}

.story-card-duration i {
  color: var(--story-color);
  opacity: 0.7;
}

.story-card-cta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.4s ease;
}

.story-card.is-active:hover .story-card-cta {
  opacity: 1;
  transform: translateX(0);
  color: white;
}

.story-card-cta i {
  transition: transform 0.3s ease;
}

.story-card.is-active:hover .story-card-cta i {
  transform: translateX(4px);
}

.story-card.is-coming-soon {
  cursor: pointer;
  cursor: not-allowed;
  filter: grayscale(60%);
  opacity: 0.7;
}

.story-card.is-coming-soon:hover {
  transform: none;
  box-shadow: none;
}

.story-card.is-coming-soon .story-card-bg img {
  transform: none;
}

/* ════════════════
   LIST VIEW - ROW
   ════════════════ */
.story-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
}

.story-row.is-active:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.story-row-thumb {
  width: 80px;
  height: 100px;
  border-radius: 8px;
  overflow: hidden;
}

.story-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-row-content {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.story-row-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.story-row-chapter {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--story-color);
}

.story-row-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.story-row-badge.is-new {
  background: color-mix(in srgb, var(--story-color) 20%, transparent);
  border: 1px solid color-mix(in srgb, var(--story-color) 30%, transparent);
  color: var(--story-color);
}
.story-row-badge.is-soon {
  background: rgba(100, 116, 139, 0.15);
  border: 1px solid rgba(100, 116, 139, 0.2);
  color: #94a3b8;
}

.story-row-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: white;
  line-height: 1.3;
}

.story-row-desc {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.5;
}

.story-row-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-right: 1rem;
}

.story-row-duration {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.5);
}

.story-row-arrow {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.3);
}

.story-row.is-coming-soon {
  cursor: not-allowed;
  filter: grayscale(60%);
  opacity: 0.7;
}

.story-row.is-coming-soon:hover {
  transform: none;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.02);
  border-color: transparent;
}

/* ══════════════════════════════════
   MOBILE ≤ 640px
   Mini-card cu thumbnail vizibil
   ══════════════════════════════════ */
@media (max-width: 640px) {
  .stories-list {
    gap: 0;
    border-top: none;
  }

  .story-row {
    display: grid;
    grid-template-columns: 76px 1fr;
    grid-template-rows: auto auto;
    align-items: start;
    gap: 0.75rem 1rem;
    padding: 1.25rem 1.25rem 1.25rem 0;
    border-bottom: none;
    border-radius: 16px;
    margin-bottom: 0.625rem;
    background: rgba(255, 255, 255, 0.025);
    overflow: visible;
  }

  /* Accent bar — mereu vizibil, border-radius stânga */
  .story-row::after {
    border-radius: 16px 0 0 16px;
    width: 4px;
    transform: scaleY(1) !important;
    opacity: 0.5;
    transition: opacity 0.25s ease;
  }
  .story-row:active::after {
    opacity: 1;
  }

  /* BG wash la tap */
  .story-row::before {
    border-radius: 16px;
    transform: translateX(0) !important;
    opacity: 0;
    transition: opacity 0.25s ease;
  }
  .story-row:active::before {
    opacity: 1;
  }

  /* Shimmer & number ascunse pe mobil */
  .story-row-shimmer,
  .story-row-num {
    display: none;
  }

  /* Thumbnail — pe mobil ajustam dimensiunea */
  .story-row-thumb {
    position: relative;
    right: auto;
    top: auto;
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
    width: 100%;
    height: 104px;
    border-radius: 12px 0 0 12px;
    box-shadow: none !important;
    grid-row: 1 / 3;
    grid-column: 1;
    display: block;
    margin-left: 1rem;
    pointer-events: none;
  }
  .story-row-thumb img {
    filter: sepia(8%) brightness(0.88);
  }
  .story-row:active .story-row-thumb {
    transform: none !important;
    box-shadow: none !important;
  }

  /* Content și right */
  .story-row-content {
    grid-column: 2;
    grid-row: 1;
    padding-top: 0.2rem;
  }
  .story-row-right {
    grid-column: 2;
    grid-row: 2;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  /* Desc vizibil 2 rânduri */
  .story-row-desc {
    font-size: 0.82rem;
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }

  /* Features mereu vizibile */
  .story-row-features {
    opacity: 1 !important;
    transform: none !important;
    transition: none;
  }

  /* Title wrap 2 rânduri */
  .story-row-title {
    font-size: 1.05rem;
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    letter-spacing: 0;
    transition: color 0.25s ease;
  }
  .story-row:active .story-row-title {
    color: var(--story-color);
  }

  /* Arrow la tap */
  .story-row-arrow,
  .story-row-lock {
    width: 34px;
    height: 34px;
    font-size: 0.875rem;
  }
  .story-row:active .story-row-arrow {
    background: var(--story-color);
    border-color: var(--story-color);
    color: #fff;
    transform: none;
    box-shadow: none;
  }

  /* Coming soon mobil */
  .story-row.is-coming-soon {
    opacity: 0.35;
  }
  .story-row.is-coming-soon .story-row-thumb {
    filter: grayscale(0.55);
  }
}

/* ════════════════════════════════
   SERIES META — total duration
   ════════════════════════════════ */
.stories-series-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.series-total-duration {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.04em;
}

.series-total-duration i {
  font-size: 0.75rem;
  opacity: 0.7;
}

/* ════════════════════════════════
   TAG FILTER BAR
   ════════════════════════════════ */
.tag-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tag-filter-btn {
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}

.tag-filter-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.15);
}

.tag-filter-btn.is-active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Filtered out state */
.story-card.is-filtered-out,
.story-row.is-filtered-out {
  display: none !important;
}

/* ════════════════════════════════
   ATMOSPHERE BADGE — card
   ════════════════════════════════ */
.story-atmosphere-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--atm-color, rgba(255,255,255,0.6));
  background: color-mix(in srgb, var(--atm-color, rgba(255,255,255,0.1)) 12%, rgba(0,0,0,0.5));
  border: 1px solid color-mix(in srgb, var(--atm-color, rgba(255,255,255,0.2)) 25%, transparent);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}

.story-card.is-active:hover .story-atmosphere-badge {
  opacity: 1;
  transform: translateY(0);
}

.story-atmosphere-badge i {
  font-size: 0.65rem;
}

/* Atmosphere badge — row (always visible, subtle) */
.story-row-atmosphere {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.7;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.story-row-atmosphere i {
  font-size: 0.6rem;
}

/* ════════════════════════════════
   FEATURE ICONS — card footer
   ════════════════════════════════ */
.story-feature-icons {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0.5rem;
}

.story-feature-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
  cursor: default;
}

.story-feature-icon i {
  font-size: 0.75rem;
}

.story-card.is-active:hover .story-feature-icon {
  background: color-mix(in srgb, var(--story-color) 15%, transparent);
  border-color: color-mix(in srgb, var(--story-color) 30%, transparent);
  color: var(--story-color);
}

/* ════════════════════════════════
   FEATURE CHIPS — list row
   ════════════════════════════════ */
.story-row-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.story-row-feature-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--story-color) 90%, white);
  background: color-mix(in srgb, var(--story-color) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--story-color) 20%, transparent);
}

.story-row-feature-chip i {
  font-size: 0.65rem;
}

/* ════════════════════════════════
   MOBILE adjustments
   ════════════════════════════════ */
@media (max-width: 640px) {
  .tag-filter-bar {
    gap: 0.4rem;
    margin-bottom: 1rem;
  }

  .tag-filter-btn {
    font-size: 0.68rem;
    padding: 0.25rem 0.6rem;
  }

  .story-row-features {
    display: none; /* too cluttered on mobile */
  }

  .story-atmosphere-badge {
    opacity: 1;
    transform: translateY(0);
  }

  .series-total-duration {
    font-size: 0.68rem;
  }
}

/* Keyboard shortcut flash feedback */
.view-btn.kb-flash {
  background: rgba(255, 255, 255, 0.2) !important;
  color: white !important;
  transform: scale(1.15);
  transition: transform 0.15s ease, background 0.15s ease !important;
}
