.gallery-hero {
    padding: 4.5rem 1.5rem 4rem;
    color: #fff;
    background: linear-gradient(rgb(9 15 12 / 52%), rgb(9 15 12 / 82%)), url("/assets/images/home-hero.webp") center 58% / cover no-repeat;
}

.gallery-hero__inner,
.gallery-layout {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
}

.gallery-hero h1 {
    margin: .2rem 0 .7rem;
    color: #fff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(3rem, 7vw, 5.8rem);
    line-height: .95;
}

.gallery-hero p:last-child {
    max-width: 48rem;
    margin: 0;
    font-size: 1.08rem;
}

.gallery-paper {
    min-height: 55vh;
    padding: 3rem 0 5rem;
    background: var(--paper, #f4efe4);
}

.gallery-index {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2.25rem;
    padding: 1.5rem 1.7rem;
    background: rgb(255 252 243 / 86%);
    border: 1px solid #d0c6b3;
    box-shadow: 0 .8rem 1.8rem rgb(66 47 27 / 10%);
}

.gallery-index h2,
.gallery-empty h2 {
    margin: .15rem 0 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2rem;
}

.gallery-index > p,
.gallery-index__label {
    margin: 0;
    color: #8e2527;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

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

.gallery-card {
    overflow: hidden;
    background: #fffaf0;
    border: 1px solid #d8cdb9;
    box-shadow: 0 1rem 1.8rem rgb(66 47 27 / 15%);
    transition: transform .18s ease, box-shadow .18s ease;
}

.gallery-card--left {
    transform: rotate(-.35deg);
}

.gallery-card--right {
    transform: rotate(.35deg);
}

.gallery-card:hover {
    transform: translateY(-.25rem);
    box-shadow: 0 1.3rem 2rem rgb(66 47 27 / 21%);
}

.gallery-card__link {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.gallery-card__media {
    position: relative;
    background: #f4efe4;
    border-bottom: 1px solid #d8cdb9;
}

.gallery-card__image {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9.2;
    object-fit: contain;
}

.gallery-card__type {
    position: absolute;
    right: .75rem;
    bottom: .75rem;
    display: grid;
    width: 2.15rem;
    height: 2.15rem;
    place-items: center;
    color: #fff;
    background: rgb(24 39 31 / 88%);
    border: 1px solid rgb(255 255 255 / 65%);
    border-radius: 50%;
    box-shadow: 0 .25rem .7rem rgb(0 0 0 / 20%);
    font-size: .85rem;
    font-weight: 700;
}

.gallery-card__body {
    padding: 1.25rem 1.35rem 1.4rem;
}

.gallery-card__count {
    margin: 0;
    color: #8e2527;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.gallery-card h2 {
    margin: .35rem 0 .45rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.65rem;
}

.gallery-card__description {
    color: #505651;
}

.gallery-card__action {
    display: inline-block;
    margin-top: .6rem;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.gallery-empty {
    padding: 4rem 1rem;
    text-align: center;
}

.gallery-empty .eyebrow {
    margin-bottom: .25rem;
}

@media (max-width: 900px) {
    .gallery-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .gallery-hero__inner,
    .gallery-layout {
        width: min(100% - 1.25rem, 1180px);
    }

    .gallery-index {
        align-items: start;
        flex-direction: column;
    }

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

    .gallery-card--left,
    .gallery-card--right {
        transform: none;
    }
}


.gallery-album-hero {
    padding: 3.6rem 1.5rem 3.2rem;
    color: #fff;
    background: linear-gradient(rgb(9 15 12 / 52%), rgb(9 15 12 / 82%)), url("/assets/images/home-hero.webp") center 58% / cover no-repeat;
}

.gallery-album-hero h1 {
    margin: .2rem 0 .7rem;
    color: #fff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.6rem, 6vw, 5rem);
    line-height: 1;
}

.gallery-album-hero p {
    max-width: 50rem;
}

.gallery-back-link {
    display: inline-block;
    margin-top: 1rem;
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.gallery-paper--not-found {
    padding-top: 6rem;
}

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

.gallery-media-card {
    overflow: hidden;
    background: #fffaf0;
    border: 1px solid #d8cdb9;
    box-shadow: 0 1rem 1.8rem rgb(66 47 27 / 13%);
}

.gallery-media-card__open {
    display: block;
    width: 100%;
    padding: 0;
    color: inherit;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.gallery-media-card__visual {
    position: relative;
    display: block;
    background: #eee8dc;
}

.gallery-media-card__visual img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
}

.gallery-media-card__type {
    position: absolute;
    right: .7rem;
    bottom: .7rem;
    display: grid;
    width: 2.15rem;
    height: 2.15rem;
    place-items: center;
    color: #fff;
    background: rgb(24 39 31 / 88%);
    border: 1px solid rgb(255 255 255 / 65%);
    border-radius: 50%;
    box-shadow: 0 .25rem .7rem rgb(0 0 0 / 20%);
}

.gallery-media-card__text {
    padding: 1rem 1.15rem 1.15rem;
}

.gallery-media-card__text h2 {
    margin: 0 0 .4rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.3rem;
}

.gallery-media-card__text p {
    margin: 0;
    color: #505651;
}

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

.gallery-viewer {
    position: fixed;
    z-index: 10000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1.25rem;
}

.gallery-viewer__backdrop {
    position: absolute;
    inset: 0;
    background: rgb(5 8 6 / 92%);
}

.gallery-viewer__dialog {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: minmax(0, 1fr) auto;
    width: min(96vw, 1500px);
    height: min(92vh, 1000px);
    overflow: hidden;
    background: #111612;
    border: 1px solid rgb(255 255 255 / 18%);
    box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 55%);
}

.gallery-viewer__stage {
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex;
    min-width: 0;
    min-height: 0;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 4.5rem;
    overflow: hidden;
}

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

.gallery-viewer__stage iframe {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

.gallery-viewer__video {
    position: relative;
    display: grid;
    width: min(100%, 1200px);
    aspect-ratio: 16 / 9;
    place-items: center;
    overflow: hidden;
    background: #000;
}

.gallery-viewer__video img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gallery-viewer__play {
    position: absolute;
    display: grid;
    width: 5rem;
    height: 5rem;
    place-items: center;
    color: #fff;
    background: rgb(24 39 31 / 90%);
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.6rem;
}

.gallery-viewer__video iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.gallery-viewer__nav,
.gallery-viewer__close {
    color: #fff;
    background: rgb(24 39 31 / 88%);
    border: 1px solid rgb(255 255 255 / 35%);
    cursor: pointer;
}

.gallery-viewer__nav {
    position: relative;
    z-index: 2;
    grid-row: 1;
    align-self: center;
    width: 3rem;
    height: 4rem;
    margin: .5rem;
    font-size: 2.4rem;
}

.gallery-viewer__nav--prev {
    grid-column: 1;
}

.gallery-viewer__nav--next {
    grid-column: 3;
}

.gallery-viewer__close {
    position: absolute;
    z-index: 2;
    top: .7rem;
    right: .7rem;
    width: 2.8rem;
    height: 2.8rem;
    font-size: 1.7rem;
    line-height: 1;
}

.gallery-viewer__info {
    grid-column: 1 / -1;
    grid-row: 2;
    max-height: 28vh;
    overflow: auto;
    padding: 1rem 4.5rem 1.15rem;
    color: #e8e5dc;
    background: #1a211c;
    border-top: 1px solid rgb(255 255 255 / 12%);
    text-align: center;
}

.gallery-viewer__counter {
    margin: 0 0 .3rem;
    color: #c8bca7;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.gallery-viewer__info h2 {
    margin: 0;
    color: #fff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.5rem;
}

.gallery-viewer__info p:last-child {
    margin: .45rem auto 0;
    max-width: 60rem;
}

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

@media (max-width: 900px) {
    .gallery-media-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gallery-viewer {
        padding: .5rem;
    }

    .gallery-viewer__dialog {
        width: 98vw;
        height: 96vh;
    }

    .gallery-viewer__info {
        padding-right: 3.5rem;
        padding-left: 3.5rem;
    }
}

@media (max-width: 620px) {
    .gallery-media-grid {
        grid-template-columns: 1fr;
    }

    .gallery-viewer__dialog {
        grid-template-columns: 2.5rem minmax(0, 1fr) 2.5rem;
    }

    .gallery-viewer__nav {
        width: 2.25rem;
        height: 3.5rem;
        margin: .1rem;
        font-size: 1.8rem;
    }

    .gallery-viewer__info {
        padding: .85rem 1rem 1rem;
    }
}

.gallery-back-link--secondary {
    margin-left: 1.25rem;
}

.gallery-media-card__map-link {
    display: inline-block;
    margin: .85rem 1.15rem 1rem;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

@media (max-width: 620px) {
    .gallery-back-link--secondary {
        display: block;
        margin-left: 0;
    }
}
