/* soru-cemberi.css — /soru-cemberi sayfası
 * Motor: js/soru-cemberi.js. Renkler tema token'larından (6 temada çalışır).
 * Ders renkleri: Tarih = --accent-amber, Coğrafya = --accent-green (ana sayfa etiketleriyle aynı).
 */

/* Yakın planda sayfa kilitlenince kaydırma çubuğu kaybolup içerik yana zıplamasın */
html.sc-page { scrollbar-gutter: stable; }

/* ⚠ styles.css'teki sayfa girişi (so-page-in) main'e `animation-fill-mode: both` ile
   transform BIRAKIR. Transform'lu ata, position:fixed öğelerin referansını ekrandan
   main'e çevirir → tam ekran katman header'ın altında ve kaymış açılıyordu.
   Opaklık animasyonu da (fill: both) main'i ayrı bir istifleme bağlamı yapar ve katman
   yine header'ın altında kalır → bu sayfada giriş animasyonu kapalı. */
html.sc-page main { animation: none; }
html.sc-preview, html.sc-preview body { overflow: hidden; }

[data-ders="tarih"] { --sc-ders: var(--accent-amber); }
[data-ders="cografya"] { --sc-ders: var(--accent-green); }

/* =========================================================================
 * SAHNE
 * ========================================================================= */
/* Zemin: çemberin arkasında yumuşak birincil renk ışığı + noktalı defter dokusu
   (kartlar defter sayfası; doku kenarlara doğru söner). Yakın planda aynı zemin
   .sc-stage::before ile tüm ekrana yayılır. */
.sc-stage-wrap {
  position: relative;
  height: calc(100svh - 69px);       /* navbar 68px + 1px çizgi */
  min-height: 560px;
  max-height: 980px;
  background:
    radial-gradient(ellipse 46% 52% at 50% 54%, var(--primary-soft) 0%, transparent 72%),
    linear-gradient(180deg, var(--color-surface-2) 0%, var(--color-background) 85%);
  border-bottom: 1px solid var(--color-border);
}
.sc-stage-wrap::before,
.sc-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(var(--color-border) 1.2px, transparent 1.3px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 70% 65% at 50% 52%, #000 30%, transparent 78%);
  mask-image: radial-gradient(ellipse 70% 65% at 50% 52%, #000 30%, transparent 78%);
}
.sc-stage::before { content: none; }

.sc-stage {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  touch-action: pan-y;               /* dikey = sayfa kayar, yatay = çember döner */
}

/* Yakın plan: tam ekran katman */
html.sc-preview .sc-stage {
  position: fixed;
  inset: 0;
  z-index: 300;
  touch-action: none;
}
/* Yakın plan zemini: düz renk + aynı ışık/doku, yumuşakça belirir */
html.sc-preview .sc-stage::before {
  content: "";
  z-index: 0;
  background:
    radial-gradient(ellipse 50% 55% at 50% 45%, var(--primary-soft) 0%, transparent 75%),
    var(--color-background);
  -webkit-mask-image: none;
  mask-image: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}
html.sc-dim .sc-stage::before { opacity: 1; }
html.sc-preview .sc-ring-area { position: fixed; inset: 0; }
html.sc-preview .sc-top,
html.sc-preview .sc-bottom { opacity: 0; pointer-events: none; }

/* ---------- Üst şerit: başlık + filtre ---------- */
.sc-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 24px 0;
  transition: opacity 0.35s ease;
}
.sc-kicker {
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-600);
}
.sc-intro h1 {
  margin: 0;
  font-size: clamp(1.15rem, 2.4vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--color-text);
}
.sc-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.sc-filter {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}
.sc-filter button,
.sc-shuffle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sc-filter button { padding: 9px 15px; transition: background 0.2s ease, color 0.2s ease; }
.sc-filter button:hover { background: var(--color-surface-2); }
.sc-filter button[aria-pressed="true"] { background: var(--primary-500); color: var(--on-primary); }
.sc-filter i,
.sc-eyebrow i,
.sc-group-title i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  background: var(--sc-ders, var(--color-text-muted));
}
.sc-filter button[aria-pressed="true"] i { box-shadow: 0 0 0 2px var(--on-primary); }

.sc-shuffle {
  padding: 9px 16px 9px 13px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease;
}
.sc-shuffle:hover { border-color: var(--primary-500); }
.sc-shuffle svg { width: 16px; height: 16px; display: block; transition: transform 0.3s ease; }
.sc-shuffle:active svg { transform: rotate(180deg); }
.sc-filter button:focus-visible,
.sc-shuffle:focus-visible,
.sc-scroll:focus-visible { outline: 2px solid var(--primary-500); outline-offset: 2px; }

/* ---------- Halka alanı ---------- */
.sc-ring-area {
  position: relative;
  flex: 1;
  min-height: 0;
}
.sc-ring-container {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  transform-style: preserve-3d;
  perspective: 2000px;
  will-change: transform;
}
.sc-ring {
  position: relative;
  width: 600px;
  height: 600px;
  flex: none;
  display: flex;
  justify-content: center;
  align-items: center;
  transform-origin: center;
  transform-style: preserve-3d;
  will-change: transform;
}

/* Kılavuz halka: kartların dizildiği çizgi (r = 270 → çap 540). Halkayla birlikte
   döner; yakın planda 6-7× büyüyüp kalın çizgiye dönüşeceği için gizlenir. */
.sc-ring::before {
  content: "";
  position: absolute;
  width: 540px;
  height: 540px;
  border-radius: 50%;
  border: 1.5px dashed var(--color-border);
  transition: opacity 0.4s ease;
}
.sc-ring::after {
  content: "";
  position: absolute;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  opacity: 0.6;
  transition: opacity 0.4s ease;
}
.sc-stage:not(.sc-ready) .sc-ring::before,
.sc-stage:not(.sc-ready) .sc-ring::after,
html.sc-preview .sc-ring::before,
html.sc-preview .sc-ring::after { opacity: 0; }

/* Veri gelene kadar ince bir yükleniyor halkası */
.sc-stage:not(.sc-ready):not(.sc-error) .sc-ring-area::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 3px solid var(--color-border);
  border-top-color: var(--primary-500);
  border-radius: 50%;
  animation: sc-spin 0.8s linear infinite;
}
@keyframes sc-spin { to { transform: rotate(360deg); } }
.sc-error-msg {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: var(--color-text-muted);
}

/* ---------- Kart ----------
 * --hi = raster çarpanı: tarayıcı katmanı yerleşim boyutunda rasterize eder, üstteki
 * scale() o bitmap'i gerer. Açık karta --hi kat büyük kutu verilir, transform ölçeği
 * aynı oranda bölünür → görünen boyut aynı, raster gerçek boyutta. */
.sc-card {
  --hi: 1;
  position: absolute;
  width: calc(92px * var(--hi));     /* js/soru-cemberi.js CONFIG.cardW ile AYNI */
  height: calc(92px * var(--hi));    /* CONFIG.cardH ile AYNI (kare) */
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: calc(5px * var(--hi));
  transform-origin: center center;
  transform-style: preserve-3d;
  will-change: transform;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sc-card:focus-visible { outline: 2px solid var(--primary-500); outline-offset: 3px; }

.sc-face {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: calc(5px * var(--hi));
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: var(--color-surface-2);
  box-shadow: 0 calc(2px * var(--hi)) calc(10px * var(--hi)) rgba(0, 0, 0, 0.22);
}
.sc-face--back { transform: rotateY(180deg); }
.sc-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.sc-hero {
  --hi: 1;
  position: fixed;
  z-index: 302;
  transform-style: preserve-3d;
  pointer-events: none;              /* tıklama alttaki karta gider */
  will-change: transform;
}
.sc-hero[hidden] { display: none; }

/* ---------- Alt şerit ---------- */
.sc-bottom {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 16px 18px;
  transition: opacity 0.35s ease;
}
.sc-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  text-align: center;
}
.sc-hint b { color: var(--color-text); font-weight: 700; }
.sc-hint kbd {
  font-family: inherit;
  font-size: 0.72rem;
  border: 1px solid currentColor;
  border-radius: 3px;
  padding: 1px 5px;
}
.sc-pool { margin: 0; font-size: 0.75rem; color: var(--color-text-soft); }
.sc-scroll {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-600);
  text-decoration: none;
  border-radius: var(--radius-sm);
}
.sc-scroll svg { width: 18px; height: 18px; }
.sc-scroll:hover { text-decoration: underline; }

/* Fare/klavye ile dokunmatik ipucu metinleri */
.sc-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .sc-pointer { display: none; }
  .sc-touch { display: inline; }
}

/* ---------- Yakın plan arayüzü (fixed, yalnız html.sc-preview'da) ---------- */
.sc-hint--zoom {
  position: fixed;
  top: 2.4em;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
html.sc-preview .sc-hint--zoom { opacity: 1; transition-delay: 0.6s; }
html.sc-preview:not(.sc-dim) .sc-hint--zoom { opacity: 0; transition-delay: 0s; }

/* Dikey yerleşim (alttan): Cevabı gör → başlık → etiket → kart.
 * Yakın plan kartı JS'te reserveBottom (196px) üstüne oturur. */
.sc-eyebrow {
  position: fixed;
  left: 50%;
  bottom: 148px;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
html.sc-dim .sc-eyebrow { opacity: 1; transition-delay: 0.9s; }

.sc-title {
  position: fixed;
  bottom: 92px;
  left: 50%;
  transform: translateX(-50%);
  width: min(90vw, 760px);
  height: 46px;
  overflow: hidden;                  /* kelimeler alttan girer */
  z-index: 3;
  pointer-events: none;
}
.sc-title p {
  position: absolute;
  width: 100%;
  margin: 0;
  text-align: center;
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 46px;
  white-space: nowrap;
  color: var(--color-text);
}
.sc-word {
  position: relative;
  display: inline-block;
  will-change: transform;
  transform: translateY(125%);
}

.sc-flip {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px 11px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: border-color 0.2s ease;
}
/* ⚠ display:inline-flex, UA'nın [hidden]{display:none} kuralını ezer — bu satır şart */
.sc-flip[hidden] { display: none; }
.sc-flip:hover { border-color: var(--primary-500); }
.sc-flip:focus-visible { outline: 2px solid var(--primary-500); outline-offset: 3px; }
.sc-flip svg { width: 18px; height: 18px; display: block; }
.sc-flip[aria-pressed="true"] svg { transform: scaleX(-1); }

.sc-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* =========================================================================
 * TÜM SORULAR LİSTESİ
 * ========================================================================= */
.sc-list-section {
  padding: 56px 0 24px;
  background: var(--color-background);
  scroll-margin-top: 69px;
}
.sc-group { margin-top: 40px; }
.sc-group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--color-text);
}
.sc-group-title i { width: 10px; height: 10px; box-shadow: 0 0 0 4px var(--color-surface-2); }
.sc-group-title span { font-size: 0.82rem; font-weight: 600; color: var(--color-text-muted); }

.sc-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr));
  gap: 16px;
}
.sc-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--sc-ders, var(--primary-500));   /* ders rengi şeridi */
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 85px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.sc-item:hover { box-shadow: var(--shadow-md); }
.sc-item:target { border-color: var(--primary-500); box-shadow: var(--shadow-primary); }
.sc-item-thumb {
  flex: none;
  width: 112px;
  height: 112px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface-2);
  cursor: zoom-in;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.sc-item-thumb:hover { transform: translateY(-2px) rotate(-1.5deg); box-shadow: var(--shadow-md); }
.sc-item-thumb:focus-visible { outline: 2px solid var(--primary-500); outline-offset: 3px; }
.sc-item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.sc-item-body { min-width: 0; flex: 1; }
.sc-item-meta {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.sc-item-q {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--color-text);
}
.sc-options {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: grid;
  gap: 2px;
  font-size: 0.88rem;
  color: var(--color-text-soft);
}

.sc-answer summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--primary-soft);
  color: var(--primary-ink, var(--primary-700));
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.sc-answer summary::-webkit-details-marker { display: none; }
.sc-answer summary::after { content: "+"; font-size: 1rem; line-height: 1; }
.sc-answer[open] summary::after { content: "−"; }
.sc-answer summary:focus-visible { outline: 2px solid var(--primary-500); outline-offset: 2px; }
.sc-answer-key { margin: 12px 0 6px; font-size: 0.92rem; color: var(--color-text); }
.sc-answer-points,
.sc-mix {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--color-text-soft);
}
.sc-mix-title {
  margin: 10px 0 4px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-warning);
}

/* =========================================================================
 * DUYARLI
 * ========================================================================= */
@media (max-width: 860px) {
  .sc-top { flex-direction: column; align-items: flex-start; padding: 16px 16px 0; gap: 12px; }
  .sc-controls { width: 100%; justify-content: space-between; flex-wrap: nowrap; }
}
@media (max-width: 767px) {
  .sc-title { height: 34px; bottom: 120px; }
  .sc-title p { font-size: 1.5rem; line-height: 34px; }
  .sc-eyebrow { bottom: 162px; font-size: 0.7rem; }
  .sc-flip { bottom: 64px; font-size: 0.9rem; padding: 10px 18px 10px 14px; }
  .sc-hint--zoom { top: 1.6em; font-size: 0.75rem; }
  .sc-filter button { padding: 8px 12px; font-size: 0.82rem; }
  .sc-shuffle { padding: 8px 12px 8px 10px; font-size: 0.82rem; }
  .sc-list-section { padding-top: 40px; }
  .sc-item { padding: 12px; gap: 12px; }
  .sc-item-thumb { width: 84px; height: 84px; }
}
@media (max-width: 380px) {
  .sc-shuffle span { display: none; }        /* 320px: yalnız ikon */
  .sc-shuffle { padding: 8px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .sc-card, .sc-ring, .sc-ring-container { will-change: auto; }
  .sc-stage, .sc-top, .sc-bottom, .sc-hint--zoom, .sc-eyebrow { transition: none; }
  .sc-item-thumb, .sc-item-thumb:hover { transition: none; transform: none; }
}

/* =========================================================================
 * HAKKINDA + SSS
 * ========================================================================= */
.sc-about { padding: 24px 0 8px; }
.sc-about-inner {
  max-width: 820px;
  padding: 24px clamp(16px, 4vw, 32px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}
.sc-about h2 { margin: 0 0 8px; font-size: 1.15rem; font-weight: 800; color: var(--color-text); }
.sc-faq-item { border-bottom: 1px solid var(--color-border); }
.sc-faq-item:last-child { border-bottom: 0; }
.sc-faq-item summary {
  position: relative;
  padding: 14px 28px 14px 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  list-style: none;
}
.sc-faq-item summary::-webkit-details-marker { display: none; }
.sc-faq-item summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  color: var(--primary-600);
}
.sc-faq-item[open] summary::after { content: "−"; }
.sc-faq-item summary:focus-visible { outline: 2px solid var(--primary-500); outline-offset: 2px; }
.sc-faq-item p { margin: 0 0 14px; font-size: 0.9rem; line-height: 1.7; color: var(--color-text-soft); }
