/* =========================================================================
   TÜRK TARİHİ · turktarih.net
   Tailwind (CDN, configured in layout.twig <head>) carries the design
   system. This file holds only what utilities can't express cleanly:
   the .prose article typography, the sharp timeline node pseudo-elements,
   the lightbox/tabs/reading-progress behaviours, and CKEditor sizing.
   Palette: turquoise #008080, crimson #E30A17, slate text #334155.
   ========================================================================= */

:root {
  --teal: #008080;
  --teal-deep: #005F5F;
  --teal-line: rgba(0, 128, 128, .30);
  --crimson: #E30A17;
  --ink: #0f172a;
  --slate: #334155;
  --line: #e2e8f0;
}

/* Site layout — main + sticky sidebar (450px)                          */
/* ------------------------------------------------------------------ */
.site-layout {
  display: grid;
  gap: 2rem;
}
.site-layout__main { min-width: 0; }
.site-layout__sidebar { min-width: 0; }
@media (min-width: 1024px) {
  .site-layout--with-sidebar {
    grid-template-columns: minmax(0, 1fr) 450px;
    gap: 2rem;
  }
  .site-layout__sidebar {
    width: 450px;
    max-width: 450px;
  }
}

/* ------------------------------------------------------------------ */
/* Sticky sidebar timeline — modern rail                              */
/* ------------------------------------------------------------------ */
.tl-rail {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, .06);
  overflow: hidden;
}

.tl-rail__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem 1rem .85rem;
  border-bottom: 1px solid #f1f5f9;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.tl-rail__title {
  font-size: .9rem;
  font-weight: 800;
  letter-spacing: .02em;
  color: #0f172a;
  line-height: 1.2;
}

.tl-rail__span {
  margin-top: .2rem;
  font-size: .68rem;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-weight: 600;
  color: #64748b;
  letter-spacing: .04em;
}

.tl-rail__filter-btn {
  position: relative;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  cursor: pointer;
  transition: border-color .15s, color .15s, background-color .15s, box-shadow .15s;
}
.tl-rail__filter-btn:hover,
.tl-rail__filter-btn.is-open {
  border-color: var(--teal);
  color: var(--teal-deep);
  background: #f0fdfa;
  box-shadow: 0 0 0 3px rgba(0, 128, 128, .1);
}

.tl-rail__filter-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--crimson);
  border: 1.5px solid #fff;
}

.tl-rail__filters {
  padding: .75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  background: #f8fafc;
  display: grid;
  gap: .65rem;
}
.tl-rail__filters.hidden { display: none; }

.tl-rail__field { display: grid; gap: .3rem; }
.tl-rail__label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #94a3b8;
}

.tl-rail__select {
  width: 100%;
  font-size: .8rem;
  font-weight: 600;
  color: #334155;
  padding: .45rem .65rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.tl-rail__select:hover { border-color: #cbd5e1; }
.tl-rail__select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 128, 128, .12);
}

.tl-rail__reset {
  justify-self: start;
  font-size: .72rem;
  font-weight: 700;
  color: var(--teal-deep);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.tl-rail__reset:hover { color: var(--crimson); }

.tl-rail__body {
  max-height: min(52vh, 520px);
  overflow-y: auto;
  padding: .85rem 1rem 1rem;
}

.tl-rail__track {
  position: relative;
  padding-left: .15rem;
}

.tl-era-label {
  position: sticky;
  top: 0;
  z-index: 2;
  display: inline-block;
  margin: .85rem 0 .45rem;
  padding: .2rem .55rem;
  font-size: .62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--teal-deep);
  background: #ecfdf5;
  border: 1px solid #ccfbf1;
  border-radius: 999px;
}
.tl-rail__track > .tl-era-label:first-child { margin-top: 0; }

.tl-node {
  position: relative;
  display: grid;
  grid-template-columns: 3.4rem 1fr auto;
  align-items: center;
  gap: .55rem;
  width: 100%;
  text-align: left;
  padding: .55rem .5rem .55rem .75rem;
  margin-bottom: .2rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, transform .12s;
}
.tl-node::before {
  content: "";
  position: absolute;
  left: 3.55rem;
  top: 50%;
  width: 5px;
  height: 5px;
  margin-top: -2.5px;
  border-radius: 50%;
  background: #cbd5e1;
  transition: background-color .15s, transform .15s;
}
.tl-node:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
  transform: translateX(2px);
}
.tl-node:hover::before,
.tl-node:focus-visible::before {
  background: var(--teal);
  transform: scale(1.35);
}
.tl-node:focus-visible {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 128, 128, .12);
}
.tl-node.imp-5::before { background: var(--crimson); }

.tl-node__year {
  font-size: .68rem;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-weight: 700;
  color: var(--teal-deep);
  line-height: 1.2;
}

.tl-node__content {
  min-width: 0;
  padding-left: .55rem;
  border-left: 1px solid #e2e8f0;
}

.tl-node__title {
  display: block;
  font-size: .82rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.35;
}
.tl-node:hover .tl-node__title { color: var(--teal-deep); }

.tl-node__meta {
  display: block;
  margin-top: .15rem;
  font-size: .65rem;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tl-node__arrow {
  font-size: .6rem;
  color: #cbd5e1;
  transition: color .15s, transform .15s;
}
.tl-node:hover .tl-node__arrow {
  color: var(--teal);
  transform: translateX(2px);
}

.tl-rail__foot {
  padding: .7rem 1rem;
  border-top: 1px solid #f1f5f9;
  background: #fafbfc;
  text-align: center;
}

.tl-rail__more {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--teal-deep);
  transition: color .15s;
}
.tl-rail__more:hover { color: var(--crimson); }

/* era filter chips (full timeline page) */
.era-chip {
  font-size: 11px;
  font-weight: 700;
  padding: .2rem .55rem;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #475569;
  border-radius: 2px;
  cursor: pointer;
  transition: all .12s;
}
.era-chip:hover { border-color: var(--teal); color: var(--teal-deep); }
.era-chip.is-active { background: var(--teal); border-color: var(--teal); color: #fff; }

/* ------------------------------------------------------------------ */
/* Full timeline page rail                                            */
/* ------------------------------------------------------------------ */
.tl-page { position: relative; padding-left: 2rem; border-left: 2px solid var(--teal-line); }
.tl-page__event {
  position: relative;
  margin-bottom: 1.25rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 1.1rem 1.3rem;
  transition: border-color .15s, transform .15s;
}
.tl-page__event:hover { border-color: var(--teal); transform: translateX(3px); }
.tl-page__event::before {
  content: "";
  position: absolute;
  left: -2.6rem;
  top: 1.3rem;
  width: 12px;
  height: 12px;
  background: var(--teal);
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px var(--teal-line);
}
.tl-page__event.imp-5::before { background: var(--crimson); box-shadow: 0 0 0 4px #fde3e3; }

/* ------------------------------------------------------------------ */
/* Reading progress bar                                               */
/* ------------------------------------------------------------------ */
.reading-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: var(--crimson);
  z-index: 100; transition: width .1s linear;
}

/* ------------------------------------------------------------------ */
/* Sticky Table of Contents (article view)                            */
/* ------------------------------------------------------------------ */
.article-toc a {
  display: block;
  padding: .3rem 0 .3rem .8rem;
  font-size: .86rem;
  color: #475569;
  border-left: 2px solid var(--line);
}
.article-toc a:hover,
.article-toc a.is-active {
  color: var(--teal-deep);
  border-left-color: var(--teal);
  font-weight: 600;
}
.article-toc a[data-level="3"] { padding-left: 1.6rem; font-size: .82rem; }

/* ------------------------------------------------------------------ */
/* .prose — long-form article body & modal detail                     */
/* ------------------------------------------------------------------ */
.prose {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.075rem;
  line-height: 1.85;
  color: var(--slate);
}
.prose > * + * { margin-top: 1.3em; }
.prose h2 {
  font-family: Inter, system-ui, sans-serif;
  font-size: 1.5rem; font-weight: 800;
  margin-top: 2.2em; color: var(--ink);
  padding-bottom: .3em; border-bottom: 1px solid var(--line);
}
.prose h3 {
  font-family: Inter, system-ui, sans-serif;
  font-size: 1.2rem; font-weight: 700; margin-top: 1.8em; color: var(--ink);
}
.prose a { color: var(--teal-deep); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--crimson); }
.prose img { border: 1px solid var(--line); margin-block: 1.6em; max-width: 100%; height: auto; }
.prose blockquote {
  border-left: 3px solid var(--teal);
  padding: .3em 1.2em; margin-left: 0;
  background: #f0fdfa; font-style: italic; color: #0f766e;
}
.prose ul, .prose ol { padding-left: 1.4em; }
.prose ul { list-style: square; }
.prose code {
  font-family: "JetBrains Mono", monospace; font-size: .9em;
  background: #f1f5f9; padding: .1em .35em; border: 1px solid var(--line);
}
.prose-sm { font-size: .95rem; line-height: 1.7; }
.prose-sm h2 { font-size: 1.15rem; margin-top: 1.4em; }

.prose .cite-ref {
  font-size: .72em;
  line-height: 0;
  vertical-align: super;
  font-family: Inter, system-ui, sans-serif;
  font-weight: 600;
}
.prose .cite-ref a {
  text-decoration: none;
  color: var(--teal-deep);
  padding: 0 .12em;
  scroll-margin-top: 6rem;
}
.prose .cite-ref a:hover { color: var(--crimson); }

/* Article footnotes (citations table) */
.article-footnotes .footnotes-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.article-footnotes .footnote-item {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  gap: .45rem;
  font-size: .875rem;
  line-height: 1.65;
  color: #475569;
  margin-bottom: .7rem;
  scroll-margin-top: 6rem;
}
.article-footnotes .footnote-item cite { font-style: italic; }
.article-footnotes .footnote-back a {
  text-decoration: none;
  color: var(--teal);
  font-weight: 700;
}
.article-footnotes .footnote-back a:hover { color: var(--crimson); }
.article-footnotes .footnote-text a {
  color: var(--teal-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Tarihten Sözleri */
.quote-feature-card {
  display: block;
  padding: 1.25rem 1.35rem;
  background: linear-gradient(135deg, #f0fdfa 0%, #fff 100%);
  border: 1px solid var(--line);
  border-left: 3px solid var(--crimson);
  transition: border-color .15s;
}
.quote-feature-card:hover { border-color: var(--teal); }
.quote-feature-card__mark {
  font-family: Georgia, serif;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--teal);
  opacity: .45;
}
.quote-feature-card__text {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--slate);
  margin: .35rem 0 .75rem;
  font-style: italic;
}
.quote-feature-card__author { font-size: .875rem; }
.quote-figure-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 1.25rem;
  transition: border-color .15s;
}
.quote-figure-card:hover { border-color: var(--teal); }
.quote-figure-card__sample {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: .95rem;
  line-height: 1.7;
  color: #475569;
  font-style: italic;
  padding-left: 1rem;
  border-left: 2px solid var(--teal-line);
}
.quote-mark {
  font-family: Georgia, serif;
  color: var(--teal);
  font-weight: 700;
  margin-right: .15em;
}
.quote-mark--lg { font-size: 2rem; line-height: 0; vertical-align: -.35em; }
.quote-block {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  padding: 1.35rem 1.5rem;
}
.quote-block__text {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.15rem;
  line-height: 1.85;
  color: var(--ink);
  font-style: italic;
}
.quote-block__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem;
  margin-top: 1rem;
  padding-top: .75rem;
  border-top: 1px solid var(--line);
  font-size: .875rem;
}
.quote-share {
  border: 1px solid var(--line);
  background: #fff;
  width: 2rem;
  height: 2rem;
  border-radius: 2px;
  color: var(--slate);
  cursor: pointer;
}
.quote-share:hover { border-color: var(--teal); color: var(--teal-deep); }
.quote-block--solo { padding: 1.75rem 1.85rem; }
.quote-tag {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .85rem;
  font-size: .8125rem;
  font-weight: 700;
  color: var(--teal-deep);
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: 2px;
  transition: border-color .15s, color .15s, background .15s;
}
.quote-tag:hover {
  color: var(--crimson);
  border-color: var(--crimson);
  background: #fff;
}
.quote-tag--topic {
  color: #475569;
  background: #f8fafc;
  border-color: var(--line);
}
.quote-tag--topic:hover { color: var(--teal-deep); border-color: var(--teal); background: #f0fdfa; }
.quote-tag-card {
  display: block;
  padding: .85rem 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  transition: border-color .15s;
}
.quote-tag-card:hover { border-color: var(--teal); }

/* ------------------------------------------------------------------ */
/* Biography tabs                                                     */
/* ------------------------------------------------------------------ */
.tab-btn {
  padding: .65rem 1.1rem; font-weight: 700; font-size: .9rem;
  border: none; background: none; color: #64748b; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.tab-btn.is-active { color: var(--teal-deep); border-bottom-color: var(--teal); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* ------------------------------------------------------------------ */
/* Gallery lightbox                                                   */
/* ------------------------------------------------------------------ */
.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(6, 10, 18, .95);
  display: none; align-items: center; justify-content: center; flex-direction: column; padding: 2rem;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 78vh; border: 1px solid rgba(255,255,255,.15); transition: transform .2s; }
.lightbox__cap { color: #e2e8f0; margin-top: 1rem; font-size: .95rem; text-align: center; max-width: 60ch; }
.lightbox__close { position: absolute; top: 1.2rem; right: 1.5rem; background: none; border: none; color: #fff; font-size: 2rem; cursor: pointer; }
.lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.12); border: none; color: #fff;
  font-size: 1.8rem; width: 48px; height: 48px; cursor: pointer;
}
.lightbox__nav:hover { background: var(--teal); }
.lightbox__nav--prev { left: 1.5rem; }
.lightbox__nav--next { right: 1.5rem; }
.lightbox__tools { position: absolute; bottom: 1.5rem; display: flex; gap: .6rem; }
.lightbox__tools button { background: rgba(255,255,255,.14); border: none; color: #fff; padding: .5rem .9rem; cursor: pointer; font-weight: 700; }
.lightbox__tools button:hover { background: var(--teal); }

/* ------------------------------------------------------------------ */
/* Modal open state (JS toggles .is-open)                             */
/* ------------------------------------------------------------------ */
#tlModal.is-open { display: flex; }

/* ------------------------------------------------------------------ */
/* CKEditor (admin) — 500px min height                                */
/* ------------------------------------------------------------------ */
.ck-editor__editable_inline { min-height: 500px !important; }

/* ------------------------------------------------------------------ */
/* Reduced motion                                                     */
/* ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
