@import url('https://fonts.googleapis.com/css2?family=Literata:ital,opsz,wght@0,7..72,400;0,7..72,600;1,7..72,400&display=swap');

/* ── Reset & base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --serif: 'Literata', Georgia, 'Times New Roman', serif;
  --bg: #fff;
  --fg: #1a1a1a;
  --muted: #6b6b6b;
  --link: #052658;
  --accent: #123D7A;
  --sidebar-w: 180px;
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--serif);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.55;
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar (right side) ── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  border-left: 1px solid #f0f0f0;
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.sidebar-inner { display: flex; flex-direction: column; height: 100%; }
.site-name {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 16px;
  color: var(--fg);
  text-decoration: none;
  letter-spacing: -0.3px;
}
.site-name .dot { color: var(--accent); }
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 36px;
}
.sidebar-nav a {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}
.sidebar-nav a:hover { color: var(--fg); }
.shuffle-btn {
  font-size: 22px;
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-decoration: none;
  margin-top: auto;
  transition: color 0.2s;
}
.shuffle-btn:hover { color: var(--fg); }

/* ── Main content ── */
.content {
  flex: 1;
  min-width: 0;
  max-width: 700px;
  padding: 80px 48px 120px;
}

/* ── Post cover ── */
.post-cover img,
.post-cover svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

/* ── Post head ── */
.post-head { margin-top: 32px; margin-bottom: 32px; }
.post-head h1 {
  font-family: var(--serif);
  font-size: 2rem;
  line-height: 1.25;
  font-weight: 600;
  margin-top: 12px;
}
.lang-tag {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 0;
  display: inline-block;
}
.lang-tag.tr { color: var(--accent); }
.lang-tag.en { color: var(--muted); }

/* ── Post footer (shuffle on post pages) ── */
.post-footer {
  margin-top: 64px;
  padding-top: 32px;
}
.shuffle-btn-lg {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  transition: color 0.2s;
}
.shuffle-btn-lg:hover { color: var(--fg); }

/* ── Prose ── */
.prose { font-size: 1.05rem; }
.prose h1 { font-size: 1.75rem; margin: 48px 0 16px; }
.prose h2 { font-size: 1.35rem; margin: 40px 0 12px; }
.prose h3 { font-size: 1.1rem; margin: 32px 0 8px; }
.prose p { margin: 20px 0; }
.prose strong { font-weight: 600; }
.prose em { font-style: italic; }
.prose a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { opacity: 0.7; }
.prose blockquote {
  margin: 28px 0;
  padding: 0 0 0 20px;
  border-left: 2px solid #e0e0e0;
  color: var(--muted);
  font-style: italic;
}
.prose ul, .prose ol { margin: 20px 0; padding-left: 24px; }
.prose li { margin: 6px 0; }
.prose hr { margin: 40px 0; border: none; border-top: 1px solid #eee; }
.prose pre {
  margin: 24px 0;
  padding: 20px 24px;
  font-size: 0.9rem;
  line-height: 1.6;
  background: #f9f9f9;
  border-radius: 6px;
  overflow-x: auto;
}
.prose code {
  font-size: 0.9em;
  background: #f4f4f4;
  padding: 2px 5px;
  border-radius: 3px;
}
.prose pre code { background: none; padding: 0; }
.prose img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 28px 0;
}
.prose a { color: var(--accent); }
.prose a:hover { opacity: 0.7; }

/* ── All posts page ── */
.all-posts { }
.all-posts h1 { font-size: 1.75rem; margin-bottom: 32px; }
.all-list { list-style: none; padding: 0; }
.all-list li { padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
.all-list li:last-child { border-bottom: none; }
.all-list a {
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--fg);
  text-decoration: none;
}
.all-list a:hover { color: var(--accent); }

/* ── Footer ── */
.site-footer {
  padding: 32px 0;
  margin-top: auto;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--muted);
}
.footer-inner a { color: var(--muted); text-decoration: none; }
.footer-inner a:hover { color: var(--fg); }

/* ── Responsive: sidebar becomes top bar on mobile ── */
@media (max-width: 900px) {
  body { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    border-left: none;
    border-bottom: 1px solid #f0f0f0;
    padding: 14px 20px;
    background: var(--bg);
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .sidebar-inner { flex-direction: row; align-items: center; width: 100%; height: auto; }
  .sidebar-nav { flex-direction: row; gap: 16px; margin-top: 0; margin-left: auto; margin-right: 20px; }
  .shuffle-btn { margin-top: 0; font-size: 20px; }
  .content {
    max-width: 100%;
    padding: 80px 24px 80px;
  }
}
@media (max-width: 480px) {
  .content { padding: 72px 16px 60px; }
  .post-head h1 { font-size: 1.5rem; }
  .prose { font-size: 1rem; }
}
