@font-face {
  font-family: "Oswald";
  src: url("assets/oswald.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Work Sans";
  src: url("assets/work-sans.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Literata";
  src: url("assets/literata.ttf") format("truetype");
  font-display: swap;
}

:root {
  --blue: #1646d8;
  --orange: #ff5a36;
  --paper: #f7f6f0;
  --concrete: #dfe1dc;
  --ink: #111318;
  --leaf: #2f6c4f;
  --white: #fff;
  --line: rgba(17, 19, 24, 0.22);
  --sans: "Work Sans", Arial, sans-serif;
  --display: "Oswald", Impact, sans-serif;
  --serif: "Literata", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
}

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

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 4px;
}

.site-header {
  min-height: 102px;
  padding: 18px clamp(22px, 4vw, 64px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 40px;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}

.brand {
  width: max-content;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(2rem, 3.4vw, 3.1rem);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
  text-decoration: none;
}

.brand-mark {
  width: 29px;
  height: 37px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
}

.brand-mark i {
  width: 7px;
  background: var(--blue);
  border-radius: 7px;
}

.brand-mark i:nth-child(1) { height: 15px; }
.brand-mark i:nth-child(2) { height: 36px; }
.brand-mark i:nth-child(3) { height: 24px; background: var(--orange); }

.mission {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
}

.edition {
  justify-self: end;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.5;
}

.intro {
  min-height: 435px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.45fr);
  background: var(--blue);
  color: var(--white);
}

.intro-copy {
  position: relative;
  overflow: hidden;
  padding: clamp(50px, 6.5vw, 94px) clamp(24px, 6.3vw, 92px) 56px;
}

.intro-copy::after {
  content: "";
  position: absolute;
  width: 310px;
  height: 310px;
  right: -92px;
  bottom: -195px;
  border: 32px solid rgba(255,255,255,0.16);
  border-radius: 50%;
}

.intro h1 {
  max-width: 780px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(4.8rem, 8.9vw, 8.4rem);
  font-weight: 570;
  letter-spacing: -0.055em;
  line-height: 0.86;
}

.intro-copy > p {
  max-width: 520px;
  margin: 34px 0 0;
  font-size: clamp(1rem, 1.4vw, 1.22rem);
  line-height: 1.45;
}

.finder {
  padding: 54px clamp(24px, 4.1vw, 60px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  background: var(--orange);
  color: var(--ink);
}

.search-field,
.select-field {
  display: grid;
  gap: 9px;
  font-size: 0.82rem;
  font-weight: 650;
}

.search-wrap,
.select-wrap {
  position: relative;
  display: block;
}

.search-wrap svg {
  position: absolute;
  left: 0;
  top: 50%;
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  transform: translateY(-50%);
}

.search-wrap input,
.select-wrap select {
  width: 100%;
  height: 50px;
  padding: 0 0 0 35px;
  border: 0;
  border-bottom: 2px solid var(--ink);
  border-radius: 0;
  background: transparent;
  font-size: 1rem;
  font-weight: 550;
}

.search-wrap input::placeholder {
  color: rgba(17, 19, 24, 0.62);
}

.select-wrap select {
  padding-left: 0;
  padding-right: 30px;
  appearance: none;
}

.select-wrap svg {
  position: absolute;
  right: 0;
  top: 50%;
  width: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  transform: translateY(-50%);
  pointer-events: none;
}

.saved-toggle {
  min-height: 56px;
  padding: 0 17px;
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 13px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: transparent;
  font-weight: 650;
  text-align: left;
}

.saved-toggle svg,
#save-item svg {
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.saved-toggle[aria-pressed="true"] {
  background: var(--ink);
  color: var(--white);
}

.saved-count {
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.78rem;
}

.story-section {
  padding: 65px clamp(22px, 6.3vw, 92px) 100px;
}

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

.section-heading h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.25rem, 4vw, 4rem);
  font-weight: 560;
  letter-spacing: -0.035em;
  line-height: 1;
}

.section-heading p {
  margin: 0 0 5px;
  font-size: 0.86rem;
  font-weight: 580;
}

.story-list {
  border-top: 1px solid var(--ink);
}

.featured-story {
  min-height: 490px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  border-bottom: 1px solid var(--ink);
}

.featured-image {
  position: relative;
  min-height: 490px;
  overflow: hidden;
  background: var(--concrete);
}

.featured-image img {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  object-fit: cover;
  filter: saturate(0.78) contrast(1.05);
}

.featured-image > span {
  position: absolute;
  left: 16px;
  bottom: 15px;
  padding: 6px 9px;
  background: rgba(247,246,240,0.92);
  font-size: 0.68rem;
  font-weight: 600;
}

.image-route {
  position: absolute;
  top: 25px;
  right: 25px;
  width: 45px;
  height: 112px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background: var(--orange);
}

.image-route::before {
  content: "";
  position: absolute;
  top: 19px;
  bottom: 19px;
  width: 3px;
  background: var(--ink);
}

.image-route i {
  z-index: 1;
  width: 12px;
  height: 12px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--orange);
}

.featured-copy {
  padding: clamp(34px, 4vw, 64px);
  display: flex;
  flex-direction: column;
}

.story-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  font-weight: 630;
}

.story-meta span:not(:last-child)::after {
  content: "/";
  margin-left: 12px;
  color: rgba(17,19,24,.5);
}

.category {
  color: var(--blue);
}

.featured-copy h3 {
  margin: auto 0 20px;
}

.open-item {
  padding: 0;
  border: 0;
  background: transparent;
  font-family: var(--display);
  font-weight: 560;
  text-align: left;
}

.featured-copy .open-item {
  font-size: clamp(2.8rem, 4.3vw, 4.75rem);
  letter-spacing: -0.045em;
  line-height: 1.02;
}

.open-item:hover {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.1em;
}

.featured-copy .summary {
  max-width: 560px;
  margin: 0 0 38px;
  font-size: 1rem;
  line-height: 1.55;
}

.card-foot {
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.78rem;
  font-weight: 620;
}

.story-row {
  min-height: 190px;
  display: grid;
  grid-template-columns: 28px 155px minmax(0, 1fr) 145px;
  gap: clamp(18px, 2.8vw, 42px);
  align-items: stretch;
  border-bottom: 1px solid var(--ink);
}

.pulse {
  position: relative;
  display: flex;
  justify-content: center;
  background: var(--concrete);
}

.pulse::before {
  content: "";
  width: 2px;
  height: 100%;
  background: var(--ink);
}

.pulse i {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  border: 3px solid var(--paper);
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 2px var(--ink);
  transform: translateY(-50%);
}

.row-topic,
.row-end {
  padding: 30px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.74rem;
  font-weight: 620;
}

.row-copy {
  padding: 30px 0;
}

.row-copy h3 {
  margin: 0 0 12px;
}

.row-copy .open-item {
  font-size: clamp(1.65rem, 2.5vw, 2.7rem);
  letter-spacing: -0.035em;
  line-height: 1.07;
}

.row-copy .summary {
  max-width: 660px;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.row-end {
  align-items: flex-end;
  text-align: right;
}

.empty-state {
  min-height: 460px;
  padding: 75px 20px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  text-align: center;
}

.empty-sign {
  width: 108px;
  height: 108px;
  margin: 0 auto 28px;
  padding: 20px;
  display: grid;
  place-items: center;
  border: 7px solid var(--white);
  border-radius: 50%;
  outline: 8px solid var(--orange);
  background: var(--orange);
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}

.empty-state h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 3rem;
  font-weight: 560;
}

.empty-state p {
  margin: 10px 0 25px;
}

.empty-state button,
.close-detail-secondary {
  min-height: 48px;
  padding: 0 20px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  font-weight: 650;
}

footer {
  min-height: 230px;
  padding: 58px clamp(22px, 6.3vw, 92px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 30px;
  background: var(--ink);
  color: var(--white);
}

.footer-brand {
  color: inherit;
  font-family: var(--display);
  font-size: 3.3rem;
  font-weight: 560;
  letter-spacing: -0.045em;
  text-decoration: none;
}

footer p {
  max-width: 290px;
  margin: 0;
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.5;
  text-align: center;
}

#back-to-top {
  justify-self: end;
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 600;
}

#back-to-top span {
  margin-left: 10px;
  color: var(--orange);
  font-size: 1.3rem;
}

.detail-dialog {
  width: min(100%, 1080px);
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  overflow-y: auto;
}

.detail-dialog::backdrop {
  background: rgba(17, 19, 24, 0.72);
}

.detail-topbar {
  min-height: 74px;
  padding: 0 clamp(22px, 5vw, 70px);
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--ink);
  background: rgba(247,246,240,0.97);
}

.detail-brand {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 560;
  letter-spacing: -0.025em;
}

.close-detail {
  min-height: 42px;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 0;
  background: transparent;
  font-weight: 620;
}

.close-detail span:last-child {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--white);
  font-size: 1.4rem;
  font-weight: 400;
  line-height: 1;
}

.detail-header {
  padding: clamp(54px, 8vw, 108px) clamp(24px, 9vw, 124px) 62px;
  background: var(--blue);
  color: var(--white);
}

.detail-meta {
  display: flex;
  gap: 12px;
  font-size: 0.78rem;
  font-weight: 620;
}

.detail-meta span:not(:last-child)::after {
  content: "/";
  margin-left: 12px;
  opacity: .55;
}

.detail-header h1 {
  max-width: 840px;
  margin: 36px 0 28px;
  font-family: var(--display);
  font-size: clamp(4rem, 8vw, 7.3rem);
  font-weight: 560;
  letter-spacing: -0.05em;
  line-height: 0.95;
}

.detail-summary {
  max-width: 660px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.55;
}

.detail-byline {
  margin-top: 54px;
  padding-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid rgba(255,255,255,.45);
  font-size: 0.83rem;
}

.detail-byline p { margin: 0; }

#save-item {
  min-height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 2px solid var(--white);
  background: transparent;
  color: var(--white);
  font-weight: 650;
}

#save-item[aria-pressed="true"] {
  background: var(--white);
  color: var(--blue);
}

#save-item[aria-pressed="true"] svg {
  fill: currentColor;
}

.detail-body-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(55px, 9vw, 105px) 28px;
  display: grid;
  grid-template-columns: 44px minmax(0, 650px);
  gap: clamp(25px, 5vw, 58px);
}

.story-marker {
  height: 210px;
  position: sticky;
  top: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.story-marker::before {
  content: "";
  width: 3px;
  height: 100%;
  position: absolute;
  background: var(--ink);
}

.story-marker span {
  z-index: 1;
  width: 15px;
  height: 15px;
  border: 3px solid var(--paper);
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 2px var(--ink);
}

.detail-body {
  font-family: var(--serif);
  font-size: clamp(1.08rem, 1.6vw, 1.24rem);
  line-height: 1.8;
}

.detail-body p {
  margin: 0 0 1.55em;
}

.detail-body p:first-child::first-letter {
  float: left;
  margin: 0.11em 0.11em 0 0;
  color: var(--blue);
  font-family: var(--display);
  font-size: 4.4em;
  line-height: 0.72;
}

.detail-end {
  min-height: 190px;
  padding: 45px clamp(24px, 9vw, 124px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  border-top: 1px solid var(--ink);
}

.detail-end > span {
  font-family: var(--display);
  font-size: 2.4rem;
  font-weight: 560;
}

body:has(dialog[open]) {
  overflow: hidden;
}

@media (max-width: 820px) {
  .site-header {
    min-height: 84px;
    grid-template-columns: 1fr auto;
    padding: 16px 22px;
  }

  .mission { display: none; }
  .edition span:last-child { display: none; }
  .brand { font-size: 2.35rem; }

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

  .intro-copy {
    min-height: 330px;
    padding: 55px 22px 45px;
  }

  .intro h1 {
    font-size: clamp(4.1rem, 21vw, 6rem);
  }

  .intro-copy > p {
    max-width: 330px;
    margin-top: 28px;
    font-size: 0.97rem;
  }

  .finder {
    padding: 36px 22px 40px;
    gap: 24px;
  }

  .story-section {
    padding: 48px 22px 70px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

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

  .featured-image {
    min-height: 275px;
  }

  .featured-copy {
    min-height: 385px;
    padding: 30px 0;
  }

  .featured-copy h3 {
    margin: 48px 0 16px;
  }

  .featured-copy .open-item {
    font-size: 2.85rem;
  }

  .featured-copy .summary { margin-bottom: 30px; }

  .story-row {
    min-height: 0;
    grid-template-columns: 18px 1fr;
    gap: 18px;
  }

  .pulse { grid-row: 1 / span 3; }

  .row-topic {
    padding: 25px 0 0;
    flex-direction: row;
    justify-content: space-between;
  }

  .row-copy {
    padding: 16px 0 0;
  }

  .row-copy .open-item { font-size: 2rem; }

  .row-end {
    padding: 4px 0 25px;
    flex-direction: row;
    align-items: center;
    text-align: left;
  }

  .row-end .time::after {
    content: "/";
    margin-left: 8px;
  }

  footer {
    min-height: 260px;
    grid-template-columns: 1fr;
    justify-items: start;
  }

  footer p { text-align: left; }
  #back-to-top { justify-self: start; }

  .detail-dialog { width: 100%; }
  .detail-topbar { min-height: 66px; padding: 0 18px; }
  .detail-header { padding: 54px 22px 42px; }
  .detail-header h1 { font-size: clamp(3.55rem, 17vw, 5rem); margin-top: 30px; }
  .detail-meta { flex-wrap: wrap; row-gap: 6px; }
  .detail-byline { align-items: flex-start; flex-direction: column; }
  #save-item { width: 100%; justify-content: center; }
  .detail-body-wrap { grid-template-columns: 18px minmax(0, 1fr); gap: 18px; padding: 55px 22px; }
  .story-marker { height: 170px; }
  .detail-end { align-items: flex-start; flex-direction: column; }
  .close-detail-secondary { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
