/* Gallery presentation only: Image, Title and Category remain the source fields. */
#gallery {
    position: relative;
    padding-top: 80px;
    padding-bottom: 85px;
}
#gallery:before {
    content: "";
    position: absolute;
    top: 50px;
    right: -3%;
    width: 55%;
    height: 450px;
    background: radial-gradient(ellipse, #6a075f22, transparent 65%);
    pointer-events: none;
    z-index: -1;
}
#gallery .section-heading {
    margin-bottom: 30px;
    align-items: end;
}
#gallery .section-heading h2 {
    font-size: clamp(35px, 4.2vw, 57px);
    line-height: 1.12;
}
#gallery .section-heading .eyebrow {
    color: #b798ca;
}
#gallery .section-heading p {
    border-left: 1px solid #e5b93c55;
    padding-left: 22px;
    font-size: 12px;
    letter-spacing: 0.2px;
}
.gallery-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    border-top: 1px solid #ffffff20;
    padding: 18px 0 24px;
}
.gallery-meta {
    display: flex;
    gap: 13px;
    align-items: center;
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 1.5px;
}
.gallery-meta b {
    font:
        italic 27px Georgia,
        serif;
    font-weight: 400;
    color: var(--gold);
}
.gallery-meta span {
    font-size: 12px;
    color: #97869f;
    letter-spacing: 0;
}
.gallery-view {
    display: flex;
    border: 1px solid #ffffff25;
    border-radius: 30px;
    padding: 3px;
    gap: 2px;
}
.gallery-view button {
    background: none;
    border: 0;
    border-radius: 25px;
    font-size: 12px;
    color: var(--muted);
    padding: 10px 17px;
}
.gallery-view button[aria-pressed="true"] {
    background: #e5b93c;
    color: #24141a;
}
.gallery-view button:hover {
    color: var(--cream);
}
.gallery-view button[aria-pressed="true"]:hover {
    color: #24141a;
}
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: 190px;
    gap: 18px;
    align-items: stretch;
}
.gallery-card {
    position: relative;
    grid-column: span 4;
    border: 1px solid #ffffff16;
    border-radius: 8px;
    min-width: 0;
    overflow: hidden;
    background: #24172c;
    isolation: isolate;
    transition:
        border-color 0.4s,
        box-shadow 0.4s;
}
.gallery-card:nth-child(6n + 1) {
    grid-column: span 8;
    grid-row: span 2;
}
.gallery-card:nth-child(6n + 4),
.gallery-card:nth-child(6n + 5),
.gallery-card:nth-child(6n + 6) {
    min-height: 0;
}
.gallery-card > button {
    height: 100%;
    width: 100%;
    aspect-ratio: auto;
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: inherit;
}
.gallery-card .media {
    height: 100%;
    width: 100%;
}
.gallery-card .media img {
    object-fit: cover;
    transition:
        transform 0.85s cubic-bezier(0.2, 0.65, 0.25, 1),
        filter 0.6s;
    filter: saturate(0.88);
}
.gallery-card:hover img,
.gallery-card:focus-within img {
    transform: scale(1.045);
    filter: saturate(1.08);
}
.gallery-card:hover,
.gallery-card:focus-within {
    border-color: #e5b93c88;
    box-shadow: 0 15px 35px #0004;
}
.gallery-card > button:after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, #140c201a 20%, transparent 40%, #140c20b3 80%, #140c20ed);
    transition: opacity 0.5s;
    opacity: 0.9;
}
.gallery-copy {
    position: absolute;
    z-index: 2;
    pointer-events: none;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 21px 22px;
    align-items: end;
    gap: 20px;
    border: 0;
    background: transparent;
    transform: translateY(0);
    transition: transform 0.45s;
}
.gallery-copy h3 {
    font-size: 17px;
    color: #fff9ec;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: -0.5px;
}
.gallery-copy p {
    font-size: 12px;
    color: #ddc9e4;
    margin-top: 7px;
    letter-spacing: 0.3px;
}
.gallery-copy h3:after {
    content: "";
    display: block;
    width: 22px;
    height: 1px;
    background: var(--gold);
    margin-top: 9px;
    transition: width 0.5s;
}
.gallery-card:hover .gallery-copy h3:after,
.gallery-card:focus-within .gallery-copy h3:after {
    width: 55px;
}
.gallery-copy > span {
    width: 33px;
    height: 33px;
    border: 1px solid #e5b93c88;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 19px;
    color: var(--gold);
    background: #21152bb0;
    transition:
        background 0.3s,
        color 0.3s,
        transform 0.3s;
    flex-shrink: 0;
}
.gallery-card:hover .gallery-copy > span,
.gallery-card:focus-within .gallery-copy > span {
    background: var(--gold);
    color: var(--bg);
    transform: rotate(8deg);
}
.gallery-card:nth-child(6n + 1) .gallery-copy {
    padding: 28px;
}
.gallery-card:nth-child(6n + 1) .gallery-copy h3 {
    font-size: 29px;
}
.gallery-card:nth-child(6n + 1) .gallery-copy p {
    font-size: 12px;
}
.photo-index {
    position: absolute;
    top: 15px;
    left: 16px;
    z-index: 2;
    color: #fff3dd;
    font-size: 12px;
    letter-spacing: 1.5px;
    border: 1px solid #ffffff35;
    background: #160c21a6;
    padding: 6px 9px;
    border-radius: 30px;
    pointer-events: none;
}
.photo-index:before {
    content: "FRAME / ";
    color: #d0bbd9;
    font-size: 12px;
}
.gallery-grid[data-view="grid"] {
    grid-auto-rows: 255px;
}
.gallery-grid[data-view="grid"] .gallery-card {
    grid-column: span 4;
    grid-row: span 1;
}
.gallery-grid[data-view="grid"] .gallery-copy {
    padding: 21px 22px;
}
.gallery-grid[data-view="grid"] .gallery-copy h3 {
    font-size: 17px;
}
.gallery-grid[data-view="grid"] .gallery-copy p {
    font-size: 12px;
}
.gallery-card .fallback {
    padding: 15px 20px 75px;
    font-size: 12px;
}
.gallery-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-top: 23px;
    font-size: 12px;
    letter-spacing: 1.3px;
    color: #ad96b9;
}
.gallery-note span:last-child {
    font-size: 12px;
    letter-spacing: 0;
    color: #d4bfde;
}
.gallery-grid .empty-state {
    min-height: 210px;
    grid-column: 1/-1;
}
.image-position {
    display: block;
    font:
        11px "DM Sans",
        sans-serif;
    color: var(--gold);
    letter-spacing: 1px;
    align-self: center;
    margin-right: 8px;
}
.full-image-frame {
    position: relative;
}
.full-image-frame .media {
    border-radius: 5px;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr);
}
#image-dialog .full-image-frame .media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    object-fit: contain;
}
#image-dialog {
    background: #1b1324;
    border-color: #e5b93c44;
    box-shadow: 0 30px 100px #0009;
}
#image-dialog .lightbox-caption {
    padding: 20px 7px 4px;
}
#image-dialog .lightbox-caption h3 {
    font-size: 20px;
}
#image-dialog .lightbox-caption p {
    color: #bca5c9;
    font-size: 12px;
}
#image-dialog[open] {
    animation: viewer-appear 0.3s ease-out;
}
@keyframes viewer-appear {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
@media (max-width: 900px) {
    .gallery-grid {
        grid-auto-rows: 165px;
        gap: 14px;
    }
    .gallery-copy {
        padding: 17px;
    }
    .gallery-copy h3 {
        font-size: 15px;
    }
    .gallery-card:nth-child(6n + 1) .gallery-copy h3 {
        font-size: 25px;
    }
    .gallery-card:nth-child(6n + 1) .gallery-copy {
        padding: 23px;
    }
    .gallery-copy > span {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
    .gallery-copy p {
        font-size: 12px;
    }
}
@media (max-width: 640px) {
    #gallery {
        padding-top: 55px;
        padding-bottom: 55px;
    }
    #gallery .section-heading {
        gap: 20px;
    }
    #gallery .section-heading h2 {
        font-size: 39px;
    }
    #gallery .section-heading p {
        font-size: 12px;
        padding-left: 16px;
    }
    .gallery-tools {
        padding: 16px 0 20px;
    }
    .gallery-meta {
        gap: 8px;
        font-size: 12px;
        letter-spacing: 0.8px;
    }
    .gallery-meta span {
        display: none;
    }
    .gallery-meta b {
        font-size: 24px;
    }
    .gallery-view button {
        font-size: 12px;
        padding: 9px 13px;
    }
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: 195px;
        gap: 12px;
    }
    .gallery-card,
    .gallery-card:nth-child(6n + 1) {
        grid-column: span 1;
        grid-row: span 1;
    }
    .gallery-card:nth-child(6n + 1) {
        grid-column: span 2;
        grid-row: span 1;
    }
    .gallery-grid[data-view="grid"] {
        grid-auto-rows: 195px;
    }
    .gallery-grid[data-view="grid"] .gallery-card {
        grid-column: span 1;
        grid-row: span 1;
    }
    .gallery-copy,
    .gallery-card:nth-child(6n + 1) .gallery-copy,
    .gallery-grid[data-view="grid"] .gallery-copy {
        padding: 15px;
    }
    .gallery-copy h3,
    .gallery-grid[data-view="grid"] .gallery-copy h3 {
        font-size: 14px;
    }
    .gallery-card:nth-child(6n + 1) .gallery-copy h3 {
        font-size: 23px;
    }
    .gallery-copy p,
    .gallery-grid[data-view="grid"] .gallery-copy p,
    .gallery-card:nth-child(6n + 1) .gallery-copy p {
        font-size: 12px;
        margin-top: 5px;
    }
    .gallery-copy > span {
        width: 26px;
        height: 26px;
        font-size: 15px;
    }
    .photo-index {
        top: 10px;
        left: 11px;
        font-size: 12px;
        padding: 5px 7px;
    }
    .photo-index:before {
        font-size: 12px;
    }
    .gallery-note {
        font-size: 12px;
        letter-spacing: 0.7px;
        gap: 10px;
    }
    .gallery-note span:last-child {
        font-size: 12px;
    }
    #image-dialog .lightbox-caption {
        padding-top: 16px;
    }
    #image-dialog .lightbox-caption h3 {
        font-size: 16px;
    }
    .image-position {
        font-size: 12px;
        white-space: nowrap;
    }
    .lightbox-caption > div:last-child {
        gap: 6px;
    }
}
@media (max-width: 360px) {
    .gallery-grid,
    .gallery-grid[data-view="grid"] {
        grid-template-columns: 1fr;
        grid-auto-rows: 220px;
    }
    .gallery-card,
    .gallery-card:nth-child(6n + 1),
    .gallery-grid[data-view="grid"] .gallery-card {
        grid-column: span 1;
    }
    .gallery-copy h3 {
        font-size: 19px;
    }
    .gallery-note {
        flex-direction: column;
        align-items: start;
        gap: 10px;
    }
}
@media (prefers-reduced-motion: reduce) {
    #image-dialog[open] {
        animation: none;
    }
    .gallery-card,
    .gallery-copy,
    .gallery-card img,
    .gallery-copy h3:after,
    .gallery-copy > span {
        transition: none !important;
    }
}
