/* ═══════════════════════════════════════════
   Istadoor — Exhibitions
   Listing (Gallery page) + Single + Lightbox
   ═══════════════════════════════════════════ */

:root {
    --exh-text: #ffffff;
    --exh-muted: rgba(255, 255, 255, 0.58);
    --exh-faint: rgba(255, 255, 255, 0.12);
    --exh-tile: #26252b;
    --exh-accent: #f2b31b; /* Istadoor yellow */
    --exh-radius: 2px;
    --exh-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

.exh-wrap {
    padding: 56px 0 104px;
    color: var(--exh-text);
    font-family: inherit;
}

.exh-wrap *,
.exh-wrap *::before,
.exh-wrap *::after {
    box-sizing: border-box;
}

.exh-empty {
    margin: 40px 0;
    color: var(--exh-muted);
    font-size: 15px;
    line-height: 1.9;
    text-align: center;
}

.exh-empty a {
    color: var(--exh-accent);
}
/* ───────────── Archive (Gallery page, no hero) ───────────── */
.exh-archive {
    padding-top: 120px;
    /* room for the fixed header */
}

.exh-archive-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 28px;
    margin-bottom: 48px;
    border-bottom: 1px solid var(--exh-faint);
}

.exh-archive-head__title {
    margin: 0;
    font-size: clamp(34px, 4.2vw, 56px);
    font-weight: 300;
    line-height: 1.3;
    color: var(--exh-text);
    font-family: inherit;
}

.exh-archive-head__sub {
    margin: 10px 0 0;
    font-size: 15px;
    line-height: 1.8;
    color: var(--exh-muted);
}

.exh-archive-head__count {
    flex-shrink: 0;
    font-size: 14px;
    color: var(--exh-muted);
    white-space: nowrap;
}

.exh-grid.exh-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 56px 24px;
}

.exh-grid--2 .exh-card__body {
    padding-top: 18px;
}

.exh-grid--2 .exh-card__title {
    font-size: 22px;
}

.exh-grid--2 .exh-card__date {
    font-size: 14px;
}

.exh-grid--2 .exh-card__location {
    font-size: 15px;
}

@media (max-width: 991px) {
    .exh-archive {
        padding-top: 120px;
    }

    .exh-grid.exh-grid--2 {
        gap: 44px 16px;
    }

    .exh-grid--2 .exh-card__title {
        font-size: 19px;
    }
}

@media (max-width: 767px) {
    .exh-archive {
        padding-top: 110px;
    }

    .exh-archive-head {
        margin-bottom: 32px;
        padding-bottom: 20px;
    }

    .exh-grid.exh-grid--2 {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .exh-grid--2 .exh-card__title {
        font-size: 18px;
    }
}
/* ───────────── Listing grid ───────────── */
.exh-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 44px 20px;
}

.exh-grid__item {
    margin: 0;
    padding: 0;
}

.exh-card {
    display: block;
    color: inherit;
    text-decoration: none;
    outline: none;
}

.exh-card__media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--exh-radius);
    background: var(--exh-tile);
}

.exh-card__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s var(--exh-ease), filter 0.4s ease;
}

.exh-card__placeholder {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 60%),
        var(--exh-tile);
}

.exh-card__count {
    position: absolute;
    bottom: 12px;
    right: 12px;
    padding: 5px 10px;
    font-size: 12px;
    line-height: 1.6;
    color: #fff;
    background: rgba(12, 12, 14, 0.62);
    border-radius: 2px;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.exh-card__body {
    padding-top: 16px;
}

.exh-card__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}
.exh-hero {
    position: relative;
}

.exh-hero-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
      linear-gradient(to bottom, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.15) 30%, rgba(0, 0, 0, 0.15) 70%, rgba(0, 0, 0, 0.45) 100%), rgba(0, 0, 0, 0.58);
}
.exh-card__title {
    margin: 0;
    font-size: 19px;
    font-weight: 500;
    line-height: 1.6;
    color: var(--exh-text);
}

.exh-card__title span {
    background-image: linear-gradient(#9f9b9b, #9d9487);
    background-repeat: no-repeat;
    background-position: 100% 100%;
    background-size: 0 1px;
    transition: background-size 0.45s var(--exh-ease);
}

.exh-card__date {
    flex-shrink: 0;
    font-size: 13px;
    color: var(--exh-muted);
    white-space: nowrap;
}

.exh-card__location {
    margin: 6px 0 0;
    font-size: 14px;
    line-height: 1.8;
    color: var(--exh-muted);
    text-align: right;
}

@media (hover: hover) {
    .exh-card:hover .exh-card__img {
        transform: scale(1.04);
    }
    .exh-card:hover .exh-card__title span {
        background-size: 100% 1px;
    }
}

.exh-card:focus-visible .exh-card__media {
    outline: 2px solid var(--exh-accent);
    outline-offset: 3px;
}

.exh-card:focus-visible .exh-card__title span {
    background-size: 100% 1px;
}

/* ───────────── Single: toolbar + description ───────────── */
.exh-hero-title {
    animation: exh-rise 0.9s var(--exh-ease) both 0.1s;
}

.exh-hero-title h1 {
    margin-top: 0;
}

@keyframes exh-rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

.exh-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 20px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--exh-faint);
}

.exh-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--exh-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.exh-back:hover,
.exh-back:focus-visible {
    color: var(--exh-accent);
}

.exh-toolbar__count {
    font-size: 13px;
    color: var(--exh-muted);
}

.exh-desc {
    max-width: 720px;
    margin: 0 0 48px;
    font-size: 15px;
    line-height: 2;
    color: rgba(255, 255, 255, 0.78);
}

.exh-desc p {
    margin: 0 0 12px;
}

.exh-block + .exh-block {
    margin-top: 64px;
}

.exh-block__title {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.6;
    color: var(--exh-text);
    font-family: inherit;
    text-align: right;
}

/* ───────────── Single: media grid ───────────── */
.exh-media-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.exh-media-grid--video {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.exh-media {
    position: relative;
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--exh-radius);
    background: var(--exh-tile);
    cursor: pointer;
    font: inherit;
    color: #fff;
    -webkit-tap-highlight-color: transparent;
}

.exh-media--video {
    aspect-ratio: 16 / 9;
}

.exh-media__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.exh-media__placeholder {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.06), transparent 65%),
        #1f1e24;
}

.exh-media__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
}

.exh-media__overlay svg {
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.exh-media__play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    margin: -30px 0 0 -30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 3px;
    border-radius: 50%;
    color: #111;
    background: rgba(255, 255, 255, 0.92);
    transition: transform 0.3s var(--exh-ease), background 0.3s ease;
}

.exh-media__caption {
    position: absolute;
    right: 0;
    left: 0;
    bottom: 0;
    padding: 28px 14px 12px;
    font-size: 14px;
    line-height: 1.7;
    text-align: right;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.72), transparent);
}

@media (hover: hover) {
    .exh-media:hover .exh-media__img {
        transform: scale(1.05);
    }
    .exh-media:hover .exh-media__overlay {
        background: rgba(0, 0, 0, 0.45);
    }
    .exh-media:hover .exh-media__overlay svg {
        opacity: 1;
        transform: scale(1);
    }
    .exh-media--video:hover .exh-media__play {
        transform: scale(1.08);
        background: var(--exh-accent);
    }
}

.exh-media:focus-visible {
    outline: 2px solid var(--exh-accent);
    outline-offset: 2px;
}

/* Touch — show the zoom icon softly */
@media (hover: none) {
    .exh-media__overlay {
        background: rgba(0, 0, 0, 0.18);
    }
    .exh-media__overlay svg {
        opacity: 0.7;
        transform: scale(1);
    }
}

/* ───────────── Lightbox ───────────── */
#zf-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    background: rgba(8, 8, 8, 0.97);
    font-family: inherit;
}

#zf-lightbox.is-open {
    display: flex;
}

.zf-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    height: 100%;
    padding: 72px 88px 28px;
    box-sizing: border-box;
    justify-content: center;
}

#zf-media {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
    flex: 1 1 auto;
}

.zf-el {
    animation: zf-fade 0.22s ease;
}

.zf-img {
    display: block;
    max-width: 100%;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 2px;
}

.zf-video {
    display: block;
    max-width: 100%;
    max-height: 78vh;
    width: auto;
    background: #000;
    border-radius: 2px;
}

.zf-embed {
    position: relative;
    width: min(100%, calc(78vh * 16 / 9), 1200px);
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 2px;
    overflow: hidden;
}

.zf-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

@keyframes zf-fade {
    from { opacity: 0; transform: scale(0.97); }
    to   { opacity: 1; transform: scale(1); }
}

.zf-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

#zf-caption {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

#zf-caption:empty {
    display: none;
}

#zf-counter {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.04em;
}

/* Dots */
#zf-dots {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    max-width: 220px;
}

#zf-dots:empty {
    display: none;
}

.zf-dot {
    width: 6px;
    height: 5px;
    flex-shrink: 0;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.22);
    cursor: pointer;
    transition: width 0.25s ease, background 0.25s ease;
}

.zf-dot.active {
    width: 20px;
    background: #fff;
}

/* Buttons */
#zf-close,
#zf-prev,
#zf-next {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
    border: 0.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

#zf-close {
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
}

#zf-prev,
#zf-next {
    top: 50%;
    width: 48px;
    height: 48px;
    transform: translateY(-50%);
}

#zf-prev { left: 16px; }
#zf-next { right: 16px; }

#zf-close:hover,
#zf-prev:hover,
#zf-next:hover {
    background: rgba(255, 255, 255, 0.15);
}

#zf-close:focus-visible,
#zf-prev:focus-visible,
#zf-next:focus-visible,
.zf-dot:focus-visible {
    outline: 2px solid var(--exh-accent);
    outline-offset: 2px;
}

#zf-lightbox.is-single #zf-prev,
#zf-lightbox.is-single #zf-next,
#zf-lightbox.is-single #zf-counter {
    display: none;
}

/* ───────────── Tablet ───────────── */
@media (max-width: 991px) {
    .exh-wrap {
        padding: 44px 0 88px;
    }

    .exh-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 36px 16px;
    }

    .exh-media-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .zf-stage {
        padding: 64px 72px 24px;
    }

    #zf-prev,
    #zf-next {
        width: 42px;
        height: 42px;
    }
}

/* ───────────── Mobile ───────────── */
@media (max-width: 767px) {
    .exh-wrap {
        padding: 32px 0 72px;
    }

    .exh-card__title {
        font-size: 17px;
    }

    .exh-toolbar {
        margin-bottom: 24px;
    }

    .exh-desc {
        margin-bottom: 36px;
        font-size: 14px;
    }

    .exh-block + .exh-block {
        margin-top: 48px;
    }

    .exh-media-grid {
        gap: 6px;
    }

    .exh-media-grid--video {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .exh-media__play {
        width: 52px;
        height: 52px;
        margin: -26px 0 0 -26px;
    }

    /* Lightbox */
    .zf-stage {
        padding: 56px 12px 80px;
        gap: 12px;
    }

    .zf-img,
    .zf-video {
        max-height: 66vh;
    }

    .zf-embed {
        width: 100%;
    }

    #zf-prev,
    #zf-next {
        top: auto;
        bottom: 20px;
        width: 40px;
        height: 40px;
        transform: none;
    }

    #zf-prev { left: calc(50% - 54px); }
    #zf-next { right: calc(50% - 54px); }

    #zf-close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
    }

    #zf-dots {
        max-width: 170px;
    }
}

/* ───────────── Small mobile ───────────── */
@media (max-width: 479px) {
    .exh-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .exh-card__count {
        bottom: 10px;
        right: 10px;
    }
}

/* ───────────── Reduced motion ───────────── */
@media (prefers-reduced-motion: reduce) {
    .exh-card__img,
    .exh-media__img,
    .exh-card__title span,
    .exh-media__play,
    .zf-el,
    .exh-hero-title {
        transition: none !important;
        animation: none !important;
    }
}
