/* ==========================================================================
   סגולות ותפילות — /segulot and /segulot/<slug>
   Bordeaux and gold, a printed-edition frame beside a live reading column.
   ========================================================================== */
.rbs {
  --rbs-bord: #7e022b; --rbs-bord-2: #5c011f; --rbs-gold: #c9a24a; --rbs-gold-2: #ecd08c;
  --rd-bg: #fdfbf6; --rd-paper: #ffffff; --rd-ink: #1d1611; --rd-mut: #6f6255; --rd-line: #ebe2d0;
  --rd-soft: rgba(126, 2, 43, .07); --rd-acc: #7e022b;
  --rd-instr-bg: #f8f1e1; --rd-instr-ink: #6a4513; --rd-instr-line: #e3cf9f;
  background: var(--rd-bg); color: var(--rd-ink); direction: rtl;
  transition: background .25s, color .25s;
}
.rbs[data-theme="parchment"] {
  --rd-bg: #efe2c2; --rd-paper: #f7edd5; --rd-ink: #2a1b0b; --rd-mut: #77603f; --rd-line: #d9c497;
  --rd-soft: rgba(106, 69, 19, .1); --rd-instr-bg: #ecdcb3; --rd-instr-ink: #643a08; --rd-instr-line: #cfb57a;
  background-image: radial-gradient(1200px 600px at 80% 0%, rgba(255,255,255,.45), transparent 60%),
                    radial-gradient(900px 700px at 0% 100%, rgba(150,110,50,.12), transparent 60%);
}
.rbs[data-theme="dark"] {
  --rd-bg: #121010; --rd-paper: #1b1816; --rd-ink: #efe6d6; --rd-mut: #a99a89; --rd-line: #322b25;
  --rd-soft: rgba(236, 208, 140, .1); --rd-acc: #ecd08c;
  --rd-instr-bg: #221d17; --rd-instr-ink: #e6c67e; --rd-instr-line: #4a3c26;
}
.rbs *, .rbs *::before, .rbs *::after { box-sizing: border-box; }
.rbs a { color: inherit; }
.rbs .rbs-wrap { max-width: 1240px; margin: 0 auto; padding: 0 28px; }
@media (max-width: 640px) { .rbs .rbs-wrap { padding: 0 16px; } }

/* everything is set in the site face (almoni-tzar); only the sacred text
   itself (.rbs-sacred) uses the book face */
body.rb-body .rbs h1, body.rb-body .rbs h2, body.rb-body .rbs h3,
body.rb-body .rbs .rbs-ui, body.rb-body .rbs .rbs-ui * { font-family: 'almoni-tzar', sans-serif; }

/* ---- head --------------------------------------------------------------- */
.rbs-head {
  position: relative; overflow: hidden; color: #fff; padding: 46px 0 40px;
  background: linear-gradient(135deg, var(--rbs-bord-2), var(--rbs-bord) 55%, #93083a);
  border-bottom: 3px solid var(--rbs-gold);
}
.rbs-head::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: var(--rbs-bg, none); background-size: cover; background-position: center;
  opacity: .16; mix-blend-mode: luminosity;
}
.rbs-head::after {
  content: ''; position: absolute; inset: 10px; pointer-events: none;
  border: 1px solid rgba(236, 208, 140, .35); border-radius: 4px;
}
.rbs-head .rbs-wrap { position: relative; z-index: 1; }
.rbs-crumbs { font-size: 16px; color: rgba(255,255,255,.72); margin-bottom: 14px; }
.rbs-crumbs a { color: rgba(255,255,255,.82); text-decoration: none; }
.rbs-crumbs a:hover { color: #fff; }
.rbs-crumbs i { font-style: normal; opacity: .55; margin: 0 7px; }
.rbs-kicker {
  display: inline-block; font-size: 16px; letter-spacing: .3px; color: var(--rbs-gold-2);
  border: 1px solid rgba(236, 208, 140, .55); border-radius: 999px; padding: 2px 14px; margin-bottom: 12px;
}
body.rb-body .rbs-head h1 {
  font-size: clamp(36px, 5.2vw, 64px); line-height: 1.02; margin: 0 0 10px; font-weight: 600; color: #fff;
  text-wrap: balance; /* a long title never leaves one word alone on its last line */
}
.rbs-head .rbs-sub { margin: 0; font-size: 21px; color: rgba(255,255,255,.86); max-width: 60ch; }
.rbs-head .rbs-srcnote { margin: 14px 0 0; font-size: 16px; color: var(--rbs-gold-2); }
.rbs-head .rbs-srcnote a { color: var(--rbs-gold-2); }

/* ---- the edition / reading grid ---------------------------------------- */
.rbs-grid {
  display: grid; grid-template-columns: minmax(300px, 410px) minmax(0, 1fr);
  gap: 44px; align-items: start; padding-top: 38px; padding-bottom: 70px;
}
.rbs-grid--solo { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 960px) {
  .rbs-grid { grid-template-columns: minmax(0, 1fr); gap: 30px; padding-top: 26px; }
}

/* area A — the printed edition */
.rbs-print { position: sticky; top: 72px; }
@media (max-width: 960px) { .rbs-print { position: static; } }
.rbs-label {
  display: flex; align-items: center; gap: 10px; margin: 0 0 14px;
  font-size: 22px; font-weight: 600; color: var(--rd-ink);
}
.rbs-label::before, .rbs-label::after { content: ''; flex: 1 1 auto; height: 1px; background: var(--rd-line); }
.rbs-frame {
  display: block; position: relative; margin: 0 auto 20px; max-width: 380px;
  padding: 14px; background: linear-gradient(145deg, #f6ecd2, #e9d6a8);
  border: 1px solid #c9a24a; border-radius: 6px;
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 26px 50px -24px rgba(60, 20, 5, .55),
              0 8px 18px -10px rgba(60, 20, 5, .35);
  transition: transform .25s, box-shadow .25s;
}
.rbs-frame::before {
  content: ''; position: absolute; inset: 6px; border: 1px solid rgba(126, 2, 43, .35);
  border-radius: 3px; pointer-events: none;
}
.rbs-frame img {
  display: block; width: 100%; height: auto; background: #fff;
  border: 1px solid rgba(120, 80, 20, .35); box-shadow: 0 2px 10px rgba(60, 30, 5, .18);
}
a.rbs-frame:hover { transform: translateY(-3px); box-shadow: 0 1px 0 rgba(255,255,255,.6) inset,
  0 34px 60px -26px rgba(60, 20, 5, .6), 0 10px 22px -10px rgba(60, 20, 5, .35); }
.rbs-frame--empty {
  aspect-ratio: 210 / 297; display: grid; place-items: center; text-align: center; color: var(--rbs-bord);
}
.rbs-frame--empty .rbs-orn { width: 64%; opacity: .8; }
.rbs-frame--empty b { display: block; margin-top: 14px; font-size: 22px; font-weight: 600; }

.rbs-actions { display: grid; gap: 10px; max-width: 380px; margin: 0 auto; }
.rbs-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; text-align: center;
  padding: 14px 18px; border-radius: 12px; font-size: 19px; font-weight: 600; line-height: 1.25;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: transform .16s, box-shadow .16s, background .16s;
}
.rbs-btn svg { width: 20px; height: 20px; flex: 0 0 auto; }
.rbs-btn:hover { transform: translateY(-2px); }
.rbs .rbs-btn--pdf {
  background: linear-gradient(180deg, #8d0632, var(--rbs-bord)); color: #fff;
  border-color: var(--rbs-bord-2); box-shadow: 0 10px 22px -12px rgba(126, 2, 43, .8), inset 0 1px 0 rgba(255,255,255,.18);
  font-size: 20px; padding: 16px 18px;
}
.rbs .rbs-btn--pdf small { display: block; font-size: 14px; font-weight: 400; color: var(--rbs-gold-2); }
.rbs .rbs-btn--wa { background: var(--rd-paper); color: #0f7a3d; border-color: #bfe3cc; }
.rbs .rbs-btn--wa:hover { background: #effaf3; }
.rbs[data-theme="dark"] .rbs-btn--wa { color: #7fd7a3; border-color: #2c5a3f; }
.rbs[data-theme="dark"] .rbs-btn--wa:hover { background: #18241d; }

/* area B — live reading */
.rbs-read { min-width: 0; }
.rbs-bar {
  position: sticky; top: 54px; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 22px;
  background: var(--rd-bg); background: color-mix(in srgb, var(--rd-bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px);
  border: 1px solid var(--rd-line); border-radius: 14px;
}
.rbs-bar .rbs-bar-title { font-size: 19px; color: var(--rd-mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 999px) { .rbs-bar { top: 72px; } }      /* under the phone header bar */
@media (max-width: 640px) { .rbs-bar .rbs-bar-title { display: none; } .rbs-bar { justify-content: center; } }

.rbs-sheet {
  background: var(--rd-paper); border: 1px solid var(--rd-line); border-radius: 16px;
  padding: 40px clamp(20px, 5vw, 58px) 46px;
  box-shadow: 0 24px 50px -38px rgba(40, 20, 5, .45);
  position: relative;
}
.rbs-sheet::before {
  content: ''; position: absolute; inset: 10px; border: 1px solid var(--rd-line); border-radius: 10px;
  pointer-events: none; opacity: .8;
}
.rbs[data-theme="parchment"] .rbs-sheet {
  background-image: radial-gradient(700px 400px at 100% 0%, rgba(255,255,255,.5), transparent 70%);
}

.rbs-howto {
  position: relative; margin: 0 0 30px; padding: 18px 22px; border-radius: 12px;
  background: var(--rd-instr-bg); color: var(--rd-instr-ink); border: 1px solid var(--rd-instr-line);
}
body.rb-body .rbs-howto h2 { margin: 0 0 6px; font-size: 21px; font-weight: 600; color: var(--rd-instr-ink); }
.rbs-howto, body.rb-body .rbs-howto p, body.rb-body .rbs-howto li, body.rb-body .rbs-howto span,
body.rb-body .rbs-howto b, body.rb-body .rbs-howto strong {
  font-family: 'almoni-tzar', sans-serif; font-size: 19px; line-height: 1.6;
}
.rbs-howto p { margin: 0 0 .5em; }
.rbs-howto p:last-child { margin-bottom: 0; }
.rbs-howto ul, .rbs-howto ol { margin: .3em 0; padding-inline-start: 1.3em; }

/* the text itself — shown exactly as stored, in the face the reader picked
   (--rb-book-font / --rb-book-scale, see server/lib/reader-tools.js), with
   generous room between the lines and between paragraphs */
.rbs-text { position: relative; font-size: var(--reader-size, 26px); transition: font-size .18s; }
.rbs .rbs-text .rbs-sacred,
body.rb-body .rbs .rbs-text .rbs-sacred {
  font-family: var(--rb-book-font); font-size: calc(1em * var(--rb-book-scale, 1)); line-height: 2.25; font-weight: 400;
  white-space: pre-line; color: var(--rd-ink); margin: 0 0 1.2em;
  text-align: justify; text-justify: inter-word;
  letter-spacing: normal; word-spacing: normal; text-transform: none; font-variant: normal;
  font-feature-settings: normal; font-kerning: auto;
}
.rbs .rbs-text .rbs-instr,
body.rb-body .rbs .rbs-text .rbs-instr {
  font-family: 'almoni-tzar', sans-serif; font-size: max(17px, .7em); line-height: 1.5;
  white-space: pre-line; color: var(--rd-instr-ink); background: var(--rd-instr-bg);
  border: 1px solid var(--rd-instr-line); border-inline-start: 4px solid var(--rbs-gold);
  border-radius: 10px; padding: .6em 1em; margin: .2em 0 1.1em;
}
@media (max-width: 640px) { .rbs .rbs-text .rbs-sacred, body.rb-body .rbs .rbs-text .rbs-sacred { text-align: start; } }
.rbs-empty { text-align: center; color: var(--rd-mut); font-size: 18px; padding: 20px 0; }

/* closing call to action */
.rbs-cta {
  margin-top: 34px; display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  padding: 22px 24px; border-radius: 14px; color: #fff;
  background: linear-gradient(135deg, var(--rbs-bord-2), var(--rbs-bord)); border: 1px solid var(--rbs-gold);
}
body.rb-body .rbs-cta h3 { margin: 0 0 2px; font-size: 24px; font-weight: 600; color: #fff; }
.rbs-cta p { margin: 0; font-size: 17px; color: rgba(255,255,255,.82); }
.rbs .rbs-cta a {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  background: var(--rbs-gold-2); color: var(--rbs-bord-2); font-size: 19px; font-weight: 700;
  padding: 12px 24px; border-radius: 999px; transition: transform .16s, background .16s;
}
.rbs .rbs-cta a:hover { transform: translateY(-2px); background: #f5dea4; }

/* more in the same topic */
.rbs-more { border-top: 1px solid var(--rd-line); padding: 36px 0 80px; }
body.rb-body .rbs-more h2 { font-size: 26px; font-weight: 600; margin: 0 0 16px; color: var(--rd-ink); }

/* ---- the section index -------------------------------------------------- */
.rbs-filter {
  position: sticky; top: 46px; z-index: 20; padding: 14px 0; margin-bottom: 8px;
  background: var(--rd-bg); background: color-mix(in srgb, var(--rd-bg) 92%, transparent);
  backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--rd-line);
}
@media (max-width: 999px) { .rbs-filter { top: 64px; } }
.rbs-filter .rbs-wrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rbs-search { position: relative; flex: 1 1 260px; max-width: 420px; }
.rbs-search input {
  width: 100%; height: 46px; border-radius: 999px; border: 1px solid var(--rd-line); background: var(--rd-paper);
  color: var(--rd-ink); padding: 0 46px 0 16px; font-size: 19px; font-family: 'almoni-tzar', sans-serif;
}
.rbs-search input:focus { outline: 2px solid var(--rbs-gold); outline-offset: 1px; }
.rbs-search svg { position: absolute; top: 50%; right: 16px; transform: translateY(-50%); width: 18px; height: 18px; color: var(--rd-mut); }
.rbs-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.rbs-chip {
  appearance: none; -webkit-appearance: none; cursor: pointer; margin: 0;
  border: 1px solid var(--rd-line); background: var(--rd-paper); color: var(--rd-ink);
  border-radius: 999px; padding: 7px 15px; font-size: 17px; line-height: 1.2;
  transition: background .15s, color .15s, border-color .15s;
}
.rbs-chip span { color: var(--rd-mut); font-size: 14px; margin-inline-start: 4px; }
.rbs-chip:hover { border-color: var(--rbs-gold); }
.rbs-chip[aria-pressed="true"] { background: var(--rbs-bord); border-color: var(--rbs-bord); color: #fff; }
.rbs-chip[aria-pressed="true"] span { color: var(--rbs-gold-2); }
.rbs-count { font-size: 16px; color: var(--rd-mut); margin-inline-start: auto; }
/* the search box above the bar and the magnifier inside it are for phones and tablets (round 26: up to 999px); the bar
   itself carries the box on wider screens */
.rbs-m { display: none; }
@media (max-width: 999px) {
  .rbs-d { display: none !important; }
  .rbs-find.rbs-m { display: block; padding: 16px 0 6px; }
  .rbs-find .rbs-wrap { display: flex; align-items: center; gap: 12px; }
  .rbs-find .rbs-search { flex: 1 1 auto; max-width: none; }
  .rbs-find .rbs-search input { height: 44px; font-size: 18px; }
  .rbs-find .rbs-count { flex: 0 0 auto; font-size: 14px; white-space: nowrap; margin: 0; }
  /* the sticky bar: one thin line — the magnifier and the topics, which scroll sideways */
  .rbs-filter { padding: 7px 0; margin-bottom: 0; }
  .rbs-filter .rbs-wrap { flex-wrap: nowrap; gap: 8px; padding-inline-end: 0; }
  .rbs-findbtn.rbs-m {
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
    width: 34px; height: 34px; padding: 0; border-radius: 50%; cursor: pointer;
    border: 1px solid var(--rd-line); background: var(--rd-paper); color: var(--rd-mut);
  }
  .rbs-findbtn svg { width: 17px; height: 17px; }
  .rbs-filter .rbs-chips {
    flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 1px 0;
  }
  .rbs-filter .rbs-chips::-webkit-scrollbar { display: none; }
  .rbs-filter .rbs-chips li { flex: 0 0 auto; }
  .rbs-filter .rbs-chip { padding: 6px 13px; font-size: 16px; white-space: nowrap; }
  /* right-to-left: the row starts on the right, so "הכול" stays crisp and only the side with more topics fades */
  .rbs-filter .rbs-chips.more-end { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28px); mask-image: linear-gradient(to right, transparent 0, #000 28px); }
  .rbs-filter .rbs-chips.more-start { -webkit-mask-image: linear-gradient(to left, transparent 0, #000 28px); mask-image: linear-gradient(to left, transparent 0, #000 28px); }
  .rbs-filter .rbs-chips.more-start.more-end {
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
  }
}

.rbs-topic { padding: 34px 0 6px; }
.rbs-topic[hidden] { display: none; }
body.rb-body .rbs-topic h2 {
  display: flex; align-items: center; gap: 12px; font-size: 30px; font-weight: 600; margin: 0 0 18px; color: var(--rd-ink);
}
.rbs-topic h2::after { content: ''; flex: 1 1 auto; height: 1px; background: linear-gradient(90deg, transparent, var(--rbs-gold)); }
.rbs-topic h2 svg { width: 22px; height: 22px; color: var(--rbs-gold); flex: 0 0 auto; }

.rbs-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.rbs-card {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  background: var(--rd-paper); border: 1px solid var(--rd-line); border-radius: 16px; overflow: hidden;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.rbs-card[hidden] { display: none; }
.rbs-card:hover { transform: translateY(-4px); border-color: var(--rbs-gold); box-shadow: 0 22px 40px -26px rgba(60, 20, 5, .55); }
.rbs-card .shot {
  position: relative; aspect-ratio: 4 / 5; overflow: hidden;
  background: linear-gradient(145deg, #f6ecd2, #e7d3a3); border-bottom: 1px solid var(--rd-line);
}
.rbs-card .shot img {
  position: absolute; inset: 12px; width: calc(100% - 24px); height: calc(100% - 24px);
  object-fit: cover; object-position: top center; background: #fff;
  box-shadow: 0 6px 16px -6px rgba(60, 30, 5, .45); border: 1px solid rgba(120, 80, 20, .3);
}
.rbs-card .shot .rbs-orn { position: absolute; inset: 22% 22%; width: 56%; color: var(--rbs-bord); opacity: .55; }
.rbs-card .shot .tag {
  position: absolute; top: 18px; right: 18px; z-index: 1; background: var(--rbs-bord); color: #fff;
  font-size: 14px; padding: 3px 11px; border-radius: 999px; box-shadow: 0 4px 10px -4px rgba(0,0,0,.4);
}
.rbs-card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; }
body.rb-body .rbs-card h3 { margin: 0; font-size: 23px; font-weight: 600; line-height: 1.15; color: var(--rd-ink); }
.rbs-card p { margin: 0; font-size: 17.5px; line-height: 1.4; color: var(--rd-mut); font-family: 'almoni-tzar', sans-serif; }
.rbs-card .meta { margin-top: auto; padding-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.rbs-card .meta span {
  font-size: 13px; color: var(--rbs-bord); border: 1px solid var(--rd-instr-line); background: var(--rd-instr-bg);
  border-radius: 999px; padding: 1px 9px;
}
.rbs[data-theme="dark"] .rbs-card .meta span { color: var(--rbs-gold-2); }
.rbs-none { text-align: center; padding: 50px 0 20px; font-size: 19px; color: var(--rd-mut); }
.rbs-none[hidden] { display: none; }
.rbs-index { padding-bottom: 80px; }

/* preview-only notice */
.rbs-preview {
  background: #fff4cf; color: #5c4400; text-align: center; padding: 8px 16px; font-size: 17px;
  border-bottom: 1px solid #e6cd7a; font-family: 'almoni-tzar', sans-serif;
}

@media (prefers-reduced-motion: reduce) { .rbs *, .rbs { transition: none !important; } }
@media print {
  .rbs-head, .rbs-bar, .rbs-print, .rbs-cta, .rbs-more, .rbs-filter { display: none !important; }
  .rbs, .rbs-sheet { background: #fff !important; box-shadow: none !important; border: 0 !important; }
  .rbs-grid { display: block; padding: 0; }
  .rbs-text { font-size: 18pt; }
}

/* ---- the framed reading sheet (round 20; round 23: the library of ten frames) ------------------------
   The same frame as the print edition (data-frame on .rbs-sheet, lib/segulot-topics.js frameOf): an ornamental band on
   top and at the bottom and, on wider screens, the frame's side borders repeated down the page, around a bright clean
   centre. Bands, paddings and paper colour are cut and measured on each frame by agent-vm/dossier/frame-slices.py:
   the text starts below the top corner ornaments, and on a computer the institutions' stamp closes the sheet between
   the bottom corner ornaments, like the print edition. Light and parchment modes only — the dark mode keeps its plain
   dark sheet. Prayer-book setting: justified, the last line centred, opening words in bold, notes and directions in
   a quieter sepia; kavana lines centred in the book face. */
.rbs-sheet[data-frame] { --fr-title: #7e022b; --fr-sepia: #7d5a2c; --fr-line: #c3a161; --fr-bg: #fcf7eb; }
.rbs-sheet[data-frame="leather-gold"] { --fr-title: #6b2a10; --fr-sepia: #7f5a2c; --fr-line: #c3a161; --fr-bg: #faedd4; }
.rbs-sheet[data-frame="leather-gold-b"] { --fr-title: #6b2a10; --fr-sepia: #7f5a2c; --fr-line: #c3a161; --fr-bg: #f9ecd7; }
.rbs-sheet[data-frame="tchelet-silver"] { --fr-title: #1b3770; --fr-sepia: #7a5a2e; --fr-line: #b99a56; --fr-bg: #f0f7fc; }
.rbs-sheet[data-frame="tchelet-silver-b"] { --fr-title: #1b3770; --fr-sepia: #7a5a2e; --fr-line: #b99a56; --fr-bg: #f2f7fc; }
.rbs-sheet[data-frame="parchment-gold"] { --fr-title: #7e022b; --fr-sepia: #7d5a2c; --fr-line: #c3a161; --fr-bg: #fbf1e1; }
.rbs-sheet[data-frame="parchment-gold-b"] { --fr-title: #7e022b; --fr-sepia: #7d5a2c; --fr-line: #c3a161; --fr-bg: #fcf9f0; }
.rbs-sheet[data-frame="burgundy-gold"] { --fr-title: #7e022b; --fr-sepia: #7d5a2c; --fr-line: #c3a161; --fr-bg: #fcf8ef; }
.rbs-sheet[data-frame="burgundy-gold-b"] { --fr-title: #7e022b; --fr-sepia: #7d5a2c; --fr-line: #c3a161; --fr-bg: #fafbf5; }
.rbs-sheet[data-frame="royal-blue-gold"] { --fr-title: #1b3770; --fr-sepia: #6d5230; --fr-line: #b99a56; --fr-bg: #fcfcf2; }
.rbs-sheet[data-frame="royal-blue-gold-b"] { --fr-title: #1b3770; --fr-sepia: #6d5230; --fr-line: #b99a56; --fr-bg: #fafaf5; }
.rbs[data-theme="dark"] .rbs-sheet[data-frame] { --fr-title: var(--rbs-gold-2); --fr-sepia: var(--rd-instr-ink); --fr-line: #4a3c26; }

.rbs:not([data-theme="dark"]) .rbs-sheet[data-frame] {
  --fr-top: url('/v2/segulot/parchment-gold-top.jpg'); --fr-bot: url('/v2/segulot/parchment-gold-bottom.jpg'); --fr-mid: url('/v2/segulot/parchment-gold-mid.jpg');
  --fr-pad-top: calc(33.3% + 14px); --fr-pad-bot: calc(33.5% + 12px);
  background: var(--fr-top) top center / 100% auto no-repeat, var(--fr-bot) bottom center / 100% auto no-repeat, var(--fr-bg);
  border: 0; border-radius: 6px; overflow: hidden;
  padding: var(--fr-pad-top) 9% var(--fr-pad-bot);
  box-shadow: 0 26px 54px -36px rgba(40, 20, 5, .55);
}
.rbs:not([data-theme="dark"]) .rbs-sheet[data-frame="leather-gold"] {
  --fr-top: url('/v2/segulot/leather-gold-top.jpg'); --fr-bot: url('/v2/segulot/leather-gold-bottom.jpg'); --fr-mid: url('/v2/segulot/leather-gold-mid.jpg');
  --fr-pad-top: calc(38.2% + 14px); --fr-pad-bot: calc(39.3% + 12px); --fr-pad-x: 15.0%; --fr-pad-bot-d: calc(25.3% + 8px);
}
.rbs:not([data-theme="dark"]) .rbs-sheet[data-frame="leather-gold-b"] {
  --fr-top: url('/v2/segulot/leather-gold-b-top.jpg'); --fr-bot: url('/v2/segulot/leather-gold-b-bottom.jpg'); --fr-mid: url('/v2/segulot/leather-gold-b-mid.jpg');
  --fr-pad-top: calc(22.2% + 14px); --fr-pad-bot: calc(23.3% + 12px); --fr-pad-x: 13.4%; --fr-pad-bot-d: calc(14.6% + 8px);
}
.rbs:not([data-theme="dark"]) .rbs-sheet[data-frame="tchelet-silver"] {
  --fr-top: url('/v2/segulot/tchelet-silver-top.jpg'); --fr-bot: url('/v2/segulot/tchelet-silver-bottom.jpg'); --fr-mid: url('/v2/segulot/tchelet-silver-mid.jpg');
  --fr-pad-top: calc(18.9% + 14px); --fr-pad-bot: calc(18.5% + 12px); --fr-pad-x: 11.0%; --fr-pad-bot-d: calc(11.2% + 8px);
}
.rbs:not([data-theme="dark"]) .rbs-sheet[data-frame="tchelet-silver-b"] {
  --fr-top: url('/v2/segulot/tchelet-silver-b-top.jpg'); --fr-bot: url('/v2/segulot/tchelet-silver-b-bottom.jpg'); --fr-mid: url('/v2/segulot/tchelet-silver-b-mid.jpg');
  --fr-pad-top: calc(21.2% + 14px); --fr-pad-bot: calc(21.4% + 12px); --fr-pad-x: 11.0%; --fr-pad-bot-d: calc(11.2% + 8px);
}
.rbs:not([data-theme="dark"]) .rbs-sheet[data-frame="parchment-gold"] {
  --fr-top: url('/v2/segulot/parchment-gold-top.jpg'); --fr-bot: url('/v2/segulot/parchment-gold-bottom.jpg'); --fr-mid: url('/v2/segulot/parchment-gold-mid.jpg');
  --fr-pad-top: calc(33.3% + 14px); --fr-pad-bot: calc(33.5% + 12px); --fr-pad-x: 14.1%; --fr-pad-bot-d: calc(26.7% + 8px);
}
.rbs:not([data-theme="dark"]) .rbs-sheet[data-frame="parchment-gold-b"] {
  --fr-top: url('/v2/segulot/parchment-gold-b-top.jpg'); --fr-bot: url('/v2/segulot/parchment-gold-b-bottom.jpg'); --fr-mid: url('/v2/segulot/parchment-gold-b-mid.jpg');
  --fr-pad-top: calc(29.5% + 14px); --fr-pad-bot: calc(29.6% + 12px); --fr-pad-x: 11.0%; --fr-pad-bot-d: calc(23.3% + 8px);
}
.rbs:not([data-theme="dark"]) .rbs-sheet[data-frame="burgundy-gold"] {
  --fr-top: url('/v2/segulot/burgundy-gold-top.jpg'); --fr-bot: url('/v2/segulot/burgundy-gold-bottom.jpg'); --fr-mid: url('/v2/segulot/burgundy-gold-mid.jpg');
  --fr-pad-top: calc(17.9% + 14px); --fr-pad-bot: calc(18.5% + 12px); --fr-pad-x: 11.6%; --fr-pad-bot-d: calc(11.7% + 8px);
}
.rbs:not([data-theme="dark"]) .rbs-sheet[data-frame="burgundy-gold-b"] {
  --fr-top: url('/v2/segulot/burgundy-gold-b-top.jpg'); --fr-bot: url('/v2/segulot/burgundy-gold-b-bottom.jpg'); --fr-mid: url('/v2/segulot/burgundy-gold-b-mid.jpg');
  --fr-pad-top: calc(30.0% + 14px); --fr-pad-bot: calc(30.1% + 12px); --fr-pad-x: 12.3%; --fr-pad-bot-d: calc(16.6% + 8px);
}
.rbs:not([data-theme="dark"]) .rbs-sheet[data-frame="royal-blue-gold"] {
  --fr-top: url('/v2/segulot/royal-blue-gold-top.jpg'); --fr-bot: url('/v2/segulot/royal-blue-gold-bottom.jpg'); --fr-mid: url('/v2/segulot/royal-blue-gold-mid.jpg');
  --fr-pad-top: calc(30.0% + 14px); --fr-pad-bot: calc(30.1% + 12px); --fr-pad-x: 14.5%; --fr-pad-bot-d: calc(21.9% + 8px);
}
.rbs:not([data-theme="dark"]) .rbs-sheet[data-frame="royal-blue-gold-b"] {
  --fr-top: url('/v2/segulot/royal-blue-gold-b-top.jpg'); --fr-bot: url('/v2/segulot/royal-blue-gold-b-bottom.jpg'); --fr-mid: url('/v2/segulot/royal-blue-gold-b-mid.jpg');
  --fr-pad-top: calc(30.5% + 14px); --fr-pad-bot: calc(30.1% + 12px); --fr-pad-x: 12.5%; --fr-pad-bot-d: calc(25.3% + 8px);
}
.rbs:not([data-theme="dark"]) .rbs-sheet[data-frame]::before { display: none; }
@media (min-width: 641px) {
  .rbs:not([data-theme="dark"]) .rbs-sheet[data-frame] {
    background: var(--fr-top) top center / 100% auto no-repeat, var(--fr-bot) bottom center / 100% auto no-repeat,
                var(--fr-mid) top center / 100% auto repeat-y, var(--fr-bg);
    padding: var(--fr-pad-top) var(--fr-pad-x, 11%) var(--fr-pad-bot-d, var(--fr-pad-bot));
  }
}
@media (max-width: 640px) {
  /* phones: the bands only, with a thin gilded edge instead of the side borders */
  .rbs:not([data-theme="dark"]) .rbs-sheet[data-frame] {
    padding: var(--fr-pad-top) 18px var(--fr-pad-bot);
    box-shadow: inset 0 0 0 1px var(--fr-line), inset 0 0 0 5px var(--fr-bg), inset 0 0 0 6px var(--fr-line), 0 20px 40px -30px rgba(40, 20, 5, .5);
  }
  .rbs .rbs-wrap.rbs-grid { padding-inline: 8px; }
}
.rbs-sheet[data-frame] .rbs-howto { background: color-mix(in srgb, var(--rd-instr-bg) 78%, transparent); }
/* the closing card stands below the framed sheet (round 23), so the sheet ends with the stamp, like the print edition */
.rbs-read > .rbs-cta { margin-top: 26px; }
/* kavana: names and unifications to meditate on, between the lines of a prayer */
.rbs .rbs-text .rbs-kav,
body.rb-body .rbs .rbs-text .rbs-kav {
  font-family: var(--rb-book-font); font-size: calc(.92em * var(--rb-book-scale, 1)); line-height: 1.9; font-weight: 400;
  text-align: center; color: var(--fr-title, var(--rbs-bord)); word-spacing: .6em; margin: 0 0 .9em; white-space: pre-line;
}

/* prayer-book setting */
.rbs .rbs-sheet[data-frame] .rbs-text .rbs-sacred,
body.rb-body .rbs .rbs-sheet[data-frame] .rbs-text .rbs-sacred {
  text-align: justify; text-align-last: center; line-height: 2; margin-bottom: .9em;
}
@media (max-width: 640px) {
  /* a narrow column at reading size: justifying opens wide gaps between words, so phones keep a ragged edge */
  .rbs .rbs-sheet[data-frame] .rbs-text .rbs-sacred,
  body.rb-body .rbs .rbs-sheet[data-frame] .rbs-text .rbs-sacred { text-align: start; text-align-last: auto; }
}
.rbs-sheet[data-frame] .rbs-sacred .open { font-weight: 700; font-size: 1.12em; }
.rbs-sheet[data-frame] .rbs-sacred .open.first { font-size: 1.32em; color: var(--fr-title); }
.rbs-sheet[data-frame] .rbs-sacred .note { font-size: .72em; color: var(--fr-sepia); }
body.rb-body .rbs .rbs-sheet[data-frame] .rbs-dir {
  display: flex; align-items: center; gap: 14px; margin: .4em 0 .6em; font-size: max(17px, .66em); color: var(--fr-sepia);
}
.rbs-sheet[data-frame] .rbs-dir i { flex: 1 1 auto; border-top: 1px solid var(--fr-line); }
.rbs .rbs-sheet[data-frame] .rbs-text .rbs-instr,
body.rb-body .rbs .rbs-sheet[data-frame] .rbs-text .rbs-instr {
  background: none; border: 0; padding: 0 .4em; text-align: center; color: var(--fr-sepia);
}
.rbs-stamp { margin: 34px auto 0; text-align: center; color: var(--fr-sepia, var(--rd-mut)); font-size: 16px; line-height: 1.55; }
.rbs-stamp::before { content: ''; display: block; width: 160px; margin: 0 auto 12px; border-top: 1px solid var(--fr-line, var(--rd-line)); }
.rbs-stamp b { display: block; font-size: 18px; color: var(--fr-title, var(--rbs-bord)); font-weight: 600; }
.rbs-stamp span { display: block; }
.rbs-head .rbs-bsd { display: block; font-size: 14px; color: var(--rbs-gold-2); opacity: .85; margin-bottom: 4px; }
.rbs-head .rbs-attr { margin: 8px 0 0; font-size: 16px; color: var(--rbs-gold-2); opacity: .92; }
@media print {
  .rbs-sheet[data-frame] { padding: 0 !important; }
  .rbs-stamp { color: #555; }
}

/* round 24: the default view shows the first six prayers of each topic; one quiet button leads to the rest of the topic */
.rbs-showall-wrap { margin: 18px 0 4px; text-align: center; }
.rbs .rbs-showall {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  font-family: 'almoni-tzar', sans-serif; font-size: 19px; font-weight: 600; color: var(--rbs-bord, #7e022b);
  background: #fff; border: 1px solid var(--rbs-gold, #c3a161); border-radius: 999px; padding: 10px 22px;
  box-shadow: 0 6px 16px -12px rgba(40, 20, 5, .45); transition: transform .16s, background .16s;
}
.rbs .rbs-showall:hover { transform: translateY(-2px); background: #fdf7ea; }
.rbs .rbs-showall svg { width: 18px; height: 18px; }
.rbs[data-theme="dark"] .rbs-showall { background: transparent; color: var(--rbs-gold-2); }

/* round 27: every prayer its own background from the library (lib-<nnn>). The sheet carries its frame's values as
   --lf-* (segulot-routes.js frameStyle, from segulot-frames.json); these two rules hand them to the frame variables.
   After the per-frame rules above, with the same weight, so they win; the dark theme keeps its own colours. */
.rbs-sheet[data-frame^="lib-"] { --fr-title: var(--lf-title); --fr-sepia: var(--lf-sepia); --fr-line: var(--lf-line); --fr-bg: var(--lf-bg); }
.rbs:not([data-theme="dark"]) .rbs-sheet[data-frame^="lib-"] {
  --fr-top: var(--lf-top); --fr-bot: var(--lf-bot); --fr-mid: var(--lf-mid);
  --fr-pad-top: var(--lf-pad-top); --fr-pad-bot: var(--lf-pad-bot); --fr-pad-x: var(--lf-pad-x); --fr-pad-bot-d: var(--lf-pad-bot-d);
}
