/* ─────────────────────────────────────────────
   maliasik.net · Terminal Codex Design System
   ───────────────────────────────────────────── */

:root {
  --bg:           #0f0f17;
  --surface:      #17171f;
  --surface-2:    #1e1e2c;
  --text:         #dddbe8;
  --muted:        #6e6b82;
  --faint:        #2a2838;
  --border:       #252334;
  --accent:       #f0a500;
  --accent-glow:  rgba(240, 165, 0, 0.12);
  --link:         #93c5fd;
  --green:        #4ade80;
  --red:          #f87171;
  --yellow:       #fbbf24;
  --code-bg:      #0a0a12;
  --header-bg:    rgba(15, 15, 23, 0.88);
  --mono:         'IBM Plex Mono', ui-monospace, 'Cascadia Code', monospace;
  --serif:        'Fraunces', Georgia, 'Times New Roman', serif;
  --body:         'Lora', Georgia, serif;
  --radius:       5px;
  --max-w:        720px;
}

/* ─── Gündüz / Light tema ─── */
[data-theme="light"] {
  --bg:           #f5f3ee;
  --surface:      #ede9e0;
  --surface-2:    #e5dfd3;
  --text:         #1c1916;
  --muted:        #7a7060;
  --faint:        #ccc6b5;
  --border:       #d6d0c2;
  --accent:       #b87000;
  --accent-glow:  rgba(184, 112, 0, 0.10);
  --link:         #1d5fa8;
  --green:        #1a7038;
  --red:          #bc3030;
  --yellow:       #9a6800;
  --code-bg:      #e8e2d4;
  --header-bg:    rgba(245, 243, 238, 0.88);
}

/* ─── Tema geçiş animasyonu ─── */
html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition:
    background-color 0.38s ease,
    color 0.38s ease,
    border-color 0.38s ease,
    box-shadow 0.38s ease !important;
  transition-delay: 0s !important;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

/* Grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.028;
  pointer-events: none;
  z-index: 9998;
}
[data-theme="light"] body::after {
  opacity: 0.018;
  mix-blend-mode: multiply;
}

/* ─── Reading progress bar ─── */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: var(--accent);
  z-index: 9999;
  transition: width 0.08s linear;
  box-shadow: 0 0 8px var(--accent);
}

/* ─── Layout ─── */
.container {
  max-width: calc(var(--max-w) + 2.4rem);
  margin: 0 auto;
  padding: 0 1.2rem;
}

/* ─── Sticky header ─── */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 0;
  position: sticky;
  top: 0;
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 100;
}

.nav-wrap {
  display: flex;
  align-items: center;
  gap: 2rem;
}

/* Brand with blinking cursor */
.site-brand {
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}
.site-brand .cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 1.1s step-end infinite;
  border-radius: 1px;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.4rem;
}
.nav-links a {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); }

/* Search with $ prefix */
.search-form {
  margin-left: auto;
  position: relative;
  flex-shrink: 0;
}
.search-form::before {
  content: '$';
  position: absolute;
  left: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  pointer-events: none;
  z-index: 1;
}
.search-form input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem 0.7rem 0.35rem 1.6rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--text);
  outline: none;
  width: 150px;
  transition: border-color 0.15s, width 0.2s ease, box-shadow 0.15s;
}
.search-form input:focus {
  border-color: var(--accent);
  width: 210px;
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-form input::placeholder { color: var(--muted); }

/* ─── Main ─── */
.main-content { padding: 2.5rem 0 4rem; min-height: 60vh; }

/* ─── Alerts ─── */
.alert {
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-family: var(--mono);
  font-size: 0.78rem;
}
.alert-success {
  background: rgba(74, 222, 128, 0.08);
  color: var(--green);
  border: 1px solid rgba(74, 222, 128, 0.2);
}
.alert-error {
  background: rgba(248, 113, 113, 0.08);
  color: var(--red);
  border: 1px solid rgba(248, 113, 113, 0.2);
}

/* ─── Section labels (## heading) ─── */
.section-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
  margin-top: 2rem;
}
.section-label:first-child { margin-top: 0; }
.section-label::before {
  content: '##';
  color: var(--accent);
  font-weight: 600;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ─── Ana sayfa geniş container ─── */
.main-content.home-wide {
  max-width: 1160px;
}

/* ─── İki sütunlu ana sayfa grid ─── */
.home-layout {
  display: grid;
  grid-template-columns: 1fr 270px;
  gap: 3rem;
  align-items: start;
}

/* ─── Feed list (sol sütun) ─── */
.feed-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.feed-card {
  background: var(--surface);
  border-left: 3px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}

.feed-card:hover {
  border-left-color: var(--accent);
  background: var(--surface-2);
}

.feed-card__cover {
  display: block;
  width: 100%;
  height: 220px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.feed-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.feed-card:hover .feed-card__cover img {
  transform: scale(1.03);
}

.feed-card__body {
  padding: 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.feed-card__meta {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.feed-card__meta a {
  color: var(--link);
  text-decoration: none;
}

.feed-card__meta a:hover { text-decoration: underline; }

.feed-card__title {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
  font-style: italic;
}

.feed-card__title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}

.feed-card:hover .feed-card__title a { color: var(--accent); }

.feed-card__excerpt {
  font-family: var(--body);
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

.feed-card__cta {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  text-decoration: none;
  display: inline-block;
  margin-top: 0.25rem;
  transition: letter-spacing 0.2s;
}

.feed-card__cta:hover { letter-spacing: 0.04em; }

.all-posts-cta,
.feed-loader {
  margin-top: 1.4rem;
}

.all-posts-cta a,
.feed-loader {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: none;
}

.all-posts-cta a:hover { text-decoration: underline; }

.feed-loader {
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--muted);
}

.feed-loader__text::before {
  content: '$';
  color: var(--accent);
  margin-right: 0.35rem;
}

.feed-loader.is-loading .feed-loader__text::after {
  content: '';
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-left: 0.55rem;
  border: 1px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.feed-loader.is-complete {
  color: var(--faint);
}

.feed-loader__fallback {
  color: var(--accent);
  text-decoration: none;
}

.feed-loader__fallback:hover { text-decoration: underline; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.82rem;
  padding: 2rem 0;
}

/* ─── Sidebar ─── */
.sidebar {
  position: sticky;
  top: 5rem;
  display: flex;
  flex-direction: column;
}

.sidebar-widget {
  padding-bottom: 1.75rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-widget:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.sidebar .section-label {
  margin-top: 0;
  margin-bottom: 0.85rem;
}

.sidebar-recent-list { list-style: none; }

.sidebar-recent-item {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.sidebar-recent-item:last-child { border-bottom: none; }

.sidebar-recent-item a {
  font-family: var(--serif);
  font-size: 0.875rem;
  color: var(--text);
  text-decoration: none;
  line-height: 1.4;
  display: block;
  transition: color 0.15s, padding-left 0.15s;
}

.sidebar-recent-item a::before {
  content: '→';
  color: var(--accent);
  margin-right: 0.45rem;
  font-family: var(--mono);
  font-size: 0.75em;
}

.sidebar-recent-item a:hover {
  color: var(--accent);
  padding-left: 0.2rem;
}

.sidebar-meta {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted);
  margin-top: 0.2rem;
  padding-left: 1rem;
}

/* ─── Ana sayfa responsive ─── */
@media (max-width: 900px) {
  .home-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .sidebar {
    position: static;
    border-top: 1px solid var(--border);
    padding-top: 2rem;
  }
}

/* ─── Home hero ─── */
.home-hero {
  padding: 3rem 0 2.5rem;
}
.home-hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.1rem, 5.5vw, 3.4rem);
  font-weight: 900;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 0.75rem;
  font-style: italic;
}
.home-hero h1 em {
  color: var(--accent);
  font-style: inherit;
}
.home-hero .tagline {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ─── Pill groups (categories / platforms) ─── */
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.pill {
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 0.22rem 0.7rem;
  border-radius: 2px;
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  letter-spacing: 0.02em;
}
.pill:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* ─── Post grid (home / featured) ─── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.post-card {
  background: var(--surface);
  padding: 1.4rem;
  border-left: 3px solid transparent;
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  cursor: pointer;
}
.post-card-cover {
  display: block;
  width: calc(100% + 2.8rem);
  margin: -1.4rem -1.4rem 0.85rem;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: var(--code-bg);
}
.post-card-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}
.post-card:hover .post-card-cover img {
  transform: scale(1.025);
}
.post-card:hover {
  border-left-color: var(--accent);
  background: var(--surface-2);
}
.post-card .meta {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.post-card .meta a {
  color: var(--link);
  text-decoration: none;
}
.post-card .meta a:hover { text-decoration: underline; }
.post-card h3 {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
}
.post-card h3 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}
.post-card:hover h3 a { color: var(--accent); }
.post-card .short-answer {
  font-family: var(--body);
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.55;
}
.post-card .card-arrow {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--faint);
  transition: color 0.15s;
  padding-top: 0.4rem;
}
.post-card:hover .card-arrow { color: var(--accent); }

/* ─── Post list (blog/index) ─── */
.post-list { list-style: none; }
.post-list-item {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
  transition: padding-left 0.15s;
  cursor: pointer;
}
.post-list-item:first-child { border-top: 1px solid var(--border); }
.post-list-item:hover { padding-left: 0.4rem; }
.post-list-item .post-date {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
  min-width: 5.5rem;
}
.post-list-item .post-author {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--muted);
  white-space: nowrap;
}
.post-list-item .post-title {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  flex: 1;
  transition: color 0.15s;
  line-height: 1.4;
}
.post-list-item:hover .post-title { color: var(--accent); }
.post-list-item .post-cat {
  font-family: var(--mono);
  font-size: 0.63rem;
  color: var(--link);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.post-list-item .post-cat:hover { text-decoration: underline; }

/* ─── Tag chips ─── */
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  font-family: var(--mono);
  font-size: 0.68rem;
  padding: 0.2rem 0.55rem;
  border-radius: 2px;
  background: var(--surface-2);
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--border);
  transition: color 0.15s, border-color 0.15s;
}
.chip::before { content: '#'; color: var(--accent); margin-right: 1px; }
.chip:hover { color: var(--text); border-color: var(--muted); }

/* ─── Page header ─── */
.page-header { margin-bottom: 2rem; }
.page-header h1 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.35rem;
  font-style: italic;
}
.page-header p {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

/* ─── Post detail ─── */
.post-detail .post-meta {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.post-detail .post-meta a {
  color: var(--link);
  text-decoration: none;
}
.post-detail .post-meta a:hover { text-decoration: underline; }
.post-detail .post-meta .sep { opacity: 0.35; }
.post-detail h1 {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  font-weight: 900;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 1.5rem;
  font-style: italic;
}

/* Short answer terminal box */
.short-answer-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 2rem;
  box-shadow: inset 0 0 0 1px transparent;
}
.short-answer-box strong {
  display: block;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
}
.short-answer-box strong::before { content: '> '; opacity: 0.7; }
.short-answer-box span, .short-answer-box p {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.65;
}

.post-cover {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  border: 1px solid var(--border);
}

/* ─── Article content ─── */
.article-content {
  line-height: 1.85;
  color: var(--text);
}
.article-content h2 {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 700;
  margin: 2.4rem 0 0.85rem;
  color: var(--text);
  font-style: italic;
}
.article-content h3 {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.8rem 0 0.65rem;
  color: var(--text);
}
.article-content p { margin-bottom: 1.15rem; }
.article-content ul, .article-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.15rem;
}
.article-content li { margin-bottom: 0.45rem; }
.article-content a { color: var(--link); text-decoration: underline; }
.article-content a:hover { color: var(--accent); }
.article-content code {
  font-family: var(--mono);
  background: var(--code-bg);
  color: #a5d6ff;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.84em;
  border: 1px solid var(--border);
}
.article-content pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  overflow-x: auto;
  margin-bottom: 1.4rem;
  position: relative;
}
.article-content pre::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, transparent 70%);
  border-radius: var(--radius) var(--radius) 0 0;
}
.article-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: #cdd9e5;
  font-size: 0.875rem;
}
.article-content blockquote {
  border-left: 3px solid var(--faint);
  padding: 0.6rem 1.2rem;
  color: var(--muted);
  margin: 1.5rem 0;
  font-style: italic;
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.article-content img {
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.article-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.2rem;
  font-size: 0.9rem;
}
.article-content th {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0.5rem 0.8rem;
  border-bottom: 2px solid var(--border);
  text-align: left;
}
.article-content td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
}

/* ─── Difficulty badge ─── */
.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.63rem;
  padding: 0.15rem 0.55rem;
  border-radius: 2px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.badge-easy   { background: rgba(74,222,128,0.1); color: var(--green); border: 1px solid rgba(74,222,128,0.2); }
.badge-medium { background: rgba(251,191,36,0.1);  color: var(--yellow); border: 1px solid rgba(251,191,36,0.2); }
.badge-hard   { background: rgba(248,113,113,0.1); color: var(--red);    border: 1px solid rgba(248,113,113,0.2); }

/* ─── Related posts ─── */
.related-posts {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.related-posts h3 {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}
.related-list { list-style: none; }
.related-list li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
.related-list li a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.15s, padding-left 0.15s;
  display: block;
}
.related-list li a::before {
  content: '→';
  margin-right: 0.6rem;
  color: var(--accent);
  font-size: 0.8em;
}
.related-list li a:hover {
  color: var(--accent);
  padding-left: 0.3rem;
}

/* ─── Pagination ─── */
.pagination {
  display: flex;
  gap: 0.3rem;
  margin-top: 2.5rem;
  justify-content: center;
}
.pagination a, .pagination span {
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.pagination a:hover { color: var(--text); border-color: var(--muted); }
.pagination .active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  font-weight: 600;
}

/* ─── Buttons ─── */
.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 0.45rem 1rem;
  border-radius: 3px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.btn-primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.btn-primary:hover { background: transparent; color: var(--accent); }
.btn-danger { background: transparent; color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: var(--red); color: var(--bg); }
.btn-secondary { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.btn-secondary:hover { color: var(--text); border-color: var(--muted); }
.btn-sm { padding: 0.22rem 0.6rem; font-size: 0.7rem; }

.markdown-editor {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.markdown-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.45rem;
  border-bottom: 1px solid var(--border);
  background: var(--code-bg);
}

.markdown-toolbar button {
  min-width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.72rem;
  cursor: pointer;
}

.markdown-toolbar button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.markdown-toolbar .toolbar-spacer {
  flex: 1;
}

.markdown-textarea {
  min-height: 460px;
  border: 0 !important;
  border-radius: 0 !important;
  font-family: var(--mono);
  line-height: 1.65;
  resize: vertical;
}

.markdown-preview {
  border-top: 1px solid var(--border);
  padding: 1.2rem;
  background: var(--bg);
}

/* ─── Forms ─── */
.form-group { margin-bottom: 1.3rem; }
.form-group label {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.form-control {
  width: 100%;
  padding: 0.55rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--body);
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-control::placeholder { color: var(--muted); }
textarea.form-control { min-height: 340px; font-family: var(--mono); font-size: 0.83rem; resize: vertical; }
select.form-control { cursor: pointer; }
.field-validation-error {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--red);
  display: block;
  margin-top: 0.3rem;
}
.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
  cursor: pointer;
}

/* ─── Gece/Gündüz toggle ─── */
.theme-toggle {
  position: relative;
  width: 52px;
  height: 28px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.theme-toggle:hover {
  border-color: var(--accent);
}
.theme-toggle:focus-visible {
  box-shadow: 0 0 0 2px var(--accent-glow), 0 0 0 3px var(--accent);
}

.toggle-track {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

/* ☾ ve ☀ sabit ikonlar */
.toggle-icon {
  position: absolute;
  font-size: 10px;
  line-height: 1;
  color: var(--muted);
  pointer-events: none;
  transition: opacity 0.2s, color 0.2s;
  z-index: 1;
}
.toggle-icon--moon { left: 7px; }
.toggle-icon--sun  { right: 7px; }

/* Gece modunda: moon soluk, sun görünür */
.toggle-icon--moon { opacity: 0.35; }
.toggle-icon--sun  { opacity: 1; }

/* Gündüz modunda: moon görünür, sun soluk */
[data-theme="light"] .toggle-icon--moon { opacity: 1; }
[data-theme="light"] .toggle-icon--sun  { opacity: 0.35; }

/* Kayan amber top */
.toggle-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3), 0 0 8px var(--accent-glow);
  transition: left 0.32s cubic-bezier(0.34, 1.56, 0.64, 1),
              background 0.2s,
              box-shadow 0.2s;
  z-index: 2;
}

/* Gündüz modunda thumb sağa kayar */
[data-theme="light"] .toggle-thumb {
  left: 28px; /* 52 - 4 - 20 = 28 */
}

/* Basma efekti */
.theme-toggle:active .toggle-thumb {
  width: 24px;
  transition: left 0.32s cubic-bezier(0.34, 1.56, 0.64, 1),
              width 0.1s ease,
              background 0.2s;
}
[data-theme="light"] .theme-toggle:active .toggle-thumb {
  left: 24px; /* kısalınca sağa doğru genişler */
}

/* ─── Footer ─── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 0;
  margin-top: 4rem;
}
.site-footer p {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.02em;
}

/* ─── Post Form (Admin editor) ─── */
.pf-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 1.5rem;
  align-items: start;
}

.pf-title-input {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-style: italic;
}

.pf-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.pf-label-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}

.pf-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.62rem;
  cursor: help;
  flex-shrink: 0;
}

.pf-charcount {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
  margin-left: auto;
}
.pf-charcount.warn { color: var(--yellow); }
.pf-charcount.over { color: var(--red); }

.pf-charbar {
  height: 2px;
  background: var(--faint);
  border-radius: 1px;
  margin-top: 0.3rem;
  overflow: hidden;
}
.pf-charbar-fill {
  height: 100%;
  background: var(--green);
  border-radius: 1px;
  width: 0;
  transition: width 0.2s, background 0.2s;
}

/* Markdown editor header */
.me-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}
.me-viewmode {
  margin-left: auto;
  display: flex;
  gap: 2px;
}
.me-vm-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  width: 28px;
  height: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.me-vm-btn:hover { color: var(--text); border-color: var(--muted); }
.me-vm-btn.active { background: var(--accent); color: var(--bg); border-color: var(--accent); }

/* Editor wrapper */
.me-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--code-bg);
}
.me-wrap.is-fs {
  position: fixed;
  inset: 0;
  z-index: 200;
  border-radius: 0;
  border: none;
}

/* Toolbar */
.me-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0.4rem 0.6rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.me-toolbar-group { display: flex; gap: 2px; }
.me-sep { width: 1px; height: 16px; background: var(--border); margin: 0 0.3rem; align-self: center; }
.me-toolbar-spacer { flex: 1; }

.me-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 0.18rem 0.42rem;
  cursor: pointer;
  line-height: 1.5;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.me-btn:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--border);
}
.me-btn--fs { font-size: 0.9rem; opacity: 0.55; }
.me-btn--fs:hover { opacity: 1; }

/* Panes */
.me-panes {
  display: flex;
  flex: 1;
  min-height: 0;
}
.me-editor-pane {
  flex: 1;
  display: flex;
  min-width: 0;
}
.me-preview-pane {
  flex: 1;
  min-width: 0;
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding: 1.2rem 1.4rem;
  background: var(--bg);
  max-height: 520px;
}

.me-textarea {
  width: 100%;
  min-height: 420px;
  max-height: 520px;
  padding: 1.1rem;
  background: var(--code-bg);
  border: none;
  outline: none;
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--text);
  line-height: 1.85;
  resize: vertical;
  tab-size: 2;
}
.me-wrap.is-fs .me-textarea {
  min-height: calc(100vh - 88px);
  max-height: calc(100vh - 88px);
}
.me-wrap.is-fs .me-preview-pane {
  max-height: calc(100vh - 88px);
}

/* Footer */
.me-footer {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.8rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted);
}
.me-dot { opacity: 0.35; }
.me-shortcuts { margin-left: auto; opacity: 0.4; }

/* Sidebar cards */
.pf-sidebar { display: flex; flex-direction: column; gap: 1rem; }

.pf-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.pf-card-title {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}
.pf-card-title::before { content: '> '; opacity: 0.6; }

.pf-card .form-group { margin-bottom: 0.85rem; }
.pf-card .form-group:last-child { margin-bottom: 0; }

/* Publish toggle */
.pf-publish-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  margin-top: 0.25rem;
}
.pf-publish-toggle input { display: none; }
.pf-publish-track {
  position: relative;
  width: 36px;
  height: 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.pf-publish-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--muted);
  transition: left 0.2s, background 0.2s;
}
.pf-publish-toggle input:checked ~ .pf-publish-track {
  background: var(--accent-glow);
  border-color: var(--accent);
}
.pf-publish-toggle input:checked ~ .pf-publish-track .pf-publish-thumb {
  left: 18px;
  background: var(--accent);
}
.pf-publish-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Tag chips */
.pf-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  max-height: 150px;
  overflow-y: auto;
}
.pf-tag-chip {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0.18rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--surface-2);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  user-select: none;
}
.pf-tag-chip input { display: none; }
.pf-tag-chip:has(input:checked) {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* Drag-over state */
.me-textarea.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
  background: color-mix(in srgb, var(--code-bg) 85%, var(--accent) 15%);
}

/* Draft autosave bar */
#me-draft-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.4rem;
  min-height: 1.4rem;
}
#me-draft-status {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted);
}

/* Shortcut panel overlay */
#me-shortcut-panel {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 300;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
#me-shortcut-panel.is-open { display: flex; }

.me-sp-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  width: min(480px, 90vw);
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.me-sp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}
.me-sp-title {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.me-sp-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0.1rem 0.3rem;
  transition: color 0.15s;
}
.me-sp-close:hover { color: var(--text); }

.me-sp-table {
  width: 100%;
  border-collapse: collapse;
}
.me-sp-table tr {
  border-bottom: 1px solid var(--border);
}
.me-sp-table tr:last-child { border-bottom: none; }
.me-sp-table td {
  padding: 0.5rem 0.4rem;
  font-size: 0.82rem;
  color: var(--muted);
  vertical-align: middle;
}
.me-sp-table td:last-child { color: var(--text); padding-left: 1rem; }

kbd {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.68rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 3px;
  padding: 0.1rem 0.45rem;
  color: var(--accent);
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .pf-layout { grid-template-columns: 1fr; }
  .pf-sidebar {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}
@media (max-width: 600px) {
  .pf-row2 { grid-template-columns: 1fr; }
}

/* ─── Hakkımda sayfası ─── */
.about-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
  align-items: start;
}

.about-card {
  position: sticky;
  top: 5.5rem;
}

.about-card__terminal {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--code-bg);
}

.about-card__bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.about-card__dot {
  width: 10px; height: 10px; border-radius: 50%;
}

.about-card__winname {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted);
  margin-left: auto;
}

.about-card__body {
  padding: 1.1rem;
}

.about-card__cmd {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.about-card__prompt {
  color: var(--accent);
  margin-right: 0.4rem;
}

.about-card__cursor {
  display: inline-block;
  color: var(--accent);
  animation: blink 1.1s step-end infinite;
}

.about-card__out {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text);
  padding-left: 0.9rem;
  line-height: 1.6;
}

.about-card__name {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent);
}

.about-card__interests {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding-left: 0.9rem;
  margin-top: 0.2rem;
}

.about-card__interests span {
  font-family: var(--mono);
  font-size: 0.65rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 0.12rem 0.45rem;
  color: var(--muted);
}

.about-card__links {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.75rem;
}

.about-card__link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.about-card__link:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}

.about-card__link-icon { color: var(--accent); font-size: 0.9rem; }

.about-content { padding-top: 0.5rem; }

@media (max-width: 800px) {
  .about-layout { grid-template-columns: 1fr; }
  .about-card { position: static; }
}

/* ─── İletişim sayfası ─── */
.contact-layout {
  max-width: 620px;
}

.contact-header { margin-bottom: 2rem; }

.contact-title {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  font-weight: 700;
  font-style: italic;
  color: var(--text);
  margin: 0.3rem 0 0.5rem;
  line-height: 1.2;
}

.contact-subtitle {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.contact-channels {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2rem;
}

.contact-channel {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.95rem 1.1rem;
  background: var(--surface);
  text-decoration: none;
  transition: background 0.15s, border-left-color 0.15s;
  border-left: 3px solid transparent;
}

.contact-channel:hover {
  background: var(--surface-2);
  border-left-color: var(--accent);
}

.contact-channel__icon {
  font-size: 1.2rem;
  width: 2rem;
  text-align: center;
  color: var(--accent);
  flex-shrink: 0;
}

.contact-channel__body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
}

.contact-channel__label {
  font-family: var(--mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.contact-channel__value {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text);
}

.contact-channel:hover .contact-channel__value { color: var(--accent); }

.contact-channel__arrow {
  font-family: var(--mono);
  color: var(--faint);
  transition: color 0.15s, transform 0.15s;
}
.contact-channel:hover .contact-channel__arrow { color: var(--accent); transform: translateX(3px); }

.contact-content { margin-bottom: 2rem; }

.contact-note {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--faint);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.8rem 1rem;
  line-height: 1.7;
}

.contact-note__prompt { color: var(--accent); margin-right: 0.4rem; }

/* ─── Admin nav (yeniden) ─── */
.admin-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.admin-nav__inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.2rem;
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: 46px;
}

.admin-nav__brand {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 1.25rem 0 0;
  border-right: 1px solid var(--border);
  margin-right: 0.5rem;
  letter-spacing: -0.01em;
}

.admin-nav__brand-icon { font-size: 0.85rem; }

.admin-nav__group {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 0.5rem;
}

.admin-nav__group-label {
  font-family: var(--mono);
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  margin-right: 0.6rem;
  padding-right: 0.6rem;
  border-right: 1px solid var(--border);
  white-space: nowrap;
}

.admin-nav__link {
  font-family: var(--mono);
  font-size: 0.73rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0 0.65rem;
  display: flex;
  align-items: center;
  height: 100%;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.admin-nav__link:hover { color: var(--text); }
.admin-nav__link.is-active { color: var(--accent); border-bottom-color: var(--accent); }

.admin-nav__sep {
  width: 1px;
  background: var(--border);
  margin: 0.6rem 0.5rem;
}

.admin-nav__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border);
}

.admin-nav__util {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.3rem 0.6rem;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
}
.admin-nav__util:hover { color: var(--text); background: var(--surface-2); }

.admin-nav__logout {
  background: none;
  border: none;
  cursor: pointer;
}

/* ─── Admin posts table polished ─── */
.admin-post-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.admin-post-table { border: none; }
.admin-post-table th { padding: 0.55rem 0.9rem; background: var(--surface); }
.admin-post-table td { padding: 0.7rem 0.9rem; vertical-align: top; }
.admin-post-table tbody tr:hover td { background: color-mix(in srgb, var(--surface) 60%, var(--surface-2) 40%); }
.admin-post-table .row-deleted td { opacity: 0.5; }

.col-title { min-width: 200px; }
.col-num { text-align: right; width: 90px; }
.col-date { width: 110px; }
.col-actions { width: 140px; }

.post-title-text {
  display: block;
  font-family: var(--serif);
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text);
  line-height: 1.35;
}

.post-slug {
  display: block;
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--faint);
  margin-top: 0.15rem;
}

.post-cat-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--link);
}

.view-count {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}

.post-date-main {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text);
}

.post-date-updated {
  display: block;
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--faint);
  margin-top: 0.1rem;
}

.action-row {
  display: flex;
  gap: 0.3rem;
  align-items: center;
  flex-wrap: wrap;
}

.admin-count {
  font-family: var(--mono);
  font-size: 0.62rem;
  background: var(--faint);
  border-radius: 10px;
  padding: 0.05rem 0.4rem;
  margin-left: 0.25rem;
  color: var(--muted);
}

/* ─── Admin content ─── */
.admin-page-title {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.5rem;
  font-style: italic;
}
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.6rem 0.8rem;
  text-align: left;
  border-bottom: 2px solid var(--border);
}
.admin-table td {
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text);
  vertical-align: middle;
}
.admin-table tr:hover td { background: var(--surface); }
.badge-published { background: rgba(74,222,128,0.1); color: var(--green); border: 1px solid rgba(74,222,128,0.2); }
.badge-draft     { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

/* ─── Back to top ─── */
.back-to-top {
  position: fixed;
  bottom: 1.75rem;
  right: 1.75rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s, color 0.15s, border-color 0.15s, background 0.15s;
  z-index: 90;
}
.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-to-top:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* ─── Post nav (prev/next) ─── */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 2.5rem 0 1rem;
}
.post-nav__item {
  background: var(--surface);
  min-height: 4rem;
}
.post-nav__item--next { border-left: 1px solid var(--border); }
.post-nav__link {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.9rem 1.1rem;
  text-decoration: none;
  height: 100%;
  transition: background 0.15s;
}
.post-nav__item--prev .post-nav__link { border-left: 3px solid transparent; }
.post-nav__item--next .post-nav__link {
  text-align: right;
  border-right: 3px solid transparent;
}
.post-nav__link:hover { background: var(--surface-2); }
.post-nav__item--prev .post-nav__link:hover { border-left-color: var(--accent); }
.post-nav__item--next .post-nav__link:hover { border-right-color: var(--accent); }
.post-nav__dir {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.post-nav__title {
  font-family: var(--serif);
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.4;
  font-style: italic;
}
.post-nav__link:hover .post-nav__title { color: var(--accent); }
@media (max-width: 560px) {
  .post-nav { grid-template-columns: 1fr; }
  .post-nav__item--next { border-left: none; border-top: 1px solid var(--border); }
  .post-nav__item--next .post-nav__link { text-align: left; }
}

/* ─── Code copy button ─── */
.code-copy-btn {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.62rem;
  padding: 0.2rem 0.55rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  letter-spacing: 0.04em;
  z-index: 2;
  line-height: 1.6;
}
.code-copy-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}
.code-copy-btn.copied {
  color: var(--green);
  border-color: rgba(74,222,128,0.3);
}

/* ─── Table of contents ─── */
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
}
.toc__label {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
  display: block;
}
.toc__label::before { content: '> '; opacity: 0.7; }
.toc__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.toc__item a {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
  line-height: 1.5;
}
.toc__item a:hover { color: var(--accent); }
.toc__item a::before {
  content: '–';
  margin-right: 0.45rem;
  color: var(--faint);
  font-family: var(--mono);
}
.toc__item--h3 { padding-left: 1rem; }
.toc__item--h3 a::before { content: '·'; }

/* ─── Share bar ─── */
.share-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 2.5rem 0 1.5rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.share-bar__label {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 0.25rem;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--mono);
  font-size: 0.73rem;
  padding: 0.32rem 0.8rem;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  letter-spacing: 0.02em;
}
.share-btn:hover {
  color: var(--text);
  border-color: var(--muted);
  background: var(--surface-2);
}
.share-btn--x:hover   { color: var(--text); }
.share-btn--wa:hover  { color: var(--green); border-color: rgba(74,222,128,0.4); }
.share-btn--link:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-glow); }
.share-btn--link.link-copied { color: var(--green); border-color: rgba(74,222,128,0.3); }

/* ─── Related posts grid ─── */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 1rem;
}
.related-card {
  background: var(--surface);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  transition: background 0.15s;
  border-left: 3px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}
.related-card:hover {
  background: var(--surface-2);
  border-left-color: var(--accent);
}
.related-card__cover {
  width: 100%;
  height: 120px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.related-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.related-card:hover .related-card__cover img { transform: scale(1.04); }
.related-card__body {
  padding: 0.85rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.related-card__cat {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--link);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.related-card__title {
  font-family: var(--serif);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  font-style: italic;
}
.related-card:hover .related-card__title { color: var(--accent); }

/* ─── 404 / Error page ─── */
.error-page {
  text-align: center;
  padding: 4rem 0;
}
.error-page__code {
  font-family: var(--mono);
  font-size: clamp(5rem, 15vw, 9rem);
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  text-shadow: 0 0 60px var(--accent-glow);
  display: block;
  margin-bottom: 0;
}
.error-page__msg {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.error-page__msg::before { content: '> '; }
.error-page__title {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 3vw, 1.9rem);
  font-weight: 700;
  color: var(--text);
  font-style: italic;
  margin-bottom: 1rem;
}
.error-page__desc {
  font-family: var(--body);
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 480px;
  margin: 0 auto 2rem;
}
.error-page__links {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ─── Responsive ─── */
@media (max-width: 640px) {
  .post-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .search-form input { width: 110px; }
  .search-form input:focus { width: 150px; }
  .post-list-item { flex-wrap: wrap; gap: 0.4rem; }
  .post-list-item .post-date { min-width: auto; }
  .home-hero { padding: 2rem 0 1.5rem; }
}
