/* LIGHT THEME TEST — Ivory / Forest / Champagne, 2026-10-28.
   Load AFTER the existing stylesheets. theme.css remains the unchanged baseline.
   All numeric channel changes include their original and experimental hex values.
   Fonts, spacing, images and behavior are unchanged. Media remains cinematic/dark.
   Compare: python3 tools/compare_theme.py public/theme-light-ivory.css
*/
:root {
  --preview-forest: #344B3C;
  --preview-forest-rgb: 52, 75, 60;
  --preview-premium: #E8C89F;
  --preview-premium-text: #25190D;
  --preview-border: #DDDDD3;
  --preview-backdrop-graphic: #EDE8DB; /* New decorative layer; ivory base stays #F7F5EF. */
  --theme-base-background-rgb: 247, 245, 239; /* #050506 → #F7F5EF */
  --theme-base-panel-rgb: 255, 253, 248; /* #111114 → #FFFDF8 */
  --theme-base-surface-rgb: 238, 236, 228; /* #1A1A1F → #EEECE4 */
  --theme-text-primary-rgb: 36, 40, 33; /* #F7F7F8 → #242821 */
  --theme-text-muted-rgb: 102, 107, 97; /* #8F8F98 → #666B61 */
  --theme-neutral-rgb: 36, 40, 33; /* #FFFFFF → #242821 */
  --theme-base-accent-rgb: 52, 75, 60; /* #FF2345 → #344B3C */
  --theme-base-accent-soft-rgb: 132, 99, 55; /* #FF8FA2 → #846337 */
  --theme-text-strong-rgb: 36, 40, 33; /* #FFFFFF → #242821 */
  --theme-base-search-shell-color-rgb: 102, 107, 97; /* #7E7E86 → #666B61 */
  --theme-base-search-shell-background-rgb: 238, 236, 228; /* #121215 → #EEECE4 */
  --theme-base-tab-text-rgb: 102, 107, 97; /* #777780 → #666B61 */
  --theme-base-subcategory-tabs-button-color-rgb: 102, 107, 97; /* #8B8B93 → #666B61 */
  --theme-base-chip-background-rgb: 238, 236, 228; /* #17171A → #EEECE4 */
  --theme-base-subcategory-tabs-button-active-border-color-rgb: 52, 75, 60; /* #DEDEE2 → #344B3C */
  --theme-base-count-color-rgb: 102, 107, 97; /* #74747C → #666B61 */
  --theme-navigation-mobile-rgb: 102, 107, 97; /* #62626A → #666B61 */
  --theme-policy-glow-rgb: 247, 245, 239; /* #F5233F → #F7F5EF */
  --theme-base-legal-page-eyebrow-color-rgb: 132, 99, 55; /* #EF8FA1 → #846337 */
  --theme-base-legal-page-p-color-rgb: 72, 78, 68; /* #B9B8BE → #484E44 */
  --theme-base-submit-rgb: 52, 75, 60; /* #E4163D → #344B3C */
  --theme-base-profile-edit-button-border-rgb: 221, 221, 211; /* #494950 → #DDDDD3 */
  --theme-base-button-background-rgb: 238, 236, 228; /* #202025 → #EEECE4 */
  --theme-base-profile-handle-color-rgb: 102, 107, 97; /* #9999A2 → #666B61 */
  --theme-base-profile-bio-color-rgb: 72, 78, 68; /* #E3E3E7 → #484E44 */
  --theme-base-profile-tags-span-border-rgb: 221, 221, 211; /* #FF4164 → #DDDDD3 */
  --theme-base-profile-tags-span-color-rgb: 52, 75, 60; /* #FFB5C2 → #344B3C */
  --theme-base-profile-tags-button-border-rgb: 221, 221, 211; /* #55555E → #DDDDD3 */
  --theme-base-profile-tags-button-color-rgb: 52, 75, 60; /* #D4D4D9 → #344B3C */
  --theme-base-profile-stats-span-color-rgb: 102, 107, 97; /* #A5A5AD → #666B61 */
  --theme-base-profile-edit-dialog-border-rgb: 221, 221, 211; /* #46464E → #DDDDD3 */
  --theme-base-profile-edit-heading-button-color-rgb: 102, 107, 97; /* #BBBBBB → #666B61 */
  --theme-base-profile-edit-dialog-label-color-rgb: 72, 78, 68; /* #D4D4D9 → #484E44 */
  --theme-base-profile-edit-dialog-label-input-not-type-chec-border-rgb: 185, 188, 175; /* #45454D → #B9BCAF */
  --theme-base-input-background-rgb: 255, 253, 248; /* #1B1B20 → #FFFDF8 */
  --theme-base-profile-edit-tag-options-label-border-rgb: 221, 221, 211; /* #414149 → #DDDDD3 */
  --theme-base-profile-edit-actions-button-border-rgb: 221, 221, 211; /* #44444B → #DDDDD3 */
  --theme-base-profile-edit-actions-button-background-rgb: 238, 236, 228; /* #242429 → #EEECE4 */
  --theme-base-profile-edit-actions-button-type-submit-border-color-rgb: 52, 75, 60; /* #F52B51 → #344B3C */
  --theme-library-glow-rgb: 247, 245, 239; /* #701426 → #F7F5EF */
  --theme-base-form-label-rgb: 102, 107, 97; /* #C6C6CC → #666B61 */
  --theme-community-glow-rgb: 247, 245, 239; /* #821830 → #F7F5EF */
  --theme-base-social-primary-border-rgb: 52, 75, 60; /* #FF3354 → #344B3C */
  --theme-base-social-secondary-color-rgb: 72, 78, 68; /* #D0D0D5 → #484E44 */
  --theme-base-social-secondary-background-rgb: 238, 236, 228; /* #1C1C21 → #EEECE4 */
  --theme-base-text-light-rgb: 72, 78, 68; /* #DDDDE1 → #484E44 */
  --theme-base-discussion-poll-option-border-rgb: 221, 221, 211; /* #38383E → #DDDDD3 */
  --theme-base-discussion-poll-option-color-rgb: 36, 40, 33; /* #EEEEF0 → #242821 */
  --theme-base-discussion-vote-color-rgb: 52, 75, 60; /* #A9A9B0 → #344B3C */
  --theme-base-vote-background-rgb: 238, 236, 228; /* #17171B → #EEECE4 */
  --theme-base-upvote-rgb: 52, 75, 60; /* #FF4965 → #344B3C */
  --theme-base-discussion-author-color-rgb: 36, 40, 33; /* #E8E8EB → #242821 */
  --theme-base-body-secondary-rgb: 72, 78, 68; /* #BDBDC4 → #484E44 */
  --theme-base-discussion-reply-toggle-color-rgb: 102, 107, 97; /* #A5A5AD → #666B61 */
  --theme-base-discussion-reply-color-rgb: 72, 78, 68; /* #C4C4CA → #484E44 */
  --theme-delete-action-rgb: 164, 60, 76; /* #ED8192 → #A43C4C */
  --theme-base-quiz-card-background-rgb: 255, 253, 248; /* #151519 → #FFFDF8 */
  --theme-base-quiz-topline-color-rgb: 102, 107, 97; /* #BABAC0 → #666B61 */
  --theme-base-quiz-timer-track-background-rgb: 221, 221, 211; /* #303035 → #DDDDD3 */
  --theme-base-panel-handle-background-rgb: 141, 146, 135; /* #3D3D43 → #8D9287 */
  --theme-base-panel-button-rgb: 238, 236, 228; /* #25252A → #EEECE4 */
  --theme-base-about-content-p-color-rgb: 72, 78, 68; /* #B7B7BD → #484E44 */
  --theme-base-episode-link-color-rgb: 36, 40, 33; /* #E9E9EB → #242821 */
  --theme-base-episode-link-background-rgb: 238, 236, 228; /* #202024 → #EEECE4 */
  --theme-base-comment-meta-span-color-rgb: 102, 107, 97; /* #6F6F77 → #666B61 */
  --theme-base-comment-body-p-color-rgb: 72, 78, 68; /* #D0D0D4 → #484E44 */
  --theme-base-moment-link-color-rgb: 132, 99, 55; /* #FF8AA0 → #846337 */
  --theme-base-comment-actions-button-color-rgb: 102, 107, 97; /* #8D8D95 → #666B61 */
  --theme-base-comment-reply-border-left-rgb: 221, 221, 211; /* #3A3A40 → #DDDDD3 */
  --theme-base-composer-border-rgb: 221, 221, 211; /* #34343A → #DDDDD3 */
  --theme-base-composer-background-rgb: 255, 253, 248; /* #1C1C20 → #FFFDF8 */
  --theme-base-comment-input-row-focus-within-border-color-rgb: 52, 75, 60; /* #676771 → #344B3C */
  --theme-base-timestamp-toggle-color-rgb: 102, 107, 97; /* #92929A → #666B61 */
  --theme-base-timestamp-check-border-rgb: 102, 107, 97; /* #62626B → #666B61 */
  --theme-base-replying-to-color-rgb: 52, 75, 60; /* #FF6C87 → #344B3C */
  --theme-base-replying-context-color-rgb: 102, 107, 97; /* #8D8D95 → #666B61 */
  --theme-base-speed-options-button-color-rgb: 72, 78, 68; /* #C7C7CC → #484E44 */
  --theme-base-discussion-sheet-handle-background-rgb: 141, 146, 135; /* #5A5A62 → #8D9287 */
  --theme-navigation-desktop-rgb: 102, 107, 97; /* #8C8C95 → #666B61 */
  --theme-page-background-rgb: 247, 245, 239; /* #080B11 → #F7F5EF */
  --theme-panel-background-rgb: 255, 253, 248; /* #101722 → #FFFDF8 */
  --theme-raised-surface-rgb: 238, 236, 228; /* #182231 → #EEECE4 */
  --theme-accent-gold-rgb: 52, 75, 60; /* #C99A61 → #344B3C */
  --theme-accent-gold-soft-rgb: 132, 99, 55; /* #E8C89F → #846337 */
  --theme-navigation-active-rgb: 52, 75, 60; /* #F4D9AF → #344B3C */
  --theme-reader-background-rgb: 247, 245, 239; /* #0C1119 → #F7F5EF */
  --theme-menu-background-rgb: 255, 253, 248; /* #1B2633 → #FFFDF8 */
  --theme-language-option-text-rgb: 36, 40, 33; /* #E5E7E8 → #242821 */
  --theme-language-option-selected-rgb: 52, 75, 60; /* #F9E8CF → #344B3C */
  --theme-text-secondary-rgb: 102, 107, 97; /* #AEB5B7 → #666B61 */
  --theme-scripture-heading-rgb: 36, 40, 33; /* #F8EAD4 → #242821 */
  --theme-scripture-text-rgb: 36, 40, 33; /* #EEE7DC → #242821 */
  --theme-verse-number-rgb: 132, 99, 55; /* #D4AA76 → #846337 */
  --theme-reader-footer-rgb: 102, 107, 97; /* #A3AAB2 → #666B61 */
  --theme-note-timestamp-rgb: 102, 107, 97; /* #97A0AA → #666B61 */
  --theme-note-text-rgb: 36, 40, 33; /* #EAE5DB → #242821 */
  --theme-sheet-background-rgb: 255, 253, 248; /* #121923 → #FFFDF8 */
  --theme-form-label-rgb: 102, 107, 97; /* #C5C9CD → #666B61 */
  --theme-input-border-rgb: 185, 188, 175; /* #424B55 → #B9BCAF */
  --theme-input-background-rgb: 255, 253, 248; /* #1A222C → #FFFDF8 */
  --theme-toast-background-rgb: 238, 236, 228; /* #263342 → #EEECE4 */
  --theme-chapter-close-text-rgb: 102, 107, 97; /* #D8D9D9 → #666B61 */
  --theme-chapter-scrollbar-rgb: 185, 188, 175; /* #67717D → #B9BCAF */
  --theme-book-title-rgb: 72, 78, 68; /* #C8C5CD → #484E44 */
  --theme-book-title-active-rgb: 52, 75, 60; /* #F5E9D7 → #344B3C */
  --theme-book-number-rgb: 102, 107, 97; /* #958C80 → #666B61 */
  --theme-book-chevron-rgb: 102, 107, 97; /* #AEB2BA → #666B61 */
  --theme-chapter-button-text-rgb: 52, 75, 60; /* #F9ECDB → #344B3C */
  --theme-chapter-button-background-rgb: 238, 236, 228; /* #253341 → #EEECE4 */
  --theme-chapter-button-border-hover-rgb: 52, 75, 60; /* #F4C98E → #344B3C */
  --theme-chapter-button-hover-rgb: 225, 229, 218; /* #35495A → #E1E5DA */
  --theme-chapter-button-active-text-rgb: 255, 253, 248; /* #17120B → #FFFDF8 */
  --theme-chapter-button-disabled-rgb: 149, 153, 143; /* #747F8C → #95998F */
  --theme-testament-label-rgb: 132, 99, 55; /* #D3AF7F → #846337 */
  --theme-prayer-center-small-color-rgb: 102, 107, 97; /* #8B929B → #666B61 */
  --theme-prayer-history-background-rgb: 255, 253, 248; /* #111923 → #FFFDF8 */
  --theme-prayer-calendar-demo-span-color-rgb: 102, 107, 97; /* #939CA7 → #666B61 */
  --theme-social-page-discussion-vote-voted-color-rgb: 52, 75, 60; /* #F1D5A7 → #344B3C */
  --theme-chapter-action-color-rgb: 72, 78, 68; /* #D8D8DD → #484E44 */
  --theme-sheet-handle-rgb: 141, 146, 135; /* #59616B → #8D9287 */
  --theme-artifact-scrollbar-rgb: 185, 188, 175; /* #68737D → #B9BCAF */
  --theme-artifact-caption-rgb: 102, 107, 97; /* #AEB5BF → #666B61 */
  --theme-artifact-description-rgb: 72, 78, 68; /* #C5CBD2 → #484E44 */
  --theme-history-text-rgb: 102, 107, 97; /* #A9ADB3 → #666B61 */
  --theme-tab-inactive-rgb: 102, 107, 97; /* #9299A3 → #666B61 */
  --theme-profile-text-muted-rgb: 102, 107, 97; /* #9BA5B2 → #666B61 */
  --theme-text-warm-rgb: 36, 40, 33; /* #F3EDE3 → #242821 */
  --theme-profile-stat-text-rgb: 52, 75, 60; /* #F4DFBF → #344B3C */
  --theme-profile-description-rgb: 72, 78, 68; /* #DCE1E6 → #484E44 */
  --theme-profile-action-text-rgb: 102, 107, 97; /* #AEB8C3 → #666B61 */
  --theme-control-gradient-start-rgb: 238, 236, 228; /* #283341 → #EEECE4 */
  --theme-verse-menu-close-color-rgb: 102, 107, 97; /* #DDDDDD → #666B61 */
  --theme-verse-action-background-rgb: 255, 253, 248; /* #253243 → #FFFDF8; distinct verse-action tiles. */
  --theme-catalogue-scrollbar-rgb: 185, 188, 175; /* #47505B → #B9BCAF */
  --theme-card-placeholder-rgb: 238, 236, 228; /* #172331 → #EEECE4 */
  --theme-episode-reference-muted-rgb: 102, 107, 97; /* #A6ABB4 → #666B61 */
  --theme-verse-link-rgb: 132, 99, 55; /* #C9B18E → #846337 */
  --theme-player-note-background-rgb: 255, 253, 248; /* #121C28 → #FFFDF8 */
  --theme-player-note-border-rgb: 185, 188, 175; /* #49515C → #B9BCAF */
  --theme-player-note-input-rgb: 255, 253, 248; /* #1B2635 → #FFFDF8 */
  --theme-player-artifact-description-rgb: 72, 78, 68; /* #B6BDC7 → #484E44 */
  --theme-player-panel-close-rgb: 102, 107, 97; /* #B9BEC7 → #666B61 */
}

/* One opaque ivory foundation across all destinations and sticky navigation. */
html { color-scheme: light; }
:root { --line: var(--preview-border); }
body.social-page, body.pray-page, body.legal-page { background: var(--theme-page-background); }
body[data-bible-page] .bible-nav,
body[data-bible-page] .social-header,
body.profile-page .profile-account-tools,
body.profile-page .profile-content-tabs { background: var(--theme-page-background); }

/* Fixed decoration uses its own layer rather than background-attachment: fixed
   (unreliable on iOS). Width-based sizes stay stable as mobile toolbars move.
   The opaque sticky header paints the same viewport-aligned slice of the circle.
   Isolation contains the negative layer without changing fixed positioning. */
body.videos-page .videos-catalogue {
  --preview-graphic-radius: clamp(200px, 55.814vw, 240px);
  --preview-graphic-x: clamp(70px, 20.931vw, 90px);
  --preview-graphic-y: 112px;
  --preview-graphic-left: 0px;
  --preview-graphic-height: calc(var(--preview-graphic-radius) + var(--preview-graphic-y) + 1px);
  --preview-graphic-image: radial-gradient(circle var(--preview-graphic-radius) at var(--preview-graphic-x) var(--preview-graphic-y),
    var(--preview-backdrop-graphic) calc(100% - 1px), transparent 100%);
  position: relative;
  isolation: isolate;
  background-image: none;
}
body.videos-page .videos-catalogue::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0 0 auto var(--preview-graphic-left);
  height: var(--preview-graphic-height);
  pointer-events: none;
  background-image: var(--preview-graphic-image);
  background-repeat: no-repeat;
}
body.videos-page .videos-heading.social-header {
  background-color: var(--theme-page-background);
  background-image: var(--preview-graphic-image);
  background-repeat: no-repeat;
  background-size: 100% var(--preview-graphic-height);
  background-position: left top;
}
@media (min-width: 680px) {
  body.videos-page .videos-catalogue {
    --preview-graphic-radius: clamp(260px, 23.612vw, 340px);
    --preview-graphic-x: clamp(180px, 18.056vw, 260px);
    --preview-graphic-y: 165px;
    --preview-graphic-left: 188px; /* Match the existing desktop sidebar. */
  }
}

/* Decoration is reserved for Videos; other destinations retain plain ivory. */

/* Neutral controls; forest communicates action and selection, gold means Premium. */
body[data-bible-page] :is(.premium-button, .leaderboard-button) {
  color: var(--preview-premium-text);
  background: var(--preview-premium);
  border-color: var(--preview-premium);
}
body[data-bible-page] :is(.social-primary, .profile-empty-action, .note-submit, .note-add, .profile-creations-empty button, .profile-edit-actions button[type="submit"]) {
  color: var(--theme-on-media);
  background: var(--preview-forest);
  border-color: var(--preview-forest);
}
body[data-bible-page] .bible-nav .nav-item.active {
  color: var(--preview-forest);
  border-color: rgba(var(--preview-forest-rgb), .22);
}
body[data-bible-page] :is(.profile-content-tabs button[aria-selected="true"], .social-tabs a.active)::after {
  background: var(--preview-forest);
}
body.social-page .discussion-vote {
  color: var(--preview-forest);
  background: rgba(var(--preview-forest-rgb), .05);
  border-color: rgba(var(--preview-forest-rgb), .2);
}
body.social-page .discussion-vote.voted {
  color: var(--preview-forest);
  background: rgba(var(--preview-forest-rgb), .14);
  border-color: var(--preview-forest);
}
body[data-bible-page] .book-chapter[aria-current="true"] {
  color: var(--theme-on-media);
  background: var(--preview-forest);
  border-color: var(--preview-forest);
}
body[data-bible-page] :is(.profile-edit-button, .profile-tags button, .app-language-option[aria-selected="true"]) {
  color: var(--preview-forest);
}
body[data-bible-page] :is(.app-language-menu, .profile-edit-dialog, .note-composer, .profile-note-dialog) {
  box-shadow: 0 12px 40px rgba(var(--theme-shadow-rgb), .12);
}
body[data-bible-page] :is(.profile-edit-actions button[type="submit"], .social-primary):hover {
  filter: brightness(1.08);
}
body[data-bible-page] :is(button, a, input, textarea, select):focus-visible {
  outline-color: var(--preview-forest);
}
body[data-bible-page] :is(.social-form input, .social-form textarea, .note-composer textarea, .profile-note-composer textarea) {
  accent-color: var(--preview-forest);
}

/* Artwork overlays retain white copy, dark scrims and champagne progress. */
.genesis-resume-label, .profile-video-thumbnail svg { color: var(--theme-on-media); }
.profile-video-thumbnail svg { fill: var(--theme-on-media); }
.profile-page .profile-avatar { color: var(--preview-premium); }
.artifact-photos { background: var(--theme-raised-surface); }
.episode-completed { background: rgba(var(--theme-scrim-rgb), .58); }
.episode-progress-fill { background: var(--preview-premium); }
.artifact-arrows button, .artifact-dots { background: rgba(var(--theme-scrim-rgb), .75); }
@media (max-width: 679px) {
  body[data-bible-page] .episode-card .episode-cover h3 { color: var(--theme-on-media); }
}

/* Keep playback immersive while its attached reading/note sheets use the light UI. */
#episode-player {
  color-scheme: dark;
  color: var(--theme-on-media);
  background: var(--theme-media-black);
  --theme-text-strong: var(--theme-on-media);
  --theme-text-warm: var(--theme-on-media);
}
#episode-player .reading-toggle { background: rgba(var(--theme-scrim-rgb), .54); }
#episode-player .chapter-action { color: var(--theme-on-media); }
#episode-player .chapter-action:is(:hover, :focus-visible) svg { border-color: var(--preview-premium); }
#episode-player .chapter-kicker, #episode-player .episode-save.saved { color: var(--preview-premium); }
#episode-player .episode-save.saved svg { fill: rgba(232, 200, 159, .35); }
#episode-player :is(button, a):focus-visible { outline-color: var(--preview-premium); }
