/* ============================================================================
   Client gallery
   ----------------------------------------------------------------------------
   Layered on top of site.css. The marketing site is a frame around photographs;
   this is the photographs, so the chrome recedes further still — a darker
   surround, almost no borders, and nothing coloured that is not a photograph.
   ========================================================================= */

:root {
    --shell: #17140f;
    --shell-soft: #211d17;
    --shell-line: #332d25;
    --shell-ink: #f2ede4;
    --shell-ink-soft: #a89e90;
}

body.gallery {
    background: var(--shell);
    color: var(--shell-ink);
}

body.gallery .site-header {
    background: color-mix(in srgb, var(--shell) 90%, transparent);
    border-bottom: 1px solid var(--shell-line);
}

body.gallery .brand,
body.gallery .brand-mark {
    color: var(--shell-ink);
}

body.gallery .brand-sub {
    color: var(--shell-ink-soft);
}

body.gallery h1,
body.gallery h2,
body.gallery h3 {
    color: var(--shell-ink);
}

body.gallery p {
    color: var(--shell-ink-soft);
}

body.gallery .eyebrow {
    color: var(--shell-ink-soft);
}

body.gallery .btn-ghost {
    --btn-fg: var(--shell-ink);
    --btn-line: var(--shell-line);
}

body.gallery .btn-ghost:hover {
    --btn-bg: var(--shell-ink);
    --btn-fg: var(--shell);
    --btn-line: var(--shell-ink);
}

body.gallery .btn {
    --btn-bg: var(--shell-ink);
    --btn-fg: var(--shell);
    --btn-line: var(--shell-ink);
}

body.gallery .btn:hover {
    --btn-bg: #fff;
    --btn-line: #fff;
    --btn-fg: var(--shell);
}

/* ── Sign in ─────────────────────────────────────────────────────────────── */

.signin {
    min-height: calc(100vh - 78px);
    display: grid;
    place-items: center;
    padding: var(--gut);
}

.signin-card {
    width: min(100%, 420px);
    background: var(--shell-soft);
    border: 1px solid var(--shell-line);
    padding: clamp(1.75rem, 5vw, 2.75rem);
}

.signin-card h1 {
    font-size: clamp(1.9rem, 4vw, 2.5rem);
    margin-bottom: 0.35em;
}

.signin .field label {
    color: var(--shell-ink-soft);
}

.signin .field input {
    background: var(--shell);
    border-color: var(--shell-line);
    color: var(--shell-ink);
}

.signin .field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(138, 107, 71, 0.25);
}

.signin .btn {
    width: 100%;
}

body.gallery .notice {
    background: var(--shell-soft);
    border-color: var(--shell-line);
    color: var(--shell-ink);
}

body.gallery .notice-bad {
    border-color: #7a3a2d;
    background: rgba(155, 61, 46, 0.16);
    color: #f0b6a9;
}

body.gallery .notice-good {
    border-color: #46603f;
    background: rgba(79, 107, 72, 0.16);
    color: #b9d3b0;
}

/* ── Session list ────────────────────────────────────────────────────────── */

.sessions {
    display: grid;
    gap: clamp(1.25rem, 3vw, 2rem);
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}

.session-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--shell-soft);
    border: 1px solid var(--shell-line);
    overflow: hidden;
    transition: border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.session-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    color: inherit;
}

.session-cover {
    position: relative;
    aspect-ratio: 3 / 2;
    background: var(--shell-line);
    overflow: hidden;
}

.session-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.session-body {
    padding: 1.25rem 1.35rem 1.5rem;
}

.session-body h3 {
    margin-bottom: 0.25em;
    font-size: 1.5rem;
}

.session-meta {
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    color: var(--shell-ink-soft);
    margin: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.6rem;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.badge-locked {
    color: #d9a86a;
}

.badge-expiring {
    color: #d98a6a;
}

/* ── Gallery ─────────────────────────────────────────────────────────────── */

.gallery-bar {
    position: sticky;
    top: 78px;
    z-index: 40;
    background: color-mix(in srgb, var(--shell) 92%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--shell-line);
    padding-block: 0.9rem;
}

.gallery-bar .wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
}

.gallery-title {
    font-family: var(--display);
    font-size: 1.4rem;
    font-weight: 400;
    margin: 0;
    line-height: 1.2;
}

.gallery-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Phase jump links. Hidden entirely for a single-phase shoot -- a family
   session has one bucket and a "jump to section" control for one section is
   noise. */
.phase-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding-block: 1.25rem;
    border-bottom: 1px solid var(--shell-line);
    margin-bottom: 2rem;
}

.phase-nav a {
    padding: 0.35rem 0.8rem;
    border: 1px solid var(--shell-line);
    border-radius: 999px;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-decoration: none;
    color: var(--shell-ink-soft);
    white-space: nowrap;
}

.phase-nav a:hover {
    color: var(--shell-ink);
    border-color: var(--shell-ink-soft);
}

.phase {
    margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
    scroll-margin-top: 150px;
}

.phase-head {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.phase-head h2 {
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    margin: 0;
}

.phase-head span {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--shell-ink-soft);
    white-space: nowrap;
}

/* The grid itself. Fixed row height with object-fit rather than a masonry
   layout: a masonry column reflows as images decode, and a grid of four hundred
   thumbnails reflowing is a page that will not sit still to be clicked. */
.thumbs {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr));
}

.thumb {
    position: relative;
    aspect-ratio: 1;
    background: var(--shell-soft);
    border: 0;
    padding: 0;
    overflow: hidden;
    cursor: zoom-in;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s var(--ease), transform 0.5s var(--ease);
}

.thumb img.is-loaded {
    opacity: 1;
}

.thumb:hover img {
    transform: scale(1.05);
}

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

/* ── Lightbox ────────────────────────────────────────────────────────────── */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    grid-template-rows: auto 1fr auto;
    background: rgba(10, 8, 6, 0.97);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s var(--ease);
}

.lightbox[data-open='true'] {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem clamp(1rem, 3vw, 2rem);
    color: var(--shell-ink);
}

.lightbox-count {
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    color: var(--shell-ink-soft);
}

.lightbox-stage {
    position: relative;
    display: grid;
    place-items: center;
    padding: 0 clamp(0.5rem, 4vw, 4rem);
    min-height: 0;
}

.lightbox-stage img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    background: rgba(23, 20, 15, 0.7);
    border: 1px solid var(--shell-line);
    border-radius: 999px;
    color: var(--shell-ink);
    cursor: pointer;
    transition: background 0.2s var(--ease);
}

.lightbox-nav:hover {
    background: var(--shell-ink);
    color: var(--shell);
}

.lightbox-nav[disabled] {
    opacity: 0.25;
    cursor: default;
}

.lightbox-prev {
    left: clamp(0.5rem, 2vw, 1.5rem);
}

.lightbox-next {
    right: clamp(0.5rem, 2vw, 1.5rem);
}

.lightbox-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1rem clamp(1rem, 3vw, 2rem) 1.5rem;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    background: none;
    border: 1px solid var(--shell-line);
    border-radius: 999px;
    color: var(--shell-ink);
    cursor: pointer;
    transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.icon-btn:hover {
    background: var(--shell-ink);
    color: var(--shell);
}

/* ── Watermark notice ────────────────────────────────────────────────────── */

.locked-note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
    border: 1px solid #6b5228;
    background: rgba(217, 168, 106, 0.1);
    color: #e6c294;
    font-size: 0.92rem;
}

.locked-note strong {
    color: #f3dcbc;
}

/* ── Empty and loading ───────────────────────────────────────────────────── */

.spinner {
    width: 26px;
    height: 26px;
    margin: 3rem auto;
    border: 2px solid var(--shell-line);
    border-top-color: var(--shell-ink);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .spinner {
        animation-duration: 2s;
    }
}

.empty {
    text-align: center;
    padding: clamp(3rem, 10vw, 6rem) 0;
}

@media (max-width: 640px) {
    .gallery-bar {
        top: 78px;
    }

    .thumbs {
        gap: 4px;
        grid-template-columns: repeat(auto-fill, minmax(min(50% - 2px, 140px), 1fr));
    }
}
