.pg-gallery {
    --pg-navy: #12263f;
    --pg-title: #1d4e89;
    --pg-muted: #8e959e;
    --pg-gold: #e0aa2b;
    --pg-cream: #f3f0ea;
    --pg-line: #e6e6e6;
    box-sizing: border-box;
    width: 100%;
    background: #ffffff;
    color: #243040;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    padding: 22px 18px 40px;
}

.pg-gallery *,
.pg-gallery *::before,
.pg-gallery *::after,
.pg-modal,
.pg-modal * {
    box-sizing: border-box;
}

.pg-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 26px;
}

.pg-filter {
    appearance: none;
    border: 1px solid var(--pg-line);
    background: #fff;
    color: #2c3544;
    border-radius: 10px;
    padding: 10px 16px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 1px 1px rgba(16, 24, 40, 0.04);
}

.pg-filter:hover {
    border-color: #cfd4dc;
}

.pg-filter[aria-pressed="true"] {
    background: var(--pg-navy);
    border-color: var(--pg-navy);
    color: #fff;
    box-shadow: none;
}

.pg-filter[aria-pressed="true"]:hover {
    background: #173056;
    border-color: #173056;
}

.pg-filter:focus-visible,
.pg-card:focus-visible,
.pg-modal__close:focus-visible,
.pg-modal__nav:focus-visible,
.pg-modal__thumb:focus-visible {
    outline: 2px solid var(--pg-title);
    outline-offset: 3px;
}

.pg-grid {
    display: grid;
    grid-template-columns: repeat(var(--pg-columns, 3), minmax(0, 1fr));
    gap: 32px 26px;
}

.pg-card {
    appearance: none;
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.pg-card[hidden] {
    display: none !important;
}

.pg-card__media {
    display: block;
    overflow: hidden;
    border-radius: 14px;
    aspect-ratio: 16 / 10;
    background: #e4e0d8;
}

.pg-card__img,
.pg-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.pg-card:hover .pg-card__img,
.pg-card:focus-visible .pg-card__img {
    transform: scale(1.045);
}

.pg-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 16px;
    color: var(--pg-title);
    font-weight: 700;
    text-align: center;
}

.pg-card__body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 2px 0;
}

.pg-card__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 2px;
}

.pg-card__title {
    color: var(--pg-title);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.pg-card__location {
    color: var(--pg-muted);
    font-size: 14.5px;
    font-weight: 400;
    line-height: 1.3;
}

.pg-card__arrow {
    flex: 0 0 auto;
    display: flex;
    color: var(--pg-gold);
    transition: transform 0.2s ease;
}

.pg-card:hover .pg-card__arrow,
.pg-card:focus-visible .pg-card__arrow {
    transform: translateX(3px);
}

.pg-empty,
.pg-none,
.pg-none__action {
    margin: 8px 0 0;
    color: #5d6772;
    font-size: 16px;
}

.pg-empty[hidden] {
    display: none !important;
}

.pg-none__action a {
    color: var(--pg-title);
    font-weight: 700;
}

.pg-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.pg-modal[hidden] {
    display: none !important;
}

.pg-modal {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.pg-modal__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    background: rgba(12, 18, 28, 0.78);
    cursor: pointer;
}

.pg-modal__dialog {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(1080px, 100%);
    max-height: calc(100vh - 48px);
    overflow: hidden;
    background: #f7f4ef;
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.pg-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 16px 14px 20px;
}

.pg-modal__heading {
    min-width: 0;
}

.pg-modal__title {
    margin: 0;
    color: #1d4e89;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}

.pg-modal__location {
    margin: 4px 0 0;
    color: #8e959e;
    font-size: 15px;
}

.pg-modal__close {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: #efeae3;
    color: #243040;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.pg-modal__close:hover {
    background: #e4ddd3;
}

.pg-modal__stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    background: #121820;
}

.pg-modal__photo {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: min(68vh, 720px);
    object-fit: contain;
    background: #121820;
}

.pg-modal__photo[hidden],
.pg-modal__empty[hidden],
.pg-modal__location[hidden],
.pg-modal__thumbs[hidden] {
    display: none !important;
}

.pg-modal__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #12263f;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.pg-modal__nav:hover {
    background: #fff;
}

.pg-modal__nav--prev {
    left: 14px;
}

.pg-modal__nav--next {
    right: 14px;
}

.pg-modal__nav[hidden] {
    display: none !important;
}

.pg-modal__meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    min-height: 24px;
    padding: 12px 20px 0;
}

.pg-modal__caption {
    margin: 0;
    color: #3d4754;
    font-size: 14px;
}

.pg-modal__count {
    margin: 0 0 0 auto;
    color: #6d7681;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.pg-modal__thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 16px 16px;
}

.pg-modal__thumb {
    flex: 0 0 auto;
    width: 92px;
    height: 68px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    background: #e7e2da;
    cursor: pointer;
}

.pg-modal__thumb.is-active {
    border-color: #1d4e89;
}

.pg-modal__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pg-modal__empty {
    margin: 0;
    padding: 48px 24px;
    color: #d5dbe3;
    text-align: center;
}

html.pg-lock,
html.pg-lock body {
    overflow: hidden;
}

@media (max-width: 980px) {
    .pg-grid {
        grid-template-columns: repeat(min(2, var(--pg-columns, 3)), minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .pg-gallery {
        padding: 16px 12px 28px;
    }

    .pg-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin-bottom: 18px;
        padding-bottom: 4px;
        scrollbar-width: thin;
    }

    .pg-filter {
        flex: 0 0 auto;
    }

    .pg-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .pg-modal {
        padding: 0;
        align-items: stretch;
    }

    .pg-modal__dialog {
        width: 100%;
        max-height: 100%;
        height: 100%;
        border-radius: 0;
    }

    .pg-modal__photo {
        max-height: 58vh;
    }

    .pg-modal__title {
        font-size: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pg-card__img,
    .pg-card__media img,
    .pg-card__arrow {
        transition: none;
    }

    .pg-card:hover .pg-card__img,
    .pg-card:focus-visible .pg-card__img,
    .pg-card:hover .pg-card__arrow,
    .pg-card:focus-visible .pg-card__arrow {
        transform: none;
    }
}

@media print {
    .pg-modal {
        display: none !important;
    }

    .pg-card {
        break-inside: avoid;
    }
}