/* DK – Galeria projektu, 1.1.0 */
.dkpg {
    --dkpg-radius: 12px;
    --dkpg-thumb-columns: 4;
    --dkpg-visible-columns: 4;
    --dkpg-thumb-gap: 10px;
    --dkpg-cell-width: 100px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    color: #161616;
}
.dkpg *,
.dkpg *::before,
.dkpg *::after { box-sizing: border-box; }
.dkpg button { font: inherit; }
.dkpg__stage {
    position: relative;
    width: 100%;
    min-width: 0;
    aspect-ratio: 16 / 9;
    background: #f0f1f2;
    border-radius: var(--dkpg-radius);
    isolation: isolate;
    overflow: hidden;
}
.dkpg__slide,
.dkpg__slide:focus,
.dkpg__slide:hover {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    margin: 0;
    color: inherit;
    overflow: hidden;
    box-shadow: none;
}
.dkpg__slide[hidden] { display: none !important; }
button.dkpg__slide { cursor: zoom-in; }
.dkpg__image {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center;
}
.dkpg__zoom-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .62);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    pointer-events: none;
}
.dkpg__arrow {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .94);
    color: #222;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
    cursor: pointer;
    transition: background .18s ease, box-shadow .18s ease;
}
.dkpg__arrow:hover { background: #fff; box-shadow: 0 3px 12px rgba(0, 0, 0, .23); }
.dkpg__arrow--prev { left: 14px; }
.dkpg__arrow--next { right: 14px; }
.dkpg__counter {
    position: absolute;
    z-index: 2;
    right: 12px;
    bottom: 12px;
    padding: 5px 11px;
    border-radius: 30px;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    font-size: 12px;
    line-height: 1.3;
    pointer-events: none;
}
/* Dolny slider: przykladowo 4 rowne kolumny; rozmiar liczy JS. */
.dkpg__thumbs {
    position: relative;
    width: 100%;
    min-width: 0;
    margin-top: 12px;
}
.dkpg__thumbs-viewport {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    overscroll-behavior-x: contain;
    touch-action: pan-y;
}
.dkpg__thumbs-track {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: var(--dkpg-thumb-gap);
    width: 100%;
    min-width: 0;
    transition: transform 340ms cubic-bezier(.25, .75, .25, 1);
    will-change: transform;
}
.dkpg__thumbs-track--instant { transition: none !important; }
.dkpg__thumb,
.dkpg__thumb:hover,
.dkpg__thumb:focus {
    position: relative;
    flex: 0 0 var(--dkpg-cell-width);
    width: var(--dkpg-cell-width);
    aspect-ratio: 4 / 3;
    overflow: hidden;
    padding: 0;
    margin: 0;
    background: #f2f3f5;
    border: 2px solid transparent;
    border-radius: max(4px, calc(var(--dkpg-radius) * .65));
    outline-offset: 2px;
    box-shadow: none;
    cursor: pointer;
    transition: border-color .15s ease, opacity .15s ease;
}
.dkpg__thumb-arrow {
    position: absolute;
    z-index: 3;
    top: 50%;
    display: grid;
    place-items: center;
    width: 30px;
    height: 36px;
    margin: 0;
    padding: 0;
    transform: translateY(-50%);
    border: none;
    border-radius: 6px;
    background: rgba(255, 255, 255, .92);
    color: #252525;
    box-shadow: 0 1px 8px rgba(0, 0, 0, .18);
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
}
.dkpg__thumb-arrow--prev { left: 6px; }
.dkpg__thumb-arrow--next { right: 6px; }
.dkpg:not(.dkpg--thumbs-carousel) .dkpg__thumb-arrow { display: none; }
.dkpg__thumb-arrow:hover { background: #fff; }
.dkpg__thumb.is-active { border-color: #191919; }
.dkpg__thumb-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    max-width: none;
}
.dkpg__lightbox:not([open]) { display: none; }
.dkpg__lightbox[open] {
    position: fixed;
    inset: 0;
    width: min(1200px, calc(100vw - 24px));
    max-width: none;
    max-height: min(92vh, 1000px);
    margin: auto;
    padding: 38px 12px 14px;
    border: none;
    border-radius: 12px;
    color: #fff;
    background: #171717;
    box-shadow: 0 20px 80px rgba(0,0,0,.45);
}
.dkpg__lightbox::backdrop { background: rgba(0, 0, 0, .88); }
.dkpg__lightbox-close {
    position: absolute;
    z-index: 3;
    top: 4px;
    right: 12px;
    min-width: 36px;
    height: 34px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
}
.dkpg__lightbox-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 180px;
    height: min(76vh, 780px);
}
.dkpg__lightbox-image {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    width: calc(100% - 90px);
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.dkpg__lightbox-arrow {
    flex: 0 0 36px;
    width: 36px;
    height: 42px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: #333;
    font-size: 22px;
    cursor: pointer;
}
.dkpg__lightbox-counter {
    min-height: 20px;
    padding: 8px 0 0;
    color: #ddd;
    font-size: 13px;
    text-align: center;
}
.dkpg__placeholder {
    padding: 22px;
    background: #f4f6f8;
    border: 1px dashed #aab4bd;
    color: #434b53;
    border-radius: 8px;
    line-height: 1.5;
}
@media (max-width: 767px) {
    .dkpg__arrow { width: 34px; height: 34px; }
    .dkpg__arrow--prev { left: 8px; }
    .dkpg__arrow--next { right: 8px; }
    .dkpg { --dkpg-thumb-gap: 8px; }
    .dkpg__lightbox[open] { width: calc(100vw - 10px); padding-left: 6px; padding-right: 6px; }
    .dkpg__lightbox-content { gap: 3px; }
    .dkpg__lightbox-arrow { flex-basis: 27px; width: 27px; }
}
@media (prefers-reduced-motion: reduce) {
    .dkpg__thumb, .dkpg__arrow, .dkpg__thumbs-track { transition: none; }
}
