@import url("https://fonts.googleapis.com/css2?family=Caveat:wght@500;600;700&display=swap");

.dzm-gallery-section {
    padding: 70px 0;
    background:
        radial-gradient(circle at top center, rgba(255, 255, 255, .75), transparent 45%),
        #f5f0e6;
}

.dzm-gallery-container {
    width: min(calc(100% - 40px), var(--dzm-container, 1240px));
    margin-inline: auto;
}

.dzm-gallery-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 34px;
}

.dzm-gallery-title {
    margin: 0;
    color: #111;
    font-size: clamp(2rem, 4vw, 3.3rem);
    font-weight: 950;
    line-height: 1;
    letter-spacing: -.04em;
    text-transform: uppercase;
}

.dzm-gallery-subtitle {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 8px;
    color: #444;
    font-family: var(--dzm-font-handwritten, "Comic Sans MS", "Segoe Print", cursive);
    font-size: clamp(1.35rem, 2.3vw, 2rem);
    font-weight: 600;
    line-height: 1;
    transform: rotate(-1deg);
}

.dzm-gallery-heart {
    display: inline-block;
    font-family: var(--dzm-font-body, Arial, sans-serif);
    font-size: 2.4rem;
    font-weight: 400;
    line-height: .7;
    transform: rotate(-12deg);
}

.dzm-gallery-button {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    min-height: 52px;
    padding: 12px 22px;
    border: 2px solid #707070;
    border-radius: 10px;
    background: transparent;
    box-shadow: 0 2px 0 rgba(0, 0, 0, .1);
    color: #151515;
    font-weight: 800;
    text-decoration: none;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

.dzm-gallery-button:hover,
.dzm-gallery-button:focus-visible {
    border-color: #151515;
    background: #151515;
    color: #fff;
    transform: translateY(-2px);
}

.dzm-photo-grid {
    display: grid;
    grid-template-columns: 1.45fr 1fr .72fr .72fr;
    grid-template-rows: repeat(2, 180px);
    gap: 10px;
}

.dzm-photo {
    position: relative;
    display: block;
    overflow: hidden;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: #222;
    cursor: pointer;
}

.dzm-photo__video {
    display: grid;
    width: 100%;
    height: 100%;
    align-content: center;
    justify-items: center;
    gap: 12px;
    background: radial-gradient(circle, #4b4b4b, #161616);
    color: #fff;
}

.dzm-photo__video i {
    display: grid;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--dzm-red, #c90000);
    place-items: center;
}

.dzm-photo::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(to top, rgba(0, 0, 0, .16), transparent 45%);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
}

.dzm-photo:hover::after,
.dzm-photo:focus-visible::after {
    opacity: 1;
}

.dzm-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s ease;
}

.dzm-photo:hover img,
.dzm-photo:focus-visible img {
    transform: scale(1.035);
}

.dzm-photo--1 {
    grid-column: 1;
    grid-row: 1 / span 2;
}

.dzm-photo--2 { grid-column: 2; grid-row: 1; }
.dzm-photo--3 { grid-column: 3; grid-row: 1; }
.dzm-photo--4 { grid-column: 4; grid-row: 1; }
.dzm-photo--5 { grid-column: 2; grid-row: 2; }
.dzm-photo--6 { grid-column: 3; grid-row: 2; }
.dzm-photo--7 { grid-column: 4; grid-row: 2; }

.dzm-gallery-empty {
    margin: 0;
    padding: 32px;
    border: 2px dashed #aaa;
    border-radius: 16px;
    text-align: center;
}

.dzm-lightbox {
    position: fixed;
    width: min(1100px, calc(100vw - 40px));
    max-width: none;
    height: min(820px, calc(100vh - 40px));
    max-height: none;
    margin: auto;
    padding: 52px 72px 42px;
    overflow: hidden;
    border: 0;
    border-radius: 16px;
    background: #111;
    color: #fff;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
}

.dzm-lightbox::backdrop {
    background: rgba(0, 0, 0, .88);
    backdrop-filter: blur(4px);
}

.dzm-lightbox__viewer {
    width: 100%;
    height: 100%;
}

.dzm-lightbox__viewer figure {
    display: grid;
    width: 100%;
    height: 100%;
    margin: 0;
    grid-template-rows: minmax(0, 1fr) auto;
    place-items: center;
}

.dzm-lightbox__viewer img,
.dzm-lightbox__viewer iframe {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    max-height: 100%;
    border: 0;
    object-fit: contain;
}

.dzm-lightbox__viewer figcaption {
    min-height: 34px;
    padding-top: 10px;
    color: rgba(255, 255, 255, .8);
    line-height: 1.4;
    text-align: center;
}

.dzm-lightbox__close,
.dzm-lightbox__nav {
    position: absolute;
    z-index: 1;
    display: grid;
    border: 0;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    cursor: pointer;
    place-items: center;
    transition: background-color .2s ease;
}

.dzm-lightbox__close:hover,
.dzm-lightbox__close:focus-visible,
.dzm-lightbox__nav:hover,
.dzm-lightbox__nav:focus-visible {
    background: rgba(255, 255, 255, .2);
}

.dzm-lightbox__close {
    top: 10px;
    right: 12px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 32px;
    line-height: 1;
}

.dzm-lightbox__nav {
    top: 50%;
    width: 48px;
    height: 64px;
    border-radius: 9px;
    font-size: 44px;
    transform: translateY(-50%);
}

.dzm-lightbox__nav--previous { left: 12px; }
.dzm-lightbox__nav--next { right: 12px; }

.dzm-lightbox__counter {
    position: absolute;
    top: 17px;
    left: 20px;
    color: rgba(255, 255, 255, .75);
    font-size: .9rem;
    font-weight: 700;
}

@media (min-width: 1200px) {
    .dzm-photo-grid { grid-template-rows: repeat(2, 210px); }
}

@media (max-width: 991.98px) {
    .dzm-photo-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: 320px repeat(3, 180px);
    }

    .dzm-photo--1 { grid-column: 1 / -1; grid-row: 1; }
    .dzm-photo--2 { grid-column: 1; grid-row: 2; }
    .dzm-photo--3 { grid-column: 2; grid-row: 2; }
    .dzm-photo--4 { grid-column: 1; grid-row: 3; }
    .dzm-photo--5 { grid-column: 2; grid-row: 3; }
    .dzm-photo--6 { grid-column: 1; grid-row: 4; }
    .dzm-photo--7 { grid-column: 2; grid-row: 4; }
}

@media (max-width: 575.98px) {
    .dzm-gallery-section { padding: 48px 0; }

    .dzm-gallery-container { width: min(calc(100% - 28px), var(--dzm-container, 1240px)); }

    .dzm-gallery-header {
        align-items: stretch;
        flex-direction: column;
        margin-bottom: 26px;
    }

    .dzm-gallery-button { align-self: flex-start; }

    .dzm-photo-grid {
        grid-template-rows: 260px repeat(3, 135px);
        gap: 7px;
    }

    .dzm-photo { border-radius: 11px; }
    .dzm-gallery-heart { font-size: 1.8rem; }

    .dzm-lightbox {
        width: calc(100vw - 16px);
        height: calc(100vh - 16px);
        padding: 50px 46px 36px;
        border-radius: 10px;
    }

    .dzm-lightbox__nav {
        width: 38px;
        height: 54px;
    }

    .dzm-lightbox__nav--previous { left: 4px; }
    .dzm-lightbox__nav--next { right: 4px; }
}

@media (prefers-reduced-motion: reduce) {
    .dzm-gallery-button,
    .dzm-photo img,
    .dzm-lightbox__close,
    .dzm-lightbox__nav { transition: none; }
}
