/*
 * The default theme: the minimal starter's own look.
 * Its share styles are in shares.css, loaded by the shares alone.
 *
 * Everything here sits in the `theme` layer, after the kit's (kit.css),
 * so it builds on the parts without fighting them, and a client stylesheet
 * that is not in a layer beats all of it. Values come from the tokens; a
 * client theme that only recolours or retypes the site changes tokens.css.
 */
@layer theme {

/* The Starter's own tokens --------------------------------------------------
   Beside the Kit's (kit.css), the few this look adds: what sits over a
   picture or a film, and its shadows. Set any of them in tokens.css. */
:root {
    --media-shade: rgb(0 0 0 / .55);
    --media-shade-soft: rgb(0 0 0 / .35);
    --on-media-ink: #111;
    --on-media-line: rgb(255 255 255 / .55);
    --cover-bg: #111;
    --cover-wash: rgb(8 8 10 / .34);
    --play-disc: rgb(16 17 19 / .55);
    --thumb-shade: rgb(0 0 0 / .38);
    --document-bg: #fff;
    --share-viewer-bg: #fbf8f7;
    --shadow-hover: 0 6px 18px rgb(0 0 0 / .06);
    --shadow-thumb: 0 1px 4px rgb(0 0 0 / .1);
    --shadow-chip: 0 1px 3px rgb(0 0 0 / .15);
    --shadow-popover: 0 6px 24px rgb(0 0 0 / .12);
    --shadow-dialog: 0 24px 60px rgb(0 0 0 / .18);
}

/* Pages ----------------------------------------------------------------- */
.hero-home { min-height: 52vh; display: grid; align-content: end; }
.notice { padding-top: var(--space-7); }
.link-back { color: var(--accent); }

/* Records block --------------------------------------------------------
   One block lists artists or projects in one of four layouts, laid out by
   the Kit (kit.css → Blocks); here, their look. */
.block-records .record-link { gap: .5rem; }
.record-title { font-family: var(--font-display); font-size: 1.15rem; }
.block-records a:hover .record-title,
.records-index a:hover .records-index-title { color: var(--accent); }
.record-meta { color: var(--muted); font-size: .85rem; }
.record-excerpt { color: var(--muted); font-size: .92rem; line-height: 1.5; }
.record-tagline { line-height: 1.4; }
.record-media { background: var(--paper); border: 1px solid var(--line); }

/* Cards, the default. */
.records-grid { gap: 1.5rem 1.25rem; }

/* Rows: a line between them. */
.records-list li { border-top: 1px solid var(--line); }
.records-list li:last-child { border-bottom: 1px solid var(--line); }
.records-list .record-link { gap: 1.25rem; padding: 1.1rem 0; }
.records-list .record-text { gap: .35rem; }

/* Featured: big, one or two across, for a short curated set. */
.records-featured { gap: 2.5rem 2rem; }
.records-featured .record-title { font-size: clamp(1.4rem, 2.5vw, 1.9rem); }
.records-featured .record-text { gap: .4rem; }
/* At the window's width a picture at its own shape is a screen or two
   high: one alone is cropped to the full-width tile's 21:9, two side by
   side to 4:3, on its focus point. The excerpt
   keeps a reading measure. */
.records-featured .record-media { aspect-ratio: 21 / 9; }
.records-featured > .record:not(:only-child) .record-media { aspect-ratio: 4 / 3; }
.records-featured .record-media img { height: 100%; object-fit: cover; }
/* A person is cut at the chin by 21:9: an artist's portrait is 4:3, never
   taller than the screen. */
.records-featured .record-artist .record-media { width: 100%; aspect-ratio: 4 / 3; max-height: 88svh; }
.records-featured .record-excerpt { max-width: 62ch; }
/* A tile's words are its caption, under a picture that runs to the
   window's edge: room above them, nearer what follows than they were.
   An index's cards have the same (blocks.css, .card-link). */
:is(.records-grid, .records-featured) .record-link { gap: clamp(1.5rem, 1rem + 1.5vw, 2.5rem); }
@media (max-width: 760px) {
    .records-featured .record-media { aspect-ratio: 4 / 3; }
}

/* Index: names and nothing else. A directory, not a gallery — no images are
   requested for this layout, so it costs one request and reads like a list. */
.records-index { border-top: 1px solid var(--line); }
.records-index li { border-bottom: 1px solid var(--line); }
.records-index .record-link { gap: .5rem 1rem; padding: .85rem 0; }
.records-index-title { font-family: var(--font-display); font-size: 1.3rem; }
.records-index-meta { color: var(--muted); font-size: .9rem; text-align: end; }
.records-index-tags {
    color: var(--muted);
    font-size: .82rem;
}

@media (max-width: 760px) {
    .records-list .record-link { gap: .75rem; }
}

/* Typed pages ----------------------------------------------------------- */
.bio { color: var(--muted); }
/* Where else to find an artist: a row of plain links under their bio. */
.artist-links { --cluster-gap: var(--space-2) var(--space-5); }
.byline { color: var(--muted); }
.byline a { color: var(--ink); }
/* Back to an artist's other work: above the title, where the label was. */
.project-back { --cluster-gap: var(--space-1) var(--space-5); font-size: var(--text-sm); }
.project-back a { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--tap); color: var(--muted); text-decoration: none; }
.project-back a:hover { color: var(--ink); text-decoration: underline; }
.tags { --cluster-gap: var(--space-2); }
.tags li { border: var(--border) solid var(--line); border-radius: var(--radius-sm); padding: var(--space-1) var(--space-2); font-size: var(--text-xs); color: var(--muted); }

/* A tagline sits between the title and the byline: bigger than body copy,
   quieter than the heading, so it reads as a subtitle and not a paragraph. */
.project-tagline { font-size: var(--text-md); line-height: var(--leading-snug); color: var(--muted); }
.project-head { --stack-gap: var(--space-3); }

/* Credits are scanned, not read: one column of jobs, one of people. The grid
   is what makes that scan possible, so it holds even when a role wraps. */
.project-credits { margin-top: 3rem; border-top: 1px solid var(--line); padding-top: 1.5rem; }
.project-credits-title {
    text-transform: uppercase;
    letter-spacing: .16em;
    font-size: .72rem;
    color: var(--muted);
    margin: 0 0 1rem;
}
.project-credits .credits-group + .credits-group { margin-top: 1.5rem; }
.project-credits .credits-group-title {
    font-size: .8rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin: 0 0 .5rem;
}
.project-credits .credits-list { margin: 0; }
.project-credits .credits-row {
    display: grid;
    grid-template-columns: minmax(8rem, 14rem) 1fr;
    gap: .5rem 1.5rem;
    padding: .25rem 0;
}
.project-credits .credits-role { color: var(--muted); font-size: .9rem; }
.project-credits .credits-name { margin: 0; }
@media (max-width: 40rem) {
    .project-credits .credits-row { grid-template-columns: 1fr; gap: 0; }
    .project-credits .credits-role { font-size: .78rem; }
}

/* A project's or an artist's files: the grid's column count, kept from
   the control panel, on a screen wide enough for it. */
@media (min-width: 761px) {
    .project-grid .media-grid.is-natural { grid-template-columns: repeat(var(--columns, 3), minmax(0, 1fr)); }
}
/* The name leads; the portrait beside it stays small, so the work below
   is on the first screen. */
.artist-head { display: flex; align-items: center; gap: var(--space-5); }
.artist-head .artist-portrait { flex: none; width: 10rem; }
.artist-head h1 { margin: 0; }
.artist-pronouns { margin: 0; color: var(--muted); }
@media (max-width: 40rem) {
    .artist-head { gap: var(--space-4); }
    .artist-head .artist-portrait { width: 6rem; }
}
.artist-about { margin-top: var(--space-6); }
.artist-about .disclosure { margin-top: var(--space-4); }
.project-head .tags { margin: 0; }
.pager { margin-top: var(--space-6); }

/* Gates ----------------------------------------------------------------- */
/* Three screens share this card — the viewer login, a locked page and a
   locked share link. A client meets whichever one the sender chose, so they
   are deliberately the same door: only the copy above the form changes. */

/* A gate is a destination, not a section of a page. The body carries the
   class — set by the three templates, not inferred from what is inside `main`
   — so a child theme can wrap the card in as much markup as it likes and the
   page still composes. The even padding keeps the centre optical rather than
   just arithmetic. */
.is-gate main {
    /* The public layout's main already claims the leftover height; the share
       viewer's does not, and a gate that centred on one page and sat at the
       top of the other would give away which kind of link you had been sent. */
    flex: 1;
    display: grid;
    align-content: center;
    justify-items: center;
    padding-block: clamp(2rem, 8vh, 5rem);
    padding-inline: var(--gutter);
}

.auth-card {
    width: min(26rem, 100%);
    background: var(--paper);
    border: 1px solid var(--line);
    padding: clamp(1.75rem, 5vw, 2.5rem);
}
.auth-head { margin-bottom: 1.75rem; }
/* The global h1 ramps to 4rem, which is a page title, not a door. */
.auth-card h1 { font-size: clamp(1.5rem, 4vw, 1.9rem); margin: 0; }
.auth-intro { margin: .55rem 0 0; color: var(--muted); font-size: .95rem; line-height: 1.5; }

.auth-card form { display: grid; gap: 1.1rem; }
.auth-card label {
    display: grid;
    gap: .45rem;
    color: var(--muted);
    font-size: .68rem;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.auth-card input {
    background: var(--paper);
    border: 1px solid var(--line-strong);
    color: inherit;
    padding: .75rem .8rem;
    font: inherit;
    /* Under 16px, iOS zooms the page in on the focused field and leaves it
       there. The label above carries the small type instead. */
    font-size: 1rem;
    width: 100%;
}
.auth-card input:hover { border-color: var(--ink); }
.auth-card input:focus-visible { outline-offset: 2px; border-color: var(--accent); }
.auth-card input[aria-invalid="true"] { border-color: var(--danger); }

.auth-card button {
    margin-top: .4rem;
    background: var(--ink);
    color: var(--paper);
    border: 1px solid var(--ink);
    padding: .8rem 1rem;
    font: inherit;
    font-size: .7rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}
.auth-card button:hover { background: var(--accent); border-color: var(--accent); }

.error { color: var(--danger); }
/* A rule in the margin rather than loose red text: it marks the message as
   belonging to the form below it without shouting over the heading. */
.auth-card .error {
    margin: 0 0 1.5rem;
    padding: .1rem 0 .1rem .85rem;
    border-inline-start: 2px solid var(--danger);
    font-size: .9rem;
    line-height: 1.5;
}
/* The same rule in ink: good news about the form below, not a problem. */
.auth-card .notice {
    margin: 0 0 1.5rem;
    padding: .1rem 0 .1rem .85rem;
    border-inline-start: 2px solid currentColor;
    font-size: .9rem;
    line-height: 1.5;
}

/* The way out when the password is simply gone. Below the rule, quiet: it is
   the last resort on the page, not a second thing to try first. */
.auth-foot {
    margin: 1.75rem 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .82rem;
}
.auth-foot a { color: var(--muted); text-decoration: underline; text-underline-offset: .2em; }
.auth-foot a:hover { color: var(--ink); }

/* Freeform blocks ------------------------------------------------------- */
/* Blocks are spaced by their page's flow, wider apart than the parts of
   one block; none of them carries an outer margin of its own. */
.page-blocks { --flow-gap: var(--space-8); }
/* The page's grid is Vitrine's (@vitrine/blocks.html.twig); the blocks' structure the Kit's.
   It runs to the window's edges, so work placed against one (a Media
   block, a list's tiles) reaches it, edge to edge. Each block knows which
   of its sides it shares with the window (`--edge-start`, `--edge-end`:
   the page's margin there, the wide column's edge, where the title is),
   and its words keep that margin. On a phone every block is the full
   width. */
.page-freeform:has(> .page-grid) > h1 { grid-column: wide; }
.flow > .page-grid {
    --page-edge: max(var(--gutter), (100cqi - var(--width-wide)) / 2);
    container-type: inline-size;
    grid-column: full;
}
.page-grid > .block,
.page-grid > .grid-cell[style*="--start:1;"] > .block { --edge-start: var(--page-edge); }
.page-grid > .block,
.page-grid > .grid-cell:is([style*="--start:1;--span:12"], [style*="--start:2;--span:11"], [style*="--start:3;--span:10"], [style*="--start:4;--span:9"], [style*="--start:5;--span:8"], [style*="--start:6;--span:7"], [style*="--start:7;--span:6"], [style*="--start:8;--span:5"], [style*="--start:9;--span:4"], [style*="--start:10;--span:3"], [style*="--start:11;--span:2"], [style*="--start:12;--span:1"]) > .block { --edge-end: var(--page-edge); }
@media (max-width: 47.99rem) {
    .page-grid > .grid-cell > .block { --edge-start: var(--page-edge); --edge-end: var(--page-edge); }
}
.page-grid > .block:not(.block-media-grid, .block-records),
.page-grid > .grid-cell > .block:not(.block-media-grid, .block-records) {
    padding-inline: var(--edge-start, 0) var(--edge-end, 0);
}

/* A presentation whose downloads are on: a download button over each file's
   top corner, out of the way of a player's controls. Shown on hover, and
   always where there is no hover. */
.media-grid li.has-download { position: relative; }
.media-dl {
    position: absolute;
    top: .45rem;
    inset-inline-end: .45rem;
    z-index: 2;
    padding: .35rem;
    line-height: 0;
    color: var(--on-media);
    opacity: 0;
    transition: opacity var(--duration-fast) var(--ease);
    filter: drop-shadow(0 1px 2px var(--media-shade));
}
.media-dl .icon { width: 1.35rem; height: 1.35rem; }
.media-grid li:hover .media-dl,
.media-dl:focus-visible { opacity: 1; }
@media (hover: none) {
    .media-dl { opacity: 1; }
}
/* A finger needs 44px, not the icon's 34: the corner is empty enough. */
@media (pointer: coarse) {
    .media-dl {
        top: .2rem;
        inset-inline-end: .2rem;
        min-width: var(--tap);
        min-height: var(--tap);
        display: grid;
        place-items: center;
    }
}
.share-presentation-downloads {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}
.share-presentation-downloads .share-zip { gap: .4rem; color: var(--muted); }
.share-presentation-downloads .share-zip:hover { color: var(--ink); }
.share-presentation-downloads svg {
    width: 1.1rem;
    height: 1.1rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.media-grid li.is-video .video { margin-inline: auto; }

/* Work in a page's flow runs to the window's edges too: a Media block, a
   list's tiles, an artist's or a project's own files, an artist's
   projects. Their words (a heading, filter chips, a list's rows, the names
   under the work) keep the page's column, as on the grid above. */
.flow > :is(.block-media-grid, .block-records, .project-grid, .artist-projects) {
    --edge-start: max(var(--gutter), (100cqi - var(--width-content)) / 2);
    --edge-end: var(--edge-start);
    container-type: inline-size;
    grid-column: full;
}
/* An artist's or a project's files and an artist's projects were the wide
   column, under a head that is: their words stay on its line. */
.flow > :is(.project-grid, .artist-projects) {
    --edge-start: max(var(--gutter), (100cqi - var(--width-wide)) / 2);
}
.block-records > :not(.records-grid, .records-featured),
.artist-projects > :not(.card-grid),
.project-grid .media-caption {
    padding-inline: var(--edge-start, 0) var(--edge-end, 0);
}
/* A tile's name keeps the margin on the side its tile shares with the
   window: both for one the full width (the first of five), the start for
   the left of two, the end for the right. */
:is(.records-grid > .record, .card-grid > .card) {
    --tile-start: 0px;
    --tile-end: 0px;
}
:is(.records-grid > .record, .card-grid > .card):nth-child(5n + 1 of :not([data-filter-hidden])) {
    --tile-start: var(--edge-start, 0px);
    --tile-end: var(--edge-end, 0px);
}
:is(.records-grid > .record, .card-grid > .card):is(:nth-child(5n + 2 of :not([data-filter-hidden])), :nth-child(5n + 4 of :not([data-filter-hidden]))) {
    --tile-start: var(--edge-start, 0px);
}
:is(.records-grid > .record, .card-grid > .card):is(:nth-child(5n + 3 of :not([data-filter-hidden])), :nth-child(5n + 5 of :not([data-filter-hidden]))) {
    --tile-end: var(--edge-end, 0px);
}
/* Featured, one or two large (a presentation's Artist or Project): one
   alone touches both sides, two side by side one each. */
.records-featured > .record {
    --tile-start: var(--edge-start, 0px);
    --tile-end: var(--edge-end, 0px);
}
.records-featured > .record:nth-child(odd):not(:last-child) { --tile-end: 0px; }
.records-featured > .record:nth-child(even) { --tile-start: 0px; }
@media (max-width: 760px) {
    .records-featured > .record,
    :is(.records-grid > .record, .card-grid > .card) {
        --tile-start: var(--edge-start, 0px);
        --tile-end: var(--edge-end, 0px);
    }
}
:is(.records-grid, .records-featured) .record-text { padding-inline: var(--tile-start) var(--tile-end); }
.card-grid .card-link > :not(.card-media) { margin-inline: var(--tile-start) var(--tile-end); }
/* A film's Watch button keeps its tile's margin too, off the window's edge. */
.card-grid .card-watch-frame { padding-inline-start: max(var(--space-3), var(--tile-start)); }
@media (max-width: 760px) {
    .card-grid .card-watch-frame { padding-inline-start: max(var(--space-2), var(--tile-start)); }
}

/* Kit page (templates/kit.html.twig) ----------------------------------- */
.kit-section { margin-top: var(--space-7); }
.kit-swatches { --cluster-gap: var(--space-4); font-size: var(--text-xs); }
.kit-swatches li { display: grid; gap: var(--space-1); justify-items: start; }
.kit-swatch { width: 4rem; height: 2.5rem; border: var(--border) solid var(--line); border-radius: var(--radius-sm); }
.kit-space span { display: block; height: var(--space-4); background: var(--accent); }
.kit-bar { padding: var(--space-3); background: var(--media-bg); font-size: var(--text-xs); text-align: center; }
.kit-icons { --cluster-gap: var(--space-4); font-size: var(--text-lg); }

/* A film in several versions: without the script, one small button each
   under it. With it, a film's choice is in its player (share-reel.js) and a
   picture's sits over its corner while it is pointed at. */
.has-variants { position: relative; }
.media-variant-switch {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    margin-top: .75rem;
}
.media-variant-switch button {
    font: inherit;
    font-size: .75rem;
    letter-spacing: .04em;
    padding: .3rem .75rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: none;
    color: var(--muted);
    cursor: pointer;
}
.media-variant-switch button[aria-pressed="true"] {
    color: var(--bg);
    background: var(--ink);
    border-color: var(--ink);
}
.has-variants.is-enhanced[data-showing="film"] .media-variant-switch { display: none; }
.has-variants.is-enhanced[data-showing="picture"] .media-variant-switch {
    position: absolute;
    top: .75rem;
    inset-inline-end: .75rem;
    margin: 0;
    opacity: 0;
    transition: opacity .15s ease-out;
}
.has-variants.is-enhanced[data-showing="picture"]:hover .media-variant-switch,
.has-variants.is-enhanced[data-showing="picture"]:focus-within .media-variant-switch { opacity: 1; }
@media (hover: none) {
    .has-variants.is-enhanced[data-showing="picture"] .media-variant-switch { opacity: 1; }
}
.has-variants.is-enhanced .media-variant-switch button {
    border-color: transparent;
    background: var(--media-shade);
    color: var(--on-media);
    backdrop-filter: blur(6px);
}
.has-variants.is-enhanced .media-variant-switch button[aria-pressed="true"] {
    background: var(--on-media);
    color: var(--on-media-ink);
}
/* In a film's bar, beside its resolution: never cut for room, it is a choice of film. */
.video-versions { position: relative; flex: none; }
/* The delivery viewer's own tools on a phone: what has no room goes. */
@media (max-width: 640px) {
    .dl-viewer-zoom,
    [data-viewer-fullscreen],
    .dl-viewer-tools .dl-btn span { display: none; }
}
/* Cookie notice and consent (the Kit's parts/consent) */
.cookie-notice {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 40;
    margin: 0 auto;
    max-width: 42rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1.25rem;
    padding: .9rem 1.1rem;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: .5rem;
    box-shadow: var(--shadow-popover);
    font-size: .9rem;
}
.cookie-notice p { margin: 0; color: var(--muted); }
.cookie-notice button {
    border: 1px solid var(--line);
    background: var(--ink);
    color: var(--paper);
    font: inherit;
    padding: .4rem .9rem;
    border-radius: .3rem;
    cursor: pointer;
}
.cookie-notice button.is-quiet { background: transparent; color: var(--ink); }

@media print {
    .site-head, .site-foot, .skip, .cookie-notice, .nav-toggle, .motion-toggle { display: none !important; }
    html, body { background: white; color: black; }
    main { padding: 0; max-width: none; }
    a { text-decoration: underline; }
    /* A printed link is useless unless you can read where it goes. */
    .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; word-break: break-all; }
    img, video, .card, figure { break-inside: avoid; page-break-inside: avoid; }
    h1, h2, h3 { break-after: avoid; }
}

/* Fingers. On a phone every control a recipient can tap is at least 44px
   in both directions (design/shares.md: On a phone), whatever it looks like:
   the icon stays its size, the target around it grows. */
@media (pointer: coarse) {
    .mark,
    .dl-brand,
    .langs > summary,
    .share-cover-enter,
    .share-bar-by,
    .share-zip,
    .share-cover-mark,
    .dl-crumbs a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }
    /* The player's own controls are sized in the kit, which sheds them by
       the same measure (kit.css: Controls shed). */
    .share-zip.is-icon,
    .share-tile-actions .share-dl,
    .dl-views button,
    .dl-get,
    .dl-icon-btn,
    .share-lightbox-close,
    .share-lightbox-action,
    .share-lightbox-nav {
        min-width: var(--tap);
        min-height: var(--tap);
    }
    .share-tile-actions .share-dl { display: grid; place-items: center; }
    .dl-btn { min-height: 44px; }
    .dl-files.is-grid .dl-check { width: 44px; height: 44px; top: .3rem; inset-inline-start: .3rem; }
    .dl-files.is-grid .dl-get { top: .3rem; inset-inline-end: .3rem; }
}


}
