:root {
    --bg: #f6f8fb;
    --text: #0f1724;
    --muted: #6b7280;
    --accent: #2f6fd6;
    --card-radius: 14px;
    --gap: 14px;
    --shadow: 0 18px 50px rgba(31, 49, 96, 0.08);
}


/* base */

* {
    box-sizing: border-box
}

@font-face {
    font-family: 'Yekan';
    src: url('../fonts/Yekan.ttf');
    font-weight: normal;
    font-style: normal;
    text-rendering: optimizeLegibility;
    font-display: auto;
}

html,
body {
    height: 100%;
    margin: 0;
    font-family: 'Yekan', sans-serif;
    background: var(--bg);
    color: var(--text);
    direction: rtl
}

.wrap {
    max-width: 1180px;
    margin: 28px auto;
    padding: 0 16px
}


/* report */

.exh-report {
    background: linear-gradient(180deg, #fff, #fbfdff);
    border: 1px solid rgba(15, 23, 42, 0.04);
    border-radius: 12px;
    padding: 16px;
    margin: 14px 0;
    box-shadow: 0 10px 28px rgba(31, 49, 96, 0.06);
    color: var(--text);
    line-height: 1.8
}

.exh-report h2 {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 1.05rem;
    font-weight: 800
}


/* container card */

.exh-item {
    background: linear-gradient(180deg, #fff, #fbfdff);
    border-radius: 16px;
    padding: 18px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(15, 23, 42, 0.04)
}


/* grid: default 4 cols, responsive to smaller screens */

.photo-grid {
    display: grid;
    gap: var(--gap);
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 120px;
    align-items: stretch
}

@media (max-width:1100px) {
    .photo-grid {
        grid-template-columns: repeat(3, 1fr)
    }
}

@media (max-width:760px) {
    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 160px
    }
}

@media (max-width:420px) {
    .photo-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto
    }
}


/* pane */

.pane {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.6));
    border: 1px solid rgba(15, 23, 42, 0.03);
    transition: transform .28s ease, box-shadow .28s ease, z-index .01s;
    box-shadow: 0 8px 22px rgba(10, 20, 40, 0.06)
}

.pane img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .6s ease
}

.pane figcaption {
    position: absolute;
    right: 12px;
    bottom: 8px;
    left: 12px;
    color: #fff;
    text-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    font-weight: 700;
    font-size: .95rem;
    pointer-events: none
}


/* active: becomes larger on wide screens */

.pane.active {
    z-index: 5;
    transform: scale(1.03);
    box-shadow: 0 26px 80px rgba(31, 49, 96, 0.18)
}

@media (min-width:760px) {
    .pane.active {
        grid-row: span 2;
        grid-column: span 2
    }
}

@media (max-width:760px) {
    .pane.active {
        grid-row: span 1;
        height: 320px
    }
}

.pane.active img {
    transform: scale(1.06)
}


/* hover/focus */

.pane:hover,
.pane:focus {
    transform: translateY(-6px);
    box-shadow: 0 28px 72px rgba(31, 49, 96, 0.14);
    outline: none
}

.pane:focus {
    box-shadow: 0 30px 80px rgba(47, 111, 214, 0.14)
}


/* controls */

.exh-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 12px
}

.ctrl {
    background: linear-gradient(135deg, var(--accent), #1a2a3a);
    color: #fff;
    border: 0;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 800;
    box-shadow: 0 10px 28px rgba(31, 49, 96, 0.12)
}

.ctrl .fa-play {
    display: none
}

.ctrl.paused .fa-play {
    display: inline-block
}

.ctrl.paused .fa-pause {
    display: none
}


/* small polish */

.pane::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.0), rgba(0, 0, 0, 0.12));
    pointer-events: none
}


/* mobile: show the full image (contain) so user sees کل عکس */

@media (max-width:420px) {
    .pane img {
        object-fit: contain;
        height: auto;
        max-height: 70vh;
        background: #111
    }
    /* background برای زمینه سیاه وقتی aspect فرق داره */
    .photo-grid {
        gap: 12px
    }
    .pane {
        min-height: 220px
    }
    .pane.active {
        height: auto;
        transform: none;
        box-shadow: 0 12px 40px rgba(31, 49, 96, 0.12)
    }
}


/* Lightbox modal */

.gallery-lightbox {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99999;
    visibility: hidden;
    opacity: 0;
    transition: opacity .22s, visibility .22s;
    padding: 20px;
}

.gallery-lightbox[aria-hidden="false"] {
    visibility: visible;
    opacity: 1
}

.lb-figure {
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px
}

.lb-img {
    max-width: 100%;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 10px;
    display: block
}

.lb-caption {
    color: #fff;
    text-align: center;
    font-size: 0.95rem;
    max-width: 100%;
    overflow: auto
}

.lb-close,
.lb-prev,
.lb-next {
    position: fixed;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 28px;
    padding: 10px;
    cursor: pointer;
}

.lb-close {
    top: 18px;
    left: 18px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px
}

.lb-prev {
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 36px
}

.lb-next {
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 36px
}


/* small screens: controls larger */

@media (max-width:420px) {
    .lb-prev,
    .lb-next {
        font-size: 28px;
        padding: 12px
    }
    .lb-close {
        font-size: 22px;
        padding: 8px
    }
}