.sv-article-format,
.sv-article-byline {
    margin-block: 0;
}

.sv-article-relations__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sv-article-gallery__figure {
    margin: 0;
}

.sv-article-gallery__link,
.sv-article-gallery__image {
    display: block;
}

.sv-article-gallery__image {
    width: 100%;
    height: auto;
}

.sv-article-gallery__figcaption {
    margin-top: 0.5rem;
}

.sv-article-gallery__caption,
.sv-article-gallery__credit {
    display: block;
}

.sv-article-gallery__credit {
    font-size: 0.875em;
}

/* Lightbox: photo first. Controls and credits live ON the picture, not in
   separate rows that reduce image size (especially in phone landscape). */
html.sv-gallery-open { overflow: hidden; }
.sv-gallery-viewer {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: #161616;
    color: #fff;
    overscroll-behavior: contain;
}
.sv-gallery-viewer::backdrop { background: #161616; }
/* Supported browsers: native fullscreen removes browser chrome. */
.sv-gallery-viewer__panel:fullscreen {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: #161616;
}
.sv-gallery-viewer__panel:fullscreen::backdrop { background: #161616; }
.sv-gallery-viewer__panel {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
}
.sv-gallery-viewer__figure {
    position: relative;
    display: inline-grid;
    width: max-content;
    max-width: 100%;
    height: max-content;
    max-height: 100%;
    margin: 0;
    padding: 0;
    flex: 0 1 auto;
    min-width: 0;
    min-height: 0;
}
.sv-gallery-viewer__image {
    display: block;
    grid-area: 1 / 1;
    width: auto;
    height: auto;
    max-width: 100vw;
    max-height: 100vh;
    max-height: 100dvh;
    object-fit: contain;
    /* Unzoomed vertical gestures can be handled by Safari (e.g. retract UI).
       Horizontal gestures are reserved for gallery navigation. The browser
       decides whether it can retract its toolbars; this is not guaranteed. */
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    transform-origin: center center;
    will-change: transform;
}
.sv-gallery-viewer__image--zoomed { cursor: grab; touch-action: none; }
/* A 44px touch target with a deliberately smaller visible circular control. */
.sv-gallery-viewer button {
    position: absolute;
    z-index: 5;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #f5f5f5;
    font: 400 27px/1 sans-serif;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.sv-gallery-viewer button::before {
    content: '';
    position: absolute;
    inset: 5px;
    z-index: -1;
    border-radius: 50%;
    background: rgb(52 52 52 / 65%);
    transition: background 150ms ease;
}
.sv-gallery-viewer button:hover::before,
.sv-gallery-viewer button:focus-visible::before { background: rgb(52 52 52 / 90%); }
.sv-gallery-viewer button:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.sv-gallery-viewer__close {
    top: 0;
    right: 0;
    font-size: 25px !important;
}
/* Keep the charcoal circle, including when a theme adds button focus rings. */
.sv-gallery-viewer .sv-gallery-viewer__close,
.sv-gallery-viewer .sv-gallery-viewer__close:hover,
.sv-gallery-viewer .sv-gallery-viewer__close:focus,
.sv-gallery-viewer .sv-gallery-viewer__close:focus-visible {
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}
.sv-gallery-viewer .sv-gallery-viewer__close::before {
    border: 0 !important;
    outline: none !important;
    box-shadow: none !important;
}
.sv-gallery-viewer .sv-gallery-viewer__close:focus-visible::before {
    background: rgb(82 82 82 / 95%);
}
.sv-gallery-viewer__prev,
.sv-gallery-viewer__next { top: 50%; transform: translateY(-50%); }
.sv-gallery-viewer__prev { left: 0; }
.sv-gallery-viewer__next { right: 0; }
.sv-gallery-viewer__caption {
    position: absolute;
    z-index: 3;
    right: 8px;
    bottom: 6px;
    left: 8px;
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: rgb(255 255 255 / 78%);
    font-size: 11px;
    line-height: 1.3;
    font-weight: 400;
    text-align: right;
    text-shadow: 0 1px 2px rgb(0 0 0 / 50%);
    pointer-events: none;
}
.sv-gallery-viewer__description {
    display: inline;
    overflow-wrap: anywhere;
}
.sv-gallery-viewer__credit {
    display: inline;
    overflow-wrap: anywhere;
}
.sv-gallery-viewer__status {
    position: absolute;
    z-index: 3;
    top: 12px;
    left: 12px;
    color: rgb(255 255 255 / 78%);
    font-size: 11px;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgb(0 0 0 / 50%);
    pointer-events: none;
}
.sv-gallery-viewer [hidden] { display: none; }
@media (max-width: 479px), ((orientation: landscape) and (max-height: 500px)) {
    .sv-gallery-viewer__caption { font-size: 10px; right: 6px; left: 6px; bottom: 5px; }
    .sv-gallery-viewer__status { top: 9px; left: 9px; font-size: 10px; }
}

.sv-article-main-image,
.sv-article-main-image__image {
    display: block;
    width: 100%;
}

.sv-article-main-image__image {
    height: auto;
    aspect-ratio: auto;
}

.sv-article-image-credit--mobile {
    display: none;
}

/* Match the single-column breakpoint of the Bricks article layout. */
@media (max-width: 991px) {
    .sv-article-main-image--mobile-square > .sv-article-main-image__image {
        aspect-ratio: 1 !important;
        height: auto !important;
        object-fit: cover !important;
        object-position: var(--sv-person-card-position, 50% 50%) !important;
        transform-origin: var(--sv-person-card-position, 50% 50%);
        scale: var(--sv-person-card-zoom, 1);
        clip-path: inset(var(--sv-person-card-clip, 0% 0% 0% 0%));
    }

}

@media (max-width: 479px) {
    .sv-article-image-credit--desktop { display: none; }
    .sv-article-image-credit--mobile { display: inline; }
}


.sv-article-gallery__title {
    font-size: 21px;
    line-height: 1.2;
    font-weight: 600;
    text-transform: none;
}

/* Main editorial video: same media slot as the photo, with no autoplay. */
.sv-article-main-video { width: 100%; }
.sv-article-main-video iframe {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    min-height: 200px;
    border: 0;
}
