/* FameFeed — Web Stories + Reels rail, listing grid and story viewer */

/* ================= Homepage rail ================= */
.ffs-rail { margin: 4px 0 24px; }
.ffs-rail-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.ffs-rail-head h2 { font-size: 18px; font-weight: 800; margin: 0; border-left: 4px solid var(--primary, #E4032C); padding-left: 10px; }
.ffs-rail-head a { font-size: 13px; font-weight: 700; color: var(--primary, #E4032C); }
.ffs-rail-track {
  display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.ffs-rail-track::-webkit-scrollbar { display: none; }

.ffs-card {
  box-sizing: border-box; position: relative; display: block; flex: 0 0 112px; aspect-ratio: 9 / 16; border-radius: 14px;
  overflow: hidden; background: #151515; color: #fff; scroll-snap-align: start;
}
@media (min-width: 900px) { .ffs-card { flex-basis: 150px; } }
.ffs-thumb { position: absolute; inset: 0; background: linear-gradient(160deg, #2b2b2b, #0d0d0d); }
.ffs-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ffs-card::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to top, rgba(0,0,0,.78) 0%, rgba(0,0,0,0) 58%);
}
/* Story cards get a coloured "ring", like Instagram stories */
.ffs-card-story { padding: 2.5px; background: linear-gradient(135deg, #E4032C, #FFC72C 55%, #E4032C); }
.ffs-card-story .ffs-thumb { inset: 2.5px; border-radius: 12px; overflow: hidden; }
.ffs-card-story::after { inset: 2.5px; border-radius: 12px; }

.ffs-title {
  position: absolute; left: 9px; right: 9px; bottom: 9px; z-index: 2; font-size: 12px; font-weight: 700; line-height: 1.35;
  text-shadow: 0 1px 3px rgba(0,0,0,.7); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.ffs-tag {
  position: absolute; left: 9px; top: 9px; z-index: 2; font-size: 9px; font-weight: 800; letter-spacing: .05em;
  padding: 2px 7px; border-radius: 10px; background: rgba(0,0,0,.62);
}
.ffs-card-reel .ffs-tag { background: var(--primary, #E4032C); }
.ffs-play {
  position: absolute; right: 8px; top: 8px; z-index: 2; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0,0,0,.58); display: flex; align-items: center; justify-content: center; font-size: 11px;
}
.ffs-card-reel.ffs-noposter .ffs-thumb::before {
  content: "▶"; position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); font-size: 30px; opacity: .55;
}

/* ================= /stories/ listing ================= */
.ffs-listing h1 { font-size: 22px; margin: 6px 0 16px; border-left: 4px solid var(--primary, #E4032C); padding-left: 10px; }
.ffs-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 600px) { .ffs-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .ffs-grid { grid-template-columns: repeat(5, 1fr); } }
.ffs-grid .ffs-card { flex: none; width: 100%; }
.ffs-empty { text-align: center; color: var(--muted, #777); padding: 50px 0; }

/* ================= Story viewer (full screen) ================= */
html.ffs-lock, body.ffs-body { margin: 0; height: 100%; overflow: hidden; background: #000; }
.ffs-viewer {
  position: fixed; inset: 0; background: #000; color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: -apple-system, 'Noto Sans Bengali', system-ui, sans-serif; user-select: none; -webkit-tap-highlight-color: transparent;
}
.ffs-stage { position: relative; width: 100%; height: 100%; background: #111; overflow: hidden; touch-action: manipulation; }
@media (min-width: 600px) {
  .ffs-stage { height: min(100vh, 900px); width: auto; aspect-ratio: 9 / 16; border-radius: 16px; }
}
.ffs-bars { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 4px; z-index: 6; }
.ffs-bar { flex: 1; height: 3px; background: rgba(255,255,255,.35); border-radius: 2px; overflow: hidden; }
.ffs-bar i { display: block; height: 100%; width: 0; background: #fff; }
.ffs-top { position: absolute; top: 22px; left: 12px; right: 12px; display: flex; align-items: center; gap: 8px; z-index: 6; }
.ffs-brand { font-weight: 800; font-size: 14px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.ffs-spacer { flex: 1; }
.ffs-btn {
  width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff;
  font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.ffs-slide { position: absolute; inset: 0; background: #000 center / cover no-repeat; animation: ffsFade .25s ease; }
@keyframes ffsFade { from { opacity: .3; } to { opacity: 1; } }
.ffs-shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,0) 55%, rgba(0,0,0,.35) 100%); }
.ffs-text { position: absolute; left: 18px; right: 18px; bottom: 28px; z-index: 3; pointer-events: none; }
.ffs-text h2 { margin: 0 0 8px; font-size: 22px; line-height: 1.35; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.ffs-text p { margin: 0; font-size: 15px; line-height: 1.6; text-shadow: 0 1px 3px rgba(0,0,0,.6); white-space: pre-line; }
.ffs-cta { display: inline-block; margin-top: 14px; background: #fff; color: #111; font-weight: 800; padding: 10px 20px; border-radius: 24px; font-size: 14px; pointer-events: auto; }
.ffs-tap { position: absolute; top: 64px; bottom: 0; border: 0; background: transparent; z-index: 4; cursor: pointer; padding: 0; }
.ffs-prev { left: 0; width: 33%; }
.ffs-next { right: 0; width: 67%; }
.ffs-end {
  position: absolute; inset: 0; z-index: 7; background: rgba(0,0,0,.9); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px; padding: 26px; text-align: center;
}
.ffs-end p { margin: 0 0 6px; font-size: 16px; opacity: .85; }
.ffs-endbtn {
  display: block; width: 100%; max-width: 280px; padding: 12px 16px; border-radius: 26px; border: 1px solid rgba(255,255,255,.4);
  background: transparent; color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; text-align: center;
}
.ffs-endbtn.primary { background: var(--primary, #E4032C); border-color: var(--primary, #E4032C); }
.ffs-toast {
  position: absolute; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 8; background: rgba(0,0,0,.8);
  padding: 8px 14px; border-radius: 18px; font-size: 13px;
}
.ffs-noscript { position: relative; z-index: 9; background: #fff; color: #111; padding: 16px; height: 100%; overflow: auto; }
.ffs-noscript img { max-width: 100%; height: auto; display: block; margin: 6px 0; }
@media (prefers-reduced-motion: reduce) { .ffs-slide { animation: none; } }

/* Links inside the viewer / rail are buttons, not underlined text */
.ffs-viewer a, .ffs-card, .ffs-card:hover { text-decoration: none; }
