:root {
  --bg: #f7f3ec;
  --bg-alt: #efe7dc;
  --surface: #fffdf8;
  --surface-soft: #f3ece2;
  --text: #171411;
  --muted: #70675f;
  --line: rgba(23, 20, 17, 0.12);
  --line-strong: rgba(23, 20, 17, 0.22);
  --accent: #8e5d3b;
  --accent-soft: rgba(142, 93, 59, 0.1);
  --shadow: 0 18px 50px rgba(31, 22, 15, 0.06);
}

[data-theme="dark"] {
  --bg: #0d1114;
  --bg-alt: #11171c;
  --surface: #131a20;
  --surface-soft: #182129;
  --text: #f2ede5;
  --muted: #a7a099;
  --line: rgba(242, 237, 229, 0.1);
  --line-strong: rgba(242, 237, 229, 0.18);
  --accent: #d5a07b;
  --accent-soft: rgba(213, 160, 123, 0.12);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Instrument Sans", sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 160px),
    linear-gradient(90deg, transparent 0, transparent calc(50% - 560px), var(--line) calc(50% - 560px), var(--line) calc(50% - 559px), transparent calc(50% - 559px), transparent calc(50% + 559px), var(--line) calc(50% + 559px), var(--line) calc(50% + 560px), transparent calc(50% + 560px)),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
}

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

img {
  display: block;
  max-width: 100%;
}

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

::selection {
  background: var(--accent);
  color: #fff;
}

.site-header,
.feed,
.article-view,
.admin-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  padding: 24px 0 0;
}

.site-header__bar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-strong);
}

.site-logo {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}

.site-logo__eyebrow {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.site-logo__wordmark {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(36px, 5vw, 58px);
  font-weight: 600;
  line-height: 0.9;
  letter-spacing: 0.02em;
}

.site-logo__wordmark span {
  color: var(--accent);
}

.site-header__controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle,
.admin-link,
.button,
.favorite-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.theme-toggle,
.admin-link,
.button {
  border-radius: 999px;
}

.theme-toggle:hover,
.admin-link:hover,
.button:hover,
.favorite-chip:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.site-header__intro {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 28px;
  padding: 30px 0 26px;
  border-bottom: 1px solid var(--line);
}

.site-header__kicker,
.topic-strip__label,
.lead-story__meta,
.news-card__meta,
.news-rail__eyebrow,
.rail-item__meta,
.article-shell__meta,
.site-header__aside-label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.site-header__title {
  margin: 12px 0 0;
  max-width: 11ch;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(48px, 9vw, 104px);
  font-weight: 600;
  line-height: 0.88;
}

.site-header__summary {
  margin: 18px 0 0;
  max-width: 56ch;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.site-header__aside {
  align-self: end;
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.site-header__aside p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.topic-strip {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 18px 0 14px;
  border-bottom: 1px solid var(--line-strong);
}

.topic-strip__items,
.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.favorite-chip {
  border-radius: 999px;
  background: var(--surface);
}

.favorite-chip.is-active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.feed {
  padding: 30px 0 56px;
}

.lead-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.7fr);
  gap: 28px;
  align-items: start;
}

.lead-story {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-strong);
}

.lead-story__media {
  display: block;
  margin-bottom: 22px;
  background: var(--surface-soft);
}

.lead-story__media img {
  width: 100%;
  aspect-ratio: 16 / 9.4;
  object-fit: cover;
}

.lead-story__meta span,
.article-shell__meta span {
  margin-left: 10px;
  letter-spacing: 0;
  text-transform: none;
}

.lead-story__title {
  margin: 10px 0 14px;
  max-width: 18ch;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(34px, 4.3vw, 56px);
  font-weight: 600;
  line-height: 0.96;
}

.lead-story__summary {
  max-width: 62ch;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.9;
}

.lead-story__link,
.article-shell__back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.news-rail {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line-strong);
}

.news-rail__head {
  padding: 0 0 18px;
}

.news-rail__copy {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.rail-item {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.rail-item__title {
  margin: 10px 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.08;
}

.rail-item__summary,
.news-card__summary,
.feed__status,
.article-shell__summary,
.article-shell__source,
.source-list,
.admin-card__hint,
.flash {
  color: var(--muted);
  line-height: 1.8;
}

.feed__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px 22px;
  margin-top: 24px;
  padding-top: 26px;
  border-top: 1px solid var(--line-strong);
}

.home-banner {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.news-card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.news-card__media {
  display: block;
  background: var(--surface-soft);
}

.news-card__media img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.news-card__body {
  padding: 18px;
}

.news-card__title {
  margin: 12px 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.06;
}

.feed__status {
  padding: 28px 0 0;
  text-align: center;
}

.empty-state {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.95fr);
  gap: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line-strong);
}

.empty-state__eyebrow,
.starter-card__meta {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.empty-state__title,
.starter-card__title {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  line-height: 0.95;
}

.empty-state__title {
  margin: 10px 0 14px;
  max-width: 11ch;
  font-size: clamp(38px, 5vw, 64px);
}

.empty-state__summary {
  max-width: 58ch;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
}

.empty-state__summary code {
  padding: 2px 8px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.empty-state__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

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

.starter-card {
  padding: 18px 18px 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.starter-card__title {
  margin: 8px 0 10px;
  font-size: 32px;
}

.starter-card__summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.article-view {
  padding: 28px 0 64px;
}

.article-shell {
  width: min(860px, 100%);
  margin: 0 auto;
}

.article-shell__title {
  margin: 12px 0 14px;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(46px, 7vw, 84px);
  font-weight: 600;
  line-height: 0.9;
}

.article-shell__summary {
  margin: 0 0 24px;
  font-size: 18px;
}

.article-shell__image {
  width: 100%;
  margin: 0 0 26px;
  background: var(--surface-soft);
  aspect-ratio: 16 / 9.2;
  object-fit: cover;
}

.article-shell__content {
  font-size: 18px;
  line-height: 1.95;
}

.article-shell__content p {
  margin: 0 0 1em;
}

.article-shell__source {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.ad-slot {
  display: grid;
  place-items: center;
  min-height: 90px;
  max-width: 728px;
  margin: 26px auto;
  border: 1px solid var(--line);
  background: var(--surface);
}

.ad-slot--home {
  margin: 0;
  width: min(100%, 728px);
}

.ad-slot__fallback {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 12px 18px;
  text-align: center;
}

.ad-slot__label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.ad-slot__contact {
  color: var(--text);
  font-size: 18px;
  line-height: 1.6;
}

.admin-body {
  padding: 28px 0 56px;
}

.admin-shell__panel {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 26px;
}

.admin-shell__title {
  margin: 0 0 18px;
  font-family: "Cormorant Garamond", serif;
  font-size: 46px;
  font-weight: 600;
}

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

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

.admin-card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 20px;
}

.admin-card--wide {
  grid-column: 1 / -1;
}

.admin-card h2 {
  margin-top: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 30px;
  font-weight: 600;
}

.admin-form__field {
  display: grid;
  gap: 8px;
}

.admin-form__field input,
.admin-form__field textarea,
.admin-form__field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
}

.button {
  width: fit-content;
}

.button--ghost {
  background: transparent;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.manage-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.manage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.manage-row--stacked {
  align-items: flex-start;
}

.manage-row__content {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.manage-row__title {
  font-weight: 600;
}

.manage-row__meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  word-break: break-word;
}

.manage-row__action {
  white-space: nowrap;
}

.flash {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.flash--ok {
  color: #508764;
}

.flash--error {
  color: #b85c5c;
}

.source-list p {
  margin: 0 0 10px;
}

@media (max-width: 980px) {
  .site-header__intro,
  .lead-grid,
  .feed__grid,
  .admin-grid,
  .empty-state {
    grid-template-columns: 1fr;
  }

  .site-header__aside {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 18px;
  }
}

@media (max-width: 760px) {
  .site-header,
  .feed,
  .article-view,
  .admin-shell {
    width: min(100% - 22px, 1120px);
  }

  .site-header__bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .topic-strip {
    flex-direction: column;
  }

  .news-card__title {
    font-size: 26px;
  }

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

  .manage-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
