:root {
  --bg: #f4f1ea;
  --bg-alt: #ece6da;
  --paper: #fffdfa;
  --paper-alt: #f8f3ea;
  --ink: #191714;
  --ink-soft: #5b5448;
  --muted: #766f63;
  --line: #d8cfbf;
  --line-strong: #bfb29b;
  --accent: #4d5d74;
  --accent-soft: #e9eef4;
  --danger: #9f3535;
  --shadow-soft: 0 12px 30px rgba(25, 23, 20, 0.06);
  --radius: 14px;
  --space-1: 0.4rem;
  --space-2: 0.7rem;
  --space-3: 1rem;
  --space-4: 1.4rem;
  --space-5: 2rem;
  --space-6: 2.8rem;
  --content-width: 1160px;
  --reading-width: 900px;
}

* {
  box-sizing: border-box;
}

img {
  max-width: 100%;
  height: auto;
}

html,
body {
  min-height: 100%;
}

html {
  scroll-behavior: smooth;
  background: linear-gradient(180deg, #f8f5ef 0%, var(--bg) 100%);
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.7), transparent 28%),
    linear-gradient(180deg, #f8f5ef 0%, var(--bg) 100%);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

main {
  flex: 1;
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-5) 1.4rem 4rem;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  margin: 0 0 0.65rem;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

p {
  margin: 0 0 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  backdrop-filter: blur(14px);
  background: rgba(248, 245, 239, 0.9);
  border-bottom: 1px solid rgba(191, 178, 155, 0.7);
}

.header-inner,
.footer-inner {
  width: min(100%, var(--content-width));
  margin: 0 auto;
  padding: var(--space-3) 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-3);
}

.brand {
  text-decoration: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}

.brand-logo {
  width: 62px;
  height: 62px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-text {
  display: inline-block;
  min-width: 0;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.site-nav a,
footer a,
.text-link {
  color: var(--ink-soft);
  text-decoration: none;
}

.site-nav a,
footer a {
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius);
}

.site-nav a:hover,
footer a:hover,
.text-link:hover {
  color: var(--ink);
}

.site-nav a:hover,
footer a:hover {
  background: rgba(233, 238, 244, 0.75);
}

.nav-toggle {
  display: none !important;
  min-width: 0;
  width: 50px;
  min-height: 50px;
  padding: 0;
  border-radius: 12px;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 3px auto;
  background: #fff;
  border-radius: 999px;
}

.text-link {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.eyebrow {
  margin: 0 0 var(--space-2);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  font-weight: 700;
}

.home-hero,
.about-strip,
.editors-choice,
.archive-head,
.filters,
.story-card,
.article-wrap,
.editor-shell,
.admin-shell,
.admin-card,
.admin-table-wrap,
.request-token-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.home-hero {
  margin-bottom: var(--space-4);
  padding: var(--space-6);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 243, 234, 0.98)),
    var(--paper);
}

.home-hero h1 {
  max-width: 14ch;
  font-size: clamp(2.5rem, 5vw, 4.4rem);
}

.hero-meta,
.lede,
.card-meta,
.article-meta {
  color: var(--ink-soft);
}

.hero-meta,
.card-meta,
.article-meta {
  font-size: 0.96rem;
}

.lede {
  max-width: 62ch;
  font-size: 1.06rem;
}

.about-strip,
.editors-choice,
.archive-head,
.editor-shell,
.admin-shell {
  margin-bottom: var(--space-4);
  padding: 1.6rem 1.7rem;
}

.about-strip h2,
.editors-choice h2,
.archive-head h1,
.article-wrap h1 {
  font-size: clamp(1.85rem, 3vw, 2.65rem);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.story-card {
  height: 100%;
  padding: 1.25rem;
}

.story-card h2,
.story-card h3 {
  font-size: 1.45rem;
}

.filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  padding: 1rem;
}

.archive-item {
  padding: 1.15rem 0.2rem;
  border-top: 1px solid var(--line);
}

.archive-item h2 {
  font-size: 1.5rem;
}

input,
select,
textarea,
button,
.btn-link {
  min-height: 46px;
  border-radius: 10px;
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  padding: 0.78rem 0.9rem;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(77, 93, 116, 0.13);
}

textarea {
  min-height: 220px;
  resize: vertical;
}

button,
.btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 126px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

button:hover,
.btn-link:hover {
  background: #2a2722;
  border-color: #2a2722;
}

.article-wrap {
  max-width: var(--reading-width);
  margin: 0 auto;
  padding: 2rem;
}

.article-body {
  color: #26221d;
  font-size: 1.06rem;
  line-height: 1.82;
  overflow-wrap: anywhere;
}

.pdf-viewer {
  margin: 1.2rem 0 1.5rem;
}

.paper-pdf {
  width: 100%;
  height: 70vh;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

footer {
  width: 100%;
  margin-top: auto;
  border-top: 1px solid rgba(191, 178, 155, 0.7);
  background: rgba(255, 253, 250, 0.75);
}

.site-body main,
.admin-body main {
  width: 100%;
}

.admin-body {
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.6), transparent 26%),
    linear-gradient(180deg, #f7f4ee 0%, var(--bg) 100%);
}

.admin-login-wrap {
  min-height: calc(100vh - 4rem);
  display: grid;
  place-items: center;
  padding: var(--space-4);
}

.admin-login-wrap .admin-card {
  width: min(100%, 460px);
  padding: 1.7rem;
}

.login-brand {
  margin-bottom: 1rem;
}

.admin-login-wrap h1,
.admin-shell h1,
.editor-shell h1 {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: clamp(1.8rem, 3vw, 2.3rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.2;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: 1rem;
}

.admin-actions,
.request-actions,
.editor-choice-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 260px));
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-card {
  padding: 1.2rem;
}

.admin-card h2 {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.admin-card p {
  margin: 0.3rem 0 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
}

.admin-table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.9rem 1rem;
  text-align: left;
  border-bottom: 1px solid #ece4d7;
  vertical-align: top;
}

th {
  color: var(--ink-soft);
  font-size: 0.83rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem 1rem;
}

.editor-grid label {
  display: grid;
  gap: 0.38rem;
  color: var(--ink-soft);
  font-size: 0.93rem;
  font-weight: 700;
}

.editor-content {
  grid-column: 1 / -1;
}

.editor-submit {
  grid-column: 1 / -1;
}

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

.compact button {
  align-self: end;
}

.request-token-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.request-token-box {
  min-height: 2.8rem;
  padding: 0.95rem 1rem;
}

.linkish {
  width: auto;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--danger);
  text-decoration: underline;
  text-underline-offset: 3px;
  box-shadow: none;
}

.linkish:hover {
  background: transparent;
  border-color: transparent;
  color: #7d2525;
}

.danger-btn {
  background: #fff;
  color: var(--danger);
  border-color: var(--danger);
}

.danger-btn:hover {
  background: #fff3f3;
  border-color: var(--danger);
  color: var(--danger);
}

.hidden {
  display: none;
}

@media (max-width: 980px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
  }

  .header-top {
    justify-content: space-between;
  }

  .site-nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-nav a {
    text-align: center;
  }

  .news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .home-hero {
    padding: var(--space-5);
  }

  .home-hero h1 {
    max-width: 100%;
    font-size: clamp(2.2rem, 7vw, 3.3rem);
  }
}

@media (max-width: 680px) {
  main,
  .header-inner,
  .footer-inner {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  main {
    padding-top: 1.2rem;
    padding-bottom: 2.4rem;
  }

  .brand-logo {
    width: 50px;
    height: 50px;
  }

  .brand-mark {
    gap: 0.55rem;
  }

  .brand-text {
    font-size: 1.28rem;
    line-height: 1.05;
  }

  .header-inner {
    gap: 0.75rem;
  }

  .nav-toggle {
    display: inline-flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .site-nav {
    display: none;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding-top: 0.25rem;
  }

  .site-nav.nav-open {
    display: grid;
  }

  .site-nav a,
  footer a {
    padding: 0.7rem 0.6rem;
  }

  .news-grid,
  .filters,
  .editor-grid,
  .compact,
  .request-token-form,
  .admin-stats {
    grid-template-columns: 1fr;
  }

  .home-hero,
  .about-strip,
  .editors-choice,
  .archive-head,
  .article-wrap,
  .editor-shell,
  .admin-shell {
    padding: 1.25rem;
  }

  .home-hero h1 {
    font-size: clamp(2rem, 10vw, 2.8rem);
  }

  .story-card h2,
  .story-card h3,
  .archive-item h2 {
    font-size: 1.28rem;
  }

  .article-wrap,
  .editor-shell,
  .admin-shell,
  .admin-card,
  .filters,
  .request-token-box {
    border-radius: 12px;
  }

  .admin-topbar,
  .admin-actions,
  .request-actions,
  .editor-choice-actions {
    flex-direction: column;
    align-items: stretch;
  }

  button,
  .btn-link {
    width: 100%;
  }

  .paper-pdf {
    min-height: 320px;
    height: 52vh;
  }

  table {
    min-width: 640px;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 15px;
  }

  .header-inner,
  .footer-inner,
  main {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .brand-logo {
    width: 46px;
    height: 46px;
  }

  .brand-text {
    font-size: 1.15rem;
  }

  .nav-toggle {
    width: 46px;
    min-height: 46px;
  }

  .eyebrow {
    font-size: 0.68rem;
    letter-spacing: 0.14em;
  }

  .hero-meta,
  .card-meta,
  .article-meta,
  .lede,
  .article-body {
    font-size: 0.98rem;
  }

  .home-hero,
  .about-strip,
  .editors-choice,
  .archive-head,
  .article-wrap,
  .editor-shell,
  .admin-shell {
    padding: 1rem;
  }

  .paper-pdf {
    min-height: 280px;
    height: 46vh;
  }
}
