/* BryFin Photography — editorial layout + windowed series (Karsh / m1key inspired) */

.photo-page {
    padding-top: 5.5rem;
    padding-bottom: clamp(3rem, 8vw, 5rem);
    min-height: 100vh;
    background: var(--bg-deep);
}

.photo-page-inner {
    max-width: 38rem;
    margin: 0 auto;
    padding: 0 clamp(1.25rem, 4vw, 2rem);
}

.photo-page-header {
    margin-bottom: clamp(2rem, 5vw, 3rem);
    padding-bottom: clamp(1.5rem, 4vw, 2rem);
    border-bottom: 1px solid var(--border);
}

.photo-page-title {
    font-family: var(--font-serif);
    font-size: clamp(1.85rem, 4.5vw, 2.35rem);
    font-weight: 600;
    color: var(--text-1);
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

.photo-page-lead {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-3);
    line-height: 1.7;
    max-width: 32rem;
}

.photo-series-nav {
    margin-top: var(--space-md);
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.photo-series-chip {
    border: 1px solid var(--border);
    background: rgba(28, 36, 48, 0.55);
    color: var(--text-2);
    font-family: var(--font-sans);
    font-size: 0.78rem;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    text-decoration: none;
    line-height: 1.2;
}

.photo-series-chip:hover {
    border-color: rgba(26, 171, 184, 0.45);
    color: var(--text-1);
}

.photo-series-chip:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.photo-error {
    color: #f87171;
    margin-bottom: var(--space-lg);
    font-size: var(--text-small);
    line-height: 1.5;
}

.photo-windows {
    display: flex;
    flex-direction: column;
    gap: clamp(2rem, 5vw, 2.75rem);
}

/* One “window” per series — simple frame, calm interior */
.photo-series-window {
    scroll-margin-top: 5.5rem;
    background: rgba(28, 36, 48, 0.55);
    border: 1px solid var(--border);
    border-radius: 2px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
    padding: clamp(1rem, 3vw, 1.35rem);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.photo-series-window.photo-series-window--target {
    border-color: rgba(26, 171, 184, 0.45);
    box-shadow: 0 0 0 1px rgba(26, 171, 184, 0.12), var(--shadow-sm);
}

.photo-window-head {
    margin-bottom: var(--space-md);
}

.photo-window-title {
    font-family: var(--font-serif);
    font-size: clamp(1.2rem, 2.8vw, 1.45rem);
    font-weight: 600;
    color: var(--text-1);
    line-height: 1.25;
    margin: 0 0 var(--space-xs);
}

.photo-window-blurb {
    font-size: 0.9rem;
    color: var(--text-3);
    line-height: 1.65;
    margin: 0;
    max-width: 36rem;
}

.photo-window-blurb:empty {
    display: none;
}

/* Small thumbnails — click opens large view */
.photo-thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr));
    gap: 5px;
}

@media (min-width: 480px) {
    .photo-thumb-grid {
        grid-template-columns: repeat(auto-fill, minmax(5.25rem, 1fr));
        gap: 6px;
    }
}

@media (min-width: 720px) {
    .photo-thumb-grid {
        grid-template-columns: repeat(auto-fill, minmax(5.75rem, 1fr));
    }
}

.photo-thumb {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1;
    padding: 0;
    margin: 0;
    border: none;
    cursor: zoom-in;
    border-radius: 1px;
    overflow: hidden;
    background: var(--bg-mid);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.photo-thumb:hover {
    opacity: 0.92;
    transform: scale(1.02);
}

.photo-thumb:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    z-index: 1;
}

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

/* Full-view lightbox (“maximized” photo) */
.photo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.photo-lightbox.open {
    visibility: visible;
    opacity: 1;
}

.photo-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 10, 14, 0.94);
    cursor: pointer;
}

.photo-lightbox-panel {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
}

.photo-lightbox-chrome {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: 0.65rem 0.75rem;
    padding-left: max(0.75rem, env(safe-area-inset-left));
    padding-right: max(0.75rem, env(safe-area-inset-right));
    padding-top: max(0.65rem, env(safe-area-inset-top));
    background: linear-gradient(180deg, rgba(8, 10, 14, 0.95) 0%, transparent 100%);
}

.photo-lightbox-title {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-3);
    margin: 0;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.photo-lightbox-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.photo-lightbox-nav,
.photo-lightbox-close {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(23, 30, 39, 0.9);
    color: var(--text-2);
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.photo-lightbox-nav:hover,
.photo-lightbox-close:hover {
    border-color: rgba(26, 171, 184, 0.5);
    color: var(--text-1);
    background: rgba(28, 36, 48, 0.95);
}

.photo-lightbox-stage {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem min(1rem, 3vw) max(1rem, env(safe-area-inset-bottom));
    padding-left: max(0.5rem, env(safe-area-inset-left));
    padding-right: max(0.5rem, env(safe-area-inset-right));
    border: none;
    background: transparent;
    cursor: zoom-out;
    width: 100%;
}

.photo-lightbox-img {
    max-width: 100%;
    max-height: min(88dvh, 88vh);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 1px;
    box-shadow: 0 8px 48px rgba(0, 0, 0, 0.45);
    pointer-events: none;
}
