/* =============================================================================
   for_you.css — Soultrob "For You" personalised video feed
   Loaded AFTER discover.css. Scopes all overrides to .fy-root / .fy-grid
   so nothing leaks back to the discover page.
   ============================================================================= */

/*
  IMPORTANT: No :root block here — discover.css already owns --st-* tokens.
  All --fy-* vars are scoped to .fy-root so they only activate on this page
  and inherit the correct light/dark values from --st-*.
  body.dark-mode overrides in discover.css propagate automatically.
*/

/* ── Token aliases scoped to this page only ─────────────────────────────── */
.fy-root {
  --fy-bg:           var(--st-bg);
  --fy-surface:      var(--st-surface);
  --fy-border:       var(--st-border);
  --fy-text:         var(--st-text-primary);
  --fy-muted:        var(--st-text-muted);
  --fy-purple:       var(--st-purple, #7c3aed);
  --fy-purple-light: #a855f7;
  --fy-heart:        var(--st-heart, #ef4444);
  --fy-shadow:       var(--st-card-shadow);
  --fy-shadow-hover: var(--st-card-shadow-hover);
  --fy-radius:       14px;
  --fy-radius-lg:    18px;
  --fy-transition:   180ms ease-out;
}

/* ── Page root ───────────────────────────────────────────────────────────── */
.for-you-page,
.fy-root {
  min-height: 100vh;
  background: var(--fy-bg);
  color: var(--fy-text);
  font-family: 'DM Sans', sans-serif;
}

/* ── Sub-header badge strip ──────────────────────────────────────────────── */
.fy-subheader {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--fy-border);
}
@media (min-width: 1024px) { .fy-subheader { padding: 10px 28px; } }

.fy-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  font-family: 'DM Sans', sans-serif;
}
.fy-badge--personalised {
  background: rgba(124,58,237,0.12);
  color: #a855f7;
  border: 1px solid rgba(124,58,237,0.28);
}
.fy-badge--trending {
  background: rgba(239,68,68,0.08);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.22);
}
.fy-pref-cta {
  font-size: 12px;
  color: #a855f7;
  text-decoration: none;
  font-weight: 500;
}
.fy-pref-cta:hover { text-decoration: underline; }

/* ── Main content area ───────────────────────────────────────────────────── */
.fy-main {
  padding: 14px 12px 80px;
  max-width: 1400px;
  margin: 0 auto;
}
@media (min-width: 600px)  { .fy-main { padding: 18px 18px 80px; } }
@media (min-width: 1024px) { .fy-main { padding: 24px 28px 80px; } }

/* ══════════════════════════════════════════════════════════════════════════
   THE GRID
   Mobile-first CSS grid. Cards fill columns — discover.css fixed widths
   are all overridden below for anything inside .fy-grid.
   ══════════════════════════════════════════════════════════════════════════ */

.fy-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, 1fr);
  align-items: start; /* prevent cards stretching to equal row heights */
}

@media (min-width: 540px) {
  .fy-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
}
@media (min-width: 860px) {
  .fy-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}
@media (min-width: 1200px) {
  .fy-grid { grid-template-columns: repeat(5, 1fr); gap: 18px; }
}

/* Hero card: full row width */
.fy-grid .fy-card--hero { grid-column: 1 / -1; }

/* Wide + big: 2 columns on tablet+ */
@media (min-width: 540px) {
  .fy-grid .discover-card.card--wide { grid-column: span 2; }
}
@media (min-width: 860px) {
  .fy-grid .discover-card.card--big  { grid-column: span 2; }
}

/* ══════════════════════════════════════════════════════════════════════════
   OVERRIDE discover.css fixed widths — must defeat ALL breakpoints.
   Using !important only where discover.css responsive rules would otherwise
   win (same specificity but declared later in discover.css).
   ══════════════════════════════════════════════════════════════════════════ */

.fy-grid .discover-card,
.fy-grid .discover-card.card--big,
.fy-grid .discover-card.card--poster {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
}

/* Wide card: flex row, let grid control total width */
.fy-grid .discover-card.card--wide {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
}
.fy-grid .discover-card.card--wide .discover-card-thumb-link {
  width: 42% !important;
  flex-shrink: 0;
}
.fy-grid .discover-card.card--wide .discover-card-thumb-wrap {
  width: 100% !important;
  height: 100%;
}

/* Wide card hover: scale up instead of slide sideways */
.fy-grid .discover-card.card--wide:hover {
  transform: translateY(-2px) !important;
}

/* On very small screens, stack wide card vertically */
@media (max-width: 479px) {
  .fy-grid .discover-card.card--wide {
    flex-direction: column !important;
  }
  .fy-grid .discover-card.card--wide .discover-card-thumb-link {
    width: 100% !important;
  }
  .fy-grid .discover-card.card--wide .discover-card-thumb-wrap {
    height: auto !important;
    aspect-ratio: 16 / 9;
  }
}

/* No category labels in the for-you feed */
.fy-grid .discover-card-cat-badge {
  display: none !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   HERO CARD — full-width cinematic card
   ══════════════════════════════════════════════════════════════════════════ */

.fy-card--hero {
  background: var(--fy-surface);
  border: 1px solid var(--fy-border);
  border-radius: var(--fy-radius-lg);
  overflow: hidden;
  box-shadow: var(--fy-shadow-hover);
  transition: transform var(--fy-transition), box-shadow var(--fy-transition);
  cursor: pointer;
}
.fy-card--hero:hover {
  transform: translateY(-3px);
  box-shadow: var(--fy-shadow-hover);
}

.fy-card-hero-inner {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* 21:9 cinematic on desktop, 16:9 on mobile */
.fy-card-hero-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 21 / 9;
  overflow: hidden;
  background: #0a0a0c;
}
@media (max-width: 599px) {
  .fy-card-hero-thumb { aspect-ratio: 16 / 9; }
}

.fy-card-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 350ms ease, filter var(--fy-transition);
}
.fy-card--hero:hover .fy-card-hero-img {
  transform: scale(1.03);
  filter: brightness(1.06);
}

.fy-card-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 45%, rgba(0,0,0,0.62) 100%);
  z-index: 1;
  pointer-events: none;
}

.fy-card-hero-duration {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 2;
  background: rgba(0,0,0,0.78);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  padding: 3px 8px;
  border-radius: 6px;
  line-height: 1.4;
}

.fy-card-hero-play {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.fy-card-hero-play svg {
  opacity: 0;
  transform: scale(0.85);
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.6));
  transition: opacity 200ms ease, transform 200ms ease;
}
.fy-card--hero:hover .fy-card-hero-play svg {
  opacity: 1;
  transform: scale(1);
}

.fy-card-hero-body {
  padding: 14px 18px 16px;
  border-top: 1px solid var(--fy-border);
  background: var(--fy-surface);
}

.fy-card-hero-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--fy-text);
  margin: 0 0 10px;
  line-height: 1.4;
  font-family: 'DM Sans', sans-serif;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--fy-transition);
}
@media (max-width: 599px) { .fy-card-hero-title { font-size: 14px; } }
.fy-card--hero:hover .fy-card-hero-title { color: var(--fy-purple-light); }

.fy-card-hero-stats {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

/* Shared stat element used in hero card body */
.fy-card-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--fy-muted);
  font-family: 'DM Sans', sans-serif;
  white-space: nowrap;
}
.fy-stat-icon--heart { color: #ef4444; stroke: #ef4444; }
.fy-card-stat--duration { display: none; }
@media (min-width: 480px) { .fy-card-stat--duration { display: flex; } }

/* ══════════════════════════════════════════════════════════════════════════
   SKELETON LOADER
   ══════════════════════════════════════════════════════════════════════════ */

.fy-skeleton-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 12px;
}
@media (min-width: 540px)  { .fy-skeleton-strip { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 860px)  { .fy-skeleton-strip { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) { .fy-skeleton-strip { grid-template-columns: repeat(5, 1fr); } }

.fy-skel-card {
  border-radius: var(--fy-radius);
  overflow: hidden;
  background: var(--st-surface);
  border: 1px solid var(--st-border);
}
.fy-skel-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--st-skel-a);
}
.fy-skel-body { padding: 10px 12px 12px; }
.fy-skel-line {
  height: 12px;
  border-radius: 6px;
  background: var(--st-skel-a);
  margin-bottom: 8px;
}
.fy-skel-line--lg { width: 80%; }
.fy-skel-line--sm { width: 50%; margin-bottom: 0; }

@keyframes fy-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}
.fy-skel-pulse { animation: fy-pulse 1.4s ease-in-out infinite; }

/* ── JS append fade-in ───────────────────────────────────────────────────── */
.fy-card--entering {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 280ms ease, transform 280ms ease;
}

/* ══════════════════════════════════════════════════════════════════════════
   TOPBAR — site logo
   Reuses discover-topbar layout from discover.css; only the logo
   itself needs new styles.
   ══════════════════════════════════════════════════════════════════════════ */

/* Extra left padding on mobile to clear the sidebar hamburger */
@media (max-width: 767px) {
  .fy-root .discover-topbar-left { padding-left: 40px; }
}

.fy-site-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}
.fy-site-logo-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
}
.fy-site-logo-text {
  font-size: 19px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  letter-spacing: -0.01em;
  color: var(--st-text-primary);
}

/* ══════════════════════════════════════════════════════════════════════════
   PAGE HERO HEADER — title + subtitle
   ══════════════════════════════════════════════════════════════════════════ */

.fy-hero-header {
  padding: 32px 16px 24px;
  border-bottom: 1px solid var(--fy-border);
  background: var(--fy-bg);
}
@media (min-width: 600px)  { .fy-hero-header { padding: 36px 24px 26px; } }
@media (min-width: 1024px) { .fy-hero-header { padding: 40px 32px 28px; } }

.fy-hero-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.fy-hero-title-group {
  flex: 1;
  min-width: 0;
}

.fy-hero-title {
  font-family: 'DM Serif Display', 'Poppins', serif;
  font-size: 34px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  color: var(--st-text-primary);
  /* Subtle gradient accent on the title */
  background: linear-gradient(
    100deg,
    var(--st-text-primary) 0%,
    var(--st-text-primary) 60%,
    var(--st-purple, #7c3aed) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
@media (min-width: 600px)  { .fy-hero-title { font-size: 40px; } }
@media (min-width: 1024px) { .fy-hero-title { font-size: 46px; } }
@media (max-width: 479px)  { .fy-hero-title { font-size: 28px; } }

.fy-hero-subtitle {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--st-text-muted);
  margin: 0;
  line-height: 1.6;
  max-width: 520px;
}
@media (min-width: 600px) { .fy-hero-subtitle { font-size: 15px; } }

.fy-hero-cta-link {
  color: var(--st-purple, #7c3aed);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 150ms ease;
}
.fy-hero-cta-link:hover { opacity: 0.75; text-decoration: underline; }

/* Badge — top right of hero header */
.fy-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  padding: 5px 11px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.fy-hero-badge--personalised {
  background: rgba(124,58,237,0.12);
  color: #a855f7;
  border: 1px solid rgba(124,58,237,0.28);
}
.fy-hero-badge--trending {
  background: rgba(239,68,68,0.08);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.22);
}

/* Hide the old subheader badge strip — superseded by hero header */
.fy-subheader { display: none; }