/* Gallery for myoung-cheulchung.com — replaces the Juicebox embed.
   No dependencies. Palette and type taken from the site's foundation02.css:
   #eee tiled ground, Times serif body, 11px letter-spaced Helvetica nav, #666 links. */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	font-family: "Times New Roman", Times, serif;
	color: #2b2b2b;
	background-color: #eee;
	background-image: url("../../images/background_tile_master.jpg");
	background-repeat: repeat;
	-webkit-font-smoothing: antialiased;
	text-align: center;
}

a { color: #666; text-decoration: none; }
a:hover { color: #000; }

/* ---------- masthead ---------- */

.g-head {
	max-width: 1500px;
	margin: 0 auto;
	padding: 66px 24px 0 24px;
}

.g-back {
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 11px;
	letter-spacing: 2px;
	text-transform: uppercase;
	display: inline-block;
	margin-bottom: 34px;
}

.g-title {
	font-family: "Times New Roman", Times, serif;
	font-weight: normal;
	font-style: italic;
	font-size: 30px;
	line-height: 1.25;
	letter-spacing: 0.01em;
	margin: 0 0 10px 0;
	color: #2b2b2b;
}

.g-meta {
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 11px;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: #8a8a8a;
	margin: 0 0 58px 0;
}

.g-rule {
	border: 0;
	border-top: 1px solid #ccc;
	max-width: 1500px;
	margin: 0 auto 88px auto;
}

/* ---------- grid ----------
   Measured against David Zwirner, Fraenkel and Pace -- see
   Projects/GALLERY-DENSITY-RESEARCH-2026-08-24.md.

   Two plates per row. A SMALL horizontal gutter against a VERY LARGE vertical one
   (Zwirner runs 20px : 138px, a 1:7 ratio) -- the luxury is vertical, not padding
   round each picture. Each plate sits inside a fixed 4:3 cell at object-fit:contain,
   so a portrait picture is letterboxed by the page's own paper ground exactly the
   way a mat surrounds a print in a frame. Nothing is ever cropped.

   Grid, not CSS columns: multi-column fills column one top-to-bottom before it
   starts column two, which sends a sequenced gallery into the wrong reading order. */

.g-grid {
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 30px 40px 30px;
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	column-gap: 30px;
	row-gap: 118px;
}

.g-cell {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	display: block;
	width: 100%;
	text-align: center;
	font: inherit;
	color: inherit;
	-webkit-tap-highlight-color: transparent;
}

.g-frame {
	position: relative;
	aspect-ratio: 4 / 3;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
}

.g-frame img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	display: block;
	opacity: 0;
	transition: opacity .5s ease;
}

.g-frame img.is-loaded { opacity: 1; }

.g-cell:focus-visible .g-frame { outline: 2px solid #005ca2; outline-offset: 6px; }

.g-cap {
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 10px;
	letter-spacing: 1.8px;
	text-transform: uppercase;
	color: #8d8d8d;
	margin-top: 20px;
	line-height: 1.5;
	transition: color .3s ease;
}

.g-cell:hover .g-cap { color: #2b2b2b; }

/* ---------- opening plate ----------
   Fraenkel opens Sugimoto on one plate filling the viewport before the grid
   starts. It sets the scale of the work before the eye starts comparing. */

.g-hero {
	max-width: 1180px;
	margin: 0 auto 132px auto;
	padding: 0 30px;
}

.g-hero .g-cell { margin-bottom: 0; }

.g-hero .g-frame img { width: 100%; height: auto; }

@media (max-width: 900px) { .g-hero { margin-bottom: 76px; } }
@media (min-width: 1600px) { .g-hero { max-width: 1440px; } }

/* ---------- lightbox ---------- */

.lb {
	position: fixed;
	inset: 0;
	background-color: #eee;
	background-image: url("../../images/background_tile_master.jpg");
	background-repeat: repeat;
	z-index: 999;
	display: none;
	opacity: 0;
	transition: opacity .22s ease;
}

.lb.is-open { display: block; }
.lb.is-visible { opacity: 1; }

.lb-stage {
	position: absolute;
	inset: 62px 78px 92px 78px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.lb-stage img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	opacity: 0;
	transition: opacity .28s ease;
}

.lb-stage img.is-loaded { opacity: 1; }

.lb-cap {
	position: absolute;
	left: 0; right: 0; bottom: 34px;
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 11px;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: #555;
	padding: 0 24px;
	line-height: 1.6;
}

.lb-count {
	position: absolute;
	top: 26px; left: 0; right: 0;
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 11px;
	letter-spacing: 2px;
	color: #8a8a8a;
}

.lb-btn {
	position: absolute;
	background: none;
	border: 0;
	cursor: pointer;
	color: #666;
	padding: 14px;
	line-height: 0;
	-webkit-tap-highlight-color: transparent;
}

.lb-btn:hover { color: #000; }
.lb-btn:focus-visible { outline: 2px solid #005ca2; outline-offset: 2px; }
.lb-btn svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.4; }

.lb-close { top: 16px; right: 18px; }
.lb-prev  { left: 12px;  top: 50%; transform: translateY(-50%); }
.lb-next  { right: 12px; top: 50%; transform: translateY(-50%); }

.lb-spinner {
	position: absolute;
	top: 50%; left: 50%;
	width: 26px; height: 26px;
	margin: -13px 0 0 -13px;
	border: 1px solid #cfcfcf;
	border-top-color: #777;
	border-radius: 50%;
	animation: lb-spin .8s linear infinite;
	display: none;
}

.lb.is-loading .lb-spinner { display: block; }

@keyframes lb-spin { to { transform: rotate(360deg); } }

body.lb-locked { overflow: hidden; }

/* ---------- nav / footer ---------- */

.g-nav {
	border-top: 1px solid #ccc;
	max-width: 1500px;
	margin: 0 auto;
	padding: 26px 24px 60px 24px;
}

.g-nav a {
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: 11px;
	letter-spacing: 2px;
	text-transform: uppercase;
	margin: 0 15px;
	line-height: 2.2;
	display: inline-block;
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
	.g-title { font-size: 25px; }
	.g-grid { column-gap: 20px; row-gap: 70px; }
	.lb-stage { inset: 54px 12px 86px 12px; }
	.lb-prev { left: 2px; } .lb-next { right: 2px; }
	.lb-btn svg { width: 22px; height: 22px; }
}

@media (max-width: 520px) {
	.g-head { padding-top: 30px; }
	.g-title { font-size: 21px; }
	.g-grid { grid-template-columns: 1fr; row-gap: 62px; padding-bottom: 20px; }
	.g-frame { aspect-ratio: auto; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: .001ms !important;
		transition-duration: .001ms !important;
	}
}

@media (min-width: 1600px) {
	.g-grid { max-width: 1440px; column-gap: 40px; row-gap: 140px; }
}
