/* Layout rules that Cargo's own engine used to provide. site.css (the original Cargo stylesheet) loads after this. */
html { font-size: calc(8.247px + 0.3273vw); --mobile-scale: 1.2; }
@media (max-width: 767px) { html { font-size: 2.688vw; } }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; }
img, video, iframe { max-width: 100%; }

/* pages */
.page { position: relative; display: flex; justify-content: center; width: 100%; }
.backdrop { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.page-layout { position: relative; z-index: 1; width: 100%; display: flex; min-height: inherit; }
.page-content { width: 100%; display: flex; min-height: inherit; } /* a row: align-items in page CSS sets vertical position, like Cargo */
bodycopy { width: 100%; }
.bg-video { position: absolute; top: 50%; left: 50%; width: 177.78vh; min-width: 100%; height: 56.25vw; min-height: 100%; transform: translate(-50%, -50%); border: 0; pointer-events: none; }

/* pinned pages (navs) */
.pinned { z-index: 50; pointer-events: none; }
.pinned .page-layout { pointer-events: auto; }
.pinned.fixed { position: fixed; left: 0; right: 0; max-height: 100vh; overflow-y: auto; }
.pinned.overlay:not(.fixed) { position: absolute; left: 0; right: 0; z-index: 40; }
.pinned.overlay:not(.fixed).pinned-top { top: 0; }
.pinned.overlay:not(.fixed).pinned-bottom { bottom: 0; }
.pinned.adjust:not(.fixed) { position: relative; }
.pinned.fixed.adjust.pinned-top { position: sticky; }
.pinned.fixed.pinned-top { top: 0; }
.pinned.fixed.pinned-bottom { bottom: 0; }
.pinned.fixed:not(.overlay).pinned-top { position: sticky; }
body.mobile .only-desktop, body:not(.mobile) .only-mobile { display: none !important; }
body.mobile .page-layout { max-width: 100% !important; } /* Cargo mobile setting "pages full width" */

/* columns: spans share the row like Cargo's 12-column flex layout */
column-set { display: flex; gap: var(--gutter, 1rem); width: 100%; }
column-unit { display: block; flex: var(--span, 1) 1 0%; min-width: 0; overflow-wrap: break-word; } /* long links wrap instead of running into the next column */
body.mobile column-set:not(.no-mobile-stack) { flex-direction: column; gap: var(--mobile-gutter, var(--gutter, 1rem)); }
body.mobile column-set:not(.no-mobile-stack) > column-unit:empty { display: none; }

/* media */
media-item { display: inline-block; width: 100%; max-width: var(--scale, 100%); vertical-align: bottom; }
media-item .media { display: block; width: 100%; height: auto; }
media-item.limit-height { width: auto; max-width: none; }
media-item.limit-height .media { height: var(--scale); width: auto; box-sizing: content-box; }
media-item.embed .media { aspect-ratio: 16 / 9; height: auto; border: 0; }
media-item a { display: block; }
.zoomable .media { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, .92); display: flex; align-items: center; justify-content: center; cursor: zoom-out; padding: 2rem; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* galleries */
gallery-grid { display: grid; grid-template-columns: repeat(var(--columns, 3), minmax(0, 1fr)); gap: var(--gutter, 1rem); width: 100%; }
body.mobile gallery-grid { grid-template-columns: repeat(var(--mobile-columns, 1), minmax(0, 1fr)); gap: var(--mobile-gutter, var(--gutter, 1rem)); }
gallery-grid media-item, gallery-columnized media-item { width: 100%; }
gallery-grid .thumbnail { display: block; text-decoration: none; color: inherit; }
gallery-justify { display: flex; flex-wrap: wrap; gap: var(--gutter, 1rem); width: 100%; container-type: inline-size; }
/* justified rows: items grow in proportion to their aspect ratio (--ar), so every row is one height and fills the width */
gallery-justify > media-item { flex: calc(var(--ar, 1.5) * 1000) 1 calc(var(--ar, 1.5) * var(--row-height, 20rem)); aspect-ratio: var(--ar, 1.5); width: auto; max-width: none; }
gallery-justify::after { content: ""; flex: 999999 1 0; } /* keeps a short last row from stretching */
gallery-justify > media-item .media { height: 100%; width: 100%; object-fit: cover; }
body.mobile gallery-justify > media-item { flex-basis: 100%; }
gallery-columnized { display: block; columns: var(--columns, 3); column-gap: var(--gutter, 1rem); }
/* slides share one grid cell, so the slideshow is as tall as its tallest photo and photos fade between each other */
gallery-slideshow { display: grid; position: relative; width: 100%; }
gallery-slideshow > media-item { grid-area: 1 / 1; align-self: var(--valign, center); width: 100%; opacity: 0; visibility: hidden; transition: opacity var(--speed, .5s), visibility var(--speed, .5s); }
gallery-slideshow > media-item.active { opacity: 1; visibility: visible; }
gallery-slideshow .ss-nav { position: absolute; top: 0; bottom: 0; width: 50%; background: none; border: 0; cursor: pointer; }
gallery-slideshow .ss-prev { left: 0; cursor: w-resize; }
gallery-slideshow .ss-next { right: 0; cursor: e-resize; }

/* misc Cargo elements */
.text-icon { display: inline-block; line-height: 1; }
.text-icon svg { width: 0.93em; height: 0.93em; fill: currentColor; vertical-align: -0.12em; } /* 0.93em keeps the original icon-to-caps ratio (1.57) with the new nav fonts */
/* Cargo's audio player: a pill with a play/pause segment and the track label; fills as it plays */
.audio-player { --p: 0%; display: flex; align-items: stretch; max-width: 100%; width: 34rem; height: 3.6rem; border: 1px solid rgba(0, 0, 0, .25); border-radius: 999px; overflow: hidden; color: rgba(0, 0, 0, .85); font: 400 1.35rem/1 "Diatype Variable", sans-serif; cursor: pointer; background: linear-gradient(90deg, rgba(0, 0, 0, .06) var(--p), transparent var(--p)); }
.audio-player .ap-toggle { flex: 0 0 4.4rem; border: 0; border-right: 1px solid rgba(0, 0, 0, .25); background: none; color: inherit; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.audio-player .ap-toggle::before { content: ""; border-style: solid; border-width: .55em 0 .55em .9em; border-color: transparent transparent transparent currentColor; margin-left: .2em; }
.audio-player.playing .ap-toggle::before { border-width: 0 .3em; border-color: currentColor; width: .35em; height: 1.1em; margin: 0; }
.audio-player .label { display: flex; align-items: center; padding: 0 1.5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
bodycopy iframe { border: 0; }
.not-found { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #eeeae0; font: 1.6rem/1.4 "Diatype Mono Variable", monospace; }

/* YouTube: thumbnail with a play button; the player loads on click (site.js) */
.yt { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; cursor: pointer; position: relative;
  background: #000 center / cover no-repeat; background-origin: content-box; background-clip: content-box; }
.yt::after { content: ""; position: absolute; left: 50%; top: 50%; width: 4.4rem; height: 3.1rem; transform: translate(-50%, -50%);
  border-radius: .9rem; background: rgba(0, 0, 0, .65) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 7l8 5-8 5z' fill='%23fff'/%3E%3C/svg%3E") center / 55% no-repeat; transition: background-color .15s; }
.yt:hover::after, .yt:focus-visible::after { background-color: #6ec28f; }

/* Keyboard users can see where they are */
a:focus-visible, button:focus-visible { outline: 2px solid #6ec28f; outline-offset: 3px; border-radius: 2px; }

/* Tidy text rendering and stop iOS from enlarging text */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { text-rendering: optimizeLegibility; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
