.seg-page {
    width: min(calc(100% - 40px), 1040px) !important;
    max-width: 1040px !important;
    margin-inline: auto !important;
    padding-inline: 0 !important;
}

.sue-gallery {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.58fr) minmax(0, 1fr);
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 5px;
    width: 100%;
    overflow: hidden;
    background: #eee8dd;
}

.sue-gallery--featured {
    height: 500px;
    border-radius: 33px 33px 0 0;
}

.sue-gallery--card {
    aspect-ratio: 16 / 10;
    border-radius: 23px 23px 0 0;
}

.suniva-event-card > .sue-gallery--detail {
    height: min(53vw, 520px);
    min-height: 360px;
    border-radius: 0;
}

.sue-gallery__tile {
    position: relative !important;
    display: block !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: linear-gradient(145deg, #f4ecdc, #edf4f1) !important;
    box-shadow: none !important;
    text-decoration: none !important;
}

button.sue-gallery__tile { cursor: zoom-in; }

/* 既存の .seg-card a { align-self:flex-start } を写真タイルだけ確実に解除する。 */
.seg-card .sue-gallery__tile {
    align-self: stretch !important;
    justify-self: stretch !important;
    margin: 0 !important;
}

.sue-gallery__tile:first-child { grid-row: 1 / 3; }
.sue-gallery__tile:nth-child(n + 4) { display: none !important; }

.sue-gallery__tile > img {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    object-fit: cover !important;
    object-position: center !important;
}

.sue-gallery.is-count-1 { display: block; }
.sue-gallery.is-count-1 .sue-gallery__tile { width: 100% !important; height: 100% !important; }
.sue-gallery.is-count-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr);
}
.sue-gallery.is-count-2 .sue-gallery__tile:first-child { grid-row: auto; }

.sue-gallery__credit {
    position: absolute;
    right: 6px;
    bottom: 6px;
    z-index: 3;
    max-width: calc(100% - 12px);
    padding: 4px 7px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(9, 26, 31, .72);
    color: #fff !important;
    font-size: 8px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sue-gallery__fallback {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    color: #796943;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .08em;
    text-align: center;
}

.seg-card-portal-clean {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    min-height: 44px !important;
    margin: 14px 0 8px !important;
    padding: 9px 11px !important;
    border: 1px solid rgba(197, 151, 54, .28) !important;
    border-radius: 13px !important;
    background: linear-gradient(135deg, #fffaf0, #f8fcfa) !important;
    color: #17312b !important;
    text-decoration: none !important;
}
.seg-card-portal-clean::before { content: "📍"; flex: 0 0 auto; }
.seg-card-portal-clean span { min-width: 0; line-height: 1.25; }
.seg-card-portal-clean small { display: block; color: #a87521; font-size: 9px; }
.seg-card-portal-clean strong { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.seg-card-portal-clean em { flex: 0 0 auto; margin-left: auto; color: #2f6a57; font-size: 10px; font-style: normal; font-weight: 800; }

.sue-lightbox[hidden] { display: none !important; }
.sue-lightbox {
    position: fixed;
    z-index: 100000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(5, 16, 21, .94);
}
.sue-lightbox figure { margin: 0; color: #fff; text-align: center; }
.sue-lightbox img { display: block; max-width: 90vw; max-height: 82vh; margin: auto; border-radius: 18px; object-fit: contain; }
.sue-lightbox button {
    position: absolute;
    z-index: 2;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid rgba(255,255,255,.45);
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    color: #fff;
    font-size: 30px;
}
.sue-lightbox__close { top: 16px; right: 16px; }
.sue-lightbox__prev { top: 50%; left: 12px; }
.sue-lightbox__next { top: 50%; right: 12px; }

@media (max-width: 700px) {
    .seg-page {
        width: min(calc(100% - 24px), 1040px) !important;
        padding-top: 44px !important;
    }
    .sue-gallery--featured { height: 270px; border-radius: 23px 23px 0 0; }
    .sue-gallery--card { aspect-ratio: 16 / 11; border-radius: 17px 17px 0 0; }
    .suniva-event-card > .sue-gallery--detail { height: 290px; min-height: 290px; }
    .sue-lightbox { padding: 8px; }
    .sue-lightbox__prev { left: 5px; }
    .sue-lightbox__next { right: 5px; }
}
