@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&display=swap");
:root {
  --paper: #faf7f2;
  --surface: #fff;
  --ink: #1b1a17;
  --muted: #6b655b;
  --line: #e7e1d6;
  --accent: #c2410c;
  --soft: #fde8dc;
  --success: #15803d;
  --danger: #b91c1c;
  --shadow: 0 12px 32px #4a321c14;
}
[data-theme="dark"] {
  --paper: #12110f;
  --surface: #1a1815;
  --ink: #f4efe6;
  --muted: #a39b8c;
  --line: #2c2924;
  --accent: #fb923c;
  --soft: #3a2416;
  --success: #4ade80;
  --danger: #f87171;
  --shadow: 0 12px 32px #0005;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font:
    15px/1.6 Inter,
    Arial,
    sans-serif;
  background-image: radial-gradient(#8f7d6820 0.6px, transparent 0.6px);
  background-size: 7px 7px;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
textarea {
  font: inherit;
}

/* Global Top Navigation Progress Bar */
.nav-loader {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  z-index: 999999;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
  pointer-events: none;
  opacity: 0;
}
.nav-loader.loading {
  opacity: 1;
  width: 78%;
  transition: width 6s cubic-bezier(0.1, 0.5, 0.1, 1);
}
.nav-loader.done {
  opacity: 1;
  width: 100%;
  transition: width 0.12s ease, opacity 0.25s 0.12s ease;
}
.wrap {
  width: min(1200px, calc(100% - 40px));
  margin-inline: auto;
}
.narrow {
  width: min(720px, calc(100% - 40px));
}
.skip {
  position: absolute;
  left: -10000px;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 9;
  background: var(--surface);
  padding: 0.5rem;
}
header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #faf7f2df;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
[data-theme="dark"] header {
  background: #12110fdf;
}
.nav {
  height: 73px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.brand {
  font:
    600 27px Fraunces,
    serif;
  letter-spacing: -1.6px;
  white-space: nowrap;
}
.brand span {
  color: var(--accent);
}
.nib {
  font: 17px Inter;
  color: var(--accent);
  margin-right: 3px;
}
.nav-links {
  display: flex;
  gap: 27px;
  color: var(--muted);
  font-size: 14px;
}
.nav-links a:hover,
.link-button:hover {
  color: var(--accent);
}
.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.icon,
.link-button,
.mobile-menu {
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
}
.icon {
  font-size: 22px;
  padding: 5px;
}
.link-button {
  color: var(--accent);
  font-weight: 600;
}
.button {
  border: 1px solid var(--accent);
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  padding: 11px 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s;
}
.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 14px #c2410c32;
}
.button:disabled {
  opacity: 0.65;
  cursor: wait;
}
.button.small {
  padding: 8px 13px;
  font-size: 13px;
}
.button.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.button.danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.button.pale {
  background: #fff;
  color: #83330d;
  border-color: #fff;
}
.avatar,
.mini-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--soft);
  color: var(--accent);
  font-weight: 700;
  width: 34px;
  height: 34px;
  overflow: hidden;
  line-height: 1;
  flex-shrink: 0;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mini-avatar {
  width: 27px;
  height: 27px;
  font-size: 10px;
}
.mini-avatar.large {
  width: 46px;
  height: 46px;
  font-size: 14px;
}
.mobile-menu {
  display: none;
}
.hero {
  min-height: 540px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 50px;
}
.eyebrow {
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.3px;
  font-size: 11px;
}
.hero h1,
.page-head h1,
.auth-form h1,
.dashboard h1 {
  font:
    600 clamp(45px, 6vw, 79px)/0.98 Fraunces,
    serif;
  letter-spacing: -3.5px;
  margin: 13px 0 22px;
}
.hero h1 i {
  color: var(--accent);
  font-weight: 500;
}
.hero-copy > p {
  font-size: 18px;
  color: var(--muted);
  max-width: 530px;
  margin-bottom: 29px;
}
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.hero-art {
  height: 345px;
  position: relative;
}
.orb {
  position: absolute;
  inset: 12px 28px 0 35px;
  border-radius: 48% 52% 37% 63%/55% 35% 65% 45%;
  background: linear-gradient(130deg, #f9d3bd, #ee9b6e);
  transform: rotate(-9deg);
  box-shadow: inset -17px -17px #b9451416;
}
.paper-note {
  position: absolute;
  background: var(--surface);
  padding: 31px 29px;
  right: 37px;
  top: 66px;
  font: 600 25px/1.12 Fraunces;
  letter-spacing: -1px;
  box-shadow: var(--shadow);
  transform: rotate(8deg);
}
.paper-note b {
  color: var(--accent);
  float: right;
  margin-top: 17px;
}
.spark {
  position: absolute;
  color: var(--accent);
  font-size: 31px;
}
.spark.one {
  top: 5px;
  right: 13px;
}
.spark.two {
  bottom: 1px;
  left: 3px;
  font-size: 17px;
}
.category-bar {
  display: flex;
  gap: 9px;
  overflow: auto;
  padding: 12px 0 45px;
}
.chip {
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 7px 14px;
  font-size: 13px;
  background: var(--surface);
}
.chip:hover,
.chip.active {
  background: var(--soft);
  border-color: var(--soft);
  color: var(--accent);
}
.section-heading,
.dashboard-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 24px;
}
.section-heading h2,
.cta h2 {
  font: 600 36px/1 Fraunces;
  margin: 6px 0;
}
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: 26px;
  margin-bottom: 90px;
}
.post-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 6px #5e493108;
  transition: 0.25s;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.cover {
  display: grid;
  place-items: center;
  height: 200px;
  background: #edc1a5;
  overflow: hidden;
  flex-shrink: 0;
}
.cover.gradient {
  background: linear-gradient(135deg, #e4a67e, #f8e3cd);
}
.cover span {
  font-size: 40px;
  color: #9e4217;
}
.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.4s;
}
.post-card:hover img {
  transform: scale(1.04);
}
.card-body {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card-body .eyebrow {
  margin-bottom: 6px;
  font-size: 11px;
}
.card-body h3 {
  font-family: Fraunces, Georgia, serif;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.5em;
}
.card-body h3:hover {
  text-decoration: underline;
  text-decoration-color: var(--accent);
}
.card-excerpt {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0 0 16px !important;
  height: 6.2em;
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 68%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 68%, rgba(0,0,0,0) 100%);
}
.card-footer-box {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.byline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 0;
}
.byline > span:last-child {
  margin-left: auto;
}
.cta {
  background: var(--accent);
  color: #fff;
  border-radius: 15px;
  padding: 42px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 90px;
}
.cta .eyebrow {
  color: #ffe0ca;
}
.cta h2 {
  font-size: 42px;
}
.cta p {
  color: #ffdfcb;
  margin-bottom: 0;
}
footer {
  border-top: 1px solid var(--line);
  padding: 48px 0 20px;
  background: var(--surface);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 30px;
}
.footer-grid p,
.footer-grid a {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0;
}
.footer-grid b {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.fineprint {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 33px;
  color: var(--muted);
  font-size: 12px;
}
.page-head {
  padding: 83px 0 43px;
  max-width: 850px;
}
.page-head h1 {
  font-size: 62px;
}
.page-head p {
  font-size: 18px;
  color: var(--muted);
  max-width: 680px;
}
.article-head {
  padding: 76px 0 37px;
}
.article-head h1 {
  font: 600 clamp(42px, 6vw, 76px)/1 Fraunces;
  margin: 12px 0 18px;
  letter-spacing: -3px;
}
.deck {
  color: var(--muted);
  font: 20px/1.55 Fraunces;
  max-width: 640px;
}
.author-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
}
.author-row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.share {
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.article-cover {
  display: block;
  width: min(1080px, calc(100% - 40px));
  max-height: 540px;
  object-fit: cover;
  border-radius: 14px;
  margin: 0 auto 48px;
}
.article-content {
  font: 19px/1.78 Fraunces;
  padding-bottom: 75px;
}
.article-content h1,
.article-content h2,
.article-content h3 {
  line-height: 1.1;
  margin-top: 2em;
}
.article-content p:first-child:first-letter {
  float: left;
  font-size: 4.6em;
  line-height: 0.75;
  margin: 0.1em 0.1em 0 0;
  color: var(--accent);
}
.article-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: opacity 0.2s ease;
}
.article-content a:hover {
  opacity: 0.8;
}

.pagination-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin: 48px auto 20px;
}

.article-content blockquote {
  margin: 30px 0;
  padding: 12px 24px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-size: 22px;
}
.article-content code {
  background: var(--soft);
  padding: 2px 5px;
  border-radius: 4px;
  font: 13px monospace;
}
.article-content hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 54px 0 25px;
}
.author-bio {
  display: flex;
  gap: 14px;
  align-items: center;
  font: 14px/1.4 Inter;
}
.author-bio p {
  color: var(--muted);
  margin: 4px 0;
}
.auth-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  min-height: calc(100vh - 73px);
}
.auth-layout aside {
  background: linear-gradient(145deg, #873711, #c85a23);
  color: #fff;
  padding: 48px 9vw;
  display: flex;
  flex-direction: column;
}
.auth-layout aside .brand span {
  color: #ffd4bd;
}
.auth-layout blockquote {
  margin: auto 0;
  font: 500 35px/1.22 Fraunces;
}
.auth-layout blockquote small {
  display: block;
  margin-top: 20px;
  font: 12px Inter;
  letter-spacing: 1px;
}
.auth-form {
  display: grid;
  place-items: center;
  padding: 45px;
}
.auth-form > div {
  width: min(430px, 100%);
}
.auth-form h1 {
  font-size: 48px;
}
.auth-form p {
  color: var(--muted);
}
form {
  margin-top: 28px;
}
label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin: 15px 0;
}
input,
textarea,
select {
  display: block;
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  padding: 12px;
  outline: none;
  font-family: inherit;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--soft);
}
select option {
  background-color: var(--surface);
  color: var(--ink);
}

/* Admin Dropdowns & Dark Mode Contrast */
.user-role-select,
.app-assign-select,
.app-assign-role {
  padding: 8px 12px !important;
  border-radius: 8px !important;
  border: 1px solid var(--line) !important;
  background-color: var(--surface) !important;
  color: var(--ink) !important;
  font-size: 0.88rem !important;
  cursor: pointer !important;
  outline: none !important;
}
.user-role-select option,
.app-assign-select option,
.app-assign-role option {
  background-color: var(--surface) !important;
  color: var(--ink) !important;
}

[data-theme="dark"] select,
[data-theme="dark"] select option,
[data-theme="dark"] .user-role-select,
[data-theme="dark"] .user-role-select option,
[data-theme="dark"] .app-assign-select,
[data-theme="dark"] .app-assign-select option,
[data-theme="dark"] .app-assign-role,
[data-theme="dark"] .app-assign-role option {
  background-color: #221f1b !important;
  color: #f4efe6 !important;
  border-color: #3f3930 !important;
}
textarea {
  min-height: 145px;
  resize: vertical;
}
.auth-form form .button {
  width: 100%;
  margin-top: 8px;
}
.form-foot {
  text-align: center;
  font-size: 13px;
}
.form-foot a {
  color: var(--accent);
  font-weight: 700;
}
.application {
  padding-bottom: 90px;
}
.application .page-head {
  padding-bottom: 30px;
}
.process {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-block: 1px solid var(--line);
  padding: 19px 0;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}
.process b {
  color: var(--ink);
  font-size: 15px;
}
.application-box {
  margin-top: 35px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  max-width: 720px;
}
.application-box h2 {
  font: 600 32px Fraunces;
  margin: 0;
}
.application-box p {
  color: var(--muted);
}
.application-box small {
  color: var(--muted);
  font-weight: 400;
}
.notice,
.reject {
  background: #fff0ed;
  color: var(--danger);
  padding: 8px;
  border-radius: 6px;
}
.status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--soft);
  color: var(--muted);
}
.status.status-admin {
  background: rgba(194, 65, 12, 0.12);
  color: #c2410c;
  border: 1px solid rgba(194, 65, 12, 0.3);
}
.status.status-featured-columnist,
.status.status-senior-editor {
  background: rgba(109, 40, 217, 0.12);
  color: #7c3aed;
  border: 1px solid rgba(109, 40, 217, 0.25);
}
.status.status-staff-editor,
.status.status-editor {
  background: rgba(13, 148, 136, 0.12);
  color: #0d9488;
  border: 1px solid rgba(13, 148, 136, 0.25);
}
.status.status-contributing-writer {
  background: rgba(217, 119, 6, 0.12);
  color: #d97706;
  border: 1px solid rgba(217, 119, 6, 0.25);
}
.status.status-reader {
  background: var(--soft);
  color: var(--muted);
  border: 1px solid var(--line);
}
.status.pending,
.status.pendingreview {
  color: #b45309;
}
.status.published {
  color: var(--success);
}
.status.rejected {
  color: var(--danger);
}
.dashboard {
  padding-block: 65px 85px;
}
.dashboard h1 {
  font-size: 53px;
}
.dashboard-head p {
  color: var(--muted);
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 13px;
  margin: 30px 0;
}
.stats > div {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.stats b {
  display: block;
  font: 600 32px Fraunces;
}
.stats span {
  color: var(--muted);
  font-size: 12px;
}
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
}
th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
th,
td {
  padding: 14px 7px;
  border-bottom: 1px solid var(--line);
}
td small {
  display: block;
  margin-top: 4px;
}
td a {
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
}
.editor-page {
  padding-block: 25px 70px;
}
.editor-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 10px;
}
.editor-top > div {
  display: flex;
  gap: 8px;
}
.editor-top > a {
  font-weight: 600;
}
.editor-top span {
  color: var(--muted);
  font-size: 12px;
}
.editor-grid {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 24px;
}
.title-input {
  border: 0;
  background: transparent;
  padding: 5px 0;
  font: 600 48px/1.05 Fraunces;
  border-radius: 0;
}
.writing-area {
  border: 0;
  min-height: 620px;
  background: transparent;
  border-radius: 0;
  font: 18px/1.75 Fraunces;
}
.meta {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 19px;
  height: max-content;
  position: sticky;
  top: 96px;
}
.meta h2 {
  font: 600 23px Fraunces;
  margin: 0;
}
.preview-mini {
  background: var(--soft);
  border-radius: 8px;
  padding: 15px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 12px;
}
.preview-mini b {
  display: block;
  color: var(--ink);
  font: 20px/1.1 Fraunces;
  margin-top: 7px;
}
.admin-tabs {
  display: flex;
  gap: 7px;
  margin: 28px 0 12px;
}
.admin-tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 9px 11px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.admin-tabs button.active {
  color: var(--accent);
  border-color: var(--accent);
}
.review {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding: 21px 0;
  border-bottom: 1px solid var(--line);
}
.review:first-child {
  padding-top: 0;
}
.review:last-child {
  border: 0;
}
.review h2 {
  font: 600 25px Fraunces;
  margin: 7px 0;
}
.review p {
  color: var(--muted);
  max-width: 670px;
}
.review-actions {
  display: flex;
  gap: 8px;
  align-items: start;
  flex-shrink: 0;
}
.profile {
  max-width: 650px;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: #1b1a177d;
  z-index: 10;
  display: grid;
  place-items: start center;
  padding-top: 12vh;
}
.search-modal {
  position: relative;
  background: var(--surface);
  width: min(610px, calc(100% - 28px));
  padding: 30px;
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.search-modal label {
  font: 600 25px Fraunces;
}
.search-modal input {
  font: 15px Inter;
}
.close {
  position: absolute;
  right: 14px;
  top: 9px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 27px;
  cursor: pointer;
}
.search-results {
  margin-top: 18px;
  color: var(--muted);
}
.search-item {
  display: block;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font: 600 19px Fraunces;
}
.search-item small {
  display: block;
  font: 12px Inter;
  color: var(--muted);
}
.empty {
  text-align: center;
  grid-column: 1/-1;
  padding: 60px 20px;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 14px;
}
.empty > span {
  font-size: 30px;
  color: var(--accent);
}
.empty h2 {
  font: 600 27px Fraunces;
}
.skeleton,
.article-skeleton {
  height: 320px;
  border-radius: 14px;
  background: linear-gradient(
    100deg,
    var(--surface),
    var(--soft),
    var(--surface)
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}
#toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  background: var(--ink);
  color: var(--paper);
  border-radius: 9px;
  padding: 12px 16px;
  opacity: 0;
  transform: translateY(15px);
  transition: 0.2s;
  pointer-events: none;
  box-shadow: var(--shadow);
}
#toast.show {
  opacity: 1;
  transform: none;
}
#toast.error {
  background: var(--danger);
}
@media (max-width: 760px) {
  .wrap {
    width: min(100% - 28px, 1200px);
  }
  .nav {
    gap: 12px;
  }
  .mobile-menu {
    display: block;
    font-size: 22px;
    margin-left: auto;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 73px;
    left: 0;
    right: 0;
    padding: 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
  }
  .nav-links.open {
    display: grid;
  }
  .nav-actions {
    margin-left: 0;
  }
  .nav-actions > .link-button,
  .nav-actions > .button {
    display: none;
  }
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-block: 70px 45px;
    gap: 28px;
  }
  .hero h1,
  .page-head h1 {
    font-size: 50px;
    letter-spacing: -2.4px;
  }
  .hero-art {
    height: 245px;
  }
  .paper-note {
    right: 20px;
    top: 35px;
    font-size: 20px;
    padding: 22px;
  }
  .category-bar {
    padding-bottom: 28px;
  }
  .post-grid {
    grid-template-columns: 1fr;
    margin-bottom: 55px;
  }
  .cover {
    height: 205px;
  }
  .cta {
    padding: 31px;
    display: block;
    margin-bottom: 55px;
  }
  .cta h2 {
    font-size: 32px;
  }
  .cta .button {
    margin-top: 20px;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .article-head {
    padding: 50px 0 25px;
  }
  .article-head h1 {
    letter-spacing: -2px;
  }
  .article-content {
    font-size: 18px;
  }
  .auth-layout {
    grid-template-columns: 1fr;
  }
  .auth-layout aside {
    display: none;
  }
  .auth-form {
    padding: 45px 25px;
  }
  .auth-form h1 {
    font-size: 40px;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .dashboard {
    padding-block: 43px;
  }
  .dashboard h1 {
    font-size: 42px;
  }
  .dashboard-head {
    align-items: start;
    flex-direction: column;
  }
  .editor-grid {
    grid-template-columns: 1fr;
  }
  .meta {
    position: static;
  }
  .title-input {
    font-size: 38px;
  }
  .writing-area {
    min-height: 410px;
  }
  .editor-top {
    align-items: start;
    flex-wrap: wrap;
  }
  .editor-top > span {
    display: none;
  }
  .review {
    display: block;
  }
  .review-actions {
    margin-top: 15px;
  }
  .page-head {
    padding-top: 56px;
  }
  .article-cover {
    width: 100%;
    border-radius: 0;
  }
  .hero-copy > p {
    font-size: 16px;
  }
}

.category-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin: 20px 0 70px;
}
.category-card {
  width: 240px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  transition: 0.2s;
  display: block;
}
.category-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.category-card b {
  display: block;
  font: 600 22px Fraunces;
  margin-bottom: 6px;
  color: var(--ink);
}
.category-card span {
  color: var(--muted);
  font-size: 13px;
}

.share-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 30px 0 25px;
}
.share-bar > span {
  font-size: 13px;
  color: var(--muted);
  margin-right: 6px;
  font-weight: 600;
}
.share-btn {
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: 0.2s;
  font-family: inherit;
}
.share-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}
.share-btn.whatsapp:hover {
  background: #25d366;
  border-color: #25d366;
  color: #fff;
}
.share-btn.x:hover {
  background: #000;
  border-color: #000;
  color: #fff;
}
.share-btn.facebook:hover {
  background: #1877f2;
  border-color: #1877f2;
  color: #fff;
}
.share-btn.linkedin:hover {
  background: #0a66c2;
  border-color: #0a66c2;
  color: #fff;
}

/* === IMAGE UPLOAD === */
.image-preview {
  margin-top: 10px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  min-height: 110px;
  display: grid;
  place-items: center;
  background: var(--paper);
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
}
.image-preview img {
  max-width: 100%;
  max-height: 240px;
  border-radius: 8px;
  display: block;
  object-fit: cover;
}
input[type="file"] {
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
}
input[type="file"]::file-selector-button {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 6px 12px;
  margin-right: 10px;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
}
input[type="file"]::file-selector-button:hover {
  background: #9a3309;
}

/* === WIDER LAYOUT === */
.wrap {
  width: min(1400px, calc(100% - 40px));
}
.narrow {
  width: min(820px, calc(100% - 40px));
}

/* === SMALLER TYPOGRAPHY === */
.hero h1,
.page-head h1 {
  font:
    600 clamp(36px, 4.5vw, 58px)/1 Fraunces,
    serif;
  letter-spacing: -2px;
}
.article-head h1 {
  font: 600 clamp(32px, 4vw, 48px)/1.08 Fraunces;
  letter-spacing: -1.5px;
  margin: 10px 0 14px;
}
.article-content {
  font: 17px/1.75 Fraunces;
}
.article-content h1 {
  font-size: 32px;
}
.article-content h2 {
  font-size: 26px;
  margin-top: 1.6em;
}
.article-content h3 {
  font-size: 20px;
}
.deck {
  font: 17px/1.5 Fraunces;
  max-width: 640px;
}
.section-heading h2,
.cta h2 {
  font: 600 30px/1 Fraunces;
}
.dashboard h1 {
  font-size: 44px;
}

/* === ARTICLE LAYOUT WITH SIDEBARS === */
.article-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 280px;
  gap: 48px;
  padding: 48px 0 80px;
  align-items: start;
}
.article-body {
  min-width: 0;
}
.sidebar {
  position: sticky;
  top: 96px;
}
.sidebar .side-block {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  margin-bottom: 16px;
}
.sidebar .side-block > b {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 12px;
}
.author-card {
  display: flex;
  gap: 12px;
  align-items: center;
}
.author-card a {
  font-size: 14px;
  font-weight: 600;
}
.author-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}
.sidebar .side-block > a {
  display: block;
  font-size: 13px;
  padding: 5px 0;
  color: var(--muted);
}
.sidebar .side-block > a:hover {
  color: var(--accent);
}
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 99px;
  background: var(--soft);
  color: var(--accent);
  font-weight: 600;
}
.toc a {
  display: block;
  font-size: 13px;
  color: var(--muted);
  padding: 5px 0;
  border-left: 2px solid transparent;
  padding-left: 10px;
}
.toc a:hover {
  color: var(--accent);
  border-left-color: var(--accent);
}
.toc-lv3 {
  padding-left: 22px !important;
  font-size: 12px !important;
}
.related-item {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.related-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.related-item b {
  display: block;
  font: 600 14px/1.3 Fraunces;
  color: var(--ink);
  margin-bottom: 4px;
}
.related-item small {
  color: var(--muted);
  font-size: 11px;
}
.related-item:hover b {
  color: var(--accent);
}
.share-mini {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.share-mini a,
.share-mini button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  transition: 0.2s;
}
.share-mini a:hover,
.share-mini button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* === BACK TO TOP === */
.back-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: 0.25s;
  z-index: 30;
}
.back-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-top:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* === RESPONSIVE === */
@media (max-width: 1100px) {
  .article-layout {
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 32px;
  }
  .sidebar-left {
    display: none;
  }
}
@media (max-width: 800px) {
  .article-layout {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 32px 0 60px;
  }
  .sidebar {
    position: static;
  }
  .sidebar-right {
    order: 2;
  }
  .article-body {
    order: 1;
  }
  .article-head h1 {
    font-size: 30px;
    letter-spacing: -1px;
  }
  .article-content {
    font-size: 16px;
  }
  .back-top {
    right: 14px;
    bottom: 14px;
  }
}

/* === ARTICLE LAYOUT — wider reading column === */
.article-layout {
  grid-template-columns: 240px minmax(0, 1fr) 300px;
  gap: 56px;
  padding: 52px 0 90px;
}

/* === HOME — fill width better === */
.post-grid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; gap: 26px; margin-bottom: 100px; }
.category-bar { padding: 14px 0 52px; }

/* === CARD IMAGES — consistent aspect === */
.cover { height: 200px; }

/* === AUTHOR PAGE — fill out === */
#author { padding: 56px 0 32px; }
#author .mini-avatar.large { margin-bottom: 14px; }
#author h1 { font: 600 clamp(34px, 4.5vw, 52px)/1 Fraunces; letter-spacing: -1.8px; margin: 10px 0 14px; }

/* === CATEGORY GRID — already flex, keep centered === */
.category-grid { padding: 32px 0 90px; }

/* === ADMIN / EDITOR tables feel roomy === */
.table-wrap { padding: 26px 28px; }
.stats > div { padding: 22px 24px; }
.stats b { font-size: 34px; }

/* === Footer — a little more air === */
footer { padding: 56px 0 26px; }
.footer-grid { gap: 40px; }

/* === Responsive tighten === */
@media (max-width: 1200px) {
  .article-layout { grid-template-columns: 220px minmax(0, 1fr) 260px; gap: 40px; }
}
@media (max-width: 960px) {
  .article-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 32px; }
  .sidebar-left { display: none; }
}
@media (max-width: 760px) {
  .wrap { width: min(100% - 32px, 1500px); }
  .post-grid { grid-template-columns: 1fr; gap: 20px; }
  .cover { height: 220px; }
  .article-layout { grid-template-columns: 1fr; gap: 24px; padding: 32px 0 60px; }
  .sidebar { position: static; }
  .sidebar-right { order: 2; }
  .article-body { order: 1; }
  .article-head h1 { font-size: 30px; letter-spacing: -1px; }
  .article-content { font-size: 16px; }
  .hero h1 { font-size: 40px; letter-spacing: -2px; }
  .page-head h1 { font-size: 40px; letter-spacing: -1.8px; }
  .section-heading h2 { font-size: 26px; }
  .back-top { right: 14px; bottom: 14px; }
}

.deck {
  font: 17px/1.55 Fraunces;
  color: var(--muted);
  max-width: 680px;
}

/* === CARD READ MORE === */
.card-read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}
.card-read-more:hover { text-decoration: underline; }
.card-read-more span { transition: transform .2s; display: inline-block; }
.card-read-more:hover span { transform: translateX(3px); }

/* === AUTHOR PAGE EXTRA === */
.author-meta {
  font-size: 14px;
  color: var(--muted);
  margin: 6px 0 12px !important;
}
.author-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.author-links a {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* === PROFILE FORM === */
.profile-page { padding-bottom: 90px; }
.profile-form { max-width: 1000px; margin: 0 auto; }
.profile-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 44px;
  align-items: start;
}
.profile-avatar-col {
  text-align: center;
  position: sticky;
  top: 96px;
}
.profile-avatar {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  overflow: hidden;
  font: 700 68px Fraunces;
  margin: 0 auto 16px;
  border: 3px solid var(--surface);
  box-shadow: var(--shadow);
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.profile-fields label small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  margin-top: 4px;
}
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  flex-wrap: wrap;
}

@media (max-width: 700px) {
  .profile-grid { grid-template-columns: 1fr; gap: 24px; }
  .profile-avatar-col { position: static; }
  .profile-avatar { width: 130px; height: 130px; font-size: 46px; }
}

.avatar img, .mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

label small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  margin-top: 5px;
}

.composer-toolbar {
  display: flex;
  gap: 4px;
  margin: 6px 0 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  flex-wrap: wrap;
}
.composer-toolbar button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: 0.15s;
}
.composer-toolbar button:hover {
  background: var(--soft);
  border-color: var(--accent);
  color: var(--accent);
}
.composer-toolbar button[data-md="bold"] { font-weight: 800; }
.composer-toolbar button[data-md="italic"] { font-style: italic; }

.article-content .article-image {
  margin: 32px 0;
  padding: 0;
  display: block;
}
.article-content .article-image img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  display: block;
}
.article-content .article-image figcaption {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-top: 10px;
  font-style: italic;
}
[data-theme="dark"] .article-content .article-image img {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.sidebar .side-block > a.mini-avatar,
.sidebar .side-block > a.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--accent);
  font-weight: 700;
}

.promo-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}
.promo-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(194, 65, 12, 0.12);
  border-color: var(--accent);
}
.promo-img {
  width: 100%;
  height: 130px;
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--line);
}
.promo-content {
  padding: 16px;
  position: relative;
}
.promo-tag {
  display: inline-block;
  background: var(--soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 4px;
  margin-bottom: 10px;
}
.promo-card h3 {
  font: 600 18px/1.2 Fraunces;
  color: var(--ink);
  margin: 0 0 6px;
}
.promo-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 14px;
}
.promo-btn {
  display: block;
  text-align: center;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 10px;
  border-radius: 6px;
  transition: 0.2s;
}
.promo-btn:hover {
  background: var(--accent);
}

@media (min-width: 801px) {
  .sidebar {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    padding-bottom: 20px;
  }
  .sidebar::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
  }
}

/* === 2. READING PROGRESS BAR === */
#reading-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: 100;
  pointer-events: none;
}
#reading-progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.1s ease-out;
}

/* === 3. FOCUS MODE (ZEN) === */
.focus-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 99px;
  cursor: pointer;
  margin-bottom: 10px;
  width: 100%;
  justify-content: center;
  transition: 0.2s;
}
.focus-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

body.focus-mode header,
body.focus-mode footer,
body.focus-mode .sidebar,
body.focus-mode #reading-progress-container {
  display: none !important;
}
body.focus-mode .article-layout {
  display: block;
  max-width: 70ch;
  margin: 40px auto;
  padding: 0;
}
body.focus-mode .article-content {
  font-size: 1.1rem;
  line-height: 1.8;
}
body.focus-mode .article-cover {
  width: 100%;
  border-radius: 0;
  margin-bottom: 30px;
}

/* Focus Mode Themes */
body.focus-sepia {
  background: #f4ecd8 !important;
  color: #433422 !important;
}
body.focus-sepia .article-content,
body.focus-sepia .article-head h1,
body.focus-sepia .deck {
  color: #433422 !important;
}

body.focus-dark {
  background: #12110f !important;
  color: #f4efe6 !important;
}
body.focus-dark .article-content,
body.focus-dark .article-head h1,
body.focus-dark .deck {
  color: #f4efe6 !important;
}

.focus-exit-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  padding: 10px 20px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: bold;
  box-shadow: var(--shadow);
  display: none;
}
body.focus-mode .focus-exit-btn {
  display: block;
}

.focus-themes {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  gap: 10px;
  background: var(--surface);
  padding: 10px 20px;
  border-radius: 99px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  z-index: 100;
}
body.focus-mode .focus-themes {
  display: flex;
}
.focus-themes button {
  border: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
}
.focus-themes button[data-theme="light"] { background: #faf7f2; border-color: #e7e1d6; }
.focus-themes button[data-theme="sepia"] { background: #f4ecd8; border-color: #d4c5a9; }
.focus-themes button[data-theme="dark"] { background: #12110f; border-color: #2c2924; }

mark.inkwell-highlight {
  background: rgba(250, 204, 21, 0.4);
  color: inherit;
  padding: 2px 0;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s;
}
mark.inkwell-highlight:hover {
  background: rgba(250, 204, 21, 0.7);
}
[data-theme="dark"] mark.inkwell-highlight {
  background: rgba(250, 204, 21, 0.25);
}
[data-theme="dark"] mark.inkwell-highlight:hover {
  background: rgba(250, 204, 21, 0.5);
}

#highlight-toolbar {
  position: absolute;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 6px;
  border-radius: 8px;
  display: flex;
  gap: 4px;
  box-shadow: var(--shadow);
  transform: translate(-50%, -100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s;
}
#highlight-toolbar.active {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -110%);
}
#highlight-toolbar button {
  background: transparent;
  border: 0;
  color: var(--paper);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
}
#highlight-toolbar button:hover {
  background: rgba(255,255,255,0.15);
}

/* === 5. BOOKMARK (TBR) BUTTON === */
.bookmark-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  background: rgba(0,0,0,0.5);
  border: 0;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: 0.2s;
  backdrop-filter: blur(4px);
}
.bookmark-btn:hover {
  background: var(--accent);
  transform: scale(1.1);
}
.bookmark-btn.saved {
  color: var(--accent);
  background: #fff;
}
.bookmark-btn.saved:hover {
  color: #fff;
  background: var(--accent);
}

/* === 6. TEXT-TO-SPEECH ACTIVE === */
.tts-active {
  background: var(--soft);
  border-radius: 4px;
  box-shadow: 0 0 0 4px var(--soft);
  transition: background 0.2s;
}

/* === 7. ANIMATIONS === */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in-up {
  animation: fadeInUp 0.4s ease forwards;
}

.ink-burst {
  position: absolute;
  pointer-events: none;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: burst 0.6s ease-out forwards;
}
@keyframes burst {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}

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

/* 1. Reduce top padding of the layout */
.article-layout {
  padding: 20px 0 80px !important; 
}

/* 2. Reduce spacing around the title */
.article-head {
  padding: 10px 0 20px !important;
}

/* 3. Reduce spacing below the hero image */
.article-cover {
  margin: 0 auto 24px !important;
}

/* 4. Fix TOC clicking (prevents the sticky header from covering the heading) */
.article-content h1,
.article-content h2,
.article-content h3 {
  scroll-margin-top: 100px;
}

/* === CONTACT FORM === */
.form input, .form textarea {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  margin-top: 6px;
  font: 15px Inter;
}
.form input:focus, .form textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px var(--soft);
}

.summary-modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 520px; /* Forces a nice horizontal rectangle */
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
  margin: auto;
}

.summary-modal h2 {
  font: 600 22px Fraunces;
  margin: 0 0 6px 0;
  color: var(--ink);
}

.summary-modal .muted {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 20px 0;
}

.summary-preview-box {
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.summary-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  width: 100%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
  text-align: left;
}

.summary-icon { font-size: 22px; margin-bottom: 8px; }
.summary-title { font: 700 18px/1.3 Fraunces; color: var(--ink); margin: 0 0 12px 0; }
.summary-text { font: 400 14px/1.5 Inter; color: var(--ink); margin: 0 0 16px 0; }

.summary-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-size: 12px;
}
.summary-author { color: var(--muted); font-weight: 600; }
.summary-brand { color: var(--accent); font-weight: 700; font-family: Fraunces; }

.summary-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.summary-actions .button {
  padding: 10px 16px;
  font-size: 13px;
  border-radius: 8px;
  height: auto;
  min-height: 40px;
}

@media (max-width: 500px) {
  .summary-actions {
    flex-direction: column;
  }
  .summary-actions .button {
    width: 100%;
  }
}

.summary-url {
  color: var(--muted);
  font-size: 11px;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.summary-url:hover {
  opacity: 1;
  text-decoration: underline;
}

#editor-preview .article-content {
  font-size: 17px !important;
  line-height: 1.75 !important;
}

#editor-preview .article-content h1 {
  font-size: 32px !important;
  margin-top: 0;
}

#editor-preview .article-content h2 {
  font-size: 26px !important;
}

#editor-preview .article-content h3 {
  font-size: 20px !important;
}

/* Ensure the editor column doesn't stretch too far */
.editor-grid > section {
  min-width: 0; /* Prevents grid blowout */
}

/* === MOBILE POST PAGE LAYOUT === */
@media (min-width: 801px) {
  .mobile-only { 
    display: none !important; 
  }
}

/* Mobile Specific Fixes */
@media (max-width: 800px) {
  /* Hide desktop sidebars on mobile */
  .sidebar-left, 
  .desktop-only { 
    display: none !important; 
  }

  /* 1. TOOLS ROW (Above Title) */
  .mobile-tools-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 6px;
    padding: 10px !important;
    margin-bottom: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .mobile-tools-row::-webkit-scrollbar { display: none; }
  
  /* Make inner block invisible */
  .mobile-tools-row .tools-block {
    display: flex !important;
    flex: 1;
    gap: 6px;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
  }
  .mobile-tools-row .tools-block b { display: none !important; }
  
  /* Button Styling */
  .mobile-tools-row .focus-btn {
    flex: 1;
    min-width: 0;
    padding: 10px 4px !important;
    font-size: 11px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    background: var(--paper);
    color: var(--ink);
    border: 1px solid var(--line) !important;
    border-radius: 8px !important;
  }

  /* Hide TTS button on mobile */
  .mobile-tools-row .tts-toggle {
    display: none !important;
  }

  /* 2. SHARE ROW (Below Author) */
  .mobile-share-row {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    margin-top: 30px;
    padding: 16px !important;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
  }
  
  /* Make inner block invisible */
  .mobile-share-row .share-block {
    display: flex !important;
    flex: 1;
    align-items: center;
    justify-content: space-between;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
  }
  
  .mobile-share-row .share-block b {
    margin-bottom: 0 !important;
    font-size: 14px;
    color: var(--muted);
  }
  .mobile-share-row .share-mini {
    margin-bottom: 0 !important;
  }

  /* 3. Spacing Fixes */
  .article-content { padding-bottom: 20px !important; }
  .sidebar-right { margin-top: 10px !important; padding-top: 0 !important; }
  .sidebar-right .side-block:first-child { margin-top: 0 !important; }
}

/* 4. Dark Mode Fix for Desktop Tools */
.focus-btn {
  background: var(--paper) !important;
  color: var(--ink) !important;
  border: 1px solid var(--line) !important;
  transition: all 0.2s ease;
}
.focus-btn:hover {
  background: var(--soft) !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  transform: translateY(-1px);
}
[data-theme="dark"] .focus-btn {
  background: #1a1815 !important;
  color: var(--ink) !important;
}
[data-theme="dark"] .focus-btn:hover {
  background: var(--soft) !important;
  color: var(--accent) !important;
}

/* ==========================================================================
   HOMEPAGE CURATED SPOTLIGHT (Admin Curated)
   ========================================================================== */
.spotlight-section {
  margin: 40px auto 20px;
}
.spotlight-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
}
.spotlight-header h2 {
  font-family: Fraunces, Georgia, serif;
  font-size: 2rem;
  margin: 4px 0 0;
  font-weight: 600;
}
.spotlight-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: 26px;
}
@media (max-width: 960px) {
  .spotlight-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}
.spotlight-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  text-decoration: none;
}
.spotlight-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(0,0,0,0.08);
  border-color: var(--accent);
}
.spotlight-cover {
  position: relative;
  width: 100%;
  height: 210px;
  overflow: hidden;
  background: var(--soft);
  flex-shrink: 0;
}
.spotlight-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.spotlight-card:hover .spotlight-cover img {
  transform: scale(1.03);
}
.spotlight-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(27, 26, 23, 0.85);
  color: #fff;
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.spotlight-badge.badge-series {
  background: var(--accent);
  color: #fff;
}
.spotlight-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.spotlight-meta {
  font-size: 0.82rem;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.spotlight-title {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 0 0 10px;
  font-weight: 600;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.6em;
}
.spotlight-excerpt {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 18px;
  height: 6.2em;
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 68%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 68%, rgba(0,0,0,0) 100%);
}
.spotlight-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
}
.spotlight-cta {
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

[data-theme="dark"] .spotlight-card {
  background: var(--surface);
  border-color: var(--line);
}
[data-theme="dark"] .spotlight-card:hover {
  border-color: var(--accent);
  box-shadow: 0 16px 36px rgba(0,0,0,0.5);
}
[data-theme="dark"] .spotlight-badge {
  background: rgba(35, 32, 28, 0.9);
  color: #f4efe6;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   SERIES DIRECTORY & DETAIL PAGES
   ========================================================================== */
.series-directory-hero {
  text-align: center;
  padding: 48px 20px 32px;
  max-width: 760px;
  margin: 0 auto;
}
.series-directory-hero h1 {
  font-family: Fraunces, Georgia, serif;
  font-size: 2.5rem;
  margin: 8px 0 16px;
  font-weight: 600;
}
.series-directory-hero p {
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1.6;
}
.series-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: 26px;
  margin-bottom: 60px;
}
@media (max-width: 960px) {
  .series-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}
.series-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  text-decoration: none;
}
.series-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.08);
  border-color: var(--accent);
}
.series-card-cover {
  position: relative;
  width: 100%;
  height: 210px;
  background: var(--soft);
  overflow: hidden;
  flex-shrink: 0;
}
.series-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.series-card:hover .series-card-cover img {
  transform: scale(1.03);
}
.series-chapter-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(27, 26, 23, 0.85);
  color: #fff;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  backdrop-filter: blur(6px);
}
.series-card-body {
  padding: 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.series-card-title {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.3rem;
  margin: 0 0 10px;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.6em;
}
.series-card-desc {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0 0 18px;
  height: 6.2em;
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 68%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 68%, rgba(0,0,0,0) 100%);
}
.series-card-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--accent);
}

[data-theme="dark"] .series-card {
  background: var(--surface);
  border-color: var(--line);
}
[data-theme="dark"] .series-card:hover {
  border-color: var(--accent);
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

/* SERIES DETAIL HERO */
.series-detail-hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: center;
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 40px;
}
@media (max-width: 860px) {
  .series-detail-hero {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}
.series-hero-cover {
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  box-shadow: 0 16px 36px rgba(0,0,0,0.12);
  background: var(--soft);
}
.series-hero-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.series-hero-content h1 {
  font-family: Fraunces, Georgia, serif;
  font-size: 2.3rem;
  margin: 10px 0 16px;
  line-height: 1.25;
}
.series-hero-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  margin: 20px 0 24px;
  font-size: 0.9rem;
  color: var(--muted);
}
.series-hero-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
}
.series-hero-stat {
  display: flex;
  flex-direction: column;
}
.series-hero-stat b {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.5rem;
  color: var(--ink);
}
.series-hero-stat span {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* CHAPTER LIST */
.chapter-timeline {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 980px;
  margin: 0 auto 60px;
}
.chapter-item {
  display: grid;
  grid-template-columns: 70px 1fr 220px;
  gap: 26px;
  align-items: center;
  padding: 24px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
}
.chapter-item:hover {
  transform: translateX(4px);
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(0,0,0,0.08);
}
@media (max-width: 820px) {
  .chapter-item {
    grid-template-columns: 56px 1fr;
    gap: 16px;
    padding: 18px 20px;
  }
  .chapter-item-thumbnail {
    display: none;
  }
}
.chapter-number-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background: var(--soft);
  color: var(--accent);
  border-radius: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.chapter-number-badge small {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.chapter-number-badge span {
  font-size: 1.35rem;
  font-family: Fraunces, Georgia, serif;
  line-height: 1;
}
.chapter-info {
  min-width: 0;
}
.chapter-info h3 {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.32rem;
  line-height: 1.3;
  margin: 0 0 8px;
  color: var(--ink);
}
.chapter-info p {
  color: var(--muted);
  font-size: 0.94rem;
  margin: 0 0 12px;
  line-height: 1.6;
  max-height: 6.4em;
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
}
.chapter-meta {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  gap: 12px;
  align-items: center;
}
.chapter-item-thumbnail {
  width: 220px;
  height: 135px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--soft);
  flex-shrink: 0;
}
.chapter-item-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.chapter-item:hover .chapter-item-thumbnail img {
  transform: scale(1.04);
}

[data-theme="dark"] .chapter-item {
  background: var(--surface);
  border-color: var(--line);
}
[data-theme="dark"] .chapter-item:hover {
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(0,0,0,0.5);
}
[data-theme="dark"] .chapter-number-badge {
  background: #2b1b11;
  color: var(--accent);
  border: 1px solid rgba(251, 146, 60, 0.25);
}

/* ==========================================================================
   READER VIEW SERIES NAVIGATION
   ========================================================================== */
.series-badge-row {
  margin-bottom: 16px;
}
.series-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--soft);
  color: var(--accent);
  padding: 6px 14px;
  border-radius: 24px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid rgba(194, 65, 12, 0.25);
  transition: background 0.2s ease, transform 0.2s ease;
  text-decoration: none;
}
.series-pill:hover {
  background: #fbd6c3;
  transform: translateY(-1px);
}
[data-theme="dark"] .series-pill {
  background: #2b1b11;
  border: 1px solid rgba(251, 146, 60, 0.35);
  color: var(--accent);
}
[data-theme="dark"] .series-pill:hover {
  background: #3d2415;
}
.series-tag {
  background: var(--accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}
.series-part-label {
  color: var(--ink);
  font-weight: 600;
}
[data-theme="dark"] .series-part-label {
  color: #f4efe6;
}
.series-dot {
  color: var(--muted);
}
.series-title-text {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* SIDEBAR ROADMAP CARD */
.series-roadmap-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px !important;
  margin-bottom: 24px;
}
.series-roadmap-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 12px;
}
.series-roadmap-title {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  display: block;
  margin-top: 4px;
}
.series-roadmap-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.series-roadmap-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--ink);
  text-decoration: none;
  transition: background 0.2s ease;
  position: relative;
  min-width: 0;
  box-sizing: border-box;
}
.series-roadmap-item:hover {
  background: var(--paper);
}
.series-roadmap-item.active {
  background: var(--soft);
  color: var(--accent);
  font-weight: 600;
}
.series-roadmap-item .part-number {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  background: var(--line);
  color: var(--muted);
  flex-shrink: 0;
}
.series-roadmap-item.active .part-number {
  background: var(--accent);
  color: #fff;
}
.series-roadmap-item .part-title {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.series-roadmap-item .current-badge {
  font-size: 0.65rem;
  text-transform: uppercase;
  background: var(--accent);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  flex-shrink: 0;
}

/* FOOTER PART NAVIGATION */
.series-nav-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 36px 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
@media (max-width: 640px) {
  .series-nav-footer {
    grid-template-columns: 1fr;
  }
}
.series-nav-btn {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.2s ease;
  min-width: 0;
  box-sizing: border-box;
}
.series-nav-btn:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
}
.series-nav-btn.next {
  text-align: right;
  border-left: 3px solid var(--accent);
}
.series-nav-btn.next:first-child {
  grid-column: 2;
}
.series-nav-btn.prev {
  text-align: left;
  border-right: 3px solid var(--muted);
}
.series-nav-btn .nav-dir {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 4px;
}
.series-nav-btn.next .nav-dir {
  color: var(--accent);
}
.series-nav-btn .nav-title {
  font-family: Fraunces, Georgia, serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}
[data-theme="dark"] .series-nav-btn {
  background: #1e1b17;
  border-color: #332d25;
}
[data-theme="dark"] .series-nav-btn:hover {
  background: #28241e;
  border-color: var(--accent);
}
[data-theme="dark"] .series-nav-btn .nav-title {
  color: #f4efe6;
}

/* FLOATING UP-NEXT PILL */
.series-up-next-pill {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1b1a17;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.35);
  z-index: 1000;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
  max-width: 390px;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.series-up-next-pill.visible {
  opacity: 1;
  transform: translateY(0);
}
.series-up-next-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(0,0,0,0.45);
}
.series-up-next-pill .up-next-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--accent);
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.series-up-next-pill .up-next-title {
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #ffffff;
  flex: 1;
  min-width: 0;
}
.series-up-next-pill .up-next-arrow {
  font-size: 1.1rem;
  color: var(--accent);
  flex-shrink: 0;
}

/* Explicit Dark Mode for series pill popup */
[data-theme="dark"] .series-up-next-pill {
  background: #25221e;
  color: #f4efe6;
  border: 1px solid #484136;
  box-shadow: 0 16px 36px rgba(0,0,0,0.65);
}
[data-theme="dark"] .series-up-next-pill .up-next-title {
  color: #f4efe6;
}
[data-theme="dark"] .series-up-next-pill:hover {
  background: #2e2924;
  border-color: var(--accent);
}

/* ==========================================================================
   MOBILE RESPONSIVE: SERIES POST PAGE SLEEK & PROPORTIONAL FIX
   ========================================================================== */
@media (max-width: 800px) {
  /* Prevent horizontal canvas blowout from any nested container */
  html, body {
    overflow-x: clip !important;
    max-width: 100vw !important;
  }
  .wrap, 
  .article-layout, 
  .article-body, 
  .article-content,
  .sidebar-right {
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow-x: clip !important;
  }

  /* 1. Constrain series pill at top of article - clean single line badge */
  .series-badge-row {
    max-width: 100% !important;
    margin-bottom: 10px !important;
    overflow: hidden !important;
  }
  .series-pill {
    max-width: 100% !important;
    padding: 4px 10px !important;
    font-size: 0.72rem !important;
    gap: 6px !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
  }
  .series-tag {
    font-size: 0.6rem !important;
    padding: 2px 5px !important;
    flex-shrink: 0 !important;
  }
  .series-part-label {
    font-size: 0.72rem !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }
  .series-dot {
    flex-shrink: 0 !important;
  }
  .series-title-text {
    flex: 1 !important;
    min-width: 0 !important;
    max-width: 160px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    display: inline-block !important;
    vertical-align: middle !important;
  }

  /* 2. Floating Up-Next Pill (Strictly contained within mobile viewport) */
  .series-up-next-pill {
    bottom: 12px !important;
    right: 12px !important;
    left: 12px !important;
    width: auto !important;
    max-width: calc(100vw - 24px) !important;
    padding: 8px 12px !important;
    gap: 8px !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
    border-radius: 20px !important;
  }
  .series-up-next-pill .up-next-label {
    font-size: 0.62rem !important;
    padding: 3px 6px !important;
    flex-shrink: 0 !important;
  }
  .series-up-next-pill .up-next-title {
    font-size: 0.78rem !important;
    flex: 1 !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .series-up-next-pill .up-next-arrow {
    font-size: 0.95rem !important;
    flex-shrink: 0 !important;
  }

  /* 3. Series Nav Footer (Clean, sleek, compact stack) */
  .series-nav-footer {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    margin: 20px 0 16px !important;
    padding-top: 16px !important;
    border-top: 1px solid var(--line) !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .series-nav-btn {
    padding: 10px 14px !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    border-radius: 10px !important;
    border-left: 1px solid var(--line) !important;
    border-right: 1px solid var(--line) !important;
  }
  .series-nav-btn.prev {
    border-left: 3px solid var(--muted) !important;
    text-align: left !important;
  }
  .series-nav-btn.next {
    border-left: 3px solid var(--accent) !important;
    text-align: left !important;
    grid-column: auto !important;
  }
  .series-nav-btn .nav-dir {
    font-size: 0.68rem !important;
    letter-spacing: 0.04em !important;
    margin-bottom: 2px !important;
  }
  .series-nav-btn .nav-title {
    font-size: 0.86rem !important;
    line-height: 1.3 !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    min-width: 0 !important;
  }

  /* 4. Series Roadmap Card in Sidebar (Sleek & proportional) */
  .series-roadmap-card {
    padding: 12px 14px !important;
    margin: 0 0 16px !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    border-radius: 10px !important;
    overflow: hidden !important;
  }
  .series-roadmap-header {
    padding-bottom: 8px !important;
    margin-bottom: 8px !important;
  }
  .series-roadmap-title {
    font-size: 0.95rem !important;
    line-height: 1.25 !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
  }
  .series-roadmap-list {
    gap: 6px !important;
    min-width: 0 !important;
  }
  .series-roadmap-item {
    padding: 6px 10px !important;
    border-radius: 6px !important;
    font-size: 0.8rem !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  .series-roadmap-item .part-number {
    width: 20px !important;
    height: 20px !important;
    font-size: 0.68rem !important;
    flex-shrink: 0 !important;
  }
  .series-roadmap-item .part-title {
    flex: 1 !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 0.8rem !important;
  }
  .series-roadmap-item .current-badge {
    font-size: 0.6rem !important;
    padding: 2px 5px !important;
    flex-shrink: 0 !important;
  }
}

/* ==========================================================================
   ADMIN CONTROL ROOM: SPOTLIGHT DRAG & DROP & SERIES MANAGER
   ========================================================================== */
.admin-spotlight-wrapper {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: flex-start;
}
@media (max-width: 900px) {
  .admin-spotlight-wrapper {
    grid-template-columns: 1fr;
  }
}
.drag-queue-container {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
}
.drag-queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.drag-queue-header h3 {
  margin: 0;
  font-size: 1.15rem;
}
.drag-queue-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 140px;
}
.admin-drag-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 12px 16px;
  border-radius: 10px;
  cursor: grab;
  user-select: none;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.admin-drag-item:active {
  cursor: grabbing;
}
.admin-drag-item.dragging {
  opacity: 0.4;
  border-color: var(--accent);
  background: var(--soft);
}
.admin-drag-item.drag-over {
  border-top: 3px solid var(--accent);
  transform: translateY(2px);
}
.drag-handle {
  color: var(--muted);
  font-size: 1.2rem;
  cursor: grab;
}
.drag-item-thumb {
  width: 48px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--soft);
}
.drag-item-info {
  flex: 1;
  min-width: 0;
}
.drag-item-type {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--line);
  color: var(--muted);
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 6px;
}
.drag-item-type.type-series {
  background: var(--accent);
  color: #fff;
}
.drag-item-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.drag-item-author {
  font-size: 0.75rem;
  color: var(--muted);
}
.drag-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.drag-btn-move {
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 7px;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--muted);
}
.drag-btn-move:hover {
  background: var(--surface);
  color: var(--ink);
}
.drag-btn-delete {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}
.drag-btn-delete:hover {
  opacity: 0.7;
}

/* ADD TO SPOTLIGHT PICKER */
.spotlight-picker-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
}
.spotlight-picker-box h3 {
  margin: 0 0 16px;
  font-size: 1.15rem;
}
.spotlight-picker-box select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  margin-bottom: 14px;
}

/* SERIES MANAGER TABLE/CARDS */
.series-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.series-admin-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}
.series-admin-card h4 {
  margin: 0 0 6px;
  font-size: 1rem;
}
.series-admin-card p {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0 0 12px;
  flex: 1;
}
.series-admin-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
}