:root {
  --ink: #121212;
  --muted: #68615c;
  --paper: #fffaf4;
  --surface: #ffffff;
  --line: #ded7cf;
  --ta-red: #c81414;
  --ta-red-dark: #9e0e0e;
  --gold: #c79b36;
  --green: #267a59;
  --blue: #235a7c;
  --shadow: 0 16px 40px rgba(18, 18, 18, 0.12);
  font-family: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(200, 20, 20, 0.04), transparent 36%),
    var(--paper);
}

a {
  color: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(18px, 4vw, 48px);
  color: #ffffff;
  background: var(--ink);
  border-bottom: 5px solid var(--ta-red);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  font-family: Arial, sans-serif;
  font-weight: 900;
  letter-spacing: 0;
  color: #ffffff;
  background: var(--ta-red);
}

.brand strong {
  display: block;
  font-size: 1.1rem;
}

.brand small {
  display: block;
  color: #ddd6cf;
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
}

.top-nav {
  display: inline-flex;
  gap: 6px;
  font-family: Arial, sans-serif;
}

.top-nav a {
  min-width: 106px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  text-align: center;
  text-decoration: none;
}

.top-nav a[aria-current="page"] {
  background: #ffffff;
  color: var(--ink);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(20px, 4vw, 44px) 0;
}

.edition-bar,
.admin-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 6px;
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--ta-red);
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2.2rem, 6vw, 5.4rem);
  line-height: 0.94;
}

h2 {
  font-size: 1.35rem;
}

.edition-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  align-items: end;
  gap: 8px;
  font-family: Arial, sans-serif;
  color: var(--muted);
}

.edition-meta span,
.date-jump {
  padding: 8px 10px;
  background: #ffffff;
  border: 1px solid var(--line);
}

.date-jump {
  display: grid;
  gap: 4px;
  min-width: 178px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.date-jump input,
.date-jump select {
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 0.96rem;
}

.lead-story {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: clamp(20px, 4vw, 42px);
  align-items: stretch;
  margin-top: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.lead-story img,
.story-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #e8e1d9;
}

.lead-story img {
  grid-column: 1;
  grid-row: 1;
  min-height: 420px;
}

.lead-content {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(20px, 4vw, 46px);
  background: #ffffff;
  position: relative;
  z-index: 1;
}

.kicker {
  width: fit-content;
  margin-bottom: 18px;
  padding: 7px 10px;
  font-family: Arial, sans-serif;
  font-size: 0.76rem;
  font-weight: 800;
  color: #ffffff;
  background: var(--ta-red);
  text-transform: uppercase;
}

.lead-content h2 {
  margin-bottom: 16px;
  font-size: clamp(2rem, 4.4vw, 4.3rem);
  line-height: 0.98;
}

.lead-content p,
.story-card p {
  color: #38322e;
  font-size: 1.08rem;
  line-height: 1.5;
}

.read-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 42px;
  margin-top: 14px;
  padding: 10px 13px;
  font-family: Arial, sans-serif;
  font-weight: 800;
  color: #ffffff;
  background: var(--ink);
  text-decoration: none;
}

.story-card .read-link {
  margin-top: auto;
}

.read-link:hover,
.read-link:focus-visible {
  background: var(--ta-red-dark);
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.story-card {
  display: grid;
  grid-template-rows: 210px 1fr;
  min-height: 100%;
  background: var(--surface);
  border-top: 5px solid var(--ta-red);
  overflow: hidden;
}

.story-card-content {
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  background: #ffffff;
  position: relative;
  z-index: 1;
}

.story-card > img {
  grid-row: 1;
}

.story-card h3 {
  margin-bottom: 0;
  font-size: 1.48rem;
  line-height: 1.05;
}

.story-card p {
  margin-bottom: 4px;
  font-size: 0.98rem;
}

.admin-view {
  font-family: Arial, sans-serif;
}

.admin-view h1,
.admin-view h2,
.admin-view h3 {
  font-family: Georgia, "Times New Roman", serif;
}

.admin-actions,
.split {
  display: flex;
  gap: 10px;
}

.button {
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--ink);
  cursor: pointer;
  font-family: Arial, sans-serif;
  font-weight: 800;
}

.button-dark {
  color: #ffffff;
  background: var(--ink);
}

.button-light {
  color: var(--ink);
  background: #ffffff;
}

.button:hover,
.button:focus-visible {
  border-color: var(--ta-red);
  outline: 2px solid rgba(200, 20, 20, 0.18);
}

.control-panel {
  display: grid;
  grid-template-columns: 180px minmax(220px, 1fr) 220px minmax(190px, 0.65fr);
  gap: 12px;
  margin-top: 20px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
}

.schedule-note {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px;
  color: #3c342e;
  background: #fff3d4;
  border-left: 5px solid var(--gold);
  font-size: 0.86rem;
  line-height: 1.35;
}

label {
  display: grid;
  gap: 7px;
  color: #2e2925;
  font-size: 0.83rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px;
  border: 1px solid #bcb4ac;
  background: #fffdf9;
  color: var(--ink);
  font-family: Arial, sans-serif;
  font-size: 0.96rem;
}

textarea {
  resize: vertical;
}

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

.metrics div {
  padding: 16px;
  background: var(--ink);
  color: #ffffff;
}

.metrics span {
  display: block;
  font-size: 2rem;
  font-weight: 900;
}

.metrics p {
  margin: 2px 0 0;
  color: #ddd6cf;
  font-size: 0.84rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  gap: 18px;
}

.queue,
.editor {
  background: #ffffff;
  border: 1px solid var(--line);
}

.section-title,
.editor {
  padding: 18px;
}

.section-title {
  border-bottom: 1px solid var(--line);
}

.section-title p {
  margin-bottom: 0;
  color: var(--muted);
}

.article-list {
  display: grid;
}

.article-row {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

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

.article-row img {
  width: 116px;
  height: 86px;
  object-fit: cover;
}

.article-row h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
}

.article-edit-fields {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.article-edit-fields label {
  font-size: 0.74rem;
}

.article-edit-fields input,
.article-edit-fields textarea {
  min-height: 38px;
  padding: 8px;
  font-size: 0.9rem;
}

.article-row p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.35;
}

.row-tools {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.row-tools label {
  font-size: 0.74rem;
}

.checkline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
}

.checkline input {
  width: 18px;
  min-height: 18px;
}

.score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 8px;
  color: #ffffff;
  background: var(--blue);
  font-weight: 900;
}

.score-pill-auto {
  background: var(--green);
}

.mini-button {
  min-height: 42px;
  padding: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
}

.editor form,
.rss-tools,
.data-tools {
  display: grid;
  gap: 12px;
}

.rss-tools {
  margin-bottom: 26px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.data-tools {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.tool-message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(18px, 4vw, 48px);
  color: #ffffff;
  background: var(--ink);
  font-family: Arial, sans-serif;
}

.site-footer a {
  color: #ffffff;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 42px 18px;
  color: var(--muted);
  text-align: center;
  background: #ffffff;
  border: 1px dashed var(--line);
}

body.embed [data-app-shell],
body.embed .admin-view {
  display: none;
}

body.embed main {
  width: min(100%, 1120px);
  padding: 0;
}

@media (max-width: 860px) {
  .site-header {
    position: static;
    gap: 14px;
  }

  .site-header,
  .edition-bar,
  .admin-heading,
  .site-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .top-nav {
    width: 100%;
  }

  .top-nav a {
    flex: 1;
  }

  .lead-story,
  .workspace,
  .control-panel {
    grid-template-columns: 1fr;
  }

  .lead-story img {
    grid-column: 1;
    grid-row: 1;
    aspect-ratio: 16 / 10;
    height: auto;
    min-height: 280px;
  }

  .lead-content {
    grid-column: 1;
    grid-row: 2;
    justify-content: start;
    padding: 22px;
  }

  .lead-content h2 {
    font-size: clamp(2rem, 9vw, 3rem);
  }

  .story-grid,
  .metrics {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  body {
    background: var(--paper);
  }

  main {
    width: min(100% - 24px, 1180px);
    padding-top: 18px;
  }

  .brand-mark {
    width: 54px;
    height: 54px;
  }

  .brand strong {
    font-size: 1.35rem;
    line-height: 1;
  }

  .brand small {
    font-size: 0.95rem;
  }

  .top-nav a {
    min-width: 0;
    padding: 12px 10px;
  }

  .edition-bar {
    gap: 14px;
  }

  h1 {
    font-size: clamp(2.25rem, 13vw, 3.4rem);
  }

  .edition-meta {
    justify-content: stretch;
  }

  .edition-meta span,
  .date-jump {
    width: 100%;
  }

  .lead-story {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    gap: 0;
    margin-top: 18px;
    box-shadow: none;
    border-top: 5px solid var(--ta-red);
  }

  .lead-story img {
    aspect-ratio: 4 / 3;
    min-height: 0;
    max-height: 360px;
    object-position: center;
  }

  .lead-content {
    background: #ffffff;
    color: var(--ink);
    padding: 18px;
    margin: 0;
  }

  .kicker {
    margin-bottom: 12px;
  }

  .lead-content h2 {
    margin-bottom: 10px;
    font-size: clamp(1.7rem, 9vw, 2.35rem);
    line-height: 1.03;
  }

  .lead-content p {
    color: #302b27;
    font-size: 1rem;
    line-height: 1.45;
  }

  .admin-actions,
  .split {
    flex-direction: column;
  }

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

  .article-row img {
    width: 100%;
    height: 180px;
  }

  .story-card {
    display: grid;
    grid-template-rows: auto auto;
  }

  .story-card img {
    grid-row: 1;
    aspect-ratio: 16 / 9;
    height: auto;
    min-height: 0;
  }

  .story-card-content {
    grid-row: 2;
    background: #ffffff;
  }

  .row-tools {
    grid-template-columns: 1fr;
  }
}
