/* Namespaced markup avoids the CMS's container, wrapper and image tile rules. */
.gt-gallery {
    color: #292929;
    background: #fff;
}

.gt-gallery-source {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8vw;
    padding: 5vw 2.5vw;
}

.gt-gallery .gt-gallery-link {
    display: block;
    padding: 0;
    width: 100%;
}

.gt-gallery .gt-gallery-link figure.image {
    margin: 0;
    width: 100%;
}

.gt-gallery .gt-gallery-link img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 3px;
}

.gt-gallery.gt-ready {
    position: relative;
    height: 100svh;
    min-height: 320px;
    overflow: hidden;
    touch-action: none;
    overscroll-behavior: none;
    cursor: grab;
    user-select: none;
    isolation: isolate;
}

.gt-gallery.gt-ready > .gt-gallery-source {
    display: none;
}

body.gt-gallery-page {
    overflow: hidden;
}

body:has(.gallery-tiles-group) #footer {
    display: none !important;
}

body:has(.gallery-tiles-group) #main-nav {
    background-color: #292b31 !important;
}

body.gt-gallery-page .gt-gallery.gt-ready {
    position: fixed;
    inset: 0;
    z-index: 7;
    width: 100%;
    height: 100%;
}

/* Preserve the page heading for screen readers, behind the gallery canvas. */
body.gt-gallery-page main > .page-foto {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

.gt-gallery:focus-visible {
    outline: 2px solid #f32c2c;
    outline-offset: -4px;
}

.gt-gallery.gt-dragging {
    cursor: grabbing;
}

.gt-gallery-plane {
    position: absolute;
    inset: 0;
    will-change: transform;
}

.gt-gallery-sheet {
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(var(--gt-columns), var(--gt-cell));
    grid-auto-rows: var(--gt-cell);
}

.gt-gallery-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--gt-cell);
    height: var(--gt-cell);
}

.gt-gallery .gt-gallery-card {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: var(--gt-image-width);
    max-height: var(--gt-image-height);
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    transition: opacity 250ms ease;
    -webkit-user-drag: none;
}

.gt-gallery .gt-gallery-card img {
    display: block;
    width: 100%;
    height: auto;
    max-height: var(--gt-image-height);
    object-fit: cover;
    border-radius: 3px;
    pointer-events: none;
    -webkit-user-drag: none;
}

.gt-gallery.gt-selected .gt-gallery-card:not(.gt-active) {
    opacity: 0.2;
}

.gt-gallery-card:focus-visible {
    outline: 2px solid #f32c2c;
    outline-offset: 5px;
}

.gt-gallery-markers {
    position: absolute;
    inset: 16px;
    z-index: 2;
    pointer-events: none;
    background:
        linear-gradient(#333, #333) left center / 9px 1px no-repeat,
        linear-gradient(#333, #333) right center / 9px 1px no-repeat;
}

.gt-gallery-markers i,
.gt-gallery-panel-markers i {
    position: absolute;
    width: 9px;
    height: 9px;
    border: solid #333;
    border-width: 1px 0 0 1px;
}

.gt-gallery-markers i:nth-child(2),
.gt-gallery-panel-markers i:nth-child(2) {
    right: 0;
    transform: rotate(90deg);
}

.gt-gallery-markers i:nth-child(3),
.gt-gallery-panel-markers i:nth-child(3) {
    bottom: 0;
    transform: rotate(-90deg);
}

.gt-gallery-markers i:nth-child(4),
.gt-gallery-panel-markers i:nth-child(4) {
    right: 0;
    bottom: 0;
    transform: rotate(180deg);
}

.gt-gallery-cursor {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
    padding: 8px 10px;
    background: #f32c2c;
    color: #fff;
    font: 10px/1.3 'Chivo Mono', monospace;
    text-transform: uppercase;
    white-space: nowrap;
    pointer-events: none;
}

.gt-gallery-cursor[hidden] {
    display: none;
}

dialog.gt-gallery-panel {
    position: fixed;
    inset: auto 2.78vw 2.78vw auto;
    z-index: 1001;
    box-sizing: border-box;
    width: 22.22vw;
    max-width: 420px;
    min-width: 260px;
    max-height: calc(100svh - 100px);
    margin: 0;
    padding: 0;
    border: 0;
    overflow: visible;
    background: #fff;
    color: #222;
    font: 10px/1.3 'Chivo Mono', monospace;
    text-transform: uppercase;
}

dialog.gt-gallery-panel:not([open]) {
    display: none;
}

.gt-gallery-panel-markers {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.gt-gallery-panel-bar {
    position: absolute;
    bottom: 100%;
    left: 0;
    display: flex;
    max-width: 100%;
    gap: 4px;
    touch-action: none;
    user-select: none;
}

.gt-gallery-panel-title {
    padding: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
    background: #292929;
    cursor: move;
}

.gt-gallery-panel-title::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 6px;
    background: #fff;
}

.gt-gallery-panel .gt-gallery-close {
    flex: 0 0 28px;
    margin: 0;
    padding: 4px;
    border: 0;
    border-radius: 0;
    color: #fff;
    background: #292929;
    font: 16px/1 monospace;
    cursor: pointer;
}

.gt-gallery-close:focus-visible {
    outline: 2px solid #f32c2c;
    outline-offset: 2px;
}

.gt-gallery-panel-content {
    box-sizing: border-box;
    padding: 16px;
    border: 1px solid #d0d0d0;
    max-height: calc(100svh - 100px);
    overflow: auto;
    overscroll-behavior: contain;
}

.gt-gallery-panel .gt-gallery-preview {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 0;
}

.gt-gallery-panel-photo {
    position: relative;
}

.gt-gallery-credit {
    position: absolute;
    right: 14px;
    bottom: 14px;
    max-width: calc(100% - 28px);
    padding: 8px;
    background: #292929;
    color: #fff;
    font: inherit;
    overflow-wrap: anywhere;
}

.gt-gallery-credit-by {
    opacity: 0.65;
}

.gt-gallery-credit-author {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.gt-gallery-panel .gt-gallery-description {
    margin: 16px 0 0;
    color: inherit;
    font: inherit;
    text-align: justify;
    white-space: pre-line;
}

.gt-gallery-credit[hidden],
.gt-gallery-description[hidden] {
    display: none;
}

@media (max-width: 767.5px) {
    .gt-gallery-source {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    dialog.gt-gallery-panel {
        width: 82%;
        min-width: 0;
        right: 9%;
        bottom: 4.5%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gt-gallery .gt-gallery-card {
        transition: none;
    }
}
