/* Fides in Reality — Public Gallery */

.gallery-page-head {
    border-bottom: 1px solid #e2d9cc;
    background: #f7f3eb;
}

.gallery-page-head > div,
.gallery-page {
    box-sizing: border-box;
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
}

.gallery-page-head > div {
    padding: 46px 0 34px;
}

.gallery-kicker {
    margin: 0 0 7px;
    color: #98701e;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.gallery-page-head h1 {
    margin: 0;
    color: var(--navy);
    font: clamp(36px, 5vw, 54px) / 1.04 Georgia, serif;
}

.gallery-page-head div > p:last-child {
    max-width: 620px;
    margin: 12px 0 0;
    color: #6f675d;
    font-size: 15px;
    line-height: 1.6;
}

.gallery-page {
    padding: 30px 0 80px;
}

.gallery-category-bar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 20px;
}

.gallery-category-bar > a,
.gallery-category-picker > summary {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    box-sizing: border-box;
    padding: 7px 13px;
    border: 1px solid #d7cdbc;
    background: #fff;
    color: #5f584f;
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
    list-style: none;
}

.gallery-category-bar > a.active {
    border-color: var(--navy);
    background: var(--navy);
    color: #fff;
}

.gallery-category-picker {
    position: relative;
}

.gallery-category-picker > summary::-webkit-details-marker {
    display: none;
}

.gallery-category-menu {
    position: absolute;
    top: calc(100% + 7px);
    left: 0;
    z-index: 30;
    width: min(330px, calc(100vw - 36px));
    max-height: 390px;
    padding: 12px;
    overflow: auto;
    border: 1px solid #d9cfbf;
    background: #fff;
    box-shadow: 0 18px 50px rgba(6, 18, 27, .16);
}

.gallery-category-menu input {
    box-sizing: border-box;
    width: 100%;
    margin-bottom: 9px;
    padding: 9px 10px;
    border: 1px solid #d7cdbc;
    font: inherit;
}

.gallery-category-menu [data-category-list] {
    display: grid;
}

.gallery-category-menu a {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 7px;
    border-bottom: 1px solid #eee8df;
    color: var(--navy);
    font-size: 13px;
    text-decoration: none;
}

.gallery-category-menu a:hover,
.gallery-category-menu a.active {
    background: #f5f1ea;
}

.gallery-category-menu small {
    color: #8c8276;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.gallery-card {
    position: relative;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: #e9e3da;
    cursor: pointer;
    text-align: left;
}

.gallery-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    display: block;
    object-fit: cover;
    background: #e9e3da;
    transition: transform .25s ease;
}

.gallery-card:hover img {
    transform: scale(1.018);
}

.gallery-card-overlay {
    position: absolute;
    inset: auto 0 0;
    display: block;
    padding: 42px 13px 12px;
    background: linear-gradient(transparent, rgba(2, 10, 15, .82));
    color: #fff;
    pointer-events: none;
}

.gallery-card-overlay small {
    display: block;
    margin-bottom: 3px;
    color: #e0be68;
    font-size: 9px;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.gallery-card-overlay strong {
    display: block;
    font: 18px / 1.18 Georgia, serif;
}

.gallery-featured {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 5px 7px;
    background: rgba(5, 20, 29, .9);
    color: #e3c36d;
    font-size: 9px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.gallery-empty {
    padding: 55px 20px;
    border: 1px solid #e2d9cc;
    text-align: center;
}

.gallery-empty h2 {
    margin: 0 0 8px;
    color: var(--navy);
    font: 29px / 1.15 Georgia, serif;
}

.gallery-empty p {
    margin: 0;
    color: #746b60;
}

/* Viewer */

body.gallery-viewer-open {
    overflow: hidden;
}

.gallery-viewer[hidden] {
    display: none;
}

.gallery-viewer {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: clamp(12px, 2vw, 28px);
    color: #fff;
}

.gallery-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(1, 7, 11, .92);
    backdrop-filter: blur(10px);
}

.gallery-viewer-shell {
    position: relative;
    width: min(1280px, 96vw);
    height: min(900px, 94dvh);
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
    grid-template-rows: 54px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 18px;
    background: #02080c;
    box-shadow: 0 28px 90px rgba(0,0,0,.5);
}

.gallery-viewer-top {
    grid-column: 1 / -1;
    min-width: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    border-bottom: 1px solid rgba(255,255,255,.1);
    background: #02080c;
}

.gallery-viewer-top > div,
.gallery-viewer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gallery-viewer button,
.gallery-viewer-actions a {
    padding: 8px 11px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 8px;
    background: rgba(255,255,255,.04);
    color: #fff;
    font: inherit;
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
}

.gallery-viewer button:hover,
.gallery-viewer-actions a:hover {
    border-color: rgba(212,164,55,.7);
    color: #f0c766;
}

.gallery-viewer-media {
    position: relative;
    min-width: 0;
    min-height: 0;
    display: grid;
    place-items: center;
    padding: 20px 54px;
    overflow: hidden;
    background: #010507;
}

.gallery-viewer-media img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
}

.gallery-arrow {
    position: absolute;
    top: 50%;
    width: 38px;
    height: 52px;
    padding: 0 !important;
    transform: translateY(-50%);
    font-size: 27px !important;
    border-radius: 999px !important;
}

.gallery-arrow.previous {
    left: 9px;
}

.gallery-arrow.next {
    right: 9px;
}

.gallery-viewer-info {
    min-width: 0;
    min-height: 0;
    padding: 28px 24px 34px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-left: 1px solid rgba(255,255,255,.1);
    background: #071722;
    scrollbar-width: thin;
}

.gallery-viewer-info > * {
    max-width: 100%;
}

.gallery-viewer-meta {
    margin: 0 0 10px;
    color: #d2a53d;
    font-size: 10px;
    line-height: 1.5;
    letter-spacing: .08em;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.gallery-viewer-info h2 {
    margin: 0 0 12px;
    font: 30px / 1.12 Georgia, serif;
    overflow-wrap: anywhere;
}

.gallery-viewer-caption {
    margin: 0;
    color: #eee6dc;
    font: 15px / 1.6 Georgia, serif;
    overflow-wrap: anywhere;
}

.gallery-viewer-story {
    margin-top: 16px;
    color: #c7c0b7;
    font-size: 13px;
    line-height: 1.75;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.gallery-viewer-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 18px;
}

.gallery-viewer-tags span {
    max-width: 100%;
    padding: 5px 8px;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 999px;
    color: #bdb6ad;
    font-size: 10px;
    overflow-wrap: anywhere;
}

.gallery-viewer-actions {
    margin-top: 20px;
    padding-bottom: 4px;
}

.gallery-photo-page {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: clamp(28px, 5vw, 60px) 0 70px;
}

.gallery-photo-back {
    display: inline-block;
    margin-bottom: 20px;
    color: #8c6a1f;
    text-decoration: none;
    font-size: 13px;
}

.gallery-photo-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, .75fr);
    overflow: hidden;
    border: 1px solid rgba(7,23,34,.12);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(7,23,34,.08);
}

.gallery-photo-media {
    min-height: 520px;
    display: grid;
    place-items: center;
    padding: 18px;
    background: #02080c;
}

.gallery-photo-media img {
    display: block;
    max-width: 100%;
    max-height: 78vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.gallery-photo-copy {
    min-width: 0;
    padding: 30px 26px;
    text-align: left;
    overflow-wrap: anywhere;
}

.gallery-photo-copy h1 {
    margin: 0 0 12px;
    font: clamp(26px, 4vw, 38px) / 1.1 Georgia, serif;
    color: #071722;
}

.gallery-photo-copy .gallery-viewer-story {
    color: #5d5a55;
}

@media (max-width: 800px) {
    .gallery-page-head > div,
    .gallery-page {
        width: calc(100% - 28px);
    }

    .gallery-page-head > div {
        padding: 34px 0 27px;
    }

    .gallery-page {
        padding-top: 22px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .gallery-card-overlay {
        padding: 34px 9px 9px;
    }

    .gallery-card-overlay strong {
        font-size: 15px;
    }

    .gallery-viewer {
        padding: 0;
    }

    .gallery-viewer-shell {
        width: 100%;
        height: 100dvh;
        border: 0;
        border-radius: 0;
        grid-template-columns: 1fr;
        grid-template-rows: 52px minmax(280px, 52dvh) minmax(0, 1fr);
    }

    .gallery-viewer-top {
        position: relative;
        z-index: 2;
        padding: 0 12px;
    }

    .gallery-viewer-media {
        padding: 10px 38px;
    }

    .gallery-viewer-info {
        padding: 20px 18px 32px;
        overflow-y: auto;
        border-top: 1px solid rgba(255,255,255,.1);
        border-left: 0;
    }

    .gallery-viewer-info h2 {
        font-size: 25px;
    }

    .gallery-photo-page {
        width: calc(100% - 24px);
        padding-top: 20px;
    }

    .gallery-photo-layout {
        grid-template-columns: 1fr;
    }

    .gallery-photo-media {
        min-height: 0;
        padding: 10px;
    }

    .gallery-photo-media img {
        max-height: 65vh;
    }

    .gallery-photo-copy {
        padding: 22px 18px 30px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-card img {
        transition: none;
    }
}


/* Gallery title links */
.gallery-card {
    position: relative;
}

.gallery-card-image {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

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

.gallery-card-overlay {
    pointer-events: none;
}

.gallery-card-overlay strong a {
    position: relative;
    z-index: 3;
    color: inherit;
    text-decoration: none;
    pointer-events: auto;
}

.gallery-card-overlay strong a:hover,
.gallery-card-overlay strong a:focus-visible {
    color: #f0c766;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Individual photograph page */
.gallery-photo-layout {
    align-items: stretch;
}

.gallery-photo-media {
    position: relative;
    min-width: 0;
    min-height: 560px;
    padding: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at center, rgba(255,255,255,.04), transparent 48%),
        #010507;
}

.gallery-photo-viewport {
    width: 100%;
    height: 100%;
    min-height: 560px;
    display: grid;
    place-items: center;
    overflow: hidden;
    touch-action: none;
    cursor: grab;
}

.gallery-photo-viewport.is-dragging {
    cursor: grabbing;
}

.gallery-photo-viewport img {
    display: block;
    max-width: 94%;
    max-height: 82vh;
    width: auto;
    height: auto;
    object-fit: contain;
    transform-origin: center center;
    user-select: none;
    will-change: transform;
}

.gallery-photo-zoom-controls {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 4;
    display: flex;
    gap: 6px;
    padding: 6px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 12px;
    background: rgba(2,8,12,.8);
    backdrop-filter: blur(8px);
}

.gallery-photo-zoom-controls button {
    min-width: 38px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 8px;
    background: rgba(255,255,255,.06);
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.gallery-photo-zoom-controls button:hover,
.gallery-photo-zoom-controls button:focus-visible {
    border-color: rgba(212,164,55,.75);
    color: #f0c766;
}

.gallery-photo-zoom-controls button[data-zoom-reset] {
    min-width: 62px;
    font-size: 11px;
}

.gallery-photo-zoom-hint {
    position: absolute;
    left: 50%;
    bottom: 14px;
    z-index: 3;
    margin: 0;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(2,8,12,.74);
    color: rgba(255,255,255,.72);
    font-size: 10px;
    transform: translateX(-50%);
    white-space: nowrap;
    pointer-events: none;
}

.gallery-photo-copy {
    align-self: stretch;
    background: #fff;
}

@media (max-width: 800px) {
    .gallery-photo-layout {
        overflow: visible;
    }

    .gallery-photo-media,
    .gallery-photo-viewport {
        min-height: min(62vh, 520px);
    }

    .gallery-photo-viewport img {
        max-width: 96%;
        max-height: 60vh;
    }

    .gallery-photo-zoom-controls {
        top: 10px;
        right: 10px;
    }

    .gallery-photo-zoom-hint {
        bottom: 10px;
        max-width: calc(100% - 24px);
        white-space: normal;
        text-align: center;
    }
}


/* Popup title links to the photograph page */
.gallery-viewer-title a {
    color: inherit;
    text-decoration: none;
}

.gallery-viewer-title a:hover,
.gallery-viewer-title a:focus-visible {
    color: #f0c766;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Professional individual photograph page */
.gallery-photo-page {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
    padding: clamp(26px, 4vw, 54px) 0 76px;
    text-align: left;
}

.gallery-photo-header {
    margin-bottom: 22px;
}

.gallery-photo-back {
    display: inline-flex;
    margin-bottom: 24px;
    color: #78601f;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.gallery-photo-back:hover,
.gallery-photo-back:focus-visible {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.gallery-photo-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 28px;
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(7,23,34,.14);
}

.gallery-photo-heading h1 {
    max-width: 760px;
    margin: 4px 0 0;
    color: #071722;
    font: clamp(30px, 5vw, 48px) / 1.05 Georgia, serif;
    overflow-wrap: anywhere;
}

.gallery-photo-header-meta {
    max-width: 360px;
    margin: 0;
    color: #6d6962;
    font-size: 12px;
    line-height: 1.6;
    text-align: right;
}

.gallery-photo-stage {
    position: relative;
    min-height: min(74vh, 820px);
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 16px;
    background:
        radial-gradient(circle at center, rgba(255,255,255,.045), transparent 50%),
        #010507;
    box-shadow: 0 22px 58px rgba(7,23,34,.13);
}

.gallery-photo-viewport {
    width: 100%;
    height: min(74vh, 820px);
    min-height: 520px;
    display: grid;
    place-items: center;
    overflow: hidden;
    touch-action: none;
    cursor: grab;
}

.gallery-photo-viewport.is-dragging {
    cursor: grabbing;
}

.gallery-photo-viewport img {
    display: block;
    max-width: calc(100% - 42px);
    max-height: calc(100% - 42px);
    width: auto;
    height: auto;
    object-fit: contain;
    transform-origin: center;
    user-select: none;
    will-change: transform;
}

.gallery-photo-zoom-controls {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 4;
    display: flex;
    gap: 6px;
    padding: 6px;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 12px;
    background: rgba(2,8,12,.82);
    backdrop-filter: blur(8px);
}

.gallery-photo-zoom-controls button {
    min-width: 38px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 8px;
    background: rgba(255,255,255,.06);
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.gallery-photo-zoom-controls button[data-zoom-reset] {
    min-width: 64px;
    font-size: 11px;
}

.gallery-photo-zoom-hint {
    position: absolute;
    left: 50%;
    bottom: 15px;
    z-index: 3;
    margin: 0;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(2,8,12,.76);
    color: rgba(255,255,255,.72);
    font-size: 10px;
    transform: translateX(-50%);
    white-space: nowrap;
    pointer-events: none;
}

.gallery-photo-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    gap: clamp(30px, 5vw, 72px);
    padding: clamp(32px, 5vw, 58px) clamp(2px, 2vw, 18px) 0;
}

.gallery-photo-main-copy,
.gallery-photo-details {
    min-width: 0;
}

.gallery-photo-caption {
    max-width: 760px;
    margin: 0;
    color: #34312d;
    font: clamp(18px, 2.3vw, 23px) / 1.65 Georgia, serif;
    overflow-wrap: anywhere;
}

.gallery-photo-story {
    margin-top: 34px;
    color: #4d4943;
}

.gallery-photo-story h2,
.gallery-photo-details h2 {
    margin: 0 0 14px;
    color: #071722;
    font: 20px / 1.2 Georgia, serif;
}

.gallery-photo-story > div {
    font-size: 15px;
    line-height: 1.85;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.gallery-photo-details {
    padding: 22px;
    border: 1px solid rgba(7,23,34,.12);
    border-radius: 14px;
    background: rgba(255,255,255,.68);
    align-self: start;
}

.gallery-photo-details dl {
    margin: 0;
}

.gallery-photo-details dl > div {
    padding: 12px 0;
    border-top: 1px solid rgba(7,23,34,.1);
}

.gallery-photo-details dt {
    margin-bottom: 4px;
    color: #8b6b24;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.gallery-photo-details dd {
    margin: 0;
    color: #393631;
    font-size: 13px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.gallery-photo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 17px;
}

.gallery-photo-tags span {
    padding: 6px 9px;
    border-radius: 999px;
    background: #eee9df;
    color: #5c554a;
    font-size: 10px;
}

.gallery-photo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}

.gallery-photo-actions button,
.gallery-photo-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid #071722;
    border-radius: 8px;
    background: #071722;
    color: #fff;
    font: inherit;
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
}

.gallery-photo-actions a {
    background: transparent;
    color: #071722;
}

@media (max-width: 760px) {
    .gallery-photo-page {
        width: calc(100% - 24px);
        padding-top: 20px;
    }

    .gallery-photo-heading {
        display: block;
    }

    .gallery-photo-heading h1 {
        font-size: clamp(28px, 9vw, 38px);
    }

    .gallery-photo-header-meta {
        max-width: none;
        margin-top: 12px;
        text-align: left;
    }

    .gallery-photo-stage,
    .gallery-photo-viewport {
        min-height: 0;
        height: min(62vh, 580px);
    }

    .gallery-photo-viewport img {
        max-width: calc(100% - 18px);
        max-height: calc(100% - 18px);
    }

    .gallery-photo-content {
        grid-template-columns: 1fr;
        gap: 30px;
        padding-top: 30px;
    }

    .gallery-photo-caption {
        font-size: 18px;
    }

    .gallery-photo-details {
        padding: 18px;
    }

    .gallery-photo-zoom-hint {
        max-width: calc(100% - 24px);
        white-space: normal;
        text-align: center;
    }
}


/* ========================================================================
   FINAL GALLERY CORRECTIONS
   ======================================================================== */

/* Grid title is display text only. The dedicated URL belongs in popup title. */
.gallery-card-overlay strong {
    color: inherit;
    text-decoration: none;
}

/* Popup photograph title is the dedicated photo-page link. */
.gallery-viewer-title a {
    color: inherit;
    text-decoration: none;
    transition: color .2s ease;
}

.gallery-viewer-title a:hover,
.gallery-viewer-title a:focus-visible {
    color: #f0c766;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Smooth photo-only mode. */
.gallery-viewer .gallery-viewer-top,
.gallery-viewer .gallery-viewer-info,
.gallery-viewer .gallery-arrow {
    will-change: transform, opacity;
    transition:
        transform .42s cubic-bezier(.22, .61, .36, 1),
        opacity .34s ease,
        visibility 0s linear 0s;
}

.gallery-viewer-media img {
    cursor: pointer;
}

/* Top bar exits upward. */
.gallery-viewer.gallery-viewer-clean .gallery-viewer-top {
    transform: translateY(-115%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        transform .42s cubic-bezier(.22, .61, .36, 1),
        opacity .34s ease,
        visibility 0s linear .42s;
}

/* The complete information/actions panel exits downward. */
.gallery-viewer.gallery-viewer-clean .gallery-viewer-info {
    transform: translateY(115%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        transform .42s cubic-bezier(.22, .61, .36, 1),
        opacity .34s ease,
        visibility 0s linear .42s;
}

.gallery-viewer.gallery-viewer-clean .gallery-arrow.previous {
    transform: translate(-120%, -50%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.gallery-viewer.gallery-viewer-clean .gallery-arrow.next {
    transform: translate(120%, -50%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Give the photograph the whole viewer while controls are hidden. */
.gallery-viewer.gallery-viewer-clean .gallery-viewer-shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
}

.gallery-viewer.gallery-viewer-clean .gallery-viewer-media {
    grid-column: 1;
    grid-row: 1;
    padding: 14px;
}

.gallery-viewer.gallery-viewer-clean .gallery-viewer-media img {
    max-width: 100%;
    max-height: 100%;
}

/* Professional individual photograph page.
   Content flows naturally; nothing is trapped in a fixed-height text panel. */
.gallery-photo-page {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
    padding: clamp(26px, 4vw, 54px) 0 78px;
    text-align: left;
}

.gallery-photo-header {
    margin-bottom: 24px;
}

.gallery-photo-back {
    display: inline-flex;
    margin-bottom: 24px;
    color: #78601f;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.gallery-photo-back:hover,
.gallery-photo-back:focus-visible {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.gallery-photo-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 30px;
    padding-bottom: 22px;
    border-bottom: 1px solid rgba(7,23,34,.14);
}

.gallery-photo-heading h1 {
    max-width: 760px;
    margin: 4px 0 0;
    color: #071722;
    font: clamp(30px, 5vw, 48px) / 1.06 Georgia, serif;
    overflow-wrap: anywhere;
}

.gallery-photo-header-meta {
    max-width: 360px;
    margin: 0;
    color: #6d6962;
    font-size: 12px;
    line-height: 1.65;
    text-align: right;
}

.gallery-photo-stage {
    position: relative;
    min-height: min(74vh, 820px);
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 16px;
    background:
        radial-gradient(circle at center, rgba(255,255,255,.045), transparent 50%),
        #010507;
    box-shadow: 0 22px 58px rgba(7,23,34,.13);
}

.gallery-photo-viewport {
    width: 100%;
    height: min(74vh, 820px);
    min-height: 520px;
    display: grid;
    place-items: center;
    overflow: hidden;
    touch-action: none;
    cursor: grab;
}

.gallery-photo-viewport.is-dragging {
    cursor: grabbing;
}

.gallery-photo-viewport img {
    display: block;
    max-width: calc(100% - 42px);
    max-height: calc(100% - 42px);
    width: auto;
    height: auto;
    object-fit: contain;
    transform-origin: center;
    user-select: none;
    will-change: transform;
}

.gallery-photo-zoom-controls {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 4;
    display: flex;
    gap: 6px;
    padding: 6px;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 12px;
    background: rgba(2,8,12,.82);
    backdrop-filter: blur(8px);
}

.gallery-photo-zoom-controls button {
    min-width: 38px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 8px;
    background: rgba(255,255,255,.06);
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.gallery-photo-zoom-controls button[data-zoom-reset] {
    min-width: 64px;
    font-size: 11px;
}

.gallery-photo-zoom-hint {
    position: absolute;
    left: 50%;
    bottom: 15px;
    z-index: 3;
    margin: 0;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(2,8,12,.76);
    color: rgba(255,255,255,.72);
    font-size: 10px;
    transform: translateX(-50%);
    white-space: nowrap;
    pointer-events: none;
}

.gallery-photo-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    gap: clamp(30px, 5vw, 72px);
    padding: clamp(34px, 5vw, 60px) clamp(2px, 2vw, 18px) 0;
}

.gallery-photo-main-copy,
.gallery-photo-details {
    min-width: 0;
}

.gallery-photo-caption {
    max-width: 780px;
    margin: 0;
    color: #34312d;
    font: clamp(18px, 2.3vw, 23px) / 1.65 Georgia, serif;
    overflow-wrap: anywhere;
}

.gallery-photo-story {
    margin-top: 36px;
    color: #4d4943;
}

.gallery-photo-story h2,
.gallery-photo-details h2 {
    margin: 0 0 14px;
    color: #071722;
    font: 20px / 1.2 Georgia, serif;
}

.gallery-photo-story > div {
    font-size: 15px;
    line-height: 1.9;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.gallery-photo-details {
    align-self: start;
    padding: 22px;
    border: 1px solid rgba(7,23,34,.12);
    border-radius: 14px;
    background: rgba(255,255,255,.72);
}

.gallery-photo-details dl {
    margin: 0;
}

.gallery-photo-details dl > div {
    padding: 12px 0;
    border-top: 1px solid rgba(7,23,34,.1);
}

.gallery-photo-details dt {
    margin-bottom: 4px;
    color: #8b6b24;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.gallery-photo-details dd {
    margin: 0;
    color: #393631;
    font-size: 13px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.gallery-photo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 17px;
}

.gallery-photo-tags span {
    padding: 6px 9px;
    border-radius: 999px;
    background: #eee9df;
    color: #5c554a;
    font-size: 10px;
}

.gallery-photo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}

.gallery-photo-actions button,
.gallery-photo-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid #071722;
    border-radius: 8px;
    background: #071722;
    color: #fff;
    font: inherit;
    font-size: 12px;
    text-decoration: none;
    cursor: pointer;
}

.gallery-photo-actions a {
    background: transparent;
    color: #071722;
}

@media (max-width: 800px) {
    .gallery-viewer.gallery-viewer-clean .gallery-viewer-shell {
        grid-template-rows: minmax(0, 1fr);
    }

    .gallery-viewer.gallery-viewer-clean .gallery-viewer-media {
        padding: 8px;
    }

    .gallery-photo-page {
        width: calc(100% - 24px);
        padding-top: 20px;
    }

    .gallery-photo-heading {
        display: block;
    }

    .gallery-photo-heading h1 {
        font-size: clamp(28px, 9vw, 38px);
    }

    .gallery-photo-header-meta {
        max-width: none;
        margin-top: 12px;
        text-align: left;
    }

    .gallery-photo-stage,
    .gallery-photo-viewport {
        min-height: 0;
        height: min(62vh, 580px);
    }

    .gallery-photo-viewport img {
        max-width: calc(100% - 18px);
        max-height: calc(100% - 18px);
    }

    .gallery-photo-content {
        grid-template-columns: 1fr;
        gap: 30px;
        padding-top: 30px;
    }

    .gallery-photo-caption {
        font-size: 18px;
    }

    .gallery-photo-details {
        padding: 18px;
    }

    .gallery-photo-zoom-hint {
        max-width: calc(100% - 24px);
        white-space: normal;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-viewer .gallery-viewer-top,
    .gallery-viewer .gallery-viewer-info,
    .gallery-viewer .gallery-arrow {
        transition-duration: .01ms;
    }
}


/* photo.php zoomed-image navigation */
.gallery-photo-viewport {
    touch-action: none;
    cursor: default;
}

.gallery-photo-viewport:has([data-zoom-image][style*="scale("]) {
    overscroll-behavior: contain;
}

.gallery-photo-viewport.is-dragging {
    cursor: grabbing;
}

.gallery-photo-viewport [data-zoom-image] {
    cursor: grab;
    -webkit-user-drag: none;
    user-select: none;
}

.gallery-photo-viewport.is-dragging [data-zoom-image] {
    cursor: grabbing;
}


/* Gallery popup — final full-image behaviour */

.gallery-viewer-shell {
    position: relative;
}

.gallery-viewer-media {
    min-width: 0;
    min-height: 0;
}

.gallery-viewer-media img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}


/* Photo-only mode */

.gallery-viewer.gallery-viewer-clean {
    padding: 0;
}

.gallery-viewer.gallery-viewer-clean .gallery-viewer-shell {
    position: fixed;
    inset: 0;

    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;

    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;

    border: 0;
    border-radius: 0;
    background: #010507;
}

.gallery-viewer.gallery-viewer-clean .gallery-viewer-media {
    grid-column: 1;
    grid-row: 1;

    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;
    overflow: hidden;
}

.gallery-viewer.gallery-viewer-clean .gallery-viewer-media img {
    display: block;

    width: auto;
    height: auto;

    max-width: 100vw;
    max-height: 100dvh;

    object-fit: contain;
    object-position: center;
}


/* Mobile */

@media (max-width: 800px) {
    .gallery-viewer.gallery-viewer-clean .gallery-viewer-shell {
        width: 100vw;
        height: 100dvh;
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
    }

    .gallery-viewer.gallery-viewer-clean .gallery-viewer-media {
        width: 100vw;
        height: 100dvh;
        padding: 0;
    }

    .gallery-viewer.gallery-viewer-clean .gallery-viewer-media img {
        max-width: 100vw;
        max-height: 100dvh;
    }
}