/* Opt in to cross-document view transitions: arriving from the homepage
   cross-fades the page. The feature tile is deliberately not morphed here —
   this page opens on an editorial header rather than a full-bleed image, so
   there is nothing worth expanding the tile into. */
@view-transition { navigation: auto; }

:root {
    --paper: #eee9df;
    --ink: #171714;
    --acid: #ff583d;
    --line: rgba(23, 23, 20, .2);
    --sidebar-width: clamp(220px, 18vw, 290px);
    --gutter: clamp(20px, 3.2vw, 58px);
}

html { scroll-behavior: smooth; }

body.photo-portfolio-page {
    margin: 0;
    overflow-x: hidden;
    background: var(--paper);
    color: var(--ink);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* The portfolio supplies its own masthead. This also prevents the global blue
   header gradient from reaching album headers. */
.photo-portfolio-page > header { display: none; }
.photo-story__header { background: transparent !important; }

.photo-portfolio *, .photo-lightbox * { box-sizing: border-box; }
.photo-portfolio a { color: inherit; }
.photo-sidebar a, .photo-sidebar a * { cursor: pointer !important; }

.photo-sidebar {
    position: fixed;
    z-index: 20;
    inset: 0 auto 0 0;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    height: 100svh;
    padding: clamp(24px, 3vw, 48px) clamp(20px, 2.5vw, 38px) 28px;
    background: var(--ink);
    color: var(--paper);
}

.photo-sidebar__brand {
    align-self: flex-start;
    font-family: "Iowan Old Style", Baskerville, Georgia, serif;
    font-size: clamp(23px, 2vw, 32px);
    line-height: 1;
    letter-spacing: -.035em;
    text-decoration: none;
}

.photo-sidebar__brand:hover { color: var(--paper); text-decoration: none; }

.photo-sidebar__edition {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding-top: 11px;
    border-top: 1px solid rgba(238, 233, 223, .28);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.photo-sidebar__nav-shell { display: contents; }
.photo-sidebar__chevron { display: none; }

.photo-sidebar__nav {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    margin-block: 30px;
}

.photo-sidebar__nav a {
    position: relative;
    display: grid;
    grid-template-columns: 27px 1fr;
    gap: 9px;
    align-items: baseline;
    padding: 11px 0;
    color: rgba(238, 233, 223, .54);
    font-family: "Iowan Old Style", Baskerville, Georgia, serif;
    font-size: clamp(17px, 1.45vw, 23px);
    line-height: 1.05;
    text-decoration: none;
    cursor: pointer;
    transition: color .25s ease;
}

.photo-sidebar__nav a > span {
    transition: transform .35s cubic-bezier(.22, .61, .36, 1);
}

.photo-sidebar__nav a::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 3px;
    left: 36px;
    height: 1px;
    background: var(--acid);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .35s cubic-bezier(.22, .61, .36, 1);
}

.photo-sidebar__nav a:hover,
.photo-sidebar__nav a.is-active { color: var(--paper); }
.photo-sidebar__nav a:hover > span,
.photo-sidebar__nav a.is-active > span { transform: translateX(4px); }
.photo-sidebar__nav a.is-active::after { transform: scaleX(1); }
.photo-sidebar__nav a:focus-visible { outline: 1px solid var(--acid); outline-offset: 3px; }

.photo-sidebar__number {
    color: var(--acid);
    font-family: Georgia, serif;
    font-size: 10px;
    font-style: italic;
}

.photo-sidebar__footer {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.photo-sidebar__footer a { text-decoration: none; }
.photo-stage {
    min-height: 100svh;
    margin-left: var(--sidebar-width);
    view-transition-name: portfolio-album;
}

.photo-story {
    min-height: 100svh;
    padding: clamp(42px, 5vw, 82px) var(--gutter) clamp(80px, 10vw, 160px);
    animation: album-enter .55s cubic-bezier(.22, .61, .36, 1) both;
}

.photo-story[hidden] { display: none; }

@keyframes album-enter {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

::view-transition-old(portfolio-album) {
    animation: .18s ease both album-old;
}

::view-transition-new(portfolio-album) {
    animation: .5s cubic-bezier(.22, .61, .36, 1) both album-new;
}

@keyframes album-old { to { opacity: 0; transform: translateY(-8px); } }
@keyframes album-new { from { opacity: 0; transform: translateY(14px); } }

.photo-story__header {
    display: grid;
    grid-template-columns: minmax(38px, .18fr) minmax(260px, 1.35fr) minmax(220px, .7fr);
    gap: clamp(18px, 2.5vw, 42px);
    align-items: end;
    margin-bottom: clamp(44px, 6vw, 92px);
    padding: 0 !important;
}

.photo-story__number {
    color: var(--acid);
    font-family: Georgia, serif;
    font-size: clamp(30px, 3.8vw, 62px);
    font-style: italic;
    line-height: 1;
}

.photo-kicker {
    margin: 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.photo-story__title h1 {
    margin: 10px 0 0;
    color: var(--ink);
    font-family: "Iowan Old Style", Baskerville, Georgia, serif;
    font-size: clamp(54px, 7.8vw, 132px);
    font-weight: 400;
    line-height: .8;
    letter-spacing: -.065em;
}

.photo-story__note {
    max-width: 370px;
    font-size: 14px;
    line-height: 1.55;
}

.photo-story__note p { margin: 0 0 16px; }
.photo-story__note span {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: clamp(10px, 1.3vw, 22px);
    align-items: start;
}

.photo-grid__item { grid-column: span 6; margin: 0 0 clamp(28px, 5vw, 76px); }
.photo-grid__item--wide { grid-column: span 8; }
.photo-grid__item--offset { grid-column: 3 / span 7; }
.photo-grid__item--small { grid-column: span 4; margin-top: 7vw; }
.photo-grid__item--full { grid-column: 1 / -1; }
.photo-grid__item--row-start { grid-column: 1 / span 6; }

.photo-open {
    position: relative;
    display: block;
    width: min(100%, calc((100svh - 48px) * var(--photo-aspect)));
    margin-inline: auto;
    padding: 0;
    overflow: hidden;
    background: #d8d2c8;
    border: 0;
    cursor: zoom-in;
}

.photo-open img {
    display: block;
    width: 100%;
    height: auto;
    max-height: calc(100svh - 48px);
    object-fit: contain;
    transition: transform .8s cubic-bezier(.22, .61, .36, 1), filter .5s ease;
}

.photo-open:hover img { transform: scale(1.018); filter: saturate(1.05); }

.photo-grid__item[data-photo-crop="2:3"] .photo-open {
    width: min(100%, calc((100svh - 48px) * 2 / 3));
    aspect-ratio: 2 / 3;
    margin-inline: auto;
}

.photo-grid__item[data-photo-crop="2:3"] .photo-open img {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: cover;
    object-position: var(--photo-crop-position, center);
}

.photo-grid__item[data-photo-crop="2:3"] figcaption {
    width: min(100%, calc((100svh - 48px) * 2 / 3));
}

.photo-filename {
    position: absolute;
    z-index: 2;
    right: 12px;
    bottom: 12px;
    left: 12px;
    padding: 9px 11px;
    opacity: 0;
    background: rgba(12, 12, 10, .82);
    color: #fff;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: clamp(10px, .75vw, 13px);
    font-weight: 600;
    letter-spacing: .04em;
    line-height: 1.2;
    overflow-wrap: anywhere;
    text-align: left;
    transform: translateY(6px);
    transition: opacity .18s ease, transform .25s cubic-bezier(.22, .61, .36, 1);
    pointer-events: none;
}

.show-photo-filenames .photo-open:hover .photo-filename,
.show-photo-filenames .photo-open:focus-visible .photo-filename {
    opacity: 1;
    transform: none;
}

.photo-copy-status {
    position: fixed;
    z-index: 120;
    right: 22px;
    bottom: 22px;
    max-width: min(420px, calc(100vw - 44px));
    padding: 12px 15px;
    opacity: 0;
    background: var(--ink);
    color: var(--paper);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 11px;
    line-height: 1.35;
    overflow-wrap: anywhere;
    transform: translateY(8px);
    transition: opacity .2s ease, transform .25s cubic-bezier(.22, .61, .36, 1);
    pointer-events: none;
}

.photo-copy-status.is-visible { opacity: 1; transform: none; }

.photo-grid__item figcaption {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    width: min(100%, calc((100svh - 48px) * var(--photo-aspect)));
    margin: 10px auto 0;
    font-size: 9px;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.photo-next {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "eyebrow meta"
        "title meta";
    gap: 12px 30px;
    align-items: end;
    margin-top: clamp(30px, 5vw, 80px);
    padding-top: clamp(24px, 3vw, 42px);
    border-top: 1px solid var(--line);
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
}

.photo-next:hover, .photo-next:focus { color: var(--ink); text-decoration: none; }
.photo-next:focus-visible { outline: 2px solid var(--acid); outline-offset: 8px; }

.photo-next__eyebrow {
    grid-area: eyebrow;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.photo-next__title {
    grid-area: title;
    font-family: "Iowan Old Style", Baskerville, Georgia, serif;
    font-size: clamp(42px, 6.8vw, 112px);
    line-height: .9;
    letter-spacing: -.05em;
    transition: transform .35s cubic-bezier(.22, .61, .36, 1);
}

.photo-next__meta {
    grid-area: meta;
    display: flex;
    gap: clamp(14px, 2vw, 30px);
    align-items: center;
    color: var(--acid);
    font-family: Georgia, serif;
    font-size: clamp(16px, 2vw, 28px);
    font-style: italic;
}

.photo-next__arrow {
    color: var(--ink);
    font-size: clamp(30px, 4vw, 64px);
    font-style: normal;
    line-height: .7;
    transition: transform .35s cubic-bezier(.22, .61, .36, 1);
}

.photo-next:hover .photo-next__title { transform: translateX(8px); }
.photo-next:hover .photo-next__arrow { transform: translateX(8px); }

.portfolio-js .reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .7s ease, transform .75s cubic-bezier(.22, .61, .36, 1);
}

.portfolio-js .reveal.is-visible { opacity: 1; transform: none; }

.photo-lightbox {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: grid;
    grid-template-columns: 80px 1fr 80px;
    align-items: center;
    padding: 56px 18px 28px;
    visibility: hidden;
    background: rgba(12, 12, 10, .97);
    color: white;
    transition: background-color 240ms ease;
}

.photo-lightbox.is-open { visibility: visible; }
.photo-lightbox.is-closing { background-color: rgba(12, 12, 10, 0); }
.photo-lightbox__figure { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; height: 100%; margin: 0; touch-action: pan-y pinch-zoom; }
.photo-lightbox__image { display: block; max-width: 100%; max-height: calc(100svh - 110px); object-fit: contain; will-change: transform; }
.photo-lightbox__caption { align-self: stretch; display: flex; justify-content: space-between; gap: 24px; min-height: 20px; padding-top: 10px; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; transition: opacity 140ms ease; }
.photo-lightbox__caption-date { flex: 0 0 auto; text-align: right; }
.photo-lightbox button { background: transparent; border: 0; color: inherit; cursor: pointer; font: inherit; transition: opacity 140ms ease; }
.photo-lightbox.is-closing button,
.photo-lightbox.is-closing .photo-lightbox__caption { opacity: 0; pointer-events: none; }
.photo-lightbox__close { position: absolute; top: 20px; right: 22px; font-size: 11px !important; letter-spacing: .12em; text-transform: uppercase; }
.photo-lightbox__previous, .photo-lightbox__next { font-family: Georgia, serif !important; font-size: 34px !important; }
body.has-lightbox { overflow: hidden; }

@media (max-width: 980px) {
    :root { --sidebar-width: 210px; }
    .photo-story__header { grid-template-columns: 48px 1fr; }
    .photo-story__note { grid-column: 2; }
    .photo-grid__item, .photo-grid__item--wide { grid-column: span 6; }
    .photo-grid__item--offset { grid-column: 2 / span 9; }
    .photo-grid__item--row-start { grid-column: 1 / span 6; }
}

@media (max-height: 760px) and (min-width: 721px) {
    .photo-sidebar { padding-block: 20px; }
    .photo-sidebar__nav { gap: 0; margin-block: 16px; }
    .photo-sidebar__nav a { padding-block: 7px; font-size: clamp(15px, 1.3vw, 20px); }
}

@media (max-width: 720px) {
    .photo-sidebar {
        position: sticky;
        top: 0;
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 12px 20px;
        width: 100%;
        height: auto;
        padding: 16px 18px 10px;
    }

    .photo-sidebar__brand { font-size: 21px; }
    .photo-sidebar__edition { align-self: center; margin: 0; padding: 0; border: 0; }
    .photo-sidebar__edition span:last-child { display: none; }
    .photo-sidebar__nav-shell {
        position: relative;
        grid-column: 1 / -1;
        display: block;
        min-width: 0;
    }
    .photo-sidebar__chevron {
        position: absolute;
        z-index: 3;
        top: 0;
        bottom: 0;
        display: flex;
        align-items: center;
        width: 42px;
        padding: 0 0 7px;
        visibility: hidden;
        border: 0;
        color: var(--paper);
        font: 22px/1 Georgia, serif;
        opacity: 0;
        cursor: pointer;
        transition: opacity .18s ease;
        pointer-events: none;
    }
    .photo-sidebar__chevron--left {
        left: 0;
        justify-content: flex-start;
        background: linear-gradient(90deg, var(--ink) 0 48%, rgba(23, 23, 20, 0) 100%);
    }
    .photo-sidebar__chevron--right {
        right: 0;
        justify-content: flex-end;
        background: linear-gradient(270deg, var(--ink) 0 48%, rgba(23, 23, 20, 0) 100%);
    }
    .photo-sidebar__chevron.is-visible { visibility: visible; opacity: .9; pointer-events: auto; }
    .photo-sidebar__chevron:focus-visible { outline: 1px solid var(--acid); outline-offset: 1px; }
    .photo-sidebar__nav { min-width: 0; flex-direction: row; justify-content: flex-start; gap: 22px; margin: 0; overflow-x: auto; scrollbar-width: none; }
    .photo-sidebar__nav::-webkit-scrollbar { display: none; }
    .photo-sidebar__nav a { display: block; flex: 0 0 auto; padding: 7px 0 10px; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
    .photo-sidebar__nav a::after { right: 0; bottom: 4px; left: 0; }
    .photo-sidebar__nav a:hover > span, .photo-sidebar__nav a.is-active > span { transform: none; }
    .photo-sidebar__number, .photo-sidebar__footer { display: none; }
    .photo-stage { margin-left: 0; }
    .photo-story { padding-top: 38px; }
    .photo-story__header { display: block; }
    .photo-story__number { margin-bottom: 22px; }
    .photo-story__note { margin-top: 26px; }
    .photo-grid { display: block; }
    .photo-grid__item, .photo-grid__item--small { margin: 0 0 42px; }
    .photo-next {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "eyebrow" "title" "meta";
        gap: 10px;
        margin-top: 58px;
        padding-top: 24px;
    }
    .photo-next__title { font-size: clamp(38px, 13vw, 58px); }
    .photo-next__meta { justify-self: start; margin-top: 4px; }
    .photo-grid__item--small { width: 76%; margin-left: auto; }
    .photo-grid__item .photo-open,
    .photo-grid__item figcaption { width: min(100%, calc((100svh - 112px) * var(--photo-aspect))); }
    .photo-grid__item .photo-open img { max-height: calc(100svh - 112px); }
    .photo-grid__item[data-photo-crop="2:3"] .photo-open,
    .photo-grid__item[data-photo-crop="2:3"] figcaption { width: min(100%, calc((100svh - 112px) * 2 / 3)); }
    .photo-lightbox { grid-template-columns: minmax(0, 1fr); padding-inline: 0; }
    .photo-lightbox__figure { grid-column: 1; width: 100vw; }
    .photo-lightbox__image { max-width: 100vw; }
    .photo-lightbox__caption { padding-inline: 14px; }
    .photo-lightbox__previous, .photo-lightbox__next { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .photo-story { animation: none; }
    .portfolio-js .reveal { opacity: 1; transform: none; transition: none; }
    .photo-open img, .photo-sidebar__nav a, .photo-sidebar__nav a::after { transition: none; }
    .photo-lightbox, .photo-lightbox button, .photo-lightbox__caption { transition: none; }
    ::view-transition-group(portfolio-album) { animation-duration: 0s; }
}
