/* Galleries: a horizontal carousel for articles, a grid for standalone pages,
   and the lightbox both of them open. Colours follow the site palette
   (#121212 ground, #c9a84c gold, #2a2a2a borders). */

.gallery-title {
    font-family: 'Cinzel', serif;
    margin: 32px 0 12px;
}

.gallery-intro {
    color: #b0b0b0;
    margin-bottom: 24px;
}

/* Carousel */

.gallery-carousel {
    position: relative;
    margin: 32px 0;
}

.gallery-track {
    display: flex;
    column-gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 16px;
    padding-bottom: 12px;
    scrollbar-width: thin;
    scrollbar-color: #c9a84c #1e1e1e;
}

.gallery-track::-webkit-scrollbar {
    height: 8px;
}

.gallery-track::-webkit-scrollbar-thumb {
    background: #c9a84c;
    border-radius: 4px;
}

.gallery-slide {
    flex: 0 0 auto;
    scroll-snap-align: start;
    max-width: 90%;
}

.gallery-slide img {
    display: block;
    height: 340px;
    width: auto;
    max-width: 100%;
    object-fit: cover;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    cursor: zoom-in;
}

.gallery-slide figcaption,
.gallery-item figcaption {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #a0a0a0;
}

.gallery-arrow {
    position: absolute;
    top: 150px;
    z-index: 5;
    width: 42px;
    height: 42px;
    border: 1px solid #2a2a2a;
    border-radius: 50%;
    background: rgba(18, 18, 18, 0.9);
    color: #c9a84c;
    cursor: pointer;
    transition: opacity 0.3s, color 0.3s;
}

.gallery-arrow:hover {
    color: #e5c87b;
}

.gallery-arrow--prev { left: -8px; }
.gallery-arrow--next { right: -8px; }

.gallery-arrow.is-disabled {
    opacity: 0.25;
    pointer-events: none;
}

/* Grid */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin: 32px 0;
}

.gallery-item img {
    display: block;
    width: 100%;
    height: 220px;
    object-fit: cover;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    cursor: zoom-in;
}

/* Lightbox */

.gallery-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.92);
    padding: 40px 20px;
    text-align: center;
}

.gallery-lightbox.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gallery-lightbox img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 6px;
}

.gallery-lightbox-caption {
    margin-top: 12px;
    color: #d0d0d0;
}

.gallery-lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #e0e0e0;
    font-size: 1.1rem;
    cursor: pointer;
}

.gallery-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.16);
}

/* Article extras that came with the block editor */

.article-figure {
    margin: 24px 0;
}

.article-figure--wide {
    margin-left: -40px;
    margin-right: -40px;
}

.article-figure--full img {
    width: 100%;
}

.article-figure figcaption {
    margin-top: 8px;
    font-size: 0.85rem;
    color: #a0a0a0;
    text-align: center;
}

.article-callout {
    display: flex;
    gap: 12px;
    padding: 16px 18px;
    margin: 24px 0;
    border-left: 3px solid #c9a84c;
    border-radius: 4px;
    background: #1b1b1b;
}

.article-callout--warning {
    border-left-color: #c75c5c;
}

.article-callout i {
    color: #c9a84c;
    margin-top: 4px;
}

.article-callout--warning i {
    color: #c75c5c;
}

.article-callout p:last-child {
    margin-bottom: 0;
}

.article-quote {
    margin: 24px 0;
    padding: 12px 20px;
    border-left: 3px solid #c9a84c;
    font-style: italic;
    color: #d0d0d0;
}

.article-quote cite {
    display: block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: #a0a0a0;
    font-style: normal;
}

.article-embed {
    margin: 24px 0;
}

.article-embed iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
}

.article-related {
    margin-top: 32px;
}

.filter-empty {
    margin-top: 16px;
    color: #a0a0a0;
}

@media (max-width: 768px) {
    .article-figure--wide {
        margin-left: 0;
        margin-right: 0;
    }

    .gallery-slide img {
        height: 240px;
    }

    .gallery-arrow {
        top: 100px;
    }
}
