/* TBMM Milletvekilleri Hatıratları — site stili. Harici yazı tipi ya da kütüphane kullanmaz. */

:root {
  --paper: #f6f2ea;
  --paper-2: #efe8dc;
  --surface: #fffdf9;
  --ink: #1f1b18;
  --muted: #625b53;
  --line: #e2d8c8;
  --line-strong: #cdbfa8;
  --accent: #7b1e2b;
  --accent-deep: #5c1520;
  --accent-soft: #f4e4e2;
  --gold: #9a7a2f;
  --focus: #1f5fd1;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(60 40 20 / 6%), 0 10px 30px rgb(60 40 20 / 8%);
  --shadow-sheet: 0 2px 4px rgb(40 25 10 / 10%), 0 18px 40px rgb(40 25 10 / 16%);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--paper); color: var(--ink); font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; outline: none; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-deep); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: 78rem; margin-inline: auto; padding-inline: max(1rem, env(safe-area-inset-left)); }
@media (min-width: 48rem) { .wrap { padding-inline: 2rem; } }

.skip { position: absolute; left: 1rem; top: -5rem; z-index: 100; padding: .6rem 1rem; background: var(--ink); color: #fff; border-radius: var(--radius-sm); }
.skip:focus { top: 1rem; color: #fff; }

.eyebrow { margin-bottom: .6rem; font-size: .76rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }

/* ---------- Butonlar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 3rem; padding: .7rem 1.35rem; border-radius: 999px; border: 1px solid transparent;
  font-weight: 650; text-decoration: none; cursor: pointer; transition: background-color .15s, border-color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); color: #fff; }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-small { min-height: 2.5rem; padding: .4rem 1rem; font-size: .9rem; }

/* ---------- Üst bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgb(246 242 234 / 92%);
  -webkit-backdrop-filter: saturate(1.3) blur(10px); backdrop-filter: saturate(1.3) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }
.brand { display: flex; align-items: center; gap: .7rem; min-width: 0; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-seal { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; flex: none; border-radius: 50%; background: var(--accent); color: #fff; }
.brand-seal svg { width: 1.3rem; height: 1.3rem; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.brand-kicker { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.brand-title { font-family: var(--serif); font-weight: 700; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topnav { display: flex; gap: .25rem; }
.topnav a { white-space: nowrap; padding: .55rem .8rem; border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 550; font-size: .93rem; }
.topnav a:hover { background: var(--paper-2); color: var(--accent); }
.topnav-home { display: none; }
@media (max-width: 40rem) {
  .topnav a:first-child { display: none; }
  .brand-title { font-size: .92rem; }
}
@media (min-width: 56rem) { .topnav-home { display: inline-block; } .brand-title { font-size: 1.1rem; } }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); background:
  radial-gradient(60rem 30rem at 85% -10%, rgb(123 30 43 / 9%), transparent 60%),
  linear-gradient(var(--paper), var(--paper-2)); }
.hero-in { display: grid; gap: 2.5rem; padding-block: 2.5rem 3rem; align-items: center; }
.hero-title { font-family: var(--serif); font-weight: 700; letter-spacing: -.015em; line-height: 1.08; font-size: clamp(2.1rem, 1.3rem + 4vw, 4rem); }
.hero-title span { color: var(--accent); }
.hero-lead { margin-top: 1.1rem; max-width: 38rem; font-size: clamp(1.02rem, .95rem + .35vw, 1.2rem); color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.6rem; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin-top: 2rem; max-width: 34rem; }
.stats div { padding: .75rem .5rem; text-align: center; background: rgb(255 253 249 / 70%); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.stats dt { font-size: .72rem; color: var(--muted); }
.stats dd { font-family: var(--serif); font-weight: 700; font-size: clamp(1.3rem, 1rem + 1.2vw, 1.9rem); color: var(--accent); font-variant-numeric: tabular-nums; }

.hero-art { position: relative; height: 18rem; max-width: 30rem; margin-inline: auto; width: 100%; }
.hero-sheet { position: absolute; width: 46%; top: 50%; left: 50%; background: #fff; padding: .35rem; border-radius: 4px; box-shadow: var(--shadow-sheet); }
.hero-sheet img { border-radius: 2px; }
.hero-sheet--1 { transform: translate(-112%, -46%) rotate(-7deg); }
.hero-sheet--2 { transform: translate(-50%, -54%) rotate(1deg); z-index: 2; width: 50%; }
.hero-sheet--3 { transform: translate(12%, -44%) rotate(6deg); }
@media (min-width: 56rem) {
  .hero-in { grid-template-columns: 1.1fr .9fr; padding-block: 4rem 4.5rem; }
  .hero-art { height: 28rem; }
}

/* ---------- Mektup listesi ---------- */
.letters { padding-block: 3rem 4rem; }
.section-head { display: grid; gap: .75rem; margin-bottom: 1.5rem; }
.section-title { font-family: var(--serif); font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.3rem); line-height: 1.15; }
.section-note { color: var(--muted); max-width: 40rem; }
@media (min-width: 56rem) { .section-head { grid-template-columns: 1fr 1fr; align-items: end; } }

.toolbar {
  position: sticky; top: 4rem; z-index: 30;
  display: grid; gap: .6rem; padding: .75rem; margin-inline: -.25rem;
  background: rgb(246 242 234 / 95%); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: var(--radius);
}
@media (min-width: 48rem) { .toolbar { grid-template-columns: 1fr 13rem auto; align-items: center; } }
.field { display: flex; align-items: center; gap: .5rem; min-height: 2.9rem; padding-inline: .9rem; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px; }
.field:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px rgb(31 95 209 / 18%); }
.field svg { width: 1.15rem; height: 1.15rem; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.field input, .field select { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; padding: .5rem 0; }
.field select { cursor: pointer; }
.segmented { display: flex; padding: .2rem; background: var(--paper-2); border-radius: 999px; }
.segmented button { flex: 1; min-height: 2.5rem; padding: .3rem .9rem; border: 0; border-radius: 999px; background: transparent; font-weight: 600; font-size: .9rem; cursor: pointer; white-space: nowrap; color: var(--muted); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--accent); box-shadow: 0 1px 3px rgb(0 0 0 / 12%); }
.result { min-height: 1.5rem; margin: .9rem 0 .2rem; font-size: .92rem; color: var(--muted); }

.group { margin-top: 2rem; }
.group-title { display: flex; align-items: center; gap: .6rem; margin-bottom: .9rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line); font-family: var(--serif); font-size: 1.35rem; scroll-margin-top: 10rem; }
.group-count { display: inline-grid; place-items: center; min-width: 1.7rem; height: 1.7rem; padding-inline: .45rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font: 700 .8rem/1 var(--sans); }

.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
@media (min-width: 40rem) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; } }
@media (min-width: 64rem) { .cards { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.card-link { display: flex; flex-direction: column; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--ink); text-decoration: none; transition: transform .18s, box-shadow .18s, border-color .18s; }
.card-link:hover { color: var(--ink); transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.card-thumb { position: relative; display: block; aspect-ratio: 3 / 3.2; overflow: hidden; background: var(--paper-2); border-bottom: 1px solid var(--line); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .35s; }
.card-link:hover .card-thumb img { transform: scale(1.04); }
.card-kind { position: absolute; left: .5rem; bottom: .5rem; padding: .15rem .55rem; border-radius: 999px; background: rgb(31 27 24 / 78%); color: #fff; font-size: .7rem; font-weight: 600; }
.card-body { display: flex; flex-direction: column; gap: .15rem; padding: .75rem .8rem .9rem; flex: 1; }
.card-place { font-size: .72rem; font-weight: 600; letter-spacing: .03em; color: var(--gold); text-transform: uppercase; }
.card-name { font-family: var(--serif); font-weight: 700; font-size: 1.05rem; line-height: 1.25; }
.card--unknown .card-name { font-style: italic; font-weight: 600; color: var(--muted); }
.card-role { font-size: .78rem; color: var(--muted); line-height: 1.35; }
.card-meta { display: flex; flex-wrap: wrap; gap: .1rem .5rem; margin-top: auto; padding-top: .4rem; font-size: .76rem; color: var(--muted); }
.empty { padding: 2.5rem 1rem; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); margin-top: 1.5rem; }

/* ---------- Mektup sayfası ---------- */
.page-letter main, .page-reader main, .page-404 main { padding-block: 1.25rem 3.5rem; }
.crumbs { margin-bottom: 1.25rem; font-size: .88rem; color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: .2rem; }
.crumbs li + li::before { content: "›"; margin-inline: .4rem; color: var(--line-strong); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; }

.letter-head { margin-bottom: 1.75rem; }
.letter-title { font-family: var(--serif); font-weight: 700; letter-spacing: -.01em; line-height: 1.1; font-size: clamp(2rem, 1.4rem + 2.8vw, 3.3rem); }
.letter-role { margin-top: .5rem; font-size: 1.05rem; color: var(--muted); }
.letter-count { color: var(--muted); font-weight: 600; letter-spacing: 0; }

.letter-layout { display: grid; gap: 2rem; }
@media (min-width: 64rem) { .letter-layout { grid-template-columns: minmax(0, 40rem) minmax(0, 1fr); gap: 3rem; align-items: start; } .letter-side { position: sticky; top: 5.5rem; max-height: calc(100vh - 7rem); overflow: auto; padding-right: .25rem; } }

.sheets { display: grid; gap: 1.5rem; }
.sheet { margin: 0; }
.sheet-zoom { position: relative; display: block; width: 100%; padding: .45rem; border: 0; background: #fff; border-radius: 6px; box-shadow: var(--shadow-sheet); cursor: zoom-in; }
.sheet-zoom img { border-radius: 3px; }
.sheet-hint { position: absolute; right: 1rem; bottom: 1rem; display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .75rem; border-radius: 999px; background: rgb(31 27 24 / 80%); color: #fff; font-size: .8rem; font-weight: 600; }
.sheet-hint svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.sheet figcaption { margin-top: .55rem; text-align: center; font-size: .82rem; color: var(--muted); }
.copies { font-size: .88rem; color: var(--muted); padding: .75rem 1rem; background: var(--paper-2); border-radius: var(--radius-sm); }

.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); }
.facts div { padding: .75rem .9rem; background: var(--surface); }
.facts dt { font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.facts dd { font-weight: 600; line-height: 1.35; }

.transcript { margin-top: 1.5rem; }
.side-title { font-family: var(--serif); font-size: 1.35rem; margin-bottom: .75rem; }
.prose { padding: 1.25rem 1.3rem; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius-sm); font-family: var(--serif); font-size: 1.08rem; line-height: 1.75; overflow-wrap: anywhere; }
.prose p + p { margin-top: .85em; }
.transcript-note { margin-top: .6rem; font-size: .8rem; color: var(--muted); }
.transcript--hand p { color: var(--muted); padding: 1rem 1.2rem; background: var(--paper-2); border-radius: var(--radius-sm); }

.pager { display: grid; gap: .75rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
@media (min-width: 40rem) { .pager { grid-template-columns: 1fr 1fr; } }
.pager-link { display: flex; flex-direction: column; gap: .15rem; padding: 1rem 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.pager-link:hover { border-color: var(--accent); color: var(--ink); }
.pager-next { text-align: right; }
.pager-dir { font-size: .8rem; color: var(--gold); font-weight: 600; }
.pager-name { font-family: var(--serif); font-size: 1.15rem; font-weight: 700; }

/* ---------- Görüntüleyici ---------- */
.viewer { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #16110e; color: #fff; }
.viewer[open] { display: flex; flex-direction: column; }
.viewer::backdrop { background: rgb(0 0 0 / 85%); }
.viewer-bar { display: flex; align-items: center; gap: .5rem; padding: .6rem max(.75rem, env(safe-area-inset-right)) .6rem max(1rem, env(safe-area-inset-left)); background: #221a16; }
.viewer-title { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-btn { min-height: 2.6rem; padding: .3rem .95rem; border: 1px solid rgb(255 255 255 / 25%); border-radius: 999px; background: transparent; color: #fff; cursor: pointer; font-weight: 600; }
.viewer-btn:hover, .viewer-btn[aria-pressed="true"] { background: rgb(255 255 255 / 14%); }
.viewer-close { width: 2.6rem; padding: 0; font-size: 1.1rem; }
.viewer-stage { flex: 1; overflow: auto; display: grid; place-items: center; touch-action: pan-x pan-y pinch-zoom; }
.viewer-stage img { max-width: 100%; max-height: calc(100dvh - 3.8rem); width: auto; height: auto; background: #fff; }
.viewer-stage.is-actual { place-items: start center; }
.viewer-stage.is-actual img { max-width: none; max-height: none; }

/* ---------- Defteri oku ---------- */
.reader-head { margin-bottom: 1.25rem; }
.reader-head .section-note { margin-top: .6rem; }
.reader-bar { position: sticky; top: 4rem; z-index: 30; background: rgb(246 242 234 / 95%); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-block: 1px solid var(--line); }
.reader-bar-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; min-height: 3.6rem; }
.jump { display: flex; align-items: center; gap: .5rem; }
.jump label { font-weight: 600; }
.jump input { width: 5rem; min-height: 2.5rem; padding: .3rem .6rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); text-align: center; font-variant-numeric: tabular-nums; }
.jump span { color: var(--muted); }
.reader-letter { font-size: .9rem; }
.reader { display: grid; gap: 2rem; max-width: 48rem; margin: 2rem auto 0; padding-inline: max(.75rem, env(safe-area-inset-left)); }
.reader-page { scroll-margin-top: 8.5rem; }
.reader-page img { width: 100%; background: #fff; padding: .4rem; border-radius: 6px; box-shadow: var(--shadow-sheet); }
.reader-page figcaption { display: flex; align-items: center; justify-content: center; gap: .6rem; margin-top: .7rem; font-size: .9rem; }
.reader-num { display: inline-grid; place-items: center; min-width: 2rem; height: 2rem; padding-inline: .4rem; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 700; font-size: .8rem; }

.notfound { padding-block: 3rem; max-width: 42rem; }
.notfound .section-note { margin-top: .8rem; }

/* ---------- Alt bilgi ---------- */
.footer { margin-top: auto; background: #211a17; color: #d9d0c6; }
.footer-in { display: grid; gap: 1.5rem; padding-block: 2.5rem 1.5rem; }
@media (min-width: 48rem) { .footer-in { grid-template-columns: 1.4fr 1fr; } }
.footer-title { font-family: var(--serif); font-size: 1.25rem; font-weight: 700; color: #fff; }
.footer-text { margin-top: .4rem; font-size: .9rem; max-width: 34rem; color: #b9aea3; }
.footer-nav { display: flex; flex-direction: column; gap: .35rem; }
.footer-nav a { color: #e8ded3; text-decoration: none; padding-block: .2rem; }
.footer-nav a:hover { color: #fff; text-decoration: underline; }
.footer-bottom { padding-block: 1rem calc(1rem + env(safe-area-inset-bottom)); border-top: 1px solid rgb(255 255 255 / 10%); font-size: .82rem; color: #9d9187; }

.totop { position: fixed; z-index: 35; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); display: grid; place-items: center; width: 3rem; height: 3rem; border: 0; border-radius: 50%; background: var(--accent); color: #fff; box-shadow: var(--shadow); cursor: pointer; }
.totop svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

@media print {
  .topbar, .toolbar, .footer, .totop, .pager, .reader-bar, .sheet-hint, .hero-actions { display: none !important; }
  body { background: #fff; }
  .sheet-zoom, .reader-page img { box-shadow: none; }
}
