/* Standard condiviso per le gallerie fotografiche. */
.gallery-page .gallery-hero {
    padding: 64px 0 34px;
}

.gallery-page .gallery-eyebrow {
    margin: 0 0 8px;
    color: #765100;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.gallery-page .gallery-hero h1 {
    margin: 0 0 18px;
    color: #1a1a1a;
    font-family: Roboto, Arial, sans-serif;
    font-size: 40px;
    line-height: 1.2;
}

.gallery-page .gallery-lead {
    max-width: 75ch;
    margin: 0;
    color: #333;
    font-size: 18px;
    line-height: 1.7;
}

.gallery-page .gallery-section {
    padding: 12px 0 72px;
}

.gallery-page .gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.gallery-page .gallery-card {
    min-width: 0;
}

.gallery-page .gallery-card figure {
    height: 100%;
    margin: 0;
    overflow: hidden;
    border: 1px solid #d5d5d5;
    border-bottom: 4px solid #ffbc13;
    background: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .08);
}

.gallery-page .gallery-link {
    position: relative;
    display: block;
    overflow: hidden;
    color: inherit;
    background: #e5e5e5;
}

.gallery-page .gallery-link img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 8 / 5;
    object-fit: cover;
    transition: transform .25s ease;
}

.gallery-page .gallery-link::after {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    color: #1a1a1a;
    background: #ffbc13;
    font: 700 24px/1 Arial, sans-serif;
    content: "+";
}

.gallery-page .gallery-link:hover img,
.gallery-page .gallery-link:focus-visible img {
    transform: scale(1.035);
}

.gallery-page .gallery-card figcaption {
    min-height: 86px;
    padding: 16px 18px 18px;
    color: #333;
    font-size: 15px;
    line-height: 1.55;
}

.gallery-page .gallery-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    margin-top: 40px;
    padding: 30px;
    color: #fff;
    background: #1a1a1a;
}

.gallery-page .gallery-actions p {
    margin: 0;
    color: #e5e5e5;
    font-size: 17px;
}

.gallery-page .gallery-actions-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.gallery-page .gallery-actions a {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    padding: 12px 18px;
    color: #1a1a1a;
    background: #ffbc13;
    font-weight: 700;
}

.gallery-page .gallery-actions .gallery-secondary-action {
    color: #fff;
    border: 2px solid #ffbc13;
    background: transparent;
}

.gallery-page :focus-visible {
    outline: 3px solid #005fcc;
    outline-offset: 3px;
}

.gallery-dialog {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    width: 100%;
    height: 100%;
    padding: 16px;
    overflow: auto;
    place-items: center;
    border: 0;
    color: #fff;
    background: rgba(0, 0, 0, .86);
}

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

.gallery-dialog-inner {
    display: grid;
    width: min(1040px, 100%);
    max-height: calc(100vh - 32px);
    overflow: hidden;
    grid-template-columns: 56px minmax(0, 1fr) 56px;
    grid-template-rows: auto minmax(0, 1fr);
    align-items: center;
    background: #111;
    box-shadow: 0 18px 70px rgba(0, 0, 0, .55);
}

.gallery-dialog-header {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    padding-left: 18px;
    border-bottom: 1px solid #444;
}

.gallery-counter {
    margin: 0;
    color: #eee;
    font-weight: 700;
}

.gallery-dialog button {
    display: inline-grid;
    min-width: 48px;
    min-height: 48px;
    padding: 0;
    place-items: center;
    border: 0;
    color: #fff;
    background: transparent;
    font: inherit;
    cursor: pointer;
}

.gallery-dialog button:hover,
.gallery-dialog button:focus-visible {
    color: #1a1a1a;
    background: #ffbc13;
}

.gallery-close {
    font-size: 28px !important;
}

.gallery-previous,
.gallery-next {
    font-size: 34px !important;
}

.gallery-dialog figure {
    min-width: 0;
    margin: 0;
    padding: 16px 10px 20px;
    text-align: center;
}

.gallery-dialog img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: calc(100vh - 160px);
    margin: 0 auto;
    object-fit: contain;
}

.gallery-dialog figcaption {
    margin-top: 13px;
    color: #eee;
    line-height: 1.5;
}

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

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

    .gallery-page .gallery-card figcaption {
        min-height: 0;
    }
}

@media (max-width: 600px) {
    .gallery-page .gallery-hero {
        padding: 48px 0 28px;
    }

    .gallery-page .gallery-hero h1 {
        font-size: 32px;
    }

    .gallery-page .gallery-lead {
        font-size: 17px;
    }

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

    .gallery-page .gallery-actions,
    .gallery-page .gallery-actions-links {
        display: grid;
    }

    .gallery-page .gallery-actions a {
        justify-content: center;
        text-align: center;
    }

    .gallery-dialog {
        padding: 8px;
    }

    .gallery-dialog-inner {
        max-height: calc(100vh - 16px);
        grid-template-columns: 48px minmax(0, 1fr) 48px;
    }

    .gallery-dialog figure {
        padding-right: 4px;
        padding-left: 4px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-page *,
    .gallery-page *::before,
    .gallery-page *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
