/* ==========================================================================
   lesson.css — Fetih Suresi ezber atölyesi, paylaşılan stil.
   Her ders ve referans belgesi bunu bağlar. Satır içine stil yazma.

   TASARIM NOTU
   Bu bir doküman değil, günlük kullanılan bir alet. Birincil kullanım:
   telefon, sabah erken ya da gece. Bu yüzden mobil öncelikli (min-width ile
   büyütülür), dokunma hedefleri >= 44px, ve Arapça metin hiçbir kırılma
   noktasında küçülmez — sayfadaki asıl okunan şey o.

   Palet mushaf dünyasından: yeşile çalan kemik zemin, mürekkep, yakılmış
   altın (yalnızca ayet numarası / tesbih tanesi / aktif durum), yapı için
   zangar yeşili. Griler nötr değil, yeşile eğimli.
   ========================================================================== */

/* --- Tokenler: açık tema ------------------------------------------------- */
:root {
  --ground: #f6f4ec;
  --panel: #fffdf7;
  --ink: #161e1c;
  --muted: #5c6864;
  --rule: #ddd9cb;
  --rule-soft: #ebe8dc;
  --gold: #8a6a18;
  --gold-soft: #f2ead2;
  --verdigris: #3a6961;
  --verdigris-soft: #e6efec;
  --ok: #1f6b46;
  --ok-soft: #e4f0e8;
  --bad: #97281f;
  --bad-soft: #f7e8e6;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Charter",
    "Bitstream Charter", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  --arabic: "KFGQPC Uthmanic Script HAFS", "Amiri Quran", "Amiri",
    "Scheherazade New", "Geeza Pro", "Traditional Arabic",
    "Noto Naskh Arabic", "Droid Arabic Naskh", serif;

  --measure: 34rem;
  --pad: 1.15rem;
}

/* --- Tokenler: koyu tema ------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0f1615;
    --panel: #161f1d;
    --ink: #e7e5db;
    --muted: #8f9c97;
    --rule: #2b3634;
    --rule-soft: #202b29;
    --gold: #d8b25e;
    --gold-soft: #241f12;
    --verdigris: #69a49a;
    --verdigris-soft: #16211f;
    --ok: #62b585;
    --ok-soft: #14241b;
    --bad: #dd8b83;
    --bad-soft: #251815;
  }
}

/* İzleyicinin tema düğmesi kök elemana data-theme basar; her iki yönde de
   media query'yi geçmesi gerekir. */
:root[data-theme="dark"] {
  --ground: #0f1615;
  --panel: #161f1d;
  --ink: #e7e5db;
  --muted: #8f9c97;
  --rule: #2b3634;
  --rule-soft: #202b29;
  --gold: #d8b25e;
  --gold-soft: #241f12;
  --verdigris: #69a49a;
  --verdigris-soft: #16211f;
  --ok: #62b585;
  --ok-soft: #14241b;
  --bad: #dd8b83;
  --bad-soft: #251815;
}
:root[data-theme="light"] {
  --ground: #f6f4ec;
  --panel: #fffdf7;
  --ink: #161e1c;
  --muted: #5c6864;
  --rule: #ddd9cb;
  --rule-soft: #ebe8dc;
  --gold: #8a6a18;
  --gold-soft: #f2ead2;
  --verdigris: #3a6961;
  --verdigris-soft: #e6efec;
  --ok: #1f6b46;
  --ok-soft: #e4f0e8;
  --bad: #97281f;
  --bad-soft: #f7e8e6;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 1.9rem var(--pad) 4.5rem;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Okunan metin ölçüsü. Ayet kartları ve tablolar bundan taşabilir. */
p, ul, ol, blockquote, .callout, .quiz, .checklist, .recall, .tally, .lesson-footer {
  max-width: var(--measure);
}

/* --- Başlıklar ---------------------------------------------------------- */
h1, h2, h3 {
  font-weight: 400;
  line-height: 1.18;
  text-wrap: balance;
  letter-spacing: -0.012em;
}

h1 { font-size: 1.72rem; margin: 0 0 0.5rem; max-width: 26rem; }

h2 {
  font-size: 1.2rem;
  margin: 2.5rem 0 0.8rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--rule-soft);
  max-width: var(--measure);
}

h3 {
  font-size: 1.02rem;
  font-weight: 600;
  margin: 1.9rem 0 0.55rem;
  letter-spacing: 0;
}

/* --- Üst künye ---------------------------------------------------------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.85rem;
}

.subtitle {
  font-size: 1.08rem;
  color: var(--muted);
  line-height: 1.45;
  margin: 0 0 1.5rem;
  max-width: 30rem;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 0.6rem 0;
  margin: 0 0 2rem;
  max-width: var(--measure);
}

/* --- Metin -------------------------------------------------------------- */
p { margin: 0 0 1rem; }

a {
  color: var(--verdigris);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--verdigris) 38%, transparent);
}
a:hover { border-bottom-color: var(--verdigris); }
a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

strong { font-weight: 600; }
em.term { font-style: normal; font-weight: 600; border-bottom: 1px dotted var(--muted); }

ul, ol { margin: 0 0 1.1rem; padding-left: 1.25rem; }
li { margin-bottom: 0.45rem; }
ol li::marker { font-family: var(--mono); font-size: 0.85em; color: var(--gold); }

blockquote {
  margin: 1.4rem 0;
  padding-left: 1.1rem;
  border-left: 2px solid var(--rule);
  color: var(--muted);
  font-style: italic;
}
blockquote cite {
  display: block;
  margin-top: 0.45rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-style: normal;
  letter-spacing: 0.04em;
}

code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--verdigris-soft);
  padding: 0.1em 0.32em;
  border-radius: 3px;
}

pre {
  font-family: var(--mono);
  font-size: 0.74rem;
  line-height: 1.55;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.85rem 0.9rem;
  margin: 0 0 1.2rem;
  overflow-x: auto;
}
pre code { background: none; padding: 0; }

.filename {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.3rem;
}

/* --- Kenar notu (mobilde akış içinde, geniş ekranda kenarda) ------------ */
.sidenote {
  font-size: 0.83rem;
  line-height: 1.5;
  color: var(--muted);
  margin: 1.1rem 0;
  padding-left: 0.85rem;
  border-left: 2px solid var(--rule);
  max-width: var(--measure);
}
.sidenote strong { color: var(--ink); }

/* --- Uyarı kutusu ------------------------------------------------------- */
.callout {
  background: var(--gold-soft);
  border: 1px solid color-mix(in srgb, var(--gold) 28%, transparent);
  border-left: 3px solid var(--gold);
  border-radius: 0 5px 5px 0;
  padding: 0.9rem 1rem;
  margin: 1.5rem 0;
}
.callout > :last-child { margin-bottom: 0; }
.callout-label {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.4rem;
}

/* --- Tablolar ----------------------------------------------------------- */
.table-scroll {
  overflow-x: auto;
  margin: 0 0 1.4rem;
  padding-bottom: 0.2rem;
  -webkit-overflow-scrolling: touch;
}
table {
  border-collapse: collapse;
  font-size: 0.82rem;
  width: 100%;
  min-width: 25rem;
  font-variant-numeric: tabular-nums;
}
th, td {
  text-align: left;
  padding: 0.45rem 0.8rem 0.45rem 0;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
}
thead th {
  border-bottom: 1.5px solid var(--ink);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.64rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
tbody tr.is-target { background: var(--gold-soft); }
td.level-num, td.seg {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--gold);
  white-space: nowrap;
  padding-right: 0.9rem;
}
td.load { font-family: var(--mono); color: var(--muted); white-space: nowrap; }
.loadbar {
  display: inline-block;
  height: 6px;
  background: var(--gold);
  border-radius: 2px;
  vertical-align: middle;
  margin-left: 0.35rem;
  opacity: 0.75;
}

/* ==========================================================================
   AYET KARTI — sayfanın görsel çapası.
   Ön kenarında altın ray, üstünde ayet numarası, içinde büyük nesih metin.
   Bu blok asla UI parçası gibi görünmemeli.
   ========================================================================== */

.ayah {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--gold);
  border-radius: 0 5px 5px 0;
  padding: 0.85rem 0.9rem;
  margin: 0 0 0.9rem;
}

.ayah-no {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.8rem;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.6rem;
}
.ayah-no .len {
  color: var(--muted);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

/* Arapça: hiçbir kırılma noktasında küçülmez. */
.ar {
  direction: rtl;
  text-align: right;
  unicode-bidi: isolate;
  font-family: var(--arabic);
  font-size: 1.85rem;
  line-height: 2.05;
  color: var(--ink);
  margin: 0 0 0.75rem;
  overflow-wrap: break-word;
}
.ayah.sm .ar { font-size: 1.5rem; line-height: 1.95; }

/* Latin okunuş — destek, otorite değil. */
.tr {
  font-style: italic;
  font-size: 0.97rem;
  line-height: 1.7;
  margin: 0 0 0.6rem;
  max-width: none;
  overflow-wrap: break-word;
}
.tr .stop { color: var(--gold); font-style: normal; font-weight: 700; }

.meal {
  font-size: 0.87rem;
  line-height: 1.55;
  color: var(--muted);
  padding-left: 0.8rem;
  border-left: 2px solid var(--rule);
  margin: 0;
  max-width: none;
}

/* --- Ses oynatıcı (memorize.js) ----------------------------------------- */
.ayah-audio {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.8rem;
}

.ayah-audio button,
.ayah-audio select {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  min-height: 44px;
  border-radius: 4px;
  cursor: pointer;
}
.ayah-audio button {
  text-transform: uppercase;
  background: var(--ink);
  color: var(--ground);
  border: none;
  padding: 0.6rem 0.95rem;
}
.ayah-audio button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
  padding: 0.6rem 0.8rem;
}
.ayah-audio button:hover { opacity: 0.86; }
.ayah-audio button:focus-visible,
.ayah-audio select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.ayah-audio select {
  background: var(--ground);
  color: var(--ink);
  border: 1px solid var(--rule);
  padding: 0.55rem 0.45rem;
}
.ayah-audio .status {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  flex: 1 1 auto;
}
.ayah-audio .status.playing { color: var(--gold); font-weight: 600; }

/* --- Örtme alıştırması -------------------------------------------------- */
.occlude-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin: 1.4rem 0 0.7rem;
}
.occlude-bar .lbl {
  flex: 1 1 100%;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.15rem;
}
.occlude-bar button {
  flex: 1 1 auto;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.55rem 0.6rem;
  min-height: 44px;
  cursor: pointer;
}
.occlude-bar button:hover { border-color: var(--muted); }
.occlude-bar button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.occlude-bar button.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ground);
  font-weight: 600;
}

/* Kademeli örtme seviyeleri */
.occ-1 .tr, .occ-1 .meal { display: none; }

.occ-2 .tr, .occ-2 .meal { display: none; }
.occ-2 .ar {
  filter: blur(7px);
  cursor: pointer;
  user-select: none;
  transition: filter 0.15s ease;
}
.occ-2 .ar:hover, .occ-2 .ar.peek { filter: none; }

.occ-3 .ar, .occ-3 .tr, .occ-3 .meal { display: none; }
.occ-3 .ayah::after {
  content: "Ezberden oku — sonra sesi aç ve kontrol et.";
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   TESBİH — tekrar sayacı.
   Taneler altınla dolar. Konunun kendi aleti; dekoratif nokta dizisi değil.
   ========================================================================== */

.tally {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--gold);
  border-radius: 0 5px 5px 0;
  padding: 0.9rem 1rem;
  margin: 1.4rem 0;
}
.tally .t-label { font-weight: 600; margin: 0 0 0.15rem; }
.tally .t-sub { font-size: 0.83rem; color: var(--muted); margin: 0 0 0.75rem; }

.tally-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}
.tally-count {
  font-family: var(--mono);
  font-size: 1.32rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 4.2rem;
  color: var(--gold);
}
.tally-count.done { color: var(--ok); }

.tally button {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--ground);
  border: none;
  border-radius: 4px;
  padding: 0.6rem 0.95rem;
  min-height: 44px;
  cursor: pointer;
}
.tally button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--rule);
}
.tally button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.tally-dots {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 0.25rem;
}
.tally-dots span {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1.5px solid var(--rule);
  background: transparent;
  transition: background 0.14s ease, border-color 0.14s ease;
}
.tally-dots span.on {
  background: var(--gold);
  border-color: color-mix(in srgb, var(--gold) 70%, black);
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.22);
}

/* --- Alıştırma bölümü --------------------------------------------------- */
.practice {
  border-top: 2px solid var(--ink);
  margin-top: 2.8rem;
  padding-top: 0.4rem;
}
.practice h2 { border-top: none; padding-top: 0.5rem; }

/* --- Test (quiz.js) ----------------------------------------------------- */
.quiz { margin: 1.3rem 0 1.8rem; }
.quiz-q { margin-bottom: 1.7rem; }
.quiz-q .q-prompt { font-weight: 600; margin: 0 0 0.6rem; }
.quiz-q .q-prompt::before {
  content: attr(data-n);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 400;
  color: var(--gold);
  margin-right: 0.45rem;
}

.q-options { list-style: none; margin: 0; padding: 0; }
.q-options li {
  margin: 0 0 0.4rem;
  padding: 0.75rem 0.85rem;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.94rem;
  line-height: 1.45;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.q-options li:hover { border-color: var(--muted); }
.q-options li:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.q-options li.picked-right {
  border-color: var(--ok);
  background: var(--ok-soft);
  color: var(--ok);
  font-weight: 600;
  cursor: default;
}
.q-options li.picked-wrong {
  border-color: var(--bad);
  background: var(--bad-soft);
  color: var(--bad);
  text-decoration: line-through;
  cursor: default;
}
.q-options li.reveal-right { border-color: var(--ok); color: var(--ok); font-weight: 600; }
.quiz-q.answered .q-options li { cursor: default; }
.quiz-q.answered .q-options li:hover { border-color: var(--rule); }
.quiz-q.answered .q-options li.picked-right:hover,
.quiz-q.answered .q-options li.reveal-right:hover { border-color: var(--ok); }

.q-explain {
  display: none;
  margin: 0.6rem 0 0;
  padding-left: 0.85rem;
  border-left: 2px solid var(--rule);
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--muted);
}
.quiz-q.answered .q-explain { display: block; }

.quiz-score {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  padding-top: 0.6rem;
}

/* --- Ezberden yazma (quiz.js) ------------------------------------------ */
.recall { margin: 1.3rem 0 1.8rem; }
.recall .r-prompt { font-weight: 600; margin: 0 0 0.5rem; }
.recall textarea {
  width: 100%;
  min-height: 5.5rem;
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.55;
  padding: 0.65rem 0.7rem;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 4px;
  resize: vertical;
}
.recall textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }

.recall button, .quiz button, .checklist button {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--ground);
  border: none;
  border-radius: 4px;
  padding: 0.6rem 0.95rem;
  min-height: 44px;
  margin-top: 0.55rem;
  cursor: pointer;
}
.recall button:hover, .quiz button:hover, .checklist button:hover { opacity: 0.86; }
.recall button:focus-visible, .checklist button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.r-model {
  display: none;
  margin-top: 0.8rem;
  padding: 0.8rem 0.9rem;
  background: var(--verdigris-soft);
  border-left: 3px solid var(--verdigris);
  border-radius: 0 4px 4px 0;
  font-size: 0.9rem;
}
.r-model > :last-child { margin-bottom: 0; }
.recall.revealed .r-model { display: block; }
.recall.revealed button { display: none; }

/* --- Yapılacaklar (checklist.js) --------------------------------------- */
.checklist { margin: 1.3rem 0 1.8rem; }
.checklist ol { list-style: none; padding: 0; margin: 0; }
.checklist li {
  position: relative;
  padding: 0.75rem 0 0.75rem 2.3rem;
  border-bottom: 1px solid var(--rule-soft);
  margin: 0;
  cursor: pointer;
  font-size: 0.93rem;
  line-height: 1.45;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.85rem;
  width: 1.15rem;
  height: 1.15rem;
  border: 1.5px solid var(--muted);
  border-radius: 3px;
}
.checklist li.done::before {
  content: "✓";
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.15rem;
  text-align: center;
}
.checklist li.done { color: var(--muted); text-decoration: line-through; }
.checklist li:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.checklist-progress {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
  margin-top: 0.6rem;
}

/* --- Altlık ------------------------------------------------------------- */
.lesson-footer {
  border-top: 2px solid var(--ink);
  margin-top: 3rem;
  padding-top: 1.1rem;
  font-size: 0.93rem;
}
.lesson-footer h3 { margin-top: 1.2rem; }
.lesson-footer h3:first-child { margin-top: 0; }
.nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.76rem;
}

/* --- Referans belgesi varyantı ----------------------------------------- */
body.reference h1 { font-size: 1.6rem; }

/* ==========================================================================
   Geniş ekran — mobil tasarımı büyüt, yeniden kurma.
   ========================================================================== */

@media (min-width: 40rem) {
  :root { --pad: 2rem; }
  body { padding: 3rem var(--pad) 7rem; max-width: 60rem; margin: 0 auto; font-size: 1.09rem; }
  h1 { font-size: 2.3rem; }
  h2 { font-size: 1.45rem; font-style: italic; margin-top: 3rem; }
  h3 { font-size: 1.12rem; }
  .subtitle { font-size: 1.28rem; }
  .ar { font-size: 2.1rem; line-height: 2.15; }
  .ayah { padding: 1.1rem 1.3rem; }
  .tr { font-size: 1.03rem; }
  .meal { font-size: 0.92rem; }
  table { font-size: 0.87rem; }
  .occlude-bar button { flex: 0 0 auto; }
  .nav-links { flex-direction: row; flex-wrap: wrap; gap: 1.5rem; }
  .tally-dots { flex: 0 1 auto; max-width: 18rem; padding-top: 0; }
}

/* Kenar notları gerçek kenar notu olur */
@media (min-width: 68rem) {
  .sidenote {
    float: right;
    clear: right;
    width: 15rem;
    margin: 0.3rem -17.5rem 1rem 0;
    padding-left: 0;
    border-left: none;
    font-size: 0.8rem;
  }
}

/* ==========================================================================
   Baskı — referans belgeleri kağıda basılmak için tasarlandı.
   ========================================================================== */

@media print {
  :root {
    --ground: #fff; --panel: #fff; --ink: #000; --muted: #444;
    --rule: #bbb; --rule-soft: #ddd; --gold: #6a5210; --gold-soft: #f7f4ea;
    --verdigris: #2c4f49; --verdigris-soft: #f2f6f5;
  }
  body { padding: 0; max-width: none; font-size: 10.5pt; }
  h1 { font-size: 19pt; }
  h2 { font-size: 13pt; margin-top: 15pt; }
  h2, h3 { page-break-after: avoid; }
  .ayah, pre, table, tr, .callout, .quiz-q { page-break-inside: avoid; }
  .ar { font-size: 17pt; line-height: 1.9; }
  .tr { font-size: 9.5pt; }
  a { color: #000; border-bottom: none; }
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 7pt; color: #555; word-break: break-all;
  }
  .ayah-audio, .occlude-bar, .tally-row, .no-print,
  .quiz button, .recall button, .checklist button { display: none !important; }
  /* Baskıda her şey görünür olmalı */
  .occ-1 .tr, .occ-1 .meal, .occ-2 .tr, .occ-2 .meal,
  .occ-3 .ar, .occ-3 .tr, .occ-3 .meal,
  .r-model, .q-explain { display: block !important; }
  .occ-2 .ar { filter: none !important; }
  .occ-3 .ayah::after { content: ""; }
}

/* ==========================================================================
   İLERLEME (progress.js) — site genelinde blok durumu.
   Durum hem renk hem biçimle kodlanır: yalnız renge güvenmek erişilebilir değil.
   ========================================================================== */

/* --- Ders sayfasındaki durum düğmesi ------------------------------------ */
.prog-control {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 0.85rem 1rem;
  margin: 1.5rem 0;
  max-width: var(--measure);
}
.prog-label {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.6rem;
}
.prog-label.state-learning { color: var(--gold); font-weight: 600; }
.prog-label.state-done { color: var(--ok); font-weight: 600; }

.prog-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.prog-row button {
  flex: 1 1 auto;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.6rem 0.9rem;
  min-height: 44px;
  cursor: pointer;
}
.prog-row button.ghost { color: var(--muted); }
.prog-row button:hover { border-color: var(--muted); }
.prog-row button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.prog-row button.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ground);
  font-weight: 600;
}

/* --- index: özet + yüzde ------------------------------------------------ */
.prog-summary { margin: 0 0 1.6rem; max-width: var(--measure); }
.prog-figure {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  flex-wrap: wrap;
}
.prog-pct {
  font-family: var(--mono);
  font-size: 2.4rem;
  font-weight: 600;
  line-height: 1;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.prog-sub { font-size: 0.88rem; color: var(--muted); }

.prog-bar {
  height: 8px;
  background: var(--rule-soft);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  margin: 0.7rem 0 1.1rem;
}
.prog-bar span {
  display: block;
  height: 100%;
  background: var(--gold);
  border-radius: 3px 0 0 3px;
  transition: width 0.3s ease;
}

.prog-resume {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  background: var(--ink);
  color: var(--ground);
  border: none;
  border-radius: 5px;
  padding: 0.85rem 1rem;
  text-decoration: none;
}
.prog-resume:hover { opacity: 0.9; border: none; }
.prog-resume:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.prog-resume .lbl {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.7;
}
.prog-resume .val { font-size: 1.02rem; font-weight: 600; }

/* --- index: blok listesi ----------------------------------------------- */
.prog-grid { list-style: none; margin: 0; padding: 0; max-width: 44rem; }
.prog-item { margin: 0 0 0.4rem; }
.prog-item a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--rule);
  border-radius: 0 4px 4px 0;
  padding: 0.7rem 0.85rem;
  text-decoration: none;
  color: var(--ink);
  min-height: 56px;
}
.prog-item a:hover { border-color: var(--muted); border-left-color: var(--gold); }
.prog-item a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.pi-id {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  min-width: 1.8rem;
  font-variant-numeric: tabular-nums;
}
.pi-body { display: flex; flex-direction: column; gap: 0.1rem; flex: 1 1 auto; min-width: 0; }
.pi-verses {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}
.pi-title {
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Durum göstergesi: boş daire / yarım / dolu onay */
.pi-state {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--rule);
}
.state-learning .pi-state {
  border-color: var(--gold);
  background: linear-gradient(to top, var(--gold) 50%, transparent 50%);
}
.state-done .pi-state {
  border-color: var(--ok);
  background: var(--ok);
  position: relative;
}
.state-done .pi-state::after {
  content: "✓";
  position: absolute;
  inset: 0;
  color: #fff;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 17px;
  text-align: center;
}
.state-learning a { border-left-color: var(--gold); }
.state-done a { border-left-color: var(--ok); }
.state-done .pi-id, .state-done .pi-title { color: var(--muted); }

/* --- Yedekleme --------------------------------------------------------- */
.prog-backup { max-width: var(--measure); margin: 1.2rem 0; }
.prog-code {
  width: 100%;
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.5;
  padding: 0.6rem 0.7rem;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 4px;
  resize: vertical;
  word-break: break-all;
  margin-bottom: 0.5rem;
}
.prog-code:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.prog-msg { font-family: var(--mono); font-size: 0.72rem; margin: 0.5rem 0 0; color: var(--muted); }
.prog-msg.ok { color: var(--ok); }
.prog-msg.bad { color: var(--bad); }

/* --- Blok üst bilgisi (ders sayfaları) --------------------------------- */
.block-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.8rem;
}
.block-head .bh-id { color: var(--gold); font-weight: 600; }

/* --- Karıştırma uyarısı ------------------------------------------------ */
.clash {
  background: var(--bad-soft);
  border: 1px solid color-mix(in srgb, var(--bad) 25%, transparent);
  border-left: 3px solid var(--bad);
  border-radius: 0 5px 5px 0;
  padding: 0.85rem 1rem;
  margin: 1.4rem 0;
  max-width: var(--measure);
}
.clash .callout-label { color: var(--bad); }
.clash > :last-child { margin-bottom: 0; }
.clash ul { margin-bottom: 0; }

/* --- Adım listesi (kompakt yöntem hatırlatıcı) ------------------------- */
.steps { counter-reset: st; list-style: none; padding: 0; margin: 0 0 1.3rem; }
.steps li {
  position: relative;
  padding: 0 0 0.6rem 2.1rem;
  margin: 0;
  font-size: 0.93rem;
  line-height: 1.5;
}
.steps li::before {
  counter-increment: st;
  content: counter(st);
  position: absolute;
  left: 0;
  top: 0.05rem;
  width: 1.5rem;
  height: 1.5rem;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.4rem;
  text-align: center;
}

@media (min-width: 40rem) {
  .prog-row button { flex: 0 0 auto; }
  .prog-resume { flex-direction: row; align-items: center; justify-content: space-between; }
}
