:root {
  color-scheme: dark;
  --background: #1e1028;
  --text: #ababd4;
  --primary: #acacd7;
  --accent: #c8ec84;
  --surface: #2b1c37;
  --surface-hover: #352442;
  --quiet: #25172f;
  --line: #6f5d7c;
  --shadow: #140a1c;
  --radius: 6px;
  --section-gap: 58px;
  --duration: 600ms;
}

html {
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-size: 20px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

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

a {
  color: inherit;
}

button, summary {
  cursor: pointer;
}

button {
  color: inherit;
  font-size: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.edition-head, .main-content-frame, .edition-foot {
  width: calc(100% - 80px);
  max-width: 1050px;
  margin-inline: auto;
  padding-inline: 0;
}

.edition-head {
  position: static;
  min-height: 94px;
  border-bottom: 1px dotted var(--line);
}

.brand-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 52px;
}

.read-main {
  justify-self: start;
  color: var(--accent);
  font-size: 14px;
  text-underline-offset: 0.22em;
}

.edition-title {
  text-align: center;
  color: var(--primary);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.navigation-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 41px;
}

.edition-note {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.menu {
  position: absolute;
  top: calc(100% + 1px + var(--section-gap));
  right: 0;
  width: 198px;
}

.nav-switch {
  display: none;
}

.nav-switch, .nav-group > summary {
  list-style: none;
}

.nav-switch::-webkit-details-marker, .nav-group > summary::-webkit-details-marker {
  display: none;
}

#edition-nav, .nav-pages, .post-links ul {
  display: grid;
  gap: 6px;
}

.nav-pages {
  padding: 6px 0 0 12px;
}

.tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--primary);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  text-underline-offset: 0.3em;
}

.nav-pages .tab {
  background: var(--quiet);
  font-weight: 400;
}

.tab[aria-current='page'], .nav-group:has(a[aria-current='page']) > summary {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.nav-group[open] > .nav-pages {
  animation: unfold-nav var(--duration) ease both;
}

.nav-group[open] > summary svg {
  rotate: 180deg;
}

.tab svg, .nav-switch svg, .section-mark svg, .control svg {
  flex: none;
  width: 18px;
  height: 18px;
}

.main-content-frame {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 198px;
  align-items: start;
  column-gap: 36px;
  min-height: 16em;
  margin-block: var(--section-gap);
}

.home-flow {
  display: grid;
  gap: var(--section-gap);
  min-width: 0;
}

#lead-heading {
  color: var(--primary);
  font-size: 56px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.opening {
  padding-bottom: 20px;
  border-bottom: 1px dotted var(--line);
}

.section-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  color: var(--primary);
}

.section-top::after {
  flex: 1;
  min-width: 12px;
  border-top: 1px dotted var(--line);
  content: '';
}

.section-top h2 {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
}

.section-mark {
  display: grid;
  flex: none;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 4px;
  background: var(--accent);
  color: var(--background);
}

.post-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.post {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 38px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 5px 5px 0 var(--shadow);
  color: var(--text);
  text-align: center;
  text-decoration: none;
}

.post-copy {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 0;
}

.post h3, .abstract {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 100%;
}

.post h3 {
  -webkit-line-clamp: 2;
  color: var(--primary);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.18;
}

.abstract {
  -webkit-line-clamp: 3;
  max-width: 44ch;
}

.post-image {
  display: block;
  width: 128px;
  max-width: 100%;
  height: 128px;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  background: var(--quiet);
  object-fit: cover;
}

.text-action {
  display: inline-block;
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.26em;
}

.slider {
  width: 75%;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--quiet);
  box-shadow: 5px 5px 0 var(--shadow);
}

.slide-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  border-radius: 5px 5px 0 0;
  background: var(--surface);
  object-fit: cover;
}

.slide-copy {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 24px;
}

.slide-copy h3 {
  color: var(--primary);
  font-size: 30px;
  font-weight: 500;
  line-height: 1.2;
}

.slide-controls, .slide-dots {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.slide-controls {
  padding: 12px;
  border-top: 1px dotted var(--line);
}

.control {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: var(--surface);
  color: var(--primary);
}

.control[aria-disabled='true'] {
  color: #9383a5;
  cursor: default;
}

.slide-dot {
  width: 28px;
  background: transparent;
}

.slide-dot[aria-current='true'] {
  background: var(--accent);
  color: var(--background);
}

.play-switch {
  margin-inline-start: auto;
}

.reading-grid {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  align-items: start;
  column-gap: 16px;
  min-width: 0;
}

.post-page {
  display: grid;
  grid-column: 2;
  grid-row: 1;
  gap: 28px;
  min-width: 0;
  width: 100%;
  max-width: 600px;
  margin-left: auto;
  margin-right: 0;
}

.post-head {
  display: grid;
  gap: 16px;
}

.location {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 9px;
  font-size: 16px;
}

.location a {
  color: var(--accent);
  text-underline-offset: 0.22em;
}

.location [aria-hidden='true'] {
  font-weight: 700;
}

.post-side {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--quiet);
}

.post-side .section-top {
  margin-bottom: 12px;
}

.post-side .section-top h2 {
  font-size: 18px;
}

.post-side .section-top::after {
  display: none;
}

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

.prose {
  display: flow-root;
  min-width: 0;
  padding-top: 24px;
  border-top: 1px dotted var(--line);
}

.prose > * {
  margin-block: 0;
}

.prose > * + * {
  margin-block-start: 1em;
}

.prose p {
  line-height: 1.4;
}

.prose h2, .prose h3 {
  color: var(--primary);
  font-weight: 600;
  line-height: 1.2;
}

.prose h2 {
  font-size: 1.6em;
}

.prose h3 {
  font-size: 1.25em;
}

.prose a {
  color: var(--accent);
  text-underline-offset: 0.22em;
}

.prose img {
  max-width: 100%;
  height: auto;
}

.prose blockquote {
  margin-inline: 0;
  padding: 18px 22px;
  border-radius: var(--radius);
  background: var(--surface);
}

.prose blockquote > * + * {
  margin-block-start: 0.6em;
}

.prose cite {
  display: block;
  margin-block-start: 8px;
  color: var(--accent);
  font-size: 0.9em;
  font-style: italic;
  font-weight: 400;
}

.prose ul, .prose ol {
  padding-inline-start: 1.6em;
  list-style-type: decimal;
}

.prose li + li {
  margin-block-start: 0.35em;
}

.prose li::marker {
  color: var(--accent);
  font-weight: 600;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  text-align: start;
}

.prose th, .prose td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: start;
}

.prose th {
  color: var(--primary);
  font-weight: 700;
}

.prose caption {
  padding: 0 0 10px;
  color: var(--primary);
  font-weight: 600;
  text-align: start;
}

.edition-foot {
  border-top: 1px dotted var(--line);
}

.credits-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 20px 28px;
  font-size: 14px;
}

.edition-title, .tab, .post, .text-action, .control {
  transition: color var(--duration) ease, background-color var(--duration) ease;
}

@media (hover: hover) {
  .edition-title:hover, .nav-switch:hover, .tab:hover, .read-main:hover {
    color: var(--accent);
  }

  .tab:hover, .post:hover, .control:not([aria-disabled='true']):not([aria-current='true']):hover {
    background-color: var(--surface-hover);
  }

  .control:not([aria-disabled='true']):not([aria-current='true']):hover {
    color: var(--accent);
  }

  .text-action:hover, .post:hover .text-action, .read-main:hover {
    text-decoration-thickness: 2px;
  }
}

@keyframes reveal-items {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes unfold-nav {
  from {
    transform: translateY(-8px);
  }

  to {
    transform: translateY(0);
  }
}

.reveal.is-visible, .slide.is-active {
  animation: reveal-items var(--duration) ease 0ms both;
}

.reveal.is-visible:focus-within {
  animation: none;
}

@media (max-width: 1040px) {
  .reading-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--section-gap);
  }

  .post-page, .post-side {
    grid-column: 1;
    grid-row: auto;
  }

  .post-side {
    width: 100%;
    max-width: 600px;
    margin-inline-start: auto;
  }
}

@media (max-width: 820px) {
  :root {
    --section-gap: 38px;
  }

  body {
    font-size: 16px;
  }

  .edition-head {
    min-height: 68px;
  }

  .brand-row {
    min-height: 34px;
  }

  .read-main {
    font-size: 12px;
  }

  .edition-title {
    font-size: 19px;
  }

  .navigation-row {
    min-height: 33px;
  }

  .edition-note {
    display: none;
  }

  .menu {
    position: static;
    width: 100%;
  }

  .nav-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    width: max-content;
    max-width: 100%;
    margin-inline-start: auto;
    padding: 4px 0 4px 8px;
    color: var(--primary);
    font-weight: 600;
  }

  .menu[open] > #edition-nav {
    padding-block: 6px 12px;
    animation: unfold-nav var(--duration) ease both;
  }

  .main-content-frame {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  #lead-heading {
    font-size: 36px;
  }

  .section-top {
    margin-bottom: 18px;
  }

  .post {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    padding: 20px;
  }

  .post-image {
    grid-row: 1;
    height: auto;
  }

  .post h3, .slide-copy h3 {
    font-size: 24px;
  }

  .slider {
    width: 100%;
  }

  .slide-copy {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  .edition-head, .main-content-frame, .edition-foot {
    width: calc(100% - 40px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal.is-visible, .slide.is-active, .nav-group[open] > .nav-pages, .menu[open] > #edition-nav {
    animation: none;
  }

  .edition-title, .tab, .post, .text-action, .control {
    transition: none;
  }
}

[hidden] {
  display: none;
}

/* Editorial article details */
.article-meta, .post-meta { font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.article-meta a { color: var(--accent); text-underline-offset: .22em; }
.prose .article-cover { display:block; width:100%; aspect-ratio:3/2; height:auto; object-fit:cover; border-radius:4px; }
.prose .medical-note { border-top: 1px dotted var(--line); padding-top: 16px; font-size: .92em; }
.post h3 { display:block; overflow:visible; overflow-wrap:anywhere; }
.slide-image { aspect-ratio:3/2; }
