.gallery-page { background: #fff; color: #526476; }
.gallery-page [hidden] { display: none !important; }
.gallery-container { width: min(1200px, calc(100% - 3rem)); margin-inline: auto; }
.gallery-hero { overflow: hidden; background: #edf5fa; }
.gallery-breadcrumb { display: flex; gap: .85rem; padding-top: 1.8rem; font-size: .72rem; color: #667a8c; }
.gallery-breadcrumb a:hover { color: #155be5; text-decoration: underline; }
.gallery-breadcrumb [aria-current] { color: #123a61; }
.gallery-hero-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 3.5rem; align-items: center; padding: 3.7rem 0 5.7rem; }
.gallery-hero-copy h1 { margin: 1.25rem 0 1.5rem; color: #102a43; font-size: clamp(2.6rem, 4.8vw, 4.3rem); line-height: 1.08; font-weight: 600; letter-spacing: -.055em; }
.gallery-hero-copy h1 em { color: #155be5; font-style: normal; }
.gallery-hero-copy > p { max-width: 29rem; font-size: .94rem; line-height: 1.85; }
.gallery-button { display: inline-flex; align-items: center; justify-content: center; gap: 1.8rem; padding: .95rem 1.25rem; min-height: 48px; border-radius: 8px; background: #155be5; color: white; font-size: .8rem; font-weight: 600; transition: background .2s, transform .2s; }
.gallery-button:hover { background: #1248b3; transform: translateY(-2px); }
.gallery-button > span { font-size: 1.25rem; line-height: 1; }
.gallery-hero-copy .gallery-button { margin-top: 1.8rem; }
.gallery-hero-note { display: flex; align-items: center; gap: .65rem; margin-top: 1.7rem; font-size: .7rem; color: #667a8c; }
.gallery-hero-note > span { color: #ad7926; font-size: 1.35rem; }
.gallery-hero-photos { position: relative; min-width: 0; height: 390px; }
.gallery-hero-main { position: absolute; inset: 5px 0 35px 35px; padding: 10px 10px 0; border-radius: 5px; background: #fff; transform: rotate(3deg); box-shadow: 0 18px 45px #123a611c; }
.gallery-hero-main img { width: 100%; height: calc(100% - 43px); object-fit: cover; border-radius: 2px; }
.gallery-hero-main figcaption { padding: 14px 5px; color: #536878; font-size: .72rem; }
.gallery-hero-small { position: absolute; width: 47%; left: -12px; bottom: -17px; padding: 7px 7px 0; background: white; transform: rotate(-8deg); box-shadow: 0 12px 32px #123a6126; border-radius: 4px; }
.gallery-hero-small img { width: 100%; aspect-ratio: 4 / 3; height: auto; object-fit: cover; }
.gallery-hero-small figcaption { padding: 10px 3px; font-size: .65rem; color: #526476; }
.gallery-photo-stamp { position: absolute; top: -20px; right: -13px; width: 106px; height: 106px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 50%; background: #f4ca76; color: #503b1c; transform: rotate(12deg); font-size: .55rem; letter-spacing: .12em; line-height: 1.6; box-shadow: 0 0 0 6px #edf5fa; }
.gallery-photo-stamp strong { font-size: .78rem; letter-spacing: -.02em; }
.gallery-photo-stamp > span { font-size: 1.1rem; }
.gallery-collection { padding: 4.8rem 0 3.5rem; scroll-margin-top: 100px; }
.gallery-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; }
.gallery-section-heading h2, .gallery-visit h2 { margin-top: .8rem; font-size: clamp(1.8rem, 3vw, 2.6rem); line-height: 1.18; color: #102a43; font-weight: 600; letter-spacing: -.04em; }
.gallery-section-heading > p { font-size: .8rem; margin-bottom: .3rem; }
.gallery-toolbar { display: flex; justify-content: space-between; gap: 1.5rem; align-items: center; padding: 1.2rem 0; margin-bottom: 1.6rem; border-block: 1px solid #e4eaf0; }
.gallery-filters { display: flex; flex-wrap: wrap; gap: .45rem; }
.gallery-filter { display: inline-flex; gap: .7rem; align-items: center; justify-content: center; min-height: 44px; padding: .6rem .95rem; border: 1px solid transparent; border-radius: 7px; background: transparent; color: #526476; font-size: .75rem; font-weight: 600; cursor: pointer; transition: background .2s, color .2s; }
.gallery-filter > span { font-size: .64rem; opacity: .8; }
.gallery-filter:hover { background: #edf5fa; color: #155be5; }
.gallery-filter[aria-pressed="true"] { background: #123a61; color: #fff; }
#gallery-count { flex-shrink: 0; font-size: .72rem; color: #687b8b; }
.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.6rem; }
.gallery-card { display: block; min-width: 0; border-radius: 12px; background: #fff; border: 1px solid #e6ecf0; overflow: hidden; transition: transform .25s, box-shadow .25s; }
.gallery-card:hover { transform: translateY(-5px); box-shadow: 0 14px 32px #123a6114; }
.gallery-card-photo { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #e9f0f5; }
.gallery-card-photo > img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.gallery-card:hover img { transform: scale(1.045); }
.gallery-card-category { position: absolute; top: 14px; left: 14px; max-width: calc(100% - 28px); padding: .4rem .65rem; border-radius: 5px; background: #fffffff0; color: #123a61; font-size: .6rem; font-weight: 600; overflow-wrap: anywhere; }
.gallery-card-expand { position: absolute; right: 14px; bottom: 14px; display: grid; place-items: center; width: 35px; height: 35px; background: #fff; border-radius: 50%; color: #123a61; font-size: 1.2rem; box-shadow: 0 3px 12px #102a4326; }
.gallery-card-caption { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.1rem; }
.gallery-card-caption h3 { color: #123a61; font-size: .87rem; line-height: 1.5; font-weight: 600; overflow-wrap: anywhere; }
.gallery-card-caption > span { color: #8394a2; font-size: .65rem; font-variant-numeric: tabular-nums; }
.gallery-endnote { text-align: center; margin-top: 2.5rem; font-size: .72rem; color: #718393; }
.gallery-visit { padding: 0 0 4.5rem; }
.gallery-visit-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 2.7rem 3rem; background: #edf5fa; border-radius: 14px; }
.gallery-visit p { margin-top: .9rem; font-size: .82rem; line-height: 1.8; max-width: 34rem; }
.gallery-visit .gallery-button { flex-shrink: 0; }
.gallery-viewer { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; color: #fff; background: #081725f5; }
.gallery-viewer::backdrop { background: #081725; }
.gallery-viewer-shell { display: flex; flex-direction: column; height: 100%; padding: 1.2rem 2rem 1.6rem; }
.gallery-viewer-top { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; max-width: 1400px; width: 100%; margin-inline: auto; }
#viewer-position { color: #c3d1dc; font-size: .8rem; font-variant-numeric: tabular-nums; }
.gallery-viewer-control { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid #ffffff30; border-radius: 50%; background: #ffffff0d; color: white; font-size: 1.25rem; cursor: pointer; flex-shrink: 0; }
.gallery-viewer-control:hover { background: #ffffff25; }
.gallery-viewer-control:disabled { opacity: .3; cursor: default; }
.gallery-viewer :focus-visible { outline: 3px solid #f4ca76; outline-offset: 4px; }
.gallery-viewer-stage { display: flex; gap: 1.5rem; align-items: center; justify-content: center; flex: 1; min-height: 0; padding-block: 1rem; }
.gallery-viewer-image { position: relative; width: min(100%, 1100px); height: 100%; min-width: 0; display: grid; place-items: center; touch-action: pan-y pinch-zoom; }
#viewer-image { width: 100%; height: 100%; object-fit: contain; }
#viewer-error { position: absolute; text-align: center; padding: 2rem; color: #dae4ec; font-size: .9rem; }
.gallery-viewer-caption { text-align: center; flex-shrink: 0; }
#viewer-category { color: #f4ca76; font-size: .65rem; letter-spacing: .13em; text-transform: uppercase; }
#viewer-label { margin: .45rem 0; font-size: 1.1rem; line-height: 1.4; overflow-wrap: anywhere; max-height: 15vh; overflow-y: auto; }
#viewer-help { color: #a6bac9; font-size: .7rem; }
@media (max-width: 1000px) {
    .gallery-hero-layout { gap: 2rem; }
    .gallery-hero-photos { height: 330px; }
    .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gallery-section-heading > p { max-width: 12rem; line-height: 1.6; }
    .gallery-toolbar { align-items: flex-start; flex-direction: column; gap: .8rem; }
}
@media (max-width: 700px) {
    .gallery-container { width: calc(100% - 2rem); }
    .gallery-section-heading { display: block; }
    .gallery-section-heading > p { max-width: none; margin-top: .8rem; }
    .gallery-collection { padding-top: 3rem; }
    .gallery-grid { gap: 1rem; }
    .gallery-visit-inner { flex-direction: column; align-items: flex-start; padding: 2rem; }
    .gallery-viewer-shell { padding: .8rem 1rem 1.4rem; }
    .gallery-viewer-stage { position: relative; padding-bottom: 4.2rem; gap: 0; }
    #viewer-prev, #viewer-next { position: absolute; bottom: .5rem; }
    #viewer-prev { left: calc(50% - 58px); }
    #viewer-next { right: calc(50% - 58px); }
    #viewer-help { max-width: 17rem; margin-inline: auto; line-height: 1.7; }
}
@media (max-width: 480px) {
    .gallery-grid { grid-template-columns: 1fr; }
    .gallery-filter { padding-inline: .7rem; }
    .gallery-visit h2 { font-size: 1.9rem; }
}
/* Keep the photos in document flow on smaller screens so captions and
   enlarged text can grow without colliding with the next section. */
@media (max-width: 900px) {
    .gallery-hero-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 2rem;
        padding: 2.25rem 0 2.5rem;
    }
    .gallery-hero-copy { min-width: 0; width: 100%; max-width: 36rem; margin-inline: auto; }
    .gallery-hero-copy h1 {
        margin: 1rem 0 1.15rem;
        font-size: clamp(2rem, 8.5vw, 3.4rem);
        line-height: 1.12;
        overflow-wrap: anywhere;
    }
    .gallery-hero-copy > p { max-width: none; font-size: .9rem; line-height: 1.75; }
    .gallery-hero-copy .gallery-button { margin-top: 1.35rem; max-width: 100%; }
    .gallery-hero-note { margin-top: 1.15rem; line-height: 1.6; }
    .gallery-hero-note > span { flex-shrink: 0; }
    .gallery-hero-photos {
        width: 100%;
        max-width: 32rem;
        height: auto;
        margin: 0 auto;
        padding: .5rem .75rem 0;
    }
    .gallery-hero-main {
        position: relative;
        inset: auto;
        width: 100%;
        margin: 0;
        padding: 8px 8px 0;
        transform: none;
    }
    .gallery-hero-main img { display: block; height: auto; aspect-ratio: 4 / 3; }
    .gallery-hero-main figcaption { padding: .75rem .25rem; line-height: 1.5; overflow-wrap: anywhere; }
    .gallery-hero-small {
        position: relative;
        inset: auto;
        z-index: 1;
        width: 54%;
        max-width: 240px;
        margin: .75rem 0 0 .5rem;
        transform: rotate(-4deg);
    }
    .gallery-hero-small img { display: block; }
    .gallery-hero-small figcaption { padding: .6rem .2rem; line-height: 1.5; overflow-wrap: anywhere; }
    .gallery-photo-stamp {
        top: 1rem;
        right: .25rem;
        width: clamp(72px, 16vw, 92px);
        height: clamp(72px, 16vw, 92px);
        font-size: .5rem;
        box-shadow: 0 0 0 4px #edf5fa;
    }
    .gallery-photo-stamp strong { font-size: .7rem; }
    .gallery-photo-stamp > span { font-size: .9rem; }
}
@media (max-width: 380px) {
    .gallery-hero .gallery-container { width: calc(100% - 2rem); }
    .gallery-breadcrumb { padding-top: 1.25rem; }
    .gallery-hero-layout { padding-top: 1.75rem; gap: 1.75rem; }
    .gallery-hero-copy .gallery-button { width: 100%; gap: 1rem; }
    .gallery-hero-note { font-size: .65rem; gap: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
    html:has(.gallery-page) { scroll-behavior: auto; }
    .gallery-page *, .gallery-page *::before, .gallery-page *::after { transition: none !important; animation: none !important; }
    .gallery-card:hover, .gallery-card:hover img, .gallery-button:hover { transform: none; }
}
