/* ==========================================================================
   Elif Ba — profesyonel tema
   Diyanet elifba'nin kurumsal mavisinden ilham; dingin dijital mushaf.
   --------------------------------------------------------------------------
   Palet:
     --ink      #12233b  lacivert mürekkep (metin, koyu)
     --ink-2    #2b3f57  yumuşak mürekkep
     --paper    #f7f4ec  sıcak fildişi zemin
     --paper-2  #efeadd  ikincil zemin
     --card     #fffdf9  kart yüzeyi
     --blue     #0480be  Diyanet mavisi (birincil aksan)
     --blue-2   #149bdf  açık mavi
     --blue-ink #063a56  koyu mavi
     --gold     #a8863d  ince altın
     --line     #e6dfce  hairline
   ========================================================================== */

/* ── Mushaf hattı ─────────────────────────────────────────────────────
   Çalışan quran/ uygulamasıyla aynı font: ShaikhHamdullah (tam Diyanet
   uyumlu). Yedekler: Elfmshf ve KKAbay.
   ÖNEMLİ: Font hem .woff2 hem .ttf olarak tanımlı; tarayıcı sunucuda
   hangisi varsa onu yükler. Böylece uzantı uyuşmazlığı sorunu olmaz. */
@font-face {
  font-family: "ShaikhHamdullah";
  src: url("../fonts/shaikh_hamdullah_mushaf.woff2") format("woff2"),
       url("../fonts/shaikh_hamdullah_mushaf.ttf") format("truetype");
  font-weight: normal; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Elfmshf";
  src: url("../fonts/elfmshf.woff2") format("woff2"),
       url("../fonts/elfmshf.ttf") format("truetype");
  font-weight: normal; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "KKAbay";
  src: url("../fonts/KK_Abay.woff2") format("woff2"),
       url("../fonts/KK_Abay.ttf") format("truetype");
  font-weight: normal; font-style: normal; font-display: swap;
}

/* Geriye dönük uyumluluk için eski adlar da geçerli fontlara işaret etsin */
@font-face {
  font-family: "FeyzulFurkan";
  src: url("../fonts/KK_Abay.woff2") format("woff2"),
       url("../fonts/KK_Abay.ttf") format("truetype");
  font-weight: normal; font-style: normal; font-display: swap;
}

@font-face {
  font-family: "MushafHat";
  src: url("../fonts/shaikh_hamdullah_mushaf.woff2") format("woff2"),
       url("../fonts/shaikh_hamdullah_mushaf.ttf") format("truetype");
  font-weight: normal; font-style: normal; font-display: swap;
}

@font-face {
  font-family: "Glyphicons Halflings";
  src: url("../fonts/glyphicons-halflings-regular.woff2") format("woff2");
  font-weight: normal; font-style: normal; font-display: swap;
}

:root {
  --ink: #12233b;
  --ink-2: #2b3f57;
  --paper: #f7f4ec;
  --paper-2: #efeadd;
  --card: #fffdf9;
  --blue: #0480be;
  --blue-2: #149bdf;
  --blue-ink: #063a56;
  --gold: #a8863d;
  --line: #e6dfce;
  --shadow-sm: 0 1px 2px rgba(18,35,59,.05);
  --shadow: 0 1px 2px rgba(18,35,59,.04), 0 10px 30px rgba(18,35,59,.07);
  --shadow-blue: 0 8px 24px rgba(4,128,190,.18);
}

* { -webkit-tap-highlight-color: transparent; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.arabic {
  font-family: "KKAbay", "Segoe UI", serif;
  direction: rtl;
  /* line-height:1 idi: hareke/med isaretleri satir kutusuna sigmayip
     ust satira giriyordu. Diyanet .ebt_inner degeri %200. */
  line-height: 200%;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

/* ── Tipografik yardımcılar ── */
.eyebrow {
  font-size: .70rem; letter-spacing: .24em; text-transform: uppercase;
  color: var(--blue); font-weight: 700;
}
.num-badge { font-variant-numeric: tabular-nums; font-weight: 700; }

/* ── Kart ── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.hair-top { border-top: 1px solid var(--line); }

/* ── Üst bar ── */
.topbar {
  background: rgba(247,244,236,.82);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(150deg, var(--blue) 0%, var(--blue-ink) 100%);
  color: #fff; box-shadow: var(--shadow-blue);
}
/* Elifba SVG logosu (mavi kutuda beyaz) */
.brand-logo {
  display: block; width: 68%; height: 68%;
  background-color: #fff;
  -webkit-mask: url("../img/logo.svg") center/contain no-repeat;
  mask: url("../img/logo.svg") center/contain no-repeat;
}
.nav-pill {
  padding: .35rem .7rem; border-radius: 999px;
  color: var(--ink-2); font-variant-numeric: tabular-nums;
  transition: background .18s, color .18s;
}
.nav-pill:hover { background: var(--paper-2); color: var(--ink); }
.nav-pill.active { background: var(--blue); color: #fff; }

/* ── Buton (birincil) ── */
.btn-primary {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.4rem; border-radius: 999px;
  background: linear-gradient(150deg, var(--blue) 0%, var(--blue-ink) 100%);
  color: #fff; font-weight: 600; box-shadow: var(--shadow-blue);
  transition: transform .15s, box-shadow .2s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(4,128,190,.28); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .8rem 1.4rem; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink);
  background: var(--card); transition: background .18s;
}
.btn-ghost:hover { background: var(--paper-2); }

/* ── Ses kontrol butonu (baslik/aciklama/tümü) ── */
.sound-btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .5rem .9rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card);
  color: var(--ink-2); font-size: .82rem; font-weight: 500;
  transition: all .18s;
}
.sound-btn:hover { border-color: var(--blue); color: var(--blue-ink); background: #fff; }
.sound-btn.active {
  background: var(--blue); color: #fff; border-color: var(--blue);
  box-shadow: var(--shadow-blue);
}
.sound-btn svg { flex: 0 0 auto; }
/* Sadece ikon buton (yuvarlak) */
.sound-btn-icon {
  padding: .55rem; width: 40px; height: 40px;
  justify-content: center; gap: 0;
}

/* ── Slayt sahnesi ── */
/* Ana teori dersinde alt ders kartları */
.alt-ders-liste { margin-top: 1.2rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.alt-ders-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .6rem; }
.alt-ders-kart {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .8rem 1.1rem; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--ink); font-weight: 500; font-size: .95rem;
  transition: background .15s, border-color .15s, transform .1s;
}
.alt-ders-kart:hover { background: #e9f2fa; border-color: var(--blue); transform: translateX(2px); }
.alt-ders-kart svg { color: var(--blue-ink); flex-shrink: 0; }

/* ── Sure: bütün metin + meal aç/kapa ── */
.sure-wrap { max-width: 820px; margin: 0 auto 1.5rem; }
.sure-tekpar {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 1.8rem 2rem; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.sure-tekpar:hover { background: #f3ecdb; border-color: var(--gold); }
.sure-besmele {
  text-align: center; font-size: 1.7rem; color: var(--ink);
  padding-bottom: 1.2rem; margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--line); direction: rtl;
}
.sure-metin {
  font-family: "ShaikhHamdullah","Elfmshf","KKAbay",serif;
  font-size: clamp(26px, 4.5vw, 38px); line-height: 2.4;
  color: var(--ink); direction: rtl; text-align: right; text-align: justify;
}
/* Ayet parçası: tıklanabilir + okunan vurgulu (Diyanet gibi) */
.sure-ayet-span {
  display: inline; border-radius: 6px;
  transition: background-color .2s;
  padding: .05em 0;
}
.sure-ayet-span:hover { background-color: #f3ecdb; }
.sure-ayet-span.sure-okunan,
.sure-besmele.sure-okunan {
  background-color: #f6e6b8 !important;
  color: #12233b !important;
  border-radius: 8px;
  box-shadow: 0 0 0 4px #f6e6b8;
}
.sure-ayet-no {
  font-family: "ShaikhHamdullah","Elfmshf",serif;
  font-size: .7em; color: var(--blue-ink);
  margin: 0 .1em; vertical-align: baseline; direction: rtl;
}
.sure-meal-toggle {
  display: inline-flex; align-items: center; gap: .4rem;
  margin: 1rem auto 0; font-size: .85rem; font-weight: 600;
  color: var(--blue-ink); background: var(--paper-2);
  border: 1px solid var(--line); border-radius: 999px;
  padding: .5rem 1.1rem; cursor: pointer; transition: background .15s;
}
.sure-meal-toggle:hover { background: #e9f2fa; }
.sure-meal-toggle.acik { background: var(--blue); color: #fff; border-color: var(--blue); }
.sure-meal-box {
  margin-top: 1rem; background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 1.2rem 1.5rem;
}
.sure-meal-satir {
  display: grid; grid-template-columns: 32px 1fr; gap: .8rem;
  padding: .6rem 0; border-bottom: 1px dashed var(--line);
}
.sure-meal-satir:last-child { border-bottom: none; }
.sure-meal-no {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 600; width: 26px; height: 26px;
  border-radius: 999px; background: var(--paper-2); color: var(--blue-ink);
}
.sure-meal-tr { font-size: .95rem; color: var(--ink); line-height: 1.6; }

/* eski sure-ayet stilleri (kullanılmıyor ama uyumluluk) */

/* ── Mushaflarda Yer Alan İşaretler tablosu ── */
.isaret-tablo { max-width: 820px; margin: 0 auto 1.5rem; }
.isaret-baslik {
  text-align: center; font-weight: 700; font-size: 1.05rem;
  color: var(--ink); margin-bottom: 1rem;
}
.isaret-row {
  display: grid; grid-template-columns: 100px 1fr; gap: 1rem;
  align-items: center; width: 100%;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: .5rem 1rem; margin-bottom: .6rem;
  cursor: pointer; transition: background .15s, border-color .15s;
  direction: ltr; text-align: left;
}
.isaret-row:hover { background: #f3ecdb; border-color: var(--gold); }
.isaret-row.active { background: #e9f2fa; border-color: var(--blue); }
.isaret-glyph {
  font-family: "ShaikhHamdullah","Elfmshf","KKAbay",serif;
  font-size: 40px; line-height: 1; color: var(--ink); text-align: center;
}
.isaret-aciklama { font-size: .95rem; color: var(--ink); text-align: left; }

/* ── Harfler ve Şekilleri: 4 sütunlu tablo (Diyanet düzeni) ── */
.sekil-layout {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 340px);
  gap: 1.5rem; align-items: start; margin-bottom: 1.5rem;
}
@media (max-width: 900px){ .sekil-layout { grid-template-columns: 1fr; } }
.sekil-tablo-wrap { max-width: 760px; margin: 0; }
.sekil-tablo {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .5rem;
  direction: rtl;
}
.sekil-head {
  font-weight: 600; font-size: .82rem; text-align: center;
  color: #c0392b; background: #f6efe0;
  border: 1px solid var(--line); border-radius: 10px;
  padding: .7rem .3rem; display: flex; align-items: center; justify-content: center;
}
.sekil-head-harf { color: #c0392b; font-weight: 700; }
.sekil-cell {
  font-family: "ShaikhHamdullah","Elfmshf","KKAbay",serif;
  font-size: clamp(22px, 3.5vw, 30px); line-height: 1;
  color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px;
  padding: .8rem .3rem; cursor: pointer; direction: rtl;
  transition: background .15s, border-color .15s;
}
.sekil-cell:hover { background: #f3ecdb; border-color: var(--gold); }
.sekil-cell-harf { background: #f6efe0; font-weight: 600; color: #b0392b; }
.sekil-red { color: #c0392b; }
.sekil-cell.active { background: #e9f2fa; border-color: var(--blue); }

/* Yan büyük kutu + durum sekmeleri */
.sekil-yan { position: sticky; top: 1rem; }
.sekil-buyuk-kart {
  background: radial-gradient(130% 120% at 50% -10%, #fff 0%, var(--card) 60%, #f4eee0 100%);
  border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow);
  aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center;
  margin-bottom: .8rem;
}
.sekil-buyuk {
  font-family: "ShaikhHamdullah","Elfmshf","KKAbay",serif;
  font-size: clamp(60px, 14vw, 120px); line-height: 1;
  color: var(--blue-ink); direction: rtl;
}
.sekil-buyuk .sekil-red { color: #c0392b; }
.sekil-tabs { display: grid; grid-template-columns: repeat(4,1fr); gap: .4rem; }
.sekil-tab {
  font-size: .82rem; font-weight: 600; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: .55rem .3rem; cursor: pointer; transition: background .15s, color .15s;
}
.sekil-tab:hover { background: #f3ecdb; }
.sekil-tab.active { background: var(--blue); color: #fff; border-color: var(--blue); }
@media (max-width:640px){ .sekil-cell, .sekil-head { font-size: .7rem; padding: .5rem .2rem; } }

/* ── Grid + Büyük gösterim yan yana (Diyanet düzeni) ── */
.harf-layout {
  display: grid;
  grid-template-columns: 1fr minmax(280px, 420px);
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 1.5rem;
}
.harf-layout .harf-grid-wrap { margin: 0; max-width: none; }
.harf-layout .stage { margin: 0; position: sticky; top: 1rem; }
/* Dar ekranda alt alta */
@media (max-width: 900px){
  .harf-layout { grid-template-columns: 1fr; }
  .harf-layout .stage { max-width: 420px; margin: 0 auto; }
}

/* ── Harf GRID görünümü (Diyanet gibi: İnce/Kalın başlıklı ızgara) ── */
.harf-grid-wrap { margin: 0 auto 1.75rem; max-width: 760px; }
.harf-grid-head {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  background: #efe7d3;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .7rem 1rem;
  margin: 1rem 0 .8rem;
}
.harf-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: .6rem;
  direction: rtl;
}
@media (max-width: 640px){ .harf-grid { grid-template-columns: repeat(4, 1fr); } }
.harf-cell {
  font-family: "ShaikhHamdullah", "Elfmshf", "KKAbay", "Traditional Arabic", "Amiri", "Segoe UI", serif;
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.4;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem .4rem;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
  direction: rtl;
  text-rendering: optimizeLegibility;
  /* Arapça kelimeleri harf ortasından KIRMA; sadece kelime araları sarılır */
  word-break: keep-all; overflow-wrap: break-word; hyphens: none;
  white-space: normal;
  min-height: 3.5rem; display: flex; align-items: center; justify-content: center;
  text-align: center;
}
/* Uzun ayet ifadeleri: küçük font, kelime bütünlüğü korunur */
.harf-cell[data-long="true"] {
  font-size: clamp(14px, 2.1vw, 20px); line-height: 1.9;
  word-break: keep-all; overflow-wrap: break-word;
}
.harf-cell:hover { background: #f3ecdb; border-color: var(--gold); }
/* Tecvid renklendirme: kurala tabi harf/hece kırmızı */
.tecvid-red { color: #c0392b; }
/* Kelime grubu: nowrap ama Arapça harf bağlanması korunur (inline-block DEĞİL) */
.kelime-grup { white-space: nowrap; }
.tecvid-red, .kelime-grup span { display: inline; }
/* Harfler ve İsimleri: harf üstte + ismi altta */
.harf-cell[data-isimli="true"] { flex-direction: column; gap: .2rem; padding: .7rem .3rem; }
.hucre-harf { font-size: 1em; line-height: 1.1; }
.hucre-isim {
  font-size: .62em; color: var(--blue-ink);
  padding-top: .25rem; border-top: 1px solid var(--line);
  width: 100%; text-align: center;
}
.harf-cell:active { transform: scale(.96); }
.harf-cell.active {
  background: #e9f2fa;
  border-color: var(--blue);
  color: var(--blue-ink);
}

.stage {
  position: relative; overflow: hidden; border-radius: 24px;
  background:
    radial-gradient(130% 120% at 50% -10%, #ffffff 0%, var(--card) 55%, #f4eee0 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  /* Kare (1:1) sahne */
  aspect-ratio: 1 / 1;
  max-width: 560px;
  margin-left: auto; margin-right: auto;
  container-type: inline-size;
}
.slide-track { display: flex; height: 100%; will-change: transform;
  transition: transform .5s cubic-bezier(.22,.61,.36,1); }
.slide {
  flex: 0 0 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4%;
  padding: 8%;
  user-select: none;
  overflow: hidden;
}

.glyph {
  font-family: "KKAbay", serif; direction: rtl; line-height: 1.25;
  color: var(--ink);
  transition: color .25s, transform .25s, text-shadow .25s;
  cursor: pointer;
  /* Kontrollü, tutarlı boyut (container query ile ama sınırlı) */
  font-size: clamp(52px, 34cqw, 120px);
  max-width: 90%; max-height: 78cqh;
  overflow-wrap: break-word; word-break: break-word;
  text-align: center;
  display: flex; align-items: center; justify-content: center;
}
/* İçerik uzunluğuna göre kademeli font (tutarlılık için) */
.glyph[data-len="kisa"]  { font-size: clamp(52px, 40cqw, 130px); }   /* 3-6 karakter */
.glyph[data-len="orta"]  { font-size: clamp(38px, 28cqw, 96px); line-height: 1.35; } /* 7-14 */
.glyph[data-len="uzun"]  { font-size: clamp(24px, 14cqw, 52px); line-height: 1.6; } /* 15+ */
.glyph[data-long="true"] { font-size: clamp(20px, 11cqw, 40px); line-height: 1.7; }
.slide:hover .glyph { color: var(--blue-ink); }
/* Karşılaştırma: her konum eşit satır, aralarında çizgi (Diyanet gibi) */
.slide:has(.glyph-uzun) {
  flex-direction: column; justify-content: stretch;
  gap: 0; padding: 5% 8%;
}
.slide:has(.glyph-uzun) .glyph,
.glyph-uzun {
  font-family: "KKAbay", serif; direction: rtl; line-height: 1;
  color: var(--ink);
  flex: 1 1 0; width: 100%; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  margin: 0; max-height: none;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
/* 2 satırlı karşılaştırma: büyük font */
.slide:has(.glyph-uzun) .glyph { font-size: clamp(26px, 26cqw, 72px); }
.glyph-uzun { font-size: clamp(26px, 26cqw, 72px); }
/* 3 satırlı (tenvin): biraz küçük */
.slide:has(.glyph-uzun ~ .glyph-uzun) .glyph,
.slide:has(.glyph-uzun ~ .glyph-uzun) .glyph-uzun { font-size: clamp(22px, 20cqw, 58px); }
/* son satırda çizgi yok */
.slide:has(.glyph-uzun) > *:last-child { border-bottom: none; }
.playing .glyph {
  color: var(--blue);
  text-shadow: 0 6px 30px rgba(4,128,190,.25);
}
.playing .glyph.beat { animation: beat .55s ease; }
@keyframes beat {
  0% { transform: scale(1); } 40% { transform: scale(1.04); } 100% { transform: scale(1); }
}

/* Harfin altında ek içerik (form/varyant) varsa küçült */
.glyph.glyph-sm { font-size: 26cqw; max-height: 38cqh; }

/* Yazılış biçimi ızgarası — sahne içinde */
.forms-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 2.5cqw; width: 84%;
}
.form-cell {
  border: 1px solid var(--line); border-radius: 3cqw; background: var(--card);
  padding: 2.5cqw 1cqw; text-align: center;
  transition: border-color .18s, box-shadow .18s;
}
.form-cell:hover { border-color: var(--blue-2); box-shadow: var(--shadow-sm); }
.form-glyph { font-size: 9cqw; color: var(--ink); line-height: 1; }
.form-label { font-size: 2.6cqw; color: var(--ink); opacity: .5; margin-top: 1.5cqw; }

/* Varyant sekmeleri satırı */
.variant-row { display: flex; gap: 2cqw; flex-wrap: wrap; justify-content: center; }

/* ── Ses dalgası göstergesi ── */
.wave { display: inline-flex; align-items: flex-end; gap: 3px; height: 16px; }
.wave i {
  width: 3px; background: currentColor; border-radius: 2px;
  height: 5px; animation: none;
}
.sound-btn.active .wave i { animation: wv .9s ease-in-out infinite; }
.wave i:nth-child(2){ animation-delay:.15s } .wave i:nth-child(3){ animation-delay:.3s }
.wave i:nth-child(4){ animation-delay:.45s }
@keyframes wv { 0%,100%{height:5px} 50%{height:15px} }

/* ── Navigasyon okları ── */
.nav-btn {
  display: grid; place-items: center; width: 48px; height: 48px;
  border-radius: 999px; background: var(--card);
  border: 1px solid var(--line); color: var(--ink); box-shadow: var(--shadow);
  transition: transform .15s, background .2s, color .2s, border-color .2s;
}
.nav-btn:hover { background: var(--blue); color: #fff; border-color: var(--blue); transform: translateY(-1px); }
.nav-btn:active { transform: scale(.96); }
.nav-btn:disabled { opacity: .32; cursor: not-allowed; }
.nav-btn:disabled:hover { background: var(--card); color: var(--ink); border-color: var(--line); transform: none; }

/* ── Varyant sekmeleri (hareke/tenvin) ── */
.variant-tab {
  font-size: .82rem; padding: .45rem .95rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  transition: all .16s;
}
.variant-tab:hover { border-color: var(--blue-2); color: var(--blue-ink); }
.variant-tab[aria-selected="true"] {
  background: var(--blue); color: #fff; border-color: var(--blue);
  box-shadow: var(--shadow-blue);
}

/* ── İlerleme noktaları ── */
.dot {
  height: 7px; width: 7px; border-radius: 999px; background: var(--line);
  transition: all .25s; cursor: pointer; border: none; padding: 0;
}
.dot.active { background: var(--blue); width: 24px; }
.dot:hover:not(.active) { background: var(--blue-2); }

/* ── Yazılış biçimi kutuları ── */
.form-cell {
  border: 1px solid var(--line); border-radius: 14px; background: var(--card);
  transition: border-color .18s, box-shadow .18s;
}
.form-cell:hover { border-color: var(--blue-2); box-shadow: var(--shadow-sm); }

/* ── Bölüm listesi ── */
.chapter-row { transition: background .2s; }
.chapter-row:hover { background: var(--paper-2); }
.chapter-row:hover .row-arrow { transform: translateX(3px); color: var(--blue); }
.chapter-row:hover .ch-num { background: var(--blue); color: #fff; }
.ch-num {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: var(--paper-2); color: var(--blue-ink);
  font-weight: 700; font-variant-numeric: tabular-nums;
  transition: background .2s, color .2s;
}
.row-arrow { transition: transform .2s, color .2s; }

/* ── Fokus ── */
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 8px; }

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .slide-track { transition: none; }
  .playing .glyph.beat, .sound-btn.active .wave i { animation: none; }
  html { scroll-behavior: auto; }
}

/* ══════════════════════════════════════════════════════════════════════
   SIDEBAR + AĞAÇ MENÜ + PLAYER (Diyanet tarzı)
   ══════════════════════════════════════════════════════════════════════ */
/* ── Ders başlığı üst barı (ince, açık, ortalanmış) ── */
.ders-topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.ders-topbar-inner {
  max-width: 1152px; margin: 0 auto;
  padding: .55rem 2rem;
  display: flex; align-items: center; gap: 1rem;
  position: relative;
  min-height: 44px;
}
.ders-topbar-no {
  font-size: .62rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--gold); font-weight: 700;
}
.ders-topbar-title {
  font-size: 1.05rem; font-weight: 600; line-height: 1.2; color: var(--ink);
}
/* başlık bloğu yatay ortalı; butonlar sağda */
.ders-topbar-inner > .min-w-0 {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  text-align: center;
}
.ders-topbar-inner > .flex { margin-left: auto; min-height: 40px; align-items: center; }
.ders-topbar .sound-btn {
  background: transparent; color: var(--ink); border-color: var(--line);
  font-size: .8rem; padding: .35rem .7rem;
}
.ders-topbar .sound-btn:hover { background: var(--paper-2); }
@media (max-width: 640px){
  .ders-topbar-inner { padding: .5rem 1rem; }
  .ders-topbar-inner > .min-w-0 { position: static; transform: none; text-align: left; }
  .ders-topbar-title { font-size: .95rem; }
}

/* ── Ders başlığı üst barı sonu ── */
.sidebar {
  background: var(--card);
  border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh;
  overflow: hidden;
  /* Genislik tanimi yoktu: menu icerigine gore ezilip 89px'e kadar
     iniyordu (.content{flex:1 1 auto} tum bosluğu aliyor). */
  width: clamp(240px, 20vw, 320px);
  flex: 0 0 clamp(240px, 20vw, 320px);
}
.sidebar-inner {
  height: 100%; overflow-y: auto;
  padding: 18px 14px 40px;
  scrollbar-width: thin;
}
.sidebar-inner::-webkit-scrollbar { width: 8px; }
.sidebar-inner::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }

.content { flex: 1 1 auto; min-width: 0; }

/* ── Player (sade, mavi kutu yok) ── */
.player {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 14px; color: var(--ink);
  margin-bottom: 10px;
}
.player[data-idle="true"] { opacity: .55; }
.player-controls { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.pp-btn {
  display: grid; place-items: center; border-radius: 999px;
  background: transparent; color: var(--blue-ink);
  width: 34px; height: 34px; transition: background .16s, transform .12s;
}
.pp-btn:hover { background: var(--paper-2); }
.pp-btn:active { transform: scale(.94); }
.pp-main { width: 40px; height: 40px; background: var(--blue); color: #fff; }
.pp-main:hover { background: var(--blue-ink); }
.pp-btn[aria-pressed="true"] { background: var(--paper-2); color: var(--blue-ink); }
.player-bar { height: 4px; border-radius: 999px; background: var(--line); overflow: hidden; }
.player-fill { height: 100%; width: 0%; background: var(--blue); border-radius: 999px; transition: width .15s linear; }
.player-label {
  font-size: 12px; margin-top: 8px; color: var(--ink);
  opacity: .7;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Ağaç menü ── */
.tree { display: flex; flex-direction: column; gap: 2px; }
.tree-section-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gold);
  padding: .9rem .75rem .35rem;
  margin-top: .5rem;
  border-top: 1px solid var(--line);
}
.tree-section-title:first-child { border-top: none; margin-top: 0; }
.tree-item-soon { opacity: .55; }
.tree-soon {
  font-size: .62rem; color: var(--ink); opacity: .4;
  margin-right: auto; padding-left: .4rem;
}
.tree-static {
  display: block; padding: 9px 12px; border-radius: 10px;
  font-size: 14px; color: var(--ink-2); font-weight: 500;
  transition: background .16s, color .16s;
}
.tree-static:hover { background: var(--paper-2); color: var(--ink); }
.tree-static.active { background: var(--blue); color: #fff; }

.tree-group { border-radius: 10px; overflow: hidden; }
.tree-head {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  color: var(--ink); font-weight: 600; font-size: 14px;
  transition: background .16s;
}
.tree-head:hover { background: var(--paper-2); }
.tree-no {
  display: grid; place-items: center; min-width: 24px; height: 22px; padding: 0 6px;
  border-radius: 6px; background: var(--paper-2); color: var(--blue-ink);
  font-size: 11px; font-weight: 700;
}
.tree-title { flex: 1; text-align: left; }
.tree-caret { color: var(--ink-2); transition: transform .2s; flex: 0 0 auto; }
.tree-group[data-open="true"] > .tree-head .tree-caret { transform: rotate(180deg); }

.tree-children {
  overflow: hidden;
  max-height: 0;
  transition: max-height .25s ease;
  padding-left: 6px;
}
.tree-group[data-open="true"] > .tree-children { max-height: 600px; }
.tree-group[data-open="false"] > .tree-children { max-height: 0; }

.tree-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px 8px 14px; margin: 2px 0 2px 12px;
  border-left: 2px solid var(--line); border-radius: 0 8px 8px 0;
  font-size: 13.5px; color: var(--ink-2);
  transition: background .16s, color .16s, border-color .16s;
}
.tree-item:hover { background: var(--paper-2); color: var(--ink); border-color: var(--blue-2); }
.tree-item.active {
  background: #eaf5fb; color: var(--blue-ink); font-weight: 600;
  border-color: var(--blue);
}
.tree-item-no {
  font-variant-numeric: tabular-nums; font-size: 11px; font-weight: 700;
  color: var(--blue); min-width: 18px;
}

/* ── Backdrop (mobil) ── */
.backdrop {
  position: fixed; inset: 0; background: rgba(18,35,59,.4);
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 45;
}
.backdrop.show { opacity: 1; pointer-events: auto; }

/* ── Responsive ── */
@media (max-width: 1023px) {
  .sidebar {
    position: fixed; top: 0; left: 0; z-index: 50;
    transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: 0 0 40px rgba(18,35,59,.18);
    width: min(86vw, 340px); flex: 0 0 auto;
  }
  .sidebar.open { transform: translateX(0); }
  .content { width: 100%; }
}

/* Statik sayfa okunabilirliği */
.prose-tr p { line-height: 1.75; color: var(--ink-2); margin-bottom: 1rem; max-width: 60ch; }

/* ── Sûre âyetleri ── */
.ayet { transition: border-color .18s, box-shadow .18s, background .18s; cursor: pointer; }
.ayet:hover { border-color: var(--blue-2); box-shadow: var(--shadow); }
.ayet.playing {
  border-color: var(--blue); background: #f4fafe;
  box-shadow: var(--shadow-blue);
}
.ayet-no {
  flex: 0 0 auto; display: grid; place-items: center;
  min-width: 30px; height: 30px; padding: 0 8px; border-radius: 999px;
  background: var(--paper-2); color: var(--blue-ink);
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
  margin-top: 4px;
}
.ayet.playing .ayet-no { background: var(--blue); color: #fff; }

/* ══════════════════════════════════════════════════════════════════════
   MUSHAF GÖRÜNÜMÜ (sûre — tek blok akan metin)
   ══════════════════════════════════════════════════════════════════════ */
.mushaf {
  background:
    radial-gradient(120% 100% at 50% 0%, #fffefb 0%, var(--card) 60%, #f6f0e2 100%);
}
.besmele {
  font-family: "ShaikhHamdullah", "Elfmshf", "KKAbay", serif;
  text-align: center; font-size: clamp(26px, 4.6vw, 34px);
  color: var(--blue-ink); line-height: 2.55; margin-bottom: 1.6rem;
  padding-bottom: 1.4rem; border-bottom: 1px solid var(--line);
  direction: rtl; cursor: pointer; border-radius: 10px;
  transition: color .2s, background .2s;
}
.besmele:hover { color: var(--blue); }
.besmele.playing { color: var(--blue); background: #eaf5fb; }
.ayah-flow {
  font-family: "ShaikhHamdullah", "Elfmshf", "KKAbay", serif;
  direction: rtl;
  font-size: clamp(26px, 4.6vw, 34px);
  line-height: 2.55;
  color: var(--ink);
  text-align: center;
  word-spacing: 0;
  unicode-bidi: plaintext;
  /* NOT: font-feature-settings ile init/medi/fina/isol'ü ELLE açmak
     tarayıcının doğal Arapça bağlama algoritmasını bozuyordu (harfler
     müstakil kalıyordu). Bu özellikler zaten otomatik uygulanır; bu yüzden
     hiç dokunmuyoruz. */
}
.ayah {
  cursor: pointer;
  border-radius: .35rem;
  padding: 0 2px;
  transition: background .18s ease;
}
.ayah:hover { background: #eaf5fb; }
.ayah.playing { background: #d9eefa; color: var(--blue-ink); }

/* Âyet sonu numarası: Diyanet mushafındaki gibi ﴿١﴾ süslü parantez.
   direction:rtl olmalı — ltr süsleri dışa çevirip ters gösteriyordu.
   isolate ile numara komşu metinden etkilenmez. */
.ayah-num {
  display: inline-block;
  direction: rtl;
  unicode-bidi: isolate;
  font-family: "ShaikhHamdullah", "Elfmshf", "KKAbay", serif;
  color: var(--gold);
  font-size: .82em;
  margin: 0 4px;
  vertical-align: baseline;
  user-select: none;
}
.ayah.playing .ayah-num { color: var(--blue); }

/* Aktif âyet meali kutusu */
.meal-box { border-color: var(--blue-2); }
.meal-box .ayet-no { background: var(--blue); color: #fff; }

/* ══════════════════════════════════════════════════════════════════════
   GLYPHICONS (ikon fontu) — Bootstrap Halflings
   Kullanım: <span class="glyphicon glyphicon-play"></span>
   ══════════════════════════════════════════════════════════════════════ */
.glyphicon {
  position: relative; top: 1px; display: inline-block;
  font-family: "Glyphicons Halflings";
  font-style: normal; font-weight: 400; line-height: 1;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
.glyphicon-play::before { content: "\e072"; }
.glyphicon-pause::before { content: "\e073"; }
.glyphicon-stop::before { content: "\e074"; }
.glyphicon-step-forward::before { content: "\e076"; }
.glyphicon-step-backward::before { content: "\e070"; }
.glyphicon-forward::before { content: "\e075"; }
.glyphicon-backward::before { content: "\e071"; }
.glyphicon-repeat::before { content: "\e031"; }
.glyphicon-refresh::before { content: "\e031"; }
.glyphicon-volume-up::before { content: "\e036"; }
.glyphicon-volume-off::before { content: "\e035"; }
.glyphicon-chevron-left::before { content: "\e079"; }
.glyphicon-chevron-right::before { content: "\e080"; }
.glyphicon-chevron-down::before { content: "\e114"; }
.glyphicon-chevron-up::before { content: "\e113"; }
.glyphicon-menu-hamburger::before { content: "\e236"; }
.glyphicon-book::before { content: "\e043"; }
.glyphicon-home::before { content: "\e021"; }
.glyphicon-arrow-right::before { content: "\e092"; }
.glyphicon-arrow-left::before { content: "\e091"; }
.glyphicon-print::before { content: "\e045"; }
.glyphicon-info-sign::before { content: "\e086"; }

/* Player içindeki glyphicon boyutları */
.pp-btn .glyphicon { font-size: 15px; }
.pp-main .glyphicon { font-size: 18px; }
.pp-btn .ic-play { position: relative; left: 1px; }
