.post-detail.container {
    --post-heading: #282130;
    --post-text: #403849;
    --post-muted: #655b70;
    --post-surface: #fff;
    --post-border: #e5ddea;
    --post-accent: #6c3d88;
    --post-highlight: #f0e8f6;
    --post-tint: #f7f1fa;
    --post-padding: clamp(18px, 3.1vw, 38px);
    width: calc(100% - 2 * clamp(16px, 3.5vw, 44px));
    max-width: 1120px;
    margin-block: 25px 0;
    padding: 0;
}

html[data-bs-theme="dark"] .post-detail {
    --post-heading: #f6f0fa;
    --post-text: #ddd2e5;
    --post-muted: #bcb0c7;
    --post-surface: #22232c;
    --post-border: #42404d;
    --post-accent: #dec1f3;
    --post-highlight: #322840;
    --post-tint: #252132;
}

.post-detail .post-detail__breadcrumb {
    --bs-breadcrumb-divider: "›";
    --bs-breadcrumb-divider-color: var(--post-muted);
    margin-bottom: 18px;
    color: var(--post-muted);
    font-size: .875rem;
}

.post-detail .post-detail__breadcrumb a {
    color: var(--post-muted);
    text-decoration: none;
}

.post-detail .post-detail__breadcrumb a:hover {
    color: var(--post-accent);
    text-decoration: underline;
}

.post-detail__hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: clamp(22px, 4.1vw, 52px);
    padding: var(--post-padding);
    border: 1px solid var(--post-border);
    border-radius: 17px;
    background: linear-gradient(120deg, var(--post-tint), var(--post-surface) 75%);
}

.post-detail__intro {
    min-width: 0;
    max-width: 48rem;
    overflow-wrap: anywhere;
}

.post-detail__topic {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    border-radius: 6px;
    background: var(--post-highlight);
    color: var(--post-accent);
    font-size: .8125rem;
    font-weight: 650;
    text-decoration: none;
}

.post-detail__topic:hover { color: var(--post-accent); text-decoration: underline; }

.site-facelift.public-content .post-detail .post-detail__intro h1 {
    margin: 0 0 14px;
    color: var(--post-heading);
    font-weight: 750 !important;
    letter-spacing: -.042em !important;
    line-height: 1.1 !important;
    text-wrap: balance;
}

.site-facelift.public-content .post-detail .post-detail__topic + h1 { margin-top: 14px; }

.post-detail__lead {
    margin: 0 0 19px;
    color: var(--post-text);
    font-size: 1rem;
    line-height: 1.6;
}

.post-detail__byline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    padding-top: 15px;
    border-top: 1px solid var(--post-border);
}

.post-detail__byline-author {
    display: flex;
    gap: 10px;
    align-items: center;
    color: var(--post-heading);
    font-size: .875rem;
    line-height: 1.35;
    text-decoration: none;
}

.post-detail__byline-author:hover { color: var(--post-accent); }
.post-detail__byline-author strong { display: block; font-weight: 680; }

.post-detail__avatar {
    flex: 0 0 auto;
    border-radius: 50%;
    object-fit: cover;
    background: var(--post-highlight);
}

.post-detail__byline-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 6px;
    color: var(--post-muted);
    font-size: .8125rem;
}

.post-detail__byline-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
}

.post-detail__language { margin-inline-start: auto; }

.post-detail .post-detail__language > .btn {
    min-height: 40px;
    padding: 5px 9px;
    border: 1px solid var(--post-border);
    border-radius: 8px;
    background: var(--post-surface);
    color: var(--post-muted);
    font-size: .8125rem;
    font-weight: 650;
}

.post-detail .post-detail__language > .btn:hover { color: var(--post-accent); }

.post-detail__language .dropdown-item[aria-current] {
    font-weight: 650;
    text-decoration: underline;
    text-underline-offset: .2em;
}

.post-detail__cover { min-width: 0; margin: 0; }

.post-detail__cover > img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 29rem;
    aspect-ratio: auto 3 / 2;
    border-radius: 11px;
    object-fit: contain;
    background: var(--post-tint);
}

.post-detail__cover figcaption,
.post-detail__photo-caption {
    margin-top: 8px;
    color: var(--post-muted);
    font-size: .8125rem;
    overflow-wrap: anywhere;
}

.post-detail__cover figcaption p,
.post-detail__captioned-photo > p,
.post-detail__photo-caption p { margin: 0; }

.post-detail__flow {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 20px;
    margin: 34px var(--post-padding) 0;
}

.post-detail__reading { min-width: 0; }

[data-post-detail]:not(.post-detail--with-contents) .post-detail__reading {
    width: 100%;
    max-width: 44rem;
    margin-inline: auto;
}

.post-detail__text {
    color: var(--post-text);
    font-size: clamp(1rem, 1.4vw, 1.0625rem);
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.post-detail .post-detail__text :is(h2, h3, h4) {
    margin: 1.5em 0 .45em;
    color: var(--post-heading);
    font-weight: 700;
    line-height: 1.24;
    letter-spacing: -.025em;
}

.post-detail .post-detail__text h2 { font-size: clamp(1.35rem, 2.5vw, 1.75rem); }
.post-detail .post-detail__text h3 { font-size: clamp(1.18rem, 2.1vw, 1.375rem); }
.post-detail .post-detail__text h4 { font-size: 1.12rem; }
.post-detail .post-detail__text > :first-child { margin-top: 0; }

.post-detail :is([data-post-lead], .post-detail__text, .post-detail__cover figcaption) a {
    color: var(--post-accent);
    text-decoration: underline;
    text-underline-offset: .17em;
}

.post-detail__text :where(figure, iframe, img, video) { max-width: 100%; }
.post-detail__text :where(img, video) { height: auto; }
.post-detail__text :where(iframe[src*="youtube.com/"], iframe[src*="youtube-nocookie.com/"]) {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
}

.post-detail__text :where(ul, ol) { padding-inline-start: 1.6em; }
.post-detail__text pre, .post-detail__table { max-width: 100%; overflow-x: auto; }
.post-detail__table { margin-bottom: 1rem; }
.post-detail__table > table { margin-bottom: 0; }
.post-detail__text [id], .post-detail__author { scroll-margin-block-start: 24px; }

.post-detail__contents-wide { display: none; }

.post-detail__contents-narrow {
    padding-inline: 13px;
    border: 1px solid var(--post-border);
    border-radius: 9px;
    background: var(--post-surface);
}

.post-detail__contents-narrow summary, .post-detail__contents-label {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--post-heading);
    font-size: .875rem;
    font-weight: 700;
}

.post-detail__contents-narrow summary { min-height: 46px; list-style: none; cursor: pointer; }
.post-detail__contents-narrow summary::-webkit-details-marker { display: none; }
.post-detail__contents-narrow summary:focus-visible { outline: 2px solid var(--post-accent); outline-offset: 2px; }
.post-detail__contents-narrow[open] { padding-bottom: 10px; }
.post-detail__contents-chevron { margin-inline-start: auto; }
.post-detail__contents-narrow[open] .post-detail__contents-chevron { transform: rotate(180deg); }
.post-detail__contents :is(i, svg) { color: var(--post-accent); }
.post-detail__contents-label { margin-bottom: 9px; }
.post-detail__contents ul { margin: 0; padding: 0; list-style: none; }
.post-detail__contents li + li { margin-top: 2px; }

.post-detail .post-detail__contents a {
    display: block;
    padding: 7px 8px;
    border-radius: 6px;
    color: var(--post-muted);
    font-size: .875rem;
    font-weight: 530;
    line-height: 1.4;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.post-detail .post-detail__contents a:is(:hover, [aria-current]) {
    background: var(--post-highlight);
    color: var(--post-accent);
}

.post-detail__author {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-top: 30px;
    padding: 17px;
    border: 1px solid var(--post-border);
    border-radius: 11px;
    background: var(--post-tint);
    overflow-wrap: anywhere;
}

.post-detail__author p { margin: 0; color: var(--post-text); font-size: .875rem; }
.post-detail__author .post-detail__author-label { color: var(--post-accent); font-size: .8125rem; font-weight: 650; }
.post-detail__author h2, .post-detail__related h2 { color: var(--post-heading); font-size: 1rem; font-weight: 700; }
.post-detail__author h2 { margin: 2px 0 4px; }
.post-detail__related { margin-top: 24px; }
.post-detail__related ul { padding: 0; margin: 0; list-style: none; }
.post-detail__related li { border-top: 1px solid var(--post-border); }
.post-detail__related li:last-child { border-bottom: 1px solid var(--post-border); }

.post-detail .post-detail__related a {
    display: flex;
    gap: 14px;
    justify-content: space-between;
    align-items: center;
    min-height: 44px;
    padding-block: 8px;
    color: var(--post-accent);
    font-size: .9375rem;
    font-weight: 600;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.post-detail .post-detail__related a:hover { text-decoration: underline; }

@media (min-width: 768px) {
    .post-detail__hero--with-cover { grid-template-columns: minmax(0, 1fr) minmax(0, 1.06fr); }
}

@media (min-width: 992px) {
    .post-detail--with-contents .post-detail__flow {
        grid-template-columns: minmax(0, 1fr) minmax(12rem, 23%);
        gap: clamp(28px, 6vw, 72px);
    }
    .post-detail--with-contents .post-detail__reading { grid-column: 1; grid-row: 1; }
    .post-detail__contents { grid-column: 2; grid-row: 1; position: sticky; top: 24px; }
    .post-detail__contents-wide { display: block; padding-inline-start: 14px; border-inline-start: 1px solid var(--post-border); }
    .post-detail__contents-narrow { display: none; }
}

@media (max-width: 767.98px) {
    .post-detail.container { --post-padding: 15px; margin-top: 16px; }
    .post-detail .post-detail__breadcrumb { margin-bottom: 13px; }
    .post-detail__hero { gap: 16px; border-radius: 13px; }
    .post-detail__flow { margin: 20px 0 0; }
    .post-detail__byline { padding-top: 12px; }
    .post-detail__cover > img { border-radius: 8px; }
}

@media (pointer: coarse) {
    .post-detail .post-detail__language > .btn, .post-detail .post-detail__contents a { min-height: 44px; }
    .post-detail .post-detail__contents a { display: flex; align-items: center; }
}
