:root {
  --paper: #f4efe5;
  --paper-deep: #ebe2d3;
  --paper-light: #faf7f0;
  --ink: #202321;
  --muted: #6c675f;
  --accent: #b54327;
  --accent-dark: #8e2f1d;
  --rule: #c9bda9;
  --rule-dark: #9e907c;
  --success: #45634c;
  --danger: #9a3426;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, Baskerville,
    "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --content-width: 1360px;
  --shadow: 0 24px 70px rgba(70, 52, 31, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 255, 255, 0.72), transparent 31rem),
    linear-gradient(90deg, rgba(104, 76, 42, 0.024) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 5px 5px, auto;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

::selection {
  background: rgba(181, 67, 39, 0.2);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200000;
  transform: translateY(-160%);
  padding: 10px 16px;
  border: 1px solid var(--ink);
  background: var(--paper-light);
  color: var(--ink);
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.bootstrap-state,
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px;
  min-height: 54vh;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.loading-mark {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-mark 1.2s ease-in-out infinite;
}

@keyframes pulse-mark {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.78);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.site-header {
  position: relative;
  z-index: 50;
  padding: 0 38px;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--content-width);
  min-height: 96px;
  margin: 0 auto;
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  flex: 0 0 auto;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(1.65rem, 2.5vw, 2.25rem);
  font-weight: 500;
  letter-spacing: 0.055em;
  line-height: 1;
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(22px, 3vw, 48px);
}

.site-nav__link {
  position: relative;
  padding: 35px 0 31px;
  color: #353735;
  font-size: 0.96rem;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav__link::after {
  position: absolute;
  right: 0;
  bottom: 24px;
  left: 0;
  height: 2px;
  background: var(--accent);
  content: "";
  opacity: 0;
  transform: scaleX(0.3);
  transition: 150ms ease;
}

.site-nav__link:hover,
.site-nav__link.is-active {
  color: var(--accent-dark);
}

.site-nav__link.is-active::after,
.site-nav__link:hover::after {
  opacity: 1;
  transform: scaleX(1);
}

.site-menu-button {
  display: none;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-main {
  min-height: calc(100vh - 220px);
  padding: 0 38px 80px;
}

.page-shell {
  max-width: var(--content-width);
  margin: 0 auto;
}

.home-hero {
  max-width: 920px;
  padding: 35px 0 31px;
}

.home-hero__title {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: clamp(4rem, 6vw, 5.3rem);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.home-hero__tagline {
  max-width: 900px;
  margin: 8px 0 0;
  color: #49453f;
  font-family: var(--display);
  font-size: clamp(1.45rem, 2.15vw, 2rem);
  line-height: 1.32;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 27px 0 30px;
  border-top: 1px solid var(--rule);
}

.filter-chip {
  min-height: 43px;
  padding: 7px 24px;
  border: 1px solid var(--rule-dark);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: 130ms ease;
}

.filter-chip:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.filter-chip.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fffaf2;
}

.home-layout,
.archive-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.05fr) minmax(290px, 0.95fr);
  align-items: start;
  gap: 40px;
}

.home-feed,
.content-list {
  min-width: 0;
}

.home-sidebar,
.archive-sidebar {
  display: grid;
  gap: 0;
  border: 1px solid var(--rule);
  background: rgba(250, 247, 240, 0.32);
}

.side-panel {
  padding: 34px 38px 36px;
}

.side-panel + .side-panel {
  border-top: 1px solid var(--rule);
}

.eyebrow {
  margin: 0 0 15px;
  color: var(--accent-dark);
  font-size: 0.81rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.side-panel > .eyebrow,
.side-panel__heading {
  padding-bottom: 13px;
  border-bottom: 1px solid var(--rule);
}

.side-panel__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.side-panel__heading .eyebrow {
  margin: 0;
}

.text-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 0.82rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ongoing-list {
  display: grid;
}

.ongoing-item {
  padding: 22px 0 21px;
  border-bottom: 1px dashed var(--rule);
}

.ongoing-item:last-child {
  border-bottom: 0;
}

.ongoing-item__line {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.ongoing-item__dot {
  width: 11px;
  height: 11px;
  border: 1px solid var(--rule-dark);
  border-radius: 50%;
}

.ongoing-item__dot.is-active {
  border-color: var(--accent);
  background: var(--accent);
}

.ongoing-item__title {
  overflow: hidden;
  font-size: 1rem;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ongoing-item__title:hover {
  color: var(--accent-dark);
}

.ongoing-item__value {
  color: var(--muted);
  font-family: var(--display);
  font-size: 0.95rem;
}

.progress-track {
  height: 2px;
  margin: 12px 0 0 26px;
  background: var(--rule);
}

.progress-track__value {
  display: block;
  height: 100%;
  background: var(--accent);
}

.category-tree,
.category-tree__branch {
  margin: 0;
  padding: 0;
  list-style: none;
}

.category-tree {
  padding: 13px 0 1px;
}

.category-tree__branch {
  position: relative;
  margin-left: 11px;
  padding-left: 25px;
}

.category-tree__branch::before {
  position: absolute;
  top: 0;
  bottom: 18px;
  left: 0;
  width: 1px;
  background: var(--rule);
  content: "";
}

.category-row {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 42px;
}

.category-row__toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 10px;
  padding: 0;
  border: 1px solid var(--rule-dark);
  background: var(--paper-light);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.72rem;
  line-height: 1;
}

.category-row__name {
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.category-row:hover .category-row__name,
.category-row.is-selected .category-row__name {
  color: var(--accent-dark);
}

.category-row.is-selected .category-row__toggle {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.match-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 17px;
  padding-top: 15px;
  border-top: 1px dashed var(--rule);
  color: var(--muted);
  font-size: 0.84rem;
}

.match-switch__button {
  padding: 4px 10px;
  border: 1px solid var(--rule-dark);
  background: transparent;
  color: var(--accent-dark);
  cursor: pointer;
}

.feed-entry {
  position: relative;
  min-height: 280px;
  padding: 28px 54px 32px;
  border-bottom: 1px solid var(--rule);
}

.feed-entry::before {
  position: absolute;
  top: 33px;
  bottom: 33px;
  left: 1px;
  width: 4px;
  background: var(--accent);
  content: "";
}

.feed-entry__pin {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.feed-entry__title {
  max-width: 850px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.35rem, 4vw, 3.75rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.03;
}

.feed-entry__preview {
  max-width: 800px;
  margin: 18px 0;
  color: #4d4b46;
  font-size: 1.05rem;
  line-height: 1.62;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 20px 0 14px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.entry-meta span + span::before {
  margin: 0 12px;
  color: var(--accent);
  content: "•";
}

.entry-meta__primary {
  color: #5b554c;
}

.feed-entry__link,
.content-entry__link,
.text-link {
  color: var(--accent-dark);
  text-decoration-color: rgba(181, 67, 39, 0.55);
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.feed-entry__link {
  font-family: var(--display);
  font-size: 1.2rem;
}

.feed-entry__link:hover,
.content-entry__link:hover,
.text-link:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

.text-link--quiet {
  color: var(--muted);
}

.pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 28px 0;
}

.pagination--empty {
  display: none;
}

.pagination__button {
  justify-self: start;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  cursor: pointer;
}

.pagination__button:last-child {
  justify-self: end;
}

.pagination__button:disabled {
  color: var(--rule-dark);
  cursor: not-allowed;
}

.pagination__status {
  color: var(--muted);
  font-size: 0.84rem;
}

.empty-state,
.error-state {
  display: grid;
  justify-items: start;
  min-height: 260px;
  padding: 50px 0;
  border-bottom: 1px solid var(--rule);
}

.empty-state__title,
.error-state__title {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 400;
  line-height: 1.08;
}

.empty-state p,
.error-state p {
  max-width: 680px;
  color: var(--muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px 18px;
  border: 1px solid var(--rule-dark);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  transition: 120ms ease;
}

.button:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.button--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fffaf2;
}

.button--primary:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  color: #fff;
}

.button--quiet {
  border-color: transparent;
  color: var(--muted);
}

.archive-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  column-gap: 50px;
  align-items: end;
  padding: 54px 0 40px;
  border-bottom: 1px solid var(--rule);
}

.archive-header .eyebrow,
.archive-header__title,
.archive-header__description {
  grid-column: 1;
}

.archive-header__title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(3.4rem, 6vw, 5.6rem);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.archive-header__description {
  max-width: 720px;
  margin: 17px 0 0;
  color: var(--muted);
  font-family: var(--display);
  font-size: 1.35rem;
  line-height: 1.45;
}

.search-form {
  display: flex;
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: end;
  gap: 8px;
  padding-bottom: 6px;
}

.archive-layout {
  padding-top: 34px;
}

.content-entry {
  position: relative;
  padding: 30px 44px 34px;
  border-bottom: 1px solid var(--rule);
}

.content-entry::before {
  position: absolute;
  top: 34px;
  bottom: 34px;
  left: 0;
  width: 3px;
  background: var(--accent);
  content: "";
}

.content-entry__type {
  margin-bottom: 8px;
  color: var(--accent-dark);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.content-entry__title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 3vw, 3.1rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.content-entry__preview {
  max-width: 790px;
  margin: 14px 0 0;
  color: #55514a;
}

.article-shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 58px 0 30px;
}

.article-header {
  padding-bottom: 34px;
  border-bottom: 1px solid var(--rule);
}

.article-header__title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(3.5rem, 7vw, 6.4rem);
  font-weight: 400;
  letter-spacing: -0.052em;
  line-height: 0.98;
}

.article-header__lead {
  max-width: 820px;
  margin: 24px 0 0;
  color: #4e4a44;
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  line-height: 1.45;
}

.prose {
  padding: 32px 0 54px;
  color: #2b2d2b;
  font-family: var(--display);
  font-size: 1.18rem;
  line-height: 1.8;
}

.prose > :first-child {
  margin-top: 0;
}

.prose h1,
.prose h2,
.prose h3 {
  margin: 1.6em 0 0.55em;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.16;
}

.prose h1 {
  font-size: 2.2rem;
}

.prose h2 {
  font-size: 1.8rem;
}

.prose h3 {
  font-size: 1.45rem;
}

.prose p,
.prose ul,
.prose ol,
.prose blockquote {
  margin: 1em 0;
}

.prose ul li::marker {
  content: "- ";
}

.prose code {
  padding: 0.12em 0.28em;
  background: var(--paper-deep);
  font-family: var(--mono);
  font-size: 0.84em;
}

.prose pre {
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--rule);
  background: #2a2a27;
  color: #f5efe3;
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.62;
}

.prose pre code {
  padding: 0;
  background: transparent;
}

.prose blockquote {
  margin-left: 0;
  padding-left: 24px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}

.prose--plain {
  white-space: pre-wrap;
}

.article-footer {
  padding: 25px 0;
  border-top: 1px solid var(--rule);
}

.about-shell .prose > p:first-of-type::first-letter {
  float: left;
  margin: 0.02em 0.12em 0 0;
  color: var(--accent);
  font-size: 4.3em;
  line-height: 0.82;
}

.site-footer {
  padding: 0 38px;
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--content-width);
  min-height: 108px;
  margin: 0 auto;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer__links {
  display: flex;
  gap: 24px;
}

.input,
.textarea,
.select {
  width: 100%;
  border: 1px solid var(--rule-dark);
  border-radius: 0;
  background: rgba(255, 252, 246, 0.65);
  color: var(--ink);
}

.input,
.select {
  min-height: 44px;
  padding: 9px 12px;
}

.textarea {
  min-height: 104px;
  padding: 11px 12px;
  line-height: 1.55;
  resize: vertical;
}

.textarea--code {
  font-family: var(--mono);
  font-size: 0.87rem;
  tab-size: 4;
}

.field {
  display: grid;
  gap: 6px;
}

.field__label,
.field__hint {
  color: var(--muted);
}

.field__label {
  font-size: 0.84rem;
  font-weight: 750;
}

.field__hint {
  font-size: 0.76rem;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #4c4b47;
  font-size: 0.88rem;
}

.checkbox input {
  accent-color: var(--accent);
}

.login-page {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 270px);
  padding: 50px 0;
}

.login-panel {
  width: min(100%, 440px);
  padding: 40px;
  border: 1px solid var(--rule);
  background: rgba(250, 247, 240, 0.75);
  box-shadow: var(--shadow);
}

.login-panel__title {
  margin: 0;
  font-family: var(--display);
  font-size: 3.25rem;
  font-weight: 400;
  line-height: 1;
}

.login-panel__intro {
  margin: 16px 0 26px;
  color: var(--muted);
}

.editorial-login-form {
  width: 100% !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--ink) !important;
  font-family: var(--sans) !important;
}

.editorial-login-form label {
  color: var(--muted) !important;
  font-weight: 750 !important;
}

.editorial-login-form input {
  height: 44px !important;
  border: 1px solid var(--rule-dark) !important;
  border-radius: 0 !important;
  background: rgba(255, 252, 246, 0.72) !important;
  color: var(--ink) !important;
}

.editorial-login-form button {
  height: 44px !important;
  border-radius: 0 !important;
  background: var(--accent) !important;
}

.login-status {
  min-height: 1.5em;
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 0.84rem;
}

/* Admin */
.admin-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  max-width: var(--content-width);
  min-height: 720px;
  margin: 38px auto 0;
  border: 1px solid var(--rule);
  background: rgba(250, 247, 240, 0.45);
}

.admin-nav {
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  border-right: 1px solid var(--rule);
  background: var(--paper-deep);
}

.admin-nav__identity {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 0 8px 21px;
  border-bottom: 1px solid var(--rule);
}

.admin-nav__identity > span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--display);
  font-size: 0.85rem;
}

.admin-nav__identity div {
  display: grid;
}

.admin-nav__identity small {
  color: var(--muted);
  font-size: 0.7rem;
}

.admin-nav nav {
  display: grid;
  gap: 3px;
}

.admin-nav__link,
.admin-nav__logout {
  display: block;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  background: transparent;
  color: #484943;
  cursor: pointer;
  font-size: 0.88rem;
  text-align: left;
  text-decoration: none;
}

.admin-nav__link:hover,
.admin-nav__link.is-active {
  background: rgba(181, 67, 39, 0.1);
  color: var(--accent-dark);
}

.admin-nav__logout {
  margin-top: auto;
  color: var(--danger);
}

.admin-content {
  min-width: 0;
  padding: 34px;
}

.admin-section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 30px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
}

.admin-section-header__title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.6rem, 4vw, 4.2rem);
  font-weight: 400;
  line-height: 1;
}

.admin-section-header__description {
  max-width: 680px;
  margin: 10px 0 0;
  color: var(--muted);
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--rule);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 252, 246, 0.36);
  font-size: 0.86rem;
}

.admin-table th,
.admin-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  background: rgba(235, 226, 211, 0.72);
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-table tbody tr:hover {
  background: rgba(181, 67, 39, 0.035);
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.admin-table__actions {
  white-space: nowrap;
}

.table-action {
  padding: 3px 7px;
  border: 0;
  background: transparent;
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 0.78rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.table-action--danger {
  color: var(--danger);
}

.table-action:disabled {
  color: var(--rule-dark);
  cursor: not-allowed;
}

.status-pill {
  display: inline-flex;
  padding: 3px 8px;
  border: 1px solid var(--rule-dark);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.7rem;
  white-space: nowrap;
}

.status-pill--published,
.status-pill--active {
  border-color: rgba(69, 99, 76, 0.5);
  color: var(--success);
}

.status-pill--off {
  color: var(--danger);
  text-decoration: line-through;
}

.admin-category-tree {
  overflow: hidden;
  border: 1px solid var(--rule);
  background: rgba(255, 252, 246, 0.42);
}

.editorial-dom-tree {
  background: transparent !important;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.88rem;
}

.editorial-dom-tree .dom-tree-row {
  border-bottom: 1px solid rgba(201, 189, 169, 0.5);
  border-radius: 0 !important;
}

.settings-form {
  display: grid;
  gap: 16px;
}

.setting-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.42fr) minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--rule);
  background: rgba(255, 252, 246, 0.4);
}

.setting-row__meta {
  display: grid;
  align-content: start;
  gap: 4px;
}

.setting-row__meta span {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

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

.media-item {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px solid var(--rule);
  background: rgba(255, 252, 246, 0.42);
  font-size: 0.8rem;
}

.media-item__preview {
  display: grid;
  min-height: 110px;
  place-items: center;
  background: var(--paper-deep);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
}

.profile-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: var(--rule);
}

.profile-summary > div {
  padding: 18px;
  background: var(--paper-light);
}

.profile-summary dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-summary dd {
  margin: 5px 0 0;
  font-family: var(--display);
  font-size: 1.25rem;
}

/* ModalElement is reused from libs; these selectors only apply the chosen theme. */
[id^="myModal"] {
  padding-top: 4vh !important;
  background: rgba(35, 29, 23, 0.44) !important;
  backdrop-filter: blur(3px);
}

[id^="myModal"] [id^="modal-title"] {
  color: var(--ink);
  font-family: var(--display);
  font-size: 1.2rem;
}

[id^="myModal"] [id^="modal-body-content"] {
  min-width: min(720px, 84vw);
}

[id^="myModal"] [id^="modal-body-content"] > div {
  max-width: 90vw !important;
}

[id^="myModal"] table {
  border-collapse: collapse;
}

.admin-form {
  display: grid;
  width: min(720px, 82vw);
  gap: 16px;
  padding: 10px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

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

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

.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.category-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 230px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--rule);
}

.category-checks legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.admin-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}

.admin-form__status {
  min-height: 1.4em;
  margin: 0;
  color: var(--danger);
  font-size: 0.82rem;
}

@media (max-width: 1100px) {
  .site-header,
  .site-main,
  .site-footer {
    padding-right: 24px;
    padding-left: 24px;
  }

  .site-nav {
    gap: 22px;
  }

  .site-nav__link {
    font-size: 0.88rem;
  }

  .home-layout,
  .archive-layout {
    grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.8fr);
    gap: 28px;
  }

  .side-panel {
    padding: 27px 25px;
  }

  .feed-entry {
    padding-right: 30px;
    padding-left: 38px;
  }

  .admin-shell {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .admin-content {
    padding: 26px;
  }
}

@media (max-width: 860px) {
  .site-header__inner {
    min-height: 78px;
  }

  .site-menu-button {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: 78px;
    right: 24px;
    left: 24px;
    display: none;
    padding: 14px;
    border: 1px solid var(--rule);
    background: var(--paper-light);
    box-shadow: var(--shadow);
  }

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

  .site-nav__link {
    padding: 9px 12px;
  }

  .site-nav__link::after {
    display: none;
  }

  .home-layout,
  .archive-layout {
    grid-template-columns: 1fr;
  }

  .home-sidebar,
  .archive-sidebar {
    grid-row: 1;
  }

  .archive-header {
    grid-template-columns: 1fr;
  }

  .search-form {
    grid-column: 1;
    grid-row: auto;
    margin-top: 26px;
  }

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

  .admin-nav {
    display: block;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .admin-nav__identity {
    margin-bottom: 12px;
  }

  .admin-nav nav {
    display: flex;
    flex-wrap: wrap;
  }

  .admin-nav__link,
  .admin-nav__logout {
    width: auto;
  }

  .admin-nav__logout {
    margin-top: 10px;
  }

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

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

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

  .site-header,
  .site-main,
  .site-footer {
    padding-right: 17px;
    padding-left: 17px;
  }

  .site-main {
    padding-bottom: 52px;
  }

  .wordmark {
    font-size: 1.42rem;
  }

  .site-nav {
    right: 17px;
    left: 17px;
  }

  .home-hero {
    padding-top: 29px;
  }

  .home-hero__title {
    font-size: 3.45rem;
  }

  .home-hero__tagline {
    font-size: 1.35rem;
  }

  .filter-chips {
    gap: 8px;
    padding: 20px 0 24px;
  }

  .filter-chip {
    min-height: 38px;
    padding: 6px 16px;
  }

  .feed-entry,
  .content-entry {
    min-height: 0;
    padding: 27px 8px 30px 25px;
  }

  .feed-entry::before,
  .content-entry::before {
    top: 29px;
    bottom: 30px;
    width: 3px;
  }

  .feed-entry__title {
    font-size: 2.4rem;
  }

  .content-entry__title {
    font-size: 2rem;
  }

  .side-panel {
    padding: 25px 20px;
  }

  .archive-header {
    padding-top: 42px;
  }

  .archive-header__title {
    font-size: 3.3rem;
  }

  .article-shell {
    padding-top: 42px;
  }

  .article-header__title {
    font-size: 3.45rem;
  }

  .prose {
    font-size: 1.08rem;
  }

  .site-footer__inner {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
  }

  .login-panel {
    padding: 28px 22px;
  }

  .admin-content {
    padding: 22px 16px;
  }

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

  .form-grid--2,
  .category-checks,
  .setting-row,
  .profile-summary {
    grid-template-columns: 1fr;
  }

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

  .admin-form {
    width: 84vw;
    padding: 2px;
  }

  [id^="myModal"] [id^="modal-body-content"] {
    min-width: 88vw;
  }
}

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

@media print {
  .site-header,
  .site-footer,
  .article-footer,
  .filter-chips,
  .home-sidebar,
  .archive-sidebar {
    display: none !important;
  }

  body,
  html {
    background: #fff;
  }

  .site-main {
    padding: 0;
  }

  .article-shell {
    max-width: none;
  }
}
