:root {
    --background: #f8d7e0;
    --paper: #fce9ef;
    --text: #2c1d32;
    --primary: #4e1a62;
    --accent: #9c210f;
    --muted: #684b64;
    --line: #c6a4b3;
    --soft: #efc7d3;
}

html {
    box-sizing: border-box;
    scroll-behavior: smooth;
}

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

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-size: 18px;
    font-weight: 400;
    line-height: 1.5;
    overflow-wrap: break-word;
}

button {
    color: inherit;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
}

a {
    color: var(--primary);
    text-underline-offset: 4px;
}

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

svg {
    display: block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

strong,
b {
    font-weight: 700;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 4px;
}

.main-frame {
    width: calc(100% - 60px);
    max-width: 1128px;
    margin-inline: auto;
    padding-inline: 0;
}

.top-band {
    position: static;
    width: 100%;
    padding-inline: 0;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
}

.top-band > .band-content {
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.to-main {
    position: absolute;
    z-index: 10;
    inset-block-start: 12px;
    inset-inline-start: 30px;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.to-main:focus {
    width: auto;
    height: auto;
    padding: 10px 16px;
    overflow: visible;
    clip-path: none;
    background: var(--primary);
    color: var(--paper);
}

.site-link {
    display: inline-flex;
    min-width: 0;
    max-width: 100%;
    color: var(--primary);
    text-decoration: none;
}

.site-name {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.035em;
    overflow-wrap: anywhere;
}

.nav-list {
    display: flex;
    margin: 0;
    padding: 0;
    align-items: center;
    gap: 10px;
    list-style: none;
}

.nav-list > li {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

.nav-list a {
    display: block;
    padding: 8px 12px;
    border: 1px solid transparent;
    background: var(--background);
    color: var(--primary);
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
}

.nav-list a[aria-current="page"] {
    color: var(--accent);
}

.nav-divider {
    color: var(--accent);
}

.nav-trigger,
.nav-close {
    width: 44px;
    height: 44px;
    padding: 0;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--primary);
    border-radius: 0;
    background: var(--primary);
    color: var(--paper);
}

.nav-trigger {
    display: none;
}

.nav-close {
    display: inline-flex;
}

.nav-dialog {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(380px, calc(100% - 20px));
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0 0 0 auto;
    padding: 24px;
    overflow-y: auto;
    border: 1px solid var(--primary);
    border-right: 0;
    border-radius: 0;
    background: var(--paper);
    color: var(--text);
}

.nav-dialog::backdrop {
    background: rgb(44 29 50 / 42%);
}

html:has(dialog:modal) {
    overflow: hidden;
}

.nav-head {
    display: flex;
    margin-block-end: 24px;
    padding-block-end: 18px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--line);
}

.nav-head h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 500;
    line-height: 1.3;
}

.home-main {
    display: grid;
    padding-block: 40px 48px;
    gap: 48px;
}

.welcome h1,
.entry-page h1 {
    margin: 0;
    font-size: 40px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.035em;
    overflow-wrap: anywhere;
}

.welcome h1 {
    max-width: 820px;
}

.welcome p {
    max-width: 740px;
    margin: 18px 0 0;
    color: var(--muted);
}

.feature-slider {
    min-width: 0;
    max-width: 100%;
    border: 1px solid var(--line);
    background: var(--paper);
}

.slide-stage {
    min-width: 0;
}

.slide-picture {
    margin: 0;
    border-bottom: 1px solid var(--line);
    background: var(--soft);
}

.slide-picture img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    mix-blend-mode: multiply;
}

.slide-copy {
    padding: 24px;
}

.slide-caption {
    margin: 0 0 12px;
    color: var(--accent);
    font-size: 16px;
    font-weight: 500;
}

.slide-copy h2 {
    margin: 0;
    font-size: 32px;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: -0.025em;
    overflow-wrap: anywhere;
}

.slide-description {
    max-width: 760px;
    margin: 16px 0 20px;
    color: var(--muted);
}

.solid-link {
    display: inline-flex;
    max-width: 100%;
    min-height: 44px;
    padding: 10px 18px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: var(--paper);
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
}

.slider-tools {
    display: flex;
    padding: 0 18px 12px;
    justify-content: flex-end;
}

.slide-switches {
    display: flex;
    max-width: 100%;
    align-items: center;
    gap: 6px;
}

.slide-step {
    display: inline-flex;
    width: 40px;
    min-height: 44px;
    padding: 8px 0;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.segment-bar {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--line);
}

.slide-step[aria-pressed="true"] .segment-bar {
    background: var(--accent);
}

.slide.is-active {
    animation: enter-items 150ms ease both;
}

.slide[hidden],
.slide-switches[hidden] {
    display: none;
}

.section-top {
    display: flex;
    margin-block-end: 24px;
    align-items: center;
    gap: 14px;
}

.section-top h2,
.topics h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: -0.025em;
}

.symbol-box {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--primary);
}

.entry-list {
    display: grid;
    margin: 0;
    padding: 0;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    list-style: none;
}

.entry-list > li {
    min-width: 0;
}

.entry {
    display: grid;
    min-width: 0;
    max-width: 100%;
    padding: 18px;
    grid-template-columns: 190px minmax(0, 1fr);
    align-items: center;
    gap: 24px;
    border: 1px solid var(--line);
    background: var(--paper);
    color: var(--text);
    text-decoration: none;
}

.entry-preview {
    width: auto;
    height: var(--preview-height, 190px);
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: var(--soft);
}

.entry-copy {
    min-width: 0;
}

.entry-meta {
    display: flex;
    margin-block-end: 12px;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 16px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.5;
}

.entry-label {
    color: var(--accent);
    font-weight: 500;
}

.read-length {
    white-space: nowrap;
}

.entry h3 {
    margin: 0;
    overflow: hidden;
    color: var(--primary);
    font-size: 20px;
    font-weight: 500;
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.entry-list > li:nth-child(even) .entry {
    grid-template-columns: minmax(0, 1fr) 190px;
}

.entry-list > li:nth-child(even) .entry-preview {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
}

.entry-list > li:nth-child(even) .entry-copy {
    grid-column: 1;
    grid-row: 1;
}

.entry-list > li:nth-child(2) {
    --preview-height: 164px;
}

.entry-list > li:nth-child(3) {
    --preview-height: 178px;
}

.topics {
    display: grid;
    padding-block: 24px;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.topic-info {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    gap: 16px;
}

.topic-text {
    min-width: 0;
}

.topic-text > .entry-label {
    font-size: 20px;
}

.topic-text p {
    margin: 10px 0 0;
    color: var(--muted);
}

.article-main {
    padding-block: 40px 48px;
}

.reading-grid {
    display: grid;
    width: 100%;
    max-width: 966px;
    margin-left: auto;
    grid-template-columns: 302px minmax(0, 1fr);
    align-items: start;
    gap: 24px;
}

.entry-page {
    width: 100%;
    min-width: 0;
    max-width: 640px;
    margin-left: auto;
    margin-right: 0;
    grid-column: 2;
    grid-row: 1;
}

.path-links {
    margin-block-end: 24px;
    color: var(--muted);
    font-size: 16px;
}

.path-links ol {
    display: flex;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
    list-style: none;
}

.path-links li {
    display: inline-flex;
    min-width: 0;
    align-items: baseline;
    gap: 10px;
}

.path-links [aria-current="page"] {
    overflow-wrap: anywhere;
}

.entry-heading {
    margin-block-end: 24px;
}

.page-picture {
    width: 100%;
    height: auto;
    margin-block: 0 24px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: var(--soft);
}

.entry-page > p {
    margin: 0 0 20px;
}

.entry-page > h2 {
    margin: 32px 0 16px;
    color: var(--primary);
    font-size: 26px;
    font-weight: 500;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.entry-page > h3 {
    margin: 24px 0 14px;
    font-size: 22px;
    font-weight: 500;
    line-height: 1.4;
}

.entry-page > ul,
.entry-page > ol {
    margin: 20px 0;
    padding-inline-start: 24px;
}

.entry-page > ul {
    list-style-type: disc;
}

.entry-page > ul li + li,
.entry-page > ol li + li {
    margin-block-start: 8px;
}

.entry-page > ul li::marker {
    color: var(--accent);
}

.entry-page blockquote {
    margin: 24px 0;
    padding: 18px;
    border-left: 3px solid var(--accent);
    background: var(--paper);
    color: var(--primary);
    font-style: italic;
}

.entry-page blockquote::before {
    display: block;
    margin-block-end: 10px;
    content: "“";
    color: var(--accent);
    font-size: 58px;
    font-style: normal;
    line-height: 1;
}

.entry-page blockquote p {
    margin: 0;
}

.entry-page blockquote p + p {
    margin-block-start: 16px;
}

.entry-page blockquote cite {
    display: block;
    margin-block-start: 12px;
    color: var(--muted);
    font-size: 16px;
    font-style: normal;
}

.entry-page > [tabindex="0"] {
    margin-block: 24px;
}

.entry-page table {
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
    font-size: 16px;
    line-height: 1.5;
    text-align: left;
}

.entry-page th,
.entry-page td {
    padding: 12px;
    border: 1px solid var(--line);
    vertical-align: top;
}

.entry-page th {
    background: var(--paper);
    color: var(--primary);
    font-weight: 600;
}

.entry-page caption {
    padding-block-end: 12px;
    color: var(--muted);
    text-align: left;
}

.entry-page > :last-child {
    margin-block-end: 0;
}

.reading-aside {
    min-width: 0;
    padding: 18px;
    grid-column: 1;
    grid-row: 1;
    border: 1px solid var(--line);
    background: var(--paper);
}

.reading-aside h2 {
    margin: 20px 0 12px;
    color: var(--primary);
    font-size: 24px;
    font-weight: 500;
    line-height: 1.3;
}

.reading-aside p {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 16px;
}

.aside-topic {
    margin-block: 24px;
    padding-block-start: 18px;
    border-top: 1px solid var(--line);
}

.aside-topic p {
    margin-block-end: 8px;
}

.aside-link {
    display: inline-block;
    padding-block: 8px;
    font-size: 16px;
    font-weight: 500;
}

.bottom-band {
    width: 100%;
    padding-inline: 0;
    border-top: 1px solid var(--primary);
    background: var(--primary);
    color: var(--paper);
}

.bottom-band > .band-content {
    display: flex;
    padding-block: 24px;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px 24px;
}

.bottom-band p {
    margin: 0;
    font-size: 16px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.welcome,
.feature-slider,
.entry,
.topics,
.reading-grid {
    animation: enter-items 150ms ease 150ms both;
}

@keyframes enter-items {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@media (max-width: 906px) {
    body {
        font-size: 16px;
    }

    .top-band > .band-content {
        padding-block: 12px;
        flex-wrap: wrap;
        gap: 12px;
    }

    #site-nav {
        width: 100%;
    }

    .nav-list {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .nav-list > li {
        display: block;
    }

    .nav-list a {
        width: 100%;
        padding: 12px;
    }

    .nav-divider {
        display: none;
    }

    .menu-ready .nav-trigger {
        display: inline-flex;
        margin-inline-start: auto;
    }

    .menu-ready .top-band > .band-content > #site-nav {
        display: none;
    }

    .home-main {
        padding-block-start: 32px;
    }

    .welcome h1,
    .entry-page h1 {
        font-size: 34px;
    }

    .slide-copy h2 {
        font-size: 26px;
    }

    .entry,
    .entry-list > li:nth-child(even) .entry {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .entry-preview,
    .entry-list > li:nth-child(even) .entry-preview {
        width: 100%;
        height: auto;
        grid-column: 1;
        grid-row: 1;
        justify-self: stretch;
    }

    .entry-copy,
    .entry-list > li:nth-child(even) .entry-copy {
        grid-column: 1;
        grid-row: 2;
    }

    .topics {
        grid-template-columns: minmax(0, 1fr);
    }

    .article-main {
        padding-block-start: 32px;
    }

    .reading-grid {
        max-width: 640px;
        grid-template-columns: minmax(0, 1fr);
        gap: 48px;
    }

    .entry-page {
        grid-column: 1;
        grid-row: 1;
    }

    .reading-aside {
        grid-column: 1;
        grid-row: 2;
    }

    .bottom-band > .band-content {
        align-items: flex-start;
        flex-direction: column;
    }
}

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

    .to-main {
        inset-inline-start: 20px;
    }

    .site-name {
        font-size: 18px;
    }

    .welcome h1,
    .entry-page h1 {
        font-size: 30px;
    }

    .slide-copy {
        padding: 18px;
    }

    .slide-copy h2 {
        font-size: 24px;
    }

    .section-top h2,
    .topics h2 {
        font-size: 24px;
    }

    .entry-page > h2 {
        font-size: 24px;
    }
}

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

    .welcome,
    .feature-slider,
    .entry,
    .topics,
    .reading-grid,
    .slide.is-active {
        animation: none;
    }
}

/* Editorial covers and medical article note */
.slide-picture img, .page-picture {aspect-ratio: 3 / 2;}
.medical-disclaimer {margin-top: 32px !important; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .92em;}
