/* nadiye.jemahmed.com — no external fonts or libraries.
   Palatino is the typeface of the author's own printed books. */
:root {
  --paper: #fbf7f0;
  --card: #fffdf9;
  --ink: #2b2521;
  --muted: #776b61;
  --line: #e7dccb;
  --rose: #a3304a;
  --rose-deep: #832338;
  --rose-soft: #f6e6e6;
  --sage: #64795a;
  --shadow: 0 1px 2px rgba(60, 40, 20, .08), 0 8px 24px rgba(60, 40, 20, .10);
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", "P052", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 38rem;
  --on-accent: #fff;
  --img-filter: none;
  color-scheme: light;
}
/* Dark theme: follows the system unless the visitor chose a theme with the header button
   (data-theme on <html>, set before first paint by the inline script in the page head). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1a1714;
    --card: #231f1b;
    --ink: #ebe3d7;
    --muted: #a3978a;
    --line: #3a332c;
    --rose: #e08a9b;
    --rose-deep: #f0a9b6;
    --rose-soft: #33222a;
    --sage: #9db38f;
  --on-accent: #1a1714;
  --img-filter: brightness(.92);
    --on-accent: #1a1714;
    --img-filter: brightness(.92);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1a1714;
  --card: #231f1b;
  --ink: #ebe3d7;
  --muted: #a3978a;
  --line: #3a332c;
  --rose: #e08a9b;
  --rose-deep: #f0a9b6;
  --rose-soft: #33222a;
  --sage: #9db38f;
  --on-accent: #1a1714;
  --img-filter: brightness(.92);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--rose); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--rose-deep); }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { font-weight: 400; line-height: 1.2; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -999px; top: 0; background: var(--card); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: .5rem; top: .5rem; }

/* ---------- header / footer ---------- */
.site-header {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem;
  max-width: 68rem; margin: 0 auto; padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--line);
}
.wordmark { font-size: 1.3rem; letter-spacing: .02em; color: var(--ink); text-decoration: none; margin-right: auto; }
.wordmark span { display: block; font-family: var(--sans); font-size: .68rem; letter-spacing: .18em; color: var(--muted); }
.site-header nav { display: flex; gap: 1.25rem; font-family: var(--sans); font-size: .9rem; }
.site-header nav a { color: var(--ink); text-decoration: none; padding: .25rem 0; border-bottom: 1px solid transparent; }
.site-header nav a:hover { border-color: var(--rose); }
.lang-switch { display: flex; font-family: var(--sans); font-size: .78rem; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang-switch a { padding: .3rem .7rem; color: var(--muted); text-decoration: none; }
.lang-switch a[aria-current] { background: var(--rose); color: var(--on-accent); }
.lang-switch a:not([aria-current]):hover { background: var(--rose-soft); color: var(--ink); }

main { max-width: 68rem; margin: 0 auto; padding: 0 1.25rem; min-height: 60vh; }
.site-footer { margin-top: 5rem; padding: 2.5rem 1.25rem 3rem; text-align: center; color: var(--muted); font-size: .92rem; border-top: 1px solid var(--line); }
.site-footer p { max-width: 40rem; margin: 0 auto .6em; }
.flourish { font-size: 1.6rem; color: var(--rose); margin-bottom: .4em !important; }
.small { font-family: var(--sans); font-size: .75rem; letter-spacing: .06em; }

/* ---------- shared bits ---------- */
.kicker { font-family: var(--sans); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin: 0 0 .5rem; }
.kicker a { color: inherit; text-decoration: none; }
.kicker a:hover { color: var(--rose); }
.gloss { color: var(--muted); font-style: italic; margin: .2rem 0 0; }
.lead { color: var(--muted); max-width: 44rem; }
.section { padding-top: 4rem; }
.section > h2, .book h2, .prose-page h2 { font-size: 1.6rem; margin-bottom: .6rem; }
.section > h2::after { content: ""; display: block; width: 2.5rem; height: 2px; background: var(--rose); margin-top: .7rem; }
.btn {
  display: inline-block; font-family: var(--sans); font-size: .9rem; text-decoration: none;
  background: var(--rose); color: var(--on-accent); padding: .65rem 1.2rem; border-radius: 4px; border: 1px solid var(--rose);
}
.btn:hover { background: var(--rose-deep); border-color: var(--rose-deep); color: var(--on-accent); }
.btn.ghost { background: transparent; color: var(--rose); }
.btn.ghost:hover { background: var(--rose-soft); color: var(--rose-deep); }
.btn .size { opacity: .75; font-size: .8em; }

/* ---------- home ---------- */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 3rem; align-items: center; padding: 4.5rem 0 1rem; }
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.4rem); letter-spacing: .01em; }
.name-alt { font-size: 1.35rem; color: var(--muted); margin: .2rem 0 1.2rem; }
.tagline { font-style: italic; color: var(--rose); margin-bottom: 1.4rem; }
.intro { max-width: 36rem; font-size: 1.12rem; }
.portrait { margin: 0; }
.portrait img { width: 13rem; border-radius: 50% 50% 4px 4px / 38% 38% 4px 4px; box-shadow: var(--shadow); border: 6px solid var(--card); filter: sepia(.18); }
.portrait.float { float: right; margin: 0 0 1.5rem 2rem; }
.portrait.float img { width: 11rem; border-radius: 4px; }

.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 2.5rem 2rem; margin-top: 2rem; }
.book-card { display: flex; flex-direction: column; gap: 1rem; }
.book-card h3 { font-size: 1.25rem; }
.book-card h3 a { color: var(--ink); text-decoration: none; }
.book-card h3 a:hover { color: var(--rose); }
.alt-title { color: var(--muted); margin: .15rem 0 0; }
.count { font-family: var(--sans); font-size: .78rem; color: var(--muted); margin: .5rem 0 0; }

.cover { display: block; aspect-ratio: 5 / 7; background: var(--card); box-shadow: var(--shadow); border-radius: 2px 5px 5px 2px; overflow: hidden; position: relative; transition: transform .25s ease, box-shadow .25s ease; }
.cover::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 6%; background: linear-gradient(90deg, rgba(0,0,0,.18), rgba(0,0,0,0) 70%, rgba(255,255,255,.12)); pointer-events: none; }
a.cover:hover { transform: translateY(-4px) rotate(-.6deg); }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover.large { width: min(17rem, 70vw); flex: none; }
.typo-cover { display: flex; flex-direction: column; justify-content: center; gap: .9em; height: 100%; padding: 12% 12% 12% 15%; text-align: center; color: #fdf6ea; container-type: inline-size; }
.tc-author { font-family: var(--sans); font-size: .62rem; letter-spacing: .24em; text-transform: uppercase; opacity: .85; }
.tc-title { font-size: 1.35rem; line-height: 1.15; }
.tc-title + .tc-title { font-size: 1.05rem; opacity: .9; padding-top: .8em; border-top: 1px solid rgba(255,255,255,.35); }
.tc-year { font-family: var(--sans); font-size: .6rem; letter-spacing: .2em; opacity: .75; margin-top: auto; }
.typo-cover .tc-author { margin-bottom: auto; }
.tc-en-kiymetli-anmalik { background: radial-gradient(120% 90% at 30% 15%, #7f9671, #4f6447 60%, #3c4d36); }
.tc-ates-kisin-cicegidir { background: radial-gradient(110% 80% at 50% 105%, #e39a3c 0%, #b8482d 38%, #5a1f24 78%, #3b1519); }
.cover.large .tc-title { font-size: 1.8rem; }
.cover.large .tc-title + .tc-title { font-size: 1.35rem; }

.words blockquote { margin: 1.2rem 0 1rem; padding: 0 0 0 1.5rem; border-left: 2px solid var(--rose); max-width: 46rem; font-size: 1.15rem; font-style: italic; }
.more { font-family: var(--sans); font-size: .9rem; text-decoration: none; }
.early-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 2rem; margin-top: 1.8rem; max-width: 44rem; }
.early-grid img { aspect-ratio: 5 / 7; object-fit: cover; width: 100%; box-shadow: var(--shadow); border-radius: 2px; margin-bottom: .9rem; }
.early-grid h3 { font-size: 1.05rem; }
.early-grid .gloss { font-size: .9rem; }

/* ---------- book page ---------- */
.book { padding-top: 3rem; }
.book-head { display: flex; gap: 3rem; align-items: flex-start; margin-bottom: 3rem; }
.book-head h1 { font-size: clamp(2rem, 5vw, 3rem); }
.book-head h1 span { display: block; }
.book-head h1 span + span { font-size: .72em; color: var(--muted); margin-top: .3rem; }
.subtitle { font-variant: small-caps; letter-spacing: .08em; margin: .4rem 0 0; }
.facts { margin: 1.4rem 0 1.8rem; font-family: var(--sans); font-size: .88rem; color: var(--muted); }
.facts li { padding: .35rem 0; border-bottom: 1px dotted var(--line); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 0; }
.book section, .book aside { max-width: 46rem; margin-bottom: 2.8rem; }
.dedication p { font-style: italic; font-size: 1.12rem; }
.handwriting { margin: 0 0 1.2rem; }
.handwriting img { max-width: 26rem; width: 100%; border: 1px solid var(--line); border-radius: 3px; background: #fff; }
.handwriting figcaption { font-family: var(--sans); font-size: .78rem; color: var(--muted); margin-top: .5rem; }
.toc { border-top: 1px solid var(--line); }
.toc a { display: grid; grid-template-columns: 2.4rem 1fr; gap: 0 .5rem; padding: .7rem .4rem; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.toc a:hover { background: var(--rose-soft); }
.toc .n { font-family: var(--sans); font-size: .78rem; color: var(--muted); padding-top: .25rem; grid-row: span 2; }
.toc .tt2 { grid-column: 2; color: var(--muted); font-size: .94rem; }
.extras li { margin-bottom: .4rem; }
.note { border: 1px solid var(--line); background: var(--card); border-radius: 4px; padding: 1.2rem 1.4rem; font-size: .95rem; color: var(--muted); }
.note h2 { font-family: var(--sans); font-size: .74rem !important; letter-spacing: .16em; text-transform: uppercase; margin-bottom: .6rem; }
.note p { margin: 0; }

/* ---------- reading ---------- */
.reading { max-width: var(--measure); margin: 0 auto; padding-top: 2.5rem; }
.crumbs { font-family: var(--sans); font-size: .85rem; margin-bottom: 2rem; }
.crumbs a { text-decoration: none; }
.text-lang { display: flex; align-items: center; gap: .4rem; font-family: var(--sans); font-size: .8rem; color: var(--muted); margin-bottom: 2rem; }
.text-lang button { font: inherit; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: .3rem .85rem; cursor: pointer; }
.text-lang button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.hint { font-family: var(--sans); font-size: .8rem; color: var(--muted); }
.text h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); text-align: center; margin: 1rem 0 .6rem; }
.text .meta { text-align: center; font-family: var(--sans); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 2.6rem; }
.text .meta::after { content: "❦"; display: block; color: var(--rose); font-size: 1.2rem; letter-spacing: 0; margin-top: 1rem; }
.text p { font-size: 1.19rem; line-height: 1.78; margin-bottom: .95em; hyphens: auto; overflow-wrap: break-word; }
.text p.first::first-letter { float: left; font-size: 3.55em; line-height: .82; padding: .06em .09em 0 0; color: var(--rose); }
.text p.sig { text-align: right; font-style: italic; color: var(--muted); margin-top: 1.6em; font-size: 1.05rem; }
.text p.sig + p.sig { margin-top: -.6em; }
.text section + section { margin-top: 4rem; }
hr.sep { border: 0; text-align: center; margin: 2rem 0; }
hr.sep::after { content: "* * *"; color: var(--muted); letter-spacing: .4em; }
.pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: 1rem; }
.pager a { text-decoration: none; color: var(--ink); }
.pager a:hover span, .pager a.up:hover { color: var(--rose); }
.pager small { display: block; font-family: var(--sans); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pager .next { text-align: right; }
.pager .up { font-family: var(--sans); font-size: .8rem; color: var(--muted); }

/* ---------- about / 404 ---------- */
.prose-page { max-width: 44rem; margin: 0 auto; padding-top: 3rem; }
.page-head h1 { font-size: clamp(2.2rem, 6vw, 3.2rem); margin-bottom: 2.5rem; }
.prose-page h2 { margin: 2.8rem 0 1rem; }
.bio p { font-size: 1.14rem; line-height: 1.75; }
.source { font-family: var(--sans); font-size: .8rem; color: var(--muted); }
.timeline li { display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.timeline .year { font-family: var(--sans); font-size: .85rem; color: var(--rose); padding-top: .15rem; }
.notfound { max-width: 34rem; margin: 0 auto; padding: 3rem 0 1rem; text-align: center; }
.notfound h1 { font-size: 1.8rem; margin-bottom: .6rem; }

/* ---------- small screens / print ---------- */
@media (max-width: 46rem) {
  body { font-size: 1rem; }
  .site-header { gap: .6rem 1rem; }
  .site-header nav { order: 3; width: 100%; gap: 1.1rem; }
  .hero { grid-template-columns: 1fr; gap: 2rem; padding-top: 2.5rem; text-align: center; }
  .hero .portrait { order: -1; justify-self: center; }
  .portrait img { width: 10rem; }
  .intro { margin-inline: auto; }
  .book-head { flex-direction: column; align-items: center; gap: 2rem; }
  .book-head > div { width: 100%; }
  .book-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem 1.2rem; }
  .portrait.float { float: none; margin: 0 0 1.5rem; }
  .text p { font-size: 1.1rem; line-height: 1.7; }
  .pager { grid-template-columns: 1fr 1fr; }
  .pager .up { grid-column: 1 / -1; grid-row: 2; text-align: center; }
  .timeline li { grid-template-columns: 5.5rem 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print {
  .site-header, .site-footer, .pager, .text-lang, .crumbs, .actions, .skip { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .text[hidden] { display: none !important; }
}

/* ---------- uncollected writings ---------- */
.uncollected .page-head h1 { margin-bottom: 1rem; }
.uncollected .page-head { margin-bottom: 3rem; }
.uncollected section .lead { margin-bottom: 1.2rem; }
.toc .badge { font-family: var(--sans); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: .1rem .5rem; margin-left: .6rem; vertical-align: .15em; }
.reading > .kicker { text-align: center; margin-bottom: .2rem; }

/* ---------- machine translations ---------- */
.auto-warning { font-family: var(--sans); font-size: .84rem; line-height: 1.55; color: var(--ink); background: var(--rose-soft); border: 1px solid var(--rose); border-left-width: 4px; border-radius: 4px; padding: .9rem 1.1rem; margin: 0 0 2.2rem; }
.auto-warning strong { display: block; text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; color: var(--rose-deep); margin-bottom: .3rem; }
.linklike { font: inherit; color: var(--rose); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: .18em; }
.linklike:hover { color: var(--rose-deep); }
.auto-mark { font-family: var(--sans); font-size: .62rem; font-style: normal; letter-spacing: .08em; text-transform: uppercase; color: var(--rose); border: 1px solid currentColor; border-radius: 3px; padding: 0 .3rem; margin-left: .45rem; vertical-align: .2em; white-space: nowrap; }
.text-lang button[aria-pressed="true"] .auto-mark { color: inherit; }
.book section > .hint { margin-bottom: .8rem; }
@media print { .auto-warning button { display: none; } }

/* ---------- theme switch ---------- */
.header-tools { display: flex; align-items: center; gap: .6rem; }
.early-grid img, .handwriting img, .portrait.float img { filter: var(--img-filter); }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 2.1rem; height: 2.1rem; padding: 0; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 50%; cursor: pointer; }
.theme-toggle:hover { color: var(--ink); background: var(--rose-soft); }
.theme-toggle svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media print { .theme-toggle { display: none; } }
