.gallery-page {
    min-height: 100vh;
    background: var(--bg);
}

.gallery-hero {
    padding: 175px 0 105px;
    color: #fff;
    background:
        radial-gradient(
            circle at 78% 18%,
            rgba(185, 121, 67, 0.28),
            transparent 33%
        ),
        linear-gradient(135deg, #486b57 0%, #17291f 72%);
}

.gallery-hero__content {
    max-width: 850px;
}

.gallery-hero h1 {
    margin: 0 0 24px;
    font-family: Georgia, serif;
    font-size: clamp(52px, 7vw, 92px);
    font-weight: 400;
    line-height: 0.96;
}

.gallery-hero p {
    max-width: 620px;
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 19px;
}

.gallery-media {
    padding: 90px 0 120px;
}

.udacha-albums__heading {
    margin-bottom: 38px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 40px;
}

.udacha-albums__heading h2 {
    margin: 5px 0 0;
    font-family: Georgia, serif;
    font-size: clamp(38px, 5vw, 58px);
    font-weight: 400;
    line-height: 1.05;
}

.udacha-albums__heading p {
    max-width: 390px;
    margin: 0;
    color: var(--muted, #6d746f);
}

.udacha-albums__grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: 140px;
    grid-auto-flow: dense;
    gap: 18px;
}

.udacha-albums__card {
    min-width: 0;
    padding: 0;
    grid-column: span 4;
    grid-row: span 2;
    overflow: hidden;
    position: relative;
    border: 0;
    border-radius: 24px;
    color: #fff;
    background: #294536;
    font: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 14px 35px rgba(23, 41, 31, 0.08);
}

.udacha-albums__card:first-child {
    grid-column: span 8;
    grid-row: span 4;
}

.udacha-albums__card::after {
    position: absolute;
    inset: 0;
    z-index: 1;
    content: "";
    background: linear-gradient(
        180deg,
        transparent 30%,
        rgba(13, 27, 19, 0.84)
    );
}

.udacha-albums__cover {
    width: 100% !important;
    height: 100% !important;
    display: block;
    object-fit: cover;
    transition: transform 450ms ease;
}

.gallery-cta {
    padding: 90px 0;
    background: #e7dfd1;
}

.gallery-cta__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
}

.gallery-cta h2 {
    max-width: 700px;
    margin: 0;
    font-family: Georgia, serif;
    font-size: clamp(36px, 5vw, 58px);
    font-weight: 400;
    line-height: 1.05;
}

.udacha-albums__card:hover .udacha-albums__cover {
    transform: scale(1.035);
}

.udacha-albums__card:focus-visible {
    outline: 3px solid #b97943;
    outline-offset: 4px;
}

.udacha-albums__video-cover {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.65);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.18em;
    background:
        radial-gradient(
            circle,
            rgba(185, 121, 67, 0.35),
            transparent 32%
        ),
        linear-gradient(135deg, #466a55, #17291f);
}

.udacha-albums__card-info {
    padding: 25px;
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2;
}

.udacha-albums__card-info strong,
.udacha-albums__card-info small {
    display: block;
}

.udacha-albums__card-info strong {
    font-family: Georgia, serif;
    font-size: clamp(23px, 2.4vw, 34px);
    font-weight: 400;
    line-height: 1.05;
}

.udacha-albums__card-info small {
    margin-top: 7px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

.udacha-albums__empty {
    min-height: 300px;
    padding: 40px;
    display: grid;
    place-content: center;
    gap: 8px;
    border-radius: 24px;
    text-align: center;
    background: #e7dfd1;
}

.udacha-albums__empty strong {
    font-family: Georgia, serif;
    font-size: 30px;
    font-weight: 400;
}

.udacha-albums__empty span {
    color: var(--muted, #6d746f);
}

/* Открытый альбом */

.udacha-album-is-open {
    overflow: hidden;
}

.udacha-album-dialog {
    width: min(1180px, calc(100vw - 40px));
    max-width: none;
    height: min(88vh, 900px);
    max-height: none;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 26px;
    color: var(--text, #17291f);
    background: var(--bg, #f5f1e9);
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.35);
}

.udacha-album-dialog::backdrop {
    background: rgba(10, 19, 14, 0.78);
    backdrop-filter: blur(8px);
}

.udacha-album-dialog__shell {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.udacha-album-dialog__header {
    padding: 22px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    border-bottom: 1px solid rgba(23, 41, 31, 0.1);
    background: rgba(245, 241, 233, 0.95);
}

.udacha-album-dialog__header span {
    color: #b97943;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

.udacha-album-dialog__header h2 {
    margin: 3px 0 0;
    font-family: Georgia, serif;
    font-size: clamp(26px, 4vw, 42px);
    font-weight: 400;
    line-height: 1;
}

.udacha-album-dialog__close {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    padding: 0 0 4px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: #274535;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.udacha-album-dialog__body {
    padding: 24px;
    overflow-y: auto;
}

.udacha-album-dialog__grid {
    column-count: 3;
    column-gap: 18px;
}

.udacha-album-dialog__item {
    width: 100%;
    margin: 0 0 18px;
    display: inline-block;
    overflow: hidden;
    break-inside: avoid;
    vertical-align: top;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(23, 41, 31, 0.08);
}

.udacha-album-dialog__item img,
.udacha-album-dialog__item video {
    width: 100% !important;
    height: auto !important;
    display: block;
}

.udacha-album-dialog__item video {
    background: #17291f;
}

.udacha-album-dialog__item figcaption {
    padding: 13px 16px 15px;
    color: var(--muted, #6d746f);
    font-size: 14px;
}

@media (max-width: 900px) {
    .udacha-albums__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: 250px;
    }

    .udacha-albums__card {
        grid-column: span 1;
        grid-row: span 1;
    }

    .udacha-albums__card:first-child {
        grid-column: span 2;
        grid-row: span 2;
    }

    .udacha-album-dialog__grid {
        column-count: 2;
    }
}

@media (max-width: 600px) {
    .gallery-hero {
        padding: 135px 0 75px;
    }

    .gallery-hero h1 {
        font-size: clamp(44px, 14vw, 64px);
    }

    .gallery-media {
        padding: 55px 0 75px;
    }

    .udacha-albums__heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 18px;
    }

    .udacha-albums__grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 270px;
        gap: 14px;
    }

    .udacha-albums__card,
    .udacha-albums__card:first-child {
        grid-column: 1;
        grid-row: span 1;
        border-radius: 18px;
    }

    .udacha-album-dialog {
        width: calc(100vw - 16px);
        height: calc(100dvh - 16px);
        border-radius: 18px;
    }

    .udacha-album-dialog__header {
        padding: 18px;
    }

    .udacha-album-dialog__body {
        padding: 12px;
    }

    .udacha-album-dialog__grid {
        column-count: 1;
        column-gap: 0;
    }

    .udacha-album-dialog__item {
        margin-bottom: 12px;
        border-radius: 14px;
    }

    .gallery-cta {
        padding: 65px 0;
    }

    .gallery-cta__inner {
        align-items: flex-start;
        flex-direction: column;
    }

    .gallery-cta .button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .udacha-albums__cover {
        transition: none;
    }
}
