/* ============================================================
   KNOWLEDGE HUB STYLES — Premium Editorial Platform
   Matching the FlirtLabz v2 design language
   ============================================================ */

:root {
  /* ─── Colors (Dark Theme) ──────────────────────────────────── */
  --blog-bg: #0f0a14;
  --blog-surface: #1a1020;
  --blog-surface-hover: #24152d;
  --blog-border: rgba(255, 255, 255, 0.06);
  --blog-border-hover: rgba(255, 255, 255, 0.12);
  --blog-primary: #d96bff;
  --blog-primary-hover: #ee86ff;
  --blog-primary-glow: rgba(217, 107, 255, 0.15);
  --blog-accent: #ec4899;
  --blog-accent-glow: rgba(236, 72, 153, 0.15);
  --blog-text: #f1f5f9;
  --blog-text-secondary: #a68fb8;
  --blog-text-muted: #6c6078;
  --blog-accent-gradient: linear-gradient(135deg, #a855f7, #ec4899);
  --blog-gold: #f59e0b;
  --blog-red: #ef4444;
  --blog-green: #c58d72;
  --blog-radius-card: 14px;
  --blog-radius-pill: 50px;
  --blog-radius-input: 10px;
  --blog-shadow-card: 0 4px 24px rgba(0, 0, 0, 0.15);
  --blog-shadow-hover: 0 8px 30px rgba(217, 107, 255, 0.1);
  --blog-transition: 250ms cubic-bezier(0.2, 0, 0, 1);
  --blog-font-display: 'Cormorant Garamond', Georgia, serif;
  --blog-font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --blog-reading-width: 720px;
  --surface-page: var(--blog-bg);
  --surface-editor: #11131d;
  --surface-raised: var(--blog-surface);
  --surface-popover: #1b1e2b;
  --text-primary: var(--blog-text);
  --text-secondary: var(--blog-text-secondary);
  --text-muted: var(--blog-text-muted);
  --border-subtle: var(--blog-border);
  --border-strong: var(--blog-border-hover);
  --accent: var(--blog-primary);
  --accent-hover: var(--blog-primary-hover);
  --accent-soft: var(--blog-primary-glow);
  --danger: var(--blog-red);
  --focus-ring: #c4a7ff;
  --layer-base: 0;
  --layer-toolbar: 20;
  --layer-outline: 30;
  --layer-drawer-backdrop: 39;
  --layer-drawer: 40;
  --layer-selection-toolbar: 60;
  --layer-popover: 70;
  --layer-modal: 100;
  --layer-toast: 110;
}

/* ========================================================================
   Editorial Studio — writing-first long-form workspace
   ======================================================================== */
.authoring-workspace.submit-wrap {
  width: min(100%, 1440px);
  max-width: none;
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 64px) 80px;
}

.authoring-workspace #post-form { min-width: 0; }

.studio-topbar {
  position: relative;
  z-index: var(--layer-toolbar);
  top: auto;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 64px;
  margin: 0 calc(clamp(18px, 4vw, 64px) * -1) 40px;
  padding: 10px clamp(18px, 4vw, 64px);
  border-bottom: 1px solid rgba(148, 163, 184, .14);
  background: color-mix(in srgb, var(--blog-bg, #0d0f17) 92%, transparent);
  backdrop-filter: blur(18px);
}

.studio-topbar-context {
  color:var(--blog-muted,#aab0c0);
  font-size:.7rem;
  font-weight:700;
  letter-spacing:.12em;
  text-transform:uppercase;
}

.studio-back {
  justify-self: start;
  color: var(--blog-muted, #aab0c0);
  font-size: .9rem;
  text-decoration: none;
}

.studio-save-state {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--blog-muted, #aab0c0);
  font-size: .78rem;
}

.save-state-dot { width: 7px; height: 7px; border-radius: 50%; background: #5cae84; }
.studio-save-state.is-saving .save-state-dot { background: #d3a551; animation: studio-pulse 1s infinite; }
.studio-save-state.is-error .save-state-dot { background: #dc6673; }
@keyframes studio-pulse { 50% { opacity: .35; } }

.studio-editor-commandbar {
  position:sticky;
  z-index:calc(var(--layer-toolbar) + 2);
  top:68px;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:.75rem;
  align-items:center;
  width:min(100%,900px);
  min-height:52px;
  margin:0 auto 8px;
  padding:6px 8px 6px 14px;
  border:1px solid var(--blog-border,rgba(148,163,184,.18));
  border-radius:18px 18px 10px 10px;
  background:color-mix(in srgb,var(--blog-bg,#0d0f17) 91%,transparent);
  box-shadow:0 14px 36px rgba(0,0,0,.16);
  -webkit-backdrop-filter:blur(18px) saturate(120%);
  backdrop-filter:blur(18px) saturate(120%);
}
.studio-editor-commandbar-actions { display:flex;gap:6px;align-items:center;justify-content:flex-end; }
.studio-editor-commandbar button { min-height:38px;white-space:nowrap; }
.studio-editor-commandbar .ghost { padding:.55rem .8rem; }
.studio-editor-commandbar .btn-primary { padding:.55rem 1rem; }
.authoring-workspace #lexical-editor-body[data-profile="publishing"] .lexical-toolbar { top:128px !important; }

.studio-topbar button, .studio-editor-commandbar button, .story-settings-button { min-height: 42px; }
.studio-topbar button:disabled,
.studio-editor-commandbar button:disabled,
.story-settings-button:disabled,
.studio-inspector button:disabled,
.studio-dialog button:disabled { opacity: .48; cursor: not-allowed; transform: none !important; }
.studio-topbar button:active:not(:disabled),
.studio-editor-commandbar button:active:not(:disabled),
.story-settings-button:active:not(:disabled),
.studio-inspector button:active:not(:disabled),
.studio-dialog button:active:not(:disabled) { transform: translateY(1px); }

.authoring-workspace .studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

.authoring-workspace .studio-main {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.authoring-workspace .studio-title-area {
  width: min(100%, 900px);
  margin: 0 auto 28px;
  padding: 0 clamp(10px, 3vw, 46px);
}

.authoring-workspace #id_title {
  width: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--blog-text, #f5f2ed);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(2.25rem, 5vw, 4.2rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.035em;
  box-shadow: none;
}

.authoring-workspace #id_title::placeholder { color: color-mix(in srgb, var(--blog-text, #fff) 32%, transparent); }
.studio-byline { margin: 14px 0 0; color: var(--blog-muted, #969cab); font-size: .86rem; }

.authoring-workspace .studio-editor-area {
  width: min(100%, 980px);
  margin: 0 auto;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.studio-editor-hint { margin: 10px auto 0; max-width: 72ch; color: var(--blog-muted, #8d93a1); font-size: .75rem; text-align: center; }
.studio-editor-hint kbd { padding: 1px 5px; border: 1px solid rgba(148,163,184,.25); border-radius: 4px; background: transparent; }

.studio-writing-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: min(100%, 900px);
  margin: 18px auto 0;
  padding: 14px clamp(10px, 3vw, 46px);
  border-top: 1px solid rgba(148, 163, 184, .12);
}

.authoring-workspace .studio-writing-stats { display: flex; gap: 9px; align-items: center; padding: 0; border: 0; background: transparent; color: var(--blog-muted, #969cab); font-size: .78rem; }
.studio-detailed-stats { position: relative; }
.studio-detailed-stats summary { cursor: pointer; }
.studio-detailed-stats[open] { padding: 7px 10px; border-radius: 8px; background: rgba(148,163,184,.09); }
.story-settings-button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 13px; border: 1px solid rgba(167,139,250,.34); border-radius: 9px; background: rgba(124,58,237,.08); color: var(--blog-text, #f5f2ed); cursor: pointer; font-weight: 680; transition: border-color .16s ease, background .16s ease, color .16s ease; }
.story-settings-button:hover { border-color: rgba(167,139,250,.68); background: rgba(124,58,237,.15); }
.story-settings-button[aria-expanded='true'] { border-color: #a78bfa; background: rgba(124,58,237,.22); color: #fff; }
.story-settings-button .story-settings-icon { color: #c4b5fd; font-size: 1rem; }
.story-settings-button .story-settings-arrow { display: inline-block; margin-left: 2px; color: #a78bfa; font-size: 1.2rem; transition: transform .2s; }
.story-settings-button:hover .story-settings-arrow, .story-settings-button[aria-expanded='true'] .story-settings-arrow { transform: translateX(3px); }

.studio-inspector {
  position: fixed;
  z-index: var(--layer-drawer);
  inset: 68px 0 0 auto;
  display: flex;
  flex-direction: column;
  width: min(430px, 92vw);
  border-left: 1px solid rgba(148,163,184,.18);
  background: #11131d;
  box-shadow: -24px 0 80px rgba(0,0,0,.42);
  transform: translateX(102%);
  visibility: hidden;
  transition: transform .25s ease, visibility .25s;
}
.studio-inspector.is-open { transform: translateX(0); visibility: visible; }
.inspector-backdrop { position: fixed; z-index: var(--layer-drawer-backdrop); inset: 68px 0 0; background: rgba(5,7,12,.58); backdrop-filter: blur(2px); }
.studio-inspector-header { display: flex; justify-content: space-between; align-items: center; padding: 24px 24px 18px; border-bottom: 1px solid rgba(148,163,184,.14); }
.studio-inspector-header h2 { margin: 3px 0 0; font-family: Georgia, serif; font-size: 1.55rem; }
.eyebrow { color: #a78bfa; font-size: .67rem; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
.studio-inspector-header button, .story-outline-header button { width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(148,163,184,.1); color: inherit; cursor: pointer; font-size: 1.35rem; }
.studio-inspector-scroll { overflow-y: auto; padding: 10px 20px 40px; }
.inspector-section { border-bottom: 1px solid rgba(148,163,184,.13); }
.inspector-section > summary { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 19px 4px; cursor: pointer; list-style: none; }
.inspector-section > summary::-webkit-details-marker { display: none; }
.inspector-section > summary span { font-weight: 700; }
.inspector-section > summary small { max-width: 190px; overflow: hidden; color: var(--blog-muted, #9298a8); font-size: .73rem; text-overflow: ellipsis; white-space: nowrap; }
.inspector-section[open] > summary small { display: none; }
.inspector-section-body { padding: 0 4px 22px; }
.inspector-section .form-group { margin: 0 0 18px; }
.inspector-section label { display: block; margin-bottom: 7px; color: #d8d9e0; font-size: .78rem; font-weight: 650; }
.inspector-section input[type='text'], .inspector-section input[type='url'], .inspector-section input[type='search'], .inspector-section textarea, .inspector-section select { width: 100%; min-height: 44px; border: 1px solid rgba(148,163,184,.2); border-radius: 8px; background: #171a25; color: #f5f2ed; }
.inspector-section textarea { min-height: 94px; resize: vertical; }
.inspector-section .help-text { display: block; margin-top: 7px; color: #888e9e; font-size: .7rem; line-height: 1.45; }

.cover-dropzone { display: flex; flex-direction: column; align-items: center; width: 100%; min-height: 150px; padding: 20px; border: 1px dashed rgba(167,139,250,.45); border-radius: 12px; background: rgba(124,58,237,.055); color: #f2eff8; cursor: pointer; }
.cover-dropzone:hover, .cover-dropzone.is-dragging { border-color: #a78bfa; background: rgba(124,58,237,.12); }
.cover-dropzone-icon { margin-bottom: 7px; color: #a78bfa; font-size: 1.6rem; }
.cover-dropzone > span:last-child { margin-top: 5px; color: #9197a7; font-size: .68rem; }
.cover-preview[hidden] { display: none; }
.cover-preview { margin-top: 12px; overflow: hidden; border-radius: 10px; aspect-ratio: 1.91 / 1; }
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.cover-url-advanced { margin-top: 14px; }
.cover-url-advanced > summary { color: #9fa5b4; cursor: pointer; font-size: .74rem; }
.cover-url-advanced > input { margin-top: 10px; }
.cover-upload-status { display: block; min-height: 18px; margin-top: 7px; color: #80c69e; font-size: .7rem; }
.cover-upload-status.is-error { color: #ed7b86; }
.cover-actions { display: flex; gap: 8px; margin-top: 9px; }
.cover-actions[hidden] { display: none; }
.cover-actions button, .tag-browse-button { min-height: 38px; padding: 7px 10px; border: 1px solid rgba(148,163,184,.18); border-radius: 7px; background: transparent; color: #b9bdc8; cursor: pointer; font-size: .72rem; }
.tag-browse-button { margin-top: 9px; }

.story-outline { position: fixed; z-index: var(--layer-outline); top: 88px; right: clamp(18px, 3vw, 42px); width: 280px; max-width: calc(100vw - 28px); max-height: calc(100vh - 130px); overflow: auto; padding: 14px; border: 1px solid rgba(148,163,184,.17); border-radius: 12px; background: rgba(17,19,29,.98); box-shadow: 0 18px 60px rgba(0,0,0,.35); }
.story-outline-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.story-outline-header button { width: 34px; height: 34px; }
.outline-item { display: block; width: 100%; padding: 8px; border: 0; border-radius: 6px; background: transparent; color: #c8cad3; cursor: pointer; text-align: left; }
.outline-item:hover { background: rgba(148,163,184,.09); }
.outline-item--h3 { padding-left: 20px; }
.outline-item--h4 { padding-left: 32px; color: #999eac; }

.studio-dialog[hidden] { display: none !important; }
.studio-dialog.is-open { position: fixed; z-index: var(--layer-modal); inset: 0; display: grid; place-items: center; padding: 20px; }
.preview-modal-content { position: relative; z-index: 1; width: min(1050px, 96vw); max-height: 92vh; overflow: hidden; border: 1px solid rgba(148,163,184,.18); border-radius: 14px; background: #11131d; }
.preview-modal-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.preview-modal-close { justify-self: end; }
.preview-device-switch { display: flex; padding: 3px; border-radius: 8px; background: rgba(148,163,184,.1); }
.preview-device-switch button { min-height: 34px; padding: 4px 10px; border: 0; border-radius: 6px; background: transparent; color: #aeb2bf; }
.preview-device-switch button.is-active { background: #2a2e3e; color: #fff; }
.preview-modal-body { overflow: auto; max-height: calc(92vh - 66px); }
.preview-article { width: min(100%, 75ch); margin: 0 auto; padding: clamp(28px, 6vw, 72px); transition: width .2s; }
.preview-article.is-mobile { width: min(390px, 100%); }

.publish-review-card { position: relative; z-index: 1; width: min(500px, 94vw); padding: 34px; border: 1px solid rgba(148,163,184,.18); border-radius: 14px; background: #11131d; box-shadow: 0 28px 100px rgba(0,0,0,.5); }
.publish-review-card > .preview-modal-close { position: absolute; top: 18px; right: 18px; }
.publish-review-card h2 { margin: 8px 42px 24px 0; font-family: Georgia, serif; font-size: 1.75rem; }
.publish-checklist { margin: 0; }
.publish-checklist div { display: grid; grid-template-columns: 100px 1fr; gap: 18px; padding: 12px 0; border-bottom: 1px solid rgba(148,163,184,.12); }
.publish-checklist dt { color: #898f9e; font-size: .75rem; }
.publish-checklist dd { margin: 0; overflow: hidden; color: #e9e7e4; text-overflow: ellipsis; white-space: nowrap; }
.publish-review-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 28px; }
body.studio-overlay-open { overflow: hidden; }
.authoring-workspace button:focus-visible, .authoring-workspace a:focus-visible,
.studio-dialog button:focus-visible, .story-outline button:focus-visible {
  outline: 2px solid #c4a7ff;
  outline-offset: 3px;
}

@media (max-width: 760px) {
  .authoring-workspace.submit-wrap { padding-inline: 14px; }
  .studio-topbar { grid-template-columns: auto 1fr; margin-inline: -14px; padding-inline: 14px; }
  .studio-topbar-context { justify-self:end; }
  .studio-editor-commandbar { top:60px;grid-template-columns:auto minmax(0,1fr);gap:.4rem;padding:6px; }
  .studio-editor-commandbar .studio-save-state > span:last-child { position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0; }
  .studio-editor-commandbar-actions { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:3px; }
  .studio-editor-commandbar-actions button { min-width:0;min-height:38px;padding:.45rem .35rem;font-size:.68rem; }
  .authoring-workspace .studio-title-area { margin-top: 22px; padding-inline: 5px; }
  .authoring-workspace #id_title { font-size: clamp(2rem, 11vw, 3rem); }
  .studio-writing-footer { align-items: flex-start; gap: 12px; padding-inline: 5px; }
  .authoring-workspace .studio-writing-stats { flex-wrap: wrap; }
  .studio-detailed-stats { width: 100%; }
  .studio-inspector { inset: auto 0 0; width: 100%; max-height: calc(100dvh - 60px); border: 0; border-top: 1px solid rgba(148,163,184,.2); border-radius: 18px 18px 0 0; transform: translateY(102%); }
  .inspector-backdrop { inset:60px 0 0; }
  .studio-inspector.is-open { transform: translateY(0); }
  .studio-inspector-scroll { overscroll-behavior: contain; }
  .preview-modal-header { grid-template-columns: 1fr auto; }
  .preview-device-switch { display: none; }
  .preview-article { padding: 28px 20px; }
  .publish-review-card { padding: 28px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .studio-inspector, .preview-article, .story-settings-button span { transition: none; }
}

/* ================================================================
   LIGHT MODE
   ================================================================ */
:root.site-light {
  --blog-bg: #f8f4f2;            /* Warm, creamy off-white background */
  --blog-surface: #faf8f6;       /* Slightly off-white for depth */
  --blog-surface-hover: #f3eeea; /* Warm, mauve hover */

  --blog-border: rgba(140, 90, 80, 0.14);    /* Soft, warm border */
  --blog-border-hover: rgba(140, 90, 80, 0.25);

  --blog-primary: #a855f7;       /* Keep your signature purple */
  --blog-primary-hover: #9333ea;
  --blog-primary-glow: rgba(168, 85, 247, 0.12);

  --blog-accent: #db2777;
  --blog-accent-glow: rgba(219, 39, 119, 0.10);

  --blog-text: #2a1f24;          /* Soft, warm dark brown/grey text */
  --blog-text-secondary: #6b535c; /* Warm, muted purple-brown */
  --blog-text-muted: #9a8490;     /* Soft, muted warm grey */

  --blog-accent-gradient: linear-gradient(135deg, #9333ea, #db2777);

  --blog-shadow-card: 0 4px 24px rgba(140, 90, 80, 0.06);
  --blog-shadow-hover: 0 8px 30px rgba(168, 85, 247, 0.10);
}

/* ─── Container ────────────────────────────────────────────────── */
.blog-wrap,
.post-wrap,
.submit-wrap,
.library-layout,
.blog-seo {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 32px 64px;
}

.post-wrap {
  max-width: var(--blog-reading-width);
}

/* ─── Brand Bar ────────────────────────────────────────────────── */
.blog-brand-bar {
  text-align: center;
  padding: 2rem 1rem 1rem;
}

.blog-brand-img {
  height: 90px;
  width: auto;
  display: inline-block;
}

/* ─── Hero (Landing Page) ──────────────────────────────────────── */
.blog-hero {
  text-align: center;
  padding: 64px 48px;
  margin-bottom: 48px;
  background: linear-gradient(135deg, #1e0a2e, #3a0a3a);
  border-radius: var(--blog-radius-card);
  position: relative;
  overflow: hidden;
}

.blog-hero::before {
  content: "";
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at 30% 40%, rgba(217,107,255,0.12) 0%, transparent 60%);
  pointer-events: none;
}

.blog-hero-title {
  font-family: var(--blog-font-display);
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.05;
  background: var(--blog-accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.blog-hero-description {
  font-size: 1.1rem;
  color: var(--blog-text-secondary);
  max-width: 560px;
  margin: 0 auto;
}

.blog-hero-search {
  display: flex;
  gap: 8px;
  max-width: 480px;
  margin: 28px auto 0;
}

.blog-hero-search input[type="search"] {
  flex: 1;
  padding: 12px 16px;
  background: var(--blog-surface);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius-input);
  color: var(--blog-text);
  font-family: var(--blog-font-body);
  font-size: 0.95rem;
  outline: none;
  transition: var(--blog-transition);
}

.blog-hero-search input[type="search"]:focus {
  border-color: var(--blog-primary);
  box-shadow: 0 0 0 3px var(--blog-primary-glow);
}

.blog-hero-search button {
  padding: 12px 24px;
  background: var(--blog-accent-gradient);
  color: #fff;
  border: none;
  border-radius: var(--blog-radius-input);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: opacity 0.15s;
}

.blog-hero-search button:hover { opacity: 0.9; }

/* ─── Section Tabs / Pills ─────────────────────────────────────── */
.blog-section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 32px;
}

.blog-section-pill {
  padding: 8px 20px;
  border-radius: var(--blog-radius-pill);
  background: var(--blog-surface);
  border: 1px solid var(--blog-border);
  color: var(--blog-text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--blog-transition);
}

.blog-section-pill:hover,
.blog-section-pill.active {
  border-color: var(--blog-primary);
  color: var(--blog-primary);
  background: var(--blog-primary-glow);
}

/* ─── Cards ─────────────────────────────────────────────────────── */
.blog-card {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--blog-border);
  border-radius: 0;
  padding: 16px 0;
  transition: var(--blog-transition);
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  color: inherit;
}

.blog-card:hover {
  border-bottom-color: var(--blog-primary);
  transform: none;
  box-shadow: none;
}

.blog-card:last-child {
  border-bottom: none;
}

.blog-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--blog-text);
  line-height: 1.35;
}

.blog-card-title:hover { color: var(--blog-primary); }

.blog-card-excerpt {
  font-size: 0.85rem;
  color: var(--blog-text-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--blog-text-muted);
  flex-wrap: wrap;
}

.blog-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--blog-border);
  padding-top: 12px;
  margin-top: 4px;
}

/* ─── Blog Grid ─────────────────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

/* ─── Blog Post List (simple) ───────────────────────────────────── */
.blog-post-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.blog-post-card {
  border-bottom: 1px solid var(--blog-border);
  padding-bottom: 20px;
}

.blog-post-card:last-child { border-bottom: none; }

.blog-post-card h2 {
  margin: 0 0 6px;
  font-family: var(--blog-font-display);
  font-size: 1.5rem;
}

.blog-post-card h2 a {
  color: var(--blog-text);
  text-decoration: none;
}

.blog-post-card h2 a:hover { color: var(--blog-primary); }

/* ─── Reading Experience (Article Page) ─────────────────────────── */
.post-wrap {
  padding-top: 32px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  color: var(--blog-text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.15s;
}

.back-link:hover { color: var(--blog-text); }

/* ─── Post Meta ──────────────────────────────────────────────────── */
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  font-size: 0.85rem;
  color: var(--blog-text-muted);
  border-bottom: 1px solid var(--blog-border);
  padding-bottom: 1rem;
}

.post-meta time { color: var(--blog-text-muted); }

/* ─── Blog Post Body - Premium Typography ──────────────────────── */
.post-body {
  margin-top: 24px;
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--blog-text-secondary);
  max-width: var(--blog-reading-width);
  margin: 0 auto;
  background: transparent !important;
}

/* ─── Headings - Clean & Modern ────────────────────────────────── */
.post-body h1,
.post-body .h1 {
  font-family: var(--blog-font-display);
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--blog-text);
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.post-body h2,
.post-body .h2 {
  font-family: var(--blog-font-display);
  font-size: 1.8rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--blog-text);
  margin: 2.5rem 0 1rem;
  border-bottom: 1px solid var(--blog-border);
  padding-bottom: 0.4rem;
}

.post-body h3,
.post-body .h3 {
  font-family: var(--blog-font-display);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--blog-text);
  margin: 2rem 0 0.75rem;
}

.post-body h4,
.post-body .h4 {
  font-family: var(--blog-font-body);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--blog-text-secondary);
  margin: 1.5rem 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.post-body h5,
.post-body .h5 {
  font-family: var(--blog-font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--blog-text-muted);
  margin: 1rem 0 0.25rem;
}

.post-body h6,
.post-body .h6 {
  font-family: var(--blog-font-body);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blog-text-muted);
  margin: 0.75rem 0 0.25rem;
  font-style: italic;
}

/* ─── Paragraphs ──────────────────────────────────────────────────── */
.post-body p {
  margin: 0 0 1.25rem;
  color: var(--blog-text-secondary);
  line-height: 1.85;
}

.post-body p:last-child {
  margin-bottom: 0;
}

/* ─── Lists ───────────────────────────────────────────────────────── */
.post-body ul,
.post-body ol {
  padding-left: 1.5rem;
  margin: 0 0 1.25rem;
  color: var(--blog-text-secondary);
  line-height: 1.85;
}

.post-body li {
  margin: 0.4rem 0;
  padding-left: 0.2rem;
}

.post-body ul ul,
.post-body ol ul,
.post-body ul ol,
.post-body ol ol {
  margin: 0.3rem 0;
}

/* ─── Blockquotes ─────────────────────────────────────────────────── */
.post-body blockquote {
  border-left: 4px solid var(--blog-primary);
  padding: 0.25rem 0 0.25rem 1.5rem;
  margin: 1.75rem 0;
  color: var(--blog-text);
  font-style: italic;
  font-size: 1.1rem;
  background: transparent !important;
  border-radius: 0 !important;
}

.post-body blockquote p {
  margin: 0.5rem 0;
  color: var(--blog-text);
}

.post-body blockquote strong,
.post-body blockquote b {
  color: var(--blog-primary);
}

.post-body blockquote cite {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-style: normal;
  color: var(--blog-text-muted);
}

/* ─── Pull Quotes ────────────────────────────────────────────────── */
.post-body .pull-quote {
  font-family: var(--blog-font-display);
  font-size: 1.6rem;
  font-weight: 300;
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  text-align: center;
  color: var(--blog-text);
  line-height: 1.4;
  border-top: 2px solid var(--blog-primary);
  border-bottom: 2px solid var(--blog-primary);
}

.post-body .pull-quote cite {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-style: normal;
  color: var(--blog-text-muted);
  font-family: var(--blog-font-body);
}

/* ─── Callout boxes ────────────────────────────────────────────── */
.post-body .callout {
  padding: 1.25rem 1.5rem;
  background: var(--blog-primary-glow);
  border-radius: var(--blog-radius-card);
  margin: 1.75rem 0;
  border-left: 4px solid var(--blog-primary);
  color: var(--blog-text-secondary);
}

.post-body .callout strong {
  color: var(--blog-text);
}

/* ─── Spoiler tag ────────────────────────────────────────────────── */
.post-body .spoiler {
  background: var(--blog-text);
  color: var(--blog-text);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.post-body .spoiler:hover {
  color: var(--blog-bg);
  background: var(--blog-text-muted);
}

/* ─── Images ──────────────────────────────────────────────────────── */
.post-body img {
  max-width: 100%;
  border-radius: var(--blog-radius-card);
  margin: 1.75rem 0;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.post-body .image-caption {
  display: block;
  text-align: center;
  font-size: 0.85rem;
  color: var(--blog-text-muted);
  margin-top: -0.75rem;
  margin-bottom: 1.75rem;
}

/* ─── Tables ──────────────────────────────────────────────────────── */
.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.75rem 0;
  border-radius: var(--blog-radius-card);
  overflow: hidden;
  border: 1px solid var(--blog-border);
}

.post-body th,
.post-body td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--blog-border);
  color: var(--blog-text-secondary);
}

.post-body th {
  background: var(--blog-surface-hover);
  font-weight: 600;
  color: var(--blog-text);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.post-body tr:last-child td {
  border-bottom: none;
}

.post-body tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

/* ─── Code ────────────────────────────────────────────────────────── */
.post-body code {
  background: var(--blog-surface-hover);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-family: 'SF Mono', 'Courier New', monospace;
  font-size: 0.9em;
  color: var(--blog-text-secondary);
  border: 1px solid var(--blog-border);
}

.post-body pre {
  background: var(--blog-surface);
  padding: 1.25rem 1.5rem;
  border-radius: var(--blog-radius-card);
  overflow-x: auto;
  border: 1px solid var(--blog-border);
  margin: 1.75rem 0;
  color: var(--blog-text-secondary);
}

.post-body pre code {
  background: transparent;
  padding: 0;
  border: none;
}

/* ─── Links ───────────────────────────────────────────────────────── */
.post-body a {
  color: var(--blog-primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

.post-body a:hover {
  border-bottom-color: var(--blog-primary);
  color: var(--blog-primary-hover);
}

/* ─── Horizontal Rules & Scene Dividers ──────────────────────────── */
.post-body hr {
  border: none;
  border-top: 1px solid var(--blog-border);
  margin: 2.5rem 0;
}

/* Roadmap cards ----------------------------------------------------
   Keyword-first product summaries for official roadmap posts. Icons use the
   same vector Font Awesome family as the rest of Community, never emoji, and
   inherit the active site palette. */
.post-body .roadmap-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 1.35rem 0 2rem;
}

.post-body .roadmap-card {
  position: relative;
  min-width: 0;
  padding: 1.05rem 1.1rem 1rem 3.8rem;
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius-card);
  background: linear-gradient(145deg, var(--blog-surface-hover), transparent);
}

.post-body .roadmap-card--planned {
  border-color: color-mix(in srgb, var(--blog-primary) 32%, var(--blog-border));
}

.post-body .roadmap-card h3 {
  margin: 0 0 0.25rem;
  font: 700 1rem/1.3 var(--blog-font-body);
  color: var(--blog-text);
}

.post-body .roadmap-card p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--blog-text-muted);
}

.post-body .roadmap-state {
  display: inline-block;
  margin-bottom: 0.35rem;
  color: var(--blog-primary);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.post-body .roadmap-icon {
  position: absolute;
  top: 1.05rem;
  left: 1rem;
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--blog-primary) 34%, transparent);
  border-radius: 0.7rem 0.7rem 0.7rem 0.25rem;
  background: var(--blog-primary-glow);
  color: var(--blog-primary);
  font: 900 0.88rem/1 "Font Awesome 6 Free";
}

.post-body .roadmap-icon--chat::before { content: "\f086"; }
.post-body .roadmap-icon--identity::before { content: "\f2bd"; }
.post-body .roadmap-icon--mobile::before { content: "\f3cd"; }
.post-body .roadmap-icon--site::before { content: "\f0ac"; }
.post-body .roadmap-icon--themes::before { content: "\f53f"; }
.post-body .roadmap-icon--dm::before { content: "\f27a"; }
.post-body .roadmap-icon--gif::before { content: "\f03e"; }
.post-body .roadmap-icon--music::before { content: "\f001"; }
.post-body .roadmap-icon--cloud::before { content: "\f382"; }
.post-body .roadmap-icon--android::before {
  content: "\f17b";
  font-family: "Font Awesome 6 Brands";
  font-weight: 400;
}
.post-body .roadmap-icon--bouncer::before { content: "\f233"; }

@media (max-width: 680px) {
  .post-body .roadmap-grid { grid-template-columns: 1fr; }
}

.post-body .scene-divider {
  text-align: center;
  padding: 1rem 0;
  color: var(--blog-text-muted);
  font-size: 1.5rem;
  letter-spacing: 0.5rem;
  opacity: 0.4;
  user-select: none;
}

/* ─── Post Navigation ───────────────────────────────────────────── */
.post-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--blog-border);
}

.post-nav-prev,
.post-nav-next {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  transition: background 0.2s;
}

.post-nav-prev:hover,
.post-nav-next:hover {
  background: var(--blog-surface-hover);
}

.post-nav-prev { align-items: flex-start; }
.post-nav-next { align-items: flex-end; text-align: right; }

.post-nav-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blog-text-muted);
}

.post-nav-title {
  font-size: 0.9rem;
  color: var(--blog-text);
  line-height: 1.3;
}

.post-nav-center a {
  padding: 0.4rem 1rem;
  border: 1px solid var(--blog-border);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--blog-text-muted);
  text-decoration: none;
  transition: all 0.2s;
}

.post-nav-center a:hover {
  border-color: var(--blog-primary);
  color: var(--blog-text);
}

/* ─── Comments ──────────────────────────────────────────────────── */
.comments-section {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--blog-border);
}

.comments-heading {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--blog-text);
  margin-bottom: 16px;
}

.comment-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--blog-border);
  background: transparent !important;
  border: none !important;
  border-bottom: 1px solid var(--blog-border) !important;
}

.comment-item:last-child {
  border-bottom: none !important;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--blog-text-muted);
  margin-bottom: 4px;
}

.comment-meta strong {
  color: var(--blog-text);
}

.comment-delete-form {
  display: inline-flex;
  margin-left: auto;
}

.comment-delete-button {
  border: 0;
  padding: 4px;
  color: var(--blog-text-muted);
  background: transparent;
  cursor: pointer;
}

.comment-delete-button:hover,
.comment-delete-button:focus-visible {
  color: #e94560;
}

.comment-body {
  line-height: 1.6;
  color: var(--blog-text-secondary);
  padding: 0 !important;
  background: transparent !important;
}

/* ─── Comment Form ──────────────────────────────────────────────── */
.comment-form {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--blog-border);
  background: transparent !important;
  border: none !important;
}

.comment-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--blog-text);
}

.comment-form textarea {
  width: 100%;
  padding: 12px;
  border-radius: var(--blog-radius-input);
  border: 1px solid var(--blog-border);
  background: var(--blog-surface);
  color: var(--blog-text);
  font: inherit;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 100px;
  box-sizing: border-box;
}

.comment-form textarea:focus {
  outline: none;
  border-color: var(--blog-primary);
  box-shadow: 0 0 0 3px var(--blog-primary-glow);
}

.comment-submit {
  margin-top: 12px;
}

.comment-submit button {
  padding: 10px 24px;
  background: var(--blog-accent-gradient);
  color: #fff;
  border: none;
  border-radius: var(--blog-radius-pill);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: opacity 0.15s;
}

.comment-submit button:hover {
  opacity: 0.9;
}

.comment-signin {
  margin-top: 16px;
  color: var(--blog-text-muted);
}

.comment-signin a {
  color: var(--blog-primary);
}

/* ─── Related Posts ─────────────────────────────────────────────── */
.related-posts {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--blog-border);
}

.related-heading {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--blog-text);
  margin-bottom: 16px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

/* ─── Tags & Badges ─────────────────────────────────────────────── */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--blog-radius-pill);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--blog-text-muted);
}

.tag-community { background: #2563eb; }
.tag-guide { background: #17876f; }
.tag-feedback { background: #f59e0b; color: #1a1020; }
.tag-erotic {
  background: rgba(236, 72, 153, 0.15);
  color: var(--blog-accent);
  border: 1px solid rgba(236, 72, 153, 0.25);
}

.tag-filter-btn {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius-pill);
  font-size: 0.8rem;
  text-decoration: none;
  color: var(--blog-text-secondary);
  transition: var(--blog-transition);
}

.tag-filter-btn:hover,
.tag-filter-btn.active {
  border-color: var(--blog-accent);
  color: var(--blog-accent);
  background: var(--blog-accent-glow);
}

/* ─── Buttons ───────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: var(--blog-accent-gradient);
  color: #fff;
  border: none;
  border-radius: var(--blog-radius-pill);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s;
  box-shadow: 0 2px 12px var(--blog-primary-glow);
}

.btn-primary:hover { opacity: 0.9; }

.ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius-pill);
  color: var(--blog-text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: none;
  transition: var(--blog-transition);
}

.ghost:hover {
  border-color: var(--blog-primary);
  color: var(--blog-text);
  background: var(--blog-surface-hover);
}

/* ─── Forms ─────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--blog-text);
  font-size: 0.9rem;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group input[type="email"],
.form-group input[type="search"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  background: var(--blog-surface);
  color: var(--blog-text);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius-input);
  font: inherit;
  font-size: 0.9rem;
  box-sizing: border-box;
  transition: var(--blog-transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--blog-primary);
  box-shadow: 0 0 0 3px var(--blog-primary-glow);
}

.form-group .help-text {
  font-size: 0.75rem;
  color: var(--blog-text-muted);
  margin-top: 4px;
}

.field-error {
  color: var(--blog-red);
  font-size: 0.8rem;
  margin-top: 4px;
}

.required { color: var(--blog-red); }

/* ─── Erotic Reads Library ──────────────────────────────────────── */
.library-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  align-items: start;
}

.library-sidebar {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

.filter-section {
  padding: 12px 0;
  border-bottom: 1px solid var(--blog-border);
}

.filter-section:last-child { border-bottom: none; }

.filter-heading {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--blog-text-muted);
  margin: 0 0 8px;
}

.filter-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.filter-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--blog-text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: background 0.1s;
}

.filter-item:hover { background: var(--blog-surface-hover); }

.filter-item-active {
  background: var(--blog-accent-glow);
  color: var(--blog-accent);
  font-weight: 600;
}

.filter-count {
  font-size: 0.7rem;
  opacity: 0.5;
}

.library-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.library-card {
  background: var(--blog-surface);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius-card);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: var(--blog-transition);
  text-decoration: none;
  color: inherit;
}

.library-card:hover {
  border-color: var(--blog-accent);
  transform: translateY(-2px);
  box-shadow: var(--blog-shadow-hover);
}

.library-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--blog-text);
}

.library-card-title:hover { color: var(--blog-accent); }

.library-card-excerpt {
  font-size: 0.82rem;
  color: var(--blog-text-secondary);
  line-height: 1.5;
}

.library-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--blog-text-muted);
}

.library-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto;
}

.library-card-footer {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--blog-border);
  padding-top: 10px;
  margin-top: 4px;
}

/* ─── Blog Landing Extras ──────────────────────────────────────── */
.blog-hero-eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--blog-text-muted);
  margin-bottom: 8px;
}

.blog-card-readmore {
  color: var(--blog-primary);
  font-size: 0.8rem;
  font-weight: 600;
}

.blog-view-all {
  display: inline-block;
  margin-top: 12px;
  color: var(--blog-primary);
  font-size: 0.85rem;
  text-decoration: none;
  font-weight: 600;
}

.blog-view-all:hover { text-decoration: underline; }

.blog-quicklinks-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--blog-border);
}

.blog-seo-quicklinks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.blog-seo-quicklink {
  display: block;
  padding: 16px;
  background: var(--blog-surface);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius-card);
  text-decoration: none;
  color: inherit;
  font-size: 0.85rem;
  transition: var(--blog-transition);
}

.blog-seo-quicklink:hover {
  border-color: var(--blog-primary);
  background: var(--blog-surface-hover);
}

.blog-seo-quicklink strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.9rem;
  color: var(--blog-accent);
}

/* ─── Tag Selector ──────────────────────────────────────────────── */
.tag-selector-container {
    position: relative;
    width: 100%;
}

.tag-selector-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--blog-surface);
    color: var(--blog-text);
    border: 1px solid var(--blog-border);
    border-radius: var(--blog-radius-input);
    font: inherit;
    font-size: 0.9rem;
    box-sizing: border-box;
    transition: var(--blog-transition);
}

.tag-selector-input:focus {
    outline: none;
    border-color: var(--blog-primary);
    box-shadow: 0 0 0 3px var(--blog-primary-glow);
}

.tag-selector-input::placeholder {
    color: var(--blog-text-muted);
    opacity: 0.6;
}

.tag-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--blog-surface);
    border: 1px solid var(--blog-border);
    border-radius: var(--blog-radius-input);
    box-shadow: var(--blog-shadow-card);
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 4px;
}

.tag-dropdown.open {
    display: block;
}

.tag-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--blog-text-secondary);
    font-size: 0.85rem;
    transition: background 0.15s;
}

.tag-dropdown-item:hover {
    background: var(--blog-surface-hover);
    color: var(--blog-text);
}

.tag-dropdown-item .tag-check {
    width: 18px;
    height: 18px;
    border: 2px solid var(--blog-border);
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.tag-dropdown-item .tag-check.selected {
    background: var(--blog-primary);
    border-color: var(--blog-primary);
}

.tag-dropdown-item .tag-check.selected::after {
    content: "✓";
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.tag-dropdown-item .tag-name {
    flex: 1;
}

.tag-dropdown-item .tag-count {
    font-size: 0.7rem;
    color: var(--blog-text-muted);
    opacity: 0.5;
}

.selected-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 0;
    min-height: 36px;
}

.selected-tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--blog-radius-pill);
    font-size: 0.78rem;
    font-weight: 500;
    background: var(--blog-primary-glow);
    color: var(--blog-primary);
    border: 1px solid rgba(168, 85, 247, 0.15);
}

.selected-tag-pill .remove-tag {
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--blog-text-muted);
    transition: color 0.15s;
    background: none;
    border: none;
    padding: 0 2px;
    line-height: 1;
}

.selected-tag-pill .remove-tag:hover {
    color: var(--blog-red);
}

.tag-selector-hint {
    font-size: 0.75rem;
    color: var(--blog-text-muted);
    margin-top: 4px;
}

.tag-selector-hint strong {
    color: var(--blog-text-secondary);
}

/* Hide the original tags field */
#id_tags {
    display: none;
}

/* ─── Responsive ────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .library-layout {
    grid-template-columns: 1fr;
  }
  .library-sidebar {
    position: static;
    max-height: none;
    display: contents;
  }
}

@media (max-width: 820px) {
  .blog-brand-img { height: 55px; }
  .blog-brand-bar { padding: 1rem 0.5rem; }

  .post-body { font-size: 0.95rem; }
  .post-body h1 { font-size: 1.8rem; }
  .post-body h2 { font-size: 1.5rem; }
  .post-body h3 { font-size: 1.2rem; }

  .post-nav { flex-direction: column; gap: 12px; }
}

@media (max-width: 768px) {
  .blog-wrap,
  .post-wrap,
  .submit-wrap,
  .library-layout,
  .blog-seo {
    padding: 24px 16px 48px;
  }

  .blog-hero {
    padding: 40px 24px;
  }

  .blog-hero-search {
    flex-direction: column;
  }

  .blog-hero-search button { width: 100%; }

  .blog-grid {
    grid-template-columns: 1fr;
  }

  .library-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .search-form { flex-direction: column; }
  .search-form .btn-primary { width: 100%; }

  .post-body table {
    display: block;
    overflow-x: auto;
  }
}

@media (max-width: 480px) {
  .blog-hero-title { font-size: 1.8rem; }
  .post-body { font-size: 0.9rem; }
  .post-body h1 { font-size: 1.5rem; }
  .post-body h2 { font-size: 1.2rem; }
  .post-body h3 { font-size: 1rem; }

  .submit-actions { flex-direction: column; align-items: stretch; }
  .submit-actions .cancel-link { text-align: center; }

  .library-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── Light Mode ──────────────────────────────────────────────────── */
:root.site-light .post-body blockquote {
    color: var(--blog-text);
}

:root.site-light .post-body .callout {
    background: var(--blog-primary-glow);
}

:root.site-light .post-body tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.02);
}

:root.site-light .post-body th {
    background: var(--blog-surface-hover);
}

:root.site-light .post-body .spoiler {
    background: var(--blog-text);
    color: var(--blog-text);
}

:root.site-light .post-body .spoiler:hover {
    color: var(--blog-bg);
    background: var(--blog-text-muted);
}

/* ============================================================
   BLOG INDEX LAYOUT — Three-Column Architecture
   Matching gallery rhythm
   ============================================================ */

/* ─── Index Wrap ─────────────────────────────────────────────── */
.blog-index-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* ─── Hero Logo ──────────────────────────────────────────────── */
.blog-hero-logo {
  filter: drop-shadow(0 4px 12px rgba(217, 107, 255, 0.25));
}

/* ─── Page Header ────────────────────────────────────────────── */
.blog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.blog-header h1,
.blog-header h2 {
  font-family: var(--blog-font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--blog-text);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.blog-header h1 i,
.blog-header h2 i {
  color: var(--blog-primary);
  font-size: 1.2rem;
}

.blog-header-actions {
  display: flex;
  gap: 8px;
}

/* ─── Filter Bar ─────────────────────────────────────────────── */
.blog-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
  padding: 16px 20px;
  background: var(--blog-surface);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius-card);
}

.filter-search-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 400px;
  position: relative;
}

.filter-search-icon {
  color: var(--blog-text-muted);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.filter-search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--blog-text);
  font-family: var(--blog-font-body);
  font-size: 0.9rem;
  padding: 4px 0;
  outline: none;
  min-width: 140px;
}

.filter-search-input::placeholder {
  color: var(--blog-text-muted);
}

.filter-search-btn {
  background: var(--blog-primary-glow);
  border: 1px solid var(--blog-primary);
  color: var(--blog-primary);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--blog-transition);
  flex-shrink: 0;
}

.filter-search-btn:hover {
  background: var(--blog-primary);
  color: #fff;
}

.blog-section-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.blog-section-pills .blog-section-pill {
  padding: 6px 14px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.blog-section-pills .blog-section-pill.active {
  border-color: var(--blog-primary);
  color: var(--blog-primary);
  background: var(--blog-primary-glow);
}

/* ================================================================
   THREE-COLUMN LAYOUT
   ================================================================ */

.blog-layout {
  display: grid;
  grid-template-columns: 220px 1fr 260px;
  gap: 28px;
  align-items: start;
}

/* ─── Sidebars (shared) ──────────────────────────────────────── */
.blog-sidebar {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.blog-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.blog-sidebar-nav h3 {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--blog-text-muted);
  margin: 0 0 6px;
  padding: 0 4px;
}

.blog-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--blog-text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: var(--blog-transition);
}

.blog-sidebar-nav a:hover {
  background: var(--blog-surface-hover);
  color: var(--blog-text);
}

.blog-sidebar-nav a.active {
  background: var(--blog-primary-glow);
  color: var(--blog-primary);
  font-weight: 600;
}

/* ─── Right Sidebar Widgets ──────────────────────────────────── */
.blog-sidebar-widget {
  background: var(--blog-surface);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius-card);
  padding: 16px;
}

.blog-sidebar-widget h3 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blog-text-muted);
  margin: 0 0 12px;
}

.sidebar-empty-text {
  font-size: 0.8rem;
  color: var(--blog-text-muted);
  font-style: italic;
  margin: 0;
}

.blog-sidebar-activity {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid var(--blog-border);
  text-decoration: none;
  color: inherit;
  transition: var(--blog-transition);
}

.blog-sidebar-activity:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.blog-sidebar-activity:hover .activity-title {
  color: var(--blog-primary);
}

.activity-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blog-text);
  line-height: 1.3;
  transition: color 0.15s;
}

.activity-meta {
  font-size: 0.72rem;
  color: var(--blog-text-muted);
}

.blog-sidebar-author {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--blog-border);
  text-decoration: none;
  color: inherit;
  transition: var(--blog-transition);
}

.blog-sidebar-author:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.blog-sidebar-author:hover .author-name {
  color: var(--blog-primary);
}

.author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blog-surface-hover);
  color: var(--blog-text-muted);
  font-size: 0.9rem;
}

.author-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.author-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blog-text);
  transition: color 0.15s;
}

.author-stats {
  font-size: 0.72rem;
  color: var(--blog-text-muted);
}

/* ─── Tag Cloud ───────────────────────────────────────────────── */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.blog-tag-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--blog-radius-pill);
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--blog-surface-hover);
  color: var(--blog-text-secondary);
  text-decoration: none;
  transition: var(--blog-transition);
  border: 1px solid transparent;
}

.blog-tag-pill:hover {
  border-color: var(--blog-primary);
  color: var(--blog-primary);
  background: var(--blog-primary-glow);
}

/* ================================================================
   ENHANCED CARDS
   ================================================================ */

/* ─── Section Header ──────────────────────────────────────────── */
.blog-section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 20px;
}

.blog-section-heading {
  font-family: var(--blog-font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--blog-text);
  margin: 0;
}

.blog-section-heading a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}

.blog-section-heading a:hover {
  color: var(--blog-primary);
}

.blog-section-viewall {
  font-size: 0.85rem;
  color: var(--blog-primary);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.15s;
}

.blog-section-viewall:hover {
  opacity: 0.8;
}

.blog-section-block {
  margin-bottom: 40px;
}

.blog-section-block:last-child {
  margin-bottom: 0;
}

/* ─── Featured Card (first in section) ────────────────────────── */
.blog-card--featured {
  display: flex;
  flex-direction: row;
  gap: 20px;
  background: var(--blog-surface);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius-card);
  padding: 0;
  overflow: hidden;
  margin-bottom: 20px;
  transition: var(--blog-transition);
  text-decoration: none;
  color: inherit;
}

.blog-card--featured:hover {
  border-color: var(--blog-primary);
  box-shadow: var(--blog-shadow-hover);
  transform: translateY(-1px);
}

.blog-card--featured .blog-card-cover {
  width: 240px;
  min-height: 200px;
  flex-shrink: 0;
  background: var(--blog-surface-hover);
}

.blog-card--featured .blog-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-card--featured .blog-card-body {
  padding: 20px 20px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

/* The normal featured layout gets its left inset from the cover column. */
.blog-card--featured.blog-card--no-cover .blog-card-body {
  padding: 20px;
}

.blog-card--featured .blog-card-title,
.blog-card--featured .blog-card-excerpt {
  overflow-wrap: anywhere;
}

.blog-card--featured .blog-card-title {
  font-size: 1.2rem;
  font-family: var(--blog-font-display);
}

/* ─── Grid Cards (2-column within section) ───────────────────── */
.blog-grid--compact {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.blog-card--grid {
  display: flex;
  flex-direction: column;
  background: var(--blog-surface);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius-card);
  padding: 0;
  overflow: hidden;
  transition: var(--blog-transition);
  text-decoration: none;
  color: inherit;
}

.blog-card--grid:hover {
  border-color: var(--blog-primary);
  box-shadow: var(--blog-shadow-hover);
  transform: translateY(-1px);
}

.blog-card--grid .blog-card-cover--sm {
  width: 100%;
  height: 120px;
  background: var(--blog-surface-hover);
}

.blog-card--grid .blog-card-cover--sm img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-card--grid .blog-card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.blog-card--grid .blog-card-title {
  font-size: 0.95rem;
}

/* ─── Discovery Cards (small, below main content) ─────────────── */
.blog-discovery {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--blog-border);
}

.discovery-title {
  font-family: var(--blog-font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--blog-text);
  margin: 0 0 16px;
}

.discovery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.blog-card--discovery {
  background: var(--blog-surface);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius-card);
  padding: 14px;
  transition: var(--blog-transition);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.blog-card--discovery:hover {
  border-color: var(--blog-primary);
  background: var(--blog-surface-hover);
}

.blog-card--discovery .blog-card-title {
  font-size: 0.9rem;
}

.blog-card--discovery .blog-card-author {
  font-size: 0.75rem;
  color: var(--blog-text-muted);
}

/* ─── Empty State ─────────────────────────────────────────────── */
.blog-empty {
  text-align: center;
  padding: 48px 24px;
}

.blog-empty .empty-icon {
  font-size: 3rem;
  color: var(--blog-text-muted);
  margin-bottom: 16px;
  opacity: 0.4;
}

.blog-empty p {
  color: var(--blog-text-secondary);
  font-size: 1rem;
}

/* ─── Reading Time & Word Count ───────────────────────────────── */
.reading-time {
  font-size: 0.72rem;
  color: var(--blog-text-muted);
  white-space: nowrap;
}

.blog-card-wordcount {
  font-size: 0.72rem;
  color: var(--blog-text-muted);
  white-space: nowrap;
}

.blog-card-author {
  font-size: 0.8rem;
  color: var(--blog-text-secondary);
  font-weight: 500;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 1200px) {
  .blog-layout {
    grid-template-columns: 200px 1fr 240px;
    gap: 20px;
  }

  .blog-card--featured .blog-card-cover {
    width: 180px;
    min-height: 160px;
  }
}

@media (max-width: 1024px) {
  .blog-layout {
    grid-template-columns: 1fr 240px;
  }

  .blog-sidebar--left {
    display: none;  /* Move to bottom sheet or hamburger on tablet */
  }

  .blog-grid--compact {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .blog-index-wrap {
    padding: 24px 16px 48px;
  }

  .blog-layout {
    grid-template-columns: 1fr;
  }

  .blog-sidebar--right {
    position: static;
    max-height: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }

  .blog-sidebar-widget {
    break-inside: avoid;
  }

  .blog-filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-search-wrapper {
    max-width: none;
  }

  .blog-section-pills {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .blog-section-pills .blog-section-pill {
    flex-shrink: 0;
  }

  .blog-card--featured {
    flex-direction: column;
  }

  .blog-card--featured .blog-card-cover {
    width: 100%;
    min-height: 180px;
    max-height: 220px;
  }

  .blog-card--featured .blog-card-body {
    padding: 16px;
  }

  .blog-grid--compact {
    grid-template-columns: 1fr;
  }

  .discovery-grid {
    grid-template-columns: 1fr 1fr;
  }

  .blog-hero {
    padding: 40px 20px;
  }

  .blog-hero-title {
    font-size: 1.8rem;
  }
}

@media (max-width: 480px) {
  .blog-grid--compact {
    grid-template-columns: 1fr;
  }

  .discovery-grid {
    grid-template-columns: 1fr;
  }

  .blog-hero-title {
    font-size: 1.5rem;
  }

  .blog-header h1,
  .blog-header h2 {
    font-size: 1.2rem;
  }
}

/* ============================================================
   EROTIC READS LIBRARY — Premium Digital Library Experience
   ============================================================ */

/* ─── Library Wrap ──────────────────────────────────────────── */
.library-index-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* ─── Library Hero ─────────────────────────────────────────── */
.library-hero {
  text-align: center;
  padding: 56px 40px 40px;
  margin-bottom: 32px;
  background: linear-gradient(160deg, #1e0a2e 0%, #2d1038 30%, #1a0a24 70%, #0f0518 100%);
  border-radius: var(--blog-radius-card);
  position: relative;
  overflow: hidden;
}

.library-hero::before {
  content: "";
  position: absolute;
  top: -30%;
  left: -20%;
  width: 140%;
  height: 160%;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 60%, rgba(168, 85, 247, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.library-hero-eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--blog-text-muted);
  margin-bottom: 8px;
}

.library-hero-title {
  font-family: var(--blog-font-display);
  font-size: clamp(2.2rem, 4.5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.05;
  background: linear-gradient(135deg, #ee86ff, #ec4899, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.library-hero-description {
  font-size: 1rem;
  color: var(--blog-text-secondary);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

.library-hero-search {
  display: flex;
  gap: 8px;
  max-width: 480px;
  margin: 24px auto 0;
}

.library-hero-search input[type="search"] {
  flex: 1;
  padding: 12px 16px;
  background: var(--blog-surface);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius-input);
  color: var(--blog-text);
  font-family: var(--blog-font-body);
  font-size: 0.9rem;
  outline: none;
  transition: var(--blog-transition);
}

.library-hero-search input[type="search"]:focus {
  border-color: var(--blog-accent);
  box-shadow: 0 0 0 3px var(--blog-accent-glow);
}

.library-hero-search button {
  padding: 12px 20px;
  background: var(--blog-accent-gradient);
  color: #fff;
  border: none;
  border-radius: var(--blog-radius-input);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.library-hero-search button:hover { opacity: 0.9; }

/* ─── Quick Genre Pills ─────────────────────────────────────── */
.library-genre-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
}

.library-genre-label {
  font-size: 0.75rem;
  color: var(--blog-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: 4px;
}

.library-genre-pill {
  padding: 6px 14px;
  border-radius: var(--blog-radius-pill);
  font-size: 0.8rem;
  font-weight: 500;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--blog-text-secondary);
  text-decoration: none;
  transition: var(--blog-transition);
}

.library-genre-pill:hover {
  background: var(--blog-accent-glow);
  border-color: var(--blog-accent);
  color: var(--blog-accent);
}

/* ─── Library Header ────────────────────────────────────────── */
.library-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.library-header-left {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.library-header-left h1,
.library-header-left h2 {
  font-family: var(--blog-font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--blog-text);
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.library-header-left h1 i,
.library-header-left h2 i {
  color: var(--blog-accent);
  font-size: 1.1rem;
}

.library-story-count {
  font-size: 0.85rem;
  color: var(--blog-text-muted);
}

.library-story-count strong {
  color: var(--blog-text);
}

.library-header-actions {
  display: flex;
  gap: 8px;
}

/* ─── Active Filters Bar ────────────────────────────────────── */
.library-active-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--blog-surface);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius-card);
  margin-bottom: 24px;
}

.active-filters-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blog-text-muted);
  margin-right: 4px;
}

.active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--blog-radius-pill);
  font-size: 0.78rem;
  font-weight: 500;
  background: var(--blog-accent-glow);
  color: var(--blog-accent);
  border: 1px solid rgba(236, 72, 153, 0.2);
  text-decoration: none;
  transition: var(--blog-transition);
}

.active-filter-chip:hover {
  background: rgba(236, 72, 153, 0.2);
  border-color: var(--blog-accent);
}

.active-filter-x {
  font-size: 0.7rem;
  opacity: 0.7;
}

.clear-filters-link {
  font-size: 0.78rem;
  color: var(--blog-text-muted);
  text-decoration: underline;
  margin-left: auto;
  transition: color 0.15s;
}

.clear-filters-link:hover {
  color: var(--blog-text);
}

/* ─── Three-Column Library Layout ───────────────────────────── */
.library-layout--three-col {
  display: grid;
  grid-template-columns: 220px 1fr 260px;
  gap: 28px;
  align-items: start;
}

.library-sidebar--left,
.library-sidebar--right {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.library-sidebar--left {
  gap: 0;
}

/* ─── Right Sidebar Widgets ─────────────────────────────────── */
.library-sidebar-widget {
  background: var(--blog-surface);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius-card);
  padding: 16px;
  margin-bottom: 16px;
}

.library-sidebar-widget h3 {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blog-text-muted);
  margin: 0 0 10px;
}

.library-sidebar-activity {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 0;
  border-bottom: 1px solid var(--blog-border);
  text-decoration: none;
  color: inherit;
  transition: var(--blog-transition);
}

.library-sidebar-activity:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.library-sidebar-activity:hover .activity-title {
  color: var(--blog-accent);
}

.library-sidebar-author {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--blog-border);
  text-decoration: none;
  color: inherit;
  transition: var(--blog-transition);
}

.library-sidebar-author:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.library-sidebar-author:hover .author-name {
  color: var(--blog-accent);
}

.library-tag-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--blog-radius-pill);
  font-size: 0.73rem;
  font-weight: 500;
  background: var(--blog-surface-hover);
  color: var(--blog-text-secondary);
  text-decoration: none;
  transition: var(--blog-transition);
  border: 1px solid transparent;
}

.library-tag-pill:hover {
  border-color: var(--blog-accent);
  color: var(--blog-accent);
  background: var(--blog-accent-glow);
}

/* ─── Enhanced Library Cards ────────────────────────────────── */
.library-card--enhanced {
  display: flex;
  flex-direction: column;
  background: var(--blog-surface);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius-card);
  overflow: hidden;
  transition: var(--blog-transition);
  text-decoration: none;
  color: inherit;
}

.library-card--enhanced:hover {
  border-color: var(--blog-accent);
  box-shadow: var(--blog-shadow-hover);
  transform: translateY(-2px);
}

.library-card-cover {
  position: relative;
  width: 100%;
  height: 160px;
  background: var(--blog-surface-hover);
  overflow: hidden;
  flex-shrink: 0;
}

.library-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.library-card--enhanced:hover .library-card-cover img {
  transform: scale(1.03);
}

.library-card-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--blog-surface-hover), var(--blog-surface));
  color: var(--blog-text-muted);
}

.library-card-cover-placeholder i {
  font-size: 1.5rem;
  opacity: 0.4;
}

.library-card-cover-placeholder span {
  font-family: var(--blog-font-display);
  font-size: 1.5rem;
  font-weight: 700;
  opacity: 0.3;
}

.library-card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 10px;
  border-radius: var(--blog-radius-pill);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.library-card-badge--completed {
  background: rgba(197, 141, 114, 0.12);
  color: var(--blog-green);
  border: 1px solid rgba(197, 141, 114, 0.3);
}

.library-card-badge--ongoing {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.library-card--enhanced .library-card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.library-card--enhanced .library-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-top: 1px solid var(--blog-border);
  margin-top: auto;
}

.library-card-author {
  font-size: 0.78rem;
  color: var(--blog-text-secondary);
  font-weight: 500;
}

.library-card-stats {
  display: flex;
  gap: 10px;
  font-size: 0.7rem;
  color: var(--blog-text-muted);
}

.stat-item {
  white-space: nowrap;
}

/* ─── Library Empty State ───────────────────────────────────── */
.library-empty {
  text-align: center;
  padding: 56px 24px;
}

.library-empty .empty-icon {
  font-size: 3rem;
  color: var(--blog-text-muted);
  margin-bottom: 16px;
  opacity: 0.35;
}

.library-empty h3 {
  font-family: var(--blog-font-display);
  font-size: 1.3rem;
  color: var(--blog-text);
  margin: 0 0 8px;
}

.library-empty p {
  color: var(--blog-text-secondary);
  margin: 0 0 20px;
}

/* ─── Library Pagination ────────────────────────────────────── */
.library-pagination {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  padding: 32px 0 8px;
}

.pagination-info {
  font-size: 0.85rem;
  color: var(--blog-text-muted);
}

.ghost--disabled {
  opacity: 0.35;
  pointer-events: none;
  cursor: not-allowed;
}

/* ─── Responsive — Library ──────────────────────────────────── */
@media (max-width: 1200px) {
  .library-layout--three-col {
    grid-template-columns: 200px 1fr 240px;
    gap: 20px;
  }

  .library-card-cover {
    height: 140px;
  }
}

@media (max-width: 1024px) {
  .library-layout--three-col {
    grid-template-columns: 1fr 240px;
  }

  .library-sidebar--left {
    display: none;
  }
}

@media (max-width: 768px) {
  .library-index-wrap {
    padding: 20px 14px 40px;
  }

  .library-layout--three-col {
    grid-template-columns: 1fr;
  }

  .library-sidebar--right {
    position: static;
    max-height: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
  }

  .library-sidebar-widget {
    margin-bottom: 0;
  }

  .library-hero {
    padding: 36px 18px 28px;
  }

  .library-hero-title {
    font-size: 1.8rem;
  }

  .library-hero-search {
    flex-direction: column;
  }

  .library-hero-search button {
    width: 100%;
  }

  .library-genre-pills {
    gap: 6px;
  }

  .library-genre-pill {
    font-size: 0.75rem;
    padding: 5px 10px;
  }

  .library-card-cover {
    height: 130px;
  }

  .library-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ============================================================
   POST DETAIL — Reading Experience
   ============================================================ */

/* ─── Post Detail Wrap ─────────────────────────────────────── */
.post-detail-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

/* ─── Reading Progress Bar ─────────────────────────────────── */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: 1000;
  pointer-events: none;
}

.reading-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--blog-accent-gradient);
  transition: width 0.1s linear;
}

/* ─── Breadcrumb ───────────────────────────────────────────── */
.post-breadcrumb {
  padding: 24px 0 16px;
  font-size: 0.85rem;
  color: var(--blog-text-muted);
}

.post-breadcrumb a {
  color: var(--blog-text-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.post-breadcrumb a:hover {
  color: var(--blog-primary);
}

.breadcrumb-sep {
  margin: 0 8px;
  color: var(--blog-text-muted);
}

.breadcrumb-current {
  color: var(--blog-text);
  font-weight: 500;
}

/* ─── Three-Column Post Layout ─────────────────────────────── */
.post-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, var(--blog-reading-width)) 240px;
  gap: 32px;
  justify-content: center;
  align-items: start;
}

/* ─── Post Sidebars ────────────────────────────────────────── */
.post-sidebar {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.post-sidebar--left {
  font-size: 0.85rem;
}

.post-sidebar--right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-toc {
  margin-bottom: 24px;
}

.post-toc h3 {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--blog-text-muted);
  margin: 0 0 8px;
}

.post-toc-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.post-toc-link {
  display: block;
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--blog-text-secondary);
  text-decoration: none;
  font-size: 0.82rem;
  line-height: 1.4;
  transition: var(--blog-transition);
  border-left: 2px solid transparent;
}

.post-toc-link:hover {
  background: var(--blog-surface-hover);
  color: var(--blog-text);
  border-left-color: var(--blog-primary);
}

.post-toc-link--sub {
  padding-left: 18px;
  font-size: 0.78rem;
}

.post-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.post-sidebar-nav h3 {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--blog-text-muted);
  margin: 0 0 6px;
}

.post-sidebar-nav a {
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--blog-text-secondary);
  text-decoration: none;
  font-size: 0.82rem;
  transition: var(--blog-transition);
}

.post-sidebar-nav a:hover {
  background: var(--blog-surface-hover);
  color: var(--blog-text);
}

/* ─── Right Sidebar Widgets ────────────────────────────────── */
.post-sidebar-widget {
  background: var(--blog-surface);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius-card);
  padding: 14px;
}

.post-sidebar-widget h3 {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blog-text-muted);
  margin: 0 0 10px;
}

.post-sidebar-activity {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 0;
  border-bottom: 1px solid var(--blog-border);
  text-decoration: none;
  color: inherit;
  transition: var(--blog-transition);
}

.post-sidebar-activity:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.post-sidebar-activity:hover .activity-title {
  color: var(--blog-primary);
}

/* ─── Story Info List ──────────────────────────────────────── */
.story-info-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.story-info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--blog-border);
  font-size: 0.82rem;
}

.story-info-item:last-child {
  border-bottom: none;
}

.story-info-label {
  color: var(--blog-text-muted);
}

.story-info-value {
  color: var(--blog-text);
  font-weight: 500;
}

/* ─── Article Styles ───────────────────────────────────────── */
.post-article {
  min-width: 0;
}

.post-meta-top {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 16px;
}

.post-title {
  font-family: var(--blog-font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--blog-text);
  margin: 0 0 12px;
}

.post-subtitle {
  font-size: 1.05rem;
  color: var(--blog-text-secondary);
  line-height: 1.6;
  margin: 0 0 20px;
}

.post-stats-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--blog-text-muted);
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--blog-border);
}

.post-author {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.post-author-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--blog-border);
  border-radius: 50%;
  background: var(--blog-primary-glow);
  color: var(--blog-primary);
  text-decoration: none;
}

.post-author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-page-avatar {
  width: 108px;
  height: 108px;
  flex: 0 0 108px;
  overflow: hidden;
  border: 1px solid var(--blog-border);
  border-radius: 50%;
  background: var(--blog-primary-glow);
  color: var(--blog-primary);
  font: 600 2.35rem/1 var(--blog-font-display);
  text-decoration: none;
}

.author-page-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-author a {
  color: var(--blog-primary);
  text-decoration: none;
  font-weight: 500;
}

.post-author a:hover {
  text-decoration: underline;
}

.post-stats-sep {
  margin: 0 4px;
  opacity: 0.5;
}

/* Public article controls must not depend on admin-only button styles. */
.post-meta-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  padding-left: 10px;
  border-left: 1px solid var(--blog-border-hover);
}

.post-meta-action {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--blog-border-hover);
  border-radius: var(--blog-radius-pill);
  color: var(--blog-text-secondary);
  background: rgba(255, 255, 255, 0.025);
  box-shadow: none;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.post-meta-action:hover,
.post-meta-action:focus-visible {
  color: var(--blog-text);
  border-color: rgba(217, 107, 255, 0.38);
  background: var(--blog-primary-glow);
  text-decoration: none;
  transform: translateY(-1px);
}

.post-meta-action:focus-visible {
  outline: 2px solid var(--blog-primary);
  outline-offset: 2px;
}

.post-meta-action--edit i { color: var(--blog-primary); }

.post-meta-action--report:hover,
.post-meta-action--report:focus-visible {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.38);
  background: rgba(239, 68, 68, 0.09);
}

@media (max-width: 560px) {
  .post-meta-actions {
    flex-basis: 100%;
    margin: 6px 0 0;
    padding: 8px 0 0;
    border-left: 0;
    border-top: 1px solid var(--blog-border);
  }
}

/* ─── Story Metadata (Erotic Reads) ────────────────────────── */
.post-story-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--blog-accent-glow);
  border-radius: var(--blog-radius-card);
  border: 1px solid rgba(236, 72, 153, 0.15);
}

.story-meta-item {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--blog-text-secondary);
}

.story-meta-genre {
  color: var(--blog-accent);
  font-weight: 600;
}

.story-meta-completed {
  color: var(--blog-green);
}

.story-meta-ongoing {
  color: #f59e0b;
}

/* ─── Featured Image ───────────────────────────────────────── */
.post-featured-image {
  margin: 0 0 24px;
  border-radius: var(--blog-radius-card);
  overflow: hidden;
}

.post-featured-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--blog-radius-card);
}

/* ─── Tags Footer ──────────────────────────────────────────── */
.post-tags-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--blog-border);
}

/* ─── Post Pagination (Prev/Next) ──────────────────────────── */
.post-pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 16px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--blog-border);
}

.post-pagination-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: var(--blog-radius-card);
  background: var(--blog-surface);
  border: 1px solid var(--blog-border);
  transition: var(--blog-transition);
}

.post-pagination-link:hover {
  border-color: var(--blog-primary);
  box-shadow: var(--blog-shadow-hover);
}

.post-pagination--prev {
  align-items: flex-start;
}

.post-pagination--next {
  align-items: flex-end;
  text-align: right;
}

.pagination-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blog-text-muted);
}

.pagination-title {
  font-size: 0.9rem;
  color: var(--blog-text);
  line-height: 1.3;
}

.post-pagination-center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 1px solid var(--blog-border);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--blog-text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: var(--blog-transition);
}

.post-pagination-center:hover {
  border-color: var(--blog-primary);
  color: var(--blog-text);
}

.post-pagination-spacer {
  flex: 1;
}

/* ─── Comments Empty State ─────────────────────────────────── */
.comments-empty {
  color: var(--blog-text-muted);
  font-style: italic;
  font-size: 0.9rem;
}

.comment-meta-sep {
  margin: 0 4px;
  opacity: 0.4;
}

/* ─── Responsive ───────────────────────────────────────────── */
@media (max-width: 1200px) {
  .post-layout {
    grid-template-columns: 180px minmax(0, var(--blog-reading-width)) 220px;
    gap: 24px;
  }
}

@media (max-width: 1024px) {
  .post-layout {
    grid-template-columns: 1fr 220px;
  }

  .post-sidebar--left {
    display: none;
  }
}

@media (max-width: 768px) {
  .post-detail-wrap {
    padding: 0 14px 48px;
  }

  .post-layout {
    grid-template-columns: 1fr;
  }

  .post-sidebar--right {
    position: static;
    max-height: none;
    order: 3;
  }

  .post-title {
    font-size: 1.5rem;
  }

  .post-pagination {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .post-pagination-center {
    order: -1;
    width: 100%;
  }

  .post-pagination--next {
    align-items: flex-start;
    text-align: left;
  }

  .post-breadcrumb {
    font-size: 0.78rem;
    padding: 16px 0 12px;
  }

  .post-stats-bar {
    font-size: 0.78rem;
  }
}

/* ================================================================
   SUBMIT PAGE — PREMIUM EDITORIAL STUDIO (FINAL)
   ================================================================ */

/* ─── Global Submit Wrap ────────────────────────────────────── */
.submit-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 32px 96px;
}

/* ─── Header Area ───────────────────────────────────────────── */
.submit-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 30px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--blog-border);
}

.submit-header-left h1 {
  font-family: var(--blog-font-display);
  font-size: 2.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--blog-text);
  margin: 0 0 4px;
}

.submit-header-left p {
  color: var(--blog-text-muted);
  font-size: 0.95rem;
  margin: 0;
  font-weight: 400;
}

.submit-header-actions .ghost {
  background: var(--blog-surface);
  border: 1px solid var(--blog-border);
  color: var(--blog-text-secondary);
  padding: 8px 16px;
  border-radius: var(--blog-radius-pill);
  font-size: 0.85rem;
  text-decoration: none;
  transition: var(--blog-transition);
  backdrop-filter: blur(8px);
}
.submit-header-actions .ghost:hover {
  border-color: var(--blog-primary);
  color: var(--blog-text);
  transform: translateY(-1px);
  box-shadow: var(--blog-shadow-hover);
}

/* ─── Studio Layout ─────────────────────────────────────────── */
.studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  align-items: start;
}

.studio-draft-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 10px;
  padding: 3px 8px;
  border: 1px solid rgba(168, 85, 247, 0.28);
  border-radius: var(--blog-radius-pill);
  color: var(--blog-primary);
  background: var(--blog-primary-glow);
  font-size: 0.7rem;
  font-weight: 700;
}

.studio-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* ─── The Sidebar (Glassmorphism card) ─────────────────────── */
.studio-sidebar {
  position: sticky;
  top: 72px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  background: var(--blog-surface);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius-card);
  padding: 32px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  backdrop-filter: blur(12px);
}

/* ─── Sidebar Form Elements ────────────────────────────────── */
.studio-sidebar .form-group {
  margin: 0;
}

.studio-sidebar .form-group label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blog-text-muted);
  font-weight: 700;
  margin-bottom: 8px;
}

.studio-sidebar .form-group select,
.studio-sidebar .form-group textarea {
  background: var(--blog-bg);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius-input);
  padding: 12px 14px;
  font-size: 0.9rem;
  width: 100%;
  color: var(--blog-text);
  transition: var(--blog-transition);
  box-sizing: border-box;
  font-family: var(--blog-font-body);
}
.studio-sidebar .form-group select:focus,
.studio-sidebar .form-group textarea:focus {
  border-color: var(--blog-primary);
  outline: none;
  box-shadow: 0 0 0 3px var(--blog-primary-glow);
}

/* ─── The Manuscript Title (Premium Type) ──────────────────── */
.studio-sidebar input[name="title"],
.studio-sidebar #id_title {
  font-family: var(--blog-font-display) !important;
  font-size: 2.4rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.02em !important;
  color: var(--blog-text) !important;
  border: none !important;
  background: transparent !important;
  padding: 0 0 12px 0 !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  width: 100% !important;
  outline: none !important;
  transition: border-color 0.3s ease;
  line-height: 1.2;
}

/* Make placeholder massive and elegant */
.studio-sidebar input[name="title"]::placeholder,
.studio-sidebar #id_title::placeholder {
  color: var(--blog-text-muted);
  opacity: 0.3;
  font-size: 2.4rem;
  font-weight: 400;
  letter-spacing: -0.02em;
}

/* Highlights the entire bottom border when focused */
.studio-sidebar input[name="title"]:focus,
.studio-sidebar #id_title:focus {
  border-bottom-color: var(--blog-primary) !important;
  background: transparent !important;
}

/* ─── Tags Selector (Minimalist) ───────────────────────────── */
.tag-selector-input {
  background: var(--blog-bg) !important;
  border: 1px solid var(--blog-border) !important;
  padding: 10px 14px !important;
  border-radius: var(--blog-radius-input) !important;
}
.selected-tag-pill {
  background: var(--blog-surface-hover);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius-pill);
  color: var(--blog-text-secondary);
}

/* ─── Sticky Floating Publish Bar ──────────────────────────── */
.submit-actions {
  position: sticky;
  bottom: 24px;
  margin-top: 48px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;

  background: rgba(26, 16, 32, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius-pill);
  padding: 8px 12px 8px 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 50;
  max-width: 100%;
  width: fit-content;
  margin-left: auto;
}

.submit-actions .btn-primary {
  background: var(--blog-accent-gradient);
  padding: 12px 36px;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  color: #fff;
  cursor: pointer;
  border-radius: var(--blog-radius-pill);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 16px var(--blog-accent-glow);
}
.submit-actions .btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 24px var(--blog-accent-glow);
}

.submit-actions .cancel-link {
  color: var(--blog-text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}
.submit-actions .cancel-link:hover {
  color: var(--blog-text-secondary);
}

/* ─── Mobile Responsive ────────────────────────────────────── */
@media (max-width: 1024px) {
  .studio-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .studio-sidebar {
    position: static;
    order: 2;
    padding: 24px;
    gap: 20px;
    box-shadow: none;
    background: transparent;
    border: none;
  }
  .submit-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    background: rgba(26, 16, 32, 0.98);
    padding: 12px 16px;
    width: 100%;
    margin: 0;
  }
  .studio-sidebar input[name="title"]::placeholder,
  .studio-sidebar #id_title::placeholder {
    font-size: 1.8rem;
  }
}


/* ================================================================
   LIGHT MODE HERO OVERRIDES — Unified Bright & Ethereal
   ================================================================ */

/* ─── 1. Override the Gradients for Light Mode ────────────── */
/* Applies to: Blog Hero, Forum Hero, Library Hero, Submit Header */
:root.site-light .blog-hero {
    background: var(--blog-surface) !important;
}
:root.site-light .blog-hero-title {
    background: var(--blog-accent-gradient) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}
:root.site-light .blog-hero-description {
    color: var(--blog-text-secondary) !important;
}

:root.site-light .blog-hero-search input[type="search"],
:root.site-light .library-hero-search input[type="search"] {
    background: var(--blog-bg);
    border-color: var(--blog-border);
    color: var(--blog-text);
}
:root.site-light .blog-hero-search input[type="search"]::placeholder,
:root.site-light .library-hero-search input[type="search"]::placeholder {
    color: var(--blog-text-muted);
}
:root.site-light .blog-hero-search input[type="search"]:focus,
:root.site-light .library-hero-search input[type="search"]:focus {
    border-color: var(--blog-primary);
    box-shadow: 0 0 0 3px var(--blog-primary-glow);
}

/* ─── 2. Fix the Typography Colors for Light Mode ──────────── */
/* Make the gradient text darker so it's readable on white */
:root.site-light .blog-hero-title,
:root.site-light .forum-hero-title,
:root.site-light .library-hero-title {
    background: linear-gradient(135deg, #a855f7, #db2777) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* Change description and subtitle text to dark gray */
:root.site-light .blog-hero-description,
:root.site-light .forum-hero-description,
:root.site-light .library-hero-description,
:root.site-light .blog-hero-eyebrow,
:root.site-light .forum-hero-eyebrow,
:root.site-light .library-hero-eyebrow {
    color: #5c4a6e !important; /* Your light mode secondary text color */
}

/* ─── 3. Fix the Search Boxes for Light Mode ───────────────── */
:root.site-light .blog-hero-search input[type="search"],
:root.site-light .forum-hero-search input[type="search"],
:root.site-light .library-hero-search input[type="search"] {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.08) !important;
    color: #1a1020 !important;
}
:root.site-light .blog-hero-search input[type="search"]::placeholder,
:root.site-light .forum-hero-search input[type="search"]::placeholder,
:root.site-light .library-hero-search input[type="search"]::placeholder {
    color: #8a7c9a !important;
}
:root.site-light .blog-hero-search input[type="search"]:focus,
:root.site-light .forum-hero-search input[type="search"]:focus,
:root.site-light .library-hero-search input[type="search"]:focus {
    border-color: #a855f7 !important;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15) !important;
}

/* ─── 4. Fix the Submit Page Header for Light Mode ─────────── */
:root.site-light .submit-header {
    border-bottom-color: rgba(0, 0, 0, 0.08) !important;
}
:root.site-light .submit-header-left h1 {
    color: #1a1020 !important;
    -webkit-text-fill-color: #1a1020 !important; /* Solid color for headers */
}
:root.site-light .submit-header-left p {
    color: #5c4a6e !important;
}

/* ================================================================
   STUDIO TITLE AREA — Large editorial title above the editor
   ================================================================ */
.studio-title-area {
  margin-bottom: 22px;
  max-width: none;
  width: 100%;
}

.studio-title-group {
  margin-bottom: 8px !important;
}

/* The actual title input — large, serif, editorial */
.studio-title-group input,
.studio-title-group textarea,
#id_title {
  font-family: var(--blog-font-display) !important;
  font-size: 2.35rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  color: var(--blog-text) !important;
  background: transparent !important;
  border: none !important;
  border-bottom: 2px solid var(--blog-border) !important;
  border-radius: 0 !important;
  padding: 0 0 16px 0 !important;
  width: 100% !important;
  outline: none !important;
  line-height: 1.15 !important;
  box-shadow: none !important;
  transition: border-color 0.3s ease;
}

.studio-title-group input::placeholder,
.studio-title-group textarea::placeholder,
#id_title::placeholder {
  color: var(--blog-text-muted);
  opacity: 0.35;
  font-size: 2.1rem;
  font-weight: 400;
}

.studio-title-group input:focus,
.studio-title-group textarea:focus,
#id_title:focus {
  border-bottom-color: var(--blog-primary) !important;
}

/* Slug preview */
.studio-slug-preview {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--blog-text-muted);
  padding: 4px 0;
  font-family: var(--blog-font-body);
}

.studio-slug-preview .slug-label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.7rem;
  opacity: 0.6;
}

.studio-slug-preview .slug-path {
  opacity: 0.5;
}

.studio-slug-preview .slug-value {
  color: var(--blog-text-secondary);
  font-weight: 500;
}

/* ================================================================
   STUDIO EDITOR AREA — Wrapper for toolbar + canvas
   ================================================================ */
.studio-editor-area {
  width: 100%;
  max-width: none;
  margin-bottom: 12px;
}

.studio-editor-hint {
  margin-top: 9px;
  font-size: 0.78rem;
  color: var(--blog-text-muted);
  text-align: center;
  opacity: 0.7;
}

.studio-editor-hint kbd {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--blog-surface-hover);
  border: 1px solid var(--blog-border);
  font-family: var(--blog-font-body);
  font-size: 0.75rem;
  color: var(--blog-text-secondary);
}

/* ================================================================
   STUDIO WRITING STATS — Live stats bar below editor
   ================================================================ */
.studio-writing-stats {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: none;
  width: 100%;
  padding: 9px 12px;
  background: var(--blog-surface);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius-card);
  font-family: var(--blog-font-body);
  font-size: 0.82rem;
}

.studio-writing-stats .stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  white-space: nowrap;
}

.studio-writing-stats .stat-item:first-child {
  padding-left: 4px;
}

.studio-writing-stats .stat-icon {
  color: var(--blog-green);
  font-size: 0.85rem;
}

.studio-writing-stats .stat-value {
  font-weight: 600;
  color: var(--blog-text);
  font-variant-numeric: tabular-nums;
}

.studio-writing-stats .stat-label {
  color: var(--blog-text-muted);
  font-size: 0.75rem;
}

.studio-writing-stats .stat-divider {
  width: 1px;
  height: 20px;
  background: var(--blog-border);
  flex-shrink: 0;
}

/* ================================================================
   SIDEBAR CARDS — Publishing assistant panels
   ================================================================ */
.studio-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}

.sidebar-card {
  background: var(--blog-surface);
  border: 1px solid var(--blog-border);
  border-radius: 14px;
  padding: 14px;
}

.sidebar-card-heading {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blog-text-muted);
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--blog-border);
}

/* Form elements inside cards */
.sidebar-card .form-group {
  margin-bottom: 11px;
}

.sidebar-card .form-group:last-child {
  margin-bottom: 0;
}

.sidebar-card .form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--blog-text-secondary);
  margin-bottom: 6px;
}

.sidebar-card .form-group select,
.sidebar-card .form-group textarea,
.sidebar-card .form-group input[type="text"],
.sidebar-card .form-group input[type="url"] {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  background: var(--blog-bg);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius-input);
  color: var(--blog-text);
  font-family: var(--blog-font-body);
  font-size: 0.88rem;
  box-sizing: border-box;
  transition: var(--blog-transition);
}

.sidebar-card .form-group select:focus,
.sidebar-card .form-group textarea:focus,
.sidebar-card .form-group input:focus {
  outline: none;
  border-color: var(--blog-primary);
  box-shadow: 0 0 0 3px var(--blog-primary-glow);
}

.sidebar-card .form-group textarea {
  min-height: 70px;
  resize: vertical;
}

.sidebar-card .help-text {
  display: block;
  font-size: 0.72rem;
  color: var(--blog-text-muted);
  margin-top: 5px;
  line-height: 1.4;
}

/* ================================================================
   SIDEBAR TOGGLES — Featured, Comments, etc.
   ================================================================ */
.sidebar-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  cursor: pointer;
  border-bottom: 1px solid var(--blog-border);
  font-size: 0.85rem;
  color: var(--blog-text-secondary);
  transition: color 0.15s;
}

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

.sidebar-toggle:first-child {
  padding-top: 0;
}

.sidebar-toggle:hover {
  color: var(--blog-text);
}

.sidebar-toggle input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 40px;
  height: 22px;
  background: var(--blog-border);
  border-radius: 11px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
  border: none;
  outline: none;
}

.sidebar-toggle input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.sidebar-toggle input[type="checkbox"]:checked {
  background: var(--blog-primary);
}

.sidebar-toggle input[type="checkbox"]:checked::after {
  transform: translateX(18px);
}

.sidebar-toggle .toggle-label {
  user-select: none;
}

/* ================================================================
   SEO PREVIEW — Google-style search result preview
   ================================================================ */
.seo-preview {
  font-family: Arial, sans-serif;
  font-size: 0.82rem;
  line-height: 1.4;
}

.seo-preview-title {
  color: #1a0dab;
  font-size: 1rem;
  font-weight: 400;
  text-decoration: none;
  display: block;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seo-preview-url {
  color: #006621;
  font-size: 0.78rem;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seo-preview-desc {
  color: #545454;
  font-size: 0.78rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* The settings drawer preview is a real inset card, not a border wrapped
   directly around the first line of text. */
.studio-inspector .seo-preview {
  box-sizing:border-box;
  width:100%;
  min-width:0;
  overflow:hidden;
  padding:1rem 1.1rem 1.05rem;
}
.studio-inspector .seo-preview > div { min-width:0; }
.studio-inspector .seo-preview-title {
  margin:0 0 .3rem;
  line-height:1.25;
}
.studio-inspector .seo-preview-url { margin:0 0 .35rem; }
.studio-inspector .seo-preview-desc { margin:0; }

/* ================================================================
   COVER IMAGE PREVIEW — Thumbnail in sidebar
   ================================================================ */
.cover-preview {
  margin-top: 9px;
  border-radius: var(--blog-radius-card);
  overflow: hidden;
  border: 1px solid var(--blog-border);
}

.cover-preview img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 128px;
  object-fit: cover;
}

.cover-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: stretch;
}

.cover-input-row input[type="text"] {
  min-width: 0;
}

.cover-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid rgba(168, 85, 247, 0.34);
  border-radius: var(--blog-radius-input);
  color: var(--blog-primary);
  background: var(--blog-primary-glow);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--blog-transition);
}

.cover-upload-btn:hover {
  border-color: var(--blog-primary);
  color: var(--blog-text);
  background: rgba(168, 85, 247, 0.18);
}

.cover-upload-btn:disabled {
  cursor: wait;
  opacity: 0.55;
}

.cover-upload-status {
  display: block;
  min-height: 1em;
  margin-top: 5px;
  color: var(--blog-green);
  font-size: 0.7rem;
}

.cover-upload-status.is-error {
  color: var(--blog-red);
}

/* ================================================================
   PREVIEW MODAL — Full-screen article preview
   ================================================================ */
.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
}

.preview-modal-content {
  position: relative;
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  background: var(--blog-surface);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius-card);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1;
}

.preview-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--blog-border);
  flex-shrink: 0;
}

.preview-modal-header h2 {
  font-family: var(--blog-font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--blog-text);
  margin: 0;
}

.preview-modal-close {
  background: none;
  border: none;
  color: var(--blog-text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: var(--blog-transition);
}

.preview-modal-close:hover {
  background: var(--blog-surface-hover);
  color: var(--blog-text);
}

.preview-modal-body {
  padding: 40px 48px;
  overflow-y: auto;
  flex: 1;
}

.preview-article {
  max-width: 720px;
  margin: 0 auto;
}

.preview-article h1 {
  font-family: var(--blog-font-display);
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--blog-text);
  margin: 0 0 2rem;
}

/* Mobile */
@media (max-width: 768px) {
  .preview-modal-content {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
  }

  .preview-modal-body {
    padding: 24px 20px;
  }

  .preview-article h1 {
    font-size: 1.6rem;
  }
}

/* ================================================================
   STICKY PUBLISH BAR — Multi-button action bar
   ================================================================ */
.submit-actions {
  position: sticky;
  bottom: 24px;
  margin-top: 28px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;

  background: rgba(26, 16, 32, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius-pill);
  padding: 8px 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 50;
  max-width: 100%;
  width: fit-content;
  margin-left: auto;
}

.submit-actions .btn-primary {
  background: var(--blog-accent-gradient);
  padding: 10px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  color: #fff;
  cursor: pointer;
  border-radius: var(--blog-radius-pill);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.15s;
  box-shadow: 0 4px 16px var(--blog-accent-glow);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.submit-actions .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--blog-accent-glow);
  opacity: 0.95;
}

.submit-actions .ghost {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--blog-border);
  border-radius: var(--blog-radius-pill);
  color: var(--blog-text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  transition: var(--blog-transition);
  font-family: var(--blog-font-body);
}

.submit-actions .ghost:hover {
  border-color: var(--blog-primary);
  color: var(--blog-text);
  background: var(--blog-surface-hover);
}

.submit-actions .cancel-link {
  color: var(--blog-text-muted);
}

.submit-actions .cancel-link:hover {
  color: var(--blog-text-secondary);
}

/* Light mode */
:root.site-light .submit-actions {
  background: rgba(250, 248, 246, 0.95);
  border-color: var(--blog-border);
  box-shadow: 0 4px 20px rgba(140, 90, 80, 0.06);
}

/* ================================================================
   STUDIO RESPONSIVE
   ================================================================ */
@media (max-width: 1024px) {
  .submit-wrap { padding-inline: 24px; }

  .studio-sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .sidebar-card--settings { grid-column: 1 / -1; }

  .studio-title-group input,
  .studio-title-group textarea,
  #id_title {
    font-size: 2rem !important;
  }

  .studio-title-group input::placeholder,
  .studio-title-group textarea::placeholder,
  #id_title::placeholder {
    font-size: 1.8rem;
  }

  .studio-writing-stats {
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
  }

  .studio-writing-stats .stat-divider {
    display: none;
  }

  .studio-writing-stats .stat-item {
    padding: 0 8px;
  }

  .submit-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    width: 100%;
    margin: 0;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 16px;
  }
}

@media (max-width: 480px) {
  .studio-title-group input,
  .studio-title-group textarea,
  #id_title {
    font-size: 1.6rem !important;
  }

  .studio-title-group input::placeholder,
  .studio-title-group textarea::placeholder,
  #id_title::placeholder {
    font-size: 1.4rem;
  }

  .submit-actions .ghost {
    padding: 6px 12px;
    font-size: 0.78rem;
  }

  .submit-actions .btn-primary {
    padding: 8px 18px;
    font-size: 0.82rem;
  }
}

@media (max-width: 700px) {
  .submit-wrap { padding: 22px 16px 116px; }
  .submit-header { align-items: flex-start; margin-bottom: 22px; }
  .submit-header-left h1 { font-size: 1.8rem; }
  .studio-draft-badge { display: flex; width: max-content; margin: 6px 0 0; }
  .studio-sidebar { grid-template-columns: 1fr; }
  .sidebar-card--settings { grid-column: auto; }
  .studio-editor-hint { text-align: left; line-height: 1.5; }
  .studio-writing-stats { justify-content: flex-start; overflow-x: auto; }
}
.tag-cross-content { margin-top:clamp(1.5rem,4vw,2.5rem); }
.tag-cross-content > h2 { display:flex;align-items:center;gap:.55rem;margin-bottom:.9rem;font-size:1.15rem; }
.tag-cross-content .discovery-grid { display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:.8rem; }
.tag-cross-content .discovery-grid a { display:grid;gap:.4rem;color:inherit;text-decoration:none; }
.tag-cross-content .discovery-grid img { width:100%;aspect-ratio:1;object-fit:cover;border-radius:10px; }

/* ================================================================
   EDITORIAL STUDIO — COMPACT PUBLISHING INSPECTOR
   Kept last so it replaces the older experimental sidebar treatments.
   ================================================================ */
.studio-layout {
  grid-template-columns: minmax(0, 1fr) minmax(278px, 300px);
  gap: clamp(20px, 2.4vw, 30px);
}

.studio-sidebar {
  position: sticky;
  top: 82px;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0;
  padding: 0 !important;
  overflow: visible;
  border: 1px solid var(--blog-border) !important;
  border-radius: 12px !important;
  background: color-mix(in srgb, var(--blog-surface) 94%, transparent) !important;
  box-shadow: 0 16px 42px rgba(0, 0, 0, .14) !important;
  backdrop-filter: blur(14px) !important;
}

.studio-sidebar .sidebar-card {
  min-width: 0;
  padding: 13px 14px;
  border: 0;
  border-bottom: 1px solid var(--blog-border);
  border-radius: 0;
  background: transparent;
}

.studio-sidebar .sidebar-card:first-child { border-radius: 12px 12px 0 0; }
.studio-sidebar .sidebar-card:last-child { border-bottom: 0; border-radius: 0 0 12px 12px; }
.studio-sidebar .sidebar-card-heading {
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  font-size: .66rem;
  letter-spacing: .1em;
}
.studio-sidebar .form-group { margin-bottom: 10px; }
.studio-sidebar .form-group label { margin-bottom: 5px; font-size: .74rem; }
.studio-sidebar .form-group select,
.studio-sidebar .form-group textarea,
.studio-sidebar .form-group input[type="text"],
.studio-sidebar .form-group input[type="url"],
.studio-sidebar .content-tag-search {
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: .84rem;
}
.studio-sidebar .form-group textarea { min-height: 66px; }
.studio-sidebar .help-text { margin-top: 4px; font-size: .68rem; line-height: 1.35; }
.studio-sidebar .content-tag-results {
  max-height: min(250px, 38dvh);
  border-color: color-mix(in srgb, var(--blog-primary) 32%, var(--blog-border));
  background: color-mix(in srgb, var(--blog-bg) 96%, var(--blog-primary));
  box-shadow: inset 0 1px rgba(255,255,255,.025), 0 8px 18px rgba(0,0,0,.18);
}
.studio-sidebar .content-tag-result { padding: 8px 9px; }
.studio-sidebar .content-tag-result small { font-size: .7rem; }
.studio-sidebar .cover-input-row { grid-template-columns: minmax(0,1fr) 74px; }
.studio-sidebar .cover-upload-btn { min-height: 38px; padding-inline: 9px; }
.studio-sidebar .sidebar-toggle { min-height: 38px; padding: 7px 0; }
.studio-sidebar .sidebar-toggle input[type="checkbox"] { width: 36px; height: 20px; }
.studio-sidebar .sidebar-toggle input[type="checkbox"]::after { width: 16px; height: 16px; }
.studio-sidebar .sidebar-toggle input[type="checkbox"]:checked::after { transform: translateX(16px); }

.studio-sidebar .seo-preview { line-height: 1.35; }
.studio-sidebar .seo-preview-title { color: var(--blog-primary); font-size: .9rem; }
.studio-sidebar .seo-preview-url { color: var(--blog-green); font-size: .7rem; }
.studio-sidebar .seo-preview-desc { color: var(--blog-text-muted); font-size: .72rem; }
:root.site-light .studio-sidebar .seo-preview-title { color: #551a8b; }
:root.site-light .studio-sidebar .seo-preview-url { color: #317b45; }
:root.site-light .studio-sidebar .seo-preview-desc { color: #5f5663; }

@media (max-width: 1024px) {
  .studio-layout { grid-template-columns: minmax(0,1fr); }
  .studio-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 12px;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }
  .studio-sidebar .sidebar-card,
  .studio-sidebar .sidebar-card:first-child,
  .studio-sidebar .sidebar-card:last-child {
    border: 1px solid var(--blog-border);
    border-radius: 10px;
    background: var(--blog-surface);
  }
  .studio-sidebar .sidebar-card--settings { grid-column: 1 / -1; }
}

@media (max-width: 920px) {
  .submit-wrap { padding-bottom: 176px; }
  .submit-actions { bottom: 68px; }
}

@media (max-width: 700px) {
  .submit-header { gap: 14px; flex-wrap: wrap; }
  .submit-header-actions { width: 100%; }
  .submit-header-actions .ghost { display: inline-flex; min-height: 42px; align-items: center; }
  .studio-sidebar { grid-template-columns: minmax(0,1fr); }
  .studio-sidebar .sidebar-card--settings { grid-column: auto; }
  .studio-writing-stats { overflow: visible; gap: 6px; }
  .studio-writing-stats .stat-item { min-width: 0; padding: 0 6px; }
  .submit-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    padding: 9px 12px max(9px, env(safe-area-inset-bottom));
  }
  .submit-actions .publish-btn { grid-column: 1 / -1; grid-row: 1; justify-content: center; }
  .submit-actions .ghost,.submit-actions .cancel-link { min-height: 40px; justify-content: center; text-align: center; }
  .submit-wrap .lexical-toolbar .toolbar-more-dropdown {
    bottom: calc(176px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 420px) {
  .submit-wrap { padding-inline: 12px; }
  .studio-sidebar .sidebar-card { padding: 12px; }
  .studio-sidebar .cover-input-row { grid-template-columns: minmax(0,1fr); }
  .studio-sidebar .cover-upload-btn { width: 100%; }
  .submit-actions { gap: 6px; }
  .submit-actions .ghost,.submit-actions .cancel-link { padding-inline: 7px; font-size: .72rem; }
}

/* Keep dialog geometry above the legacy modal contract during the studio transition. */
.studio-dialog .preview-modal-content { width: min(1050px, 96vw); max-width: none; max-height: 92vh; border-radius: 14px; }
.studio-dialog .preview-modal-header { display: grid; grid-template-columns: 1fr auto 1fr; min-height: 64px; padding: 12px 18px; }
.studio-dialog .preview-modal-body { max-height: calc(92vh - 66px); padding: 0; }
.studio-dialog .preview-article { width: min(100%, 75ch); max-width: none; padding: clamp(28px, 6vw, 72px); }
.studio-dialog .preview-article.is-mobile { width: min(390px, 100%); }
.studio-topbar .ghost, .publish-review-actions .ghost { border: 1px solid rgba(148,163,184,.18); border-radius: 8px; background: transparent; color: var(--blog-text-secondary); cursor: pointer; }
.studio-topbar .btn-primary, .publish-review-actions .btn-primary { border: 0; border-radius: 8px; background: var(--blog-accent-gradient); color: #fff; cursor: pointer; font-weight: 700; }

@media (max-width: 760px) {
  .studio-dialog .preview-modal-content { width: 100%; max-height: 100dvh; border-radius: 0; }
  .studio-dialog .preview-modal-header { grid-template-columns: 1fr auto; }
  .studio-dialog .preview-article { width: 100%; padding: 28px 20px; }
}

/* Erotic Reads and long-form pages use a literary journal rhythm. */
.library-hero { margin: 0 0 4rem; padding: clamp(3rem,8vw,7rem) clamp(1rem,5vw,5rem); border: 0; border-radius: 1.5rem; overflow: hidden; background: radial-gradient(circle at 82% 20%,rgba(200,80,117,.23),transparent 30%),linear-gradient(145deg,#2c111c,#140a10) !important; box-shadow: 0 35px 90px rgba(0,0,0,.3); }
.library-hero::before { opacity: .2; }
.library-hero-logo { display:none; }
.library-hero-eyebrow { color: var(--champagne,#e5c991); letter-spacing:.18em; }
.library-hero-title { max-width: 760px; color:#fff8ef !important; font: 400 clamp(3.5rem,7vw,6.6rem)/.88 var(--serif,Georgia,serif) !important; letter-spacing:-.045em; }
.library-hero-title em { color:#e17998; font-weight:400; }
.library-hero-description { max-width:58ch; color:#cfb9bf !important; font-size:1.02rem; line-height:1.75; }
.library-chat-invite { display:block; margin:1.5rem 0 1rem; color:#bda4ac; font-size:.78rem; text-decoration:none; }
.library-chat-invite strong { margin-left:.4rem; color:#ef9bb2; }
.library-hero-search { max-width:590px; }
.library-hero-search input[type="search"] { border-color:rgba(255,255,255,.14); border-radius:999px 0 0 999px; background:rgba(255,255,255,.055); }
.library-hero-search button { border-radius:0 999px 999px 0; background:linear-gradient(135deg,#bd3c69,#762441); }
.library-layout--three-col { grid-template-columns:minmax(0,1fr) 230px !important; gap:clamp(2rem,5vw,4rem) !important; }
.library-sidebar--left { display:none !important; }
.library-sidebar-widget { padding:1.25rem 0; border:0; border-top:1px solid var(--border); border-radius:0; background:transparent; }
.library-sidebar-widget h3 { color:var(--champagne); font-size:.68rem; letter-spacing:.13em; text-transform:uppercase; }
.library-card--enhanced { border:0; border-radius:0; background:transparent; box-shadow:none; }
.library-card--enhanced:hover { transform:translateY(-4px); box-shadow:none; }
.library-card-cover { border-radius:.8rem; overflow:hidden; }
.library-card--enhanced .library-card-body { padding:1.2rem .2rem .7rem; }
.library-card--enhanced .library-card-footer { padding:.8rem .2rem 1.4rem; border-top:1px solid var(--border); background:transparent; }
.library-card-title { color:var(--ink); font:600 1.65rem/1.08 var(--serif,Georgia,serif); }
.library-card-excerpt { color:var(--muted); line-height:1.65; }
.post-detail-wrap { max-width:1040px; }
.post-article { max-width:72ch; margin-inline:auto; }
.post-article h1 { font-family:var(--serif,Georgia,serif); font-size:clamp(3rem,6vw,5.5rem); font-weight:400; line-height:.95; }

@media (max-width:800px) {
  .library-layout--three-col { grid-template-columns:1fr !important; }
  .library-sidebar--right { display:none; }
  .library-hero { margin-inline:-.4rem; padding-inline:1.5rem; }
}

/* Editorial metadata belongs in the writing flow, not behind the settings drawer. */
.authoring-workspace .studio-summary-field {
  margin-top:1.35rem;
}
.authoring-workspace .studio-summary-field label,
.authoring-workspace .studio-category-field label,
.authoring-workspace .studio-tags-label label {
  display:flex;
  align-items:center;
  gap:.55rem;
  margin:0 0 .55rem;
  color:var(--fl-secondary,var(--blog-text-secondary));
  font-size:.72rem;
  font-weight:750;
  letter-spacing:.075em;
  text-transform:uppercase;
}
.authoring-workspace .studio-summary-field label span,
.authoring-workspace .studio-category-field label span {
  color:var(--fl-champagne,#e5c991);
  font-size:.59rem;
  letter-spacing:.11em;
}
.authoring-workspace .studio-summary-field #id_excerpt {
  width:100%;
  min-height:74px;
  padding:.9rem 1rem;
  resize:vertical;
  border:1px solid var(--fl-border,var(--blog-border));
  border-radius:1.15rem 1.15rem 2.25rem 1.15rem;
  background:rgba(255,248,239,.025);
  color:var(--fl-ivory,var(--blog-text));
  font:400 1.03rem/1.55 var(--fl-serif,Georgia,serif);
  box-shadow:inset 0 1px rgba(255,248,239,.025);
}
.authoring-workspace .studio-summary-field #id_excerpt:focus {
  border-color:var(--fl-rose,var(--blog-accent));
  outline:0;
  box-shadow:0 0 0 3px rgba(188,62,105,.1);
}
.authoring-workspace .studio-summary-field small {
  display:block;
  margin:.45rem .25rem 0;
  color:var(--fl-muted,var(--blog-text-muted));
  font-size:.7rem;
}
.authoring-workspace .studio-classification {
  width:min(100%,900px);
  margin:0 auto 1rem;
  padding:clamp(1rem,2.2vw,1.45rem);
  border:1px solid var(--fl-border,var(--blog-border));
  border-radius:1.6rem 1.6rem 3.25rem 1.6rem;
  background:
    radial-gradient(circle at 100% 0,rgba(188,62,105,.11),transparent 38%),
    rgba(255,248,239,.022);
  box-shadow:inset 0 1px rgba(255,248,239,.025),0 18px 50px rgba(0,0,0,.09);
}
.authoring-workspace .studio-classification-heading {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(260px,42ch);
  gap:1.5rem;
  align-items:end;
  margin-bottom:1rem;
}
.authoring-workspace .studio-classification-heading h2 {
  margin:.25rem 0 0;
  color:var(--fl-ivory,var(--blog-text));
  font:500 1.55rem/1 var(--fl-serif,Georgia,serif);
}
.authoring-workspace .studio-classification-heading p {
  margin:0;
  color:var(--fl-muted,var(--blog-text-muted));
  font-size:.73rem;
  line-height:1.55;
}
.authoring-workspace .studio-classification-grid {
  display:grid;
  grid-template-columns:minmax(175px,220px) minmax(0,1fr);
  gap:1rem;
  align-items:start;
}
.authoring-workspace .studio-category-field select,
.authoring-workspace .content-tag-search {
  width:100%;
  min-height:46px;
  padding:.72rem .9rem;
  border:1px solid var(--fl-border,var(--blog-border));
  border-radius:999px;
  background:rgba(255,248,239,.035);
  color:var(--fl-ivory,var(--blog-text));
  font:inherit;
  box-shadow:inset 0 1px rgba(255,248,239,.025);
}
.authoring-workspace .studio-category-field select {
  color-scheme:dark;
  appearance:none;
  -webkit-appearance:none;
  padding-right:3rem;
  background-color:rgba(255,248,239,.035) !important;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='m2 2 5 5 5-5' fill='none' stroke='%23e8c0c5' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat:no-repeat !important;
  background-position:right 1.05rem center !important;
  background-size:14px 9px !important;
  cursor:pointer;
}
.authoring-workspace .studio-category-field select:invalid { color:var(--fl-muted,var(--blog-text-muted)) !important; }
.authoring-workspace .studio-category-field select option {
  background-color:var(--fl-editorial,#211018);
  color:var(--fl-ivory,#fff8ef);
  font-family:var(--fl-sans,Inter,sans-serif);
}
.authoring-workspace .studio-category-field select option:checked {
  background-color:var(--fl-burgundy,#8b294e);
  color:#fff8ef;
}
.authoring-workspace .studio-category-field select:focus,
.authoring-workspace .content-tag-search:focus {
  border-color:var(--fl-rose,var(--blog-accent));
  outline:0;
  box-shadow:0 0 0 3px rgba(188,62,105,.1);
}
.authoring-workspace .studio-category-requirement {
  display:block;
  margin:.55rem .35rem 0;
  color:var(--fl-muted,var(--blog-text-muted));
  font-size:.68rem;
  line-height:1.45;
}
.authoring-workspace .studio-guidelines-access {
  display:grid;
  gap:.45rem;
  margin-top:.8rem;
}
.authoring-workspace .studio-guidelines-access[hidden] { display:none; }
.authoring-workspace .studio-guidelines-button {
  width:100%;
  min-height:38px;
  padding:.55rem .8rem;
  border:1px solid var(--fl-border-strong,var(--blog-border-hover));
  border-radius:999px;
  background:rgba(188,62,105,.075);
  color:var(--fl-rose,var(--blog-primary));
  font:750 .68rem/1.2 var(--fl-sans,Inter,sans-serif);
  cursor:pointer;
}
.authoring-workspace .studio-guidelines-button:hover {
  border-color:var(--fl-rose,var(--blog-primary));
  background:rgba(188,62,105,.12);
  color:var(--fl-ivory,var(--blog-text));
}
.authoring-workspace #erotic-guidelines-state {
  color:var(--fl-warning,#d1ad70);
  font-size:.66rem;
  line-height:1.4;
  text-align:center;
}
.authoring-workspace #erotic-guidelines-state.is-accepted { color:var(--fl-success,#c58d72); }

.erotic-guidelines-card {
  position:relative;
  z-index:1;
  width:min(720px,calc(100vw - 2rem));
  max-height:min(880px,calc(100dvh - 2rem));
  overflow:auto;
  padding:clamp(1.5rem,4vw,2.5rem);
  border:1px solid var(--fl-border,var(--blog-border));
  border-radius:2rem 2rem 5rem 2rem;
  background:
    radial-gradient(circle at 100% 0,rgba(188,62,105,.14),transparent 38%),
    var(--fl-editorial,#211018);
  color:var(--fl-text,var(--blog-text-secondary));
  box-shadow:var(--fl-shadow-lg,0 30px 90px rgba(0,0,0,.4));
}
.erotic-guidelines-card > .preview-modal-close { position:absolute;top:1.1rem;right:1.1rem; }
.erotic-guidelines-card h2 {
  max-width:15ch;
  margin:.45rem 3rem .8rem 0;
  color:var(--fl-ivory,var(--blog-text));
  font:500 clamp(2rem,6vw,3.1rem)/.95 var(--fl-serif,Georgia,serif);
}
.erotic-guidelines-intro { max-width:62ch;margin:0 0 1.35rem;color:var(--fl-secondary,var(--blog-text-secondary));line-height:1.6; }
.erotic-guidelines-list {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:0;
  margin:0;
  padding:0;
  border-top:1px solid var(--fl-border,var(--blog-border));
  list-style:none;
}
.erotic-guidelines-list li {
  display:grid;
  align-content:start;
  gap:.35rem;
  padding:1rem 1rem 1rem 0;
  border-bottom:1px solid var(--fl-border,var(--blog-border));
}
.erotic-guidelines-list li:nth-child(even) { padding-left:1rem;border-left:1px solid var(--fl-border,var(--blog-border)); }
.erotic-guidelines-list strong { color:var(--fl-ivory,var(--blog-text));font-family:var(--fl-serif,Georgia,serif);font-size:1.12rem;font-weight:600; }
.erotic-guidelines-list span { color:var(--fl-muted,var(--blog-text-muted));font-size:.76rem;line-height:1.55; }
.erotic-guidelines-prohibited {
  display:grid;
  gap:.35rem;
  margin-top:1.25rem;
  padding:1rem 1.1rem;
  border:1px solid color-mix(in srgb,var(--fl-danger,#d97878) 36%,transparent);
  border-left:2px solid var(--fl-danger,#d97878);
  border-radius:6px 1.25rem 1.25rem 6px;
  background:color-mix(in srgb,var(--fl-danger,#d97878) 8%,transparent);
}
.erotic-guidelines-prohibited strong { color:var(--fl-danger,#d97878);font-size:.68rem;letter-spacing:.1em;text-transform:uppercase; }
.erotic-guidelines-prohibited span { color:var(--fl-secondary,var(--blog-text-secondary));font-size:.8rem;line-height:1.5; }
.erotic-guidelines-actions { display:flex;justify-content:flex-end;gap:.7rem;margin-top:1.5rem; }
.erotic-guidelines-actions .ghost,
.erotic-guidelines-actions .btn-primary { min-height:42px;padding:.7rem 1rem;border-radius:999px; }
:root.site-light .erotic-guidelines-card {
  background:radial-gradient(circle at 100% 0,rgba(183,67,103,.1),transparent 40%),var(--fl-popover,#f1dfd8);
}
@media (max-width:620px) {
  .erotic-guidelines-card { border-radius:1.4rem 1.4rem 3.5rem 1.4rem; }
  .erotic-guidelines-list { grid-template-columns:1fr; }
  .erotic-guidelines-list li,.erotic-guidelines-list li:nth-child(even) { padding:1rem 0;border-left:0; }
  .erotic-guidelines-actions { align-items:stretch;flex-direction:column-reverse; }
  .erotic-guidelines-actions button { width:100%; }
}
.authoring-workspace .studio-tags-label {
  display:flex;
  justify-content:space-between;
  gap:1rem;
}
.authoring-workspace .studio-tags-label > span {
  color:var(--fl-muted,var(--blog-text-muted));
  font-size:.68rem;
}
.authoring-workspace .content-tag-results {
  max-height:min(430px,52dvh);
  padding:.45rem;
  border-color:var(--fl-border,var(--blog-border));
  border-radius:1.1rem 1.1rem 2rem 1.1rem;
  background:var(--fl-popover,var(--blog-surface));
  box-shadow:0 20px 55px rgba(0,0,0,.28);
}
.authoring-workspace .content-tag-group-heading {
  background:var(--fl-popover,var(--blog-surface));
  color:var(--fl-champagne,#e5c991);
}
.authoring-workspace .content-tag-result {
  min-height:48px;
  padding:.7rem .8rem;
  border-radius:.85rem;
}
.authoring-workspace .content-tag-result:hover,
.authoring-workspace .content-tag-result:focus-visible,
.authoring-workspace .content-tag-result.is-active {
  color:var(--fl-rose,var(--blog-accent));
  background:rgba(188,62,105,.1);
}
.authoring-workspace .content-tag-pill {
  border-color:var(--fl-border-strong,var(--blog-border-hover));
  background:rgba(188,62,105,.1);
  color:var(--fl-blush,var(--blog-accent));
}
.authoring-workspace .studio-tag-actions {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:.55rem 1rem;
  margin-top:.6rem;
}
.authoring-workspace .studio-tag-actions .tag-browse-button {
  min-height:36px;
  margin:0;
  padding:.5rem .8rem;
  border:1px solid var(--fl-border,var(--blog-border));
  border-radius:999px;
  background:transparent;
  color:var(--fl-secondary,var(--blog-text-secondary));
  cursor:pointer;
}
.authoring-workspace .studio-tag-actions .tag-browse-button:hover {
  border-color:var(--fl-border-strong,var(--blog-border-hover));
  background:rgba(188,62,105,.08);
  color:var(--fl-ivory,var(--blog-text));
}
.authoring-workspace .studio-tag-actions .help-text {
  color:var(--fl-muted,var(--blog-text-muted));
  font-size:.68rem;
}
:root.site-light .authoring-workspace .studio-summary-field #id_excerpt,
:root.site-light .authoring-workspace .studio-category-field select,
:root.site-light .authoring-workspace .content-tag-search {
  background:rgba(249,232,223,.48);
}
:root.site-light .authoring-workspace .studio-category-field select {
  color-scheme:light;
  background-color:rgba(249,232,223,.48) !important;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='m2 2 5 5 5-5' fill='none' stroke='%2363434e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
}
:root.site-light .authoring-workspace .studio-category-field select option {
  background-color:var(--fl-popover,#f1dfd8);
  color:var(--fl-ivory,#321923);
}
:root.site-light .authoring-workspace .studio-category-field select option:checked {
  background-color:#d9b9ba;
  color:#321923;
}
:root.site-light .authoring-workspace .studio-classification {
  background:radial-gradient(circle at 100% 0,rgba(169,48,89,.1),transparent 40%),rgba(244,224,216,.38);
  box-shadow:0 18px 50px rgba(72,31,44,.08);
}
:root.site-light .authoring-workspace .content-tag-results,
:root.site-light .authoring-workspace .content-tag-group-heading {
  background:#efdcd5;
}
@media (max-width:760px) {
  .authoring-workspace .studio-summary-field { margin-top:1rem; }
  .authoring-workspace .studio-classification { padding:1rem; border-radius:1.35rem 1.35rem 2.6rem 1.35rem; }
  .authoring-workspace .studio-classification-heading,
  .authoring-workspace .studio-classification-grid { grid-template-columns:minmax(0,1fr); gap:.85rem; }
  .authoring-workspace .studio-classification-heading p { max-width:55ch; }
  .authoring-workspace .content-tag-results { max-height:min(360px,48dvh); }
}

/* Unified editorial actions: one visual system for article, author, and section follows. */
.article-engagement {
  margin-top:clamp(1.5rem,4vw,2.25rem);
  padding:1rem 0;
  border-top:1px solid var(--fl-border,var(--blog-border));
  border-bottom:1px solid var(--fl-border,var(--blog-border));
}
.article-engagement__label {
  margin:0 0 .7rem;
  color:var(--fl-champagne,var(--blog-accent));
  font-size:.66rem;
  font-weight:800;
  letter-spacing:.12em;
  text-transform:uppercase;
}
.article-engagement .content-preference.content-preference--article {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(132px,1fr));
  gap:.55rem;
  margin:0;
  padding:0;
  border:0;
}
.article-engagement .content-preference.content-preference--article > button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.45rem;
  width:100%;
  min-width:0;
  min-height:44px;
  padding:.66rem .8rem;
  border:1px solid var(--fl-border-strong,var(--blog-border-hover));
  border-radius:999px;
  background:rgba(255,248,239,.035);
  color:var(--fl-secondary,var(--blog-text-secondary));
  font:700 .75rem/1.1 var(--fl-sans,system-ui,sans-serif);
  white-space:nowrap;
}
.article-engagement .content-preference.content-preference--article > button:hover,
.article-engagement .content-preference.content-preference--article > button:focus-visible {
  border-color:var(--fl-rose,var(--blog-primary));
  background:rgba(188,62,105,.1);
  color:var(--fl-ivory,var(--blog-text));
}
.article-engagement .content-preference.content-preference--article > button.is-active {
  border-color:color-mix(in srgb,var(--fl-rose,var(--blog-primary)) 62%,transparent);
  background:rgba(188,62,105,.14);
  color:var(--fl-rose,var(--blog-primary));
}
.article-engagement .content-preference.content-preference--article > button i {
  width:.9rem;
  flex:0 0 .9rem;
  text-align:center;
}
.author-follow-actions { margin-top:.75rem; }
.author-follow-actions .follow-control,
.blog-header-actions > .follow-control,
.blog-header-actions > a {
  min-height:42px;
}

@media (max-width:680px) {
  .article-engagement { padding:.9rem 0; }
  .article-engagement .content-preference.content-preference--article {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:.5rem;
  }
  .article-engagement .content-preference.content-preference--article > button {
    min-height:46px;
    padding:.62rem .45rem;
    font-size:.72rem;
  }
  .blog-header-actions {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    width:100%;
    gap:.5rem;
  }
  .blog-header-actions > .follow-control,
  .blog-header-actions > a {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:100%;
    min-width:0;
    min-height:44px;
    margin:0;
    padding:.65rem .7rem;
    border-radius:999px;
    font-size:.72rem;
    text-align:center;
  }
  .author-follow-actions .follow-control {
    min-height:44px;
    padding:.65rem .9rem;
  }
}

@media (max-width:360px) {
  .article-engagement .content-preference.content-preference--article {
    grid-template-columns:minmax(0,1fr);
  }
}

/* Article discovery reads as an editorial footer, not a row of dashboard cards. */
.post-sidebar--right {
  gap:0;
}
.post-sidebar--right .post-sidebar-widget {
  width:100%;
  min-width:0;
  max-width:100%;
  padding:1.05rem .15rem 1.25rem;
  border:0;
  border-top:1px solid var(--fl-border,var(--blog-border));
  border-radius:0;
  background:transparent;
  box-shadow:none;
}
.post-sidebar--right .post-sidebar-widget:first-child {
  border-top-color:color-mix(in srgb,var(--fl-rose,var(--blog-primary)) 45%,transparent);
}
.post-sidebar--right .post-sidebar-widget h3 {
  margin:0 0 .65rem;
  color:var(--fl-champagne,var(--blog-text-muted));
  font-size:.64rem;
  letter-spacing:.12em;
}
.post-sidebar--right .post-sidebar-activity {
  min-width:0;
  padding:.72rem .2rem;
  border-bottom-color:var(--fl-border,var(--blog-border));
}
.post-sidebar--right .post-sidebar-activity .activity-title,
.post-sidebar--right .post-sidebar-activity .activity-meta {
  min-width:0;
  overflow-wrap:anywhere;
  white-space:normal;
}
.post-sidebar--right .post-sidebar-activity .activity-title {
  font-family:var(--fl-serif,var(--blog-font-display));
  font-size:1rem;
  font-weight:600;
  line-height:1.25;
}
.post-sidebar--right .post-sidebar-activity:hover .activity-title,
.post-sidebar--right .post-sidebar-activity:focus-visible .activity-title {
  color:var(--fl-rose,var(--blog-primary));
}

@media (max-width:768px) {
  .post-layout,
  .post-article,
  .post-sidebar--right {
    width:100%;
    min-width:0;
    max-width:100%;
  }
  .post-sidebar--right {
    display:grid;
    grid-template-columns:minmax(0,1fr);
    overflow:visible;
    margin-top:.75rem;
  }
  .post-sidebar--right .post-sidebar-widget {
    box-sizing:border-box;
    padding:1.2rem .15rem 1.4rem;
  }
  .post-sidebar--right .post-sidebar-activity .activity-title {
    font-size:1.08rem;
  }
}

/* Mobile Knowledge Hub discovery: stack sections instead of squeezing a card grid. */
@media (max-width:768px) {
  .blog-layout,
  .blog-main,
  .blog-layout > .blog-sidebar--right {
    width:100%;
    min-width:0;
    max-width:100%;
  }
  .blog-layout > .blog-sidebar--right {
    position:static;
    display:flex;
    flex-direction:column;
    gap:0;
    max-height:none;
    margin-top:1.25rem;
    overflow:visible;
  }
  .blog-layout > .blog-sidebar--right .blog-sidebar-widget {
    box-sizing:border-box;
    width:100%;
    min-width:0;
    margin:0;
    padding:1.25rem .1rem 1.4rem;
    border:0;
    border-top:1px solid var(--fl-border,var(--blog-border));
    border-radius:0;
    background:transparent;
    box-shadow:none;
  }
  .blog-layout > .blog-sidebar--right .blog-sidebar-widget:first-child {
    border-top-color:color-mix(in srgb,var(--fl-rose,var(--blog-primary)) 45%,transparent);
  }
  .blog-layout > .blog-sidebar--right .blog-sidebar-widget h3 {
    margin:0 0 .75rem;
    color:var(--fl-champagne,var(--blog-text-muted));
    font-size:.68rem;
    line-height:1.35;
    letter-spacing:.12em;
    white-space:normal;
  }
  .blog-layout > .blog-sidebar--right .blog-sidebar-activity {
    min-width:0;
    padding:.75rem 0;
  }
  .blog-layout > .blog-sidebar--right .activity-title,
  .blog-layout > .blog-sidebar--right .activity-meta,
  .blog-layout > .blog-sidebar--right .sidebar-empty-text {
    min-width:0;
    overflow-wrap:anywhere;
    white-space:normal;
  }
  .blog-layout > .blog-sidebar--right .sidebar-empty-text {
    max-width:34ch;
    font-size:.82rem;
    line-height:1.6;
  }
  .blog-layout > .blog-sidebar--right .tag-cloud {
    display:flex;
    flex-wrap:wrap;
    gap:.55rem;
    width:100%;
  }
  .blog-layout > .blog-sidebar--right .blog-tag-pill {
    flex:0 0 auto;
    max-width:100%;
    padding:.5rem .8rem;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
}

.blog-sidebar-copy {
  margin:0 0 .9rem;
  color:var(--fl-secondary,var(--blog-text-secondary));
  font-size:.82rem;
  line-height:1.6;
}
.blog-sidebar-library-link {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:42px;
  padding:.65rem .85rem;
  border-radius:999px;
  text-align:center;
  white-space:normal;
}

@media (max-width:768px) {
  .blog-layout > .blog-sidebar--section {
    display:grid;
    grid-template-columns:minmax(0,1fr);
    gap:0;
    width:100%;
    min-width:0;
    max-width:100%;
  }
  .blog-layout > .blog-sidebar--section > .blog-sidebar-widget {
    grid-column:1;
    width:100%;
    min-width:0;
    max-width:100%;
  }
  .blog-sidebar--section .blog-sidebar-widget--library {
    padding-block:1.35rem 1.5rem;
  }
  .blog-sidebar--section .blog-sidebar-copy {
    max-width:42ch;
    margin-bottom:1rem;
    font-size:.88rem;
  }
  .blog-sidebar--section .blog-sidebar-library-link {
    width:min(100%,22rem);
    min-height:46px;
    padding:.72rem 1rem;
  }
  .blog-sidebar--section .blog-sidebar-activity {
    display:grid;
    grid-template-columns:minmax(0,1fr);
    gap:.25rem;
  }
}

/* Story facts are editorial metadata, not a dashboard card. */
.post-sidebar--story-footer .post-sidebar-widget--story,
.post-sidebar--story-footer .post-sidebar-widget--explore {
  border-right:0;
  border-bottom:0;
  border-left:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
}
.post-sidebar--story-footer .story-info-list {
  display:grid;
  gap:0;
  margin:0;
}
.post-sidebar--story-footer .story-info-item {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:.75rem;
  align-items:baseline;
  padding:.7rem .15rem;
  border-bottom:1px solid var(--fl-border,var(--blog-border));
}
.post-sidebar--story-footer .story-info-item:last-child { border-bottom:0; }
.post-sidebar--story-footer .story-info-label {
  color:var(--fl-muted,var(--blog-text-muted));
  font-size:.67rem;
  font-weight:750;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.post-sidebar--story-footer .story-info-value {
  margin:0;
  color:var(--fl-ivory,var(--blog-text));
  font-family:var(--fl-serif,var(--blog-font-display));
  font-size:1rem;
  font-weight:600;
  text-align:right;
}

@media (max-width:768px) {
  .post-layout > .post-sidebar--story-footer {
    display:grid;
    grid-template-columns:minmax(0,1fr);
    gap:0;
    width:100%;
    min-width:0;
    max-width:100%;
  }
  .post-layout > .post-sidebar--story-footer > .post-sidebar-widget {
    grid-column:1;
    box-sizing:border-box;
    width:100%;
    min-width:0;
    max-width:100%;
  }
  .post-sidebar--story-footer .story-info-list {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:0 1rem;
  }
  .post-sidebar--story-footer .story-info-item {
    grid-template-columns:minmax(0,1fr);
    align-content:start;
    gap:.3rem;
    border-top:1px solid var(--fl-border,var(--blog-border));
    border-bottom:0;
  }
  .post-sidebar--story-footer .story-info-value {
    text-align:left;
  }
}

@media (max-width:360px) {
  .post-sidebar--story-footer .story-info-list {
    grid-template-columns:minmax(0,1fr);
  }
}
