/* The original manuscript carries the masthead and the lesson; the catalogue begins on drawn paper. */
.pocket-catalogue {
  --emblem-large:clamp(160px,13.1vw,204px);
  --emblem-small:68px;
  --emblem-inset:clamp(23px,2.45vw,38px);
  --folio-seam:#e9dcc3;
  --shelf-overlap:clamp(36px,5vw,72px);
  --folio-paper:#f6efdf;
  --folio-light:#f9f4e8;
  --folio-ink:#322a22;
  --folio-brown:#695033;
  --folio-note:#594b3b;
}
/* One physical sheet runs from the upper edge to the start of the catalogue.
   The manuscript and the light share its coordinate system. */
.bound-leaves{position:relative;isolation:isolate;background:var(--folio-light);color:var(--folio-ink)}
.parchment-panel{position:relative;isolation:isolate;display:flow-root;background:var(--folio-seam)}
.panel-ground{position:absolute;inset:0;z-index:0;overflow:hidden;pointer-events:none;background:linear-gradient(155deg,#e7d5b4,#f1e5cd 52%,#f2e8d3 96%)}
.panel-ground .hero-facsimile{height:100%;width:100%;object-position:54% 48%;opacity:.83;mix-blend-mode:multiply;
  mask-image:linear-gradient(to bottom,#000 15%,rgb(0 0 0/.93) 44%,rgb(0 0 0/.80) 74%,rgb(0 0 0/.61) 100%)}
.panel-ground .hero-light{z-index:1}
.panel-ground::before{z-index:1}
.panel-ground::after{z-index:2;background:
  linear-gradient(to bottom,transparent calc(100% - 146px),var(--folio-seam)),
  radial-gradient(ellipse 37% 67% at 51% 35%,rgb(246 236 215/.88),rgb(246 234 211/.64) 45%,transparent 86%),
  linear-gradient(to bottom,transparent 22%,rgb(246 236 216/.17) 52%,rgb(247 237 216/.37) 78%,rgb(249 244 232/.54) 100%)}
.light-field{pointer-events:none;position:absolute;z-index:1;inset:0;overflow:hidden}
.emblem-wave{display:none}
@media(prefers-reduced-motion:no-preference){
  .emblem-wave.is-radiating{position:absolute;display:block;left:var(--flame-x,50%);top:var(--flame-y,52px);
    width:var(--wave-size,190vmax);aspect-ratio:1;pointer-events:none;opacity:0;
    background:radial-gradient(circle closest-side,transparent 24%,rgb(249 224 167/.07) 40%,rgb(255 236 192/.28) 52%,rgb(255 246 216/.59) 60%,rgb(254 239 196/.42) 68%,rgb(241 212 157/.12) 79%,transparent 92%);
    animation:ner-parchment-wave 2.9s cubic-bezier(.28,.49,.33,1) .20s 1 both}
  @keyframes ner-parchment-wave{0%{transform:translate(-50%,-50%) scale(.033);opacity:0}19%{opacity:.66}48%{opacity:.54}82%{opacity:.18}100%{transform:translate(-50%,-50%) scale(1);opacity:0}}
}
.parchment-panel .hero,.parchment-panel .lessons-section,.parchment-panel .resume-strip{position:relative;z-index:2;background:transparent;border:0}
.parchment-panel .hero{overflow:visible}
.parchment-panel .hero::after{content:none}
.parchment-panel .hero .hero-inner{min-height:clamp(340px,30vw,455px);padding-bottom:clamp(29px,3.7vw,55px)}
.parchment-panel .hero h1{margin:0}
.site-header::before{background:#f8f3e7}
.parchment-panel .resume-strip a{color:var(--folio-ink)}
.parchment-panel .lessons-section{padding-block:clamp(15px,1.7vw,27px) clamp(29px,4.5vw,66px)}
.lesson-content,.library-content{position:relative;z-index:1}
.bound-leaves .lessons-section,.bound-leaves .library-section{position:relative;isolation:isolate}
/* Title and portion precede the moving picture. The series credit belongs to the film itself. */
.parchment-panel .weekly-lesson:not([hidden]){display:grid;grid-template-columns:minmax(0,1.06fr) minmax(0,.94fr);grid-template-areas:"intro summary" "poster summary";gap:9px clamp(28px,4.2vw,68px);align-items:center}
.weekly-intro{grid-area:intro;display:flex;align-items:baseline;flex-wrap:wrap;gap:3px 15px;min-width:0}
.weekly-intro h2{color:var(--folio-ink);margin:0;font:600 clamp(1.85rem,3.05vw,2.6rem)/1.2 var(--font-family);letter-spacing:normal}
.weekly-intro .lesson-meta{font-size:.93rem;line-height:1.45;margin:0}
.parchment-panel .weekly-media{grid-area:poster;margin:0;width:100%;min-width:0}
.parchment-panel .weekly-copy{grid-area:summary;align-self:center}
.weekly-series{margin:7px 0 0;padding:1px 4px;text-align:center;color:#594224;font:500 clamp(.96rem,1.16vw,1.10rem)/1.45 var(--font-family);text-shadow:0 1px 5px #f7ecd9}
.bound-leaves :is(.shelf-title h2,.section-heading h2){color:var(--folio-ink)}
.bound-leaves .shelf-title>.eyebrow{color:var(--folio-brown)}
.bound-leaves :is(.lesson-meta,.book-meta,.type-badge,.result-count){color:var(--folio-note)}
.weekly-stage{border:2px solid #906d3e;border-radius:8px;background:#e4d6bb;box-shadow:0 4px 13px rgb(78 53 25/.20);box-sizing:border-box}
.weekly-stage:fullscreen{border:0;border-radius:0;box-shadow:none}
/* Playback and the archive share the two main buttons. Each secondary link sits
   directly beneath its own action, in the same reading order as the keyboard. */
.lesson-key,.weekly-volume{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:44px;min-height:44px;padding:7px 13px;border:0;border-radius:4px;text-decoration:none;font:600 .93rem/1.35 var(--font-family);cursor:pointer}
.lesson-key{background:#5f451e;color:#fffaf0}
.lesson-key:hover{background:#4d381b;color:#fffaf0;text-decoration:none}
.lesson-key .icon,.weekly-volume .icon{width:19px;height:19px;flex:none}
.video-archive-row{flex-basis:100%}
.parchment-panel .weekly-copy .weekly-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px 10px;align-items:center;justify-items:start;width:min(100%,21.5rem);max-width:100%;margin:12px 0 0}
.weekly-controls .lesson-key{justify-self:stretch;align-self:stretch;text-align:center;padding-inline:8px;gap:5px}
.weekly-controls [data-weekly-toggle]{grid-area:1/1}
.weekly-controls .weekly-archive{grid-area:1/2}
.weekly-controls .weekly-player-link{grid-area:2/1;justify-self:center}
.weekly-controls .transcript-link{grid-area:2/2;justify-self:center}
.weekly-controls [data-weekly-sound]{grid-area:3/1;justify-self:center}
.weekly-controls .button[download]{grid-area:3/2;justify-self:center}
.weekly-volume{background:#eee4cf;color:#4d381b}
.weekly-volume:hover{background:#e2d4b7}
.weekly-cover-play{position:absolute;inset:0;z-index:1;display:grid;place-items:center;width:100%;height:100%;padding:0;background:transparent;border:0;cursor:pointer}
.weekly-cover-play .icon{box-sizing:border-box;padding:14px;width:54px;height:54px;background:rgb(72 52 30 / 85%);color:#fff9eb;border-radius:50%}
.weekly-cover-play:hover .icon,.weekly-cover-play:focus-visible .icon{background:#533d20}
.weekly-cover-play:focus-visible{outline:3px solid #fff2cd;outline-offset:-5px}
#video-library:not([hidden]){padding-block:25px 36px}
#video-library-title{font-size:clamp(1.65rem,2.8vw,2.3rem);line-height:1.2;color:var(--folio-ink);margin:0}
@media(min-width:901px){.bound-leaves .weekly-copy{max-width:32rem}}
@media (min-width:961px) and (max-height:810px){.pocket-catalogue{--emblem-large:clamp(133px,20vh,165px);--emblem-inset:clamp(17px,3vh,26px)}}
/* The room extends across the page. The actual publication covers stay in front of the shelves. */
.bound-leaves .library-section {background:linear-gradient(180deg,var(--folio-seam),#f2e8d4 clamp(125px,17vw,250px),var(--folio-light) 100%)}
/* The shelves begin in the last strokes of the manuscript. Neither edge fades to white. */
.video-library[hidden]+.library-section .library-room {inset-block-start:calc(0px - var(--shelf-overlap))}
.bound-leaves:has(#video-library:not([hidden])){background:var(--folio-seam)}
.library-room {position:absolute;z-index:0;inset:0;overflow:hidden;pointer-events:none}
.library-room picture {
  position:absolute;inset:0 0 auto;height:min(100%,clamp(420px,43vw,705px));opacity:.39;
  mask-image:linear-gradient(to bottom,transparent,#000 calc(var(--shelf-overlap) + 105px),#000 63%,rgba(0,0,0,.65) 80%,transparent 100%);
}
.library-room picture,.library-room img{display:block;width:100%}.library-room img {height:100%;object-fit:cover;object-position:50% 48%;filter:none}

.shelf-heading {position:relative;isolation:isolate;align-items:center}
.shelf-tools {width:auto;flex:none}
.shelf-title {position:relative;isolation:isolate}
.shelf-title::before {content:"";position:absolute;z-index:-1;pointer-events:none;inset:-46% -20% -38% -22%;background:radial-gradient(ellipse,#f8f1df 12%,rgb(248 241 223 / 81%) 39%,transparent 74%)}
.bound-leaves .shelf-context {color:var(--folio-note)}
.bound-leaves .shelf-tools .filter-toggle {color:#4d3b28}
.bound-leaves .book-card,.bound-leaves .book-stage {background:transparent}
/* Use only the silhouette of the actual jacket: multiplying a white studio square still shows its
   frame on a detailed backdrop, and would tint the cream covers. Preserve every printed pixel. */
.book-card[data-book-id="haggadah"] {--jacket-shape:url("assets/folio/edge-haggadah.svg")}
.book-card[data-book-id="shabbat"] {--jacket-shape:url("assets/folio/edge-shabbat.svg")}
.book-card[data-book-id="uri-veyishi"] {--jacket-shape:url("assets/folio/edge-uri-veyishi.svg")}
.book-card[data-book-id="sukkot"] {--jacket-shape:url("assets/folio/edge-sukkot.svg")}
.bound-leaves .book-stage {mix-blend-mode:normal;filter:drop-shadow(0 5px 5px rgb(65 44 20 / 22%))}
.bound-leaves .book-stage>.book-cover {mix-blend-mode:normal;filter:none;mask:var(--jacket-shape,none) center / contain no-repeat}
.bound-leaves .book-body {position:relative;isolation:isolate}
/* Let the shelves stay sharp at the margins; leave a pool of unprinted paper immediately behind type. */
.bound-leaves .book-body::before {content:"";position:absolute;z-index:-1;pointer-events:none;inset:-.8rem -6% -.5rem;background:radial-gradient(ellipse at center 40%,rgb(249 244 231 / 72%) 15%,rgb(249 244 231 / 42%) 55%,transparent 81%)}
.bound-leaves .contact-section,.site-footer {background:var(--folio-light)}
.bound-leaves .contact-card {background:rgb(235 223 199 / 52%)}
.bound-leaves .contact-card :is(.button-blue,.button-gold),.bound-leaves .book-actions .button-blue {background:var(--accent)}
.bound-leaves .contact-card :is(.button-blue,.button-gold):hover,.bound-leaves .book-actions .button-blue:hover {background:var(--accent-hover)}
.bound-leaves .about-section {background:linear-gradient(180deg,var(--folio-light),#efe5d1 58%,var(--folio-light));color:var(--folio-ink)}
@media(min-width:681px){
  .library-room::after {content:"";position:absolute;inset:0;pointer-events:none;background:radial-gradient(ellipse 20% 24% at 86% 14%,rgb(249 243 226 / 60%),transparent 90%)}
}
/* Phone layouts use one portrait illustration: a bookcase at the cover edge,
   a light central wall under the words, and no tiling or square panels. */
@media(max-width:900px),(max-width:960px) and (max-height:540px){
  html:has(.pocket-catalogue){scroll-behavior:auto}
  .pocket-catalogue{--emblem-large:clamp(102px,29vw,132px);--emblem-small:50px;--emblem-inset:12px}
  .parchment-panel .hero .hero-inner{width:calc(100% - 30px);min-height:0;padding-block:calc(var(--device-top) + var(--emblem-inset) + var(--emblem-large) + 7px) clamp(15px,4.3vw,26px)}
  .parchment-panel .hero .hero-actions{margin-top:13px}
  .parchment-panel .lessons-section:not(.weekly-pending){padding-block:18px 27px}
  .parchment-panel .weekly-lesson:not([hidden]){grid-template-columns:minmax(0,1fr);grid-template-areas:"intro" "poster" "actions" "message" "description";gap:0}
  .parchment-panel .weekly-intro{margin-bottom:8px;flex-direction:column;align-items:flex-start;gap:2px}
  .weekly-intro h2{font-size:clamp(1.65rem,7.0vw,2.34rem);line-height:1.19}
  .weekly-intro .lesson-meta{font-size:.9rem}
  .parchment-panel .weekly-copy{display:contents}
  .weekly-series{margin-top:6px;font-size:.96rem}
  .parchment-panel .weekly-copy .weekly-controls{margin-top:8px}
  .parchment-panel .weekly-description{margin-top:6px}
  .parchment-panel .weekly-stage{border-radius:6px}
  .parchment-panel .resume-strip>a{min-height:48px;padding-block:4px}
  .parchment-panel .hero-light{inset:-15% -25%}
  .panel-ground .hero-facsimile{object-position:60% 46%;opacity:.77;mask-image:linear-gradient(to bottom,#000 9%,rgb(0 0 0/.93) 38%,rgb(0 0 0/.80) 69%,rgb(0 0 0/.63) 100%)}
  .panel-ground::after{background:
    linear-gradient(to bottom,transparent calc(100% - 110px),var(--folio-seam)),
    radial-gradient(ellipse 63% 46% at 52% 36%,rgb(246 235 212/.85),rgb(245 233 211/.65) 40%,transparent 94%),
    linear-gradient(to bottom,transparent 29%,rgb(246 236 215/.24) 51%,rgb(248 239 218/.43) 79%,rgb(249 244 232/.55) 100%)}

}
@media(max-width:680px) and (orientation:portrait),(max-width:540px){
  .bound-leaves .library-section{background:linear-gradient(180deg,var(--folio-seam),#f3ead8 150px,#f9f3e5 81%,var(--folio-light));padding-block:28px 30px}
  .library-room picture{height:100%;width:100%;opacity:.35;mask-image:linear-gradient(to bottom,transparent,#000 calc(var(--shelf-overlap) + 72px),#000 73%,rgb(0 0 0/.66) 89%,transparent)}
  .library-room img{object-fit:cover;object-position:74% 36%}
  .bound-leaves .book-body::before{display:none}
  .shelf-title::before{inset:-52% -36% -85% -30%;background:radial-gradient(ellipse,#f6ead2 14%,rgb(246 234 210/.90) 40%,transparent 76%)}
  .shelf-context{gap:3px 12px;color:#574937;margin-block:8px 11px}
  .bound-leaves .shelf-context .result-count{color:#544737}
  .book-grid .book-card{grid-template-columns:clamp(82px,28%,150px) minmax(0,1fr);padding-block:14px}
  .book-stage{align-self:start}
  .book-actions{gap:3px 8px}
  .book-actions .button,.shelf-tools .filter-toggle,.gate-read{min-height:44px}
  .parchment-panel .weekly-actions a{min-height:44px}
  .gates-dialog .gates-inner{padding-inline:max(16px,var(--device-right)) max(16px,var(--device-left))}
}
@media(max-width:390px){.parchment-panel .hero-actions .button{padding-inline:10px;gap:6px}}
@media(max-width:355px){.parchment-panel .hero .hero-actions{gap:7px}.shelf-context{font-size:.75rem}.book-grid .book-card{gap:9px}}
@media(orientation:landscape) and (max-height:540px) and (max-width:960px){
  .pocket-catalogue{--emblem-large:clamp(64px,18vh,83px);--emblem-small:43px;--emblem-inset:7px}
  .parchment-panel .weekly-lesson:not([hidden]){grid-template-columns:1.06fr .94fr;grid-template-areas:"intro summary" "poster summary";gap:5px 19px}
  .parchment-panel .weekly-intro{margin-bottom:0;gap:2px 8px;flex-direction:row}
  .parchment-panel .weekly-copy{display:block}

}
@media print{.panel-ground,.light-field,.library-room,.shelf-title::before,.bound-leaves .book-body::before{display:none}
  .bound-leaves,.parchment-panel,.bound-leaves :is(.lessons-section,.library-section,.contact-section,.about-section,.contact-card){color:#222;background:white}
}

/* The deeper bronze in the emblem stays legible on the manuscript. */
.parchment-panel .hero #hero-title {
  margin-inline:auto; max-inline-size:100%;
  color:#84501c; font-family:"Frank Ruhl Libre", "Noto Serif Hebrew", serif;
  font-size:clamp(2.15rem,4.35vw,3.65rem);
  font-weight:600; line-height:1.16; letter-spacing:normal;
  white-space:normal; text-wrap:balance;
  text-shadow:0 1px 1px rgb(255 247 226 / 85%);
}
.site-footer .institute-rights {
  display:block; margin:1.25rem auto 0; padding-inline:1rem;
  text-align:center; color:var(--muted); font-size:.78rem; line-height:1.55;
}
.hero-phrase {display:inline-block; max-inline-size:100%}
