/* =========================================================
   دراسة كتابية — styles for study.html
   Built on style.css (tokens, fonts, .btn, .card, .eyebrow, .container).
   No external fonts or images. One design for every book and every lesson.
   ========================================================= */

/* Author rules like .hint { display: block } would otherwise beat the browser's [hidden] rule. */
[hidden] { display: none !important; }

.study-nav { display: flex; align-items: center; gap: 0.9rem; list-style: none; font-weight: 500; font-size: 0.85rem; }
.study-nav a, .study-nav-home { padding: 0.4rem 0.2rem; transition: color 0.2s; white-space: nowrap; }
.site-header .wordmark { font-size: 1.45rem; }
@media (min-width: 640px) {
  .study-nav { gap: 1.2rem; font-size: 0.95rem; }
  .site-header .wordmark { font-size: 1.75rem; }
}
.study-nav a:hover, .study-nav-home:hover { color: var(--red); }
.study-nav-home { background: none; border: none; font: inherit; color: inherit; cursor: pointer; font-weight: 700; }

main#app { min-height: 70vh; outline: none; padding-bottom: 3rem; }

.muted { color: var(--ink); opacity: 0.75; font-size: 0.95rem; }
.lede { color: var(--ink); font-size: 1.125rem; max-width: 560px; margin: 0.4rem auto 0.8rem; }
.page-title { font-size: clamp(1.6rem, 5vw, 2.3rem); font-weight: 900; line-height: 1.35; }
.btn-sm { padding: 0.55rem 1.2rem; font-size: 0.95rem; min-height: 44px; }
.btn:disabled { opacity: 0.55; cursor: progress; transform: none; }

/* ---- breadcrumbs ---- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.15rem; padding-block: 1rem 0.2rem; font-size: 0.9rem; }
.crumb { background: none; border: none; font: inherit; color: var(--ink); cursor: pointer; padding: 0.35rem 0.35rem; border-radius: 8px; min-height: 36px; }
.crumb:hover { color: var(--red); }
.crumb-current { color: var(--charcoal); font-weight: 600; cursor: default; }
.crumb-sep { color: var(--gold); }

/* ---- home hero ---- */
.study-hero { position: relative; min-height: 46svh; display: flex; align-items: flex-end; overflow: hidden; background: var(--charcoal); }
.study-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.study-hero-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(24, 20, 16, 0.86) 0%, rgba(24, 20, 16, 0.5) 38%, rgba(24, 20, 16, 0.08) 75%); }
.study-hero-content { position: relative; color: #fff; text-align: center; padding-block: 3.2rem 2.6rem; }
.study-hero-icon { display: block; font-size: 2.2rem; margin-bottom: 0.3rem; }
.study-hero-content h1 { font-size: clamp(2rem, 8vw, 3.4rem); font-weight: 900; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.5); }
.study-hero-content p { max-width: 520px; margin: 0.4rem auto 0; font-size: clamp(1.02rem, 3.4vw, 1.2rem); color: rgba(255, 255, 255, 0.93); text-shadow: 0 1px 14px rgba(24, 20, 16, 0.8); }

/* ---- track cards ---- */
.track-grid { display: grid; gap: 1.4rem; }
.track-card { overflow: hidden; display: flex; flex-direction: column; }
.track-img { aspect-ratio: 4 / 3; overflow: hidden; }
.track-img img { width: 100%; height: 100%; object-fit: cover; }
.track-body { padding: 1.4rem 1.4rem 1.7rem; display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
.track-body p { color: var(--ink); margin-bottom: 0.6rem; }

/* ---- the 66 books ---- */
.testament { margin-top: 2.8rem; }
.testament-title { font-size: clamp(1.5rem, 5vw, 2.1rem); font-weight: 900; padding-bottom: 0.5rem; border-bottom: 2px solid var(--gold); margin-bottom: 1.4rem; }
.testament-count { font-family: var(--font-body); font-weight: 400; font-size: 1rem; color: var(--ink); }
.category { margin-bottom: 2.2rem; }
.category-title { font-size: 1.15rem; color: var(--wood); margin-bottom: 0.9rem; }
.book-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.book-card { padding: 1.3rem 1.2rem 1.4rem; display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem; }
.book-icon { font-size: 1.8rem; line-height: 1; }
.book-icon-lg { font-size: 2.6rem; display: block; margin-bottom: 0.4rem; }
/* Book symbols (study/data/book-icons.js): the home page's red icon, .gospel-icon in style.css. */
.book-symbol { width: 62px; height: 62px; display: grid; place-items: center; flex: none; color: var(--red); background: rgba(168, 32, 42, 0.07); border-radius: 50%; margin-bottom: 0.3rem; }
.book-symbol svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.book-symbol-lg { width: 84px; height: 84px; margin: 0 auto 0.9rem; }
.book-symbol-lg svg { width: 38px; height: 38px; stroke-width: 1.3; }
.book-no { font-size: 0.78rem; color: var(--ink); opacity: 0.7; margin-top: 0.4rem; }
.book-name { font-family: var(--font-head); font-size: 1.25rem; font-weight: 700; }
.book-desc { color: var(--ink); font-size: 0.93rem; line-height: 1.7; margin: 0.2rem 0 0.4rem; flex: 1; }
.book-count { font-size: 0.88rem; font-weight: 600; color: var(--red); margin-bottom: 0.6rem; }
.book-head { text-align: center; padding-block: 1.4rem 1.6rem; }
.book-head .book-count { margin-top: 0.4rem; }

/* ---- lesson list ---- */
.lesson-list { list-style: none; display: grid; gap: 0.7rem; margin-top: 1.6rem; }
.lesson-row { width: 100%; display: flex; align-items: center; gap: 0.9rem; text-align: start; padding: 0.9rem 1rem; background: var(--warmwhite); border: 1px solid rgba(38, 34, 30, 0.08); border-radius: 14px; cursor: pointer; font: inherit; color: inherit; transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s; min-height: 64px; }
.lesson-row:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: rgba(168, 32, 42, 0.3); }
.lesson-row:not(.is-ready) .lesson-title { color: var(--ink); }
.lesson-no { flex-shrink: 0; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: rgba(168, 32, 42, 0.08); color: var(--red); font-family: var(--font-head); font-weight: 700; }
.lesson-row.is-ready .lesson-no { background: var(--red); color: #fff; }
.lesson-info { flex: 1; display: flex; flex-direction: column; gap: 0.1rem; }
.lesson-title { font-family: var(--font-head); font-weight: 600; font-size: 1.04rem; line-height: 1.5; }
.lesson-ref { font-size: 0.85rem; color: var(--wood); }
.lesson-chip { font-size: 1.1rem; }

/* ---- a lesson ---- */
.lesson { padding-bottom: 1.5rem; }
.lesson-banner { margin: 0.8rem 0 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.lesson-banner img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.lesson-head { text-align: center; padding-block: 1.4rem 1rem; }
.lesson-kicker { font-size: 0.88rem; color: var(--wood); font-weight: 600; }
.lesson-head .lesson-ref { font-size: 1rem; margin-top: 0.3rem; }
.part { margin-top: 2rem; }
.part h2 { font-size: 1.3rem; color: var(--charcoal); padding-inline-start: 0.8rem; border-inline-start: 4px solid var(--gold); margin-bottom: 0.8rem; }
.item { margin-bottom: 0.8rem; color: var(--ink); }
.note-badge { display: inline-block; margin-inline-end: 0.5rem; padding: 0.05rem 0.7rem; font-size: 0.8rem; font-weight: 700; color: var(--wood); background: rgba(192, 148, 84, 0.18); border-radius: 999px; }
.part-key { background: var(--warmwhite); border: 1px solid rgba(192, 148, 84, 0.45); border-radius: var(--radius); padding: 1.1rem 1.3rem 1.3rem; }
.main-idea { font-size: 1.15rem; font-weight: 500; color: var(--charcoal); }
.bullets { padding-inline-start: 1.3rem; display: grid; gap: 0.6rem; color: var(--ink); }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { padding: 0.3rem 0.9rem; border-radius: 999px; background: var(--tint); color: var(--charcoal); font-size: 0.93rem; border: 1px solid rgba(38, 34, 30, 0.08); }
.questions { padding-inline-start: 1.5rem; display: grid; gap: 0.8rem; color: var(--ink); }
.questions li::marker { color: var(--red); font-weight: 700; }

.passages { display: grid; gap: 1rem; }
.passage { background: var(--warmwhite); border: 1px solid rgba(38, 34, 30, 0.07); border-radius: var(--radius); padding: 1.1rem 1.3rem; }
.passage-ref { font-size: 1rem; color: var(--red); margin-bottom: 0.4rem; }
.passage-text { font-size: 1.12rem; line-height: 2.1; color: var(--charcoal); }
.vn { font-size: 0.7rem; color: var(--wood); font-weight: 700; margin-inline-end: 0.2rem; vertical-align: super; }
.credit { font-size: 0.8rem; color: var(--ink); opacity: 0.7; }

.audio-card { background: var(--warmwhite); border: 1px solid rgba(38, 34, 30, 0.07); border-radius: var(--radius); padding: 0.9rem 1.1rem; margin-top: 1.4rem; display: grid; gap: 0.5rem; }
.audio-label { font-family: var(--font-head); font-weight: 700; }
.audio-card audio { width: 100%; }

.empty-frame { margin-top: 1.6rem; padding: 1.4rem 1.3rem; border: 2px dashed rgba(38, 34, 30, 0.2); border-radius: var(--radius); background: rgba(255, 253, 249, 0.6); }
.empty-title { font-family: var(--font-head); font-weight: 700; margin-bottom: 0.4rem; }
.empty-list { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.7rem; }
.empty-list li { padding: 0.25rem 0.8rem; border-radius: 999px; border: 1px dashed rgba(38, 34, 30, 0.25); color: var(--ink); font-size: 0.9rem; }

.lesson-nav { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; margin-top: 2.6rem; padding-top: 1.4rem; border-top: 1px solid rgba(38, 34, 30, 0.1); flex-wrap: wrap; }
.nav-none { color: var(--ink); opacity: 0.55; font-size: 0.9rem; }

/* ---- seeker: tabs and sets ---- */
.tabs { display: flex; justify-content: center; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.tab { padding: 0.6rem 1.4rem; border-radius: 999px; border: 2px solid transparent; background: var(--tint); font: inherit; font-family: var(--font-head); font-weight: 700; cursor: pointer; color: var(--charcoal); min-height: 46px; }
.tab.is-active { background: var(--charcoal); color: var(--warmwhite); }
.tab:not(.is-active):hover { border-color: var(--gold); }
.tab-desc { text-align: center; color: var(--ink); margin-bottom: 1.8rem; }
.set-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.set-card { padding: 1.3rem 1.2rem 1.4rem; display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem; }
.set-icon { font-size: 1.8rem; line-height: 1; }
.set-sub { font-size: 0.82rem; color: var(--wood); font-weight: 700; margin-top: 0.3rem; }
.set-title { font-size: 1.12rem; line-height: 1.55; flex: 1; }

/* ---- mode toggle: individual / group ---- */
.mode-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; padding: 0.35rem; background: var(--tint); border-radius: 18px; margin-top: 0.4rem; }
.mode-btn { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; padding: 0.7rem 0.5rem; border: none; border-radius: 14px; background: transparent; font: inherit; cursor: pointer; color: var(--charcoal); min-height: 62px; }
.mode-btn.is-active { background: var(--warmwhite); box-shadow: var(--shadow); outline: 2px solid var(--red); }
.mode-label { font-family: var(--font-head); font-weight: 700; font-size: 1.02rem; }
.mode-hint { font-size: 0.75rem; color: var(--ink); line-height: 1.4; }

/* ---- group mode (laid out like Waha's lesson page) ---- */
.waha-page { background: var(--tint); }
.waha-page .crumbs { background: var(--warmwhite); max-width: none; }
.waha { margin-top: 0.4rem; }
.waha-section { margin-top: 1.8rem; }
.waha-h { text-align: center; color: var(--red); font-size: 1.5rem; font-weight: 900; margin-bottom: 0.4rem; }
.waha-list { list-style: none; }
.waha-item { padding: 0.9rem 0.2rem 1.2rem; border-bottom: 1px solid rgba(38, 34, 30, 0.12); }
.waha-item:last-child { border-bottom: none; }
.waha-item-top { display: flex; justify-content: space-between; align-items: center; min-height: 40px; }
.waha-no { color: var(--red); font-weight: 800; font-family: var(--font-head); font-size: 1rem; }
.play-here { width: 44px; height: 44px; border-radius: 50%; border: none; background: transparent; color: var(--red); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.play-here:hover { background: rgba(168, 32, 42, 0.1); }
.waha-q { font-size: 1.08rem; font-weight: 500; color: var(--charcoal); margin-top: 0.2rem; }
.waha-item .passages { margin-top: 1rem; }
.waha-foot { text-align: center; color: var(--ink); font-size: 0.88rem; margin-top: 1.6rem; opacity: 0.8; }

/* ---- bottom player ---- */
.player { position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 90; background: var(--warmwhite); border-top: 1px solid rgba(38, 34, 30, 0.12); box-shadow: 0 -8px 24px rgba(38, 34, 30, 0.12); padding: 0.6rem 1.2rem calc(0.7rem + env(safe-area-inset-bottom, 0px)); }
.pl-label { text-align: center; font-size: 0.82rem; color: var(--wood); font-weight: 700; }
.pl-label:empty { display: none; }
.pl-status { text-align: center; color: var(--red); font-size: 0.85rem; font-weight: 600; }
.pl-line { display: flex; align-items: center; gap: 0.7rem; direction: ltr; max-width: 560px; margin: 0.1rem auto; }
.pl-time { font-size: 0.78rem; color: var(--ink); min-width: 2.4rem; text-align: center; font-variant-numeric: tabular-nums; }
.pl-range { flex: 1; accent-color: var(--red); }
.pl-controls { direction: ltr; display: flex; justify-content: center; align-items: center; gap: 1.6rem; }
.pl-play { width: 56px; height: 56px; border-radius: 50%; border: none; background: var(--red); color: #fff; font-size: 1.5rem; cursor: pointer; box-shadow: 0 8px 20px rgba(168, 32, 42, 0.28); padding-inline-start: 3px; }
.pl-play:hover { background: var(--red-dark); }
.pl-skip { width: 48px; height: 48px; border-radius: 50%; border: none; background: transparent; color: var(--charcoal); font-size: 1.9rem; cursor: pointer; }
.pl-skip:hover { color: var(--red); }
body.has-player main#app { padding-bottom: 10rem; }
body.has-player .quick-exit { inset-block-end: 10rem; }

/* ---- individual mode ---- */
.callout { margin-top: 1.4rem; background: rgba(192, 148, 84, 0.14); border: 1px solid rgba(192, 148, 84, 0.4); border-radius: var(--radius); padding: 1rem 1.2rem; color: var(--charcoal); }
.qcard { background: var(--warmwhite); border: 1px solid rgba(38, 34, 30, 0.08); border-radius: var(--radius); padding: 1.2rem 1.2rem 1.3rem; margin-bottom: 1.2rem; box-shadow: var(--shadow); }
.qcard-head { display: flex; gap: 0.8rem; align-items: flex-start; margin-bottom: 0.8rem; }
.qcard-q { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; line-height: 1.6; }
.answer { width: 100%; font-family: var(--font-body); font-size: 1rem; padding: 0.85rem 1rem; border-radius: 12px; border: 1.5px solid rgba(38, 34, 30, 0.18); background: var(--offwhite); color: var(--charcoal); resize: vertical; }
.answer:focus { outline: none; border-color: var(--red); }
.qcard-actions { margin-top: 0.8rem; }
.qcard .hint { margin-top: 0.6rem; }
.reply-area { margin-top: 0.8rem; }
.reply { border-radius: 14px; padding: 1rem 1.1rem 1.1rem; background: var(--tint); border-inline-start: 5px solid var(--ink); }
.reply[data-verdict='fits'] { border-inline-start-color: var(--gold); }
.reply[data-verdict='outside'] { border-inline-start-color: var(--wood); }
.reply-badge { display: inline-block; font-size: 0.82rem; font-weight: 700; color: var(--charcoal); background: var(--warmwhite); border: 1px solid rgba(38, 34, 30, 0.15); border-radius: 999px; padding: 0.1rem 0.8rem; margin-bottom: 0.6rem; }
.reply-text { margin-bottom: 0.6rem; }
.reply-more { margin-top: 0.8rem; padding-top: 0.8rem; border-top: 1px dashed rgba(38, 34, 30, 0.2); }
.share-card { margin-top: 2.4rem; padding: 1.6rem 1.4rem; text-align: center; }
.share-card:hover { transform: none; }
.share-card p { color: var(--ink); margin: 0.5rem 0 1.2rem; }
.share-actions { display: flex; flex-direction: column; gap: 0.7rem; align-items: center; }
.wa-wrap { display: grid; gap: 0.4rem; justify-items: center; }

/* ---- footer ---- */
.site-footer { margin-top: 2rem; padding-top: 0; }

@media (min-width: 640px) {
  .track-grid { grid-template-columns: 1fr 1fr; }
  .book-grid, .set-grid { grid-template-columns: repeat(2, 1fr); }
  .share-actions { flex-direction: row; justify-content: center; }
}
@media (min-width: 960px) {
  .book-grid, .set-grid { grid-template-columns: repeat(3, 1fr); }
  .study-hero { min-height: 52svh; }
}
@media (prefers-reduced-motion: reduce) {
  .lesson-row, .card { transition: none; }
}

/* ---- the seeker course, one at a time ---- */
.onebyone { display: grid; gap: 0.9rem; justify-items: center; }
.step-count { font-size: 0.9rem; color: var(--wood); font-weight: 700; }
.onebyone .set-card-focus { width: min(100%, 520px); align-items: center; text-align: center; padding: 1.8rem 1.4rem 1.6rem; }
.onebyone .set-card-focus:hover { transform: none; }
.onebyone .set-card-focus .set-icon { font-size: 2.6rem; }
.onebyone .set-card-focus .set-title { flex: 0 1 auto; font-size: 1.3rem; }
.onebyone .lesson-list { width: min(100%, 520px); margin-top: 0; }
.step-nav { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; width: min(100%, 520px); }
.see-all { text-align: center; margin-top: 0.3rem; }
.btn-link { background: none; border: none; font: inherit; font-family: var(--font-head); font-weight: 700; color: var(--red); text-decoration: underline; text-underline-offset: 0.25em; cursor: pointer; padding: 0.5rem 0.8rem; min-height: 44px; }
.btn-link:hover { color: var(--red-dark); }
