/* ============================================================
   MÜREKKEP — kemik kâğıt, koyu mürekkep, oxblood vurgu.
   Serif başlıklar + sakin sans gövde. Karanlık/aydınlık.
   ============================================================ */
:root {
  --bg: #ecebe4;          /* kemik kâğıt */
  --bg-soft: #f2f1ea;     /* kart / yüzey */
  --card: #f2f1ea;
  --text: #17191f;        /* mürekkep */
  --text-soft: #5c5a52;   /* sıcak gri */
  --border: #dad8cf;
  --link: #883c34;        /* oxblood vurgu */
  --code-bg: #e4e2d8;
  --shadow-sm: 0 1px 2px rgba(23, 25, 31, 0.04);
  --shadow-md: 0 6px 24px rgba(23, 25, 31, 0.09);
  --shadow-lg: 0 14px 44px rgba(23, 25, 31, 0.14);
  --radius: 14px;
  --maxw: 68rem;
  --readw: 42rem;
  --gap: clamp(1.1rem, 4vw, 2rem);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

:root:not([data-theme="light"]) {
  @media (prefers-color-scheme: dark) {
    --bg: #16150f;
    --bg-soft: #1e1c15;
    --card: #1e1c15;
    --text: #eceae0;
    --text-soft: #9c968a;
    --border: #2c2a22;
    --link: #cf7a70;
    --code-bg: #201e17;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 14px 44px rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  --bg: #16150f;
  --bg-soft: #1e1c15;
  --card: #1e1c15;
  --text: #eceae0;
  --text-soft: #9c968a;
  --border: #2c2a22;
  --link: #cf7a70;
  --code-bg: #201e17;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 14px 44px rgba(0, 0, 0, 0.5);
}

/* Sepia — göz yormayan sıcak kâğıt okuma modu */
:root[data-theme="sepia"] {
  --bg: #f1e7d0;
  --bg-soft: #f6efdb;
  --card: #f7f0dd;
  --text: #4a3f30;
  --text-soft: #7c6e57;
  --border: #e2d5b8;
  --link: #9c4a2f;
  --code-bg: #ece0c4;
  --shadow-sm: 0 1px 2px rgba(74, 63, 48, 0.05);
  --shadow-md: 0 6px 24px rgba(74, 63, 48, 0.10);
  --shadow-lg: 0 14px 44px rgba(74, 63, 48, 0.14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.05rem);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
  transition: background 0.2s ease, color 0.2s ease;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }

/* Çizgi ikon — rengi currentColor'dan alır, metinle hizalı */
.ic { width: 1.05em; height: 1.05em; flex: none; vertical-align: -0.15em; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: max(var(--gap), env(safe-area-inset-left));
  padding-right: max(var(--gap), env(safe-area-inset-right));
}
.container.narrow { max-width: calc(var(--readw) + 4rem); }

/* ===== Üst menü ===== */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; font-family: var(--serif); font-weight: 700; font-size: 1.15rem; color: var(--text); letter-spacing: -0.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .brand-mark {
  width: 1.9rem; height: 1.9rem; border-radius: 7px;
  background: linear-gradient(140deg, #a8493f, #6e2924);
  color: #f4f1e8; display: grid; place-items: center;
  font-family: var(--serif); font-size: 1rem; font-weight: 700;
}
.nav-links { display: flex; align-items: center; gap: clamp(0.6rem, 2.5vw, 1.6rem); }
.nav-links a { color: var(--text-soft); font-size: 0.95rem; font-weight: 500; padding: 0.5rem 0; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

.theme-toggle {
  background: none; border: none; color: var(--text);
  width: 2.75rem; height: 2.75rem; margin-right: -0.5rem;
  border-radius: 50%; cursor: pointer; font-size: 1.1rem;
  display: grid; place-items: center; line-height: 1;
  -webkit-tap-highlight-color: transparent; transition: background 0.15s;
}
.theme-toggle:hover { background: var(--code-bg); }

/* ===== Hero / intro ===== */
.hero { padding: clamp(2.75rem, 8vw, 4.75rem) 0 clamp(1.5rem, 4vw, 2.5rem); }
.hero .eyebrow { color: var(--link); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; margin: 0 0 0.9rem; }
.hero h1 { font-family: var(--serif); font-size: clamp(2.1rem, 1.4rem + 4.6vw, 3.3rem); line-height: 1.08; margin: 0 0 0.9rem; letter-spacing: -0.02em; font-weight: 700; max-width: 18ch; text-wrap: balance; }
.hero p { font-size: clamp(1.05rem, 1rem + 0.5vw, 1.25rem); color: var(--text-soft); margin: 0; max-width: 40rem; }
.hero .socials { margin-top: 1.6rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; }
.hero .socials a { font-size: 0.95rem; color: var(--text-soft); padding: 0.3rem 0; }
.hero .socials a:hover { color: var(--link); text-decoration: none; }

/* ===== Öne çıkan yazı ===== */
.featured-wrap { padding-bottom: clamp(2rem, 6vw, 3.5rem); }
.featured {
  display: block;
  background: var(--card); border: 1px solid var(--border);
  border-left: 3px solid var(--c, var(--link));
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: box-shadow 0.2s, transform 0.2s;
}
.featured:hover { text-decoration: none; box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.featured-cover {
  position: relative; min-height: 260px;
  background:
    radial-gradient(120% 120% at 22% 18%, color-mix(in srgb, var(--c) 92%, #fff 0%), transparent 58%),
    linear-gradient(140deg, var(--c), color-mix(in srgb, var(--c) 52%, #000 48%));
  display: grid; place-items: center;
}
.featured-cover-icon { color: rgba(255, 255, 255, 0.94); filter: drop-shadow(0 6px 16px rgba(0,0,0,0.28)); display: grid; place-items: center; }
.featured-cover-icon .ic { width: 3.4rem; height: 3.4rem; }
.featured-body { padding: clamp(1.5rem, 4vw, 2.5rem); align-self: center; }
.featured-title { font-family: var(--serif); font-size: clamp(1.5rem, 1.1rem + 1.9vw, 2.1rem); line-height: 1.15; letter-spacing: -0.01em; margin: 0.6rem 0 0.7rem; font-weight: 700; color: var(--text); text-wrap: balance; }
.featured-excerpt { color: var(--text-soft); margin: 0 0 1.1rem; }
.read-more { color: var(--link); font-weight: 600; font-size: 0.95rem; }

/* ===== Kategori filtreleri ===== */
.filters { display: flex; gap: 0.55rem; flex-wrap: wrap; margin: 0 0 1.75rem; }
.filter {
  display: inline-flex; align-items: center; gap: 0.4rem;
  border: 1px solid var(--border); background: var(--card); color: var(--text-soft);
  font-size: 0.9rem; font-weight: 550; padding: 0.5rem 0.95rem; border-radius: 999px;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s, color 0.15s, background 0.15s; white-space: nowrap;
}
.filter .ic { width: 1rem; height: 1rem; }
.filter:hover { color: var(--text); border-color: color-mix(in srgb, var(--c, var(--link)) 55%, var(--border)); }
.filter.active { color: #f4f1e8; background: var(--c, var(--link)); border-color: var(--c, var(--link)); }

/* ===== Kart ızgarası ===== */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1rem; gap: 1rem; }
.section-title { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; margin: 0; }

.grid {
  display: grid; gap: clamp(1rem, 2.5vw, 1.5rem);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17.5rem), 1fr));
  padding-bottom: clamp(2.5rem, 8vw, 4rem);
}
.card {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { text-decoration: none; box-shadow: var(--shadow-md); transform: translateY(-3px); }
.card-cover {
  position: relative; aspect-ratio: 16 / 9;
  background:
    radial-gradient(120% 120% at 22% 18%, color-mix(in srgb, var(--c) 88%, #fff 0%), transparent 58%),
    linear-gradient(140deg, var(--c), color-mix(in srgb, var(--c) 52%, #000 48%));
  display: grid; place-items: center;
}
.card-cover-icon { color: rgba(255, 255, 255, 0.94); filter: drop-shadow(0 4px 12px rgba(0,0,0,0.25)); display: grid; place-items: center; }
.card-cover-icon .ic { width: 2.3rem; height: 2.3rem; }
.card-body { padding: 1.1rem 1.15rem 1.3rem; display: flex; flex-direction: column; flex: 1; }
.card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem; font-size: 0.8rem; color: var(--text-soft); }
.card-title { font-family: var(--serif); font-size: 1.2rem; line-height: 1.25; letter-spacing: -0.01em; margin: 0.55rem 0 0.5rem; font-weight: 700; color: var(--text); }
.card:hover .card-title { color: var(--link); }
.card-excerpt { color: var(--text-soft); font-size: 0.92rem; line-height: 1.6; margin: 0; }
.card-foot { margin-top: auto; padding-top: 0.85rem; font-size: 0.78rem; color: var(--text-soft); }
.dot { opacity: 0.5; }

/* Okunma sayısı */
.views { display: inline-flex; align-items: center; gap: 0.3rem; white-space: nowrap; }
.views .ic { width: 0.95rem; height: 0.95rem; opacity: 0.85; }

.cat-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.75rem; font-weight: 650; color: var(--c);
  background: color-mix(in srgb, var(--c) 15%, transparent);
  padding: 0.15rem 0.55rem; border-radius: 999px;
}

/* ===== Tekil yazı ===== */
.article { padding: clamp(1.75rem, 6vw, 3rem) 0 clamp(3rem, 10vw, 5rem); }
.article-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.75rem; flex-wrap: wrap; }
.back { font-size: 0.9rem; color: var(--text-soft); display: inline-block; padding: 0.25rem 0; }
.back:hover { color: var(--link); text-decoration: none; }

/* ===== E-kitap okuma özellikleri ===== */
/* Okuma ilerleme çubuğu (sayfa üstünde) */
.reading-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 30; pointer-events: none; }
.reading-progress span { display: block; height: 100%; width: 0; background: var(--link); }

/* Aa aracı ve paneli */
.reader-tools { position: relative; }
.rc-btn { border: 1px solid var(--border); background: var(--card); color: var(--text-soft); cursor: pointer; font-family: var(--serif); font-weight: 700; line-height: 1; border-radius: 999px; padding: 0.42rem 0.85rem; font-size: 1rem; transition: background 0.15s, color 0.15s, border-color 0.15s; -webkit-tap-highlight-color: transparent; }
.rc-btn:hover { color: var(--text); border-color: color-mix(in srgb, var(--link) 40%, var(--border)); }
.rc-btn .aa-lg { font-size: 1.2em; }

.reader-panel { position: absolute; right: 0; top: calc(100% + 0.5rem); z-index: 25; width: 17.5rem; max-width: calc(100vw - 2rem); background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 0.9rem; display: flex; flex-direction: column; gap: 0.7rem; }
.reader-panel[hidden] { display: none; }
.rp-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.rp-label { font-size: 0.85rem; color: var(--text-soft); font-weight: 600; white-space: nowrap; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { border: none; background: var(--bg); color: var(--text-soft); font: inherit; font-size: 0.82rem; font-weight: 600; padding: 0.34rem 0.62rem; cursor: pointer; border-left: 1px solid var(--border); line-height: 1; -webkit-tap-highlight-color: transparent; transition: background 0.12s, color 0.12s; }
.seg button:first-child { border-left: none; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--link); color: #f4f1e8; }
.seg .aa-s { font-family: var(--serif); }
.seg .aa-s.sm { font-size: 0.74rem; }
.seg .aa-s.lg { font-size: 1.02rem; }

/* Yazı sonu: önceki/sonraki */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.post-nav a { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.9rem 1.1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--card); transition: border-color 0.15s, transform 0.15s; }
.post-nav a:hover { text-decoration: none; border-color: color-mix(in srgb, var(--link) 45%, var(--border)); transform: translateY(-2px); }
.post-nav .pn-label { font-size: 0.75rem; color: var(--text-soft); }
.post-nav .pn-title { font-family: var(--serif); font-weight: 700; color: var(--text); line-height: 1.25; }
.post-nav .pn-next { text-align: right; align-items: flex-end; }
@media (max-width: 560px) { .post-nav { grid-template-columns: 1fr; } .post-nav .pn-next { text-align: left; align-items: flex-start; } }

/* Başa dön */
.to-top { position: fixed; right: max(1.2rem, env(safe-area-inset-right)); bottom: calc(1.2rem + env(safe-area-inset-bottom)); z-index: 20; width: 2.9rem; height: 2.9rem; border-radius: 50%; border: 1px solid var(--border); background: var(--card); color: var(--text); box-shadow: var(--shadow-md); cursor: pointer; display: grid; place-items: center; opacity: 0; transform: translateY(0.5rem); pointer-events: none; transition: opacity 0.2s, transform 0.2s; -webkit-tap-highlight-color: transparent; }
.to-top.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.to-top:hover { border-color: color-mix(in srgb, var(--link) 45%, var(--border)); }
.to-top .ic { width: 1.2rem; height: 1.2rem; }
.article-head { margin-bottom: 2.25rem; }
.article-head .card-meta { margin-bottom: 0.9rem; font-size: 0.85rem; }
.article h1 { font-family: var(--serif); font-size: clamp(1.9rem, 1.3rem + 3.4vw, 2.75rem); line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 0.5rem; font-weight: 700; text-wrap: balance; }

.article-body { font-size: calc(1.09rem * var(--rs, 1)); line-height: var(--rlh, 1.8); font-family: var(--rf, var(--sans)); }
.article-body h2 { font-family: var(--serif); margin: 2.5rem 0 0.8rem; font-size: 1.38em; letter-spacing: -0.01em; font-weight: 700; }
.article-body p { margin: 0 0 1.3rem; }
.article-body ul { margin: 0 0 1.3rem; padding-left: 1.3rem; }
.article-body li { margin-bottom: 0.45rem; }
.article-body pre { background: var(--code-bg); border-radius: 0.7rem; padding: 1rem 1.15rem; overflow-x: auto; -webkit-overflow-scrolling: touch; font-size: 0.875rem; line-height: 1.6; }
.article-body code { font-family: "SF Mono", Menlo, Consolas, monospace; background: var(--code-bg); padding: 0.1rem 0.35rem; border-radius: 0.35rem; font-size: 0.86em; }
.article-body pre code { background: none; padding: 0; }
.article-body blockquote { margin: 1.6rem 0; padding: 0.3rem 0 0.3rem 1.3rem; border-left: 3px solid var(--link); color: var(--text-soft); font-family: var(--serif); font-size: 1.12em; font-style: italic; line-height: 1.5; }

/* ===== Hakkımda ===== */
.page { padding: clamp(1.75rem, 6vw, 3rem) 0 clamp(3rem, 10vw, 5rem); }
.page h1 { font-family: var(--serif); font-size: clamp(1.9rem, 1.3rem + 3.4vw, 2.6rem); letter-spacing: -0.015em; margin: 0 0 1.5rem; font-weight: 700; }
.page p { margin: 0 0 1.15rem; font-size: 1.08rem; line-height: 1.8; }

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--border); margin-top: 1rem; padding: 2.25rem 0 calc(2.25rem + env(safe-area-inset-bottom)); color: var(--text-soft); font-size: 0.85rem; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; }
.footer-inner a { color: var(--text-soft); }
.footer-inner a:hover { color: var(--link); }

/* ===== Duyarlılık ===== */
@media (max-width: 720px) {
  .featured { grid-template-columns: 1fr; }
  .featured-cover { min-height: 0; aspect-ratio: 16 / 9; }
  .featured-cover-icon { font-size: 3.2rem; }
}
@media (max-width: 560px) {
  .brand { font-size: 0.98rem; gap: 0.45rem; }
  .brand .brand-mark { width: 1.65rem; height: 1.65rem; font-size: 0.88rem; }
  .nav-links { gap: 0.85rem; }
  .nav-links a { font-size: 0.88rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
