:root {
    --hig-bg: #f6f8fb;
    --hig-panel: #ffffff;
    --hig-ink: #18202b;
    --hig-muted: #657387;
    --hig-line: #d9e0ea;
    --hig-accent: #0f766e;
    --hig-accent-strong: #115e59;
    --hig-gold: #c58a1d;
}

.hig-lock {
    overflow: hidden;
}

.hig-gallery,
.hig-album-index {
    box-sizing: border-box;
    color: var(--hig-ink);
    font-family: inherit;
    width: 100%;
}

.hig-gallery *,
.hig-album-index * {
    box-sizing: border-box;
}

.hig-gallery {
    background: var(--hig-bg);
    border: 1px solid var(--hig-line);
    border-radius: 8px;
    padding: clamp(16px, 3vw, 28px);
}

.hig-gallery-head {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.hig-kicker {
    color: var(--hig-accent);
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 4px;
}

.hig-gallery h2 {
    font-size: clamp(24px, 3vw, 36px);
    line-height: 1.2;
    margin: 0;
}

.hig-return-button,
.hig-filters button,
.hig-lightbox button {
    border: 0;
    cursor: pointer;
    font: inherit;
}

.hig-return-button {
    background: var(--hig-accent);
    border-radius: 8px;
    color: #fff;
    font-weight: 700;
    padding: 11px 16px;
}

.hig-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 20px;
}

.hig-filters button {
    background: #fff;
    border: 1px solid var(--hig-line);
    border-radius: 999px;
    color: var(--hig-muted);
    min-height: 38px;
    padding: 8px 14px;
}

.hig-filters button.is-active {
    background: var(--hig-ink);
    border-color: var(--hig-ink);
    color: #fff;
}

.hig-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(var(--hig-columns), minmax(0, 1fr));
}

.hig-tile {
    background: var(--hig-panel);
    border: 1px solid var(--hig-line);
    border-radius: 8px;
    color: inherit;
    cursor: zoom-in;
    display: grid;
    overflow: hidden;
    padding: 0;
    text-align: start;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.hig-tile:hover,
.hig-tile:focus-visible {
    border-color: rgba(15, 118, 110, .5);
    box-shadow: 0 18px 38px rgba(24, 32, 43, .12);
    outline: 0;
    transform: translateY(-2px);
}

.hig-image-wrap {
    aspect-ratio: 4 / 3;
    background: #e8edf4;
    display: block;
    overflow: hidden;
}

.hig-image-wrap img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.hig-tile-content {
    display: grid;
    gap: 7px;
    padding: 14px;
}

.hig-tile-content small,
.hig-lightbox figcaption small {
    color: var(--hig-gold);
    font-size: 12px;
    font-weight: 800;
}

.hig-tile-content strong {
    font-size: 17px;
    line-height: 1.35;
}

.hig-tile-content span {
    color: var(--hig-muted);
    font-size: 14px;
    line-height: 1.6;
}

.hig-lightbox[hidden] {
    display: none;
}

.hig-lightbox {
    inset: 0;
    position: fixed;
    z-index: 999999;
}

.hig-lightbox-backdrop {
    background: rgba(8, 13, 20, .82);
    inset: 0;
    position: absolute;
}

.hig-lightbox-panel {
    background: #101820;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 8px;
    color: #fff;
    display: grid;
    gap: 12px;
    inset: 18px;
    padding: 14px;
    position: absolute;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.hig-lightbox-toolbar {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.hig-lightbox-toolbar > button {
    background: #fff;
    border-radius: 8px;
    color: #101820;
    font-weight: 800;
    min-height: 40px;
    padding: 8px 14px;
}

.hig-zoom-controls {
    align-items: center;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 8px;
    display: flex;
    gap: 8px;
    padding: 6px;
}

.hig-zoom-controls button {
    align-items: center;
    background: rgba(255, 255, 255, .14);
    border-radius: 6px;
    color: #fff;
    display: flex;
    font-size: 22px;
    height: 34px;
    justify-content: center;
    line-height: 1;
    width: 34px;
}

.hig-zoom-controls input {
    accent-color: var(--hig-accent);
    width: min(28vw, 170px);
}

.hig-stage {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    min-height: 0;
}

.hig-stage figure {
    display: grid;
    gap: 10px;
    grid-template-rows: minmax(0, 1fr) auto;
    height: 100%;
    margin: 0;
    min-width: 0;
}

.hig-image-stage {
    align-items: center;
    background: rgba(255, 255, 255, .04);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    min-height: 0;
    overflow: auto;
}

.hig-image-stage img {
    display: block;
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
    transform-origin: center center;
    transition: transform .16s ease;
}

.hig-nav {
    align-items: center;
    background: rgba(255, 255, 255, .12);
    border-radius: 8px;
    color: #fff;
    display: flex;
    font-size: 42px;
    height: 64px;
    justify-content: center;
    line-height: 1;
    width: 48px;
}

.hig-lightbox figcaption {
    background: rgba(255, 255, 255, .08);
    border-radius: 8px;
    display: grid;
    gap: 5px;
    padding: 12px;
}

.hig-lightbox figcaption strong {
    font-size: 18px;
}

.hig-lightbox figcaption span {
    color: rgba(255, 255, 255, .76);
    font-size: 14px;
    line-height: 1.55;
}

.hig-counter {
    color: rgba(255, 255, 255, .72);
    font-size: 13px;
    text-align: center;
}

.hig-thumbs {
    display: flex;
    gap: 8px;
    justify-content: center;
    overflow-x: auto;
    padding-bottom: 2px;
}

.hig-thumbs button {
    background: transparent;
    border: 2px solid transparent;
    border-radius: 8px;
    flex: 0 0 74px;
    height: 54px;
    overflow: hidden;
    padding: 0;
}

.hig-thumbs button.is-active {
    border-color: var(--hig-accent);
}

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

.hig-album-index {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.hig-album-card {
    margin: 0;
}

.hig-album-link {
    background: #fff;
    border: 1px solid var(--hig-line);
    border-radius: 8px;
    color: var(--hig-ink);
    display: grid;
    overflow: hidden;
    text-decoration: none;
}

.hig-album-cover {
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, #dfe8f1, #f8fafc);
    background-position: center;
    background-size: cover;
    display: block;
}

.hig-album-meta {
    display: grid;
    gap: 4px;
    padding: 14px;
}

.hig-album-meta small {
    color: var(--hig-muted);
}

.hig-empty {
    background: #f6f8fb;
    border: 1px solid #d9e0ea;
    border-radius: 8px;
    color: #657387;
    padding: 18px;
}

@media (max-width: 900px) {
    .hig-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .hig-gallery {
        padding: 14px;
    }

    .hig-gallery-head,
    .hig-lightbox-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .hig-grid {
        grid-template-columns: 1fr;
    }

    .hig-lightbox-panel {
        inset: 8px;
        padding: 10px;
    }

    .hig-stage {
        grid-template-columns: 38px minmax(0, 1fr) 38px;
    }

    .hig-nav {
        font-size: 32px;
        height: 54px;
        width: 38px;
    }

    .hig-thumbs button {
        flex-basis: 62px;
        height: 46px;
    }
}
