:root {
  --ink: #162029;
  --muted: #61717f;
  --line: #d9e1e8;
  --paper: #f7fafc;
  --white: #ffffff;
  --navy: #14324a;
  --teal: #0f766e;
  --coral: #d85c45;
  --gold: #e3a72f;
  --mint: #dff7ef;
  --shadow: 0 18px 42px rgba(22, 32, 41, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 32px;
  border-bottom: 1px solid rgba(217, 225, 232, 0.8);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--navy);
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: linear-gradient(135deg, var(--teal), var(--coral));
  font-size: 0.78rem;
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.nav-links a {
  text-decoration: none;
}

.hero {
  position: relative;
  min-height: clamp(560px, 78vh, 740px);
  display: grid;
  align-items: center;
  overflow: hidden;
  background: var(--navy);
}

.hero-image,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(12, 27, 39, 0.86), rgba(12, 27, 39, 0.58) 40%, rgba(12, 27, 39, 0.08) 78%),
    linear-gradient(0deg, rgba(12, 27, 39, 0.34), rgba(12, 27, 39, 0));
}

.hero-content {
  position: relative;
  width: min(760px, calc(100vw - 48px));
  margin-left: clamp(24px, 7vw, 96px);
  padding: 70px 0 112px;
  color: var(--white);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 690px;
  font-size: clamp(2.55rem, 6vw, 5.5rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 610px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1rem, 2vw, 1.24rem);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 6px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  color: #17140d;
  background: var(--gold);
}

.button.secondary {
  color: var(--white);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.36);
}

.news-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 56px auto 74px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.sidebar {
  display: grid;
  gap: 18px;
  position: sticky;
  top: 88px;
}

.filter-panel,
.ad-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.filter-panel {
  padding: 18px;
}

.filter-panel h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
}

.filter {
  width: 100%;
  min-height: 38px;
  margin: 4px 0;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.filter.active,
.filter:hover {
  color: var(--navy);
  background: var(--mint);
}

.ad-box {
  min-height: 228px;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(216, 92, 69, 0.12)),
    var(--white);
}

.ad-box span {
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--teal);
  background: rgba(15, 118, 110, 0.12);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.ad-box strong {
  color: var(--navy);
  font-size: 1.35rem;
  line-height: 1.08;
}

.ad-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.ad-placeholder {
  display: none;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

#feedStatus {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

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

.story-card {
  min-height: 320px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--white);
}

.story-media {
  height: 150px;
  background:
    radial-gradient(circle at 18% 16%, rgba(227, 167, 47, 0.42), transparent 30%),
    linear-gradient(135deg, rgba(20, 50, 74, 0.95), rgba(15, 118, 110, 0.8));
}

.story-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.story-body {
  padding: 18px;
}

.story-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.tag {
  color: var(--teal);
}

.story-card h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1.16rem;
  line-height: 1.18;
}

.story-card p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.48;
}

.story-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px 18px;
}

.source {
  min-width: 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.read-link {
  flex: 0 0 auto;
  color: var(--coral);
  font-weight: 900;
  text-decoration: none;
}

.community-band,
.newsletter-band {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 30px;
  align-items: center;
  padding: 64px max(24px, calc((100vw - 1180px) / 2));
  background: var(--navy);
  color: var(--white);
}

.community-band h2,
.newsletter-band h2 {
  margin: 0;
  max-width: 520px;
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1.04;
}

.newsletter-band p:not(.eyebrow) {
  max-width: 560px;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.55;
}

.newsletter-panel {
  display: grid;
  gap: 16px;
}

.newsletter-form {
  display: grid;
  gap: 10px;
}

.newsletter-form label {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.newsletter-form div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.newsletter-form input {
  min-height: 46px;
  width: 100%;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  font: inherit;
}

.newsletter-form input::placeholder {
  color: rgba(255, 255, 255, 0.58);
}

.newsletter-form p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.92rem;
}

.digest-preview {
  display: grid;
  gap: 10px;
}

.digest-preview article {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.digest-preview strong {
  color: var(--gold);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.digest-preview ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.digest-preview li {
  margin: 7px 0;
  line-height: 1.35;
}

.digest-preview span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.86rem;
}

.board-preview {
  display: grid;
  gap: 12px;
}

.board-preview article {
  min-height: 88px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.board-preview span {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.board-preview strong {
  line-height: 1.25;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 28px 32px;
  color: var(--muted);
  background: var(--white);
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--navy);
  font-weight: 800;
  text-decoration: none;
}

.about-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 64px 0 76px;
}

.about-hero {
  max-width: 820px;
  padding: 24px 0 42px;
}

.about-hero h1 {
  max-width: 780px;
  color: var(--navy);
  font-size: clamp(2.6rem, 6vw, 5.2rem);
}

.about-hero p:not(.eyebrow) {
  max-width: 680px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.55;
}

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

.about-grid article {
  min-height: 230px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.about-grid .about-main {
  grid-column: span 3;
  min-height: auto;
  padding: 34px;
}

.about-grid h2 {
  margin: 0 0 12px;
  color: var(--navy);
  font-size: 1.35rem;
}

.about-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.about-grid p + p {
  margin-top: 14px;
}

.about-principles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 22px;
}

.about-principles div {
  min-height: 190px;
  padding: 24px;
  border-radius: 8px;
  color: var(--white);
  background: var(--navy);
}

.about-principles span {
  color: var(--gold);
  font-weight: 900;
}

.about-principles strong {
  display: block;
  margin-top: 16px;
  font-size: 1.2rem;
}

.about-principles p {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.5;
}

.admin-page {
  background: #eef4f7;
}

.admin-shell {
  width: min(1220px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 42px 0 72px;
}

.admin-hero {
  display: grid;
  gap: 12px;
  padding: 32px 0 26px;
}

.admin-hero h1 {
  max-width: 760px;
  color: var(--navy);
  font-size: clamp(2.4rem, 5vw, 4.8rem);
}

.admin-hero p:not(.eyebrow) {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
}

.admin-toolbar {
  position: sticky;
  top: 68px;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 30px rgba(22, 32, 41, 0.08);
  backdrop-filter: blur(14px);
}

.admin-button {
  min-height: 40px;
  color: var(--navy);
  background: var(--white);
  border-color: var(--line);
}

.admin-button.quiet {
  color: var(--teal);
}

.admin-toolbar #adminStatus {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

#adminStatus[data-tone="ok"],
.source-result[data-tone="ok"] {
  color: var(--teal);
}

#adminStatus[data-tone="error"],
.source-result[data-tone="error"] {
  color: var(--coral);
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.admin-stats div {
  min-height: 104px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 20px 24px;
  border-right: 1px solid var(--line);
}

.admin-stats div:last-child {
  border-right: 0;
}

.admin-stats span {
  color: var(--navy);
  font-size: clamp(1.25rem, 3vw, 1.9rem);
  font-weight: 900;
}

.admin-stats small {
  color: var(--muted);
  font-weight: 800;
}

.source-editor {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--white);
}

.source-header,
.source-row {
  display: grid;
  grid-template-columns: 56px minmax(150px, 1fr) 145px minmax(220px, 1.25fr) minmax(220px, 1.25fr) 136px;
  gap: 10px;
  align-items: center;
}

.source-header {
  min-height: 48px;
  padding: 0 14px;
  color: var(--muted);
  background: #f4f8fa;
  border-bottom: 1px solid var(--line);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.source-rows {
  display: grid;
}

.source-row {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.source-row:last-child {
  border-bottom: 0;
}

.source-row input,
.source-row select {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--white);
  font: inherit;
}

.source-row input:focus,
.source-row select:focus {
  outline: 2px solid rgba(15, 118, 110, 0.22);
  border-color: var(--teal);
}

.switch {
  width: 44px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch span {
  position: relative;
  width: 44px;
  height: 26px;
  display: block;
  border-radius: 999px;
  background: #cbd5df;
  transition: background 160ms ease;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 2px 7px rgba(22, 32, 41, 0.22);
  transition: transform 160ms ease;
}

.switch input:checked + span {
  background: var(--teal);
}

.switch input:checked + span::after {
  transform: translateX(18px);
}

.row-actions {
  display: flex;
  gap: 6px;
}

.row-actions button {
  min-height: 36px;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--navy);
  background: #f7fafc;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 850;
  cursor: pointer;
}

.row-actions button:hover {
  border-color: var(--teal);
}

.source-result {
  grid-column: 2 / -1;
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.admin-notes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 20px;
}

.admin-notes article {
  min-height: 140px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.admin-notes strong {
  color: var(--navy);
}

.admin-notes p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

@media (max-width: 920px) {
  .site-header {
    padding: 0 18px;
  }

  .nav-links {
    display: none;
  }

  .hero {
    min-height: 650px;
  }

  .hero-content {
    width: min(620px, calc(100vw - 36px));
    margin: 0 auto;
  }

  .admin-stats {
    grid-template-columns: 1fr;
    margin-top: 0;
    width: 100%;
    border-radius: 0;
  }

  .admin-stats div {
    min-height: 86px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .sidebar {
    position: static;
  }

  .filter-panel {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px;
  }

  .filter-panel h2 {
    display: none;
  }

  .filter {
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .article-grid,
  .about-grid,
  .about-principles,
  .community-band,
  .newsletter-band,
  .admin-notes {
    grid-template-columns: 1fr;
  }

  .about-grid .about-main {
    grid-column: span 1;
  }

  .source-editor {
    overflow-x: auto;
  }

  .source-header,
  .source-row {
    min-width: 980px;
  }
}

@media (max-width: 560px) {
  .hero {
    min-height: 620px;
  }

  .hero-overlay {
    background:
      linear-gradient(180deg, rgba(12, 27, 39, 0.88), rgba(12, 27, 39, 0.58) 58%, rgba(12, 27, 39, 0.18)),
      linear-gradient(90deg, rgba(12, 27, 39, 0.62), rgba(12, 27, 39, 0.12));
  }

  .hero-content {
    padding: 54px 0 80px;
  }

  .button {
    width: 100%;
  }

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

  .section-heading {
    display: block;
  }

  #feedStatus {
    margin-top: 8px;
  }

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

  .site-footer {
    padding: 24px 18px;
  }

  .about-shell {
    width: min(100vw - 24px, 1180px);
    padding-top: 34px;
  }

  .about-grid .about-main {
    padding: 24px;
  }

  .admin-shell {
    width: min(100vw - 24px, 1220px);
    padding-top: 26px;
  }

  .admin-toolbar {
    top: 68px;
  }

  .admin-toolbar #adminStatus {
    width: 100%;
    margin-left: 0;
  }
}
