/* Gallery Layout aligned with main site grid */
.gallery-page {
    background: var(--white);
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.gallery-cover {
    margin-top: 50px;
    display: flex;
    align-items: flex-end;
    padding: calc(var(--spacing-unit) * 6) 0 calc(var(--spacing-unit) * 6);
    border-bottom: 1px solid var(--black);
}

.gallery-cover-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: calc(var(--spacing-unit) * 4);
    align-items: end;
}

.gallery-cover-content {
    grid-column: 1 / span 9;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.gallery-cover-meta {
    grid-column: 11 / span 2;
    display: flex;
    flex-direction: column;
    gap: 2px;
    justify-content: flex-end;
    align-self: end;
    padding-bottom: calc(var(--spacing-unit) * 3);
}

.gallery-kicker,
.gallery-meta-label,
.lightbox-section {
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gray-dark);
}

.gallery-cover-local {
    margin: calc(var(--spacing-unit) * 2) 0 calc(var(--spacing-unit) * 1);
    font-size: 0.875rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gray-dark);
}

.gallery-cover-title {
    font-family: 'Mantou Sans', 'Arial Black', 'Helvetica Neue', sans-serif;
    font-size: clamp(84px, 16vw, 180px);
    font-weight: 400;
    line-height: 0.9;
    letter-spacing: -0.05em;
    margin: 0 0 calc(var(--spacing-unit) * 3);
    white-space: nowrap;
}

.gallery-cover-subtitle {
    max-width: 34rem;
    font-size: 1.05rem;
    line-height: 1.7;
    margin: 0;
}

.gallery-total,
.gallery-status {
    font-size: 0.875rem;
    color: var(--gray-dark);
    margin: 0;
}

.gallery-section-wrapper {
    padding: calc(var(--spacing-unit) * 8) 0 calc(var(--spacing-unit) * 12);
}

.gallery-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: calc(var(--spacing-unit) * 1.5);
    margin-bottom: calc(var(--spacing-unit) * 5);
}

.filter-btn {
    border: 1px solid var(--black);
    background: transparent;
    color: var(--black);
    padding: 8px 14px;
    font: inherit;
    font-size: 0.8125rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.filter-btn.is-active,
.filter-btn:hover {
    background: var(--black);
    color: var(--white);
}

.masonry-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: calc(var(--spacing-unit) * 4);
    row-gap: calc(var(--spacing-unit) * 4);
    align-items: start;
}

.gallery-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 2);
    cursor: pointer;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.gallery-card.is-portrait {
    width: 100%;
}

.gallery-card.is-wide {
    width: 100%;
}

.gallery-card:hover {
    transform: translateY(-4px);
}

.gallery-thumb {
    width: 100%;
    height: 380px;
    background: var(--gray-light);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-thumb img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    object-position: center center;
    display: block;
}

.gallery-card.is-portrait .gallery-thumb img {
    width: auto;
    max-width: 100%;
    height: 100%;
    object-fit: contain;
}

.gallery-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
}

.gallery-item-title {
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
}

.gallery-item-subtitle {
    font-size: 0.9rem;
    color: var(--gray-dark);
    margin: 0;
}

.gallery-item-meta {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gray-dark);
    margin: 0;
}

.custom-cursor {
    width: 40px;
    height: 40px;
    border: 2px solid var(--black);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease, border-color 0.3s ease;
    mix-blend-mode: difference;
}

.cursor-dot {
    width: 4px;
    height: 4px;
    background-color: var(--black);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 10001;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease, background-color 0.3s ease;
}

.custom-cursor.cursor-hover {
    width: 60px;
    height: 60px;
    border-color: var(--red);
}

.cursor-dot.cursor-hover {
    width: 6px;
    height: 6px;
    background-color: var(--red);
}

.empty-state {
    padding: calc(var(--spacing-unit) * 6) 0;
    color: var(--gray-dark);
}

.lightbox {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: calc(var(--spacing-unit) * 3);
    background: rgba(0, 0, 0, 0.82);
    z-index: 3000;
}

.lightbox.is-open {
    display: flex;
}

.lightbox-dialog {
    width: min(1100px, 100%);
    max-height: 90vh;
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.7fr);
    background: var(--white);
    overflow: hidden;
}

.lightbox-dialog img {
    width: 100%;
    height: 100%;
    max-height: 90vh;
    object-fit: contain;
    background: #111;
}

.lightbox-info {
    padding: calc(var(--spacing-unit) * 4);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: calc(var(--spacing-unit) * 1.5);
}

.lightbox-info h2,
.lightbox-info p {
    margin: 0;
}

.lightbox-info h2 {
    font-size: 1.5rem;
    line-height: 1.2;
}

.lightbox-close {
    position: absolute;
    top: 18px;
    right: 24px;
    border: none;
    background: transparent;
    color: var(--white);
    font-size: 2rem;
    cursor: pointer;
}

@media (max-width: 1024px) {
    .gallery-cover-content,
    .gallery-cover-meta {
        grid-column: span 12;
    }

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

    .gallery-card,
    .gallery-card.is-portrait,
    .gallery-card.is-wide {
        width: 100%;
        max-width: none;
    }

    .lightbox-dialog {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .gallery-cover {
        min-height: auto;
        padding: calc(var(--spacing-unit) * 8) 0 calc(var(--spacing-unit) * 5);
    }

    .gallery-cover-title {
        font-size: clamp(64px, 18vw, 112px);
        line-height: 0.9;
    }

    .gallery-cover-subtitle {
        font-size: 0.95rem;
    }

    .masonry-grid {
        gap: calc(var(--spacing-unit) * 3);
    }

    .custom-cursor,
    .cursor-dot {
        display: none;
    }
}
