/* ═══════════════════════════════════════════════════════════════
   SLICK BLOG - Main Stylesheet
   Font: Work Sans | Colors: Slick design system
═══════════════════════════════════════════════════════════════ */

/* ── Variables ────────────────────────────────────────────────── */
:root {
  --primary:         #6fb3ff;
  --primary-hover:   #64a1e7;
  --primary-dim:     #6fb3ff22;
  --text:            #333;
  --text-secondary:  #555;
  --text-tertiary:   #777;
  --bg:              #fcf8fb;
  --bg-secondary:    #f5f7fb;
  --bg-card:         #ffffff;
  --border:          #dadce0;
  --shadow-sm:       0 1px 4px rgba(0,0,0,.07);
  --shadow-md:       0 4px 18px rgba(0,0,0,.10);
  --shadow-lg:       0 12px 40px rgba(0,0,0,.13);
  --radius-sm:       6px;
  --radius-md:       12px;
  --radius-lg:       18px;
  --font:            'Work Sans', system-ui, sans-serif;
  --transition:      .2s ease;
  --header-h:        64px;
  --nav-feed-offset: 0px;
  --container:       1160px;
}

[data-theme="dark"] {
  --text:            #eaecef;
  --text-secondary:  #aaa;
  --text-tertiary:   #888;
  --bg:              #1a1c22;
  --bg-secondary:    #222530;
  --bg-card:         #23262f;
  --border:          #3a3d4a;
  --shadow-sm:       0 1px 4px rgba(0,0,0,.3);
  --shadow-md:       0 4px 18px rgba(0,0,0,.4);
  --shadow-lg:       0 12px 40px rgba(0,0,0,.5);
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--nav-feed-offset) + 12px);
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  transition: background var(--transition), color var(--transition);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }
button { font-family: var(--font); cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }

/* ── Utilities ───────────────────────────────────────────────── */
.container { max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.text-muted { color: var(--text-tertiary); }
.required { color: #e05252; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .6rem 1.25rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .9rem; transition: all var(--transition);
  white-space: nowrap; border: 2px solid transparent;
}
.btn-primary {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
.btn-secondary {
  background: var(--bg-secondary); color: var(--text); border-color: var(--border);
}
.btn-secondary:hover { background: var(--border); color: var(--text); }
.btn-sm { padding: .42rem .9rem; font-size: .82rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── Form Controls ───────────────────────────────────────────── */
.form-label {
  display: block; font-size: .85rem; font-weight: 600;
  color: var(--text-secondary); margin-bottom: .35rem;
}
.form-hint { font-size: .78rem; color: var(--text-tertiary); margin-top: .3rem; }
.form-hint-inline { font-weight: 400; color: var(--text-tertiary); }
.form-control {
  width: 100%; padding: .6rem .85rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-card); color: var(--text);
  font-family: var(--font); font-size: .92rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}
textarea.form-control { resize: vertical; min-height: 80px; }
.form-group { margin-bottom: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ── Alerts ──────────────────────────────────────────────────── */
.alert { padding: .75rem 1rem; border-radius: var(--radius-sm); font-size: .9rem; margin-bottom: 1rem; }
.alert-error { background: #e0525218; color: #c0392b; border: 1px solid #e0525230; }
.alert-success { background: #27ae6018; color: #1a7a45; border: 1px solid #27ae6030; }

/* ── Badge ───────────────────────────────────────────────────── */
.category-badge {
  display: inline-flex; align-items: center;
  padding: .2rem .65rem; border-radius: 20px; font-size: .74rem;
  font-weight: 600; letter-spacing: .02em; border: 1px solid transparent;
  background: var(--primary-dim); color: var(--primary);
  transition: opacity var(--transition); white-space: nowrap;
}
.category-badge:hover { opacity: .85; }
.category-badge--sm { font-size: .68rem; padding: .15rem .5rem; }

/* ── Site Header ─────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg); border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  height: var(--header-h);
}
.header-inner {
  display: flex; align-items: center; gap: 1.5rem; height: 100%;
}
.site-logo {
  display: flex; align-items: center; gap: .35rem; flex-shrink: 0;
}
.logo-label {
  font-size: .75rem; font-weight: 600; color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: .07em; margin-top: 2px;
}
.header-nav { display: flex; align-items: center; gap: 1.75rem; margin-left: auto; }
.nav-link { font-size: .9rem; font-weight: 500; color: var(--text-secondary); }
.nav-link:hover { color: var(--primary); }
.header-actions { display: flex; align-items: center; gap: .75rem; }

.theme-toggle {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); background: var(--bg-secondary);
  border: 1.5px solid var(--border); transition: all var(--transition);
}
.theme-toggle:hover { color: var(--primary); border-color: var(--primary); }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
[data-theme="light"] .icon-sun,
:root:not([data-theme]) .icon-sun { display: none; }
[data-theme="light"] .icon-moon,
:root:not([data-theme]) .icon-moon { display: block; }

.mobile-nav-toggle {
  display: none; flex-direction: column; justify-content: space-between;
  width: 28px; height: 20px; padding: 0; background: none; border: none;
  cursor: pointer;
}
.mobile-nav-toggle span {
  display: block; width: 100%; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: all var(--transition);
}
.mobile-nav { display: none; }

/* ── Sticky category + search (below header, all pages) ─────── */
.nav-feed-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.nav-feed-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.25rem;
  justify-content: space-between;
}
.nav-feed-pills {
  flex: 1;
  min-width: min(100%, 280px);
  margin-bottom: 0;
}
.nav-search-form {
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  overflow: hidden;
  min-width: min(100%, 240px);
  max-width: 340px;
}
.nav-search-input {
  flex: 1;
  border: none;
  padding: 0.45rem 0.75rem;
  font-family: var(--font);
  font-size: 0.88rem;
  background: transparent;
  color: var(--text);
  min-width: 0;
}
.nav-search-input:focus {
  outline: none;
}
.nav-search-input::placeholder {
  color: var(--text-tertiary);
}
.nav-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.7rem;
  background: var(--bg-secondary);
  border: none;
  border-left: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.nav-search-btn:hover {
  color: var(--primary);
  background: var(--primary-dim);
}

/* ── Featured Post ───────────────────────────────────────────── */
.featured-section { padding: 3rem 0 2rem; }
.featured-card {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-md); transition: box-shadow var(--transition), transform var(--transition);
  color: inherit;
}
.featured-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.featured-image { position: relative; aspect-ratio: 16/9; }
.featured-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.featured-card:hover .featured-image img { transform: scale(1.03); }
.featured-body {
  padding: 2.5rem 2.75rem; display: flex; flex-direction: column;
  justify-content: center; gap: .9rem;
}
.featured-title {
  font-size: 1.8rem; font-weight: 700; line-height: 1.25;
  color: var(--text);
}
.featured-excerpt { color: var(--text-secondary); font-size: 1rem; line-height: 1.6; }
.featured-meta { display: flex; align-items: center; gap: .5rem; font-size: .82rem; color: var(--text-tertiary); }
.meta-dot { opacity: .5; }

.featured-section--category { padding: 2rem 0 1.5rem; }

/* ── Feed Section ────────────────────────────────────────────── */
.feed-section { padding: 2.5rem 0 4rem; }

.category-pills {
  display: flex; flex-wrap: wrap; gap: .5rem;
}
.category-pill {
  padding: .38rem .9rem; border-radius: 20px;
  border: 1.5px solid var(--border); font-size: .82rem; font-weight: 500;
  color: var(--text-secondary); background: var(--bg-card);
  transition: all var(--transition);
}
.category-pill:hover, .category-pill.active {
  border-color: var(--primary); color: var(--primary);
  background: var(--primary-dim);
}

/* ── Posts Grid ──────────────────────────────────────────────── */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.75rem;
}
.posts-grid--3 { grid-template-columns: repeat(3, 1fr); }

.post-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); overflow: hidden;
  box-shadow: var(--shadow-sm); transition: box-shadow var(--transition), transform var(--transition);
  display: flex; flex-direction: column;
}
.post-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.post-card-image-link { display: block; overflow: hidden; }
.post-card-image { aspect-ratio: 16/9; overflow: hidden; }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.post-card:hover .post-card-image img { transform: scale(1.04); }
.post-card-body { padding: 1.25rem 1.35rem 1.4rem; flex: 1; display: flex; flex-direction: column; gap: .55rem; }
.post-card-title { font-size: 1.05rem; font-weight: 700; line-height: 1.35; }
.post-card-title a { color: var(--text); }
.post-card-title a:hover { color: var(--primary); }
.post-card-excerpt { font-size: .88rem; color: var(--text-secondary); line-height: 1.55; flex: 1; }
.post-card-meta { display: flex; align-items: center; gap: .4rem; font-size: .78rem; color: var(--text-tertiary); margin-top: auto; }

/* Tile grid (latest stays featured; rest are square cards) */
.posts-grid--tiles {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.post-card--compact {
  border-radius: var(--radius-md);
}
.post-card--compact .post-card-title {
  font-size: 0.95rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card--compact .post-card-excerpt {
  font-size: 0.8rem;
  -webkit-line-clamp: 3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card--compact .post-card-body {
  padding: 1rem 1rem 1.1rem;
  gap: 0.45rem;
}
.post-card-image--tile {
  aspect-ratio: 1;
}
.rich-editor-wrap table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.88rem;
}
.rich-editor-wrap th,
.rich-editor-wrap td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.5rem;
  min-width: 2.5rem;
}
.rich-editor-wrap th {
  background: var(--bg-secondary);
  font-weight: 600;
}
.post-card-image--placeholder {
  background: linear-gradient(145deg, var(--primary-dim), var(--bg-secondary));
  min-height: 120px;
}

/* ── Pagination ──────────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: .5rem; margin-top: 3rem; flex-wrap: wrap;
}
.pagination-btn, .pagination-page {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .45rem .9rem; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); font-size: .85rem; font-weight: 500;
  color: var(--text-secondary); background: var(--bg-card);
  transition: all var(--transition);
}
.pagination-btn:hover, .pagination-page:hover {
  border-color: var(--primary); color: var(--primary); background: var(--primary-dim);
}
.pagination-page.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.pagination-pages { display: flex; gap: .4rem; }

/* ── Post Hero ───────────────────────────────────────────────── */
.post-hero { background: var(--bg-secondary); border-bottom: 1px solid var(--border); }
.post-hero-image {
  width: 100%;
}
.post-hero-image img { width: 100%; height: 100%; object-fit: cover;}
.post-hero-content {
  padding: 2.5rem 0 2rem; display: flex; flex-direction: column; gap: 1rem;
}
.post-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 700;
  line-height: 1.2; color: var(--text); max-width: 820px;
}
.post-meta-row {
  display: flex; align-items: center; flex-wrap: wrap;
  justify-content: space-between; gap: 1rem;
}
/* Post hero “Share”: neutral class names (not .share-*) reduce cosmetic ad-block hiding after paint */
.post-meta-group {
  display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--text-tertiary);
  flex: 1 1 auto;
  min-width: 0;
}
.read-time { display: flex; align-items: center; gap: .3rem; }
.post-hero-external {
  display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .75rem;
  flex: 0 0 auto;
}
.post-hero-external-inner {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: .35rem;
  flex-shrink: 0;
}
.post-hero-external-label { font-size: .8rem; color: var(--text-tertiary); flex-shrink: 0; }
.post-hero-pill {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  border: 1.5px solid var(--border); color: var(--text-secondary);
  background: var(--bg-card); transition: all var(--transition);
  flex-shrink: 0;
  cursor: pointer;
  font: inherit; padding: 0;
  -webkit-appearance: none; appearance: none;
}
.post-hero-pill svg { display: block; }
.post-hero-pill:hover { border-color: var(--primary); color: var(--primary); }
.post-hero-pill.copied { color: #27ae60; border-color: #27ae60; }

/* ── Post Layout ─────────────────────────────────────────────── */
.post-layout { display: grid; grid-template-columns: 1fr 240px; gap: 3.5rem; align-items: start; }

/* Draft preview (admin) */
.draft-preview-banner {
  background: linear-gradient(90deg, #f39c1218 0%, var(--bg-secondary) 100%);
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.draft-preview-banner .container {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem;
}
.draft-preview-banner strong { color: var(--text); font-weight: 700; }

[data-theme="dark"] .draft-preview-banner {
  background: linear-gradient(90deg, #f39c1220 0%, var(--bg-secondary) 100%);
}

/* ── Prose (post body) ───────────────────────────────────────── */
.prose {
  font-size: 1.06rem; line-height: 1.82; color: var(--text);
  max-width: 720px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  font-weight: 700; line-height: 1.25; color: var(--text);
  margin: 2rem 0 .75rem;
}
.prose h2 { font-size: 1.6rem; }
.prose h3 { font-size: 1.3rem; }
.prose h4 { font-size: 1.1rem; }
.prose p { margin-bottom: 1.3rem; }
.prose a { color: var(--primary); border-bottom: 1px solid var(--primary-dim); }
.prose a:hover { border-color: var(--primary); }
.prose ul, .prose ol { padding-left: 1.5rem; margin-bottom: 1.3rem; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: .4rem; }
.prose .contains-task-list { list-style: none; padding-left: 0; margin-left: 0; }
.prose .task-list-item {
  list-style: none;
  padding-left: 0.15rem;
  margin-left: 0;
}
.prose .task-list-item-checkbox {
  margin-right: 0.45rem;
  vertical-align: middle;
  accent-color: var(--primary);
}
.prose s { text-decoration: line-through; color: var(--text-tertiary); }
.prose blockquote {
  border-left: 4px solid var(--primary); margin: 1.5rem 0;
  padding: .8rem 1.25rem; background: var(--primary-dim);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary); font-style: italic;
}
.prose blockquote p { margin-bottom: 0; }
.prose pre {
  background: #1e2130; color: #e6edf3; border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem; overflow-x: auto; margin: 1.5rem 0;
  font-size: .9rem; line-height: 1.6;
}
[data-theme="dark"] .prose pre { background: #0d0f18; }
.prose code {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 4px; padding: .15em .45em;
  font-size: .88em; font-family: 'Fira Code', 'Cascadia Code', monospace;
  color: var(--primary);
}
.prose pre code { background: none; border: none; padding: 0; color: inherit; font-size: inherit; }
.prose img { border-radius: var(--radius-md); margin: 1.5rem 0; box-shadow: var(--shadow-md); }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .92rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: .6rem .9rem; text-align: left; }
.prose th { background: var(--bg-secondary); font-weight: 600; }
.prose .video-embed { margin: 1.5rem 0; border-radius: var(--radius-md); overflow: hidden; aspect-ratio: 16/9; }
.prose .video-embed iframe { width: 100%; height: 100%; border: none; }

/* ── TOC Sidebar ─────────────────────────────────────────────── */
.post-sidebar { position: sticky; top: calc(var(--header-h) + 1.5rem); }
.toc-widget { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1.2rem 1.35rem; }
.toc-heading { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-tertiary); margin-bottom: .75rem; }
.toc { display: flex; flex-direction: column; gap: .1rem; }
.toc a { font-size: .83rem; color: var(--text-secondary); padding: .25rem .4rem; border-radius: 4px; border-left: 2px solid transparent; transition: all var(--transition); }
.toc a:hover, .toc a.active { color: var(--primary); border-left-color: var(--primary); background: var(--primary-dim); }
.toc a.toc-h3 { padding-left: 1rem; font-size: .8rem; }

/* ── Post Tags ───────────────────────────────────────────────── */
.post-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2.5rem; margin-bottom: 2rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.post-tag { padding: .28rem .7rem; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 20px; font-size: .78rem; color: var(--text-tertiary); }

/* ── Related Posts ───────────────────────────────────────────── */
.related-posts { margin-top: 4rem; padding-top: 2.5rem; border-top: 1px solid var(--border); }
.related-heading { font-size: 1.3rem; font-weight: 700; margin-bottom: 1.5rem; }
.related-heading span { color: var(--primary); }

/* ── Category Hero ───────────────────────────────────────────── */
.category-hero {
  padding: 4rem 0 3rem;
  background: linear-gradient(135deg, var(--primary-dim) 0%, var(--bg-secondary) 100%);
  border-bottom: 1px solid var(--border);
}
.category-hero-inner { max-width: 620px; display: flex; flex-direction: column; gap: .9rem; }
.category-hero-badge { display: inline-flex; padding: .3rem .85rem; border-radius: 20px; font-size: .8rem; font-weight: 700; width: fit-content; }
.category-hero-title { font-size: 2.2rem; font-weight: 700; line-height: 1.2; color: var(--text); }
.category-hero-desc { font-size: 1rem; color: var(--text-secondary); }

/* ── Error Pages ─────────────────────────────────────────────── */
.error-page { text-align: center; padding: 6rem 1rem; }
.error-code { font-size: 6rem; font-weight: 800; color: var(--primary); line-height: 1; margin-bottom: 1rem; opacity: .6; }
.error-title { font-size: 1.8rem; font-weight: 700; margin-bottom: .75rem; }
.error-message { color: var(--text-secondary); margin-bottom: 2rem; }
.error-actions { display: flex; align-items: center; justify-content: center; gap: 1rem; flex-wrap: wrap; }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 4rem 1rem; color: var(--text-tertiary); }
.empty-state svg { margin: 0 auto 1rem; opacity: .4; }
.empty-state h2 { font-size: 1.3rem; font-weight: 600; margin-bottom: .4rem; color: var(--text-secondary); }
.empty-state p { margin-bottom: 1.2rem; }
.hero-empty { padding: 5rem 0; }

/* ── Footer ──────────────────────────────────────────────────── */
/* ── Newsletter signup ───────────────────────────────────────── */
.newsletter-signup {
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
}
.newsletter-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.5rem;
}
.newsletter-title { font-size: 1rem; font-weight: 700; margin-bottom: .25rem; color: var(--text); }
.newsletter-tagline { font-size: .9rem; color: var(--text-secondary); margin: 0; }
.newsletter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .6rem;
  flex: 2 1 280px;
}
.newsletter-input {
  min-width: 0;
  padding: .55rem .85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  font-family: var(--font);
  font-size: .92rem;
}
.newsletter-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}
.newsletter-btn { flex-shrink: 0; }
.newsletter-message {
  flex-basis: 100%;
  margin: 0;
  font-size: .85rem;
  min-height: 1.25em;
}
.newsletter-message.is-success { color: #1a7a45; }
.newsletter-message.is-error { color: #c0392b; }

/* In footer: one divider only (footer grid bottom border — not a second line on signup). */
.site-footer .newsletter-signup {
  padding: 1.5rem 0 0;
}

/* Dedicated /newsletter page */
.newsletter-page {
  padding-bottom: 3.5rem;
}
.newsletter-page-hero {
  padding: 2.75rem 0 1.5rem;
  background: linear-gradient(165deg, var(--primary-dim) 0%, var(--bg-secondary) 48%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
.newsletter-page-hero .container {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}
.newsletter-page-body {
  max-width: 560px;
}
.newsletter-page-title {
  font-size: clamp(1.65rem, 3.5vw, 2.15rem);
  font-weight: 700;
  margin: 0 0 0.65rem;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.newsletter-page-lead {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
  max-width: 40ch;
  margin-left: auto;
  margin-right: auto;
}
.newsletter-page .newsletter-signup {
  padding: 0;
}
.newsletter-page .newsletter-signup .container {
  padding-left: 0;
  padding-right: 0;
  max-width: none;
}
.newsletter-page .newsletter-inner {
  align-items: stretch;
  gap: 1.25rem;
  padding: 1.75rem 1.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.newsletter-page .newsletter-form {
  flex-direction: column;
  align-items: stretch;
}
.newsletter-page .newsletter-btn {
  width: 100%;
  justify-content: center;
}
.newsletter-page-unavailable {
  padding: 1.5rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-secondary);
}
.newsletter-page-unavailable-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  margin: 0 0 0.65rem;
}
.newsletter-page-unavailable p { margin: 0 0 0.85rem; }
.newsletter-page-unavailable p:last-of-type { margin-bottom: 0; }
.newsletter-page-unavailable-list {
  margin: 0.75rem 0 0;
  padding-left: 1.15rem;
  list-style: disc;
}
.newsletter-page-unavailable-list li { margin-bottom: 0.35rem; }
.newsletter-page-unavailable code {
  font-size: 0.84em;
  background: var(--bg-secondary);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

/* Unsubscribe confirmation (simple layout) */
.newsletter-unsub-page {
  padding: 2.75rem 1.25rem 3.5rem;
  max-width: 520px;
  margin: 0 auto;
}
.newsletter-unsub-page .newsletter-page-title { margin-bottom: 0.65rem; }
.newsletter-unsub-back { margin-top: 1.35rem; }
.newsletter-unsub-back a { font-weight: 600; color: var(--primary); }

.site-footer {
  background: var(--bg-secondary); border-top: 1px solid var(--border);
  padding: 3rem 0 1.5rem; margin-top: auto;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 1.75rem;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
}
.footer-tagline { font-size: .9rem; color: var(--text-secondary); margin: .6rem 0 1rem; }
.footer-search-cta {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1rem; background: var(--primary); color: #fff;
  border-radius: var(--radius-sm); font-size: .85rem; font-weight: 600;
  transition: background var(--transition);
}
.footer-search-cta:hover { background: var(--primary-hover); color: #fff; }
.footer-heading { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-tertiary); margin-bottom: .85rem; }
.footer-links { display: flex; flex-direction: column; gap: .4rem; }
.footer-links a { font-size: .9rem; color: var(--text-secondary); }
.footer-links a:hover { color: var(--primary); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem; font-size: .8rem; color: var(--text-tertiary); }
.site-footer .footer-bottom {
  margin-top: 1.35rem;
}
.footer-privacy-note { display: flex; align-items: center; gap: .35rem; }

/* ── Auth pages ──────────────────────────────────────────────── */
.admin-auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 2rem 1.25rem;
}
.auth-card {
  width: 100%; max-width: 540px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 2.5rem 2.75rem; box-shadow: var(--shadow-lg);
}
.auth-logo { display: flex; align-items: center; gap: .4rem; margin-bottom: 1.5rem; }
.auth-logo-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--text-tertiary); }
.auth-title { font-size: 1.5rem; font-weight: 700; margin-bottom: .3rem; }
.auth-subtitle { color: var(--text-secondary); font-size: .9rem; margin-bottom: 1.75rem; }
.auth-form { display: flex; flex-direction: column; gap: .2rem; }
.password-wrap { position: relative; }
.password-wrap .form-control { padding-right: 2.75rem; }
.password-toggle { position: absolute; right: .7rem; top: 50%; transform: translateY(-50%); color: var(--text-tertiary); padding: .2rem; }

/* ── Avatar upload ───────────────────────────────────────────── */
.avatar-upload { display: flex; align-items: center; gap: 1.25rem; }
.avatar-preview {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--bg-secondary); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-tertiary); overflow: hidden; flex-shrink: 0;
}
.avatar-upload-info { display: flex; flex-direction: column; gap: .3rem; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .featured-card { grid-template-columns: 1fr; }
  .post-layout { grid-template-columns: 1fr; }
  .post-sidebar { display: none; }
  .posts-grid--3 { grid-template-columns: repeat(2,1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1/-1; }
}
@media (max-width: 640px) {
  :root { --header-h: 56px; }
  .header-nav { display: none; }
  .mobile-nav-toggle { display: flex; }
  .mobile-nav {
    background: var(--bg-card); border-bottom: 1px solid var(--border);
    display: flex; flex-direction: column; padding: .75rem 1.25rem;
  }
  .mobile-nav-link { padding: .65rem 0; font-size: .95rem; color: var(--text-secondary); border-bottom: 1px solid var(--border); }
  .mobile-nav-link:last-child { border-bottom: none; }
  .mobile-nav[aria-hidden="true"] { display: none; }
  .posts-grid { grid-template-columns: 1fr; }
  .posts-grid--3 { grid-template-columns: 1fr; }
  .featured-body { padding: 1.5rem; }
  .featured-title { font-size: 1.35rem; }
  .auth-card { padding: 1.75rem 1.25rem; }
  .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
}
