/* ============================================================
   site.css — shared base + rewarded-video paywall UI
   Brand colors come from per-page CSS via custom properties:
   --brand, --brand-ink, --paper, --ink, --muted, --rule
   ============================================================ */

:root {
  --brand: #1a73e8;
  --brand-ink: #ffffff;
  --paper: #ffffff;
  --ink: #16181d;
  --muted: #6b7280;
  --rule: #e6e7ea;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }

.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.ui { font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }

/* ---------- Paywall gate (blur + fade over locked content) ---------- */
.gated-wrap { position: relative; }
.article-gated { transition: filter .55s ease; }

.is-locked .article-gated {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}
.is-locked .gated-wrap { max-height: 760px; overflow: hidden; }

.gate-screen {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  background: rgba(243,245,249,.55);
  -webkit-backdrop-filter: blur(8px) saturate(106%);
  backdrop-filter: blur(8px) saturate(106%);
}
.gate-screen.armed { display: flex; animation: gateFade .4s ease both; }
@keyframes gateFade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Locker card (centered, full-width takeover) ---------- */
.reward-locker {
  width: min(540px, 100%);
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 20px;
  padding: 38px 40px 30px;
  text-align: center;
  box-shadow: 0 44px 100px -34px rgba(15,23,42,.55), 0 14px 34px -18px rgba(15,23,42,.38);
  opacity: 0; transform: translateY(22px) scale(.965);
  transition: opacity .45s ease, transform .55s cubic-bezier(.2,.75,.2,1);
}
.gate-screen.armed .reward-locker { opacity: 1; transform: none; }

.lock-badge {
  width: 62px; height: 62px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--brand) 14%, #fff);
  color: var(--brand);
}
.lock-badge svg { width: 26px; height: 26px; display: block; }

.reward-locker h3 {
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-weight: 800;
  font-size: 25px;
  line-height: 1.18;
  letter-spacing: -.01em;
  margin: 0 0 8px;
  color: var(--ink);
}
.reward-locker p {
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 auto 18px;
  max-width: 340px;
}
.reward-locker p b { color: var(--ink); font-weight: 700; }

.quota {
  display: flex; align-items: center; justify-content: center;
  gap: 7px; margin: 0 0 20px;
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
}
.quota .dots { display: inline-flex; gap: 5px; }
.quota .dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); display: inline-block; }
.quota .dots i.open { background: color-mix(in srgb, var(--brand) 22%, #fff); }

.rv-cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%;
  border: 0; border-radius: 11px;
  padding: 15px 22px;
  background: var(--brand); color: var(--brand-ink);
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-weight: 800; font-size: 16px; letter-spacing: .01em;
  box-shadow: 0 12px 26px -12px color-mix(in srgb, var(--brand) 70%, transparent);
  transition: transform .12s ease, filter .15s ease;
}
.rv-cta:hover { filter: brightness(1.06); transform: translateY(-1px); }
.rv-cta:active { transform: translateY(0); }
.rv-cta svg { width: 19px; height: 19px; }

.rv-later {
  display: inline-block;
  margin-top: 14px;
  background: none; border: 0;
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 13.5px; font-weight: 600; color: var(--muted);
  text-decoration: underline; text-underline-offset: 3px;
}
.rv-later:hover { color: var(--ink); }

.rv-foot {
  margin-top: 18px; padding-top: 15px;
  border-top: 1px solid var(--rule);
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
  color: #9aa1ab;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.rv-foot svg { width: 13px; height: 13px; }

/* ---------- Floating re-prompt bar (after "Maybe later") ---------- */
.rv-floating {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 60;
  display: none;
  align-items: center; gap: 16px;
  padding: 13px clamp(16px, 4vw, 40px);
  background: #0c0f14; color: #fff;
  box-shadow: 0 -10px 30px -12px rgba(0,0,0,.5);
}
.rv-floating.show { display: flex; animation: barUp .35s ease both; }
@keyframes barUp { from { transform: translateY(100%); } to { transform: none; } }
.rv-floating .txt { font-family: "Source Sans 3", system-ui, sans-serif; font-size: 14.5px; line-height: 1.3; flex: 1; }
.rv-floating .txt b { color: #fff; }
.rv-floating .txt span { color: #9aa6b4; }
.rv-floating button {
  flex: none; border: 0; border-radius: 9px;
  padding: 11px 18px; background: var(--brand); color: var(--brand-ink);
  font-family: "Source Sans 3", system-ui, sans-serif; font-weight: 800; font-size: 14px;
}
.rv-floating button:hover { filter: brightness(1.07); }

/* ---------- Fullscreen rewarded player ---------- */
.rv-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: #000;
  display: none;
  font-family: "Source Sans 3", system-ui, -apple-system, sans-serif;
}
.rv-overlay.show { display: block; animation: rvFade .25s ease both; }
@keyframes rvFade { from { opacity: 0; } to { opacity: 1; } }

.rv-stage {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: #000; overflow: hidden;
}
.rv-video { max-width: 100%; max-height: 100%; width: auto; height: auto; background: #000; display: block; }

.rv-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(to bottom, rgba(0,0,0,.62), rgba(0,0,0,0));
  color: #fff; z-index: 5;
}
.rv-badge {
  font-size: 10.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  background: rgba(255,255,255,.16); padding: 6px 10px; border-radius: 6px;
}
.rv-status { font-size: 14px; opacity: .96; }
.rv-status b { font-variant-numeric: tabular-nums; }
.rv-spacer { flex: 1; }
.rv-mute {
  width: 42px; height: 42px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.16); color: #fff;
  display: grid; place-items: center;
}
.rv-mute:hover { background: rgba(255,255,255,.26); }
.rv-mute svg { width: 20px; height: 20px; }

.rv-skip {
  position: absolute; right: 20px; bottom: 34px; z-index: 6;
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid rgba(255,255,255,.28); border-radius: 999px;
  padding: 12px 20px;
  background: rgba(18,18,20,.66); color: #fff;
  font-weight: 700; font-size: 14px; letter-spacing: .01em;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background .15s ease, opacity .2s ease;
}
.rv-skip[disabled] { opacity: .6; cursor: default; }
.rv-skip:not([disabled]):hover { background: rgba(40,40,44,.85); }
.rv-skip b { font-variant-numeric: tabular-nums; }
.rv-skip.claim { background: #fff; color: #0b1220; border-color: #fff; font-weight: 800; }
.rv-skip svg { width: 16px; height: 16px; }

.rv-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(255,255,255,.18); z-index: 6; }
.rv-bar-fill { height: 100%; width: 0; background: var(--brand); }

.rv-unmute-hint {
  position: absolute; left: 50%; bottom: 90px; transform: translateX(-50%);
  z-index: 6; display: none; align-items: center; gap: 8px;
  background: rgba(255,255,255,.92); color: #0b1220;
  padding: 9px 15px; border-radius: 999px; font-weight: 700; font-size: 13px;
  box-shadow: 0 8px 24px -10px rgba(0,0,0,.5);
}
.rv-unmute-hint.show { display: inline-flex; }
.rv-unmute-hint svg { width: 16px; height: 16px; }

/* ---------- Fallback animated house ad (only if video can't load) ---------- */
.rv-housead {
  position: absolute; inset: 0; display: none;
  flex-direction: column; align-items: center; justify-content: center;
  text-align: center; color: #fff; overflow: hidden;
  background: radial-gradient(130% 120% at 28% 18%, #1e4a6e 0%, #0a1622 58%), #0a1622;
}
.rv-housead.show { display: flex; }
.rv-housead .blob { position: absolute; border-radius: 50%; filter: blur(36px); opacity: .55; }
.rv-housead .b1 { width: 360px; height: 360px; background: #2f7fc4; top: -80px; left: -60px; animation: float1 9s ease-in-out infinite; }
.rv-housead .b2 { width: 300px; height: 300px; background: #14c4a8; bottom: -90px; right: -50px; animation: float2 11s ease-in-out infinite; }
@keyframes float1 { 50% { transform: translate(60px, 40px); } }
@keyframes float2 { 50% { transform: translate(-50px, -30px); } }
.rv-housead .ha-kicker { position: relative; font-size: 12px; letter-spacing: .32em; text-transform: uppercase; opacity: .8; margin-bottom: 14px; animation: haIn .8s .1s ease both; }
.rv-housead .ha-brand { position: relative; font-family: "Playfair Display", Georgia, serif; font-weight: 800; font-size: clamp(40px, 8vw, 84px); line-height: 1; letter-spacing: .02em; animation: haIn .9s .25s ease both; }
.rv-housead .ha-tag { position: relative; font-size: clamp(15px, 2.4vw, 20px); opacity: .9; margin-top: 14px; animation: haIn .9s .5s ease both; }
.rv-housead .ha-cta { position: relative; margin-top: 26px; border: 1.5px solid rgba(255,255,255,.7); border-radius: 999px; padding: 12px 26px; font-weight: 700; font-size: 14px; letter-spacing: .04em; animation: haIn .9s .75s ease both, pulse 2.4s 1.4s ease-in-out infinite; }
@keyframes haIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(255,255,255,.08); } }

/* ---------- Reward toast ---------- */
.rv-toast {
  position: fixed; top: 20px; left: 50%;
  transform: translateX(-50%) translateY(-24px);
  z-index: 10000; opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 11px;
  background: #0e2a1c; color: #e9fff3; border: 1px solid #2f8d5b;
  padding: 13px 20px 13px 16px; border-radius: 13px;
  font-family: "Source Sans 3", system-ui, sans-serif; font-weight: 600; font-size: 14.5px;
  box-shadow: 0 18px 44px -18px rgba(0,0,0,.55);
  transition: opacity .4s ease, transform .4s cubic-bezier(.2,.8,.2,1);
}
.rv-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.rv-toast .chk { width: 26px; height: 26px; flex: none; border-radius: 50%; background: #29a866; display: grid; place-items: center; }
.rv-toast .chk svg { width: 15px; height: 15px; color: #fff; }
.rv-toast small { display: block; font-weight: 400; opacity: .8; font-size: 12.5px; }

/* ---------- Demo reset control ---------- */
.demo-reset {
  position: fixed; left: 16px; bottom: 16px; z-index: 85;
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(15,18,24,.86); color: #fff;
  border: 1px solid rgba(255,255,255,.2); border-radius: 999px;
  padding: 9px 15px 9px 12px;
  font-family: "Source Sans 3", system-ui, sans-serif; font-weight: 700; font-size: 12.5px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 10px 28px -12px rgba(0,0,0,.55);
}
.demo-reset:hover { background: rgba(28,32,40,.94); }
.demo-reset svg { width: 15px; height: 15px; }
.demo-reset .tag { background: var(--brand); color: var(--brand-ink); font-size: 9.5px; font-weight: 800; letter-spacing: .1em; padding: 3px 6px; border-radius: 5px; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .rv-skip { right: 14px; bottom: 24px; padding: 11px 17px; }
  .reward-locker { padding: 26px 20px 20px; }
  .rv-floating { gap: 12px; }
  .rv-floating .txt { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
