/* Hero, weekly lesson and shelf layout. */
.hero-inner {
  width: min(970px, calc(100% - 80px));
  min-height: 294px; padding-block: 25px;
  grid-template-columns: minmax(0, 1fr) auto; gap: clamp(32px, 7vw, 92px);
}
.hero-copy {justify-self: center; min-width: 0;}
.hero .eyebrow {margin-bottom: 8px;}
.hero h1 {font-size: clamp(3rem, 4.7vw, 4.15rem); line-height: 1.12;}

.hero-description {margin-top: 11px;}
.hero-actions {gap: 12px; margin-top: 21px; flex-wrap: wrap;}
.hero-actions .button {min-height: 46px; min-width: 132px; border-radius: 4px;}



/* A single announcement until a selected lesson is actually available. */
.lessons-section {padding-block: 30px; background: var(--tint); border:0;}
.lessons-section.weekly-pending {padding-block: 14px;}
.weekly-heading {display: flex; align-items: center; gap: 14px; margin-bottom: 16px;}
.weekly-heading h2 {font-size: clamp(1.25rem, 2.1vw, 1.8rem); line-height: 1.35;}
.weekly-heading .weekly-mark {color: var(--muted); width: 30px; height: 30px;}
.weekly-pending .weekly-heading {margin: 0;}
.weekly-pending .weekly-heading h2 {font-size: 1rem; font-weight: 600;}
#weekly-status {font-size: .875rem; color: var(--muted);  padding-inline-start: 14px;}
#video-summary:empty {display: none;}
.weekly-lesson {grid-template-columns: minmax(240px,.72fr) minmax(0,1.28fr);}
.weekly-visual.video-poster {align-self: center; height: auto; min-height: 0; background: var(--ink);}
.weekly-copy {padding: clamp(18px,2.2vw,30px);}
.weekly-copy h3 {margin-bottom: 3px;}
.weekly-copy .eyebrow {margin-bottom: 2px;}
.weekly-copy .lesson-meta {font-size: .875rem; color: var(--muted); margin-bottom: 8px;}
.weekly-actions {align-items: center; flex-direction: row; width: auto; gap: 8px 22px; margin-top: 14px;}
.weekly-actions .text-link {min-height: 44px; display: inline-flex; align-items: center;}
.video-card > a {display: block;}
.video-card-copy h4 {font-size: 1.2rem; line-height: 1.45; margin: 5px 0;}
.archive-links {display: flex; align-items: center; flex-wrap: wrap; gap: 0 20px;}
.archive-links .text-link {min-height: 44px; display: inline-flex; align-items: center;}
.lesson-duration {white-space: nowrap;}
.video-player {width: 100%; max-width: 100%; min-width: 0;}
.video-player iframe {max-width: 100%;}
.video-dialog.is-expanded {position: fixed; inset: 0; width: 100%; height: 100dvh; max-width: 100%; max-height: 100dvh; margin: 0; border: 0; border-radius: 0;}
.video-dialog.is-expanded .video-player {width: 100%; height: min(calc(100dvh - 145px), 70vw); min-height: 160px;}
.video-poster {isolation: isolate;}
.video-poster > .icon {background:transparent;color:var(--paper);}
@media (max-width:680px) {
  .weekly-lesson {grid-template-columns: 1fr;}
  .weekly-visual.video-poster {aspect-ratio: 16/9; max-height: none;}
  .weekly-actions {width: 100%; gap: 3px 14px;}
  .weekly-actions .button {flex: 0 1 auto;}
  .video-library-heading .archive-links {gap: 0 14px;}
  .video-dialog {width: 100%; max-width: 100%; margin-inline: 0;}
}

/* One light shelf for all publications; the covers are the strongest visual element. */
.library-section {padding-block: 34px 52px;}
.shelf-heading {display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px 32px;}
.shelf-title .eyebrow {display: flex; align-items: center; gap: 9px; margin: 0 0 4px;}

.shelf-title h2 {font-size: clamp(1.95rem, 3vw, 2.5rem); line-height: 1.2; letter-spacing: -.025em;}
.shelf-tools {display: flex; gap: 8px; align-items: stretch; width: min(100%, 405px); min-width: 0;}
.shelf-tools .search-form {
  flex: 1; min-width: 0; display: flex; gap: 0; align-items: center;
  padding: 0 14px 0 0; background: var(--paper); border: 1px solid var(--control-edge); border-radius: 4px; box-shadow: none;
}
.shelf-tools .search-form:focus-within {outline: 2px solid var(--accent); outline-offset: 2px;}
.shelf-tools .search-form input {height: 44px; outline: 0; font-size: 1rem;}
.shelf-search-button {display: grid; place-items: center; width: 46px; min-height: 44px; padding: 0; background: transparent; color: var(--ink);}
.shelf-search-button .icon {width: 21px; height: 21px;}
.filter-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 46px; padding: 7px 14px; color: var(--ink); font-size: .9375rem;
  background: var(--paper); border: 1px solid var(--control-edge); border-radius: 4px;
}
.filter-toggle .icon {width: 19px; height: 19px;}
.filter-toggle[aria-expanded="true"], .filter-toggle:hover, .shelf-search-button:hover {background: var(--tint);}
#active-filter-count {min-width: 19px; padding-inline: 4px; border-radius: 10px; background: var(--ink); color: white; font-size: .75rem; line-height: 19px;}
.library-toolbar {margin: 16px 0 0; padding: 10px 14px; border: 1px solid var(--control-edge); border-radius: 4px; background: var(--paper); gap: 16px;}
.library-toolbar .filters button {min-height: 44px;}
.library-toolbar .library-topic label {display: inline;}
.shelf-context {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px;
  margin: 12px 0 16px; font-size: .8125rem; line-height: 1.55; color: var(--muted);
}
.shelf-context .result-count {width: auto; margin: 0; color: var(--muted); font-size: .8125rem;}
.shelf-context #search-help {margin-inline-start: auto;}
.shelf-context .text-link {min-height: 44px; font-size: .8125rem;}
.book-grid {grid-template-columns: repeat(4,minmax(0,1fr)); gap: 25px;}
.book-card {background: transparent; border: 0; border-radius: 0; overflow: visible; transition: none;}
.book-card:hover {border-color: transparent; box-shadow: none;}
.book-stage {
  display: grid; place-items: center; padding: 0;
  background: transparent; aspect-ratio: 1.14; border: 0; border-radius: 4px; overflow: hidden;
}
.book-stage img {width: 100%; height: 100%; min-height: 0; object-fit: contain;}
/* White in the tabletop mockups blends into the paper. Keep the original
   illustrated covers, Hebrew lettering, edges, and contact shadows intact. */
.book-stage img,.dialog-gallery img,.reader-cover-wrap img {mix-blend-mode:multiply;filter:brightness(1.012);}
.book-dialog {background:var(--paper);}
.book-dialog .dialog-gallery {background:transparent;}
.book-body {padding: 13px 1px 0;}
.book-meta {font-size: .75rem; margin-bottom: 4px; gap: 7px;}
.book-meta .type-badge {background: transparent; color: var(--muted); padding: 0; font-weight: 600;}
.book-meta .type-badge::after {content: "·"; padding-inline-start: 7px; color: var(--muted);}
.book-card h3 {font-size: clamp(1.25rem,1.8vw,1.55rem); line-height: 1.3; margin: 0 0 5px;}
.book-subtitle {font-size: .875rem; line-height: 1.6; min-height: 3.2em;}
.book-actions {display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 13px;}
.book-actions .button {min-height: 44px; font-size: .875rem; padding: 8px 11px; gap: 6px; border-radius: 4px;}
.book-actions .button-blue {min-width: 82px;}
.book-actions .button-outline:not(:disabled) {background: transparent; border-color: transparent; color: var(--ink);}
.book-actions .button-outline:not(:disabled):hover {background: var(--tint); text-decoration: underline; text-underline-offset: 3px;}
.book-actions .icon {width: 17px; height: 17px;}
.book-body > .purchase-button {align-self: flex-start; width: auto; min-height: 44px; margin-top: 6px; padding: 6px 8px; gap: 4px; background: transparent; border: 0; color: var(--muted); font-size: .825rem;}
.book-body > .purchase-button:hover {text-decoration: underline; text-underline-offset: 4px;}
.book-body .purchase-store {flex-basis: auto; font-size: inherit;}
.book-body > .purchase-button .icon {width: 16px; height: 16px;}
@media (min-width: 681px) and (max-width: 919px) {
  .book-grid {grid-template-columns: repeat(2,minmax(0,1fr)); gap: 26px;}
}
@media (max-width: 760px) {
  .hero-inner {
    width: calc(100% - 40px); max-width: 620px; min-height: 0; padding-block: 24px;
    grid-template-areas: "intro seal" "buttons buttons";
    grid-template-columns: minmax(0,1fr) auto; gap: 16px 13px;
  }
  .hero-copy {display: contents;}
  .hero-intro {grid-area: intro; text-align: start;}
  .hero .eyebrow {justify-content: flex-start; margin-bottom: 8px;}

  .hero h1 {font-size: clamp(2.05rem,6.8vw,3rem);}
  .hero-description {margin: 8px 0 0; font-size: .975rem; line-height: 1.5; text-wrap: pretty;}

  .hero-actions {grid-area: buttons; display: flex; justify-content: flex-start; gap: 8px; max-width: none; width: 100%; margin: 0;}
  .hero-actions .button {width: auto; flex: 1; max-width: 200px; min-width: 0; padding: 10px 8px; font-size: .875rem;}
  .weekly-pending .weekly-heading {display: grid; grid-template-columns: auto minmax(0,1fr); gap: 0 10px;}
  .weekly-pending .weekly-heading .weekly-mark {grid-row: span 2; width: 25px; height: 25px;}
  .weekly-pending .weekly-heading h2 {font-size: .9375rem;}
  #weekly-status {grid-column: 2; border: 0; padding: 0; margin-top: 2px; font-size: .8125rem;}
  .lessons-section.weekly-pending {padding-block: 10px;}
  .library-section {padding-block: 27px 34px;}
  .shelf-heading {gap: 13px; align-items: flex-start;}
  .shelf-title h2 {font-size: 1.8rem;}
  .shelf-tools {width: 100%;}
  .library-toolbar {align-items: center; margin-top: 10px; padding: 9px; gap: 7px 12px;}
  .library-toolbar .library-topic {margin: 0;}
  .shelf-context {margin: 9px 0 13px; gap: 2px 10px;}
  .shelf-context #search-help {font-size: .75rem;}
}
@media (max-width: 680px) {
  .book-grid {grid-template-columns: minmax(0,1fr); gap: 0;}
  .book-card {
    display: grid; grid-template-columns: clamp(88px,28%,145px) minmax(0,1fr);
    align-items: start; gap: clamp(10px,3vw,18px);
    border:0; padding: 15px 0;
  }
  .book-card:hover {border-color: var(--control-edge);}
  .book-stage {align-self: start; padding: 0; aspect-ratio: .84; border-radius: 3px;}
  .book-body {padding: 0; min-width: 0;}
  .book-meta {margin: 0 0 2px;}
  .book-card h3 {font-size: 1.19rem; margin-bottom: 4px;}
  .book-subtitle {min-height: 0; font-size: .8125rem; line-height: 1.55;}
  .book-actions {margin-top: 7px; gap: 2px 6px;}
  .book-actions .button {font-size: .8125rem; min-width: 0; padding-inline: 7px;}
  .book-actions .icon {width: 16px; height: 16px;}
  .book-body > .purchase-button {margin: 2px 0 0; padding-inline: 0; text-align: start;}
}
@media (max-width: 350px) {
  .hero-inner {width: calc(100% - 28px); gap: 14px 9px;}
  .shelf-context #search-help {margin-inline-start: 0;}
  .filter-toggle {padding-inline: 9px; gap: 5px;}
  .book-actions {gap: 2px;}
  .book-actions .button {padding-inline: 5px;}
}
