:root {
  color-scheme: light;
  --bg: #fbfdff;
  --wash: #eef5ff;
  --panel: #ffffff;
  --panel-2: #eef5ff;
  --line: #d5e6fb;
  --line-strong: #b4d4ff;
  --box-line: #cfd8df;
  --ink: #102b36;
  --ink-dim: #4f6570;
  --ink-mute: #8296a2;
  --accent: #176b87;
  --accent-2: #86b6f6;
  --accent-3: #b4d4ff;
  --audio-blue-deep: #2459a8;
  --audio-blue: #4f8fea;
  --audio-blue-soft: #b4d4ff;
  --audio-blue-wash: #eef5ff;
  --shadow: 0 18px 42px rgba(23, 107, 135, 0.11);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.58 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.has-lightbox {
  overflow: hidden;
}

main,
section,
article,
div {
  min-width: 0;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--ink);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent-2) 42%, transparent);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}

.pagehead {
  padding: 34px 0 20px;
}

.page-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.eyebrow {
  display: inline-flex;
  padding: 4px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.language-toggle {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
}

.language-toggle button {
  min-width: 38px;
  min-height: 30px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--ink-dim);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
}

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

.top-language-toggle {
  margin-left: 2px;
}

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

.wrap h1,
.wrap h2,
.wrap h3 {
  color: var(--ink);
  letter-spacing: 0;
  line-height: 1.12;
}

.wrap h1 {
  max-width: none;
  margin-bottom: 10px;
  font-size: clamp(34px, 6vw, 48px);
  font-weight: 850;
}

.wrap h2 {
  margin: 0 0 16px;
  color: var(--ink-mute);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.wrap h3 {
  margin-bottom: 6px;
  font-size: 18px;
}

.wrap .lede {
  max-width: 66ch;
  margin-bottom: 8px;
  color: var(--ink-dim);
  font-size: 17px;
  overflow-wrap: break-word;
}

.guide-intro {
  width: 100%;
  max-width: none;
  margin: 18px 0 26px;
}

.guide-intro p {
  margin-bottom: 14px;
  color: var(--ink-dim);
  font-size: 16px;
}

.meta {
  color: var(--ink-mute);
  font-size: 13px;
}

.wrap section {
  padding: 30px 0;
  border-top: 1px solid var(--line);
}

.wrap section:first-child {
  border-top: 0;
}

.guide-list-head {
  padding-bottom: 18px;
}

.guide-controls {
  margin: 0 0 24px;
}

.guide-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--wash) 68%, var(--panel));
  box-shadow: 0 14px 34px rgba(23, 107, 135, 0.08);
}

.entries-section {
  padding-top: 24px;
}

.content-tabs {
  display: inline-flex;
  min-width: 0;
  margin: 0;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
  overflow-x: auto;
  scrollbar-width: none;
}

.content-tabs::-webkit-scrollbar {
  display: none;
}

.content-tabs a {
  display: flex;
  flex: 0 0 auto;
  min-width: 0;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 6px 11px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--ink-dim);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

.content-tabs span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.content-tabs a[aria-current="page"] {
  background: var(--accent);
  color: white;
}

.search-control {
  display: block;
  min-width: 0;
}

.search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

.search-input-wrap svg {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  color: var(--ink-mute);
  pointer-events: none;
}

.search-input-wrap path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.search-control input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  padding: 8px 12px 8px 39px;
}

.search-control input::placeholder {
  color: var(--ink-mute);
}

.search-control input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 30%, transparent);
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-list li {
  display: flex;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.post-list li:last-child {
  border-bottom: 0;
}

.post-thumb {
  display: block;
  flex: 0 0 150px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 0;
  border-radius: 4px;
  background: var(--panel-2);
  padding: 0;
}

.post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: var(--accent);
  font-weight: 800;
}

.post-body {
  flex: 1;
  min-width: 0;
}

.post-title {
  display: inline-block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.22;
}

.post-title:hover {
  color: var(--accent);
}

.post-meta {
  margin: 0 0 6px;
  color: var(--ink-mute);
  font-size: 13px;
}

.post-excerpt {
  margin: 0;
  color: var(--ink-dim);
  font-size: 15px;
}

.detail-head {
  padding-bottom: 18px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--ink-mute);
  font-size: 14px;
}

.breadcrumb a {
  color: var(--ink-dim);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb span[aria-current="page"] {
  color: var(--ink);
}

.detail-story {
  padding-top: 24px;
}

.detail-lead {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: clamp(22px, 5vw, 42px);
  align-items: start;
}

.detail-figure {
  width: min(320px, 100%);
  margin: 0;
}

.detail-image-trigger {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.detail-image-trigger img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 0;
  border-radius: 3px;
  background: var(--panel-2);
  box-shadow: var(--shadow);
}

.detail-figure figcaption {
  width: 100%;
  margin-top: 7px;
  color: var(--ink-mute);
  font-size: 11.5px;
  line-height: 1.35;
}

.detail-figure figcaption a {
  color: var(--ink-mute);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 42px);
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: color-mix(in srgb, var(--ink) 86%, transparent);
  cursor: zoom-out;
}

.lightbox-panel {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  max-width: 1120px;
  max-height: 100%;
  justify-items: center;
  gap: 10px;
  margin: 0;
}

.lightbox-panel img {
  max-width: 100%;
  max-height: calc(100vh - 132px);
  border: 0;
  background: var(--panel);
  box-shadow: 0 22px 68px rgba(0, 0, 0, 0.36);
  object-fit: contain;
}

.lightbox-panel figcaption {
  max-width: 72ch;
  color: color-mix(in srgb, white 86%, var(--accent-3));
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: -15px;
  right: -15px;
  z-index: 2;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 25px;
  line-height: 1;
}

.detail-lead-copy p,
.detail-copy p {
  margin-bottom: 15px;
  color: var(--ink-dim);
}

.detail-lead-copy p:first-child {
  color: var(--ink);
  font-size: 24px;
  line-height: 1.36;
}

.audio-row {
  display: grid;
  grid-template-areas:
    "button title time"
    "progress progress progress";
  grid-template-columns: 36px minmax(0, 1fr) auto;
  column-gap: 12px;
  row-gap: 8px;
  align-items: center;
  min-height: 64px;
  margin: 24px 0 24px;
  padding: 10px;
  border: 1px solid var(--audio-blue-soft);
  border-radius: 3px;
  background: linear-gradient(180deg, var(--audio-blue-wash), color-mix(in srgb, var(--audio-blue-soft) 28%, white));
}

.audio-row audio {
  display: none;
}

.audio-toggle {
  grid-area: button;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--audio-blue-deep);
  border-radius: 50%;
  background: var(--audio-blue-deep);
  color: white;
  cursor: pointer;
}

.audio-toggle:hover {
  background: var(--audio-blue);
  border-color: var(--audio-blue);
}

.play-icon {
  width: 0;
  height: 0;
  margin-left: 2px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid currentColor;
}

.play-icon.is-playing {
  width: 12px;
  height: 12px;
  margin-left: 0;
  border: 0;
  background: linear-gradient(90deg, currentColor 0 4px, transparent 4px 8px, currentColor 8px 12px);
}

.audio-title {
  grid-area: title;
  min-width: 0;
  color: var(--audio-blue-deep);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.audio-progress {
  grid-area: progress;
  width: 100%;
  height: 3px;
  overflow: hidden;
  background: color-mix(in srgb, var(--audio-blue-soft) 58%, white);
}

.audio-progress span {
  display: block;
  inline-size: 0%;
  block-size: 100%;
  background: var(--audio-blue);
}

.audio-time {
  grid-area: time;
  color: var(--audio-blue-deep);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.detail-copy {
  max-width: none;
}

@media (min-width: 760px) {
  .detail-copy {
    column-count: 2;
    column-gap: clamp(22px, 5vw, 42px);
  }

  .detail-copy p {
    break-inside: avoid;
  }
}

.related-busts {
  margin-top: 24px;
  padding: 24px 0 0;
}

.related-busts ul,
.source-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.related-busts li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}

.related-busts li:last-child {
  border-bottom: 0;
}

.related-busts a {
  color: var(--ink);
  font-weight: 750;
}

.related-busts a:hover {
  color: var(--accent);
}

.related-busts span {
  color: var(--ink-mute);
  font-size: 13px;
  white-space: nowrap;
}

.source-list li {
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  color: var(--ink-dim);
  font-size: 14px;
}

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

.empty-state,
.error-state {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink-dim);
}

@media (max-width: 720px) {
  .guide-toolbar {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .content-tabs {
    padding-bottom: 2px;
  }

  .detail-lead {
    grid-template-columns: 1fr;
  }

  .detail-figure {
    width: min(320px, 100%);
  }
}

@media (max-width: 620px) {
  .wrap {
    padding-right: 16px;
    padding-left: 16px;
  }

  .page-tools {
    align-items: flex-start;
  }

  .post-list li {
    flex-direction: column;
    gap: 12px;
  }

  .post-thumb {
    flex-basis: auto;
    width: min(100%, 280px);
  }

  .post-title {
    overflow-wrap: anywhere;
  }

  .lightbox {
    padding: 18px;
  }

  .lightbox-panel img {
    max-height: calc(100vh - 112px);
  }

  .lightbox-close {
    top: 8px;
    right: 8px;
  }
}
