/* Daniel Casique — application layer.

   The visual language lives in the VFW theme (/VFW/themes/gallery-editorial/).
   After the promotion pass, this file holds ONLY what is genuinely specific to
   this one site: one theme-token override (the hero crop focus, tuned to one
   painting), the contact page's address grid, the footer maker credit, and the
   artwork page's four-slot composition — the grid that gives desktop and mobile
   different reading orders from a single DOM order.

   Everything else the site needed on day one — the skip link, the language
   toggle, the whole-image plate figure, the sticky detail column, the frame
   button reset, the pending-media plate, the vertical rhythm utilities and the
   archive filter row — turned out to be theme-level and now lives there. That
   the very first consumer needed all of them is the reason they were promoted:
   a second portfolio would otherwise have forked this file.

   Anything added here that turns out to be reusable belongs in the theme. */

/* ==========================================================================
    1. THEME OVERRIDES
   ========================================================================== */

/* El triunfo del otium is a tall canvas whose figure sits high; holding the hero
   crop at 28% keeps the reader and the book in frame where a plain `center`
   would cut them. This is exactly the kind of per-artwork tuning that does not
   belong in the reusable theme, which now defaults the token to `center`. */
.vfw-theme-gallery-editorial {
    --gallery-editorial-hero-focus: center 28%;
    /* The hero rotates, so the panel must NOT take its proportions from
       whichever painting is showing — otherwise the page reflows every seven
       seconds. Pinned to otium's own 892x1128, which is both the opening image
       and the middle of the rotating set: the other two are cropped 3.4% and
       1.9% on one axis, and the panel is a pixel off where it stood before. */
    --gallery-editorial-hero-ratio: 892 / 1128;
}

/* ==========================================================================
    2. CONTACT PAGE
   ========================================================================== */

/* The channels are now the whole page. They used to be a narrow left column
   beside an enquiry form, and two-up was right at that width; with the form
   gone, a fixed two-column grid would strand five short blocks in the left
   half of the shell. `auto-fit` lets the row hold as many as the width allows
   and collapse to one on a phone, without a breakpoint per count — which
   matters because the number of channels is content, not layout. */
.daniel-contact-addresses {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    align-content: start;
}

/* A channel's lines each take their own row. `.vfw-gallery-prose` sets no
   `display`, so on an <a> it stays inline — without this the two phone numbers
   would run together on one line as though they were a single value. */
.daniel-contact-addresses a {
    display: block;
}

/* The theme spaces consecutive .vfw-gallery-prose siblings by 1rem, which is
   right for the biography's paragraphs and wrong here: these are two lines of
   ONE value, and a paragraph gap between them reads as two separate contacts —
   the very thing merging the headings was meant to stop. */
.daniel-contact-addresses .vfw-gallery-prose + .vfw-gallery-prose {
    margin-top: 0;
}

@media (max-width: 560px) {
    .daniel-contact-addresses {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.5rem;
    }
}

/* ==========================================================================
    3. FOOTER MAKER CREDIT
   ========================================================================== */

/* Copyright and maker credit stacked in the footer's right zone. */
.daniel-footer-legal {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Discreet developer credit, matching the marlon / oropeza treatment: it is
   subordinate to the copyright by SIZE, not by dimming — the same paper tone as
   the line above keeps the mailto link legible on the teal rather than sinking
   it below the contrast floor. */
.daniel-maker-credit {
    margin-top: 6px;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    color: color-mix(in srgb, var(--gallery-editorial-paper) 72%, transparent);
}

/* The separator belongs to the email, so a wrap never strands a lone "·" at the
   end of a line — it moves down with the address it introduces. */
.daniel-maker-credit a::before {
    content: " · ";
}

/* Each part is atomic; the line may only break between them. */
.daniel-credit-name,
.daniel-maker-credit a {
    white-space: nowrap;
}

.daniel-maker-credit a {
    color: inherit;
    text-decoration: none;
    padding: 2px 0;
}

.daniel-maker-credit a:hover,
.daniel-maker-credit a:focus-visible {
    text-decoration: underline;
}

@media (max-width: 900px) {
    .daniel-footer-legal {
        align-items: flex-start;
    }
}

/* ==========================================================================
    4. ARTWORK PAGE COMPOSITION
   ========================================================================== */

/* Spec §21 fixes the MOBILE reading order for this template: the work, then its
   title, artist, medium, status and the enquiry action — and only then the rest
   of the image sequence. The desktop composition (images left, sticky
   metadata right) is the opposite arrangement, so the two cannot be expressed by
   source order alone. Three sibling grid children plus named areas give each
   width its own composition from one DOM order. */
.daniel-artwork-layout {
    display: grid;
    /* Row gap as well as column: the slots are separate blocks in both axes now.
       Without it the gallery butts against the ENQUIRE button on mobile and the
       curatorial text butts against it on desktop — the spacing that used to come
       from a utility class on the heading, which moved slots. */
    gap: var(--gallery-editorial-gap-large);
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    /* One `side` area spanning both rows: the sticky element is the wrapper, so it
       travels the whole image sequence, and the curatorial text sits directly
       under the metadata instead of being pushed to a third row (which left an
       ~800px void between ENQUIRE and "About the work"). */
    grid-template-areas:
        "primary side"
        "gallery side";
    align-items: start;
}

.daniel-artwork-primary {
    grid-area: primary;
}

.daniel-artwork-meta {
    grid-area: meta;
}

.daniel-artwork-gallery {
    grid-area: gallery;
}

/* Inside the desktop wrapper these are ordinary siblings, so the grid's row-gap
   does not separate them — the margin does. On mobile the wrapper dissolves and
   the row-gap takes over, so the margin is removed there to avoid doubling. */
.daniel-artwork-detail {
    grid-area: detail;
    margin-top: var(--gallery-editorial-gap-large);
}

.daniel-artwork-side {
    grid-area: side;
}

/* A one-image work leaves the gallery slot out of the DOM, so its area goes too
   (an empty row would still cost a gap either side). */
.daniel-artwork-layout-single {
    grid-template-areas: "primary side";
}

/* Desktop image rhythm: the same 0.75rem between every plate, including the one
   between the primary image and the gallery. Before, the row gap (2.5rem) stacked
   on the figure's own 0.75rem margin and made that one seam 3.25rem. */
@media (min-width: 901px) {
    .daniel-artwork-layout {
        row-gap: 0.75rem;
    }

    .daniel-artwork-primary .vfw-gallery-plate-figure:last-child {
        margin-bottom: 0;
    }
}

@media (max-width: 900px) {
    /* Spec §21's exact mobile order: the work, its facts and the enquiry action,
       then the rest of the sequence, then the curatorial text and the way back. */
    .daniel-artwork-layout {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "primary"
            "meta"
            "gallery"
            "detail";
    }

    .daniel-artwork-layout-single {
        grid-template-areas:
            "primary"
            "meta"
            "detail";
    }

    /* Dissolve the desktop wrapper so its two children become grid items and can
       take the spec-§21 positions above; the wrapper's own sticky goes with it. */
    .daniel-artwork-side {
        display: contents;
    }

    .daniel-artwork-detail {
        margin-top: 0;
    }
}

/* ==========================================================================
    GALLERY OVERLAY

    Clicking a painting in any works grid opens the catalogue as a sequence:
    the work large, a caption under it, and a filmstrip of every other work.
    It extends the theme's lightbox (the scrim, the close button and the image
    rules are inherited) and adds the parts that make it a gallery rather than
    a single enlarged image.

    The stage takes the height that is left after the caption bar and the
    filmstrip have taken theirs, so the painting is always whole: it is sized
    by `flex: 1` + `min-height: 0`, never by a viewport calculation that would
    have to be kept in step with the two bars by hand.
   ========================================================================== */

.daniel-gallery {
    padding: 1.5rem 1.5rem 1rem;
    flex-direction: column;
    /* Deeper than the theme's single-image lightbox on purpose. This overlay
       covers a grid of other paintings, and at the theme's scrim those stayed
       legible enough to compete with the one work the visitor asked to see. */
    background-color: color-mix(in srgb, var(--gallery-editorial-ink) 97%, transparent);
}

.daniel-gallery-panel {
    display: flex;
    flex-direction: column;
    gap: var(--gallery-editorial-gap);
    width: 100%;
    max-width: var(--gallery-editorial-shell-max);
    height: 100%;
    margin: 0 auto;
}

.daniel-gallery-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    /* min-height: 0 is what lets a flex child be SMALLER than its content —
       without it the painting sets the row height and pushes the filmstrip off
       the bottom of the screen. */
    flex: 1;
    min-height: 0;
    /* The zoom viewport: the magnified canvas is clipped to this frame. */
    overflow: hidden;
    /* The anchor the step arrows are positioned against. */
    position: relative;
}

/* Holds the image button alone, so replacing the painting on every move cannot
   also remove the arrows that now live in the stage beside it. */
.daniel-gallery-stage-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.daniel-gallery-stage-button {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    background: none;
    border: 0;
    cursor: zoom-in;
}

/* Sized to the frame rather than to itself, so the element box and the zoom
   viewport are the same rectangle — which is the assumption the panning maths
   is built on. */
.daniel-gallery-stage-button img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    transform-origin: center;
    transition: transform var(--gallery-editorial-transition);
    /* The mouse half of claiming the drag: a bare img is natively draggable, and
       that drag fires pointercancel, which killed the pan on its first pixel. */
    -webkit-user-drag: none;
    user-select: none;
}

.daniel-gallery-zoomed .daniel-gallery-stage-button {
    cursor: grab;
    /* Claim the gesture: without this the browser treats a drag as a page
       gesture and the canvas stutters or refuses to move at all. */
    touch-action: none;
}

.daniel-gallery-zoomed .daniel-gallery-stage-button:active {
    cursor: grabbing;
}

/* A transition is right for the jump into zoom and wrong for every frame of a
   drag, where it turns direct manipulation into lag. */
.daniel-gallery-dragging .daniel-gallery-stage-button img {
    transition: none;
}

.daniel-gallery-stage-button:focus-visible {
    outline: 2px solid var(--gallery-editorial-ochre);
    outline-offset: -2px;
}

.daniel-gallery-bar {
    display: flex;
    align-items: center;
    gap: var(--gallery-editorial-gap);
    color: var(--gallery-editorial-paper);
    font-family: var(--gallery-editorial-font-interface);
    /* The anchor for the work link, which sits off to the right on the title's
       own line rather than in the centred column. */
    position: relative;
}

/* A centred column, not a row: the work's name, the position within the
   catalogue, then the way through to the work itself. */
.daniel-gallery-caption-column {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    text-align: center;
}

.daniel-gallery-caption {
    color: var(--gallery-editorial-paper);
    font-size: 0.9rem;
    line-height: 1.5;
}

.daniel-gallery-counter {
    color: var(--gallery-editorial-rule-strong);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: var(--gallery-editorial-label-tracking);
    text-transform: uppercase;
}

/* Back out on the right where it was, but pinned to the title's line so it
   reads as belonging to the name rather than floating against the counter.
   The caption's line box is 0.9rem x 1.5; matching it here puts the two on one
   optical line despite the link's smaller uppercase type. */
.daniel-gallery .daniel-gallery-work-link {
    position: absolute;
    right: 0;
    top: 0;
    height: calc(0.9rem * 1.5);
    color: var(--gallery-editorial-paper);
}

/* Too narrow to sit anything beside the title: back into the column, under the
   counter, where it was a moment ago. */
@media (max-width: 760px) {
    .daniel-gallery .daniel-gallery-work-link {
        position: static;
        height: auto;
        margin-top: 0.1rem;
    }
}

/* Over the painting at half its height, not under it: at the bottom they
   crowded the work link. A dark disc so a pale canvas cannot swallow them. */
.daniel-gallery-step {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    background: rgba(18, 18, 18, 0.55);
    border: 1px solid var(--gallery-editorial-ink-faint);
    border-radius: 50%;
    color: var(--gallery-editorial-paper);
    cursor: pointer;
    transition: border-color var(--gallery-editorial-transition), opacity var(--gallery-editorial-transition);
}

.daniel-gallery-previous {
    left: 0.5rem;
}

.daniel-gallery-next {
    right: 0.5rem;
}

.daniel-gallery-step:hover:not(:disabled) {
    border-color: var(--gallery-editorial-paper);
}

/* An arrow with nowhere to go is not drawn at all - not dimmed, not on hover.
   At the ends of the catalogue there is simply one arrow. It stays in the DOM
   and stays `disabled`, so it is out of the tab order and a screen reader still
   reports the boundary, and it is absolutely positioned, so hiding it shifts
   nothing. Order-independent: the reveal below cannot match it. */
.daniel-gallery-step:disabled {
    cursor: default;
    opacity: 0;
}

/* Reveal on hover ONLY where hovering is real. A touch screen has no hover
   state, so an unguarded opacity: 0 would leave the arrows permanently
   invisible on a phone; outside this query they simply stay on. */
@media (hover: hover) and (pointer: fine) {
    .daniel-gallery-step {
        opacity: 0;
    }

    /* :not(:disabled) is load-bearing: these selectors outrank the disabled
       rule above, so without it an unavailable arrow would reappear on hover. */
    .daniel-gallery-stage:hover .daniel-gallery-step:not(:disabled),
    .daniel-gallery-step:focus-visible:not(:disabled) {
        opacity: 1;
    }
}

/* Drawn rather than lettered: an arrow glyph would be read aloud by a screen
   reader on top of the button's own label. */
.daniel-gallery-step::before {
    content: "";
    display: block;
    width: 0.6rem;
    height: 0.6rem;
    margin: 0 auto;
    border-top: 1px solid currentColor;
    border-right: 1px solid currentColor;
}

.daniel-gallery-previous::before {
    transform: translateX(0.15rem) rotate(-135deg);
}

.daniel-gallery-next::before {
    transform: translateX(-0.15rem) rotate(45deg);
}

.daniel-gallery-filmstrip {
    display: flex;
    flex: 0 0 auto;
    gap: 0.5rem;
    justify-content: flex-start;
    padding-bottom: 0.5rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--gallery-editorial-ink-faint) transparent;
}

.daniel-gallery-thumb {
    flex: 0 0 auto;
    height: 4.5rem;
    padding: 0;
    background: none;
    border: 0;
    outline: 1px solid transparent;
    opacity: 0.45;
    cursor: pointer;
    transition: opacity var(--gallery-editorial-transition), outline-color var(--gallery-editorial-transition);
}

.daniel-gallery-thumb:hover {
    opacity: 0.8;
}

.daniel-gallery-thumb-current {
    outline-color: var(--gallery-editorial-paper);
    outline-offset: 2px;
    opacity: 1;
}

/* The theme's lightbox rule caps every image at the overlay's own box, which
   for a filmstrip thumbnail collapses it to nothing. These are sized by the
   strip's height instead, at their natural proportions. */
.daniel-gallery-thumb img {
    width: auto;
    height: 100%;
    max-width: none;
    max-height: none;
}

.daniel-gallery-step:focus-visible,
.daniel-gallery-thumb:focus-visible {
    outline: 2px solid var(--gallery-editorial-ochre);
    outline-offset: 2px;
}

@media (max-width: 700px) {
    .daniel-gallery {
        padding: 1rem 0.75rem 0.5rem;
    }

    /* The caption takes the full width and the controls sit under it: at this
       width a single row squeezes the caption to two words per line. */
    .daniel-gallery-bar {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
    }

    .daniel-gallery-caption-column {
        flex: 1 0 100%;
        order: -1;
    }

    .daniel-gallery-thumb {
        height: 3.25rem;
    }
}

/* The statement and the button are two acts; a line of air between them. */
.daniel-hero-action {
    margin-top: 1.5rem;
}

/* ---- the works chooser: one disc per kind ------------------------------- */

.daniel-kind-chooser {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--gallery-editorial-gap-large);
    justify-items: center;
    margin: 0 auto;
    max-width: 52rem;
    padding: var(--gallery-editorial-gap) 0;
}

.daniel-kind-choice {
    color: inherit;
    display: grid;
    gap: var(--gallery-editorial-gap);
    justify-items: center;
    text-decoration: none;
    width: 100%;
}

.daniel-kind-disc {
    aspect-ratio: 1 / 1;
    background-color: var(--gallery-editorial-paper);
    border-radius: 50%;
    overflow: hidden;
    transition: transform var(--gallery-editorial-transition);
    width: min(100%, 22rem);
}

.daniel-kind-disc img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.daniel-kind-disc-empty {
    border: 1px solid var(--gallery-editorial-rule-strong);
}

.daniel-kind-label {
    color: var(--gallery-editorial-ink);
    font-family: var(--gallery-editorial-font-interface);
    font-size: 1.6rem;
    font-weight: 300;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    transition: color var(--gallery-editorial-transition);
}

.daniel-kind-choice:hover .daniel-kind-disc,
.daniel-kind-choice:focus-visible .daniel-kind-disc {
    transform: scale(1.03);
}

.daniel-kind-choice:hover .daniel-kind-label,
.daniel-kind-choice:focus-visible .daniel-kind-label {
    color: var(--gallery-editorial-ochre);
}

@media (max-width: 720px) {
    .daniel-kind-chooser {
        grid-template-columns: minmax(0, 1fr);
    }

    .daniel-kind-disc {
        width: min(72vw, 18rem);
    }

    .daniel-kind-label {
        font-size: 1.25rem;
    }
}
/* @audited cfw style=933b448c200f memsec=933b448c200f test=933b448c200f design=9688c003f86a seam=3dd659c01fb4 */
