/* =========================================================================
   BriefNepal Discover feed — /discover (discover.php + js/discover.js)
   One full-height card per screen with CSS scroll-snap. --disc-top is the
   sticky nav's height, measured by js/discover.js, so a card fills exactly
   the visible area beneath it.
   ========================================================================= */

.disc { position: relative; background: var(--ink-2); }

.disc__feed {
  height: calc(100vh - var(--disc-top, 52px));
  height: calc(100svh - var(--disc-top, 52px));
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  outline: none;
}
.disc__feed::-webkit-scrollbar { display: none; }
.disc__feed:focus-visible { box-shadow: inset 0 0 0 3px var(--brand); }
.disc__sentinel { height: 1px; }

/* ---------- HUD (count + saved) ---------- */
.disc__hud {
  position: absolute; top: 12px; left: 16px; right: 16px; z-index: 5;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  pointer-events: none;
}
.disc__count, .disc__savedbtn {
  pointer-events: auto;
  padding: 7px 12px; border-radius: 999px;
  background: rgba(15, 22, 32, .55); color: #fff; backdrop-filter: blur(6px);
  font: inherit; font-size: .82rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.disc__savedbtn { border: 0; cursor: pointer; }
.disc__savedbtn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* ---------- card ---------- */
.disc-card {
  position: relative; height: 100%;
  scroll-snap-align: start; scroll-snap-stop: always;
  overflow: hidden; color: #fff;
  background: var(--disc-grad, linear-gradient(135deg, #034ea2 0%, #0f6fb5 100%));
}
.disc-card__img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
}
.disc-card__img--grad { display: grid; place-items: center; background: var(--disc-grad); }
.disc-card__img--grad span { font-size: 6rem; opacity: .5; }
.disc-card__shade {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.35) 0%, rgba(0,0,0,0) 22%, rgba(0,0,0,0) 40%, rgba(0,0,0,.82) 100%);
}
.disc-card__body {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 0 16px calc(24px + env(safe-area-inset-bottom, 0px));
  max-width: 720px; margin: 0 auto;
}
@media (min-width: 720px) { .disc-card__body { padding-left: 32px; padding-right: 32px; } }
.disc-card__type { margin: 0 0 6px; font-size: .78rem; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; opacity: .9; }
.disc-card__name { font-family: var(--head); font-size: clamp(1.7rem, 6vw, 2.6rem); line-height: 1.15; text-shadow: 0 2px 12px rgba(0,0,0,.4); }
.disc-card__tag { margin: 8px 0 0; font-size: 1rem; line-height: 1.5; opacity: .95; max-width: 52ch; }
.disc-card__facts { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.disc-card__facts li {
  padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.16); backdrop-filter: blur(4px);
  font-size: .8rem; font-weight: 600;
}
.disc-card__actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; }

/* ---------- buttons ---------- */
.disc-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 10px 20px; border-radius: 999px;
  border: 2px solid rgba(255,255,255,.85); color: #fff; background: transparent;
  font-weight: 700; font-size: .95rem;
}
.disc-btn:hover { background: rgba(255,255,255,.12); }
.disc-btn:focus-visible, .disc-save:focus-visible, .disc-quiz__opt:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.disc-btn--primary { background: #fff; color: var(--brand); border-color: #fff; }
.disc-btn--primary:hover { background: #eef4fb; }

.disc-save {
  flex: none; width: 48px; height: 48px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.85); background: rgba(0,0,0,.2); color: #fff;
  font-size: 1.4rem; line-height: 1; cursor: pointer;
}
.disc-save.is-on { background: #fff; color: var(--accent); border-color: #fff; }
.disc-save.is-pop { animation: disc-pop .35s ease; }

/* ---------- interactive cards (quiz / fact / peak) ---------- */
.disc-card--quiz, .disc-card--fact, .disc-card--peak { display: grid; place-items: center; }
.disc-card--quiz { --disc-grad: linear-gradient(160deg, #034ea2 0%, #14202e 100%); }
.disc-card--fact { --disc-grad: linear-gradient(160deg, #d11a2a 0%, #6b0d16 100%); }
.disc-card--peak { --disc-grad: linear-gradient(160deg, #2c3e6b 0%, #4a6fa5 60%, #dfe8f5 100%); }
.disc-card__panel {
  width: 100%; max-width: 560px; padding: 60px 16px 24px;
  display: flex; flex-direction: column; gap: 12px; align-items: stretch;
}
.disc-card__q { font-family: var(--head); font-size: clamp(1.3rem, 4.8vw, 1.8rem); line-height: 1.3; }
.disc-card__fact { margin: 0; font-size: clamp(1.1rem, 4vw, 1.4rem); line-height: 1.5; font-weight: 600; }

.disc-quiz { display: grid; gap: 8px; }
.disc-quiz__opt {
  min-height: 50px; padding: 10px 14px; text-align: left; border-radius: 10px;
  border: 2px solid rgba(255,255,255,.4); background: rgba(255,255,255,.1); color: #fff;
  font: inherit; font-weight: 600; cursor: pointer;
}
.disc-quiz__opt:hover:not(:disabled) { background: rgba(255,255,255,.2); }
.disc-quiz__opt:disabled { cursor: default; }
.disc-quiz__opt.is-right { background: #1e8e3e; border-color: #1e8e3e; }
.disc-quiz__opt.is-wrong { background: var(--accent); border-color: var(--accent); }
.disc-quiz__fb { display: grid; gap: 10px; line-height: 1.5; }
.disc-quiz__fb p { margin: 0; }
.disc-quiz__verdict { font-weight: 800; }

/* ---------- swipe hint ---------- */
.disc__hint {
  position: absolute; left: 50%; top: 56px; z-index: 4; transform: translateX(-50%);
  margin: 0; padding: 6px 14px; border-radius: 999px;
  background: rgba(15,22,32,.55); color: #fff; font-size: .8rem; font-weight: 700;
  pointer-events: none; animation: disc-bob 1.6s ease-in-out infinite;
  transition: opacity .3s;
}
.disc__hint.is-gone { opacity: 0; }
.disc__noscript { color: #fff; padding: 16px; margin: 0; }
.disc__noscript a { color: #fff; text-decoration: underline; }

/* ---------- saved drawer ---------- */
.disc-noscroll { overflow: hidden; }
.disc-drawer {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(0,0,0,.5); display: flex; justify-content: flex-end;
}
.disc-drawer[hidden] { display: none; }
.disc-drawer__panel {
  width: min(420px, 100%); height: 100%; overflow-y: auto;
  background: var(--surface); color: var(--text); padding: 16px;
  box-shadow: -8px 0 24px rgba(0,0,0,.2);
}
.disc-drawer__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.disc-drawer__head h2 { font-family: var(--head); font-size: 1.2rem; color: var(--ink-2); }
.disc-drawer__close { border: 0; background: var(--bg); width: 40px; height: 40px; border-radius: 50%; font-size: 1rem; cursor: pointer; }
.disc-drawer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.disc-drawer__item { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; }
.disc-drawer__item img, .disc-drawer__emoji { flex: none; width: 56px; height: 56px; border-radius: 8px; object-fit: cover; }
.disc-drawer__emoji { display: grid; place-items: center; background: var(--bg); font-size: 1.6rem; }
.disc-drawer__item a { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.disc-drawer__item b { color: var(--ink-2); }
.disc-drawer__item small { color: var(--text-faint); }
.disc-drawer__item button { flex: none; border: 0; background: none; color: var(--text-faint); width: 36px; height: 36px; cursor: pointer; border-radius: 50%; }
.disc-drawer__item button:hover { background: var(--bg); color: var(--accent); }
.disc-drawer__empty { color: var(--text-soft); line-height: 1.5; }

@keyframes disc-pop { 0% { transform: scale(1); } 50% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes disc-bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -6px); } }
@media (prefers-reduced-motion: reduce) {
  .disc__hint { animation: none; }
  .disc-save.is-pop { animation: none; }
}
