.photo-album {
    min-width: 0;
    --album-blue: #09385f;
    --album-line: #cedde9;
    --album-muted: #456179;
    --album-stage: #081f34;
    --album-focus: #217aa7;
}

.photo-album__heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem 1.75rem;
    margin-bottom: 1.25rem;
}

.photo-album__heading h2 {
    max-width: 42ch;
    margin: .55rem 0 .4rem;
    color: var(--album-blue);
    font-size: clamp(1.45rem, 2.5vw, 2.25rem);
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.photo-album__heading time {
    color: var(--album-muted);
    font-size: .875rem;
}

.photo-album__back, .photo-album__action {
    color: var(--album-blue);
    font-size: .875rem;
    font-weight: 700;
    text-decoration: none;
}

.photo-album__back:hover { text-decoration: underline; }

.photo-album__action {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    border: 1px solid var(--album-line);
    border-radius: 6px;
    padding: .55rem .8rem;
    background: #fff;
}

.photo-album__action:hover { background: #eef6fc; }

.photo-album__viewer {
    overflow: hidden;
    border: 1px solid var(--album-line);
    border-radius: 8px;
    background: #fff;
}

.photo-album__stage {
    position: relative;
    aspect-ratio: 16 / 10;
    max-height: 70vh;
    background: var(--album-stage);
    touch-action: pan-y;
}

.photo-album__stage img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.photo-album__arrow {
    position: absolute;
    top: 50%;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    transform: translateY(-50%);
    border: 1px solid #7d94a6;
    border-radius: 50%;
    color: #fff;
    background: #092740ed;
    font: inherit;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}

.photo-album__arrow[hidden] { display: none; }
.photo-album__arrow:disabled { opacity: .46; cursor: default; }
.photo-album__arrow:not(:disabled):hover { background: #144a72; }
.photo-album__arrow--previous { inset-inline-start: .75rem; }
.photo-album__arrow--next { inset-inline-end: .75rem; }

.photo-album__tools, .photo-album__dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .65rem .85rem;
}

.photo-album__count {
    color: var(--album-blue);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.photo-album__thumbnails {
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    padding: .25rem .85rem .8rem;
    scrollbar-width: thin;
}

.photo-album__thumbnail {
    display: block;
    flex: 0 0 88px;
    overflow: hidden;
    padding: 2px;
    border: 2px solid transparent;
    border-radius: 5px;
    background: #eaf2f8;
}

.photo-album__thumbnail[aria-current] { border-color: var(--album-focus); }
.photo-album__thumbnail img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }

.photo-album__dialog {
    position: fixed;
    inset: 0;
    width: min(1240px, calc(100% - 1.5rem));
    max-height: calc(100% - 1.5rem);
    margin: auto;
    padding: 0;
    border: 1px solid #58718a;
    border-radius: 8px;
    color: #fff;
    background: var(--album-stage);
}

.photo-album__dialog::backdrop { background: #061828ea; }
.photo-album__dialog-header h3 { flex: 1; margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.photo-album__dialog .photo-album__count { color: #daebf7; white-space: nowrap; }
.photo-album__stage--dialog { height: 75dvh; max-height: none; aspect-ratio: auto; }

.photo-album__close {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border: 1px solid #66849a;
    border-radius: 6px;
    color: #fff;
    background: #124363;
    font-size: 1.5rem;
    cursor: pointer;
}

.photo-album :is(a, button, [tabindex]):focus-visible { outline: 2px solid var(--album-focus); outline-offset: -2px; }

@media (max-width: 760px) {
    .photo-album__heading { align-items: start; }
    .photo-album__thumbnail { flex-basis: 74px; }
    .photo-album__arrow--previous { inset-inline-start: .45rem; }
    .photo-album__arrow--next { inset-inline-end: .45rem; }
}
