/* --------------------------------------------------------------------------
   Field-note article
   One cover composition, one index, one reading column.
   -------------------------------------------------------------------------- */

.article-page,
.article-related {
    --article-paper: var(--al-black);
    --article-surface: var(--al-dark);
    --article-surface-raised: var(--al-gray-900);
    --article-ink: var(--al-gray-50);
    --article-muted: var(--al-gray-300);
    --article-quiet: var(--al-gray-400);
    --article-accent: var(--al-primary);
    background: var(--article-paper);
    color: var(--article-ink);
}

.article-progress {
    position: fixed;
    z-index: 990;
    top: 78px;
    right: 0;
    left: 0;
    height: 3px;
    pointer-events: none;
}

.article-progress > span {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--al-primary);
    transform: scaleX(0);
    transform-origin: left center;
}

.article-masthead {
    display: flex;
    flex-direction: column;
    width: min(1180px, calc(100% - 3rem));
    min-height: 100svh;
    margin: 0 auto;
    padding: clamp(8.5rem, 13vh, 11rem) 0 clamp(3rem, 6vh, 5rem);
}

.article-masthead-copy {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: clamp(1rem, 2vw, 2rem);
    align-items: end;
}

.article-masthead h1 {
    grid-column: 1 / 13;
    margin: 0;
    max-width: none;
    color: var(--article-ink);
    font-family: var(--al-font-display);
    font-size: clamp(3.9rem, 6.6vw, 6.4rem);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 0.94;
    text-wrap: wrap;
}

.article-masthead h1.article-title--long {
    font-size: clamp(3.3rem, 5vw, 4.8rem);
}

.article-masthead h1.article-title--xlong {
    font-size: clamp(2.9rem, 4.2vw, 4.1rem);
}

.article-deck {
    grid-column: 7 / 13;
    margin: clamp(2rem, 4vw, 3.5rem) 0 0;
    color: #c7cec8;
    font-size: clamp(1.08rem, 1.45vw, 1.28rem);
    line-height: 1.55;
    text-wrap: pretty;
}

.article-meta {
    display: grid;
    grid-template-columns: minmax(13rem, 1fr) minmax(18rem, 1.4fr) auto;
    gap: 1.5rem 2rem;
    align-items: center;
    margin-top: clamp(2.25rem, 4vw, 3.5rem);
}

.article-author,
.article-facts,
.article-share {
    min-width: 0;
}

.article-author {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.article-author picture {
    display: contents;
}

.article-author-image {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    object-fit: cover;
}

.article-author-copy {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    color: var(--article-muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.article-author-copy a,
.article-author-copy strong {
    color: var(--article-ink);
    font-size: 0.95rem;
    font-weight: 650;
    text-decoration: none;
}

.article-author-copy a:hover {
    color: var(--article-accent);
}

.article-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 1rem;
    align-items: center;
    color: var(--article-muted);
    font-size: 0.9rem;
}

.article-category {
    color: var(--article-accent);
    font-weight: 650;
}

.article-facts time,
.article-facts > span:not(.article-category) {
    white-space: nowrap;
}

.article-share {
    display: flex;
    gap: 0.85rem;
    align-items: center;
    justify-content: flex-end;
    color: var(--article-muted);
}

.article-share-label {
    font-size: 0.88rem;
}

.article-share a,
.article-share-copy {
    display: inline-grid;
    place-items: center;
    min-width: 1.25rem;
    min-height: 2rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: #b9c2bb;
    cursor: pointer;
    text-decoration: none;
}

.article-share-copy {
    width: auto;
    color: var(--article-ink);
    font: inherit;
    font-size: 0.88rem;
}

.article-share a:hover,
.article-share-copy:hover,
.article-share-copy.is-copied {
    color: var(--article-accent);
}

.article-share svg {
    width: 1.05rem;
    height: 1.05rem;
    fill: currentColor;
}

.article-share a:focus-visible,
.article-share-copy:focus-visible,
.article-author-copy a:focus-visible,
.article-index a:focus-visible,
.article-body a:focus-visible,
.article-contact a:focus-visible,
.article-related-entry:focus-visible {
    outline: 2px solid var(--article-accent);
    outline-offset: 4px;
}

.article-cover {
    position: relative;
    flex: 0 0 auto;
    height: clamp(21rem, 42vh, 34rem);
    margin: clamp(2.5rem, 5vh, 4.25rem) 0 0;
    overflow: hidden;
    background: var(--article-surface);
    clip-path: polygon(0 0, calc(100% - 56px) 0, 100% 56px, 100% 100%, 0 100%);
}

.article-cover picture,
.article-cover > img {
    display: block;
    width: 100%;
    height: 100%;
}

.article-cover-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-cover--contain .article-cover-image {
    padding: clamp(0.75rem, 1.5vw, 1.5rem);
    object-fit: contain;
    object-position: center bottom;
}

.article-index {
    display: grid;
    grid-template-columns: minmax(10rem, 0.32fr) minmax(0, 1fr);
    gap: 2rem;
    width: min(1080px, calc(100% - 3rem));
    margin: clamp(3.5rem, 7vw, 6rem) auto 0;
    padding: clamp(2rem, 4vw, 3rem) clamp(2rem, 4vw, 3.5rem);
    background: var(--article-surface);
    clip-path: polygon(0 0, calc(100% - 42px) 0, 100% 42px, 100% 100%, 0 100%);
}

.article-index > p {
    margin: 0;
    color: var(--article-ink);
    font-family: var(--al-font-display);
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    font-weight: 650;
    line-height: 1.15;
}

.article-index #TableOfContents,
.article-index #TableOfContents > ul {
    margin: 0;
    padding: 0;
}

.article-index #TableOfContents > ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem 2rem;
    list-style: none;
}

.article-index li {
    margin: 0;
    list-style: none;
}

.article-index li ul {
    display: none;
}

.article-index a {
    display: block;
    color: #aeb8b0;
    font-size: 0.94rem;
    line-height: 1.4;
    text-decoration: none;
}

.article-index a:hover,
.article-index a[aria-current="true"] {
    color: var(--article-accent);
}

.article-reading-shell {
    width: min(760px, calc(100% - 3rem));
    margin: 0 auto;
    padding: clamp(4.5rem, 9vw, 8rem) 0 clamp(4rem, 8vw, 7rem);
}

.article-body {
    color: #d5dbd6;
    font-family: var(--al-font-body);
    font-size: clamp(1.02rem, 1.2vw, 1.14rem);
    line-height: 1.82;
}

.article-body > p:first-child {
    color: var(--article-ink);
    font-size: clamp(1.22rem, 1.8vw, 1.48rem);
    line-height: 1.62;
}

.article-body p {
    margin: 0 0 1.55em;
    text-wrap: pretty;
}

.article-body h2,
.article-body h3,
.article-body h4 {
    color: var(--article-ink);
    font-family: var(--al-font-display);
    text-wrap: balance;
    scroll-margin-top: 7rem;
}

.article-body h2 {
    margin: clamp(4.5rem, 9vw, 7rem) 0 1.6rem;
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 680;
    letter-spacing: -0.035em;
    line-height: 1.04;
}

.article-body h3 {
    margin: 3.5rem 0 1.2rem;
    font-size: clamp(1.55rem, 2.5vw, 2.1rem);
    line-height: 1.12;
}

.article-body h4 {
    margin: 2.5rem 0 1rem;
    font-size: 1.3rem;
}

.article-body a {
    color: var(--article-accent);
    text-decoration-color: var(--article-accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

.article-body a:hover {
    color: var(--article-ink);
    text-decoration-color: var(--article-ink);
}

.article-body strong {
    color: var(--article-ink);
    font-weight: 700;
}

.article-body em {
    color: #e1e5e2;
}

.article-body ul,
.article-body ol {
    margin: 1.5rem 0 2rem;
    padding-left: 1.4rem;
}

.article-body li {
    margin: 0.55rem 0;
    padding-left: 0.35rem;
}

.article-body li::marker {
    color: var(--article-accent);
    font-weight: 700;
}

.article-body blockquote {
    margin: 2.75rem 0;
    padding: 1.8rem 2rem;
    background: var(--article-surface);
    color: #e1e6e2;
    font-family: var(--al-font-display);
    font-size: clamp(1.25rem, 2.2vw, 1.7rem);
    line-height: 1.45;
}

.article-body blockquote > :last-child {
    margin-bottom: 0;
}

.article-body table {
    display: block;
    width: 100%;
    margin: 2.5rem 0 3rem;
    overflow-x: auto;
    border-collapse: collapse;
    color: #d7ddd8;
    font-size: 0.94rem;
    line-height: 1.55;
    scrollbar-color: var(--al-gray-700) var(--al-black);
    scrollbar-width: thin;
}

.article-body th,
.article-body td {
    min-width: 13rem;
    padding: 0.95rem 1rem;
    text-align: left;
    vertical-align: top;
    box-shadow: inset 0 -1px rgba(121, 217, 144, 0.16);
}

.article-body th {
    background: var(--article-surface);
    color: var(--article-ink);
    font-weight: 700;
}

.article-body :not(pre) > code {
    padding: 0.12em 0.32em;
    background: var(--article-surface-raised);
    color: var(--article-accent);
    font-family: var(--al-font-data, ui-monospace, SFMono-Regular, Menlo, monospace);
    font-size: 0.88em;
}

.article-body > img,
.article-body > picture,
.article-body > figure {
    display: block;
    max-width: 100%;
    margin: 3rem 0;
}

.article-body img,
.article-body picture img {
    max-width: 100%;
    height: auto;
}

.article-body .blog-gallery {
    border: 0;
    border-radius: 0;
    background: var(--al-black);
    box-shadow: none;
}

.article-body .blog-gallery__track {
    aspect-ratio: 4 / 3;
}

.article-body .blog-gallery__slide {
    display: grid;
    height: 100%;
    min-height: 0;
    margin: 0;
    overflow: hidden;
    aspect-ratio: auto;
}

.article-body .blog-gallery__slide picture,
.article-body .blog-gallery__slide picture img {
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
}

.article-body .blog-gallery__slide picture img {
    object-fit: contain;
}

.article-body .blog-gallery__control,
.article-body .blog-gallery__footer {
    border: 0;
    border-radius: 0;
    background: rgba(5, 8, 5, 0.88);
    backdrop-filter: none;
}

.article-body figcaption {
    margin-top: 0.8rem;
    color: var(--article-quiet);
    font-size: 0.86rem;
    line-height: 1.5;
}

.article-body hr {
    height: 0;
    margin: 5rem 0;
    border: 0;
}

.article-body .footnotes {
    margin-top: 5rem;
    color: var(--article-muted);
    font-size: 0.9rem;
}

.article-body .footnotes ol {
    padding-left: 1.2rem;
}

.article-body .footnote-backref {
    margin-left: 0.25rem;
    color: var(--article-accent);
    text-decoration: none;
}

.mermaid-wrapper {
    width: min(940px, calc(100vw - 2rem));
    margin: 3rem 50%;
    padding: clamp(1rem, 2.5vw, 2rem);
    overflow-x: auto;
    background: var(--al-black);
    transform: translateX(-50%);
    scrollbar-color: var(--al-gray-700) var(--al-black);
    scrollbar-width: thin;
}

.article-body table::-webkit-scrollbar,
.mermaid-wrapper::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

.article-body table::-webkit-scrollbar-track,
.mermaid-wrapper::-webkit-scrollbar-track {
    background: var(--al-black);
}

.article-body table::-webkit-scrollbar-thumb,
.mermaid-wrapper::-webkit-scrollbar-thumb {
    background: var(--al-gray-700);
}

.mermaid-wrapper .mermaid {
    min-width: 42rem;
    margin: 0;
    padding: 0;
    background: transparent;
    text-align: center;
}

.mermaid-wrapper svg {
    display: block;
    width: 100%;
    min-height: 220px;
    margin: 0 auto;
}

.article-body table:focus-visible,
.mermaid-wrapper:focus-visible {
    outline: 2px solid var(--article-accent);
    outline-offset: 4px;
}

.article-end {
    margin-top: clamp(4.5rem, 9vw, 7rem);
}

.article-filing {
    margin: 0;
    color: var(--article-quiet);
    font-size: 0.9rem;
    line-height: 1.7;
}

.article-filing > span {
    margin-right: 0.45rem;
    color: var(--article-muted);
    font-weight: 650;
}

.article-filing em {
    color: #b5beb7;
    font-style: normal;
}

.article-contact {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.5rem 2rem;
    align-items: center;
    margin-top: 3.5rem;
    padding: 2.25rem 2.5rem;
    background: var(--article-surface);
}

.article-contact p {
    margin: 0;
    color: var(--article-ink);
    font-family: var(--al-font-display);
    font-size: clamp(1.35rem, 2.4vw, 1.8rem);
    font-weight: 650;
    line-height: 1.2;
    text-wrap: balance;
}

.article-contact .al-btn {
    justify-self: end;
}

.article-related-arrow {
    width: 1.15rem;
    height: 1.15rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: square;
    stroke-linejoin: miter;
    stroke-width: 1.6;
}

.article-related-entry:hover .article-related-arrow {
    transform: translate(2px, -2px);
}

.article-related-arrow {
    transition: transform 150ms ease;
}

.article-related {
    padding: clamp(4rem, 8vw, 7rem) 0 clamp(5rem, 9vw, 8rem);
}

.article-related-inner {
    width: min(1080px, calc(100% - 3rem));
    margin: 0 auto;
}

.article-related h2 {
    margin: 0 0 clamp(2.5rem, 5vw, 4rem);
    color: var(--article-ink);
    font-family: var(--al-font-display);
    font-size: clamp(2.4rem, 5vw, 4.4rem);
    font-weight: 680;
    letter-spacing: -0.04em;
    line-height: 1;
}

.article-related-list {
    display: grid;
    gap: clamp(2rem, 4vw, 3.5rem);
}

.article-related-entry {
    display: grid;
    grid-template-columns: clamp(9rem, 18vw, 13rem) minmax(0, 1fr) auto;
    gap: clamp(1.25rem, 3vw, 2.5rem);
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.article-related-image {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--article-surface);
    clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 0 100%);
}

.article-related-image picture,
.article-related-image img {
    display: block;
    width: 100%;
    height: 100%;
}

.article-related-image img {
    object-fit: cover;
    filter: saturate(0.82) brightness(0.88);
    transition: filter 180ms ease;
}

.article-related-image--contain img {
    padding: 1rem;
    object-fit: contain;
}

.article-related-entry:hover .article-related-image img {
    filter: saturate(1) brightness(1);
}

.article-related-copy {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.article-related-meta {
    display: flex;
    gap: 0.55rem;
    align-items: center;
    color: var(--article-quiet);
    font-size: 0.82rem;
}

.article-related-meta b {
    color: var(--article-accent);
    font-weight: 400;
}

.article-related-copy strong {
    color: var(--article-ink);
    font-family: var(--al-font-display);
    font-size: clamp(1.45rem, 2.5vw, 2rem);
    font-weight: 650;
    line-height: 1.08;
    text-wrap: balance;
}

.article-related-copy > span:last-child {
    max-width: 64ch;
    color: var(--article-muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.article-related-arrow {
    color: var(--article-accent);
}

@media (max-width: 768px) {
    .article-progress {
        top: 69px;
    }
}

@media (max-width: 900px) {
    .article-masthead {
        width: min(760px, calc(100% - 2.5rem));
        padding-top: 7.5rem;
    }

    .article-masthead h1 {
        grid-column: 1 / 13;
        font-size: clamp(3rem, 9.5vw, 5rem);
    }

    .article-deck {
        grid-column: 3 / 13;
    }

    .article-meta {
        grid-template-columns: 1fr 1fr;
    }

    .article-share {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .article-index,
    .article-related-inner {
        width: min(760px, calc(100% - 2.5rem));
    }

    .article-index {
        grid-template-columns: 1fr;
    }

    .article-reading-shell {
        width: min(720px, calc(100% - 2.5rem));
    }
}

@media (max-width: 640px) {
    .article-masthead {
        width: calc(100% - 2rem);
        min-height: 100svh;
        padding-top: 6.75rem;
        padding-bottom: 2.5rem;
    }

    .article-masthead h1 {
        font-size: clamp(1.55rem, 8.1vw, 2.5rem);
        line-height: 0.98;
    }

    .article-masthead h1.article-title--long {
        font-size: clamp(1.45rem, 7vw, 2.1rem);
    }

    .article-masthead h1.article-title--xlong {
        font-size: clamp(1.3rem, 5.6vw, 1.8rem);
    }

    .article-deck {
        grid-column: 1 / 13;
        margin-top: 1.5rem;
        font-size: 1rem;
    }

    .article-meta {
        grid-template-columns: 1fr;
        gap: 1.15rem;
        margin-top: 2rem;
    }

    .article-facts {
        gap: 0.35rem 0.8rem;
    }

    .article-share {
        grid-column: auto;
    }

    .article-cover {
        height: clamp(15rem, 38vh, 20rem);
        margin-top: 2rem;
        clip-path: polygon(0 0, calc(100% - 30px) 0, 100% 30px, 100% 100%, 0 100%);
    }

    .article-cover--contain .article-cover-image {
        padding: 1rem;
    }

    .article-index,
    .article-reading-shell,
    .article-related-inner {
        width: calc(100% - 2rem);
    }

    .article-index {
        margin-top: 3rem;
        padding: 1.75rem 2.25rem 1.75rem 1.5rem;
        clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 0 100%);
    }

    .article-index #TableOfContents > ul {
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }

    .article-reading-shell {
        padding-top: 4rem;
    }

    .article-body {
        font-size: 1rem;
        line-height: 1.75;
    }

    .article-body h2 {
        margin-top: 4rem;
        font-size: clamp(1.9rem, 9vw, 2.6rem);
    }

    .article-body .blog-gallery__track {
        aspect-ratio: 4 / 5;
    }

    .article-body table {
        width: calc(100vw - 2rem);
        margin-right: 50%;
        margin-left: 50%;
        transform: translateX(-50%);
    }

    .article-body th,
    .article-body td {
        min-width: 12rem;
    }

    .mermaid-wrapper {
        width: calc(100vw - 1rem);
        padding: 1rem 0.5rem;
    }

    .article-contact {
        grid-template-columns: 1fr;
        padding: 1.75rem;
    }

    .article-contact .al-btn {
        justify-self: stretch;
        white-space: normal;
    }

    .article-related-entry {
        grid-template-columns: 6.5rem minmax(0, 1fr);
        align-items: start;
    }

    .article-related-arrow {
        display: none;
    }

    .article-related-copy > span:last-child {
        display: none;
    }

    .article-related-copy strong {
        font-size: 1.35rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .article-related-arrow,
    .article-related-image img {
        transition: none;
    }
}
