/*
  Gallery restyle.
  Easiest: paste this at the very end of assets/css/style.css.
  Or save as assets/css/gallery.css and link it after style.css.
*/
.otava-gallery .gallery-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-auto-rows: auto;
    align-items: start;
    gap: clamp(0.75rem, 1.35vw, 1.15rem);
}

.otava-gallery .gallery-card,
.otava-gallery .gallery-card--featured,
.otava-gallery .gallery-card--wide {
    position: relative;
    display: block;
    align-self: start;
    min-width: 0;
    height: fit-content;
    grid-column: auto;
    grid-row: auto;
    margin: 0;
    overflow: hidden;
    border: 1px solid #292929;
    border-radius: 15px;
    background: #181818;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
    transition: border-color 220ms ease, transform 220ms ease;
}

.otava-gallery .gallery-card:hover {
    transform: translateY(-3px);
    border-color: rgba(216, 180, 106, 0.58);
}

.otava-gallery .gallery-card img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: initial;
    object-position: initial;
    background: #090909;
    filter: none;
}

.otava-gallery .gallery-card figcaption {
    position: static;
    display: flex;
    min-height: 3.75rem;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    padding: 0.85rem 0.65rem;
    border-top: 1px solid #262626;
    color: #f4f0e8;
    background: #181818;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
}

.otava-gallery .gallery-card figcaption span {
    flex: 0 0 auto;
    color: #d8b46a;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.13em;
}

.otava-gallery .gallery-more {
    margin-top: 1.6rem;
}

.otava-gallery .gallery-more summary {
    display: flex;
    width: fit-content;
    max-width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 0.95rem 1.15rem;
    border: 1px solid rgba(216, 180, 106, 0.7);
    color: #f4f0e8;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    list-style: none;
    text-transform: uppercase;
}

.otava-gallery .gallery-more summary::-webkit-details-marker {
    display: none;
}

.otava-gallery .gallery-more summary::after {
    color: #d8b46a;
    content: "+";
    font-size: 1.2rem;
    line-height: 1;
}

.otava-gallery .gallery-more[open] summary::after {
    content: "−";
}

.otava-gallery .gallery-more summary:hover {
    color: #090909;
    background: #d8b46a;
}

.otava-gallery .gallery-more summary:hover::after {
    color: #090909;
}

.otava-gallery .gallery-more summary:focus-visible {
    outline: 2px solid #d8b46a;
    outline-offset: 4px;
}

.otava-gallery .gallery-more-label--close,
.otava-gallery .gallery-more[open] .gallery-more-label--open {
    display: none;
}

.otava-gallery .gallery-more[open] .gallery-more-label--close {
    display: inline;
}

.otava-gallery .gallery-grid--more {
    margin-top: 1.1rem;
}

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

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

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

    .otava-gallery .gallery-card,
    .otava-gallery .gallery-card--featured,
    .otava-gallery .gallery-card--wide {
        border-radius: 11px;
    }

    .otava-gallery .gallery-card figcaption {
        min-height: 3.4rem;
        gap: 0.4rem;
        padding: 0.7rem 0.45rem;
        font-size: 0.72rem;
    }

    .otava-gallery .gallery-more summary {
        width: 100%;
    }
}

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

@media (prefers-reduced-motion: reduce) {
    .otava-gallery .gallery-card,
    .otava-gallery .gallery-more summary {
        transition: none;
    }
}


/* Always make the gallery toggle text readable */
.otava-gallery .gallery-more summary {
    color: #171717;
    background: #d8b46a;
    opacity: 1;
    visibility: visible;
}

/* Keep the text readable on hover */
.otava-gallery .gallery-more summary:hover {
    color: #090909;
    background: #e5c782;
}

.otava-gallery .gallery-more summary::after {
    color: #090909;
}

.otava-gallery .gallery-more summary:hover::after {
    color: #090909;
}
