/* The4210 Studio — the public sermon site (apps/studio). Hand-written and
   independent of the main app's Tailwind build. A dark screening-room look:
   artwork and video carry the colour; the chrome stays quiet. */
:root {
  --bg: #11151c;
  --panel: #181d26;
  --line: #262d3a;
  --ink: #eef1f6;
  --muted: #9aa3b2;
  --accent: #e9b949;
  --live: #e5484d;
  --display: "Familjen Grotesk", "Segoe UI", system-ui, sans-serif;
  --body: "Inter", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body);
       font-size: 16px; line-height: 1.55; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; text-wrap: balance;
             letter-spacing: -0.01em; }
h1 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.02rem; font-weight: 600; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.s-wrap { max-width: 1200px; margin: 0 auto; padding-inline: 20px; }
.s-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Top bar */
.s-top { border-bottom: 1px solid var(--line); background: rgb(17 21 28 / 0.92);
         position: sticky; top: 0; z-index: 10; backdrop-filter: blur(8px); }
.s-top__row { display: flex; align-items: center; justify-content: space-between; gap: 16px;
              padding-block: 14px; flex-wrap: wrap; }
.s-brand { display: flex; align-items: center; gap: 12px; text-decoration: none;
           font-family: var(--display); font-weight: 700; font-size: 1.1rem; }
.s-brand__logo { width: 34px; height: 34px; object-fit: contain; border-radius: 6px;
                 background: #fff; padding: 3px; }
.s-brand small { display: block; font-family: var(--body); font-weight: 500; font-size: 0.75rem;
                 color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.s-nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.s-nav a { text-decoration: none; padding: 7px 12px; border-radius: 999px; font-weight: 500;
           font-size: 0.95rem; color: var(--muted); }
.s-nav a:hover, .s-nav a[aria-current="page"] { color: var(--ink); background: var(--panel); }
.s-nav a.s-live { color: var(--ink); border: 1px solid var(--line); display: inline-flex;
                  align-items: center; gap: 8px; }
.s-live i, .s-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live);
                    display: inline-block; flex: none; }

/* Hero: the latest message */
.s-main { min-height: 60vh; }
.s-hero { padding-block: 32px; background: linear-gradient(180deg, var(--panel), var(--bg)); }
.s-hero__grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 32px;
                align-items: center; }
.s-hero__text { display: grid; gap: 10px; justify-items: start; min-width: 0; }
.s-hero__text p { margin: 0; }
.s-player { aspect-ratio: 16 / 9; width: 100%; max-width: 100%; border-radius: 12px; overflow: hidden;
            background: #000; display: grid; place-items: center; }
.s-player iframe { width: 100%; height: 100%; border: 0; }
.s-player img { width: 100%; height: 100%; object-fit: cover; }

.s-eyebrow { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
             color: var(--accent); }
.s-meta { color: var(--muted); font-size: 0.9rem; margin: 4px 0 0; }
.s-scripture { font-family: var(--display); font-size: 1.05rem; color: var(--ink); margin: 0; }
.s-chip { display: inline-block; text-decoration: none; font-size: 0.85rem; font-weight: 500;
          border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; color: var(--ink); }
.s-chip:hover { border-color: var(--accent); }
.s-btn { display: inline-block; text-decoration: none; background: var(--accent); color: #1b1404;
         font-weight: 600; border: 0; border-radius: 8px; padding: 10px 18px; font-size: 0.95rem;
         cursor: pointer; font-family: var(--body); }
.s-btn:hover { filter: brightness(1.08); }

/* On-air label: grey before the service, tally red while live */
.s-onair { display: inline-flex; align-items: center; gap: 8px; font-size: 0.78rem; font-weight: 700;
           letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.s-onair i { width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.s-onair.is-live { color: var(--live); }
.s-live-block { min-width: 0; }
.s-countdown { display: grid; gap: 8px; justify-items: center; text-align: center; padding: 20px;
               color: var(--muted); }
.s-countdown strong { font-family: var(--display); font-size: clamp(2.4rem, 6vw, 3.6rem);
                      color: var(--ink); line-height: 1; }
.s-hero__text p a { color: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .s-onair.is-live i { animation: s-pulse 1.6s ease-in-out infinite; }
}
@keyframes s-pulse { 50% { opacity: 0.35; } }

/* Live band */
.s-band { border-block: 1px solid var(--line); }
.s-band__row { display: flex; justify-content: space-between; align-items: center; gap: 12px;
               flex-wrap: wrap; padding-block: 14px; }
.s-band p { margin: 0; display: flex; align-items: center; gap: 10px; font-weight: 500; }
.s-band a { color: var(--accent); text-decoration: none; font-weight: 500; }

/* Sections and grids */
.s-section { padding-block: 36px; }
.s-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
          margin-bottom: 18px; flex-wrap: wrap; }
.s-head a { color: var(--muted); text-decoration: none; font-size: 0.92rem; }
.s-head a:hover { color: var(--ink); }
.s-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 24px 20px; }
.s-card { text-decoration: none; display: grid; gap: 10px; align-content: start; min-width: 0; }
.s-card:hover h3 { color: var(--accent); }
.s-card__body { display: grid; gap: 3px; min-width: 0; }
.s-art { aspect-ratio: 16 / 9; max-width: 100%; border-radius: 10px; overflow: hidden;
         background: linear-gradient(135deg, #2a3242, #1a1f29); display: grid; place-items: center; }
.s-art img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s ease; }
.s-card:hover .s-art img { transform: scale(1.03); }
.s-art__blank { font-family: var(--display); font-weight: 700; text-align: center; padding: 12px;
                color: var(--ink); font-size: 1rem; }

/* Filter */
.s-filter { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.s-filter input, .s-filter select { font: inherit; color: var(--ink); background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; min-width: 0; }
.s-filter input { flex: 1 1 260px; }
.s-filter select { flex: 0 1 240px; }
.s-pages { display: flex; justify-content: space-between; align-items: center; margin-top: 32px;
           color: var(--muted); font-size: 0.92rem; }
.s-pages a { color: var(--accent); text-decoration: none; font-weight: 500; }

/* Detail and series pages */
.s-detail { display: grid; gap: 20px; max-width: 980px; }
.s-detail__text { display: grid; gap: 10px; justify-items: start; }
.s-detail__text audio { width: 100%; margin-top: 8px; }
.s-back { color: var(--muted); text-decoration: none; font-size: 0.92rem; }
.s-back:hover { color: var(--ink); }
.s-prose { color: #cfd5df; max-width: 65ch; }
.s-prose p { margin: 0 0 0.8em; }
.s-series { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 28px;
            align-items: center; margin: 16px 0 36px; }
.s-empty { text-align: center; padding-block: 48px; color: var(--muted); display: grid; gap: 12px;
           justify-items: center; }
.s-empty h1 { color: var(--ink); }

/* Footer */
.s-foot { border-top: 1px solid var(--line); margin-top: 24px; }
.s-foot__row { display: flex; justify-content: space-between; align-items: center; gap: 16px;
               flex-wrap: wrap; padding-block: 28px; }
.s-foot p { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }
.s-foot a { color: var(--muted); }
.s-foot__site { text-decoration: none; font-weight: 500; }
.s-foot__links { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.s-foot__staff { font-size: 0.85rem; text-decoration: none; opacity: 0.75; }
.s-foot__staff:hover { opacity: 1; text-decoration: underline; }

@media (max-width: 820px) {
  .s-hero__grid, .s-series { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .s-wrap { padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .s-art img { transition: none; }
  .s-card:hover .s-art img { transform: none; }
}

/* ---- Studio management pages (/manage/) — same palette, working layout ---- */
.m-body { min-height: 100vh; }
.m-top { border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 10; }
.m-top__row { max-width: 1200px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center;
              gap: 20px; flex-wrap: wrap; }
.m-brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700;
           text-decoration: none; font-size: 1.05rem; }
.m-brand small { color: var(--accent); font-weight: 600; }
.m-mark { width: 30px; height: 30px; border-radius: 7px; background: var(--ink); color: var(--bg);
          display: grid; place-items: center; font-size: 0.66rem; font-family: ui-monospace, Consolas, monospace; }
.m-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.m-nav a { text-decoration: none; color: var(--muted); padding: 7px 12px; border-radius: 8px; font-weight: 500; }
.m-nav a:hover, .m-nav a[aria-current="page"] { color: var(--ink); background: var(--bg); }
.m-user { margin-left: auto; display: flex; gap: 16px; align-items: center; font-size: 0.9rem; }
.m-user a { color: var(--muted); text-decoration: none; }
.m-user form { margin: 0; }
.m-link { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 0;
          text-decoration: underline; }
.m-main { max-width: 1200px; margin: 0 auto; padding: 28px 20px 60px; display: grid; gap: 20px; }
.m-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; }
.m-head h1 { font-size: 1.8rem; }
.m-sub { color: var(--muted); font-size: 0.9rem; margin: 4px 0 0; }
.m-label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.m-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; min-width: 0; }
.m-card h2 { font-size: 1.1rem; margin-bottom: 10px; }
.m-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.m-tile { display: grid; gap: 4px; text-decoration: none; }
.m-tile strong { font-family: var(--display); font-size: 1.9rem; }
.m-tile:hover { border-color: var(--accent); }
.m-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.m-rows { list-style: none; margin: 0; padding: 0; }
.m-rows li { border-top: 1px solid var(--line); }
.m-rows li:first-child { border-top: 0; }
.m-rows a { display: grid; gap: 2px; padding: 10px 0; text-decoration: none; }
.m-rows a:hover b { color: var(--accent); }
.m-onair { display: inline-flex; align-items: center; gap: 8px; }
.m-onair i { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.m-onair.is-live { color: var(--live); }
.m-onair.is-live i { background: var(--live); }
.m-tile .m-onair { font-size: 1.4rem; }
.m-btn { display: inline-block; background: var(--accent); color: #1b1404; border: 0; border-radius: 8px;
         padding: 9px 16px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.m-btn:hover { filter: brightness(1.08); }
.m-btn[disabled] { opacity: 0.5; cursor: default; }
.m-btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.m-btn--wide { width: 100%; text-align: center; }
.m-messages { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.m-msg { padding: 10px 14px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); }
.m-msg--success { border-color: #2f7d4f; }
.m-msg--warning, .m-msg--error { border-color: var(--live); }
.m-filter { display: flex; gap: 10px; flex-wrap: wrap; }
.m-filter input, .m-filter select { font: inherit; color: var(--ink); background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; min-width: 0; }
.m-filter input { flex: 1 1 240px; }
.m-table-wrap { padding: 0; overflow-x: auto; }
.m-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.m-table th { text-align: left; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
              color: var(--muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.m-table td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.m-table tr:last-child td { border-bottom: 0; }
.m-table a { color: var(--ink); }
.m-table td:last-child a { color: var(--accent); text-decoration: none; }
.m-num { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.m-pill { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px;
          background: var(--bg); color: var(--muted); }
.m-pill--ok { color: #6fd39a; }
.m-pill--warn { color: var(--accent); }
.m-pages { display: flex; justify-content: space-between; color: var(--muted); font-size: 0.9rem; }
.m-pages a { color: var(--accent); text-decoration: none; }
.m-back { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.m-edit { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.m-preview { margin-top: 10px; }
.m-narrow { max-width: 720px; }
/* Posting Sunday's sermon: one column, the stream on top, thumb-sized button. */
.m-post { display: grid; gap: 16px; max-width: 640px; }
.m-post .m-btn--wide { padding: 14px 16px; font-size: 1.05rem; }
.m-callout { display: flex; justify-content: space-between; align-items: center; gap: 16px;
             flex-wrap: wrap; border-color: var(--accent); }
.m-callout h2 { margin: 0; }
.m-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.m-series { display: grid; gap: 6px; text-decoration: none; padding: 12px; }
.m-series:hover { border-color: var(--accent); }

/* Forms */
.m-form { display: grid; gap: 16px; }
.m-field { display: grid; gap: 6px; }
.m-field > label { font-weight: 600; font-size: 0.92rem; }
.m-field .input { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line);
                  border-radius: 8px; padding: 9px 12px; width: 100%; max-width: 100%; }
.m-field textarea.input { resize: vertical; }
.m-field .input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.m-field input[type="file"] { color: var(--muted); font-size: 0.9rem; max-width: 100%; }
.m-field--check label { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.m-field--check input { width: 18px; height: 18px; accent-color: var(--accent); }
.m-field ul, .m-field div[id] { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.m-field ul label, .m-field div[id] label { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.m-field input[type="radio"] { accent-color: var(--accent); width: 17px; height: 17px; }
.m-help { color: var(--muted); font-size: 0.84rem; margin: 0; }
.m-error { color: #ff8a8f; font-size: 0.86rem; margin: 0; }
.m-error--box { border: 1px solid var(--live); border-radius: 8px; padding: 10px 12px; }
.has-error .input { border-color: var(--live); }
.m-actions { display: flex; gap: 16px; align-items: center; }
.m-field input.input[type="date"] { color-scheme: dark; }

/* Sign-in pages */
.m-auth { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px; padding: 24px 16px; }
.m-auth__card { width: min(420px, 100%); display: grid; gap: 14px; }
.m-auth__card h1 { font-size: 1.5rem; }
.m-auth__card p { margin: 0; }
.m-auth__card a { color: var(--accent); }
.m-auth__back { color: var(--muted); text-decoration: none; font-size: 0.9rem; }

@media (max-width: 820px) {
  .m-tiles, .m-grid2, .m-edit { grid-template-columns: minmax(0, 1fr); }
  .m-user { margin-left: 0; }
}

/* Stream page */
.m-relay { margin: 6px 0 0; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.m-relay .m-onair { font-size: 1.2rem; }
.m-kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 14px; margin: 14px 0; }
.m-kv dt { color: var(--muted); font-size: 0.85rem; padding-top: 6px; }
.m-kv dd { margin: 0; min-width: 0; }
.m-code { display: block; background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
          padding: 7px 10px; font-family: ui-monospace, Consolas, monospace; font-size: 0.86rem;
          overflow-x: auto; white-space: nowrap; user-select: all; }
.m-reveal summary { cursor: pointer; color: var(--accent); padding: 6px 0; }
.m-reveal .m-code { margin-top: 6px; }
.m-dest { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.m-dest form { margin: 0; }
.m-toggle { border: 1px solid var(--line); cursor: pointer; font: inherit; font-size: 0.8rem; font-weight: 600; }


/* the4210 Studio logo (static/images/studio-logo.webp, transparent, 720x291) */
.s-brand__img { height: 52px; width: auto; display: block; }
.m-logo { height: 34px; width: auto; display: block; }
.m-brand small { font-family: var(--body); font-size: 0.72rem; letter-spacing: 0.1em;
                 text-transform: uppercase; color: var(--muted); font-weight: 600; }
.m-brand--auth .m-logo { height: 64px; }
@media (max-width: 560px) { .s-brand__img { height: 42px; } }

/* iPhone notch and home indicator. The templates set viewport-fit=cover and
   the iOS app draws edge to edge, so keep content inside the safe area.
   Every env() is 0 on screens without one. */
body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
.s-top, .m-top { padding-top: env(safe-area-inset-top); }
.s-foot { padding-bottom: env(safe-area-inset-bottom); }
.m-auth { padding-top: max(24px, env(safe-area-inset-top));
          padding-bottom: max(24px, env(safe-area-inset-bottom)); }

/* Notifications card: only inside the4210 studio iOS app (studio-app.js) */
.s-apppush { margin-top: 24px; }
.s-apppush[hidden], .s-apppush [hidden] { display: none; }
.s-apppush__card { display: flex; align-items: center; justify-content: space-between; gap: 16px;
                   flex-wrap: wrap; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.s-apppush__card p { margin: 4px 0 0; color: var(--muted); font-size: 0.92rem; }
.s-apppush__off { background: none; border: 0; color: var(--muted); font: inherit; font-size: 0.9rem;
                  text-decoration: underline; cursor: pointer; padding: 6px 0; }

/* Privacy page */
.s-privacy h2 { font-family: var(--display); font-size: 1.15rem; color: var(--ink); margin: 1.6em 0 0.4em; }
.s-privacy ul { margin: 0 0 0.8em; padding-left: 1.2em; }
.s-privacy a { color: var(--accent); }

/* Header Staff link: inside the app only (data-app-only, studio-app.js) */
.s-nav a[hidden] { display: none; }
