@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=IBM+Plex+Sans+Condensed:wght@400;500;600&display=swap");

:root {
  --paper: #f4efe3;
  --paper-deep: #e7decb;
  --ink: #101622;
  --ink-soft: #4c5568;
  --accent: #c7472a;
  --accent-dark: #7e2716;
  --line: rgba(16, 22, 34, 0.18);
  --shadow: 0 22px 70px rgba(16, 22, 34, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top right, rgba(199, 71, 42, 0.18), transparent 32rem),
    radial-gradient(circle at 18% 20%, rgba(16, 22, 34, 0.08), transparent 22rem),
    linear-gradient(180deg, #f7f3ea 0%, #ece2d2 100%);
  color: var(--ink);
}

body {
  font-family: "IBM Plex Sans Condensed", sans-serif;
  line-height: 1.5;
}

.utility-nav {
  position: fixed;
  top: 0.7rem;
  right: 1rem;
  z-index: 4;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.utility-nav a {
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  background: rgba(244, 239, 227, 0.82);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.78rem;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(90deg, rgba(16, 22, 34, 0.02) 50%, transparent 50%),
    linear-gradient(rgba(16, 22, 34, 0.02) 50%, transparent 50%);
  background-size: 3px 3px;
}

.site-frame {
  position: relative;
  z-index: 1;
  padding: 3.4rem 1rem 4rem;
}

.paper-shell {
  width: min(1200px, 100%);
  margin: 0 auto;
  padding: 1rem;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.1)),
    var(--paper);
  box-shadow: var(--shadow);
}

.masthead {
  border-bottom: 3px solid var(--ink);
  padding-bottom: 1rem;
}

.masthead-topline,
.tools-ribbon,
.card-topline,
.card-meta,
.article-meta,
.source-strip,
.article-deck {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.masthead-topline {
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.6rem;
}

.masthead-topline-left {
  justify-content: flex-start;
}

.edition-pill,
.kicker,
.search-label,
.archive-summary,
.rail-label,
.source-label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-dark);
}

.edition-date,
.tagline,
.card-source,
.article-meta,
.front-link {
  color: var(--ink-soft);
}

.masthead-brand {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.2rem;
  padding-top: 1rem;
}

.masthead h1,
.card-headline,
.story-sheet h1 {
  margin: 0;
  font-family: "Fraunces", serif;
  line-height: 0.95;
}

.masthead h1 {
  font-size: clamp(3rem, 9vw, 7rem);
  text-transform: uppercase;
}

.desk-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding-top: 1rem;
}

.desk-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.35);
}

.desk-link.is-active {
  border-color: var(--ink);
  background: rgba(16, 22, 34, 0.06);
}

.desk-count,
.importance-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: white;
  background: var(--accent);
}

.tools-ribbon {
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

wa-input.news-search {
  display: block;
  flex: 1 1 20rem;
}

.lead-wrap {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

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

.story-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--line);
  cursor: pointer;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.06)),
    var(--paper);
}

.story-card::after {
  content: "";
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 0.6rem;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0;
  transition: opacity 160ms ease;
}

.story-card:hover::after {
  opacity: 1;
}

.variant-lead {
  grid-column: span 12;
  padding: clamp(1.2rem, 3vw, 2rem);
}

.variant-standard {
  grid-column: span 4;
}

.variant-compact {
  grid-column: span 6;
}

.variant-lead .card-headline {
  font-size: clamp(2rem, 5vw, 4rem);
}

.variant-standard .card-headline {
  font-size: clamp(1.25rem, 2.3vw, 1.9rem);
}

.variant-compact .card-headline {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
}

.card-headline a,
.front-link {
  color: inherit;
  text-decoration: none;
}

.card-summary,
.story-summary {
  margin: 0;
  font-size: 1.02rem;
}

.article-shell .masthead {
  margin-bottom: 1rem;
}

.article-shell .masthead h1 {
  font-size: clamp(3rem, 5vw, 7rem);
  text-transform: none;
}

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

.story-sheet,
.rail-sheet {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.35);
  padding: 1rem;
}

.story-sheet h1 {
  font-size: clamp(2rem, 4vw, 4rem);
}

.story-content {
  font-size: 1.08rem;
}

.story-content p:first-child::first-letter {
  float: left;
  font-family: "Fraunces", serif;
  font-size: 4.4rem;
  line-height: 0.9;
  padding-right: 0.45rem;
  padding-top: 0.08rem;
}

.story-content p {
  margin: 0 0 1rem;
}

.read-more {
  margin: 0;
  color: rgba(76, 85, 104, 0.78);
  font-size: 0.92rem;
}

.source-strip {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.source-strip a {
  color: var(--accent-dark);
}

.source-list {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.related-stack {
  display: grid;
  gap: 0.8rem;
}

.rail-block + .rail-block {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.story-card.is-hidden {
  display: none;
}

@media (max-width: 960px) {
  .variant-standard,
  .variant-compact {
    grid-column: span 6;
  }

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

@media (max-width: 680px) {
  .utility-nav {
    position: static;
    justify-content: flex-end;
    padding: 0 0.5rem 0.75rem;
  }

  .site-frame {
    padding: 0.5rem 0.5rem 3rem;
  }

  .paper-shell {
    padding: 0.8rem;
  }

  .variant-standard,
  .variant-compact {
    grid-column: span 12;
  }

  .masthead h1 {
    font-size: clamp(2.4rem, 15vw, 4.2rem);
  }

  .card-summary,
  .story-summary,
  .story-content {
    font-size: 1rem;
  }
}
