/* Girişsiz (public) SEO deneme testi sayfaları — bkz. scripts/build-public-tests.mjs.
   Uygulamanın 240 KB'lık styles.css'ini yüklememek için bağımsızdır; yalnızca soru kartı ve
   renderVisual() çıktılarının (grafik, tablo, harita) ihtiyaç duyduğu token ve kuralları içerir.
   Soru/şık/görsel kuralları css/styles.css "Question card" ve "SVG chart helpers" bölümleriyle
   aynı görünümü korur. */
:root {
  color-scheme: light;
  --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-serif: 'Source Serif 4', Georgia, "Times New Roman", serif;
  --radius-sm: 10px; --radius-md: 16px;
  /* Aydınlık = uygulamanın sage-light paleti (bkz. css/styles.css :root[data-theme="sage-light"]). */
  --bg: #f4f2ea; --surface: #fffdfa; --surface-2: #e8ede5; --surface-3: #dce5d9;
  --border: #cfd7cc; --text: #24352f; --text-dim: #53635d; --text-faint: #5c6b64;
  --accent: #385e52; --accent-hover: #173f36; --accent-text: #ffffff;
  --ok: #3f7d58; --bad: #a84f4f; --warn: #b7791f; --cyan: #2f8a9b; --paper-0: #fffdf8;
  --gold: #c58a35; --header-bg: #fffdfa; --header-text: #24352f; --kicker: #385e52;
  --btn-bg: #385e52; --btn-hover: #173f36; --btn-text: #ffffff;
  --subj-verbal: #4f78a8; --subj-quant: #4f8263; --subj-history: #a55c5c;
  --subj-geo: #438c89; --subj-citizenship: #7667a8; --subj-current: #8b6f3e;
}
/* Karanlık tema yalnızca kullanıcı uygulamada açıkça seçtiyse (js/publicTest.js data-theme'i
   atar); işletim sistemi tercihi tek başına sayfayı karartmaz. */
/* "Mat Adaçayı · Derin" (bkz. css/styles.css): düz yüzeyler, kırık beyaz metin, mat vurgu. */
:root[data-theme="dark"] {
  color-scheme: dark;
  /* 19 Ekim: uygulamanın yeni karanlık paletiyle aynı (bkz. css/darkTheme.css). */
  --bg: #0d1210; --surface: #171e1a; --surface-2: #121815; --surface-3: #202924;
  --border: #26302b; --text: #e8eee9; --text-dim: #b5c1b9; --text-faint: #8d9a92;
  --accent: #9cc9ad; --accent-hover: #b1d6bf; --accent-text: #0d1210;
  --ok: #86c99c; --bad: #ec968b; --warn: #e2b86f; --cyan: #9cc4c0; --paper-0: #0d1210;
  --gold: #e2b86f; --header-bg: #0b0f0d; --header-text: #e8eee9; --kicker: #9cc9ad;
  --btn-bg: #9cc9ad; --btn-hover: #b1d6bf; --btn-text: #0d1210;
}
:root[data-theme="dark"] .pt-header { border-bottom: 1px solid var(--border); }
:root[data-theme="dark"] .pt-result { background: #171e1a; border: 1px solid var(--border); color: var(--text); }
:root[data-theme="dark"] .pt-result p { color: var(--text-dim); }
:root[data-theme="dark"] .pt-result .pt-btn { background: var(--btn-bg); color: var(--btn-text); }
:root[data-theme="dark"] .pt-result .pt-kicker { color: var(--kicker); }
:root[data-theme="dark"] .pt-progress { background: var(--surface); backdrop-filter: none; }
:root[data-theme="dark"] .pt-chip:not(.pt-chip--plain) { background: color-mix(in srgb, var(--chip) 55%, #0d1210); color: #e6e9e4; }
* { box-sizing: border-box; }
html { scroll-padding-top: 72px; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: var(--font-sans); line-height: 1.5; -webkit-text-size-adjust: 100%; }
a { color: var(--accent); }
:is(a, button, summary):focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 3px; }

/* Header */
.pt-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 68px; padding: 10px clamp(16px, 4vw, 48px); background: var(--header-bg); border-bottom: 1px solid var(--border); }
.pt-logo img { display: block; width: 150px; height: auto; }
/* Logo zemin rengine göre: aydınlıkta koyu yazılı, karanlıkta açık yazılı sürüm. */
.pt-logo .logo-on-dark, :root[data-theme="dark"] .pt-logo .logo-on-light { display: none; }
:root[data-theme="dark"] .pt-logo .logo-on-dark { display: block; }
.pt-header-nav { display: flex; align-items: center; gap: 14px; }
.pt-header-nav > a:not(.pt-btn) { color: var(--header-text); text-decoration: none; font-weight: 700; font-size: 14px; }
.pt-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 22px; border-radius: 999px; background: var(--btn-bg); color: var(--btn-text); font-weight: 800; text-decoration: none; text-align: center; }
.pt-btn:hover { background: var(--btn-hover); }
.pt-btn--small { min-height: 40px; padding: 8px 16px; font-size: 14px; white-space: nowrap; }

/* Layout */
.pt-shell { width: min(760px, calc(100% - 32px)); margin: 0 auto; padding: 20px 0 64px; }
.pt-crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--text-faint); }
.pt-crumbs a { color: var(--text-dim); }
.pt-hero { padding: 28px 0 8px; }
.pt-kicker { margin: 0; color: var(--kicker); font-weight: 800; font-size: 12px; letter-spacing: .12em; }
h1 { margin: 8px 0 12px; font-size: clamp(30px, 5vw, 44px); line-height: 1.1; letter-spacing: -.02em; }
h2 { font-size: 22px; line-height: 1.25; margin: 0 0 10px; }
.pt-lead { margin: 0; font-size: 17px; color: var(--text-dim); max-width: 62ch; }
.pt-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.pt-facts li { padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 14px; color: var(--text-dim); }

/* Progress */
.pt-progress { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; margin: 20px 0 0; padding: 10px 14px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--border); backdrop-filter: blur(8px); font-size: 14px; font-weight: 700; }
.pt-progress[hidden] { display: none; }
.pt-progress-bar { flex: 1; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.pt-progress-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s ease; }

/* Question card */
.pt-questions { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 18px; }
.pt-q { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: clamp(16px, 4vw, 24px); min-width: 0; }
.pt-q-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.pt-q-num { font-weight: 800; font-size: 14px; margin-right: 4px; }
/* Ders rengi beyaz yazıyla AA kontrastı (≥4.5:1) için bir tık koyulaştırılır. */
.pt-chip { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff; background: color-mix(in srgb, var(--chip, var(--accent)) 82%, #000); }
.pt-chip--plain { background: var(--surface-2); color: var(--text-dim); font-weight: 600; }
.q-text { font-family: var(--font-serif); font-size: 17px; line-height: 1.6; margin: 4px 0 16px; white-space: pre-wrap; }
.q-passage { background: var(--surface-2); border-left: 3px solid var(--accent); padding: 12px 14px; border-radius: var(--radius-sm); font-family: var(--font-serif); font-size: 15.5px; line-height: 1.65; margin-bottom: 14px; color: var(--text-dim); white-space: pre-wrap; }
.q-visual { background: var(--surface-2); border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 14px; margin-bottom: 14px; font-size: 13px; color: var(--text-dim); overflow-x: auto; max-width: 100%; min-width: 0; }
.q-visual table { max-width: 100%; }
.q-visual th, .q-visual td { overflow-wrap: anywhere; line-height: 1.45; vertical-align: top; }
.flex { display: flex; } .center { align-items: center; } .gap-8 { gap: 8px; }
.option-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.option { width: 100%; display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: var(--radius-md); border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; text-align: left; font: inherit; font-size: 15px; line-height: 1.45; color: var(--text); min-height: 48px; transition: border-color .12s ease, background-color .12s ease; }
.option:hover:not(:disabled) { border-color: var(--text-faint); }
.option:disabled { cursor: default; }
.option .opt-letter { width: 27px; height: 27px; border-radius: 50%; flex: 0 0 27px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; border: 1px solid var(--border); }
.option.correct { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, var(--surface)); }
.option.correct .opt-letter { background: var(--ok); color: var(--paper-0); border-color: transparent; }
.option.correct::after { content: "✓"; margin-left: auto; color: var(--ok); font-weight: 800; }
.option.incorrect { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, var(--surface)); }
.option.incorrect .opt-letter { background: var(--bad); color: var(--paper-0); border-color: transparent; }
.option.incorrect::after { content: "✕"; margin-left: auto; color: var(--bad); font-weight: 800; }

/* Answer */
.pt-answer { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.pt-answer summary { cursor: pointer; font-weight: 700; color: var(--accent); min-height: 32px; display: flex; align-items: center; }
.pt-answer-key { margin: 10px 0 6px; }
.pt-explain { margin: 0 0 8px; color: var(--text-dim); }
.pt-wrongs-title { margin: 12px 0 4px; font-weight: 700; font-size: 14px; }
.pt-wrongs ul { margin: 0; padding-left: 18px; color: var(--text-dim); font-size: 14px; display: grid; gap: 4px; }
.pt-wrongs li.is-picked { color: var(--bad); }

/* Result — aydınlıkta landing kapanış bandı gibi adaçayı blok; karanlık kurallar üstte. */
.pt-result { margin-top: 24px; padding: clamp(20px, 5vw, 32px); border-radius: var(--radius-md); background: #385e52; color: #ffffff; text-align: center; }
.pt-result[hidden] { display: none; }
.pt-result h2 { font-size: clamp(26px, 5vw, 34px); margin: 8px 0; }
.pt-result p { color: #dfe8e2; }
.pt-result .pt-kicker { color: #dfe8e2; }
.pt-result .pt-btn { margin-top: 8px; background: #fffdfa; color: #173f36; }
.pt-result .pt-btn:hover { background: #f2eadb; }
.pt-result-note { font-size: 13px; margin: 14px auto 0; max-width: 48ch; }
.pt-retake { min-height: 44px; margin-top: 4px; padding: 8px 14px; border: 0; border-bottom: 1px solid currentColor; background: none; color: inherit; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.pt-retake:hover { opacity: .85; }

/* About + more */
.pt-about, .pt-more { margin-top: 40px; }
.pt-about p { color: var(--text-dim); }
/* Diğer testler: başlık üstte, soru sayısı altta; bütün kutular aynı yükseklikte (grid-auto-rows). */
.pt-more-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); grid-auto-rows: 1fr; gap: 12px; }
.pt-more-list li { display: flex; }
.pt-more-list a { flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-height: 92px; padding: 16px 18px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 16px; font-weight: 700; line-height: 1.3; text-decoration: none; transition: border-color .15s ease; }
.pt-more-list a:hover { border-color: var(--accent); }
.pt-more-list span { font-size: 12.5px; font-weight: 600; color: var(--text-faint); }
.pt-footer { padding: 24px 16px 40px; text-align: center; font-size: 13px; color: var(--text-faint); }
.pt-footer a { color: var(--text-dim); }

/* Grafik ve harita yardımcıları (renderVisual çıktısı) */
.chart-wrap { width: 100%; max-width: 100%; min-width: 0; overflow: visible; }
.chart-wrap svg { width: 100%; max-width: 100%; height: auto; display: block; overflow: visible; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; font-size: 11.5px; }
.legend-item { display: flex; align-items: center; gap: 5px; color: var(--text-dim); }
.tr-map-chart { max-width: 340px; width: 100%; margin: 0 auto; min-width: 0; }
.tr-map { width: 100%; max-width: 100%; height: auto; display: block; overflow: visible; }
.tr-map-wrap { text-align: center; max-width: 100%; }
.map-caption { margin-top: 8px; font-size: 12.5px; font-weight: 700; color: var(--text); display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.map-caption-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.map-footnote { margin-top: 4px; font-size: 11px; color: var(--text-faint); }

@media (max-width: 520px) {
  .pt-header-nav > a:not(.pt-btn) { display: none; }
  .pt-logo img { width: 112px; }
  .pt-header-nav { gap: 10px; }
  .pt-btn--small { padding: 8px 13px; font-size: 13px; }
  .q-text { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Türkiye haritası: kara ve sınırlar görsel zemininden (surface-2) her temada net ayrılsın diye
   metin rengiyle karıştırılarak türetilir; vurgulu bölge (--bad) bu kara rengine karşı ≥3:1 kalır. */
.tr-map-wrap {
  --surface-3: color-mix(in srgb, var(--text) 11%, var(--surface-2));
  --border: color-mix(in srgb, var(--text) 55%, var(--surface-2));
}
