/* ---- Theme ----
   Page (cream), text (ink) and cards (white) are CSS variables used by the
   Tailwind config in src/views/layout.tsx, so dark mode is one swap here.
   Light by default; dark follows the system unless the viewer picked one
   (html[data-theme], set by the theme toggle). */
:root {
  color-scheme: light;
  --c-cream: 255 248 240;
  --c-ink: 43 37 32;
  --c-surface: 255 255 255;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --c-cream: 24 21 19;
    --c-ink: 240 235 228;
    --c-surface: 34 30 27;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --c-cream: 24 21 19;
  --c-ink: 240 235 228;
  --c-surface: 34 30 27;
}

/* Cuppa custom polish on top of Tailwind */
:root { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; }

.font-display { font-family: 'Poppins', system-ui, sans-serif; }

.hero-gradient {
  background:
    radial-gradient(900px 400px at 80% -10%, color-mix(in srgb, var(--brand, #ff5e5b) 22%, transparent), transparent),
    radial-gradient(700px 360px at 0% 0%, #ffe9d6, transparent);
}

/* Photo hero (landing page) — landscape image, figure on the LEFT. */
.hero-photo {
  background-image: url('/hero.jpg');
  background-size: cover;
  background-position: left center;
  background-repeat: no-repeat;
}
/* Mobile: light cream wash over the whole image so centered text stays legible. */
.hero-photo-overlay {
  background: linear-gradient(
    180deg,
    rgba(255, 248, 240, 0.88) 0%,
    rgba(255, 248, 240, 0.74) 50%,
    rgba(255, 248, 240, 0.90) 100%
  );
}
@media (min-width: 768px) {
  /* Text lives in the right-hand cream space; fade from transparent on the left
     (over the figure) to near-opaque cream on the right (behind the text). */
  .hero-photo-overlay {
    background: linear-gradient(
      90deg,
      rgba(255, 248, 240, 0) 0%,
      rgba(255, 248, 240, 0.05) 22%,
      rgba(255, 248, 240, 0.45) 44%,
      rgba(255, 248, 240, 0.92) 66%,
      rgba(255, 248, 240, 0.97) 100%
    );
  }
}

.coffee-btn { transition: transform .08s ease, box-shadow .2s ease; }
.coffee-btn:active { transform: translateY(1px) scale(.99); }

.tier-card { transition: border-color .15s ease, transform .15s ease; }
.tier-card:hover { transform: translateY(-2px); }

.locked-post { position: relative; }
.locked-post .locked-body {
  filter: blur(6px); user-select: none; pointer-events: none; max-height: 7rem; overflow: hidden;
}
.locked-overlay {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: linear-gradient(180deg, transparent, rgba(255,248,240,.92) 70%);
}

.prose-cuppa a { color: var(--brand, #ff5e5b); text-decoration: underline; }

/* Custom video player: the control bar fades in on hover and whenever the
   video is paused; it stays visible while a speed/settings menu is open. */
.st-video .st-video-bar {
  opacity: 0; transition: opacity .18s ease; pointer-events: none;
}
.st-video:hover .st-video-bar,
.st-video:focus-within .st-video-bar,
.st-video:not(.is-playing) .st-video-bar {
  opacity: 1; pointer-events: auto;
}
.st-video video { cursor: pointer; }
.st-video:fullscreen { display: grid; place-items: center; background: #000; }
.st-video:fullscreen video { max-height: 100vh; width: auto; max-width: 100vw; }

/* Zoom slider drawn on the banner / profile picture in the page editor
   (shows on hover; dragging the picture repositions it). */
.frame-zoom {
  -webkit-appearance: none; appearance: none;
  height: 4px; margin: 0; padding: 0; cursor: pointer; z-index: 3;
  background: rgba(255, 255, 255, 0.6); border-radius: 999px;
}
.frame-zoom::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--brand, #ff5e5b); border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.4); cursor: pointer;
}
.frame-zoom::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--brand, #ff5e5b); border: 2px solid #fff; cursor: pointer;
}

/* Dashboard charts (src/views/charts.tsx). Members = blue, tips = orange
   (dataviz reference slots 1–2, validated for colour-blind separation);
   totals in ink, counts in neutral grey. Text never uses series colours. */
.viz-total { --viz: #2b2520; }
.viz-members { --viz: #2a78d6; }
.viz-tips { --viz: #eb6834; }
.viz-neutral { --viz: #8a8580; }
.viz-line { fill: none; stroke: var(--viz); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-area { fill: var(--viz); opacity: 0.08; stroke: none; }
.viz-spark { fill: none; stroke: var(--viz); stroke-width: 1.75; stroke-linejoin: round; }
.viz-bar { fill: var(--viz); stroke: none; }
.viz-dot { fill: var(--viz); stroke: rgb(var(--c-surface)); stroke-width: 2; opacity: 0; }
[data-col]:hover .viz-dot { opacity: 1; }
.viz-swatch { background: var(--viz); }
.viz-grid { stroke: rgb(var(--c-ink) / 0.08); stroke-width: 1; }
.viz-baseline { stroke: rgb(var(--c-ink) / 0.3); stroke-width: 1; }
.viz-axis { fill: rgb(var(--c-ink) / 0.5); font-size: 11px; font-family: Inter, system-ui, sans-serif; }


/* ---- Dark mode: colours that aren't theme variables ---- */
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .hero-gradient { background: radial-gradient(900px 400px at 80% -10%, color-mix(in srgb, var(--brand, #ff5e5b) 28%, transparent), transparent), radial-gradient(700px 360px at 0% 0%, #3a2a20, transparent); }
  :root:where(:not([data-theme="light"])) .hero-photo-overlay { background: linear-gradient(180deg, rgba(24,21,19,.86), rgba(24,21,19,.72) 50%, rgba(24,21,19,.9)); }
  :root:where(:not([data-theme="light"])) .locked-overlay { background: linear-gradient(180deg, transparent, rgba(34,30,27,.94) 70%); }
}
:root[data-theme="dark"] .hero-gradient { background: radial-gradient(900px 400px at 80% -10%, color-mix(in srgb, var(--brand, #ff5e5b) 28%, transparent), transparent), radial-gradient(700px 360px at 0% 0%, #3a2a20, transparent); }
:root[data-theme="dark"] .hero-photo-overlay { background: linear-gradient(180deg, rgba(24,21,19,.86), rgba(24,21,19,.72) 50%, rgba(24,21,19,.9)); }
:root[data-theme="dark"] .locked-overlay { background: linear-gradient(180deg, transparent, rgba(34,30,27,.94) 70%); }
@media (min-width: 768px) {
  :root[data-theme="dark"] .hero-photo-overlay { background: linear-gradient(90deg, rgba(24,21,19,0) 0%, rgba(24,21,19,.1) 22%, rgba(24,21,19,.55) 44%, rgba(24,21,19,.92) 66%, rgba(24,21,19,.97) 100%); }
}

/* Status tints (alerts, trend badges) — darker fills, lighter text. */
:root[data-theme="dark"] .bg-green-50 { background-color: rgba(34,197,94,.14); }
:root[data-theme="dark"] .text-green-700 { color: #6ee7a0; }
:root[data-theme="dark"] .border-green-200 { border-color: rgba(34,197,94,.35); }
:root[data-theme="dark"] .bg-red-50 { background-color: rgba(239,68,68,.14); }
:root[data-theme="dark"] .text-red-700, :root[data-theme="dark"] .text-red-600 { color: #fca5a5; }
:root[data-theme="dark"] .border-red-200 { border-color: rgba(239,68,68,.35); }
:root[data-theme="dark"] .bg-blue-50 { background-color: rgba(59,130,246,.14); }
:root[data-theme="dark"] .text-blue-700 { color: #93c5fd; }
:root[data-theme="dark"] .border-blue-200 { border-color: rgba(59,130,246,.35); }
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .bg-green-50 { background-color: rgba(34,197,94,.14); }
  :root:where(:not([data-theme="light"])) .text-green-700 { color: #6ee7a0; }
  :root:where(:not([data-theme="light"])) .border-green-200 { border-color: rgba(34,197,94,.35); }
  :root:where(:not([data-theme="light"])) .bg-red-50 { background-color: rgba(239,68,68,.14); }
  :root:where(:not([data-theme="light"])) .text-red-700, :root:where(:not([data-theme="light"])) .text-red-600 { color: #fca5a5; }
  :root:where(:not([data-theme="light"])) .border-red-200 { border-color: rgba(239,68,68,.35); }
  :root:where(:not([data-theme="light"])) .bg-blue-50 { background-color: rgba(59,130,246,.14); }
  :root:where(:not([data-theme="light"])) .text-blue-700 { color: #93c5fd; }
  :root:where(:not([data-theme="light"])) .border-blue-200 { border-color: rgba(59,130,246,.35); }
}

/* Charts: dark steps of the same hues (validated on #221e1b), ink-based grid. */
:root[data-theme="dark"] .viz-members { --viz: #3987e5; }
:root[data-theme="dark"] .viz-tips { --viz: #d95926; }
:root[data-theme="dark"] .viz-total { --viz: #f0ebe4; }
:root[data-theme="dark"] .viz-neutral { --viz: #9c958d; }
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .viz-members { --viz: #3987e5; }
  :root:where(:not([data-theme="light"])) .viz-tips { --viz: #d95926; }
  :root:where(:not([data-theme="light"])) .viz-total { --viz: #f0ebe4; }
  :root:where(:not([data-theme="light"])) .viz-neutral { --viz: #9c958d; }
}
