/* ==========================================================================
   JT Foxx Event Images — public gallery theme
   --------------------------------------------------------------------------
   Design idea: a photographer's contact sheet. Navigation chrome sits on cool
   paper; photographs are always viewed on graphite, the way a proof sheet is
   read on a light table. Every frame carries its real sequence number from the
   shoot (`image.idx`), printed on the frame edge in mono — the numbering is
   data, not ornament. Amber (the darkroom safelight / warm stage wash) is the
   only accent and marks exactly one thing at a time: where you are.
   ========================================================================== */

:root {
    /* ground */
    --ink:      #15171c;   /* graphite — viewing surfaces */
    --ink-2:    #1e212a;   /* raised graphite — frame wells */
    --ink-3:    #2c313d;   /* frame edge / hairlines on graphite */
    --sheet:    #eff1f4;   /* cool paper — chrome */
    --sheet-2:  #ffffff;   /* raised paper — cards */
    --rule:     #d5dae1;   /* hairline on paper */

    /* ink */
    --text:     #16181d;
    --dim:      #6c7480;
    --on-ink:   #e8eaee;
    --on-ink-dim: #8b93a1;

    /* accent */
    --amber:    #e8a33d;
    --amber-dk: #b8801f;

    /* type */
    --sans: 'Chivo', 'Helvetica Neue', Arial, sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    /* metrics */
    --rail: 264px;
    --bar: 60px;
    --pad: 28px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--sheet);
    color: var(--text);
    font: 400 15px/1.55 var(--sans);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

img { display: block; max-width: 100%; }

:focus-visible {
    outline: 2px solid var(--amber);
    outline-offset: 2px;
    border-radius: 1px;
}

/* Utility ---------------------------------------------------------------- */

.gl-mono {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.gl-sr {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Top bar --------------------------------------------------------------- */

.gl-bar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 20px;
    height: var(--bar);
    flex-wrap: nowrap;
    overflow: hidden;
    padding: 0 var(--pad);
    background: rgba(239, 241, 244, .92);
    backdrop-filter: saturate(150%) blur(10px);
    border-bottom: 1px solid var(--rule);
}

.gl-wordmark {
    display: flex;
    align-items: baseline;
    gap: 9px;
    flex: none;
}

.gl-wordmark b {
    font-weight: 900;
    font-size: 15px;
    letter-spacing: -.035em;
    text-transform: uppercase;
}

.gl-wordmark span {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--dim);
}

/* Breadcrumb reads as a filesystem path, because that is what the archive is. */
.gl-path {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .04em;
    color: var(--dim);
    overflow: hidden;
}

.gl-path a:hover { color: var(--text); }

.gl-path i {
    font-style: normal;
    color: #b4bcc7;
}

.gl-path .gl-path-here {
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gl-bar-end {
    margin-left: auto;
    flex: none;
}

/* Shell ----------------------------------------------------------------- */

.gl-shell {
    display: grid;
    grid-template-columns: var(--rail) minmax(0, 1fr);
    align-items: start;
    min-height: calc(100vh - var(--bar));
}

/* Rail — the archive index --------------------------------------------- */

.gl-rail {
    position: sticky;
    top: var(--bar);
    /* Full height, not max-height: with align-items:start the rail would
       otherwise shrink to its content and the dividing rule would stop
       mid-page. Long event lists scroll inside it. */
    height: calc(100vh - var(--bar));
    overflow-y: auto;
    padding: 22px 0 40px;
    border-right: 1px solid var(--rule);
}

.gl-rail-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 var(--pad) 12px;
    color: var(--dim);
}

.gl-rail-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 var(--pad) 14px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--dim);
}

.gl-rail-back:hover { color: var(--text); }

.gl-rail-list { display: flex; flex-direction: column; }

.gl-rail-item {
    position: relative;
    padding: 9px var(--pad) 9px calc(var(--pad) + 2px);
    font-size: 13.5px;
    line-height: 1.35;
    color: #3e444e;
    border-top: 1px solid var(--rule);
    transition: background .14s ease, color .14s ease;
}

.gl-rail-list .gl-rail-item:last-child { border-bottom: 1px solid var(--rule); }

.gl-rail-item:hover {
    background: var(--sheet-2);
    color: var(--text);
}

/* Amber marks exactly one thing: where you are. */
.gl-rail-item.is-current {
    background: var(--sheet-2);
    color: var(--text);
    font-weight: 600;
}

.gl-rail-item.is-current::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--amber);
}

/* Main ------------------------------------------------------------------ */

.gl-main { min-width: 0; }

.gl-head {
    padding: 38px var(--pad) 30px;
}

.gl-eyebrow {
    display: block;
    margin-bottom: 12px;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--amber-dk);
}

.gl-title {
    margin: 0;
    font-weight: 900;
    font-size: clamp(30px, 4.6vw, 52px);
    line-height: 1.02;
    letter-spacing: -.035em;
    text-transform: uppercase;
    text-wrap: balance;
}

.gl-lede {
    max-width: 52ch;
    margin: 14px 0 0;
    color: var(--dim);
    font-size: 15px;
}

.gl-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--dim);
}

.gl-meta em {
    font-style: normal;
    color: var(--text);
}

.gl-meta i {
    font-style: normal;
    color: #c2c9d3;
}

/* Card lists (events, days, sessions) ---------------------------------- */

.gl-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
    padding: 0 var(--pad) 48px;
}

.gl-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 116px;
    padding: 16px 17px;
    background: var(--sheet-2);
    border: 1px solid var(--rule);
    border-radius: 3px;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.gl-card:hover {
    transform: translateY(-2px);
    border-color: #aeb7c3;
    box-shadow: 0 8px 22px -14px rgba(21, 23, 28, .5);
}

/* Photo-led variant: the archive is photographs, so a card shows one. */
.gl-card--photo {
    padding: 0;
    min-height: 0;
    gap: 0;
    overflow: hidden;
}

.gl-card-cover {
    display: block;
    aspect-ratio: 3 / 2;
    background: var(--ink-2);
    overflow: hidden;
}

.gl-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s cubic-bezier(.2, .7, .3, 1);
}

.gl-card--photo:hover .gl-card-cover img { transform: scale(1.05); }

.gl-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.gl-card--photo .gl-card-body { padding: 13px 15px 14px; }

.gl-card-title {
    display: block;
    margin: 0;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.25;
    letter-spacing: -.012em;
}

.gl-card-meta {
    display: block;
    margin-top: auto;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--dim);
}

.gl-card:hover .gl-card-meta { color: var(--amber-dk); }

/* Contact sheet — the viewing surface ---------------------------------- */

.gl-sheet {
    padding: 26px var(--pad) 40px;
    background: var(--ink);
    color: var(--on-ink);
}

.gl-sheet-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 18px;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--on-ink-dim);
}

.gl-sheet-head b {
    font-weight: 400;
    color: var(--on-ink);
}

.gl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(132px, 15vw, 196px), 1fr));
    gap: 12px;
}

/* One frame of the sheet: image well + printed edge carrying the frame no. */
.gl-frame {
    display: block;
    background: var(--ink-2);
    border: 1px solid var(--ink-3);
    border-radius: 2px;
    overflow: hidden;
    animation: gl-in .4s ease both;
    animation-delay: calc(var(--i, 0) * 22ms);
    transition: border-color .16s ease, transform .16s ease;
}

.gl-frame:hover {
    border-color: var(--amber);
    transform: translateY(-2px);
}

/* Must be block: these are <span>s in the markup, and aspect-ratio /
   object-fit do nothing on an inline box — portrait thumbs would then break
   the grid rhythm instead of being cropped to it. */
.gl-frame-well {
    display: block;
    position: relative;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: #0f1115;
}

.gl-frame-well img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s cubic-bezier(.2, .7, .3, 1), opacity .3s ease;
}

.gl-frame:hover .gl-frame-well img { transform: scale(1.045); }

.gl-frame-well img.is-broken { opacity: .18; }

.gl-frame-edge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 8px;
    background: var(--ink-2);
    border-top: 1px solid var(--ink-3);
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: .12em;
    color: var(--on-ink-dim);
}

.gl-frame:hover .gl-frame-edge { color: var(--amber); }

.gl-frame-edge span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.gl-frame-no {
    flex: none;
    font-variant-numeric: tabular-nums;
}

@keyframes gl-in {
    from { opacity: 0; transform: translateY(7px); }
    to   { opacity: 1; transform: none; }
}

/* Empty state — an invitation, not an apology. ------------------------- */

.gl-empty {
    margin: 0 var(--pad) 48px;
    padding: 34px 28px;
    background: var(--sheet-2);
    border: 1px solid var(--rule);
    border-radius: 3px;
}

.gl-sheet .gl-empty {
    margin: 0;
    background: var(--ink-2);
    border-color: var(--ink-3);
}

.gl-empty h2 {
    margin: 0 0 8px;
    font-weight: 600;
    font-size: 17px;
    letter-spacing: -.012em;
}

.gl-empty p {
    margin: 0;
    max-width: 54ch;
    color: var(--dim);
    font-size: 14px;
}

.gl-sheet .gl-empty p { color: var(--on-ink-dim); }

/* Pager ---------------------------------------------------------------- */

.gl-pager { padding: 26px var(--pad) 0; }

.gl-pager ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.gl-pager li > a,
.gl-pager li > span {
    display: block;
    min-width: 36px;
    padding: 7px 10px;
    background: var(--ink-2);
    border: 1px solid var(--ink-3);
    border-radius: 2px;
    font-family: var(--mono);
    font-size: 11px;
    text-align: center;
    color: var(--on-ink-dim);
    transition: color .14s ease, border-color .14s ease;
}

.gl-pager li > a:hover {
    color: var(--on-ink);
    border-color: #4a515f;
}

.gl-pager li.active > a,
.gl-pager li.active > span {
    color: var(--ink);
    background: var(--amber);
    border-color: var(--amber);
}

.gl-pager li.disabled > a,
.gl-pager li.disabled > span {
    opacity: .35;
    pointer-events: none;
}

/* Footer --------------------------------------------------------------- */

.gl-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    padding: 22px var(--pad);
    background: var(--ink);
    border-top: 1px solid var(--ink-3);
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--on-ink-dim);
}

/* Lightbox — the loupe ------------------------------------------------- */

.gl-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    grid-template-rows: auto minmax(0, 1fr) auto;
    background: #0b0c0f;
    color: var(--on-ink);
}

.gl-lightbox.is-open { display: grid; }

.gl-lb-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid #23262f;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .08em;
}

.gl-lb-name {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--on-ink);
    /* Deliberately not uppercased: this is the actual filename people quote
       back to us, and DSC_0729.jpg is not DSC_0729.JPG. */
}

.gl-lb-count {
    flex: none;
    color: var(--amber);
    font-variant-numeric: tabular-nums;
}

.gl-lb-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex: none;
}

.gl-lb-btn {
    padding: 7px 12px;
    background: transparent;
    border: 1px solid #333844;
    border-radius: 2px;
    color: var(--on-ink-dim);
    font: inherit;
    text-transform: uppercase;
    cursor: pointer;
    transition: color .14s ease, border-color .14s ease;
}

.gl-lb-btn:hover {
    color: var(--on-ink);
    border-color: #565e6e;
}

.gl-lb-stage {
    position: relative;
    min-height: 0;
    overflow: hidden;
}

/* Image holder is cleared and refilled by gallery.js, so the prev/next
   buttons must live outside it. */
/* Absolutely positioned on purpose: a percentage max-height only resolves
   against a parent with a definite height, and a centred grid item does not
   give it one — the photo would overflow the stage and cover the filmstrip. */
.gl-lb-img {
    position: absolute;
    top: 20px;
    right: 20px;
    bottom: 20px;
    left: 20px;
    /* Flex, not grid: a percentage max-height on a *grid* item resolves against
       an auto-sized track, which is cyclic, so Chrome drops it to `none` and the
       photo renders at natural size. A flex container with a definite height
       resolves it correctly. */
    display: flex;
    align-items: center;
    justify-content: center;
}

.gl-lb-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9);
    animation: gl-pop .28s cubic-bezier(.2, .7, .3, 1) both;
}

@keyframes gl-pop {
    from { opacity: 0; transform: scale(.985); }
    to   { opacity: 1; transform: none; }
}

.gl-lb-nav {
    position: absolute;
    z-index: 2;
    top: 0; bottom: 0;
    width: clamp(56px, 12vw, 130px);
    display: grid;
    place-items: center;
    background: transparent;
    border: 0;
    color: var(--on-ink-dim);
    font-size: 26px;
    cursor: pointer;
    transition: color .14s ease, background .2s ease;
}

.gl-lb-nav:hover {
    color: var(--amber);
    background: linear-gradient(90deg, rgba(232, 163, 61, .08), transparent);
}

.gl-lb-prev { left: 0; }
.gl-lb-next { right: 0; }
.gl-lb-next:hover { background: linear-gradient(270deg, rgba(232, 163, 61, .08), transparent); }

/* Filmstrip: the sheet you came from, still in reach. */
.gl-lb-strip {
    display: flex;
    gap: 6px;
    padding: 12px 18px;
    overflow-x: auto;
    border-top: 1px solid #23262f;
    scrollbar-width: thin;
}

.gl-lb-strip button {
    flex: none;
    width: 76px;
    height: 51px;
    padding: 0;
    background: var(--ink-2);
    border: 1px solid transparent;
    border-radius: 2px;
    overflow: hidden;
    opacity: .45;
    cursor: pointer;
    transition: opacity .14s ease, border-color .14s ease;
}

.gl-lb-strip button:hover { opacity: .8; }

.gl-lb-strip button.is-current {
    opacity: 1;
    border-color: var(--amber);
}

.gl-lb-strip img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

body.gl-locked { overflow: hidden; }

/* Responsive ----------------------------------------------------------- */

@media (max-width: 900px) {
    :root { --pad: 18px; }

    .gl-shell { grid-template-columns: minmax(0, 1fr); }

    .gl-rail {
        position: static;
        height: auto;
        overflow: visible;
        padding: 0;
        border-right: 0;
        border-bottom: 1px solid var(--rule);
    }

    /* Rail collapses into a disclosure so photos stay above the fold. */
    .gl-rail-toggle {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        padding: 13px var(--pad);
        background: none;
        border: 0;
        font-family: var(--mono);
        font-size: 11px;
        letter-spacing: .1em;
        text-transform: uppercase;
        color: var(--dim);
        cursor: pointer;
    }

    .gl-rail-body { display: none; padding-bottom: 14px; }
    .gl-rail.is-open .gl-rail-body { display: block; }
    .gl-rail-head { display: none; }

    .gl-head { padding-top: 26px; }
    .gl-lb-strip { display: none; }

    /* The path wraps out of the fixed-height bar on narrow screens, and the
       eyebrow + H1 below already say where you are. */
    .gl-path { display: none; }
    .gl-bar { gap: 12px; }

    /* No keyboard on a phone; swipe handles it instead. */
    .gl-kbd-only { display: none; }
    .gl-meta i { display: none; }
}

@media (min-width: 901px) {
    .gl-rail-toggle { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-delay: 0ms !important;
        transition-duration: .001ms !important;
    }

    .gl-frame:hover { transform: none; }
    .gl-card:hover { transform: none; }
    .gl-frame:hover .gl-frame-well img { transform: none; }
    .gl-card--photo:hover .gl-card-cover img { transform: none; }
}

/* Panels & forms (login, errors, prose pages) --------------------------- */

.gl-panel {
    max-width: 460px;
    margin: 56px auto;
    padding: 30px 28px 26px;
    background: var(--sheet-2);
    border: 1px solid var(--rule);
    border-radius: 3px;
}

.gl-panel--wide { max-width: 660px; }

.gl-panel h1 {
    margin: 0 0 6px;
    font-weight: 900;
    font-size: 26px;
    letter-spacing: -.03em;
    text-transform: uppercase;
}

.gl-panel p {
    margin: 0 0 18px;
    color: var(--dim);
    font-size: 14px;
}

.gl-panel p:last-child { margin-bottom: 0; }

.gl-form .form-group { margin-bottom: 16px; }

.gl-form label {
    display: block;
    margin-bottom: 6px;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--dim);
}

.gl-form input[type="text"],
.gl-form input[type="password"],
.gl-form input[type="email"],
.gl-form textarea {
    width: 100%;
    padding: 10px 12px;
    background: #fbfcfd;
    border: 1px solid var(--rule);
    border-radius: 2px;
    color: var(--text);
    font: 400 14.5px/1.4 var(--sans);
    transition: border-color .14s ease;
}

.gl-form input:focus,
.gl-form textarea:focus {
    border-color: var(--amber);
    outline: none;
    box-shadow: 0 0 0 3px rgba(232, 163, 61, .16);
}

.gl-form .field-rememberme label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    text-transform: none;
    letter-spacing: normal;
    font-family: var(--sans);
    font-size: 14px;
    color: var(--text);
}

.gl-form .help-block {
    display: block;
    margin-top: 5px;
    color: #b03a2b;
    font-size: 12.5px;
}

.gl-form .has-error input { border-color: #d05a48; }

.gl-btn {
    display: inline-block;
    padding: 11px 20px;
    background: var(--text);
    border: 1px solid var(--text);
    border-radius: 2px;
    color: #fff;
    font: 600 13px/1 var(--sans);
    letter-spacing: .02em;
    cursor: pointer;
    transition: background .14s ease, border-color .14s ease;
}

.gl-btn:hover {
    background: var(--amber-dk);
    border-color: var(--amber-dk);
}

.gl-alert {
    margin: 0 0 18px;
    padding: 12px 14px;
    background: #fdf3e4;
    border-left: 3px solid var(--amber);
    border-radius: 2px;
    color: #6a4a12;
    font-size: 14px;
}

.gl-code {
    display: block;
    margin-top: 14px;
    padding: 10px 12px;
    background: var(--sheet);
    border: 1px solid var(--rule);
    border-radius: 2px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--dim);
    overflow-x: auto;
}
