.section-media-gallery {
    width: min(1200px, calc(100% - 32px));
    margin: 0 auto;
}

.section-media-gallery__heading {
    margin-bottom: 26px;
}

.section-media-gallery__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 24px;
}

.media-gallery-card {
    min-width: 0;
}

.media-gallery-card__button {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 210px;
    padding: 14px;
    border: 1px solid #d8e3e3;
    border-radius: 14px;
    background: #fff;
    color: inherit;
    text-align: center;
    cursor: pointer;
    transition: border-color .18s ease, transform .18s ease;
}

.media-gallery-card__button:hover {
    border-color: #fa891b;
    transform: translateY(-2px);
}

.media-gallery-card__button:focus,
.media-gallery-card__button:focus-visible {
    outline: none;
    box-shadow: none;
}

.media-gallery-card__image {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    min-height: 150px;
}

.media-gallery-card__image img {
    display: block;
    max-width: 100%;
    max-height: 170px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.media-gallery-card__title {
    display: block;
    margin-top: 12px;
    color: #006068;
    font-size: 1rem;
    line-height: 1.3;
}

.section-media-gallery__modal[hidden] {
    display: none;
}

.section-media-gallery__modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.section-media-gallery__modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .72);
}

.section-media-gallery__modal-panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: min(1100px, calc(100vw - 48px));
    max-height: calc(100vh - 48px);
    padding: 24px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 22px 70px rgba(0, 0, 0, .28);
}

.section-media-gallery__modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: #fa891b;
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.section-media-gallery__modal-close:focus,
.section-media-gallery__modal-close:focus-visible {
    outline: none;
    box-shadow: none;
}

.section-media-gallery__modal-image {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 190px);
    object-fit: contain;
}

.section-media-gallery__modal-text {
    width: 100%;
    margin-top: 18px;
    text-align: center;
}

.section-media-gallery__modal-title {
    margin: 0;
    color: #006068;
    font-size: 1.35rem;
    line-height: 1.25;
}

.section-media-gallery__modal-description {
    margin: 8px auto 0;
    max-width: 760px;
    color: #444;
    line-height: 1.45;
}


.section-media-gallery__downloads {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.section-media-gallery__downloads[hidden] {
    display: none;
}

.section-media-gallery__download {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid #006068;
    border-radius: 999px;
    background: #fff;
    color: #006068;
    font-size: .9rem;
    line-height: 1.2;
    text-decoration: none;
}


.section-media-gallery__download-icon {
    display: inline-flex;
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
}

.section-media-gallery__download-icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.section-media-gallery__download-icon path {
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.section-media-gallery__download-label {
    min-width: 0;
    overflow-wrap: anywhere;
}

.section-media-gallery__download:hover {
    border-color: #fa891b;
    background: #fa891b;
    color: #fff;
    text-decoration: none;
}

.section-media-gallery__download:focus,
.section-media-gallery__download:focus-visible {
    outline: none;
    box-shadow: none;
}

.section-media-gallery__modal-description:empty {
    display: none;
}

@media (max-width: 640px) {
    .section-media-gallery__grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 14px;
    }

    .media-gallery-card__button {
        min-height: 170px;
        padding: 10px;
    }

    .media-gallery-card__image {
        min-height: 120px;
    }

    .media-gallery-card__image img {
        max-height: 130px;
    }

    .section-media-gallery__modal {
        padding: 14px;
    }

    .section-media-gallery__modal-panel {
        padding: 18px;
    }
}
