
/* Featured artwork keeps its intrinsic aspect ratio in every article edition. */
article[data-am-reader] .am-article-image {
    align-self: center;
    min-width: 0;
}
article[data-am-reader] .am-article-image img {
    display: block;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    object-fit: contain;
}
article[data-am-edition=portrait] .am-article-image,
article[data-am-edition=founder] .am-article-image {
    display: grid;
    place-items: center;
    align-self: stretch;
    background: #171613;
}
article[data-am-edition=folio] .am-article-image,
article[data-am-edition=horizon] .am-article-image {
    width: min(1120px, 92%);
}
article[data-am-edition=folio] .am-article-image { margin-top: 24px; }
article[data-am-edition=folio] .am-article-lead:has(.am-article-image) .am-article-head { margin-top: 0; }
article[data-am-edition=case] .am-article-image { width: min(1060px, 92%); }
article[data-am-reader] .am-article-head h1 {
    line-height: 1.04;
    letter-spacing: -.05em;
    overflow-wrap: break-word;
    text-wrap: pretty;
}
article[data-am-edition=brief] .am-article-head h1,
article[data-am-edition=case] .am-article-head h1,
article[data-am-edition=horizon] .am-article-head h1 { font-size: clamp(2.5rem, 4.7vw, 5.3rem); }
article[data-am-edition=founder] .am-article-head h1,
article[data-am-edition=portrait] .am-article-head h1 { font-size: clamp(2.35rem, 3.8vw, 4.7rem); }
.am-article-body img { max-width: 100%; height: auto; }

.am-article-body blockquote,
.am-article-body .wp-block-pullquote,
.am-article-body div[style*="#f7f7f7" i][style*="font-style:italic"] {
    color: var(--paper) !important;
    background: #211e18 !important;
    border-left: 2px solid var(--gold) !important;
    padding: clamp(16px, 3vw, 28px);
}
.am-article-body :is(blockquote, .wp-block-pullquote) :is(p, strong, em, cite) {
    color: inherit !important;
}
.am-article-body blockquote p:last-child { margin-bottom: 0; }

.am-reading-progress {
    position: fixed;
    z-index: 6;
    inset: 0 0 auto;
    height: 3px;
    background: #312a20;
    pointer-events: none;
}
.admin-bar .am-reading-progress { top: 32px; }
.am-reading-progress span {
    display: block;
    height: 100%;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left;
}
.am-reader-grid { width: min(1160px, 92%); margin-inline: auto; }
.am-reader-grid:has(.am-reading-tools:not([hidden])) {
    display: grid;
    grid-template-columns: minmax(170px, .7fr) minmax(0, 2.75fr) minmax(0, .18fr);
    gap: clamp(20px, 4vw, 64px);
}
.am-reader-grid .am-article-body { min-width: 0; width: min(100%, 720px); }
.am-reader-grid.am-reader-elementor { width: min(1360px, 100%); }
.am-reader-grid.am-reader-elementor:has(.am-reading-tools:not([hidden])) { width: min(1360px, 92%); }
.am-elementor-article { min-width: 0; }
.am-reading-tools {
    align-self: start;
    position: sticky;
    top: 56px;
    margin-top: 45px;
    border-block: 1px solid var(--rule);
    padding: 14px 0;
}
.admin-bar .am-reading-tools { top: 83px; }
.am-reading-tools summary { color: var(--gold); cursor: pointer; }
.am-reading-tools ol {
    list-style: none;
    margin: 13px 0;
    padding: 0;
    max-height: min(45vh, 360px);
    overflow: auto;
    scrollbar-width: thin;
}
.am-reading-tools nav a {
    display: block;
    padding: 7px 9px;
    border-left: 1px solid var(--rule);
    font: .83rem/1.4 var(--sans);
    color: var(--muted);
}
.am-reading-tools nav a[aria-current=location] {
    border-left-color: var(--gold);
    background: #d4b2790d;
    color: var(--paper);
}
.am-reading-tools nav a:hover, .am-reading-top:hover { color: var(--gold); }
.am-reading-top { display: inline-block; margin-top: 10px; color: var(--muted); }
[data-am-chapter], #am-story-title { scroll-margin-top: 70px; }
.am-article-body .am-imported-heading {
    margin: 1.65em 0 .55em;
    padding-top: .65em;
    border-top: 1px solid var(--rule);
    color: var(--paper);
    font: clamp(1.65rem, 3vw, 2.45rem)/1.15 var(--serif);
    letter-spacing: -.025em;
}
.am-imported-heading strong, .am-imported-heading b { font-weight: 400; }
.am-read-next { border-top: 1px solid var(--rule); }
.am-read-next .am-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 820px) {
    .am-reader-grid:has(.am-reading-tools:not([hidden])) { display: block; }
    .am-reading-tools, .admin-bar .am-reading-tools { position: static; margin: 25px auto 0; max-width: 720px; }
    .am-reader-grid .am-article-body { margin-top: 30px; }
}
@media (max-width: 782px) { .admin-bar .am-reading-progress { top: 0; } }
@media (max-width: 590px) { .am-read-next .am-grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: no-preference) {
    html { scroll-behavior: smooth; }
    .am-cover-copy, .am-article-head { animation: am-editorial-rise .45s ease-out both; }
    .am-mega { animation: am-menu-settle .18s ease-out both; }
    .am-cover-tabs button, .am-cover-link, .am-nav a, .am-reading-tools nav a {
        transition: color .2s ease, background-color .2s ease, border-color .2s ease;
    }
    .am-reader-reveal { animation: am-editorial-rise .42s ease-out both; }
}
@keyframes am-editorial-rise {
    from { opacity: .62; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes am-editorial-fade {
    from { opacity: .72; }
    to { opacity: 1; }
}
@keyframes am-menu-settle {
    from { transform: translateY(-4px); }
    to { transform: translateY(0); }
}
