:root {
    --nav-feedback: #d9e2e5;
    --link-default: #a34f35;
    --contact-success: #286647;
    --contact-error: #9c382e;
    --link-visited: #76556e;
    --link-active: #b43b25;
    --footer-bg: #1e3a8a;
    --footer-ink: #faf9f6;
    --footer-muted: #d9dfed;
    --footer-line: rgb(250 249 246 / 22%);
    --footer-hover: rgb(250 249 246 / 12%);
}

:root[data-appearance="dark"] {
    --nav-feedback: #293d4a;
    --link-default: #e8a18a;
    --contact-success: #9cd3b0;
    --contact-error: #f2a69c;
    --link-visited: #c6adc1;
    --link-active: #ff9b85;
    --footer-bg: #14264d;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-appearance="light"]) {
        --nav-feedback: #293d4a;
        --link-default: #e8a18a;
        --contact-success: #9cd3b0;
        --contact-error: #f2a69c;
        --link-visited: #c6adc1;
        --link-active: #ff9b85;
        --footer-bg: #14264d;
    }
}

.author-line {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
}

.author-line .author-portrait {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 30%;
}

.article-language { justify-self: end; text-align: right; }
.author-line :is(a[rel="author"], .article-language) {
    color: var(--link-default);
    text-decoration: none;
    text-underline-offset: 4px;
}
.author-line :is(a[rel="author"], .article-language):visited { color: var(--link-visited); }
.author-line :is(a[rel="author"], .article-language):hover {
    color: var(--link-default);
    text-decoration: underline;
}
.author-line :is(a[rel="author"], .article-language):focus-visible {
    color: var(--link-default);
    outline: 3px solid var(--link-default);
    outline-offset: 4px;
}
.author-line :is(a[rel="author"], .article-language):active { color: var(--link-active); }
.article-contents nav a { padding-inline: 12px; border-radius: 3px; }
.article-contents nav a:is(:hover, :focus-visible) { background: var(--nav-feedback); color: var(--text); }
.article-contents nav a[aria-current="location"] { color: var(--accent); }

.related-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
    .related-grid { grid-template-columns: minmax(0, 1fr); }
    .author-line { grid-template-columns: 42px minmax(0, 1fr); }
    .article-language { grid-column: 1 / -1; }
}

.spj-header { position: relative; justify-content: space-between; gap: 20px; min-height: 112px; padding-block: 24px; }
.spj-header .spj-brand { padding: 8px; margin: -8px 0 -8px -8px; border-radius: 4px; }
.spj-header .spj-brand:is(:hover, :active) {
    background: var(--nav-feedback);
    color: var(--text);
    text-decoration: none;
}
.spj-brand small { display: block; color: var(--muted); font-size: 13px; }
.spj-header nav { gap: 4px; }
.spj-header nav a { padding: 10px 12px; border-radius: 3px; }
.spj-header nav a:is(:hover, :focus-visible),
.spj-nav-dropdown summary:is(:hover, :focus-visible) { background: var(--nav-feedback); color: var(--text); }
.spj-header-tools, .spj-nav-group { display: flex; align-items: center; gap: 4px; }
.spj-header-tools :is(summary, button), .spj-nav-dropdown summary {
    display: grid;
    place-items: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    list-style: none;
}
.spj-header summary::-webkit-details-marker { display: none; }
.spj-header-tools svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.spj-header-tools .spj-language { padding-inline: 8px; gap: 3px; }
.spj-language span { color: var(--muted); }
.spj-header .spj-menu-toggle { display: none; }
.spj-nav-dropdown { position: relative; }
.spj-nav-dropdown summary { min-width: 24px; }
.spj-nav-dropdown > div, .spj-header-search form {
    position: absolute;
    z-index: 3;
    background: var(--background);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 12px;
}
.spj-nav-dropdown > div { min-width: 170px; }
.spj-nav-dropdown a { display: flex; }
.spj-header-search form { right: 0; width: min(320px, 100%); }
.spj-header-search label, .spj-header-search input { display: block; width: 100%; }
.spj-header-search input { margin-block: 8px; padding: 8px; min-height: 44px; font: inherit; }
.spj-header-search form button { display: inline-flex; padding-inline: 12px; border: 1px solid var(--control); }

.spj-footer {
    display: block;
    margin-inline: -32px;
    padding: 32px 32px 24px;
    background: var(--footer-bg);
    box-shadow: 0 0 0 100vmax var(--footer-bg);
    clip-path: inset(0 -100vmax);
    color: var(--footer-muted);
    border: 0;
    font-size: 12px;
}
.spj-footer-top, .spj-footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
}
.spj-footer-top { padding-bottom: 24px; }
.spj-footer-bottom { border-top: 1px solid var(--footer-line); padding-top: 16px; }
.spj-footer-brand { gap: 16px; padding: 8px; margin-inline-start: -8px; }
.spj-footer-brand img { width: 34px; height: 44px; filter: invert(1); }
.spj-footer-brand strong { display: block; font: 500 20px/1.35 'Playfair Display', Georgia, serif; }
.spj-footer-brand small { display: block; color: var(--footer-muted); font-size: 11px; }
.spj-footer a { color: var(--footer-ink); border-radius: 3px; }
.spj-footer a:is(:hover, :active) { background: var(--footer-hover); color: var(--footer-ink); }
.spj-footer a:focus-visible { outline-color: var(--footer-ink); }
.spj-footer-tools { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.spj-footer-tools fieldset { border: 0; padding: 0; margin: 0; }
.spj-footer-label { display: block; font-size: 11px; padding: 0 0 8px; }
.spj-segments { display: flex; gap: 2px; padding: 3px; border: 1px solid var(--footer-line); border-radius: 4px; }
.spj-segments :is(a, .spj-segment-active, label span) {
    display: grid;
    place-items: center;
    min-height: 44px;
    min-width: 44px;
    padding: 8px 12px;
    border-radius: 2px;
    color: var(--footer-ink);
}
.spj-segments label { position: relative; cursor: pointer; margin: 0; }
.spj-segments input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.spj-segments :is(.spj-segment-active, input:checked + span) {
    background: var(--footer-ink);
    color: var(--footer-bg);
    font-weight: 600;
}
.spj-segments input:focus-visible + span { outline: 3px solid var(--footer-ink); outline-offset: 3px; }
.spj-footer-action { min-height: 52px !important; padding: 10px 16px; border: 1px solid var(--footer-line); }
.spj-footer-bottom nav { gap: 8px; }
.spj-footer-bottom nav a { padding: 8px 12px; }
.spj-footer-bottom p { font-size: 11px; }

@media (max-width: 800px) {
    .spj-header { gap: 10px; flex-wrap: nowrap; min-height: 88px; padding-block: 16px; }
    .spj-header .spj-brand { width: auto; min-width: 0; margin-right: auto; }
    .spj-brand strong { font-size: 19px; }
    .spj-brand small { font-size: 10px; }
    .spj-header-tools { flex-shrink: 0; }
    .spj-header-tools .spj-language { min-width: 44px; justify-content: center; padding-inline: 4px; }
    .spj-header .spj-menu-toggle:not([hidden]) { display: grid; }
    .spj-header:has(.spj-menu-toggle:not([hidden])) #spj-navigation {
        position: absolute;
        inset: 100% 0 auto;
        z-index: 2;
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        background: var(--background);
        border-bottom: 1px solid var(--control);
    }
    .spj-header:not(:has(.spj-menu-toggle:not([hidden]))) { flex-wrap: wrap; }
    .spj-nav-dropdown > div { position: static; }
    .spj-footer { margin-inline: -20px; padding: 28px 20px 24px; }
    .spj-footer-top, .spj-footer-bottom { align-items: flex-start; flex-direction: column; gap: 16px; }
}

@media (max-width: 360px) {
    .spj-header#site-top { flex-wrap: wrap; }
    .spj-header .spj-brand { flex-basis: 100%; }
    .spj-header-tools { margin-left: auto; }
}

.article-header h1, .article-body h2, .related-writing h2, .discovery-card h3 {
    font-weight: 500;
}

.spj-header .spj-brand strong { font-weight: 500; }
@media (min-width: 801px) { .spj-header .spj-brand strong { font-size: 22px; } }

.article-body :is(p, li) a, .back-link {
    color: var(--link-default);
    text-underline-offset: 4px;
}
.article-body :is(p, li) a { text-decoration: underline; }
.article-body :is(p, li) a:visited, .back-link:visited { color: var(--link-visited); }
.article-body :is(p, li) a:hover { text-decoration-thickness: 2px; }
.back-link:hover { text-decoration: underline; }
.article-body :is(p, li) a:focus-visible, .back-link:focus-visible {
    outline: 3px solid var(--link-default);
    outline-offset: 4px;
}
.article-body :is(p, li) a:active, .back-link:active { color: var(--link-active); }

.related-grid { gap: 32px; }
.related-grid .discovery-card h3 { font-size: 28px; line-height: 1.25; }
.discovery-card:is(:hover, :focus-visible, :active) .button {
    background: var(--article-action-feedback);
    color: var(--link-default);
    border-color: currentColor;
}
.discovery-card:active .button { color: var(--link-active); }
:root { --article-action-feedback: #edf0f6; }
:root[data-appearance="dark"] { --article-action-feedback: #1e2c40; }
@media (prefers-color-scheme: dark) {
    :root:not([data-appearance="light"]) { --article-action-feedback: #1e2c40; }
}

.article-contents-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 16px;
    color: var(--text);
}
.article-contents-toggle { display: none; }
@media (max-width: 881px) {
    .article-header h1 { font-size: 40px; line-height: 1.16; }
    .article-body h2 { font-size: 28px; }
    .article-contents:has(.article-contents-toggle:not([hidden])) .article-contents-title,
    .article-contents-toggle:not([hidden])[aria-expanded="false"] + nav { display: none; }
    .article-contents-toggle:not([hidden]) {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        width: 100%;
        min-height: 48px;
        padding: 10px 12px;
        border: 1px solid var(--line);
        border-radius: 4px;
        background: transparent;
        color: var(--text);
        font-family: inherit;
        font-size: 17px;
        font-weight: 600;
        line-height: 1.4;
        text-align: left;
        cursor: pointer;
    }
    .article-contents-toggle:is(:hover, :focus-visible, :active) { background: var(--nav-feedback); }
}
@media (max-width: 390px) { .article-header h1 { font-size: 35px; } }

.spj-header nav a:is([aria-current="page"], .spj-current-section) {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 5px;
}
.spj-header-tools .spj-search-toggle[hidden] { display: none; }
.spj-header-tools .spj-search-toggle:is(:hover, :focus-visible) { background: var(--nav-feedback); }
.spj-search-dialog {
    position: fixed;
    width: min(560px, calc(100% - 32px));
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--background);
    color: var(--text);
}
.spj-search-dialog::backdrop { background: rgb(17 24 39 / 55%); }
.spj-search-dialog h2 { margin: 0 48px 20px 0; font-weight: 500; }
.spj-search-close { position: absolute; top: 12px; right: 12px; }
.spj-search-dialog button { min-width: 44px; min-height: 44px; }
.spj-search-dialog input { display: block; width: 100%; min-height: 44px; margin: 8px 0 16px; padding: 8px; font: inherit; }
.related-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.related-heading h2 { margin: 0; }

/* Explore uses the same discovery-card treatment as related writing. */
.wp-site-blocks > .spj-explore { margin-block-start: 0; }
.spj-explore { padding-block: 54px 48px; }
.spj-explore > .explore-heading {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0 0 32px;
}
.spj-explore > .explore-heading > :is(p, h1) { margin: 0; }
.spj-explore > .explore-heading + :is(.explore-controls, .explore-topics) { margin-block-start: 0; }
.explore-heading h1 { font-size: 64px; line-height: 1.12; font-weight: 500; letter-spacing: -1.7px; }
.explore-heading > p:last-child { font: 500 24px/1.4 'Playfair Display', Georgia, serif; color: var(--muted); }
.spj-explore .explore-kicker { color: var(--link-default); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.explore-controls { display: grid; grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)) auto; align-items: end; gap: 16px; }
.explore-controls label { display: grid; gap: 8px; min-width: 0; font-size: 13px; }
.explore-controls :is(input, select) { width: 100%; min-width: 0; min-height: 48px; padding: 10px 16px; border: 1px solid var(--control); border-radius: 4px; background: var(--surface); color: var(--text); font: inherit; }
.explore-controls select { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%2377859a' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.explore-topics, .explore-pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-block: 24px; }
.spj-explore [aria-current] { background: var(--accent); border-color: var(--accent); color: var(--background); }
.explore-results-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; margin-block: 24px; color: var(--muted); }
.explore-results-heading p { margin: 0; }
.explore-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 28px; }
.explore-card { min-width: 0; overflow-wrap: anywhere; }
.explore-card :is(h2, h3) { margin: 0; font-size: 28px; font-weight: 500; line-height: 1.25; }
.explore-card:is(:hover, :focus-visible) :is(h2, h3) { color: var(--link-default); }
.explore-card-image { margin: 0; }
.explore-card-image img { display: block; width: 100%; height: auto; contain-intrinsic-size: none; aspect-ratio: 3/2; object-fit: cover; }
.explore-card-image figcaption { padding: 8px 12px; color: var(--muted); font-size: 12px; text-align: center; }
.explore-featured { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); align-items: stretch; gap: 24px; padding: 24px; }
.explore-featured .explore-card-copy { padding: 0; }
.explore-featured h2 { font-size: 39px; }
.explore-pin { display: inline-flex; align-items: center; align-self: flex-end; gap: 6px; color: var(--link-default); font-size: 12px; }
@media (max-width: 900px) { .explore-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 800px) { .spj-explore { padding-top: 32px; } }
@media (max-width: 760px) {
    .spj-explore > .explore-heading { margin-block-end: 28px; }
    .explore-heading h1 { font-size: 43px; }
    .explore-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .explore-featured { grid-template-columns: minmax(0, 1fr); }
    .explore-featured h2 { font-size: 31px; }
}
@media (max-width: 560px) { .explore-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 420px) { .explore-controls { grid-template-columns: minmax(0, 1fr); } }

.project-controls { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; }
.project-followup { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 40px; }
@media (max-width: 560px) { .project-controls { grid-template-columns: minmax(0, 1fr); } }

.explore-card .project-card-detail { font-size: 12px; }

.reading-page .wp-block-gallery.has-nested-images {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 36px 24px;
    margin-inline: 0;
}
.reading-page .wp-block-gallery.has-nested-images > figure.wp-block-image {
    display: block;
    width: 100%;
    margin: 0;
}
.reading-page .wp-block-gallery.has-nested-images > figure.wp-block-image img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 5px;
}
.reading-page .wp-block-gallery.has-nested-images > figure.wp-block-image figcaption {
    position: static;
    max-height: none;
    margin: 12px 0 0;
    padding: 0;
    font-size: 12px;
    line-height: 1.7;
    background: none;
    color: var(--muted);
    text-align: left;
}
.spj-photo-viewer {
    width: min(960px, calc(100% - 32px));
    max-height: calc(100dvh - 32px);
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--background);
    color: var(--text);
}
.spj-photo-viewer::backdrop { background: rgb(17 24 39 / 78%); }
.spj-photo-viewer :is(header, footer) { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.spj-photo-viewer h2 { margin: 0; font-size: 22px; font-weight: 500; }
.spj-photo-viewer img { display: block; width: auto; height: auto; max-width: 100%; max-height: 60dvh; object-fit: contain; margin: 16px auto; }
.spj-photo-viewer p { color: var(--muted); }
.spj-photo-viewer button { min-height: 44px; }
@media (max-width: 881px) {
    .reading-page .wp-block-gallery.has-nested-images { grid-template-columns: minmax(0, 1fr); }
    .spj-photo-viewer { padding: 16px; }
}

.reading-page .wp-block-gallery.has-nested-images > .spj-portrait-opening { grid-column: 1 / -1; max-width: 480px; justify-self: center; }

/* Match the approved archive and project reading widths. */
.spj-explore, .single-spj_project .reading-page { max-width: 1066px; margin-inline: auto; }
.reading-page .article-header { max-width: none; }
.reading-page .article-featured-image { max-width: none; }
.reading-page .reading-layout { max-width: none; }
.reading-page .article-body { max-width: 760px; }
@media (min-width: 882px) {
    .single-spj_project .reading-layout:not(:has(.wp-block-gallery)) {
        grid-template-columns: 190px minmax(0, 1fr);
        gap: 48px;
    }
}

.spj-explore:has(.project-controls) .explore-featured { padding: 16px; gap: 36px; }
.spj-explore:has(.project-controls) .explore-featured img { object-fit: contain; }
.spj-explore:has(.project-controls) .explore-featured h2 { font-size: 42px; }
.spj-explore:has(.project-controls) .explore-card:not(.explore-featured) .explore-card-copy { padding: 16px; gap: 16px; }
.spj-explore .explore-results-heading > p { font-size: 11px; }
.spj-explore:has(.project-controls) .explore-topics a { padding-inline: 14px; font-size: 14px; }
.project-controls :is(input, select) { font-size: 14px; }
.project-followup a, .project-reset, .spj-missing-actions a:not(.button), .explore-results-heading > a { font-size: 12px; font-weight: 500; color: var(--link-default); }
.project-end-divider { border-top: 1px solid var(--line); margin-top: 32px; }
.spj-header .spj-nav-group:has(> .spj-nav-dropdown):is(:hover, :focus-within) > a,
.spj-header .spj-nav-group:has(> .spj-nav-dropdown):is(:hover, :focus-within) > details > summary {
    background: var(--nav-feedback);
}
@media (min-width: 761px) {
    .project-controls { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto auto; }
}
@media (max-width: 760px) {
    .spj-explore:has(.project-controls) .explore-featured { gap: 24px; }
    .spj-explore:has(.project-controls) .explore-featured h2 { font-size: 34px; }
}

.spj-explore:has(.project-controls) .explore-featured {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: center;
}
.spj-explore:has(.project-controls) .explore-featured .explore-card-copy { gap: 0; }
.spj-explore:has(.project-controls) .explore-featured h2 { margin: 12px 0; }
.spj-explore:has(.project-controls) .explore-featured .explore-pin { margin-bottom: 8px; }
.spj-explore:has(.project-controls) .explore-featured .project-card-detail { margin: 20px 0; font-size: 11px; }
.spj-explore:has(.project-controls) .explore-card-image figcaption {
    margin-top: 8px;
    padding: 0;
    font-size: 11px;
    line-height: 1.6;
    text-align: left;
}
.project-followup a, .project-reset, .spj-missing-actions a:not(.button), .explore-results-heading > a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    text-decoration: none;
    text-underline-offset: 4px;
}
:is(.project-followup a, .project-reset, .spj-missing-actions a:not(.button), .explore-results-heading > a):visited { color: var(--link-visited); }
:is(.project-followup a, .project-reset, .spj-missing-actions a:not(.button), .explore-results-heading > a):hover { color: var(--link-default); text-decoration: underline; text-decoration-thickness: 1px; }
:is(.project-followup a, .project-reset, .spj-missing-actions a:not(.button), .explore-results-heading > a):focus-visible { color: var(--link-default); outline: 3px solid var(--link-default); outline-offset: 4px; }
:is(.project-followup a, .project-reset, .spj-missing-actions a:not(.button), .explore-results-heading > a):active { color: var(--link-active); }
@media (max-width: 760px) {
    .spj-explore:has(.project-controls) .explore-featured { grid-template-columns: minmax(0, 1fr); }
}


/* Detail page gutters follow the approved preview at the same viewport width. */
.reading-page {
    width: min(1066px, calc(100% - 114px));
    margin-inline: auto;
}
.reading-page .reading-layout { grid-template-columns: 190px minmax(0, 1fr); gap: 48px; }
.reading-page .reading-layout {
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 48px;
}
.reading-page .article-contents nav a { font-size: 14px; }
@media (max-width: 881px) {
    .reading-page { width: calc(100% - 50px); }
    .reading-page .reading-layout:has(.article-contents),
    .single-spj_project .reading-page .reading-layout:has(.article-contents) {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }
    .reading-page .article-body { width: 100%; max-width: none; }
    .reading-page .article-contents {
        position: static;
        padding: 0 0 12px;
        margin: 0;
        border-bottom: 1px solid var(--line);
    }
}
@media (min-width: 761px) and (max-width: 800px) {
    .reading-page { width: calc(100% - 74px); }
}
@media (max-width: 760px) { .reading-page { width: calc(100% - 34px); } }
@media (max-width: 401px) { .reading-page { width: calc(100% - 22px); } }


.single-spj_project .article-featured-image { margin-bottom: 0; }
.project-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin: 32px 0 56px;
    padding: 24px;
    background: var(--article-action-feedback);
    border: 1px solid var(--line);
    border-radius: 6px;
}
.project-facts dt { color: var(--accent); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.project-facts dd { margin: 8px 0 0; font-size: 15px; }
@media (max-width: 881px) { .project-facts { gap: 16px; padding: 20px; margin-bottom: 32px; } }
@media (max-width: 560px) { .project-facts { grid-template-columns: minmax(0, 1fr); } }

.single-spj_project .reading-layout:has(.wp-block-gallery) .article-body { max-width: 900px; }
.reading-page .wp-block-gallery figure > a { display: block; position: relative; cursor: zoom-in; }
.reading-page .wp-block-gallery figure > a[aria-haspopup="dialog"]::after {
    content: "↗" / "";
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background: var(--background);
    color: var(--link-default);
}
.reading-page .wp-block-gallery figure > a:is(:hover, :focus-visible)::after { background: var(--nav-feedback); }

.reading-page .wp-block-gallery.has-nested-images { counter-reset: gallery-photo; }
.reading-page .wp-block-gallery.has-nested-images > figure.wp-block-image { counter-increment: gallery-photo; }
.reading-page .wp-block-gallery.has-nested-images figure.wp-block-image > a {
    display: block;
    width: 100%;
    overflow: hidden;
    border-radius: 6px;
}
.reading-page .wp-block-gallery.has-nested-images figure.wp-block-image > a > img {
    height: auto;
    border-radius: inherit;
}
.reading-page .wp-block-gallery.has-nested-images > figure.wp-block-image figcaption {
    width: 100%;
    overflow: visible;
    text-shadow: none;
    filter: none;
}
.reading-page .wp-block-gallery figcaption :is(strong, span) { display: block; }
.reading-page .wp-block-gallery figcaption strong { color: var(--text); font-weight: 500; }
.reading-page .wp-block-gallery figcaption strong::before { content: counter(gallery-photo) ". "; }
@media (max-width: 881px) {
    .reading-page .wp-block-gallery.has-nested-images > .spj-portrait-opening { max-width: 100%; }
}

/* Gallery blocks include core width rules with !important. */
.reading-page .wp-block-gallery.has-nested-images > figure.wp-block-image {
    width: 100% !important;
}
.reading-page .wp-block-gallery.has-nested-images > figure.wp-block-image > a > img {
    width: 100% !important;
    height: auto !important;
    contain-intrinsic-size: none;
}
.reading-page .wp-block-gallery.has-nested-images > figure.wp-block-image figcaption {
    position: static !important;
    background: none !important;
    backdrop-filter: none;
}
@media (max-width: 881px) {
    .reading-page .wp-block-gallery.has-nested-images { grid-template-columns: minmax(0, 1fr) !important; }
}

.spj-photo-viewer h2 { line-height: 1.12; }
.spj-photo-viewer [data-caption] { font-size: 14px; font-weight: 400; line-height: 1.7; margin: 16px 0; }
.spj-photo-viewer footer span { font-size: 13px; line-height: 1.6; color: var(--muted); }
.spj-photo-viewer footer button { font-size: 12px; font-weight: 500; line-height: 1.6; padding: 12px 20px; min-height: 48px; }
.spj-photo-viewer [data-close] { width: 48px; min-height: 48px; padding: 0; border-radius: 50%; }
@media (max-width: 600px) { .spj-photo-viewer h2 { font-size: 18px; } }

.spj-photo-viewer [data-close] { display: grid; place-items: center; flex-shrink: 0; }
.spj-photo-viewer button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; }

.spj-photo-viewer { width: min(1200px, calc(100% - 24px)); }
.spj-photo-viewer img { max-height: max(180px, min(74dvh, calc(100dvh - 220px))); }
@media (max-width: 600px) {
    .spj-photo-viewer { padding-inline: 10px; }
}

.spj-photo-stage { position: relative; display: flow-root; }
.spj-photo-stage img { margin: 12px auto; }
.spj-photo-stage button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 48px;
    min-height: 48px;
    padding: 0;
    border-radius: 50%;
    background: var(--background);
    color: var(--text);
    height: 48px;
    border: 1px solid var(--line);
}
.spj-photo-stage [data-prev] { inset-inline-start: 8px; }
.spj-photo-stage [data-next] { inset-inline-end: 8px; }
.spj-photo-stage button:disabled { opacity: .45; cursor: default; }
.spj-photo-viewer footer { align-items: baseline; }
.spj-photo-viewer footer span { white-space: nowrap; }
.spj-photo-viewer [data-caption] { margin: 0; }

.spj-photo-stage {
    -webkit-user-select: none;
    user-select: none;
}

.spj-header .spj-nav-group:has(> details) { gap: 0; }
.spj-header .spj-nav-group:has(> details) > a { border-radius: 3px 0 0 3px; }
.spj-nav-dropdown summary { border-radius: 0 3px 3px 0; }
.spj-nav-dropdown[open] summary svg { transform: rotate(180deg); }
@media (max-width: 800px) {
    .spj-header .spj-nav-group:has(> details) { display: grid; grid-template-columns: minmax(0, 1fr) 48px; align-items: start; }
    .spj-nav-dropdown { display: contents; }
    .spj-nav-dropdown summary { min-width: 48px; min-height: 48px; }
    .spj-nav-dropdown > div { grid-column: 1 / -1; }
}

.spj-header .spj-nav-group { position: relative; }
.spj-header .spj-nav-dropdown { position: static; }
.spj-nav-dropdown summary svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
@media (prefers-reduced-motion: no-preference) {
    .spj-nav-dropdown summary svg { transition: transform 120ms ease; }
}
.spj-nav-dropdown > div {
    top: 100%;
    left: 0;
    min-width: 208px;
    padding: 8px;
    box-shadow: 0 10px 24px rgb(17 24 39 / 12%);
}
.spj-projects-nav .spj-nav-dropdown > div { min-width: 240px; max-width: min(320px, calc(100vw - 48px)); }
.spj-header .spj-nav-dropdown a { display: flex; align-items: center; min-height: 44px; line-height: 1.5; }
.spj-header .spj-nav-dropdown a:is(:hover, :focus-visible) { background: var(--nav-feedback); text-decoration: none; }
.spj-header .spj-nav-dropdown a[aria-current]:is(:hover, :focus-visible) { text-decoration: underline; }
@media (max-width: 800px) {
    .spj-header .spj-nav-dropdown { display: contents; }
    .spj-header .spj-nav-dropdown > div,
    .spj-header .spj-projects-nav .spj-nav-dropdown > div {
        position: static;
        min-width: 0;
        max-width: none;
        margin: 4px 0 8px 12px;
        padding: 0 0 0 12px;
        border: 0;
        border-left: 2px solid var(--line);
        border-radius: 0;
        box-shadow: none;
    }
    .spj-header .spj-nav-dropdown a { min-height: 48px; font-size: 16px; }
}

.spj-header #spj-navigation .spj-nav-group:has(> details) > a { padding-inline-end: 2px; }
.spj-header #spj-navigation .spj-nav-dropdown summary { width: 24px; }
@media (max-width: 800px) {
    .spj-header:has(.spj-menu-toggle:not([hidden])) #spj-navigation {
        padding: 12px 16px;
        gap: 4px;
        max-height: 65dvh;
        overflow-y: auto;
        overscroll-behavior: contain;
    }
    .spj-header #spj-navigation > a,
    .spj-header #spj-navigation .spj-nav-group > a { font-size: 18px; min-height: 48px; }
    .spj-header #spj-navigation .spj-nav-group:has(> details) {
        grid-template-columns: max-content 48px minmax(0, 1fr);
    }
    .spj-header #spj-navigation .spj-nav-dropdown summary { width: 48px; }
}
@media (max-width: 800px) {
    .spj-header .spj-nav-dropdown[open]::details-content { display: contents; }
}
@media (max-width: 800px) {
    .spj-header #spj-navigation .spj-nav-group:has(> details) { align-items: stretch; }
    .spj-header #spj-navigation .spj-nav-dropdown summary { min-height: 48px; }
}
.collection-section { margin-block: 32px; }
.collection-section h2 { font-weight: 500; margin-bottom: 20px; }
.collection-favorite { color: var(--link-default); font-size: 13px; }

.collection-art { margin: 0; display: grid; place-items: center; background: var(--article-action-feedback); color: var(--muted); aspect-ratio: 3 / 2; overflow: hidden; }
.collection-art img { display: block; width: 100%; height: 100%; object-fit: contain; }
.collection-art span { font-size: 32px; }
.collection-now-grid .collection-entry { display: grid; grid-template-columns: 28% minmax(0, 1fr); }
.collection-now-grid .collection-art { aspect-ratio: auto; align-self: stretch; }
.collection-now-grid .collection-entry > div { padding: 16px; gap: 8px; }
.collection-now-grid .collection-entry h3 { font-size: 20px; }
.collection-controls .collection-favorite-filter { display: flex; align-items: center; align-self: center; }
.collection-controls .collection-favorite-filter input { width: auto; min-height: auto; }
.collection-controls { margin-block: 32px 16px; }


.collection-library-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 36px 24px; }
@media (max-width: 900px) { .collection-library-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 16px; } }
@media (max-width: 760px) { .collection-library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; } }
@media (max-width: 560px) { .collection-library-grid { grid-template-columns: minmax(0, 1fr); } }

.spj-reading-dialog {
    width: min(1000px, calc(100% - 32px));
    max-height: calc(100dvh - 32px);
    padding: 32px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--background);
    color: var(--text);
}
.spj-reading-dialog::backdrop { background: rgb(17 24 39 / 78%); }
.spj-reading-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 32px; }
.spj-reading-layout .collection-art { aspect-ratio: auto; align-self: start; }
.spj-reading-layout .collection-art img { height: auto; }
.spj-reading-close { display: block; margin-left: auto; width: 48px; min-height: 48px; font-size: 24px; }
.spj-reading-dialog h2 { font-size: 32px; font-weight: 500; }
.spj-reading-dialog h3 { font-size: 20px; font-weight: 500; margin-block: 24px 12px; }
.spj-reading-dialog dt { font-weight: 600; }
.spj-reading-dialog dd { margin: 0 0 8px; }
@media (max-width: 600px) {
    .spj-reading-dialog { padding: 16px; }
    .spj-reading-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .spj-reading-layout .collection-art { max-width: 200px; justify-self: center; }
}

#explore-topics{scroll-margin-top:32px}

/* Let the section layout gap set spacing between the sidebar and content. */
.reading-page .reading-layout > .article-contents + .article-body {
    margin-block-start: 0;
}

/* Share the approved header spacing across articles and project details. */
:is(.single-post, .single-spj_project) .wp-site-blocks > .reading-page {
    margin-block-start: 0;
}
@media (min-width: 801px) {
    :is(.single-post, .single-spj_project) .reading-page > .back-link + .article-header {
        margin-block-start: 32px;
    }
}

.spj-header .spj-nav-dropdown .spj-professional-link {
    border-top: 1px solid var(--line);
    margin-top: 8px;
    padding-top: 14px;
}

.wp-site-blocks > main.article-header:has(> .spj-information-hero) {
    max-width: 1066px;
    margin: 0 auto 32px;
}

.spj-information-hero {
    padding: 54px 0 30px;
}

.spj-information-hero .spj-information-eyebrow {
    margin: 0;
    color: var(--link-default);
    font-size: 10px;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 1.8px;
    text-transform: uppercase;
}

.article-header .spj-information-hero h1 {
    margin: 20px 0;
    font-size: 64px;
    letter-spacing: -1.7px;
}

.spj-information-hero .spj-information-deck {
    max-width: 750px;
    margin: 0;
    color: var(--muted);
    font: 400 27px/1.5 "Playfair Display", Georgia, serif;
}

@media (max-width: 800px) {
    .spj-information-hero { padding-top: 32px; }
    .article-header .spj-information-hero h1 { font-size: 43px; }
    .spj-information-hero .spj-information-deck { font-size: 23px; }
}

.listing-filter-bar { display: grid; gap: 8px; margin-block: 24px; }
.listing-filter-panel > summary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 8px 14px;
    border: 1px solid currentColor;
    border-radius: 4px;
    color: var(--accent);
    font-size: 14px;
    cursor: pointer;
    list-style: none;
}
.listing-filter-panel > summary::-webkit-details-marker { display: none; }
.listing-filter-panel > summary::after {
    content: "";
    width: 7px;
    height: 7px;
    border: solid currentColor;
    border-width: 0 1.5px 1.5px 0;
    transform: translateY(-2px) rotate(45deg);
}
.listing-filter-panel[open] > summary::after { transform: translateY(2px) rotate(225deg); }
.listing-filter-panel > summary:is(:hover, :focus-visible) { background: var(--nav-feedback, var(--soft)); }
.listing-filter-panel form { margin-top: 16px; }
.listing-filter-bar > :is(.listing-filter-results, .explore-results-heading) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    margin: 0;
}
.listing-filter-bar :is(.listing-filter-results, .explore-results-heading) p { margin: 0; }
.listing-filter-results [hidden] { display: none; }
@media (min-width: 701px) {
    .listing-filter-panel, .listing-filter-bar > :is(.listing-filter-results, .explore-results-heading) { grid-area: 1 / 1; }
    .listing-filter-bar > :is(.listing-filter-results, .explore-results-heading) {
        justify-self: end;
        align-self: start;
        min-height: 44px;
    }
}
@media (max-width: 700px) {
    .listing-filter-panel :is(.explore-controls, .project-browse-controls, .explore-sort) {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }
    .listing-filter-panel [type="submit"] { justify-self: start; }
}

.spj-contact-layout {
    display: grid;
    grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
    gap: 72px;
    padding: 10px 0 64px;
}
.spj-contact-aside { font-size: 13px; line-height: 1.8; color: var(--muted); }
.spj-contact-aside p { margin: 0 0 18px; }
.spj-contact-preview { border-inline-start: 2px solid var(--warm); padding-inline-start: 14px; }
.spj-contact-form .wpcf7-form > p { margin: 0 0 26px; }
.spj-contact-form .wpcf7-form label { font-size: 14px; font-weight: 600; }
.spj-contact-form .wpcf7-form-control-wrap { display: block; margin-top: 8px; }
.spj-contact-form :is(input[type="text"], input[type="email"], select, textarea) {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid var(--control);
    border-radius: 4px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 16px;
}
.spj-contact-form select.wpcf7-select { appearance: none; padding-inline-end: 42px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%2377859a' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; }
.spj-contact-form textarea { min-height: 200px; resize: vertical; }
.spj-contact-form .wpcf7-submit {
    min-height: 48px;
    min-width: 180px;
    padding: 10px 20px;
    border: 1px solid var(--accent);
    border-radius: 4px;
    background: var(--accent);
    color: var(--background);
    font: 500 12px/1.6 Inter, system-ui, sans-serif;
    cursor: pointer;
}
.spj-contact-form .wpcf7-submit:is(:hover, :focus-visible) {
    background: var(--link-default);
    border-color: var(--link-default);
    color: var(--background);
}
.spj-contact-form .wpcf7-not-valid-tip { color: var(--link-default); font-size: 13px; margin-top: 6px; }
.spj-contact-form .wpcf7 form .wpcf7-response-output { margin: 16px 0; padding: 12px 16px; }
.spj-contact-form .wpcf7 form:is(.sent, .failed, .aborted) .wpcf7-response-output {
    margin: 24px 0;
    padding: 10px 16px;
    border: 0;
    border-inline-start: 3px solid currentColor;
    font-size: 14px;
    font-weight: 700;
}
.spj-contact-form .wpcf7 form.sent .wpcf7-response-output { color: var(--contact-success); }
.spj-contact-form .wpcf7 form:is(.failed, .aborted) .wpcf7-response-output { color: var(--contact-error); }

.spj-contact-links { display: flex; flex-wrap: wrap; gap: 8px 26px; border-top: 1px solid var(--line); padding-top: 24px; }
.spj-contact-links a { display: inline-flex; align-items: center; min-height: 44px; font-size: 12px; font-weight: 500; }
@media (max-width: 800px) {
    .spj-contact-layout { grid-template-columns: minmax(0, 1fr); gap: 30px; padding-bottom: 38px; }
    .spj-contact-form .wpcf7-submit { width: 100%; font-size: 11px; }
}

.spj-contact-layout .spj-contact-aside h2 { font-size: 25px; line-height: 1.25; margin: 0 0 18px; }
.spj-contact-layout .spj-contact-aside ul { padding-inline-start: 18px; margin: 0 0 20px; }
.spj-contact-layout .spj-contact-aside li { margin-block-end: 14px; }
.spj-contact-layout .spj-contact-aside li strong { display: block; color: var(--text); }
@media (min-width: 801px) {
    .spj-contact-layout > .spj-contact-aside { grid-area: 1 / 1; }
    .spj-contact-layout > .spj-contact-form { grid-area: 1 / 2; }
}
.spj-contact-context { color: var(--muted); font-size: 13px; margin-bottom: 24px; }

.spj-contact-errors {
    border: 2px solid var(--link-default);
    border-radius: 4px;
    padding: 18px;
    margin-bottom: 26px;
    color: var(--link-default);
    font-size: 13px;
}
.spj-contact-errors ul { margin: 8px 0 0; padding-inline-start: 20px; }
.spj-contact-errors a { display: inline-flex; align-items: center; min-height: 44px; color: inherit; text-decoration: underline; }
.spj-contact-form [aria-invalid="true"] { border: 2px solid var(--link-default); }
.spj-contact-form form:has(.spj-contact-errors:not([hidden])) .wpcf7-response-output { display: none; }
.spj-message-help { margin: -16px 0 24px; color: var(--muted); font-size: 12px; }

.spj-message-help p { margin: 0; }
.spj-message-help span + span { margin-inline-start: .25em; }

.spj-policy-body { max-width: 750px; margin: 20px auto 64px; font-size: 18px; line-height: 1.85; }
.spj-policy-body > h2 { margin: 30px 0 16px; padding-top: 26px; border-top: 1px solid var(--line); font-size: 32px; line-height: 1.25; }
.spj-policy-body > p { margin: 0 0 24px; }
.spj-policy-body > .spj-policy-notice { border-inline-start: 2px solid var(--warm); padding-inline-start: 14px; color: var(--muted); font-size: 12px; }
.spj-policy-links { display: flex; flex-wrap: wrap; gap: 8px 26px; }
.spj-policy-links a { display: inline-flex; align-items: center; min-height: 44px; font-size: 12px; font-weight: 500; color: var(--link-default); text-underline-offset: 4px; }
@media (max-width: 800px) {
    .spj-policy-body { margin-bottom: 38px; font-size: 17px; }
    .spj-policy-body > h2 { font-size: 28px; }
}

.wp-site-blocks > .spj-missing-page { max-width: 1066px; margin: 0 auto 64px; }
.spj-missing-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.spj-missing-actions a { display: inline-flex; align-items: center; min-height: 44px; }
.spj-missing-actions .button { background: var(--accent); border-color: var(--accent); color: var(--background); }
.spj-missing-actions .button:is(:hover, :focus-visible) { background: var(--link-default); border-color: var(--link-default); color: var(--background); }

.spj-missing-page { text-align: center; }
.spj-missing-page .spj-missing-number {
    margin: 0;
    color: var(--muted);
    font: 500 clamp(96px, 15vw, 200px)/.95 "Playfair Display", Georgia, serif;
    letter-spacing: -.055em;
}
.spj-missing-page .spj-information-deck { max-width: 32ch; margin-inline: auto; }
.spj-missing-actions { justify-content: center; }
.spj-missing-collections { margin-top: 18px; }

/* Article lists keep their introductions close and leave room before the next paragraph. */
.article-body p:has(+ ul) {
    margin-block-end: 12px;
}
.article-body ul {
    list-style-type: disc;
    margin-block: 0 24px;
}
.article-body p + ul,
.article-body ul + p {
    margin-block-start: 0;
}
.article-body ul li > ul {
    list-style-type: circle;
    margin-block: 4px 8px;
}
.article-body ul li > ul li > ul {
    list-style-type: square;
}
