/* Torah Skills Booklets page (booklets.html).
   Sits on top of assets/css/style.css, so the header, colours, buttons and
   preview window are the site's own. This file only adds right-to-left
   Yiddish type and the booklet cards. */

@font-face { font-family: 'Frank Ruhl'; src: url('../fonts/frank-ruhl-400.woff2') format('woff2');
  font-weight: 400; font-display: swap; }
@font-face { font-family: 'Frank Ruhl'; src: url('../fonts/frank-ruhl-700.woff2') format('woff2');
  font-weight: 700; font-display: swap; }

[data-topic="booklets"] { --accent: #003877; --accent-deep: #002450; --accent-wash: #e6eefa; }

html[dir="rtl"] body { font-family: 'Public Sans', 'Arial Hebrew', 'Noto Sans Hebrew', Arial, system-ui, sans-serif; }

/* the header stays exactly as on every other page */
.masthead { direction: ltr; }

.topicbar h1, .section-head, .bk__title, .bk__pasuk, .bk-bsd {
  font-family: 'Frank Ruhl', 'Times New Roman', serif; letter-spacing: 0;
}
.topicbar h1 { font-size: clamp(2rem, 5vw, 2.9rem); line-height: 1.15; }
.topicbar::before { background: linear-gradient(90deg, var(--navy) 0 70%, var(--gold) 70% 100%); }
.bk-bsd { position: absolute; top: .9rem; left: 1.4rem; margin: 0; font-size: .95rem;
  font-weight: 700; color: var(--navy); }
.topicbar .wrap { position: relative; }
.topicbar .bk-bsd { position: absolute; top: 0; left: 0; color: var(--navy); }
.topicbar p.bk-en { margin-top: .5rem; font-size: .85rem; letter-spacing: .02em; text-align: right; }
.fact span { letter-spacing: 0; text-transform: none; font-size: .85rem; }

.section-head { font-size: 1.55rem; display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; }
.bk-group__en { font-family: var(--body); font-size: .72rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); }
.section-head { margin-top: 2.6rem; margin-bottom: .35rem; }

.bk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem;
  padding-bottom: 1rem; }

.bk { display: flex; gap: 1rem; background: var(--paper); border: 1px solid var(--line);
  border-radius: 14px; padding: 1rem; box-shadow: var(--shadow-sm); position: relative;
  overflow: hidden; transition: box-shadow .15s, border-color .15s; }
.bk::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--accent); }
.bk:hover { box-shadow: var(--shadow); border-color: #c9d6e6; }

.bk__thumb { flex: none; width: 104px; padding: 0; border: 1px solid var(--line); border-radius: 6px;
  background: #fff; cursor: zoom-in; overflow: hidden; align-self: flex-start;
  box-shadow: 0 2px 6px rgba(13,27,42,.08); }
.bk__thumb img { display: block; width: 100%; height: auto; }

.bk__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bk__pasuk { margin: .1rem 0 .15rem; font-size: .95rem; color: var(--gold-deep); font-weight: 700; }
.bk__title { margin: 0 0 .3rem; font-size: 1.12rem; line-height: 1.3; color: var(--navy); font-weight: 700; }
.bk__en { margin: 0; font-size: .78rem; color: var(--muted); text-align: right; }
.bk__meta { margin: .15rem 0 .7rem; font-size: .82rem; color: var(--muted); }
.bk__acts { margin-top: auto; display: flex; gap: .45rem; }
.bk__acts .act { flex: 1; justify-content: center; font-size: .9rem; padding: .55rem .6rem; min-height: 40px; }
.bk__acts .act[aria-busy="true"] { opacity: .6; cursor: progress; }

/* The preview window from preview.js is in English; keep it left to right. */
#viewer { direction: ltr; }
#viewer .viewer__title, #viewer .viewer__sub { direction: rtl; unicode-bidi: plaintext; }

@media (max-width: 34rem) {
  .bk { padding: .85rem; gap: .8rem; }
  .bk__thumb { width: 88px; }
  .bk__title { font-size: 1.05rem; }
}
@media print { .bk__acts, .masthead { display: none; } }
