/* ════════════════════════════════════════════════════════════════════
   WARM BRUTALISM × EMBER
   落ち着いた琥珀・テラコッタ × ブルータリズム tech blog design
   Fonts: Bebas Neue × Overpass Mono
   ════════════════════════════════════════════════════════════════════ */

/* ── DARK THEME (default) ── */
:root {
  --bg:          #0d0b09;
  --bg-deep:     #080604;
  --surface:     #141210;
  --surface-alt: #1c1916;
  --border:      rgba(192, 130, 62, 0.14);
  --border-md:   rgba(192, 130, 62, 0.28);
  --border-lg:   rgba(192, 130, 62, 0.52);
  --ink:         #ede5d8;
  --ink-2:       #8c8272;
  --ink-3:       #4a4034;
  --dark:        #0a0806;
  --dark-2:      #100d0a;
  --dark-border: rgba(192, 130, 62, 0.18);
  --dark-text:   #ede5d8;
  --dark-muted:  #5a5040;
  --accent:      #c0823e;
  --accent-h:    #d49450;
  --accent-bg:   rgba(192, 130, 62, 0.10);
  --danger:      #c45030;
  --danger-bg:   rgba(196, 80, 48, 0.12);
  --hot:         #b84040;
  --hot-bg:      rgba(184, 64, 64, 0.12);

  --ff-body:    "Plus Jakarta Sans", ui-sans-serif, -apple-system, "Hiragino Sans", "Yu Gothic UI", sans-serif;
  --ff-display: "Plus Jakarta Sans", ui-sans-serif, "Hiragino Sans", "Yu Gothic UI", sans-serif;
  --ff-mono:    "JetBrains Mono", ui-monospace, "Fira Code", "Courier New", monospace;

  /* Zero border-radius — strict brutalism */
  --r-xs:   4px;
  --r-sm:   6px;
  --r-md:   8px;
  --r-lg:   12px;
  --r-xl:   16px;
  --r-full: 9999px;

  /* Hard offset shadows (editorial/zine style) */
  --sh-xs: 0 1px 3px rgba(0,0,0,.22), 0 1px 2px rgba(0,0,0,.14);
  --sh-sm: 0 2px 8px rgba(0,0,0,.24), 0 1px 3px rgba(0,0,0,.14);
  --sh-md: 0 4px 16px rgba(0,0,0,.26), 0 2px 6px rgba(0,0,0,.12);
  --sh-lg: 0 8px 32px rgba(0,0,0,.28), 0 4px 12px rgba(0,0,0,.12);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}

/* ── LIGHT THEME (aged paper × ink) ── */
:root[data-theme="light"] {
  --bg:          #f5f0e8;
  --bg-deep:     #ebe4d8;
  --surface:     #faf7f1;
  --surface-alt: #f0ebe0;
  --border:      rgba(60, 40, 20, 0.16);
  --border-md:   rgba(60, 40, 20, 0.30);
  --border-lg:   rgba(60, 40, 20, 0.56);
  --ink:         #1c1408;
  --ink-2:       #5a4a34;
  --ink-3:       #a09080;
  --dark:        #ede6d8;
  --dark-2:      #e2d9c8;
  --dark-border: rgba(60, 40, 20, 0.18);
  --dark-text:   #1c1408;
  --dark-muted:  #8a7860;
  --accent:      #9e5c18;
  --accent-h:    #b86c24;
  --accent-bg:   rgba(158, 92, 24, 0.12);
  --danger:      #9e2c14;
  --danger-bg:   rgba(158, 44, 20, 0.10);
  --hot:         #8c2020;
  --hot-bg:      rgba(140, 32, 32, 0.10);

  --sh-xs: 3px 3px 0 rgba(60, 40, 20, 0.18);
  --sh-sm: 5px 5px 0 rgba(60, 40, 20, 0.14);
  --sh-md: 8px 8px 0 rgba(60, 40, 20, 0.10);
  --sh-lg: 14px 14px 0 rgba(60, 40, 20, 0.08);
  color-scheme: light;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--ff-body);
  font-size: 13.5px;
  line-height: 1.72;
  color: var(--ink);
  background-color: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Scanline texture — dark mode only */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.03) 3px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
  z-index: 9999;
}
:root[data-theme="light"] body::before { display: none; }

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { border: 0; cursor: pointer; background: none; }

/* ── ANIMATIONS ── */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes glitch {
  0%, 100% { transform: translate(0); filter: none; }
  20%       { transform: translate(-3px, 1px); filter: hue-rotate(90deg) saturate(2); }
  40%       { transform: translate(3px, -2px); filter: hue-rotate(200deg); }
  60%       { transform: translate(-2px, 2px); filter: hue-rotate(300deg) saturate(3); }
  80%       { transform: translate(2px, -1px); filter: hue-rotate(150deg); }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}
@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-18px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── SHELL ── */
.app-shell {
  width: min(1080px, calc(100vw - 32px));
  margin: 0 auto;
  padding-bottom: 80px;
}
.page-admin .app-shell {
  width: min(1460px, calc(100vw - 24px));
}

/* ── TOPBAR ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0;
  padding: 0;
  margin-bottom: 40px;
  background: var(--dark);
  border: none;
  border-bottom: 2px solid var(--accent);
  border-radius: var(--r-md);
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
:root[data-theme="light"] .topbar {
  background: var(--dark);
  border-bottom-color: var(--accent);
  box-shadow: 0 4px 0 rgba(192, 130, 62, 0.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  text-decoration: none;
  cursor: default;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: var(--r-md);
  background: var(--accent);
  display: grid;
  place-items: center;
  font-family: var(--ff-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: #000;
  letter-spacing: 0;
  flex-shrink: 0;
  transition: background 200ms;
}
.brand:hover .brand-mark {
  animation: glitch 380ms steps(1) 1;
  background: var(--hot);
}
:root[data-theme="light"] .brand-mark {
  background: var(--accent);
  color: #fff;
}
:root[data-theme="light"] .brand:hover .brand-mark {
  background: var(--hot);
}

.brand-copy h1 {
  margin: 0;
  font-family: var(--ff-display);
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--dark-text);
  letter-spacing: 0.10em;
  line-height: 1;
  text-transform: uppercase;
}

.section-label {
  margin: 0 0 3px;
  font-size: 0.60rem;
  font-weight: 700;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Force accent color on all section labels */
.profile-card .section-label,
.intro-card .section-label,
.posts-section .section-label,
.home-copy .section-label,
.content-section-head .section-label,
.admin-profile-card .section-label,
.admin-content-card .section-label,
.admin-history-card .section-label,
.admin-editor-card .section-label,
.modal-header .section-label,
.preview-card .section-label { color: var(--accent); }

.topbar-nav {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0 8px;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  color: var(--dark-muted);
  font-family: var(--ff-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: color 140ms, border-color 140ms;
  white-space: nowrap;
  border-radius: var(--r-md);
}
.nav-link:hover {
  color: var(--dark-text);
  border-bottom-color: rgba(238, 238, 245, 0.35);
}
.nav-link.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── BUTTONS ── */
.primary-button, .secondary-button, .danger-button, .text-button, .ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--r-md);
  font-family: var(--ff-mono);
  font-size: 0.70rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: transform 100ms var(--ease-out), box-shadow 100ms, background 120ms, color 120ms, border-color 120ms;
  white-space: nowrap;
  min-height: 38px;
}
.primary-button[disabled],
.secondary-button[disabled],
.danger-button[disabled],
.text-button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Remove old shimmer ::after from all buttons */
.primary-button::after, .secondary-button::after, .danger-button::after,
.text-button::after, .ghost-link::after, .genre-filter-btn::after { content: none; }

.primary-button {
  background: var(--accent);
  color: #000;
  border: 2px solid var(--accent);
  box-shadow: var(--sh-sm);
}
.primary-button:hover:not([disabled]) {
  transform: translateY(-1px);
  box-shadow: var(--sh-md);
}
.primary-button:active:not([disabled]) {
  transform: scale(0.98) !important;
  box-shadow: none !important;
}

.secondary-button {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--border-md);
}
.secondary-button:hover:not([disabled]) {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--sh-sm);
}

.danger-button {
  background: transparent;
  color: var(--danger);
  border: 2px solid var(--danger);
  box-shadow: var(--sh-xs);
}
.danger-button:hover:not([disabled]) {
  background: var(--danger-bg);
  transform: translateY(-1px);
  box-shadow: var(--sh-sm);
}

.text-button {
  background: transparent;
  color: var(--ink-2);
  border: 2px solid var(--border);
}
.text-button:hover:not([disabled]) {
  border-color: var(--border-md);
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow: var(--sh-xs);
}

.ghost-link {
  background: transparent;
  color: var(--dark-muted);
  border: 2px solid var(--dark-border);
  font-family: var(--ff-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.ghost-link:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--sh-xs);
}

.primary-button:active, .secondary-button:active, .danger-button:active,
.text-button:active, .ghost-link:active,
.genre-filter-btn:active, .featured-post:active, .post-card:active {
  transform: scale(0.98) !important;
  box-shadow: none !important;
}

button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: none;
}
.file-button { position: relative; overflow: hidden; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ── THEME TOGGLE ── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 12px;
  border-radius: var(--r-md);
  border: 2px solid var(--dark-border);
  background: transparent;
  color: var(--dark-text);
  font-family: var(--ff-mono);
  transition: border-color 140ms, color 140ms;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.theme-toggle-indicator {
  width: 20px;
  height: 20px;
  border-radius: var(--r-md);
  background: var(--accent);
  position: relative;
  flex-shrink: 0;
  transition: background 200ms;
}
.theme-toggle-indicator::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hot);
  opacity: 0;
  transition: opacity 200ms;
}
.theme-toggle[data-theme="light"] .theme-toggle-indicator::after { opacity: 1; }
.theme-toggle-copy { display: grid; gap: 1px; text-align: left; line-height: 1; }
.theme-toggle-caption {
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dark-muted);
}
.theme-toggle-value { font-size: 0.72rem; font-weight: 700; color: var(--dark-text); }

/* ── HERO / PAGE SHELL ── */
.hero {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 16px;
  margin-bottom: 32px;
}
.page-public .hero { grid-template-columns: 108px 1fr; gap: 12px; }
.page-home-main, .content-page { display: grid; gap: 24px; }

/* ── HOME BANNER ── */
.home-banner, .content-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-sm);
}
/* Gradient top-line accent */
.home-banner::before, .content-card-emphasis::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--hot), var(--accent));
  pointer-events: none;
}
.home-banner {
  padding: 36px clamp(22px, 4vw, 44px);
  display: grid;
  gap: 28px;
}
.home-copy { display: grid; gap: 14px; max-width: 72ch; position: relative; z-index: 1; }

.home-title, .content-title {
  margin: 0;
  font-family: var(--ff-display);
  font-size: clamp(2.6rem, 5.5vw, 5rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.home-description, .content-copy {
  margin: 0;
  color: var(--ink-2);
  line-height: 1.85;
  font-size: 0.84rem;
}
.home-description { max-width: 64ch; }
.home-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  position: relative;
  z-index: 1;
}

/* ── CONTENT PAGES ── */
.content-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 24px;
  align-items: start;
}
.content-card { padding: 28px clamp(20px, 3vw, 34px); }
.content-section-head { display: grid; gap: 4px; margin-bottom: 18px; }
.content-section-head h3, .content-subtitle {
  margin: 0;
  font-family: var(--ff-display);
  font-size: 1.7rem;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.page-aside { display: grid; gap: 22px; align-content: start; }
.profile-spotlight, .about-aside-profile {
  display: grid;
  gap: 16px;
  align-content: start;
  position: relative;
  z-index: 1;
}
.avatar-frame.avatar-frame-lg { width: 120px; border-radius: var(--r-md); }
.profile-role-large { font-size: 0.80rem; }

.quick-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.quick-link-card {
  display: grid;
  gap: 6px;
  padding: 18px 20px;
  border-radius: var(--r-md);
  border: 2px solid var(--border);
  background: var(--surface-alt);
  transition: transform 140ms, box-shadow 140ms, border-color 140ms;
}
.quick-link-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--sh-sm);
}
.quick-link-card strong {
  font-family: var(--ff-display);
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--accent);
}
.quick-link-card span { color: var(--ink-3); font-size: 0.75rem; line-height: 1.65; }

/* ── PROFILE CARD ── */
.profile-card, .intro-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-sm);
}
.profile-card { padding: 20px 16px; display: grid; gap: 14px; align-content: start; }
.page-public .profile-card { padding: 14px 12px; }
.avatar-frame {
  width: 120px;
  aspect-ratio: 1;
  border-radius: var(--r-md);
  overflow: hidden;
  background: linear-gradient(135deg, var(--surface-alt), var(--accent));
  border: 2px solid var(--border-md);
}
.page-public .avatar-frame { width: 64px; }
.avatar-frame img { width: 100%; height: 100%; object-fit: cover; }
.profile-identity { display: grid; gap: 4px; }
.profile-name {
  margin: 0;
  font-family: var(--ff-display);
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.page-public .profile-name { font-size: 1.1rem; }
.profile-role { margin: 0; font-size: 0.74rem; color: var(--ink-3); line-height: 1.5; }
.page-public .profile-role { font-size: 0.68rem; }
.intro-card { padding: 24px 28px; display: grid; gap: 20px; align-content: start; }
.page-public .intro-card { padding: 16px 18px; gap: 14px; }
.intro-main { display: grid; gap: 10px; }
.hero-title {
  margin: 0;
  font-family: var(--ff-display);
  font-size: clamp(2.1rem, 3.4vw, 3.5rem);
  font-weight: 400;
  line-height: 1.0;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.page-public .hero-title { font-size: clamp(1.5rem, 2.4vw, 2.2rem); }
.hero-description, .posts-copy, .post-excerpt, .preview-meta {
  margin: 0;
  color: var(--ink-2);
  line-height: 1.78;
}
.hero-description { font-size: 0.83rem; max-width: 60ch; }
.page-public .hero-description { font-size: 0.77rem; max-width: 54ch; }

/* ── STAT CARDS ── */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat-card {
  padding: 16px 18px;
  border-radius: var(--r-md);
  background: var(--bg-deep);
  border: 2px solid var(--border);
  border-left: 4px solid var(--accent);
  display: grid;
  gap: 6px;
  transition: border-color 140ms, transform 140ms, box-shadow 140ms;
}
.stat-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--sh-xs);
}
.stat-card span {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-3);
}
.stat-card strong {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--ff-display);
  letter-spacing: 0.08em;
}

/* ── CHIPS & GENRE BADGES ── */
.chip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-md);
  background: var(--surface);
  font-size: 0.70rem;
  font-family: var(--ff-mono);
  color: var(--ink-2);
  letter-spacing: 0.06em;
}
.page-public .chip { font-size: 0.66rem; padding: 2px 8px; }
.genre-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--r-md);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: var(--ff-mono);
  flex-shrink: 0;
}

/* ── SEARCH ── */
.search-field { display: block; width: min(280px, 100%); }
.search-label {
  display: block;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.search-field input,
.profile-form input,
.profile-form textarea,
.ai-settings-grid input,
.ai-settings-grid select,
.thumbnail-size-row input,
.editor-fields input,
.editor-fields textarea,
.editor-fields select {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--r-md);
  border: 2px solid var(--border);
  background: var(--bg-deep);
  color: var(--ink);
  font-family: var(--ff-mono);
  font-size: 0.82rem;
  transition: border-color 120ms, box-shadow 120ms;
}
.search-field input:focus,
.profile-form input:focus,
.profile-form textarea:focus,
.ai-settings-grid input:focus,
.ai-settings-grid select:focus,
.thumbnail-size-row input:focus,
.editor-fields input:focus,
.editor-fields textarea:focus,
.editor-fields select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}

/* ── POSTS SECTION ── */
.posts-section {
  margin-top: 0;
  position: relative;
  padding: 28px;
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-sm);
  overflow: hidden;
}
.posts-section::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--hot), var(--accent));
  pointer-events: none;
}
.posts-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.posts-header h2 {
  margin: 0;
  font-family: var(--ff-display);
  font-size: 2.4rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
}
.page-public .posts-header h2 { font-size: 1.9rem; }
.posts-copy { font-size: 0.76rem; margin-top: 4px; }

/* ── GENRE FILTER ── */
.genre-filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.genre-filter-btn {
  display: inline-flex;
  align-items: center;
  padding: 5px 13px;
  border-radius: var(--r-md);
  border: 2px solid var(--border-md);
  background: var(--surface-alt);
  color: var(--ink-2);
  font-family: var(--ff-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 140ms, border-color 140ms, background 140ms, color 140ms, box-shadow 140ms;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.genre-filter-btn:hover {
  border-color: var(--gc, var(--accent));
  color: var(--gc, var(--accent));
  background: var(--gc-bg, var(--accent-bg));
  transform: translateY(-1px);
  box-shadow: var(--sh-xs);
}
.genre-filter-btn.is-active {
  background: var(--gc, var(--accent));
  color: #000;
  border-color: var(--gc, var(--accent));
  box-shadow: var(--sh-xs);
}

/* ── FEATURED POST ── */
.featured-slot { margin-bottom: 20px; }
.featured-post {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 220px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-left: 5px solid var(--card-accent, var(--accent));
  border-radius: var(--r-md);
  box-shadow: var(--sh-sm);
  overflow: hidden;
  width: 100%;
  text-align: left;
  cursor: pointer;
  color: inherit;
  transition: box-shadow 160ms, transform 160ms, border-color 160ms;
  position: relative;
  isolation: isolate;
  animation: rise-in 500ms var(--ease-out) both;
  animation-delay: var(--enter-delay, 0ms);
}
.page-public .featured-post { grid-template-columns: 200px 1fr; min-height: 190px; }
.featured-post:hover {
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
  border-color: var(--card-accent, var(--accent));
}
/* Remove old shimmer */
.featured-post::before, .post-card::before, .admin-post-row::before { content: none; }

.featured-media, .post-thumb, .preview-thumbnail, .post-thumbnail {
  position: relative;
  overflow: hidden;
  background-position: center;
  background-size: cover;
}
.featured-media::after, .post-thumb::after, .preview-thumbnail::after, .post-thumbnail::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(0,0,0,0.04), rgba(0,0,0,0.64));
}
.thumbnail-badge, .thumb-initials {
  position: absolute;
  z-index: 1;
  color: rgba(255,255,255,0.90);
}
.thumbnail-badge {
  top: 10px;
  left: 10px;
  padding: 3px 9px;
  border-radius: var(--r-md);
  background: rgba(3, 3, 7, 0.78);
  border: 1px solid rgba(192, 130, 62, 0.22);
  font-family: var(--ff-mono);
  font-size: 0.60rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.thumb-initials {
  right: 12px;
  bottom: 10px;
  font-family: var(--ff-display);
  font-size: clamp(2rem, 3.5vw, 3.2rem);
  letter-spacing: 0.04em;
  color: var(--accent);
}
.featured-copy {
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 22px 30px;
}
.page-public .featured-copy { gap: 8px; padding: 16px 22px; }
.featured-meta, .card-meta, .post-date {
  font-size: 0.66rem;
  color: var(--ink-3);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-family: var(--ff-mono);
}
.featured-copy h3 {
  margin: 0;
  font-family: var(--ff-display);
  font-size: clamp(1.7rem, 2.8vw, 2.6rem);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.page-public .featured-copy h3 { font-size: clamp(1.2rem, 2vw, 1.7rem); }
.post-excerpt { font-size: 0.80rem; line-height: 1.75; }
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}
.card-badge-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--card-accent, var(--accent));
  font-family: var(--ff-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}
.card-cta::after {
  content: "→";
  font-size: 0.95rem;
  transition: transform 140ms var(--ease-out);
}
.featured-post:hover .card-cta::after, .post-card:hover .card-cta::after {
  transform: translate(5px, 0);
}

/* ── POST GRID & CARDS ── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.page-public .post-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.post-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-top: 4px solid var(--card-accent, var(--accent));
  border-radius: var(--r-md);
  box-shadow: var(--sh-xs);
  overflow: hidden;
  width: 100%;
  text-align: left;
  cursor: pointer;
  color: inherit;
  transition: box-shadow 160ms, transform 160ms, border-color 160ms;
  position: relative;
  isolation: isolate;
  animation: rise-in 500ms var(--ease-out) both;
  animation-delay: var(--enter-delay, 0ms);
}
.post-card:hover {
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
  border-color: var(--card-accent, var(--accent));
}
.post-thumb { min-height: 148px; }
.page-public .post-thumb { min-height: 126px; }
.post-card-copy { padding: 16px 18px 20px; display: grid; gap: 8px; min-width: 0; }
.post-card-copy h3 {
  margin: 0;
  font-family: var(--ff-display);
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.page-public .post-card-copy h3 { font-size: 1.1rem; }
.post-card-copy .post-excerpt {
  font-size: 0.75rem;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

/* ── ADMIN WORKSPACE ── */
.admin-workspace {
  display: grid;
  grid-template-columns: minmax(300px, 360px) 1fr;
  gap: 20px;
  align-items: start;
}
.admin-sidebar {
  display: grid;
  gap: 20px;
  position: sticky;
  top: 72px;
  align-self: start;
}
.admin-profile-card, .admin-content-card, .admin-history-card, .admin-editor-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-sm);
  padding: 22px 20px;
}
.admin-section-head { margin-bottom: 16px; }
.admin-section-head h2, .admin-toolbar h2, .admin-editor-head h2 {
  margin: 0;
  font-family: var(--ff-display);
  font-size: 1.7rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.1;
}
.admin-avatar-block { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.admin-avatar-frame {
  width: 64px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: linear-gradient(135deg, var(--surface-alt), var(--accent));
  flex-shrink: 0;
  aspect-ratio: 1;
  border: 2px solid var(--border-md);
}
.admin-avatar-frame img { width: 100%; height: 100%; object-fit: cover; }
.profile-form, .editor-fields { display: grid; gap: 14px; }
.profile-form label, .editor-fields label {
  display: grid;
  gap: 5px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}
.admin-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.topbar-actions, .topbar-nav, .inline-actions, .modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.topbar-nav { justify-content: flex-end; }
.admin-overview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.admin-search { width: 100%; margin-bottom: 4px; }
.admin-post-list { display: grid; gap: 10px; }
.page-admin .admin-post-list { max-height: calc(100vh - 500px); overflow: auto; padding-right: 2px; }
.admin-history-list { display: grid; gap: 10px; }
.page-admin .admin-history-list { max-height: 340px; overflow: auto; padding-right: 2px; }
.admin-post-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 2px solid var(--border);
  border-left: 4px solid var(--card-accent, var(--accent));
  background: var(--surface-alt);
  transition: border-color 140ms, transform 140ms, box-shadow 140ms;
  position: relative;
  overflow: hidden;
  animation: rise-in 460ms var(--ease-out) both;
  animation-delay: var(--enter-delay, 0ms);
}
.admin-post-row:hover {
  background: var(--surface);
  border-color: var(--card-accent, var(--accent));
  transform: translateY(-1px);
  box-shadow: var(--sh-xs);
}
.admin-post-row.is-active {
  border-color: var(--accent);
  background: var(--accent-bg);
  box-shadow: var(--sh-sm);
}
.admin-post-copy { display: grid; gap: 4px; min-width: 0; }
.admin-post-copy h3 {
  margin: 0;
  font-family: var(--ff-display);
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-post-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.history-count {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: var(--r-md);
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid var(--border-md);
  font-family: var(--ff-mono);
  font-size: 0.70rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.history-storage-note { margin: 0 0 14px; font-size: 0.74rem; color: var(--ink-3); }
.admin-history-row {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  border: 2px solid var(--border);
  background: var(--surface-alt);
  box-shadow: var(--sh-xs);
  animation: rise-in 460ms var(--ease-out) both;
}
.admin-history-row h3 {
  margin: 0;
  font-family: var(--ff-display);
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.admin-history-row .post-excerpt { margin: 0; font-size: 0.76rem; color: var(--ink-2); }
.history-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.history-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 10px;
  border-radius: var(--r-md);
  background: var(--accent-bg);
  color: var(--accent);
  font-family: var(--ff-mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--border-md);
}
.admin-editor-card { min-height: calc(100vh - 120px); min-width: 0; }
.admin-editor-head { margin-bottom: 18px; }
.admin-publish-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px 18px;
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-alt);
  box-shadow: var(--sh-xs);
}
.publish-copy { display: grid; gap: 4px; min-width: 0; }
.publish-copy strong { font-size: 0.90rem; line-height: 1.35; font-weight: 600; }
.publish-status-note { margin: 0; font-size: 0.74rem; color: var(--ink-3); }
.publish-actions { justify-content: flex-end; }
.admin-ai-card {
  margin-bottom: 20px;
  padding: 18px;
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-alt);
  box-shadow: var(--sh-xs);
}
.admin-ai-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.admin-ai-head h3 {
  margin: 0;
  font-family: var(--ff-display);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.1;
}
.ai-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.6fr);
  gap: 12px;
  margin-bottom: 14px;
}
.ai-settings-grid label, .ai-draft-fields label {
  display: grid;
  gap: 5px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink-2);
}
.ai-draft-fields { gap: 12px; }
.thumbnail-config-grid { margin-top: 12px; }
.thumbnail-size-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 10px;
}
.thumbnail-size-row label {
  display: grid;
  gap: 5px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink-2);
}
.media-library-head { margin-top: 18px; }
.media-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.media-library-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-alt);
  box-shadow: var(--sh-xs);
}
.media-library-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--r-md);
  border: 1px solid var(--border-md);
  background: var(--bg-deep);
}
.media-library-copy { display: grid; gap: 8px; }
.media-library-copy h3 { margin: 0; font-size: 0.90rem; }
.editor-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 22px;
  align-items: start;
}
.admin-editor-layout { grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr); }
.page-admin .editor-fields { align-content: start; min-width: 0; }
.field-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.page-admin #postContent {
  min-height: calc(100vh - 420px);
  resize: vertical;
  font-family: var(--ff-mono);
  font-size: 0.84rem;
  line-height: 1.68;
}
.preview-panel { position: sticky; top: 80px; align-self: start; min-width: 0; }
.preview-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-sm);
  padding: 18px;
  display: grid;
  gap: 12px;
  min-width: 0;
  animation: rise-in 520ms var(--ease-out) both;
}
.page-admin .preview-card { min-height: calc(100vh - 200px); align-content: start; }
.page-admin #previewContent { min-width: 0; overflow-wrap: anywhere; }
.preview-thumbnail { min-height: 160px; border-radius: var(--r-md); }
.page-admin .preview-thumbnail { min-height: 200px; }
.preview-card h4 {
  margin: 0;
  font-family: var(--ff-display);
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.preview-meta { font-size: 0.72rem; color: var(--ink-3); }
.markdown-help {
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 2px solid var(--border);
  background: var(--surface-alt);
  font-size: 0.76rem;
}
.markdown-help summary { cursor: pointer; color: var(--ink-2); font-weight: 700; }
.markdown-help pre { margin: 10px 0 0; overflow: auto; }
.markdown-help code { font-family: var(--ff-mono); font-size: 0.76rem; }
.compact { justify-content: center; }
.split-actions { justify-content: space-between; }

/* ── MODAL ── */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; }
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
}
.modal-panel {
  position: relative;
  background: var(--surface);
  border: 2px solid var(--border-md);
  border-radius: var(--r-md);
  box-shadow: var(--sh-lg);
  width: min(1060px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 24px;
  overflow: auto;
}
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.modal-header h3 {
  margin: 0;
  font-family: var(--ff-display);
  font-size: 2.2rem;
  font-weight: 400;
  line-height: 1.0;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.post-panel { width: min(920px, calc(100vw - 24px)); }
.profile-panel { width: min(580px, calc(100vw - 24px)); }
.modal:not([hidden]) .modal-backdrop { animation: fade-in 200ms ease both; }
.modal:not([hidden]) .modal-panel { animation: rise-in 250ms var(--ease-out) both; }

/* Full-screen post modal (public page) */
.page-public #postModal { place-items: stretch; }
.page-public .modal-backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px);
}
.page-public .post-panel {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: 100dvh;
  padding: 0;
  border: 0;
  border-radius: var(--r-md);
  overflow: auto;
  background: var(--bg);
  box-shadow: none;
}
.post-panel-shell { width: 100%; min-height: 100dvh; padding: 0 0 56px; }
.page-public .modal-header {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 20px clamp(20px, 4vw, 52px) 16px;
  margin-bottom: 0;
  background: var(--bg);
  border-bottom: 2px solid var(--accent);
  backdrop-filter: blur(16px);
}
.page-public .modal-header::after { content: none; }
.page-public .modal-header .text-button { border-color: var(--border-md); }
.page-public .post-hero {
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  gap: clamp(20px, 3.6vw, 44px);
  align-items: end;
  min-height: min(74dvh, 920px);
  padding: 8px clamp(20px, 4vw, 52px) 36px;
  margin-bottom: 0;
}
.page-public .post-thumbnail {
  min-height: clamp(320px, 62dvh, 760px);
  border-radius: var(--r-md);
  box-shadow: var(--sh-md);
  border: 2px solid var(--border-md);
}
.page-public .post-summary {
  display: grid;
  align-content: end;
  gap: 14px;
  padding: 20px 0 8px;
  max-width: 460px;
}
.page-public .post-date {
  margin: 0;
  font-size: 0.70rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-family: var(--ff-mono);
}
.article-body {
  width: 100%;
  min-height: calc(100dvh - 160px);
  padding: 52px clamp(20px, 5vw, 76px) 84px;
  border-top: 2px solid var(--accent);
  background: var(--bg);
  font-size: 0.97rem;
  border-radius: var(--r-md);
}
.article-body > * { max-width: 78ch; margin-left: auto; margin-right: auto; }
.article-body > pre,
.article-body > img,
.article-body > table { max-width: min(1200px, 100%); }
.article-body > blockquote { max-width: 74ch; }
.post-hero { display: grid; grid-template-columns: 240px 1fr; gap: 20px; margin-bottom: 20px; }
.post-thumbnail { min-height: 200px; border-radius: var(--r-md); }
.post-summary { display: grid; align-content: center; gap: 12px; }
body.modal-open { overflow: hidden; }

/* ── MARKDOWN BODY ── */
.markdown-body { font-size: 0.95rem; line-height: 1.92; color: var(--ink); font-family: var(--ff-body); }
.markdown-body > *:first-child { margin-top: 0; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
  margin: 2em 0 0.6em;
  font-family: var(--ff-display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.markdown-body h2 {
  font-size: 1.9rem;
  padding-bottom: 0.3em;
  border-bottom: 2px solid var(--accent);
  color: var(--accent);
}
.markdown-body h3 { font-size: 1.4rem; }
.markdown-body p, .markdown-body ul, .markdown-body ol,
.markdown-body blockquote, .markdown-body pre { margin: 0 0 1.1rem; }
.markdown-body ul, .markdown-body ol { padding-left: 1.4rem; }
.markdown-body li + li { margin-top: 0.4rem; }
.markdown-body blockquote {
  padding: 16px 22px;
  border-left: 4px solid var(--hot);
  border-radius: var(--r-md);
  background: var(--hot-bg);
  color: var(--ink-2);
}
.markdown-body code {
  padding: 0.15em 0.5em;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border-md);
  font-family: var(--ff-mono);
  font-size: 0.88em;
  color: var(--accent);
}
.markdown-body pre {
  overflow: auto;
  padding: 20px 24px;
  border-radius: var(--r-md);
  background: #000;
  border: 2px solid var(--border-md);
  border-left: 4px solid var(--accent);
}
.markdown-body pre code {
  padding: 0;
  background: none;
  border: none;
  color: var(--accent-h);
  font-size: 0.86em;
}
.markdown-body hr { border: 0; border-top: 2px solid var(--border-md); margin: 2.5rem 0; }
.markdown-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}
.markdown-body a:hover { color: var(--accent-h); }
.markdown-body img { width: 100%; border-radius: var(--r-md); border: 2px solid var(--border-md); }
.markdown-body table { width: 100%; border-collapse: collapse; font-size: 0.88em; }
.markdown-body th {
  background: var(--surface);
  border: 1px solid var(--border-md);
  padding: 8px 12px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-size: 0.76em;
  color: var(--accent);
}
.markdown-body td { border: 1px solid var(--border); padding: 8px 12px; }

/* ── EMPTY STATE ── */
.empty-state {
  display: grid;
  place-items: center;
  min-height: 160px;
  padding: 24px;
  border: 2px dashed var(--border-md);
  border-radius: var(--r-md);
  background: var(--surface);
  text-align: center;
  color: var(--ink-3);
  font-size: 0.80rem;
  font-family: var(--ff-mono);
}

/* ── LIGHT THEME SURFACE OVERRIDES ── */
:root[data-theme="light"] .home-banner,
:root[data-theme="light"] .content-card,
:root[data-theme="light"] .profile-card,
:root[data-theme="light"] .intro-card,
:root[data-theme="light"] .admin-profile-card,
:root[data-theme="light"] .admin-content-card,
:root[data-theme="light"] .admin-history-card,
:root[data-theme="light"] .admin-editor-card,
:root[data-theme="light"] .preview-card,
:root[data-theme="light"] .modal-panel,
:root[data-theme="light"] .empty-state {
  background: var(--surface);
  border-color: var(--border);
}
:root[data-theme="light"] .posts-section,
:root[data-theme="light"] .quick-link-card,
:root[data-theme="light"] .admin-publish-bar,
:root[data-theme="light"] .admin-ai-card,
:root[data-theme="light"] .admin-history-row,
:root[data-theme="light"] .media-library-card {
  background: var(--surface-alt);
  border-color: var(--border);
}
:root[data-theme="light"] .featured-post,
:root[data-theme="light"] .post-card,
:root[data-theme="light"] .admin-post-row {
  background: var(--surface);
  border-color: var(--border);
}
:root[data-theme="light"] .stat-card {
  background: var(--bg-deep);
  border-color: var(--border);
  border-left-color: var(--accent);
}
:root[data-theme="light"] .stat-card strong { color: var(--accent); }
:root[data-theme="light"] .secondary-button {
  color: var(--ink);
  border-color: var(--border-md);
}
:root[data-theme="light"] .secondary-button:hover:not([disabled]) {
  color: var(--accent);
  border-color: var(--accent);
}
:root[data-theme="light"] .text-button {
  color: var(--ink-2);
  border-color: var(--border);
}
:root[data-theme="light"] .page-public .post-panel { background: var(--bg); }
:root[data-theme="light"] .page-public .modal-header {
  background: var(--bg);
  border-bottom-color: var(--accent);
}
:root[data-theme="light"] .article-body {
  background: var(--bg);
  border-top-color: var(--accent);
}
:root[data-theme="light"] .markdown-body pre { background: #18140e; }
:root[data-theme="light"] .modal-backdrop { background: rgba(245, 240, 232, 0.92); }
:root[data-theme="light"] .search-field input,
:root[data-theme="light"] .profile-form input,
:root[data-theme="light"] .profile-form textarea,
:root[data-theme="light"] .ai-settings-grid input,
:root[data-theme="light"] .ai-settings-grid select,
:root[data-theme="light"] .thumbnail-size-row input,
:root[data-theme="light"] .editor-fields input,
:root[data-theme="light"] .editor-fields textarea,
:root[data-theme="light"] .editor-fields select {
  background: var(--surface);
  color: var(--ink);
}
:root[data-theme="light"] .genre-filter-btn { background: var(--surface); }
:root[data-theme="light"] .chip { background: var(--surface); }
:root[data-theme="light"] .history-pill {
  background: var(--accent-bg);
  color: var(--accent);
  border-color: var(--border-md);
}

/* ── RESPONSIVE ── */
@media (max-width: 1280px) {
  .admin-editor-layout { grid-template-columns: minmax(0, 1fr); }
  .page-admin .preview-panel { position: static; }
  .page-admin .preview-card { min-height: auto; }
}
@media (max-width: 1100px) {
  .hero, .admin-workspace, .editor-layout, .content-hero { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; }
  .preview-panel { position: static; }
  .featured-post { grid-template-columns: 200px 1fr; }
  .home-meta-grid { grid-template-columns: 1fr; }
  .page-public .post-hero { grid-template-columns: 1fr; gap: 18px; min-height: auto; padding-bottom: 24px; }
  .page-public .post-thumbnail { min-height: 260px; }
  .page-public .post-summary { max-width: none; }
  .article-body { padding: 36px 24px 60px; }
  .page-admin #postContent { min-height: 380px; }
  .page-admin .preview-card { min-height: auto; }
  .page-admin .admin-post-list { max-height: none; }
  .admin-editor-layout { grid-template-columns: 1fr; }
  .thumbnail-size-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .posts-header, .admin-toolbar, .modal-header, .split-actions { flex-direction: column; align-items: stretch; }
  .admin-publish-bar { flex-direction: column; align-items: stretch; }
  .admin-ai-head { flex-direction: column; align-items: stretch; }
  .ai-settings-grid { grid-template-columns: 1fr; }
  .quick-links { grid-template-columns: 1fr; }
  .topbar-actions > *, .inline-actions > * { flex: 1; }
  .admin-overview, .stats-grid, .field-row, .thumbnail-size-row { grid-template-columns: 1fr; }
  .app-shell { width: calc(100vw - 20px); }
  .admin-post-row { grid-template-columns: 1fr; }
  .admin-post-actions { justify-content: flex-start; }
  .featured-post, .post-hero { grid-template-columns: 1fr; }
  .posts-section { padding: 20px 18px; }
  .home-banner, .content-card { padding-inline: 18px; }
  .page-public .modal-header { padding-inline: 18px; }
  .page-public .post-hero { padding-inline: 18px; }
  .featured-media { min-height: 200px; }
  .topbar { margin-bottom: 24px; }
}
@media (max-width: 640px) {
  .topbar-nav { gap: 0; }
  .nav-link { padding: 0 10px; font-size: 0.58rem; }
  .brand-copy h1 { display: none; }
}
@media (max-width: 560px) {
  .hero-title { font-size: 2rem; }
  .post-thumb, .preview-thumbnail, .post-thumbnail, .featured-media { min-height: 170px; }
  .post-card-copy h3 { font-size: 1.1rem; }
  .page-public .hero { grid-template-columns: 1fr; }
  .modal-panel, .post-panel { padding: 16px; }
  .modal-header h3 { font-size: 1.8rem; }
  .page-public .post-panel { padding: 0; }
  .page-public .modal-header { padding-top: 16px; }
  .page-public .post-thumbnail { min-height: 220px; }
  .article-body { padding: 26px 16px 52px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ════════════════════════════════════════════════════════════════════
   TAILWIND / HEADLESS UI REFINEMENTS
   Clean sans-serif + soft radius + subtle shadows
   ════════════════════════════════════════════════════════════════════ */

/* Remove scanline texture */
body::before { content: none !important; display: none !important; }

/* ── Border radius corrections ── */
.topbar                         { border-radius: 0 !important; }
.page-public .post-panel        { border-radius: 0 !important; }
.article-body                   { border-radius: 0 !important; }
.modal-panel                    { border-radius: var(--r-lg) !important; }
.chip, .genre-badge, .history-pill, .history-count,
.genre-filter-btn               { border-radius: var(--r-full) !important; }
.avatar-frame, .admin-avatar-frame { border-radius: 50% !important; }
.brand-mark                     { border-radius: var(--r-sm) !important; }
.theme-toggle-indicator         { border-radius: var(--r-sm) !important; }
.markdown-body pre              { border-radius: var(--r-md) !important; }
.markdown-body code             { border-radius: var(--r-xs) !important; }
.markdown-body img              { border-radius: var(--r-md) !important; }
.empty-state                    { border-radius: var(--r-md) !important; }
.media-library-image            { border-radius: var(--r-sm) !important; }

/* ── Topbar: clean flat nav ── */
.topbar {
  border-bottom: 1px solid var(--border-md);
  box-shadow: none !important;
}
:root[data-theme="light"] .topbar {
  box-shadow: none !important;
}

/* ── Typography: remove aggressive uppercase ── */
.home-title, .content-title,
.hero-title,
.featured-copy h3,
.post-card-copy h3,
.modal-header h3,
.admin-ai-head h3,
.preview-card h4,
.admin-section-head h2, .admin-toolbar h2, .admin-editor-head h2,
.posts-header h2,
.content-section-head h3, .content-subtitle,
.admin-post-copy h3,
.admin-history-row h3,
.profile-name,
.quick-link-card strong {
  text-transform: none !important;
  letter-spacing: -0.02em !important;
  font-weight: 700 !important;
}

.home-title {
  font-size: clamp(1.9rem, 3.8vw, 3.2rem) !important;
  line-height: 1.15 !important;
}
.hero-title { font-size: clamp(1.8rem, 3.2vw, 2.9rem) !important; }

/* Markdown headings: also normalize */
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4 {
  text-transform: none !important;
  letter-spacing: -0.01em !important;
  font-weight: 700 !important;
}

/* ── Buttons: clean Headless UI style ── */
.primary-button,
.secondary-button,
.danger-button,
.text-button,
.ghost-link {
  font-family: var(--ff-body) !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 0.84rem !important;
  font-weight: 600 !important;
}

.primary-button { color: #fff !important; }

/* Hover: subtle shadow lift instead of big offset */
.primary-button:hover:not([disabled]),
.secondary-button:hover:not([disabled]) {
  box-shadow: 0 4px 12px rgba(0,0,0,0.20) !important;
}

/* ── Nav links: clean sans ── */
.nav-link {
  font-family: var(--ff-body) !important;
  text-transform: none !important;
  letter-spacing: 0.01em !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  border-radius: 0 !important;
}
.nav-link.is-active { font-weight: 600 !important; }

/* ── Ghost link: clean ── */
.ghost-link {
  font-family: var(--ff-body) !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

/* ── Section labels: refined ── */
.section-label {
  font-size: 0.65rem !important;
  letter-spacing: 0.10em !important;
  font-weight: 600 !important;
}

/* ── Brand: no glitch ── */
.brand:hover .brand-mark { animation: none !important; }
.brand-mark               { color: #fff !important; }
:root[data-theme="light"] .brand-mark { color: #fff !important; }

/* ── Chips & badges: pill, clean font ── */
.chip, .genre-badge {
  font-family: var(--ff-body) !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 0.74rem !important;
}
.genre-badge { font-size: 0.70rem !important; font-weight: 600 !important; }

/* ── Genre filter buttons ── */
.genre-filter-btn {
  font-family: var(--ff-body) !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 0.78rem !important;
  font-weight: 500 !important;
}
.genre-filter-btn.is-active { color: #fff !important; }

/* ── Post/featured card meta ── */
.featured-meta, .card-meta, .post-date {
  font-family: var(--ff-body) !important;
  text-transform: none !important;
  letter-spacing: 0.01em !important;
  font-size: 0.74rem !important;
}
.card-cta {
  font-family: var(--ff-body) !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-weight: 600 !important;
  font-size: 0.80rem !important;
}

/* ── Card hover: subtle ── */
.featured-post:hover, .post-card:hover,
.quick-link-card:hover, .admin-post-row:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.18) !important;
}

/* ── Stat card: top accent line instead of left border ── */
.stat-card {
  border-left-width: 2px !important;
}
.stat-card strong {
  font-family: var(--ff-body) !important;
  font-size: 1.2rem !important;
  letter-spacing: -0.01em !important;
}
.stat-card span {
  font-family: var(--ff-body) !important;
  font-size: 0.68rem !important;
  letter-spacing: 0.06em !important;
}

/* ── Form inputs: Tailwind ring style ── */
.search-field input,
.profile-form input, .profile-form textarea,
.ai-settings-grid input, .ai-settings-grid select,
.thumbnail-size-row input,
.editor-fields input, .editor-fields textarea,
.editor-fields select {
  border-radius: var(--r-md) !important;
  border-width: 1.5px !important;
  font-family: var(--ff-body) !important;
  font-size: 0.85rem !important;
}
.search-field input:focus,
.profile-form input:focus, .profile-form textarea:focus,
.ai-settings-grid input:focus, .ai-settings-grid select:focus,
.thumbnail-size-row input:focus,
.editor-fields input:focus, .editor-fields textarea:focus,
.editor-fields select:focus {
  box-shadow: 0 0 0 3px var(--accent-bg), 0 0 0 1.5px var(--accent) !important;
}

/* postContent (markdown textarea) keeps mono font */
.page-admin #postContent {
  font-family: var(--ff-mono) !important;
}

/* ── Form labels ── */
.profile-form label,
.editor-fields label,
.ai-settings-grid label,
.ai-draft-fields label,
.thumbnail-size-row label {
  font-family: var(--ff-body) !important;
  font-size: 0.78rem !important;
  letter-spacing: 0 !important;
}

/* ── Theme toggle ── */
.theme-toggle {
  font-family: var(--ff-body) !important;
  border-radius: var(--r-md) !important;
}

/* ── Empty state ── */
.empty-state { font-family: var(--ff-body) !important; }

/* ── History pill ── */
.history-pill {
  border-radius: var(--r-full) !important;
  font-family: var(--ff-body) !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

/* ── Markdown ── */
.markdown-body h2 { border-bottom-width: 1px !important; }
.markdown-body table th {
  text-transform: none !important;
  letter-spacing: 0 !important;
}

/* ── Image insert toolbar ── */
.editor-img-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: var(--surface-alt);
  border: 1.5px solid var(--border);
  border-bottom: none;
  border-radius: var(--r-md) var(--r-md) 0 0;
}
.editor-img-toolbar textarea { border-top-left-radius: 0 !important; border-top-right-radius: 0 !important; }
.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--border-md);
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--ff-body);
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 120ms, color 120ms, background 120ms;
  white-space: nowrap;
}
.toolbar-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}
.toolbar-btn.file-button { position: relative; overflow: hidden; }
.toolbar-btn.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* AI section details/summary */
.ai-section-details {
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 20px;
  overflow: hidden;
}
.ai-section-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface-alt);
  cursor: pointer;
  user-select: none;
  list-style: none;
  font-family: var(--ff-body);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink-2);
}
.ai-section-details > summary::-webkit-details-marker { display: none; }
.ai-section-details > summary::after {
  content: "›";
  font-size: 1.1rem;
  font-weight: 400;
  transition: transform 200ms var(--ease-out);
  color: var(--ink-3);
  transform: rotate(90deg);
}
.ai-section-details[open] > summary::after { transform: rotate(270deg); }
.ai-section-details > summary:hover { color: var(--ink); background: var(--surface); }
.ai-section-details .admin-ai-card {
  border: none;
  border-radius: 0;
  margin-bottom: 0;
}

/* ════════════════════════════════════════════════════════════════════
   SEARCH / SORT / PAGINATION
   ════════════════════════════════════════════════════════════════════ */

/* Posts controls row (search + sort) */
.posts-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Sort select */
.sort-select-wrap {
  display: flex;
  align-items: center;
}
.sort-select-wrap select {
  appearance: none;
  padding: 8px 32px 8px 12px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border-md);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--ink-2);
  font-family: var(--ff-body);
  font-size: 0.80rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 120ms, color 120ms;
  min-width: 100px;
}
.sort-select-wrap select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
  color: var(--ink);
}

/* Search meta bar */
.search-meta-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  min-height: 20px;
}
.search-result-count {
  font-family: var(--ff-body);
  font-size: 0.74rem;
  color: var(--ink-3);
  font-weight: 500;
}

/* Admin search+sort row */
.admin-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

/* Pagination bar */
.pagination-bar {
  margin-top: 24px;
}
.admin-pagination-bar {
  margin-top: 12px;
}
.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.pagination-info {
  font-family: var(--ff-body);
  font-size: 0.76rem;
  color: var(--ink-3);
}
.pagination-btn-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pagination-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--border-md);
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--ff-body);
  font-size: 0.80rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 120ms, color 120ms, background 120ms;
}
.pagination-btn:hover:not([disabled]) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-bg);
}
.pagination-btn[disabled] {
  opacity: 0.38;
  cursor: not-allowed;
}
.pagination-page-label {
  font-family: var(--ff-body);
  font-size: 0.80rem;
  color: var(--ink-2);
  min-width: 52px;
  text-align: center;
}

/* ════════════════════════════════════════════════════════════════════
   DESIGN REFRESH — Refined Minimal
   ════════════════════════════════════════════════════════════════════ */

/* ── Cards: rounded + soft shadow ── */
.home-banner,
.content-card,
.admin-post-row,
.post-card,
.featured-slot > *,
.admin-ai-card,
.admin-history-card,
.admin-editor-card,
.admin-profile-card,
.admin-publish-card {
  border-radius: var(--r-lg) !important;
}

/* ── Topbar: flat, no radius ── */
.topbar { border-radius: 0 !important; }

/* ── Post cards: depth ── */
.post-card {
  border-radius: var(--r-lg) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--sh-xs) !important;
  transition: box-shadow 180ms, border-color 180ms, transform 180ms !important;
}
.post-card:hover {
  border-color: var(--border-md) !important;
  box-shadow: var(--sh-sm) !important;
  transform: translateY(-2px) !important;
}

/* ── Home banner: single-column minimal ── */
.home-banner {
  padding: 40px clamp(24px, 4vw, 56px) !important;
  gap: 0 !important;
  display: block !important;
}
.home-copy { gap: 10px !important; }

/* ── Home title: tighter, more elegant ── */
.home-title {
  font-size: clamp(1.7rem, 3.2vw, 2.8rem) !important;
  line-height: 1.2 !important;
  letter-spacing: -0.03em !important;
  font-weight: 700 !important;
  margin-bottom: 0 !important;
}

/* ── Home meta bar: inline stats ── */
.home-meta-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.home-meta-item {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}
.home-meta-label {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-3);
  font-family: var(--ff-body);
}
.home-meta-item strong {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-2);
  font-family: var(--ff-body);
}
.home-meta-sep {
  color: var(--ink-3);
  font-size: 0.72rem;
  line-height: 1;
}

/* hide old meta grid if still present */
.home-meta-grid { display: none !important; }

/* ── Posts section header: tighter ── */
.posts-section { padding-top: 0 !important; }
.posts-header {
  padding-top: 28px !important;
  padding-bottom: 16px !important;
}

/* ── Admin post row: refined ── */
.admin-post-row {
  border-radius: var(--r-md) !important;
  border: 1px solid var(--border) !important;
  margin-bottom: 8px !important;
  transition: border-color 150ms, box-shadow 150ms !important;
}
.admin-post-row:hover,
.admin-post-row.is-active {
  border-color: var(--border-md) !important;
  box-shadow: var(--sh-xs) !important;
}
.admin-post-row.is-active {
  border-color: var(--accent) !important;
  border-left: 3px solid var(--accent) !important;
}

/* ── Buttons: better radius ── */
.primary-button,
.secondary-button,
.danger-button {
  border-radius: var(--r-sm) !important;
}
.text-button { border-radius: var(--r-xs) !important; }

/* ── Chips and badges: ensure pill ── */
.chip, .genre-badge, .history-pill, .genre-filter-btn {
  border-radius: var(--r-full) !important;
}

/* ── Inputs: rounded ── */
input[type="text"],
input[type="url"],
input[type="search"],
input[type="password"],
input[type="datetime-local"],
select,
textarea {
  border-radius: var(--r-sm) !important;
}

/* ── Genre filter: pill style bar ── */
.genre-filter-bar {
  gap: 6px !important;
  padding-bottom: 14px !important;
}
.genre-filter-btn {
  padding: 5px 14px !important;
  font-size: 0.76rem !important;
  font-weight: 500 !important;
}
.genre-filter-btn.is-active {
  font-weight: 600 !important;
}

/* ── Light theme: use softer shadows ── */
:root[data-theme="light"] .post-card {
  box-shadow: 0 1px 4px rgba(60,40,20,.10), 0 1px 2px rgba(60,40,20,.06) !important;
}
:root[data-theme="light"] .post-card:hover {
  box-shadow: 0 3px 12px rgba(60,40,20,.14), 0 1px 4px rgba(60,40,20,.08) !important;
}
:root[data-theme="light"] .home-meta-item strong { color: var(--ink-2); }

/* ── Section label: subtle ── */
.section-label {
  font-size: 0.63rem !important;
  letter-spacing: 0.12em !important;
  font-weight: 600 !important;
  color: var(--accent) !important;
}

/* ── Home banner section label: muted ── */
.home-copy .section-label {
  color: var(--accent) !important;
}

/* ── Markdown help details ── */
.markdown-help { border-radius: var(--r-md) !important; }

/* ── Featured post card ── */
.featured-post-card { border-radius: var(--r-lg) !important; }

/* ── Modal panel ── */
.modal-panel { border-radius: var(--r-xl) !important; }

/* ════════════════════════════════════════════════════════════════════
   東京テック新聞 — Public Page Editorial Redesign
   News/magazine layout for the public-facing blog
   ════════════════════════════════════════════════════════════════════ */

:root {
  --ff-editorial: "Lora", Georgia, "Hiragino Mincho ProN", "Yu Mincho", serif;
}

/* ── Page layout: clean container ── */
.page-public .page-home-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px);
}

/* ── Home banner: masthead ── */
.page-public .home-banner {
  padding: 32px 0 24px !important;
  background: transparent !important;
  border: none !important;
  border-bottom: 2px solid var(--border-md) !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  display: block !important;
  margin-bottom: 0 !important;
}
.page-public .home-banner::before { display: none !important; }

.page-public .home-copy { gap: 6px !important; max-width: 100% !important; }

.page-public .home-title {
  font-family: var(--ff-editorial) !important;
  font-size: clamp(1.6rem, 2.8vw, 2.4rem) !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  letter-spacing: -0.025em !important;
  color: var(--ink) !important;
  text-transform: none !important;
}

.page-public .home-meta-bar { margin-top: 10px !important; }
.page-public .home-meta-label { color: var(--ink-3) !important; }
.page-public .home-meta-item strong { color: var(--ink-2) !important; }

/* ── Posts section: open, no box ── */
.page-public .posts-section {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 28px 0 !important;
  overflow: visible !important;
}
.page-public .posts-section::before { display: none !important; }

/* ── Posts header: newspaper section marker ── */
.page-public .posts-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  padding-bottom: 14px !important;
  border-bottom: 1px solid var(--border) !important;
  margin-bottom: 0 !important;
}
.page-public .posts-header > div { display: flex; align-items: center; gap: 10px; }
.page-public .posts-header .section-label { display: none !important; }
.page-public .posts-header h2 {
  font-family: var(--ff-body) !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
  color: var(--ink-2) !important;
  margin: 0 !important;
  padding-left: 10px !important;
  border-left: 3px solid var(--accent) !important;
}

/* ── Genre filter: horizontal underline tabs ── */
.page-public .genre-filter-bar {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 0 !important;
  margin-bottom: 24px !important;
  border-bottom: 1px solid var(--border) !important;
  padding-bottom: 0 !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: none !important;
}
.page-public .genre-filter-bar::-webkit-scrollbar { display: none !important; }

.page-public .genre-filter-btn {
  border: none !important;
  border-bottom: 2px solid transparent !important;
  background: transparent !important;
  border-radius: 0 !important;
  color: var(--ink-2) !important;
  font-family: var(--ff-body) !important;
  font-size: 0.82rem !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  padding: 10px 16px 11px !important;
  margin-bottom: -1px !important;
  white-space: nowrap !important;
  transition: color 150ms, border-color 150ms !important;
  transform: none !important;
  box-shadow: none !important;
}
.page-public .genre-filter-btn:hover {
  color: var(--ink) !important;
  border-bottom-color: var(--border-md) !important;
  background: transparent !important;
  transform: none !important;
  box-shadow: none !important;
}
.page-public .genre-filter-btn.is-active {
  color: var(--accent) !important;
  border-bottom-color: var(--accent) !important;
  background: transparent !important;
  font-weight: 700 !important;
}

/* ── Search meta bar ── */
.page-public .search-meta-bar { padding: 8px 0 !important; }
.page-public .search-result-count {
  font-size: 0.74rem !important;
  color: var(--ink-3) !important;
  font-family: var(--ff-body) !important;
}

/* ════════════════════════════════════════
   FEATURED POST — Cinematic Hero
   ════════════════════════════════════════ */
.page-public .featured-slot {
  margin-bottom: 32px !important;
}
.page-public .featured-post {
  display: block !important;
  grid-template-columns: unset !important;
  position: relative !important;
  width: 100% !important;
  aspect-ratio: 21 / 8 !important;
  min-height: unset !important;
  border: 1px solid var(--border) !important;
  border-left: none !important;
  border-radius: var(--r-lg) !important;
  overflow: hidden !important;
  box-shadow: var(--sh-md) !important;
  cursor: pointer !important;
  color: inherit !important;
  text-align: left !important;
  transition: box-shadow 200ms !important;
}
.page-public .featured-post:hover {
  transform: none !important;
  box-shadow: var(--sh-lg) !important;
}

/* Featured media fills entire card */
.page-public .featured-post .featured-media {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
}
/* Remove default gradient, we'll add our own */
.page-public .featured-post .featured-media::after {
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 15%,
    rgba(0, 0, 0, 0.30) 45%,
    rgba(0, 0, 0, 0.82) 100%
  ) !important;
}

/* Hide thumb-initials inside featured (they clash with overlay text) */
.page-public .featured-post .thumb-initials { display: none !important; }
.page-public .featured-post .thumbnail-badge { z-index: 3 !important; }

/* Featured overlay: text block at bottom */
.featured-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(18px, 3vw, 36px) clamp(20px, 4vw, 44px);
  z-index: 2;
  gap: 10px;
}

.featured-top-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.featured-top-row .genre-badge {
  background: var(--accent) !important;
  color: #fff !important;
  border: none !important;
  font-size: 0.62rem !important;
  letter-spacing: 0.12em !important;
}

.featured-date {
  font-family: var(--ff-body);
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  letter-spacing: 0.02em;
}

.featured-title {
  margin: 0;
  font-family: var(--ff-editorial);
  font-size: clamp(1.35rem, 3vw, 2.2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #fff;
  text-transform: none !important;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  max-width: 68ch;
}

.featured-excerpt {
  font-family: var(--ff-body);
  font-size: 0.88rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.80);
  max-width: 58ch;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.featured-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--ff-body);
  font-size: 0.80rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.90);
  letter-spacing: 0.02em;
  text-transform: none;
  margin-top: 2px;
}
.featured-cta-arrow {
  display: inline-block;
  transition: transform 180ms var(--ease-out);
}
.page-public .featured-post:hover .featured-cta-arrow {
  transform: translateX(5px);
}

/* Mobile: taller aspect ratio */
@media (max-width: 640px) {
  .page-public .featured-post { aspect-ratio: 4 / 3 !important; }
  .featured-title { font-size: clamp(1.1rem, 5vw, 1.5rem) !important; }
  .featured-excerpt { display: none !important; }
}

/* ════════════════════════════════════════
   POST GRID — Newspaper Layout
   ════════════════════════════════════════ */
.page-public .post-grid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 24px !important;
}

@media (max-width: 900px) {
  .page-public .post-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 18px !important; }
}
@media (max-width: 560px) {
  .page-public .post-grid { grid-template-columns: 1fr !important; gap: 14px !important; }
}

/* ── Post card: editorial news card ── */
.page-public .post-card {
  display: flex !important;
  flex-direction: column !important;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-top: none !important;
  border-radius: var(--r-lg) !important;
  overflow: hidden !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14) !important;
  text-align: left !important;
  cursor: pointer !important;
  color: inherit !important;
  width: 100% !important;
  transition: box-shadow 180ms, transform 180ms, border-color 180ms !important;
  animation: rise-in 400ms var(--ease-out) both !important;
  animation-delay: var(--enter-delay, 0ms) !important;
}
.page-public .post-card:hover {
  box-shadow: var(--sh-sm) !important;
  transform: translateY(-3px) !important;
  border-color: var(--border-md) !important;
}

/* Thumbnail: 16:9 */
.page-public .post-card .post-thumb {
  width: 100% !important;
  aspect-ratio: 16 / 9 !important;
  flex-shrink: 0 !important;
  position: relative !important;
  overflow: hidden !important;
}
.page-public .post-card .post-thumb::after {
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.22) 100%) !important;
}
/* Subtle accent line at top of card */
.page-public .post-card .post-thumb::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-accent, var(--accent));
  z-index: 2;
}

/* Card copy area */
.page-public .post-card .post-card-copy {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  padding: 14px 16px 18px !important;
  flex: 1 !important;
}

/* Top row: genre badge + date */
.page-public .post-card .card-top-row {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
}
.page-public .post-card .genre-badge {
  font-size: 0.58rem !important;
  letter-spacing: 0.12em !important;
  padding: 2px 7px !important;
}
.page-public .post-card .card-meta {
  font-size: 0.69rem !important;
  color: var(--ink-3) !important;
  font-family: var(--ff-body) !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

/* Title: editorial serif */
.page-public .post-card h3 {
  margin: 0 !important;
  font-family: var(--ff-editorial) !important;
  font-size: clamp(0.95rem, 1.3vw, 1.08rem) !important;
  font-weight: 700 !important;
  line-height: 1.38 !important;
  letter-spacing: -0.01em !important;
  text-transform: none !important;
  color: var(--ink) !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 3 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  transition: color 150ms !important;
}
.page-public .post-card:hover h3 { color: var(--accent) !important; }

/* Excerpt */
.page-public .post-card .post-excerpt {
  font-size: 0.78rem !important;
  line-height: 1.65 !important;
  color: var(--ink-2) !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  margin: 0 !important;
  flex: 1 !important;
}

/* ── Pagination: subtle ── */
.page-public .pagination-bar { margin-top: 32px !important; }
.page-public .pagination-controls {
  border-top: 1px solid var(--border) !important;
  padding-top: 20px !important;
}

/* ── Light theme adjustments ── */
:root[data-theme="light"] .page-public .post-card {
  border-color: rgba(60, 40, 20, 0.12) !important;
  box-shadow: 0 1px 4px rgba(60, 40, 20, 0.08) !important;
}
:root[data-theme="light"] .page-public .post-card:hover {
  box-shadow: 0 4px 16px rgba(60, 40, 20, 0.14) !important;
}
:root[data-theme="light"] .page-public .featured-post .featured-media::after {
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 10%,
    rgba(0, 0, 0, 0.28) 48%,
    rgba(0, 0, 0, 0.80) 100%
  ) !important;
}
:root[data-theme="light"] .page-public .posts-section { background: transparent !important; }

/* ── Deployed site link ── */
.deployed-site-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
  transition: opacity 150ms;
}
.deployed-site-link:hover { opacity: 0.75; text-decoration: underline; }
