/* Jin Park Media: static rebuild of the Cargo site.
   Sizes are in rem; 1rem scales with the window like Cargo (see base-size.js). */

/* Free stand-ins for Cargo's licensed fonts (both SIL Open Font License):
   Inter Tight for Monument Grotesk (menu, titles, captions), Geist for Favorit (body text).
   The overrides copy the original fonts' line metrics so text sits where it did on Cargo. */
@font-face {
  font-family: "JP Heading"; src: url(/assets/fonts/inter-tight.woff2) format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  size-adjust: 101.4%; ascent-override: 99.6%; descent-override: 37%; line-gap-override: 0%;
}
@font-face {
  font-family: "JP Heading"; src: url(/assets/fonts/inter-tight-italic.woff2) format("woff2");
  font-weight: 100 900; font-style: italic; font-display: swap;
  size-adjust: 101.4%; ascent-override: 99.6%; descent-override: 37%; line-gap-override: 0%;
}
@font-face {
  font-family: "JP Body"; src: url(/assets/fonts/geist.woff2) format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  ascent-override: 78%; descent-override: 22%; line-gap-override: 0%;
}

:root {
  --font-heading: "JP Heading";
  --font-body: "JP Body";
  --text: rgba(0, 0, 0, 0.85);
  --text-body: rgba(0, 0, 0, 0.75);
  --accent: #89cfef;
  --active: #ff0000;
  --pad: 2rem;
}
html { font-size: var(--base-size, 12.96px); background: #fff; }
html.mobile { font-size: calc(var(--base-size) * 1.3); --pad: 1rem; }
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: #fff; color: var(--text-body);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: none; text-size-adjust: none;
}
a { color: inherit; text-decoration: none; }
a:active, .zoomable:active { opacity: 0.7; }
a.active { color: var(--active) !important; }
b, strong { font-weight: bolder; }
img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }

/* ---- type (Cargo: nested --font-scale values don't compound) ---- */
.body-copy {
  --font-size: 1.6rem; --font-scale: 1;
  font-family: var(--font-body), sans-serif; font-weight: 400;
  line-height: 1.2; color: var(--text-body); word-wrap: break-word;
}
.body-copy, .body-copy * { font-size: calc(var(--font-scale, 1) * var(--font-size)); }
.body-copy a { color: var(--text-body); }
h1, h2, .caption { font-family: var(--font-heading), sans-serif; font-weight: 350; color: var(--text); }
h1 { --font-size: 2.4rem; margin: 0; line-height: 1.15; display: inline-block; }
h1, h2 { contain: layout; } /* as on Cargo: puts a title's baseline at its bottom edge */
html.mobile h1 { --font-size: 3rem; }
h2 { --font-size: 2.6rem; margin: 0; line-height: 1; }
h1 a, h2 a { color: var(--text); }
.caption { --font-size: 1.2rem; line-height: 1.2; display: block; }
.caption a { color: var(--text); text-decoration: underline; }
ol { margin: 0; padding: 0 0 0 2.5em; }
ul { margin: 0; padding: 0 0 0 2em; }
.ti {
  display: inline-block; position: relative; height: 1.2em; aspect-ratio: 1; width: auto;
  margin-top: -1em; margin-bottom: -0.25em; vertical-align: baseline;
}
.ti svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: currentColor; }

/* ---- fixed desktop chrome ---- */
/* menu, logo and top-right icons share one fixed layer that scrolls when the menu is taller
   than the window (Cargo does the same) */
.chrome {
  position: fixed; inset: 0; z-index: 10; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: none; pointer-events: none;
}
.chrome::-webkit-scrollbar { display: none; }
.chrome > * { pointer-events: auto; }
.nav { position: relative; width: 25vw; min-height: 100%; padding: var(--pad); }
.logo {
  position: absolute; z-index: 11; top: 2rem; left: calc(15vw + 2rem);
  width: calc((85vw - 4rem) * 0.08); touch-action: none; cursor: grab;
}
.logo img { width: 100%; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.topbar {
  position: absolute; right: 0; top: 0; z-index: 11; padding: 2rem; text-align: right;
  font-family: var(--font-body), sans-serif; font-size: 1.6rem; line-height: 1.2; color: var(--text-body);
}
.mhead { display: none; }

/* ---- page ---- */
.content { margin-left: 25vw; width: 75vw; padding: var(--pad); min-height: var(--viewport-height, 100vh); }
.page-body { position: relative; }
/* Cargo titles shrink to their text, but stretch when they hold images or galleries */
.page-body h1:has(> .mi, > .g, > .cols) { width: 100%; }

/* ---- columns: 12-column grid like Cargo ---- */
.cols { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter, 1rem); align-items: start; }
.col { min-width: 0; grid-column: span var(--span, 12); }

/* ---- media ---- */
.mi { position: relative; width: 100%; display: inline-block; vertical-align: bottom; }
.mi img { width: 100%; }
.mi.scaled { display: inline-block; }
.zoomable, [data-zoom] { cursor: zoom-in; }
.mi-video .yt { position: relative; width: 100%; aspect-ratio: 200 / 113; background: #000; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.thumb { cursor: pointer; }
.thumb-cover { position: absolute; inset: 0; z-index: 2; }
.thumb .caption { text-align: center; margin-top: 0.5em; margin-bottom: 2em; }
.spin { animation: spin 250s linear infinite; z-index: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- galleries ---- */
.g { position: relative; width: 100%; --gutter: 2rem; }
.g-grid {
  display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
  gap: var(--gutter); align-items: start;
}
.g-grid > .mi[data-span] { grid-column: span min(var(--span, 1), var(--cols, 3)); }
.g-justify { --gutter: 1rem; }
.g-justify, .g-columnized { min-height: 1px; }
.g-justify.laid, .g-columnized.laid { position: relative; }
.g-justify.laid > .mi, .g-columnized.laid > .mi { position: absolute; }
/* before the script runs */
.g-columnized:not(.laid) { columns: 3; column-gap: 2rem; }
.g-columnized:not(.laid) > .mi { break-inside: avoid; margin-bottom: 2rem; }
.g-justify:not(.laid) { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }

/* slideshow */
.g-slideshow { overflow: hidden; }
.ss-track { position: relative; width: 100%; aspect-ratio: var(--ss-ar, 4/3); }
.ss-track > .mi { position: absolute; inset: 0; opacity: 0; transition: opacity 1s ease; display: flex; align-items: center; justify-content: center; }
.ss-track > .mi img { width: 100%; height: 100%; object-fit: contain; }
.ss-track > .mi.on { opacity: 1; z-index: 1; }
.ss-btn {
  position: absolute; top: 50%; z-index: 3; width: 30px; height: 30px; margin-top: -15px; padding: 0;
  border: 0; border-radius: 50%; background: rgba(87, 87, 87, 0.35); cursor: pointer;
}
.ss-btn:active { opacity: 0.7; }
.ss-btn svg { width: 100%; height: 100%; fill: none; stroke: rgba(255, 255, 255, 0.9); stroke-width: 1.5px; }
.ss-prev { left: 15px; }
.ss-next { right: 15px; }

/* ---- lightbox ---- */
.lightbox { position: fixed; inset: 0; z-index: 100; background: #fff; padding: 3rem; display: flex; }
.lightbox[hidden] { display: none; }
.lb-stage { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.lb-stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.lb-close {
  position: absolute; top: 20px; right: 20px; width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: rgba(87, 87, 87, 0.35); cursor: pointer; z-index: 2;
}
.lb-close::before, .lb-close::after {
  content: ""; position: absolute; left: 30%; right: 30%; top: 50%; margin-top: -0.75px; height: 1.5px; background: rgba(255, 255, 255, 0.9);
}
.lb-close::before { transform: rotate(45deg); }
.lb-close::after { transform: rotate(-45deg); }
.lightbox .ss-btn { position: absolute; }
.lightbox .ss-prev { left: 25px; }
.lightbox .ss-next { right: 25px; }
html.lb-open { overflow: hidden; }

/* ---- phones ---- */
html.mobile .chrome { display: none; }
html.mobile body.p-nav .chrome { display: block; position: static; overflow: visible; }
html.mobile body.p-nav .logo, html.mobile body.p-nav .topbar { display: none; }
html.mobile .content { margin-left: 0; width: 100%; }
html.mobile .mhead {
  display: flex; justify-content: space-between; align-items: flex-start;
  position: absolute; left: 0; right: 0; top: 0; z-index: 10; padding: 1rem 0.75rem 1rem 1rem; pointer-events: none;
}
html.mobile .mhead > * { pointer-events: auto; }
.mtitle { visibility: hidden; font-family: var(--font-body), sans-serif; font-size: 1.6rem; line-height: 1.2; color: var(--text-body); }
.mmenu { font-family: var(--font-heading), sans-serif; font-size: 3rem; line-height: 1.15; color: var(--text); }
.mmenu .ti { margin-top: 0; margin-bottom: 0; vertical-align: top; }
body.p-homepage .mtitle { visibility: visible; }
html.mobile body.p-homepage .mhead { position: static; }
html.mobile body.p-nav .nav { width: 100%; }
html.mobile body.p-nav .content { display: none; }
html.mobile .cols:not(.no-stack) { row-gap: 0; }
html.mobile .cols:not(.no-stack) > .col { grid-column: 1 / -1; }
html.mobile .g-grid { column-gap: var(--mcolgap, 0px); row-gap: var(--mrowgap, 0px); }
html.mobile .g-grid[data-mobile-columns] { grid-template-columns: repeat(var(--mcols), minmax(0, 1fr)); }
html.mobile .g-grid > .mi[data-span] { grid-column: span min(var(--span, 1), var(--mcols, var(--cols, 3))); }
html.mobile .g-columnized:not(.laid) { column-gap: 1rem; }
html.mobile .lightbox { padding: 10px; }
html.mobile .lightbox .ss-prev { left: 25px; }
