/* ============================================================
   China Information — Broadsheet × Vermillion Seal
   Design system: warm paper, Fraunces display + Schibsted
   Grotesk body, vermillion seal accents, broadsheet grid.
   ============================================================ */

:root {
  color-scheme: light;

  /* Canvas & ink */
  --paper: #faf7f2;
  --paper-raised: #fffdf9;
  --ink: #1a1612;
  --muted: #6b635a;
  --faint: #9a9188;
  --line: #e6dfd4;
  --line-strong: #d8cfbf;
  --soft: #f3ece1;
  --mist: #f7f1e8;

  /* Accents */
  --vermillion: #c8392f;
  --vermillion-strong: #9e2b22;
  --vermillion-soft: rgba(200, 57, 47, 0.1);
  --vermillion-line: rgba(200, 57, 47, 0.32);
  --gold: #a87519;
  --danger: #b42318;

  /* Effects */
  --shadow-sm: 0 4px 16px rgba(60, 40, 20, 0.06);
  --shadow: 0 18px 48px rgba(60, 40, 20, 0.09);
  --shadow-lg: 0 28px 70px rgba(60, 40, 20, 0.13);

  /* Type */
  --font-display: "Fraunces", Georgia, "Songti SC", "Times New Roman", serif;
  --font-body: "Schibsted Grotesk", "PingFang SC", "Noto Sans SC",
    "Microsoft YaHei", sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Menlo", "Consolas", monospace;

  /* Rhythm */
  --radius: 10px;
  --radius-sm: 6px;
  --content-max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-feature-settings: "kern", "liga", "ss01";
  letter-spacing: 0.005em;
  background:
    radial-gradient(
      1200px 600px at 85% -8%,
      rgba(200, 57, 47, 0.05),
      transparent 60%
    ),
    radial-gradient(
      900px 500px at -5% 8%,
      rgba(168, 117, 25, 0.05),
      transparent 55%
    ),
    linear-gradient(180deg, var(--paper) 0%, #f5efe4 100%);
  background-attachment: fixed;
  /* subtle paper grain via layered gradients */
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

:focus-visible {
  outline: 2px solid var(--vermillion);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ============================================================
   Header
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr minmax(200px, 300px);
  gap: 24px;
  align-items: center;
  padding: 16px clamp(18px, 4vw, 56px);
  background: rgba(250, 247, 242, 0.82);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(200, 57, 47, 0.18);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.brand-mark {
  display: grid;
  place-items: center;
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--vermillion);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.04em;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.16),
    0 4px 12px rgba(200, 57, 47, 0.3);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.brand-mark::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: 3px;
}

.brand:hover .brand-mark {
  transform: rotate(-4deg) scale(1.04);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 18;
}

.brand small {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Nav */
.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}

.nav-pill,
.search-form button,
.primary-button,
.ghost-button,
.danger-button,
.icon-button {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  transition: transform 160ms ease, border-color 160ms ease,
    background 160ms ease, color 160ms ease;
}

.nav-pill {
  position: relative;
  padding: 8px 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.nav-pill::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 2px;
  background: var(--vermillion);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.nav-pill:hover {
  color: var(--ink);
  background: var(--vermillion-soft);
}

.nav-pill.active {
  color: var(--vermillion-strong);
  font-weight: 700;
}

.nav-pill.active::after {
  transform: scaleX(1);
}

/* Search */
.search-form {
  display: flex;
  gap: 8px;
}

.search-form input,
.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper-raised);
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-form input:focus,
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--vermillion);
  box-shadow: 0 0 0 3px var(--vermillion-soft);
}

.search-form input {
  min-width: 0;
  padding: 10px 14px;
}

.search-form input::placeholder {
  color: var(--faint);
}

.search-form button,
.primary-button,
.ghost-button,
.danger-button,
.icon-button {
  padding: 10px 16px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.search-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  min-height: 42px;
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
  line-height: 1;
  text-align: center;
}

.search-form button:hover {
  background: var(--vermillion);
  border-color: var(--vermillion);
  transform: translateY(-1px);
}

.primary-button {
  border-color: var(--vermillion);
  background: var(--vermillion);
  color: #fff;
  box-shadow: 0 6px 16px rgba(200, 57, 47, 0.24);
}

.primary-button:hover {
  background: var(--vermillion-strong);
  border-color: var(--vermillion-strong);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(200, 57, 47, 0.3);
}

.ghost-button {
  border-color: var(--line-strong);
  background: var(--paper-raised);
  color: var(--ink);
}

.ghost-button:hover {
  border-color: var(--vermillion);
  color: var(--vermillion-strong);
  transform: translateY(-1px);
}

.danger-button {
  border-color: rgba(180, 35, 24, 0.3);
  color: var(--danger);
  background: var(--paper-raised);
}

.danger-button:hover {
  background: rgba(180, 35, 24, 0.08);
  border-color: var(--danger);
}

/* ============================================================
   Shell & layout grids
   ============================================================ */

.app-shell {
  width: min(var(--content-max), calc(100% - 40px));
  min-height: calc(100vh - 180px);
  margin: 32px auto 64px;
}

.app-shell:focus {
  outline: none;
}

.front-grid,
.article-layout,
.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 0;
  align-items: start;
}

/* Vertical column rule between content and sidebar */
.front-grid > section,
.article-layout > .article-shell {
  padding-right: 32px;
  border-right: 1px solid var(--line);
}

.front-grid > .sidebar,
.article-layout > .sidebar {
  padding-left: 32px;
}

/* ============================================================
   Hero (homepage lead)
   ============================================================ */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(260px, 0.95fr);
  gap: 28px;
  min-height: 380px;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  animation: rise 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hero::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--vermillion);
}

.hero-copy {
  align-self: end;
}

.eyebrow,
.meta-line,
.article-meta,
.status-chip,
.admin-note {
  color: var(--muted);
  font-size: 13px;
}

.eyebrow {
  color: var(--vermillion-strong);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
}

.hero h1 {
  margin: 16px 0 16px;
  font-family: var(--font-display);
  font-weight: 700;
  font-variation-settings: "opsz" 96;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.hero h1 a {
  background-image: linear-gradient(var(--vermillion), var(--vermillion));
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size 260ms ease, color 160ms ease;
}

.hero h1 a:hover {
  color: var(--vermillion-strong);
  background-size: 100% 2px;
}

.hero p {
  max-width: 56ch;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.hero img,
.article-card img,
.article-cover {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--soft);
}

.hero-media {
  position: relative;
  min-height: 320px;
  overflow: hidden;
  border-radius: var(--radius-sm);
}

.hero-media::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--vermillion);
  opacity: 0.85;
}

.hero-media img {
  transition: transform 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hero-media:hover img {
  transform: scale(1.04);
}

/* ============================================================
   Section head + article list (Latest)
   ============================================================ */

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin: 40px 0 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--ink);
  position: relative;
}

.section-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 56px;
  height: 2px;
  background: var(--vermillion);
}

.section-head h2,
.sidebar h2,
.admin-panel h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-variation-settings: "opsz" 24;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.article-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.article-card,
.sidebar,
.admin-panel,
.login-panel,
.loading-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
}

.article-card {
  overflow: hidden;
  transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 240ms ease, box-shadow 240ms ease;
  animation: rise 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.article-card:nth-child(1) { animation-delay: 60ms; }
.article-card:nth-child(2) { animation-delay: 120ms; }
.article-card:nth-child(3) { animation-delay: 180ms; }
.article-card:nth-child(4) { animation-delay: 240ms; }
.article-card:nth-child(5) { animation-delay: 300ms; }
.article-card:nth-child(6) { animation-delay: 360ms; }

.article-card:hover {
  transform: translateY(-4px);
  border-color: var(--vermillion-line);
  box-shadow: var(--shadow);
}

.article-card img {
  aspect-ratio: 16 / 9;
  height: auto;
  border-radius: 0;
  transition: transform 500ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.article-card:hover img {
  transform: scale(1.05);
}

.article-card-body {
  padding: 20px 22px 22px;
}

.article-card h3 {
  margin: 8px 0 10px;
  font-family: var(--font-display);
  font-weight: 600;
  font-variation-settings: "opsz" 28;
  font-size: 21px;
  line-height: 1.28;
  letter-spacing: -0.01em;
}

.article-card h3 a:hover {
  color: var(--vermillion-strong);
}

.article-card p,
.sidebar p {
  color: var(--muted);
  line-height: 1.65;
}

/* Tags */
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag {
  padding: 4px 10px;
  border: 1px solid var(--vermillion-line);
  border-radius: 999px;
  background: var(--vermillion-soft);
  color: var(--vermillion-strong);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 160ms ease, color 160ms ease;
}

.tag:hover {
  background: var(--vermillion);
  color: #fff;
}

/* ============================================================
   Sidebar
   ============================================================ */

.sidebar {
  position: sticky;
  top: 96px;
  padding: 0;
  background: transparent;
  border: 0;
}

.sidebar section {
  margin-bottom: 28px;
}

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

.sidebar h2 {
  position: relative;
  padding-left: 14px;
  margin-bottom: 16px;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}

.sidebar h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 16px;
  background: var(--vermillion);
  border-radius: 2px;
}

.sidebar-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar-list a {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  transition: padding-left 200ms ease, color 160ms ease;
}

.sidebar-list li:last-child a {
  border-bottom: 0;
}

.sidebar-list a:hover {
  padding-left: 6px;
}

.sidebar-list a:hover strong {
  color: var(--vermillion-strong);
}

.sidebar-list strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-variation-settings: "opsz" 18;
  font-size: 15.5px;
  line-height: 1.35;
  transition: color 160ms ease;
}

.sidebar-list p {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--faint);
}

/* ============================================================
   Article detail page
   ============================================================ */

.article-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-raised);
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
  animation: rise 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.article-cover {
  aspect-ratio: 16 / 8;
  border-radius: 0;
}

.article-body {
  padding: clamp(26px, 5vw, 60px);
}

.article-body h1 {
  max-width: 760px;
  margin: 12px 0 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-variation-settings: "opsz" 96;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
}

.article-content {
  max-width: 760px;
  margin-top: 32px;
  font-size: 18px;
  line-height: 1.92;
  color: #211c16;
}

.article-content p {
  margin: 0 0 22px;
}

.article-content h2,
.article-content h3 {
  margin: 38px 0 14px;
  font-family: var(--font-display);
  font-weight: 600;
  font-variation-settings: "opsz" 36;
  line-height: 1.28;
  letter-spacing: -0.01em;
}

.article-content h2 {
  font-size: 27px;
  position: relative;
  padding-left: 14px;
}

.article-content h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  width: 4px;
  height: 0.78em;
  background: var(--vermillion);
  border-radius: 2px;
}

.article-content h3 {
  font-size: 21px;
}

.article-content a {
  color: var(--vermillion-strong);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--vermillion-line);
  text-decoration-thickness: 1.5px;
  transition: text-decoration-color 160ms ease, color 160ms ease;
}

.article-content a:hover {
  color: var(--vermillion);
  text-decoration-color: var(--vermillion);
}

.article-content strong {
  font-weight: 700;
  color: var(--ink);
}

.article-content em {
  font-style: italic;
}

.article-content code {
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--soft);
  color: var(--vermillion-strong);
  font-family: var(--font-mono);
  font-size: 0.88em;
  word-break: break-word;
}

.article-content blockquote {
  margin: 0 0 26px;
  padding: 16px 24px;
  border-left: 4px solid var(--vermillion);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--soft);
  color: var(--ink);
  font-family: var(--font-display);
  font-style: italic;
  font-variation-settings: "opsz" 18;
}

.article-content blockquote p {
  margin: 0;
  font-size: 17px;
  line-height: 1.8;
}

.article-content blockquote p + p {
  margin-top: 12px;
}

.article-content ul,
.article-content ol {
  margin: 0 0 24px;
  padding-left: 26px;
}

.article-content li {
  margin-bottom: 8px;
  line-height: 1.8;
}

.article-content li:last-child {
  margin-bottom: 0;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin: 6px 0;
}

.article-content hr {
  margin: 38px 0;
  border: 0;
  border-top: 1px solid var(--line);
  position: relative;
}

.article-content hr::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -3px;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background: var(--vermillion);
  border-radius: 50%;
}

/* Source block */
.article-source {
  display: grid;
  gap: 8px;
  max-width: 760px;
  margin-top: 38px;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.article-source span {
  color: var(--vermillion-strong);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 12px;
}

.article-source a {
  color: var(--vermillion-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--vermillion-line);
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

.article-source a:hover {
  color: var(--vermillion);
  text-decoration-color: var(--vermillion);
}

/* ============================================================
   Pagination
   ============================================================ */

.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 32px;
}

.pagination .ghost-button {
  min-width: 44px;
  text-align: center;
}

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  align-items: center;
  padding: 30px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13.5px;
  background: rgba(250, 247, 242, 0.6);
}

.site-footer span {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.site-footer a {
  position: relative;
  transition: color 160ms ease;
}

.site-footer a:hover {
  color: var(--vermillion-strong);
}

/* ============================================================
   Admin: login
   ============================================================ */

.login-panel {
  width: min(460px, 100%);
  margin: 80px auto;
  padding: 32px 30px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  animation: rise 520ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.login-panel::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--vermillion);
}

.login-panel h1 {
  margin: 6px 0 22px;
  font-family: var(--font-display);
  font-weight: 700;
  font-variation-settings: "opsz" 36;
  font-size: 28px;
  letter-spacing: -0.01em;
}

/* ============================================================
   Admin: dashboard + editor
   ============================================================ */

.admin-layout {
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 24px;
}

.admin-layout > section {
  border-right: 0;
  padding-right: 0;
}

.admin-panel {
  padding: 22px;
  position: relative;
  animation: rise 440ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.admin-toolbar h2 {
  font-size: 19px;
}

.admin-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.admin-item {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--mist);
  text-align: left;
  transition: border-color 160ms ease, transform 160ms ease,
    background 160ms ease;
}

.admin-item:hover {
  border-color: var(--vermillion-line);
  transform: translateX(2px);
  background: var(--vermillion-soft);
}

.admin-item strong {
  line-height: 1.35;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15.5px;
}

.status-chip {
  display: inline-flex;
  width: max-content;
  padding: 3px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--paper-raised);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Editor form fields */
.field {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.field input,
.field textarea,
.field select {
  padding: 11px 13px;
}

.field textarea {
  min-height: 220px;
  resize: vertical;
  line-height: 1.65;
}

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

.content-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 2px;
}

.cover-uploader {
  display: grid;
  gap: 10px;
}

.cover-preview {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--mist);
  color: var(--faint);
  font-size: 13px;
  font-weight: 600;
  transition: border-color 160ms ease, background 160ms ease;
}

.cover-preview:hover {
  border-color: var(--vermillion-line);
  background: var(--vermillion-soft);
}

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

.cover-preview.empty {
  padding: 20px;
}

.cover-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 10px 0 20px;
}

.check-row label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0.02em;
  text-transform: none;
  cursor: pointer;
}

.check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--vermillion);
}

.toast {
  min-height: 24px;
  margin-top: 14px;
  color: var(--vermillion-strong);
  font-weight: 600;
  font-size: 13.5px;
}

.toast.error {
  color: var(--danger);
}

/* ============================================================
   Empty + loading states
   ============================================================ */

.empty-state {
  padding: 48px 32px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
  background: var(--mist);
}

.empty-state h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 64px;
  margin: 0 0 8px;
  color: var(--vermillion);
  letter-spacing: -0.03em;
}

.empty-state p {
  margin: 0;
  font-size: 15px;
}

.loading-panel {
  padding: 28px;
}

.loading-line {
  height: 16px;
  margin: 12px 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--soft), var(--paper-raised), var(--soft));
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

.loading-line.wide {
  width: 82%;
}

.loading-line.short {
  width: 42%;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ============================================================
   Responsive — tablet collapse (≤980px)
   ============================================================ */

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .brand {
    min-width: 0;
  }

  .top-nav {
    justify-content: flex-start;
  }

  .front-grid,
  .article-layout,
  .admin-layout,
  .hero {
    grid-template-columns: 1fr;
  }

  /* Remove the vertical column rule when stacked */
  .front-grid > section,
  .article-layout > .article-shell {
    padding-right: 0;
    border-right: 0;
  }

  .front-grid > .sidebar,
  .article-layout > .sidebar {
    padding-left: 0;
    padding-top: 28px;
    border-top: 1px solid var(--line);
  }

  .sidebar {
    position: static;
  }

  .hero-media {
    min-height: 240px;
  }
}

/* ============================================================
   Responsive — mobile (≤680px)
   ============================================================ */

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 28px, var(--content-max));
    margin-top: 20px;
  }

  .site-header {
    padding: 14px 16px;
  }

  /* Horizontally scrollable nav with vermillion active + edge fade */
  .top-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(
      to right,
      transparent 0,
      #000 14px,
      #000 calc(100% - 14px),
      transparent 100%
    );
    -webkit-mask-image: linear-gradient(
      to right,
      transparent 0,
      #000 14px,
      #000 calc(100% - 14px),
      transparent 100%
    );
  }

  .nav-pill {
    flex: 0 0 auto;
  }

  .article-list,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 20px;
    gap: 18px;
  }

  .hero h1,
  .article-body h1 {
    font-size: 32px;
  }

  .article-content {
    font-size: 17px;
  }

  .article-content h2 {
    font-size: 23px;
  }

  .search-form {
    grid-template-columns: 1fr auto;
  }

  .site-footer {
    padding: 22px 16px;
    gap: 12px;
  }

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