/*
 * The theme renders list-view galleries as a CSS multi-column masonry layout
 * (.wp-block-gallery.columns-N { columns: N }) and forces every .wp-block-image
 * to width:100% !important (100% of its own column). The carousel wrapper below
 * is the gallery figure's only direct child, so without this reset it gets
 * squeezed into a single masonry column, and its cells (also .wp-block-image)
 * would collapse to that same narrow width and stack on top of each other.
 *
 * It matches the theme's edge-to-edge viewport bleed (is-full-page-width) but
 * caps it at max-width:1344px (via width:100vw + margin-left:50% + a -50%
 * translate, which re-centers correctly once max-width clamps the box, unlike
 * a fixed negative margin) so it doesn't stretch edge to edge on ultra-wide
 * screens.
 */
.wp-block-gallery.afz-gallery-is-carousel {
    display: block;
    box-sizing: border-box;
    width: 100vw;
    max-width: 1344px;
    margin-left: 50%;
    transform: translateX(-50%);
    padding: 0 15px;
    columns: initial !important;
}

.afz-gallery-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.afz-gallery-carousel .afz-gallery-carousel-track {
    display: flex;
}

/*
 * .gallery-hover-card is normally forced to position:relative !important (below,
 * so its hover overlay children can position against it). That same !important
 * beats Flickity's own inline position:absolute on carousel cells, which is how
 * Flickity stacks/slides them — without this override every cell collapses onto
 * the same spot instead of sitting side by side.
 *
 * Height is the fixed dimension here — every card is exactly --afz-gallery-height
 * tall — and width is left auto so each card shrink-wraps to its image's own
 * natural aspect ratio. That's deliberate: with object-fit:cover and a forced
 * ratio, tall/narrow (portrait) source images would get cropped, and at gap:0
 * the crop mismatch stopped adjacent images from lining up flush ("connecting").
 * Natural width means every image shows in full and butts up cleanly.
 */
.wp-block-gallery.afz-gallery-is-carousel .afz-gallery-carousel-track .carousel-cell {
    position: absolute !important;
    height: var(--afz-gallery-height, 400px) !important;
    width: auto !important;
    margin-right: var(--afz-gallery-gap, 16px) !important;
    margin-bottom: 0 !important;
}

.wp-block-gallery.afz-gallery-is-carousel .afz-gallery-carousel-track .carousel-cell:last-child {
    margin-right: 0 !important;
}

.wp-block-gallery.afz-gallery-is-carousel .afz-gallery-carousel-track .carousel-cell .lightbox-trigger {
    height: 100%;
    width: auto;
}

.wp-block-gallery.afz-gallery-is-carousel .afz-gallery-carousel-track .carousel-cell .lightbox-trigger img {
    height: 100% !important;
    width: auto !important;
}

.afz-gallery-carousel .arrow {
    display: none;
    position: absolute;
    top: 50%;
    z-index: 1;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    width: 37px;
    height: 37px;
    border: unset !important;
    background-color: var(--bulma-primary) !important;
    color: var(--bulma-black);
    cursor: pointer;
    transform: translateY(-50%);
}

.afz-gallery-carousel .arrow:hover {
    background-color: var(--bulma-white) !important;
}

.afz-gallery-carousel .arrow .fa {
    font-size: 16px;
    font-weight: 400;
    border: unset !important;
}

.afz-gallery-carousel .previous.arrow {
    left: 10px;
}

.afz-gallery-carousel .next.arrow {
    right: 10px;
}

.afz-gallery-carousel .next.arrow i {
    transform: rotate(-90deg) !important;
}

.afz-gallery-carousel .next.arrow i:before {
    content: "V";
    font-size: var(--bulma-size-6);
    font-weight: 800;
}

.afz-gallery-carousel .previous.arrow i {
    transform: rotate(90deg) !important;
}

.afz-gallery-carousel .previous.arrow i:before {
    content: "V";
    font-size: var(--bulma-size-6);
    font-weight: 800;
}

@media (min-width: 769px) {
    .afz-gallery-is-carousel:hover .afz-gallery-carousel .arrow {
        display: flex;
    }
}

.afz-gallery-carousel .flickity-viewport {
    width: 100%;
}

@media (max-width: 768px) {
    .wp-block-gallery.afz-gallery-is-carousel .afz-gallery-carousel-track .carousel-cell {
        height: min(var(--afz-gallery-height, 400px), 260px) !important;
    }

    .afz-gallery-is-carousel {
        padding: 0 !important;
    }
}

.wp-block-gallery a.lightbox-trigger {
    position: relative;
    display: block;
    overflow: hidden;
}

.wp-block-gallery a.lightbox-trigger img {
    display: block;
    width: 100%;
    transition: transform 0.35s ease;
}

.wp-block-gallery a.lightbox-trigger::after {
    content: "";
    position: absolute;
    inset: 0;
    background: #000;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.wp-block-gallery a.lightbox-trigger:hover img {
    transform: scale(1.1);
}

.wp-block-gallery a.lightbox-trigger:hover::after {
    opacity: 0.5;
}

.wp-block-gallery a.lightbox-trigger .lightbox-filename {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 1;
    color: #fff;
    font-size: var(--bulma-size-5);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;

    @media (max-width: 768px) {
        font-size: var(--bulma-size-6);
    }
}

.wp-block-gallery a.lightbox-trigger:hover .lightbox-filename {
    opacity: 1;
}

.wp-block-gallery .gallery-hover-card {
    position: relative !important;
    overflow: hidden !important;
}

.wp-block-gallery .gallery-hover-card:hover .lightbox-trigger img {
    transform: scale(1.1);
}

.wp-block-gallery .gallery-hover-card:hover .lightbox-trigger::after {
    opacity: 0.5;
}

.wp-block-gallery .gallery-hover-card:hover .gallery-hover-actions,
.wp-block-gallery .gallery-hover-card:hover .gallery-hover-info {
    opacity: 1;
}

.wp-block-gallery .gallery-hover-card:hover .gallery-hover-actions {
    pointer-events: auto;
}

.wp-block-gallery .gallery-hover-card .gallery-hover-actions {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    left: auto !important;
    bottom: auto !important;
    z-index: 3;
    width: 88px !important;
    height: 40px !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.wp-block-gallery .gallery-hover-card .gallery-hover-actions .image-download,
.wp-block-gallery .gallery-hover-card .gallery-hover-actions .afz-share-toggle {
    position: absolute !important;
    top: 0 !important;
    bottom: auto !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px !important;
    height: 40px !important;
    border: none;
    border-radius: 50px;
    background: var(--bulma-primary, #26403e);
    color: var(--bulma-black, #fff);
    cursor: pointer;
    transition: background 0.2s ease;
}

.wp-block-gallery .gallery-hover-card .gallery-hover-actions .image-download:hover,
.wp-block-gallery .gallery-hover-card .gallery-hover-actions .afz-share-toggle:hover {
    background: var(--bulma-white);
}

.wp-block-gallery .gallery-hover-card .gallery-hover-actions .image-download i,
.wp-block-gallery .gallery-hover-card .gallery-hover-actions .afz-share-toggle i {
    pointer-events: none;
}

.wp-block-gallery .gallery-hover-card .gallery-hover-actions .afz-share-toggle {
    right: 0 !important;
    left: auto !important;
}

.wp-block-gallery .gallery-hover-card .gallery-hover-actions .image-download {
    right: 48px !important;
    left: auto !important;
}

.wp-block-gallery .gallery-hover-card .gallery-hover-info {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    width: auto !important;
    height: auto !important;
    z-index: 2;
    padding: 16px 12px 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0));
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.wp-block-gallery .gallery-hover-card .gallery-hover-description {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 10px;
    color: #fff;
    font-size: var(--bulma-size-5);
    line-height: 1.4;

    @media (max-width: 768px) {
        font-size: var(--bulma-size-6);
    }
}

.wp-block-gallery .gallery-hover-card .gallery-hover-meta {
    display: flex !important;
    align-items: center;
    gap: 8px;
}

.wp-block-gallery .gallery-hover-card .gallery-hover-logo {
    width: 30px !important;
    height: 35px !important;
    object-fit: contain !important;
    flex: 0 0 auto !important;
}

.wp-block-gallery .gallery-hover-card .gallery-hover-meta-text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.wp-block-gallery .gallery-hover-card .gallery-hover-filename,
.wp-block-gallery .gallery-hover-card .gallery-hover-credit {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: var(--bulma-size-5);

    @media (max-width: 768px) {
        font-size: var(--bulma-size-6);
    }
}

.wp-block-gallery .gallery-hover-card .gallery-hover-filename {
    color: #fff;
    font-weight: 700;
}

.wp-block-gallery .gallery-hover-card .gallery-hover-credit {
    color: rgba(255, 255, 255, 0.75);
}

.glb-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    flex-direction: column;
    background: rgba(10, 10, 10, 0.95);
}

.glb-overlay.is-open {
    display: flex;
}

.glb-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50px;
    background: var(--bulma-primary, #26403e);
    color: var(--bulma-black, #fff);
    cursor: pointer;
}

.glb-btn:hover {
    background: var(--bulma-white);
}

.glb-btn.is-visible {
    display: flex;
}

.glb-download-btn,
.glb-share-btn,
.glb-fullscreen-btn {
    display: none;
}

.glb-download-btn.is-visible,
.glb-share-btn.is-visible,
.glb-fullscreen-btn.is-visible {
    display: flex;
}

.glb-share-btn i {
    pointer-events: none;
}

.glb-close-btn {
    width: auto;
    height: auto;
    padding: 6px 4px;
    gap: 8px;
    margin-left: auto;
    background: transparent;
    color: var(--bulma-white);
}

.glb-close-btn:hover {
    background: transparent;
    opacity: 0.75;
}

.glb-btn:focus,
.glb-nav:focus,
.glb-panel-toggle:focus,
.glb-panel-readmore:focus {
    outline: none;
}

.glb-btn:focus-visible,
.glb-nav:focus-visible,
.glb-panel-toggle:focus-visible,
.glb-panel-readmore:focus-visible {
    outline: unset !important;
}

/* Share dropdown — matches the site's standard social-share panel design. */
.afz-share-menu {
    position: fixed;
    z-index: 1000000;
    min-width: 220px;
    padding: 10px;
    border-radius: var(--bulma-radius-medium, 8px);
    border: 1px solid #b0b0b0;
    background-color: var(--bulma-white, #fff);
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
}

.afz-share-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 16px;
    border-radius: var(--bulma-radius-medium, 8px);
    color: var(--bulma-text, #26403e);
    font-size: var(--bulma-size-6, 0.9rem);
    font-weight: 700;
    text-decoration: none;
}

.afz-share-menu a:hover {
    background: var(--bulma-light, #0a0a0a);
}

.afz-share-menu a i {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border-radius: 99px;
    background-color: var(--bulma-primary, #26403e);
    color: var(--bulma-white, #fff);
    font-size: var(--bulma-size-6, 0.9rem);
}

.glb-close-text {
    font-size: var(--bulma-size-5);
    font-weight: 600;
    color: var(--bulma-white, #fff);

    @media (max-width: 768px) {
        font-size: var(--bulma-size-6);
    }
}

.glb-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    right: auto;
    box-sizing: border-box;
    z-index: 5;
    padding: 16px;
    color: var(--bulma-white, #fff);
}

.glb-counter {
    font-size: var(--bulma-size-5);
    opacity: 0.8;

    @media (max-width: 768px) {
        font-size: var(--bulma-size-6);
    }
}

.glb-topbar-actions {
    display: flex;
    gap: 8px;
    padding-bottom: 10px;
}

.glb-body {
    --glb-panel-width: min(408px, 85vw);
    --glb-topbar-height: 64px;
    --glb-chrome-width: 220px;
    position: relative;
    display: flex;
    justify-content: center;
    flex: 1;
    min-height: 0;
}

.glb-nav {
    display: none;
    position: absolute;
    top: 50%;
    z-index: 1;
    transform: translateY(-50%);
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border: none;
    background: none;
    color: var(--bulma-white, #fff);
    font-size: 2rem;
    cursor: pointer;
    filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.55));
    transition: opacity 0.15s ease;
}

.glb-nav.is-visible {
    display: flex;
}

.glb-nav:hover {
    opacity: 0.75;
}

.glb-nav-prev {
    left: 16px;
}

.glb-nav-next {
    right: 16px;
}

.glb-body-content {
    display: flex;
    flex-direction: column;
    padding: 16px;
    margin: auto;
}

.glb-group {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    min-width: 0;
    align-self: center;
}

.glb-stage {
    position: relative;
    flex: 0 0 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;
    cursor: grab;
    touch-action: pan-y;
}

.glb-stage:active {
    cursor: grabbing;
}

.glb-stage.is-zoomed {
    touch-action: none;
}

.glb-image {
    display: block;
    max-width: calc(100vw - var(--glb-chrome-width));
    max-height: min(70vh, 100vh - var(--glb-topbar-height));
    min-width: 0;
    min-height: 0;
    height: 100%;
    object-fit: cover;
    transform-origin: center center;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-drag: none;
}

.glb-overlay.panel-open .glb-image {
    max-width: calc(100vw - var(--glb-chrome-width) - var(--glb-panel-width));
}

.glb-image.is-animating {
    transition: transform 0.25s ease;
}

.glb-image.is-zoomed {
    cursor: grab;
    touch-action: none;
}

.glb-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: glb-spin 0.8s linear infinite;
    pointer-events: none;
}

.glb-stage.is-loading .glb-spinner {
    display: block;
}

@keyframes glb-spin {
    to {
        transform: rotate(360deg);
    }
}

.glb-swipe-hint {
    position: absolute;
    left: 50%;
    bottom: 20px;
    z-index: 4;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.65);
    color: var(--bulma-white, #fff);
    font-size: var(--bulma-size-5);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%);
    transition: opacity 0.3s ease;

    @media (max-width: 768px) {
        font-size: var(--bulma-size-6);
    }
}

.glb-panel-toggle {
    display: none;
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 6;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50px;
    background: var(--bulma-primary, #26403e);
    color: var(--bulma-black, #fff);
    font-size: 20px;
    cursor: pointer;
}

.glb-panel-toggle.is-visible {
    display: flex;
}

.glb-panel-toggle:hover {
    background: var(--bulma-white);
}

.glb-panel {
    flex: 0 0 auto;
    width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    background: var(--bulma-black);
    color: #fff;
    transition: width 0.3s ease;
}

.glb-panel.is-open {
    width: var(--glb-panel-width);
}

.glb-panel-top {
    width: var(--glb-panel-width);
    padding: 20px 20px 0;
    box-sizing: border-box;
}

.glb-panel-bottom {
    width: var(--glb-panel-width);
    padding: 0 20px 20px;
    box-sizing: border-box;
}

.glb-panel-bottom-inner {
    padding: 12px;
    background: var(--bulma-dark);
}

.glb-panel-rows {
    .glb-panel-row {
        padding-bottom: 7px;

        &:last-child {
            padding-bottom: 0
        }
    }
}

.glb-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}

.glb-panel-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
}

.glb-panel-brand {
    font-size: var(--bulma-size-5);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.75;

    @media (max-width: 768px) {
        font-size: var(--bulma-size-6);
    }
}

.glb-panel-title {
    margin: 0 0 10px;
    font-size: var(--bulma-size-4);
    font-weight: 700;
    line-height: 1.3;

    @media (max-width: 768px) {
        font-size: var(--bulma-size-5);
    }
}

.glb-panel-description-wrap {
    position: relative;
    display: none;
    margin-bottom: 20px;
}

.glb-panel-description-wrap.has-description {
    display: block;
}

.glb-panel-description-wrap:not(.is-expanded) .glb-panel-description {
    max-height: 7.5em;
    overflow: hidden;
}

.glb-panel-description-wrap.is-clamped:not(.is-expanded)::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 22px;
    height: 2.4em;
    background: linear-gradient(to bottom, rgba(13, 21, 18, 0), var(--bulma-black));
    pointer-events: none;
}

.glb-panel-description {
    margin: 0;
    font-size: var(--bulma-size-5);
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.75);

    @media (max-width: 768px) {
        font-size: var(--bulma-size-6);
    }
}

.glb-panel-readmore {
    display: none;
    position: relative;
    margin-top: 6px;
    padding: 0;
    border: none;
    background: none;
    color: #fff;
    font-size: var(--bulma-size-5);
    font-weight: 400;
    text-decoration: underline;
    cursor: pointer;

    @media (max-width: 768px) {
        font-size: var(--bulma-size-6);
    }
}

.glb-panel-readmore.is-visible {
    display: inline-block;
}

.glb-panel-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.glb-panel-label {
    font-size: var(--bulma-size-5);
    opacity: 0.65;
    white-space: nowrap;

    @media (max-width: 768px) {
        font-size: var(--bulma-size-6);
    }
}

.glb-panel-value {
    font-size: var(--bulma-size-5);
    font-weight: 400;
    line-height: 1.4;
    text-align: right;
    word-break: break-word;

    @media (max-width: 768px) {
        font-size: var(--bulma-size-6);
    }
}

.glb-panel-tags-section {
    display: none;
    margin-top: 16px;
}

.glb-panel-tags-section.has-tags {
    display: block;
}

.glb-panel-tags-title {
    margin-bottom: 10px;
    font-size: var(--bulma-size-5);
    opacity: 0.65;

    @media (max-width: 768px) {
        font-size: var(--bulma-size-6);
    }
}

.glb-panel-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.glb-panel-tag,
.glb-panel-tag-more {
    display: inline-flex;
    align-items: center;
    padding: 7px 16px;
    border: none;
    border-radius: 50px;
    background: var(--bulma-primary, #26403e);
    color: var(--bulma-black, #fff);
    font-size: var(--bulma-size-7);
    line-height: 1.2;
    white-space: nowrap;
}

.glb-panel-tag-more {
    cursor: pointer;
    transition: background 0.2s ease;
}

.glb-panel-tag-more:hover,
.glb-panel-tag-more.is-open {
    background: var(--bulma-white);
}

.glb-tags-popover {
    position: fixed;
    z-index: 1000000;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 160px;
    max-width: 260px;
    padding: 10px;
    border-radius: var(--bulma-radius-medium, 8px);
    background: var(--bulma-primary, #0d1512);
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.35);

    span {
        padding: 5px 8px;
        border-radius: 6px;
        color: var(--bulma-black, #fff);
        font-size: var(--bulma-size-7);
    }
}

body.glb-scroll-lock {
    position: fixed;
    left: 0;
    right: 0;
    overflow: hidden;
}

@media (max-width: 1279px) {
    .glb-body {
        --glb-chrome-width: 96px;
    }

    .glb-close-text {
        display: none;
    }

    .glb-overlay.panel-open .glb-image {
        max-width: calc(100vw - var(--glb-chrome-width));
    }

    .glb-topbar {
        position: static;
        margin-bottom: 16px;
    }

    .glb-topbar-actions {
        width: var(--glb-image-width, 100%);
        max-width: 100%;
        align-self: center;
        box-sizing: border-box;
    }

    .glb-body-content {
        width: 100%;
        min-height: 0;
        margin: 0 auto;
    }

    .glb-group {
        flex: 1 1 auto;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        align-self: stretch;
        min-width: 0;
        min-height: 0;
        padding: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        overscroll-behavior: contain;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .glb-group::-webkit-scrollbar {
        display: none;
    }

    .glb-stage {
        flex: 0 0 auto;
        min-width: 0;
    }

    .glb-panel {
        display: contents;
    }

    .glb-panel-top,
    .glb-panel-bottom {
        display: grid;
        grid-template-rows: minmax(0, 0fr);
        width: var(--glb-image-width, 100%);
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        background: var(--bulma-black);
        color: #fff;
        opacity: 0;
        transition: grid-template-rows 0.35s ease, opacity 0.3s ease, transform 0.35s ease;
    }

    .glb-overlay.panel-open .glb-panel-top,
    .glb-overlay.panel-open .glb-panel-bottom {
        grid-template-rows: minmax(0, 1fr);
        opacity: 1;
        transform: translateY(0);
    }

    .glb-panel-top {
        order: -1;
        transform: translateY(-16px);
    }

    .glb-panel-bottom {
        order: 1;
        transform: translateY(16px);
        padding-top: 16px;
    }

    .glb-panel-top-inner,
    .glb-panel-bottom-content {
        min-height: 0;
        overflow: hidden;
    }

    .glb-nav.is-visible {
        display: none;
    }

    .glb-swipe-hint.is-visible {
        opacity: 1;
    }
}

@media (max-width: 766px) {
    .glb-body {
        --glb-chrome-width: 32px;
    }
}

.flickity-button:focus {
    box-shadow: unset !important;
}
