/* ═══════════════════════════════════════════════════════
   Zapex – Referencje  |  zapex-referencje.css
   Tło: białe. Zmienne z motywu Zapex Classic Theme.
   ═══════════════════════════════════════════════════════ */

/* ── SECTION ── */
.zxr {
    padding: 88px 0 80px;
    background-color: var(--color-white);
    font-family: var(--font-body);
}

.zxr .wrapper {
    padding: 0 24px;
}

/* ── HEADER ── */
.zxr__hdr {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 56px;
}

.zxr__label {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--color-dark-blue);
    margin-bottom: 12px;
}

.zxr__tytul {
    font-family: var(--font-heading-alt);
    font-size: clamp(26px, 3.5vw, 42px);
    line-height: 1.1;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--color-blue-grey-900);
    margin: 0 0 14px;
}

.zxr__opis {
    font-size: 15px;
    line-height: 1.65;
    color: var(--color-blue-grey-600);
    margin: 0;
}

/* ── GRID ── */
.zxr__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto;
}

@media (max-width: 900px) {
    .zxr__grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

@media (max-width: 560px) {
    .zxr__grid { grid-template-columns: 1fr; gap: 14px; }
}

/* ── ITEM ── */
.zxr__item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ── THUMB BUTTON ── */
.zxr__thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: var(--blue-grey-50);
    border: 1.5px solid #dde3e8;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    display: block;
    transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}

.zxr__thumb:hover {
    border-color: var(--color-light-blue);
    box-shadow: 0 8px 32px rgba(21,102,147,.14);
    transform: translateY(-3px);
}

.zxr__thumb:focus-visible {
    outline: 2px solid var(--color-dark-blue);
    outline-offset: 3px;
}

/* Zdjęcie */
.zxr__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}

.zxr__thumb:hover .zxr__img {
    transform: scale(1.03);
}

/* Placeholder gdy brak zdjęcia */
.zxr__placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b0bec5;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 8px,
        rgba(21,102,147,.04) 8px,
        rgba(21,102,147,.04) 16px
    );
}

/* Overlay z ikoną */
.zxr__overlay {
    position: absolute;
    inset: 0;
    background: rgba(13,27,62,.52);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    transition: opacity .25s ease;
    backdrop-filter: blur(2px);
}

.zxr__thumb:hover .zxr__overlay {
    opacity: 1;
}

/* ── META ── */
.zxr__meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 0 2px;
}

.zxr__firma {
    font-family: var(--font-heading-main);
    font-size: 14px;
    color: var(--color-blue-grey-900);
    line-height: 1.3;
}

.zxr__podpis {
    font-size: 12px;
    color: var(--color-blue-grey-600);
    font-weight: 500;
}

/* ════════════════════════════════════════════
   LIGHTBOX
   ════════════════════════════════════════════ */
.zxr-lb {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zxr-lb[hidden] {
    display: none;
}

/* Backdrop */
.zxr-lb__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(13,27,62,.88);
    backdrop-filter: blur(6px);
    cursor: pointer;
}

/* Wrap (nad backdrop) */
.zxr-lb__wrap {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 92vw;
    width: 100%;
    padding: 0 8px;
}

/* Content box */
.zxr-lb__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.zxr-lb__img-wrap {
    position: relative;
    width: 100%;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255,255,255,.04);
    box-shadow: 0 24px 80px rgba(0,0,0,.5);
}

.zxr-lb__img {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    display: block;
    border-radius: 8px;
    transition: opacity .25s ease;
}

.zxr-lb__img.is-loading {
    opacity: 0;
}

/* Loader spinner */
.zxr-lb__loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

.zxr-lb__loader::after {
    content: '';
    width: 32px;
    height: 32px;
    border: 2px solid rgba(255,255,255,.15);
    border-top-color: var(--color-light-blue);
    border-radius: 50%;
    animation: zxr-spin .7s linear infinite;
}

.zxr-lb__img.is-loading ~ .zxr-lb__loader {
    opacity: 1;
}

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

/* Info bar */
.zxr-lb__info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.zxr-lb__firma {
    font-family: var(--font-heading-main);
    font-size: 15px;
    color: #fff;
}

.zxr-lb__podpis {
    font-size: 13px;
    color: rgba(255,255,255,.55);
}

.zxr-lb__counter {
    font-size: 12px;
    color: rgba(255,255,255,.35);
    margin-left: auto;
    white-space: nowrap;
}

/* Nawigacja strzałki */
.zxr-lb__nav {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}

.zxr-lb__nav:hover {
    background: var(--color-dark-blue);
    border-color: var(--color-dark-blue);
    transform: scale(1.08);
}

.zxr-lb__nav:disabled {
    opacity: .3;
    cursor: default;
    pointer-events: none;
}

/* Zamknij */
.zxr-lb__close {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}

.zxr-lb__close:hover {
    background: rgba(255,255,255,.2);
    transform: scale(1.08) rotate(90deg);
}

/* Animacja otwierania lightbox */
@keyframes zxr-lb-in {
    from { opacity: 0; transform: scale(.96); }
    to   { opacity: 1; transform: scale(1); }
}

.zxr-lb:not([hidden]) .zxr-lb__content {
    animation: zxr-lb-in .22s ease both;
}

/* ── Mobile lightbox ── */
@media (max-width: 640px) {
    .zxr-lb__nav { width: 36px; height: 36px; }
    .zxr-lb__wrap { gap: 8px; padding: 0 4px; }
    .zxr-lb__info { gap: 6px; }
    .zxr-lb__counter { margin-left: 0; width: 100%; text-align: center; }
}

/* ── Entrance animation ── */
@keyframes zxr-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.zxr__hdr { animation: zxr-up .5s ease both; }

.zxr__item:nth-child(1)  { animation: zxr-up .4s .08s  ease both; }
.zxr__item:nth-child(2)  { animation: zxr-up .4s .13s  ease both; }
.zxr__item:nth-child(3)  { animation: zxr-up .4s .18s  ease both; }
.zxr__item:nth-child(4)  { animation: zxr-up .4s .23s  ease both; }
.zxr__item:nth-child(5)  { animation: zxr-up .4s .28s  ease both; }
.zxr__item:nth-child(6)  { animation: zxr-up .4s .33s  ease both; }
.zxr__item:nth-child(7)  { animation: zxr-up .4s .38s  ease both; }
.zxr__item:nth-child(8)  { animation: zxr-up .4s .43s  ease both; }
.zxr__item:nth-child(9)  { animation: zxr-up .4s .48s  ease both; }
.zxr__item:nth-child(10) { animation: zxr-up .4s .53s  ease both; }
.zxr__item:nth-child(11) { animation: zxr-up .4s .58s  ease both; }
.zxr__item:nth-child(12) { animation: zxr-up .4s .63s  ease both; }

@media (prefers-reduced-motion: reduce) {
    .zxr__hdr,
    .zxr__item,
    .zxr-lb__content { animation: none; }
}
