/* Shared identity for the catalogue, reader, and standalone lesson transcripts. */
:root {
  color-scheme: light;
  --paper: #F8F6F0;
  --ink: #25201F;
  --accent: #795523;
  --accent-hover: #5C3D16;
  --muted: #625A56;
  --tint: #EEEAE3;
  --surface: #FCFAF6;
  --wash: #EDE1C8;
  --control-edge: #91837C;
  --inactive: #635E59;
  --disabled-bg: #EAE7E2;
  --disabled-edge: #CDC6C0;
  --font-family: "Heebo", Arial, sans-serif;
  --title-font: var(--font-family);
  --mast-bar:76px;
  --emblem-large:clamp(124px,10vw,150px);
  --emblem-small:64px;
  --emblem-inset:clamp(30px,3.1vw,48px);
}
body {background:var(--paper);color:var(--ink);font-family:var(--font-family);}
body :is(h1,h2,h3,h4), .video-card h4, .gate-name .gate-title,
.hero h1, .tx-title h1, .tx-content h2 {
  font-family:var(--title-font);font-weight:600;font-style:normal;letter-spacing:normal;
}
button,input,select,textarea,nav,.button,.text-link,time,.lesson-meta {font-family:var(--font-family);}
button,a,input,select,summary {text-underline-offset:.2em;}
:focus-visible,.tx-page :focus-visible,.shelf-tools .search-form:focus-within {
  outline:3px solid var(--accent);outline-offset:3px;
}

/* A single emblem sits directly on the manuscript, then travels a short
   distance into the reading rail. The rail takes no space above the hero. */
html:has(.site-header) {scroll-padding-top:calc(var(--mast-bar) + 12px);}
.site-header {
  --mast-open:calc(1 - var(--mast-scroll,0));
  position:fixed;inset:0 0 auto;z-index:20;height:var(--mast-bar);
  background:transparent;border:0;pointer-events:none;
}
.site-header::before {
  content:"";position:absolute;inset:0;background:var(--paper);
  opacity:calc(1 - var(--mast-open));pointer-events:none;
}
.site-header .header-inner {
  position:relative;height:var(--mast-bar);min-height:var(--mast-bar);gap:clamp(10px,1.4vw,22px);
  grid-template-columns:minmax(0,1fr) var(--emblem-small) minmax(0,1fr);
}
.site-header :is(a,button),.site-header .mobile-nav {pointer-events:auto;}
.site-header .brand {
  grid-column:auto;grid-row:auto;position:absolute;left:50%;right:auto;
  top:calc((var(--mast-bar) - var(--emblem-small)) / 2 + (var(--emblem-inset) - (var(--mast-bar) - var(--emblem-small)) / 2) * var(--mast-open));
  transform:translateX(-50%);width:max-content;max-width:none;min-width:44px;min-height:44px;
}
.site-header .brand-logo {
  width:auto;height:calc(var(--emblem-small) + (var(--emblem-large) - var(--emblem-small)) * var(--mast-open));
  filter:drop-shadow(0 1px 1.5px rgb(76 48 18 / 16%));
}
.site-header:has(.menu-toggle[aria-expanded="true"]),body:has(#route-notice:not([hidden])) .site-header {--mast-open:0;}
.site-footer,.mobile-nav {background:var(--paper);border:0;}
.mobile-nav {position:relative;max-height:calc(100dvh - var(--mast-bar));overflow:auto;overscroll-behavior:contain;}
#route-notice:not([hidden]) {margin-block-start:calc(var(--mast-bar) + 12px);}
#video-library {scroll-margin-top:0;}
.header-search {border:0;padding-inline:10px;font-size:1rem;}
.desktop-nav {gap:0 clamp(3px,.65vw,10px);flex-wrap:nowrap;white-space:nowrap;}
.desktop-nav a,.mobile-nav a {min-height:44px;padding:8px 11px;border-radius:0;color:var(--ink);font-size:1rem;}
.desktop-nav a:hover,.mobile-nav a:hover,.footer-main a:hover {color:var(--accent);}
.desktop-nav a[aria-current],.mobile-nav a[aria-current] {color:var(--accent-hover);background:transparent;font-weight:700;}
.desktop-nav a:focus-visible,.mobile-nav a:focus-visible {outline-offset:1px;}
.footer-main nav {font-size:.95rem;}
@media (max-width:1180px) {
  .desktop-nav {display:none;}
  .menu-toggle {display:block;}
  .header-actions {gap:0;}
  .header-search {padding:10px;min-width:44px;min-height:44px;}
  .header-search span {display:none;}
}
@media (min-width:1181px) {
  .site-header .header-inner {grid-template-columns:minmax(0,1fr) calc(var(--emblem-large) * 1.1) minmax(0,1fr);}
  .mobile-nav {display:none;}
}
@media (prefers-reduced-motion:reduce) {
  .site-header {--mast-open:1;}
  .site-header[data-docked] {--mast-open:0;}
}

/* A facsimile from the actual printed book fills the masthead. The ink and
   the content do not move; only the broad light on the paper follows a mouse. */
.hero {
  position:relative;isolation:isolate;overflow:hidden;
  color:var(--ink);background:#E5D4B8;border:0;
}
.hero-backdrop,.hero-facsimile,.hero-backdrop::after {position:absolute;inset:0;width:100%;height:100%;}
.hero-backdrop {z-index:0;overflow:hidden;isolation:isolate;pointer-events:none;user-select:none;background:#E6D5B9;}
.hero-facsimile {display:block;max-width:none;object-fit:cover;object-position:50% 49%;opacity:.79;mix-blend-mode:multiply;}
.hero-light {
  position:absolute;inset:-32% -30%;pointer-events:none;
  background:
    radial-gradient(ellipse 37% 83% at 50% 45%,rgb(253 241 212 / 46%) 0%,rgb(251 235 199 / 23%) 38%,transparent 78%),
    radial-gradient(ellipse 48% 95% at 49% 43%,transparent 30%,rgb(124 83 35 / 15%) 67%,rgb(77 47 16 / 35%) 100%);
  transform:translate3d(var(--light-x,-5%),var(--light-y,-3%),0);
}
/* A fixed wash protects the title, even at the extremes of pointer travel. */
.hero-backdrop::after {
  content:"";pointer-events:none;
  background:radial-gradient(ellipse 55% 112% at 50% 54%,rgb(244 235 216 / 92%) 0%,rgb(243 232 209 / 86%) 30%,rgb(241 228 204 / 68%) 53%,rgb(238 221 190 / 29%) 76%,transparent 100%);
}
.hero-backdrop::before {
  content:"";position:absolute;z-index:1;inset:0 0 auto;height:clamp(92px,10vw,142px);pointer-events:none;
  background:linear-gradient(to bottom,rgb(239 226 201 / 78%),rgb(237 223 197 / 42%) 55%,transparent);
}
@media (any-hover:hover) and (any-pointer:fine) and (prefers-reduced-motion:no-preference) {
  .hero-light {transition:transform 380ms cubic-bezier(.18,.66,.28,1);}
}
.hero .hero-inner {
  position:relative;z-index:1;width:min(1080px,calc(100% - 48px));min-height:clamp(496px,38.8vw,564px);
  display:grid;place-items:center;grid-template-columns:minmax(0,1fr);grid-template-areas:none;
  gap:0;padding-block:calc(var(--emblem-inset) + var(--emblem-large) + 8px) clamp(44px,4.7vw,76px);margin-inline:auto;text-align:center;
}
.hero .hero-copy {display:block;width:100%;max-width:750px;min-width:0;justify-self:center;text-align:center;}
.hero .hero-intro {min-width:0;container-type:inline-size;text-align:center;}
.hero .eyebrow,.eyebrow,.eyebrow.light,.tx-kicker {color:var(--muted);letter-spacing:normal;}
.hero .eyebrow {display:block;margin:0 0 7px;color:#51402D;font:500 .96rem/1.5 var(--font-family);text-align:center;}
.hero h1 {
  color:var(--ink);line-height:1.06;white-space:nowrap;overflow-wrap:normal;
  text-shadow:0 1px 0 rgb(255 244 221 / 48%),0 3px 6px rgb(64 42 24 / 24%);
  font-size:clamp(3.1rem,6.2vw,5.2rem);font-size:min(5.2rem,14cqi);line-height:1.19;
}
.hero .eyebrow,.hero .hero-description {text-shadow:0 1px 1px rgb(255 242 217 / 44%),0 1.5px 3px rgb(70 44 21 / 23%);}
.hero .hero-actions .button {text-shadow:0 1px 2px rgb(52 32 11 / 23%);}
.hero-description {font-size:clamp(1.04rem,1.5vw,1.27rem);line-height:1.55;max-width:none;margin:10px auto 0;text-align:center;text-wrap:balance;}
.hero .hero-actions {display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:12px;margin:22px auto 0;width:100%;max-width:none;}
.hero .hero-actions .button {flex:0 1 auto;min-width:140px;min-height:46px;width:auto;max-width:100%;border-radius:4px;}
.hero-actions .button,.weekly-actions .button,.button {font-size:1rem;}
.button-blue,.button-gold,.hero-actions .button-gold,.tx-tools .tx-primary {
  color:var(--paper);background:var(--accent);border-color:transparent;
}
.button-blue:hover,.button-gold:hover,.hero-actions .button-gold:hover,.tx-tools .tx-primary:hover {
  color:var(--paper);background:var(--accent-hover);
}
.hero-actions .hero-secondary,.button-outline,.button-outline:not(:disabled) {background:var(--tint);color:var(--ink);border-color:transparent;}
.hero-actions .hero-secondary:hover,.button-outline:not(:disabled):hover {background:var(--wash);color:var(--accent);}
.hero-actions .button {padding-inline:19px;}
.hero .hero-secondary {color:#4C371B;background:#F6EDDB;border:0;box-shadow:none;}
.hero .hero-secondary:hover {background:var(--wash);color:var(--accent-hover);}
.text-link,.transcript-link,.gate-index-link,.video-watch {color:var(--accent);border:0;text-decoration:none;}
.text-link:hover,.transcript-link:hover,.gate-index-link:hover {text-decoration:underline;}

/* Spacious groups replace ornamental rules. Input edges and focus marks remain functional. */
.lessons-section {background:var(--tint);border:0;padding-block:clamp(28px,3.3vw,45px);}
.weekly-heading {margin-bottom:19px;}
.weekly-heading h2,.section-heading h2,.shelf-title h2,.about-inner h2 {font-size:clamp(1.95rem,3.15vw,2.7rem);line-height:1.17;}
.weekly-mark,.weekly-heading .weekly-mark {color:var(--ink);}
#weekly-status {border:0;}
.weekly-lesson,.video-card,.video-empty {background:var(--paper);border:0;}
.weekly-copy h3 {font-size:clamp(2rem,3.2vw,2.8rem);line-height:1.16;}
.weekly-copy .lesson-meta,.video-card-copy p {font-size:.94rem;color:var(--muted);}
.video-card-copy h4 {font-size:1.56rem;line-height:1.22;}
.video-poster>.icon {color:var(--paper);}
.library-section {padding-block:clamp(34px,4.4vw,64px);}
.book-card,.book-card:hover,.library-toolbar,.library-topic {border:0;}
.book-card h3 {font-size:clamp(1.55rem,2.15vw,2rem);line-height:1.2;}
.book-meta,.book-meta .type-badge,.book-meta .type-badge::after,.shelf-context .result-count {color:var(--muted);}
.book-body>.purchase-button,.purchase-button,.gate-index-link,.book-actions .button-outline:not(:disabled) {color:var(--accent);}
.detail-purchase .purchase-button {background:var(--wash);border:0;}
.book-actions .button,.gate-index-link,.filters button,.filter-toggle {font-size:.95rem;}
.book-actions .button-outline:not(:disabled) {background:transparent;}
.shelf-tools .search-form,.filter-toggle,.lesson-search-form input,select {background:var(--surface);border-color:var(--control-edge);}
.shelf-tools .search-form input,.lesson-search-form input {font-size:1rem;}
.library-toolbar,.empty-state,.route-notice {background:var(--tint);border:0;}
.filters button.active,#active-filter-count {color:var(--paper);background:var(--accent);border-color:transparent;}
.shelf-context #search-help,.shelf-context .result-count {font-size:.87rem;}
.contact-section {background:var(--paper);border:0;}
.contact-card,.contact-inspiration {border:0;background:var(--tint);color:var(--ink);}
.contact-card p,.contact-inspiration p,.about-copy {color:var(--muted);}
.contact-icon {filter:grayscale(1);mix-blend-mode:multiply;}
.contact-card h3 {font-size:clamp(1.5rem,2.3vw,2rem);line-height:1.23;}
.about-section {background:var(--tint);color:var(--ink);}
:is(.hero-description,.weekly-description,.book-subtitle,.about-copy,.dialog-subtitle),.contact-card p {color:var(--ink);}
.video-poster:has(> img[src$="book-video.svg"]) {background:var(--tint);}

/* Keep the same paper and typography when a reader opens or leaves a lesson. */
dialog,.book-dialog,.video-dialog,.gates-dialog,.reader-dialog {background:var(--paper);color:var(--ink);}
dialog::backdrop,.gates-dialog::backdrop {background:rgb(37 32 31 / 54%);}
dialog {box-shadow:0 18px 70px rgb(37 32 31 / 24%);}
.dialog-copy,.gates-top,.reader-toolbar,.video-toolbar {background:var(--paper);color:var(--ink);border:0;}
#dialog-description {margin-top:1.15em;}
.dialog-close,.reader-controls,.reader-file-actions,.reader-empty,.gate-extras {background:var(--tint);border:0;}
.reader-toolbar .reader-download {background:var(--accent);color:var(--paper);}
.reader-back-button,.reader-close,.reader-kicker {color:var(--ink);}
.reader-stage,.viewer-container {background:var(--tint);}
.gate-row {border:0;padding-block:8px;}
.gate-name .gate-title {font-size:1.23rem;line-height:1.28;}
.gate-actions a,.gate-actions a.gate-read,.gates-full a {color:var(--accent);}
.video-actions,.reader-file-actions {border:0;}
.tx-page,.tx-sitehead,.tx-paper {color:var(--ink);background:var(--paper);border:0;}
.tx-page .tx-title,.tx-tools,.tx-footer,#tx-media {border:0;}
.tx-tools {padding-block:9px;}
.tx-outline {border:0;background:var(--tint);border-radius:4px;}
.tx-content h2 {border:0;padding-inline-start:0;font-size:1.43em;line-height:1.25;}
.tx-title h1 {font-size:clamp(2.35rem,4.5vw,3.85rem);line-height:1.15;}
.tx-meta,.tx-meta span,.tx-outline ol,.tx-media-tools {color:var(--muted);}
.tx-page a:hover {color:var(--accent);}
.tx-tools select {min-height:44px;}
.tx-tools button,.tx-tools label,.tx-tools select,.tx-outline summary,.tx-outline a {font-size:1rem;}
@media (max-width:760px) {
  :root {--mast-bar:64px;--emblem-small:52px;--emblem-large:clamp(94px,24vw,118px);--emblem-inset:clamp(20px,5vw,32px);}
  .hero .hero-inner {width:calc(100% - 32px);min-height:clamp(358px,92vw,438px);padding-block:calc(var(--emblem-inset) + var(--emblem-large) + 10px) clamp(32px,8vw,52px);}
  .hero h1 {font-size:clamp(2.25rem,11vw,3.8rem);font-size:min(3.8rem,14cqi);}
  .hero .eyebrow {margin-bottom:5px;font-size:.9rem;}
  .hero-description {font-size:1.035rem;margin:8px auto 0;}
  .hero .hero-actions {gap:9px;margin-top:19px;}
  .hero .hero-actions .button {font-size:.96rem;padding-inline:13px;min-width:112px;}
  .hero-backdrop::after {background:radial-gradient(ellipse 77% 88% at 50% 52%,rgb(244 234 215 / 91%) 0%,rgb(243 231 210 / 82%) 41%,rgb(240 226 200 / 57%) 70%,rgb(237 221 192 / 11%) 100%);}
  .weekly-heading {margin-bottom:14px;}
  .weekly-heading h2 {font-size:clamp(1.55rem,5.3vw,2rem);}
  .weekly-copy h3 {font-size:2rem;}
  .book-card h3 {font-size:1.45rem;}
  .book-actions .button {font-size:.93rem;}
  .contact-grid {gap:15px;}
}
@media (max-width:350px) {
  .site-header .header-inner {width:calc(100% - 12px);}
  .hero .hero-inner {width:calc(100% - 24px);}
  .book-actions .button {padding-inline:6px;}
}
@media print {
  .tx-page,.tx-paper {background:white;color:black;}
  .tx-page .tx-title,.tx-content h2 {border:0;}
  .tx-title h1 {font-size:26pt;}
  .tx-content h2 {font-size:15pt;}
}

/* A shelf item turns around the right-hand spine of the Hebrew cover. */
.book-stage {position:relative;isolation:isolate;perspective:700px;overflow:visible;background:var(--paper);}
.book-stage>.book-cover {position:absolute;inset:0;z-index:2;transform-origin:79% 54%;backface-visibility:hidden;pointer-events:none;}
.book-open-view {position:absolute;inset:0;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:8px;pointer-events:none;visibility:hidden;opacity:0;}
.book-spread {width:95%;max-height:80%;aspect-ratio:1.38;display:flex;direction:rtl;justify-content:center;filter:drop-shadow(0 4px 4px rgb(64 40 12 / 20%));}
.book-spread.slender {aspect-ratio:1.06;width:74%;}
.sheet {position:relative;overflow:hidden;display:block;width:50%;height:100%;background:#fffef8;}
.book-stage .sheet img {width:100%;height:100%;object-fit:fill;display:block;mix-blend-mode:normal;filter:none;}
.sheet-right {border-radius:2% 4% 4% 1%;transform-origin:left;transform:perspective(540px) rotateY(-5deg);}
.sheet-left {border-radius:4% 2% 1% 4%;transform-origin:right;transform:perspective(540px) rotateY(5deg);}
.sheet::after {content:"";position:absolute;inset:0;pointer-events:none;}
.sheet-right::after {background:linear-gradient(to right,rgb(78 53 26 / 28%),rgb(94 68 35 / 6%) 8%,transparent 26%);}
.sheet-left::after {background:linear-gradient(to left,rgb(78 53 26 / 24%),rgb(94 68 35 / 5%) 8%,transparent 26%);}
.spread-caption {font:500 .77rem/1.4 var(--font-family);color:var(--accent);text-align:center;}
.book-stage.is-open>.book-cover {transform:rotateY(86deg) scale(.94);opacity:0;}
.book-stage.is-open .book-open-view {visibility:visible;opacity:1;}
@media (prefers-reduced-motion:no-preference) {
  .book-stage>.book-cover {transition:transform .45s cubic-bezier(.22,.68,.25,1),opacity .27s ease;}
  .book-open-view {transform:scale(.92);transition:opacity .26s ease,transform .38s cubic-bezier(.22,.68,.25,1),visibility 0s linear .28s;}
  .book-stage.is-open .book-open-view {transform:scale(1);transition-delay:.06s,.04s,0s;}
}
@media (max-width:680px) {
  .book-open-view {gap:3px;}
  .spread-caption {font-size:.64rem;}
}

/* The film and its description share a section, not two nested cards. A fixed
   widescreen canvas fits the actual picture; archive and feature use the same player. */
.weekly-lesson,.video-card {background:transparent;border:0;border-radius:0;box-shadow:none;overflow:visible;}
.weekly-lesson {grid-template-columns:minmax(0, .96fr) minmax(0,1.04fr);gap:clamp(24px,4vw,56px);align-items:center;}
.weekly-copy,.video-card-copy {padding:0;}
.weekly-copy h3 {margin-block:6px 9px;}
.weekly-visual.video-poster,.video-poster {display:block;position:relative;width:100%;height:auto;min-height:0;max-height:none;aspect-ratio:16/9;overflow:hidden;border:0;border-radius:4px;box-shadow:none;background:var(--tint);}
.video-poster>.poster-photo,.preview-slot,.preview-slot>video,.preview-slot>iframe {
  position:absolute;inset:0;width:100%;height:100%;display:block;border:0;padding:0;margin:0;
}
.video-poster>.poster-photo,.preview-slot>video {object-fit:cover;object-position:center;}
.video-poster>.poster-photo.youtube-poster {transform:scale(1.04);}
.preview-slot {z-index:1;pointer-events:none;opacity:0;}
.video-poster:is(.is-playing-preview,.is-youtube-preview) .preview-slot {opacity:1;}
.video-poster>.icon,.weekly-visual.video-poster>.icon {
  position:absolute;z-index:2;top:50%;left:50%;transform:translate(-50%,-50%);
  width:44px;height:44px;padding:0;border:0;border-radius:0;color:#fff;background:transparent;box-shadow:none;
  filter:drop-shadow(0 1px 2px rgb(33 20 12 / 80%)) drop-shadow(0 3px 6px rgb(33 20 12 / 45%));pointer-events:none;
}
.video-poster:is(.is-playing-preview,.is-youtube-preview)>.icon {visibility:hidden;}
.video-card-copy {padding-block:12px 2px;}
.video-card>.transcript-link,.video-card>.lesson-summary-action {margin-inline:0;}
#video-player,.video-player {border:0;box-shadow:none;overflow:hidden;}
@media (max-width:760px) {
  .weekly-lesson {grid-template-columns:minmax(0,1fr);gap:18px;}
  .weekly-copy {padding:0;}
  .weekly-actions {align-items:center;}
}

.preview-prompt {display:none;position:absolute;z-index:3;inset-inline-start:10px;bottom:10px;padding:3px 10px;border-radius:3px;background:var(--paper);color:var(--ink);font:500 .83rem/1.5 var(--font-family);pointer-events:none;}
.preview-needs-click:hover>.preview-prompt {display:block;}


/* No decorative frames around pictograms. Text buttons keep their colour and
   keyboard-only focus remains visible on every control. */
.icon,.contact-icon,.tx-page svg {border:0;border-radius:0;box-shadow:none;}
:is(.dialog-close,.reader-close,.reader-back-button,.icon-button,.shelf-search-button,.menu-toggle,.header-search),
.filter-toggle {border:0;border-radius:0;box-shadow:none;background:transparent;}
:is(.dialog-close,.reader-close,.reader-back-button,.icon-button,.shelf-search-button,.menu-toggle,.header-search):hover,
.filter-toggle:hover,.filter-toggle[aria-expanded="true"] {background:transparent;color:var(--accent-hover);}
.filter-toggle[aria-expanded="true"] {font-weight:700;}
@media (max-width:760px) {
  .reader-toolbar .reader-download {background:transparent;color:var(--ink);border:0;box-shadow:none;min-width:44px;min-height:44px;}
}
.tx-sitehead {position:sticky;top:0;z-index:5;background:var(--paper);}
html:has(.tx-sitehead) {scroll-padding-top:88px;}
.tx-page .tx-aside {top:88px;}
@media (max-width:760px) {
  html:has(.tx-sitehead) {scroll-padding-top:74px;}
}
