/* Chinagirl Tile */

:root {
  --bg: #111110;
  --bg-2: #1c1c1a;
  --text: #f1efe9;
  --muted: #a3a09a;
  --accent: #c8f031;
  --line: #2e2d2a;
  --gap: 10px;
  --row: 240px;
  --pad: clamp(16px, 4vw, 48px);
  --max: 1440px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

h1, h2, h3 { line-height: 1.1; letter-spacing: -0.02em; }

/* Header ----------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 14px var(--pad);
  background: rgb(17 17 16 / 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.logo {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  text-transform: lowercase;
}
.logo span { color: var(--accent); margin-left: 0.2em; }

.menu { display: flex; gap: 24px; }
.menu a {
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.menu a:hover, .menu a[aria-current] { color: var(--text); }
.menu a[aria-current] { box-shadow: 0 2px 0 var(--accent); }

main { min-height: 70vh; }

.section, .tile {
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 56px) var(--pad);
}

.page-title {
  font-size: clamp(2rem, 6vw, 4rem);
  margin: 0 0 0.6em;
}

/* Hero ------------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero img {
  width: 100%;
  height: clamp(280px, 55vh, 620px);
  object-fit: cover;
}
.hero-text {
  position: absolute;
  inset: auto 0 0 0;
  padding: 80px var(--pad) var(--pad);
  background: linear-gradient(transparent, rgb(0 0 0 / 0.85));
}
.hero h1 {
  margin: 0;
  font-size: clamp(2.6rem, 10vw, 7.5rem);
  font-weight: 900;
  text-transform: lowercase;
}
.hero p { margin: 0.4em 0 0; max-width: 40em; color: var(--text); font-size: 1.1rem; }

/* Justified image rows (no JS):
   each item grows proportionally to its aspect ratio --ar */

.justified {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
.justified::after {
  /* keeps the last row from stretching */
  content: "";
  flex-grow: 1000000;
}
.justified li {
  position: relative;
  flex: var(--ar) 1 calc(var(--ar) * var(--row));
  background: var(--bg-2);
}
.justified a { display: block; height: 100%; }
.justified img {
  width: 100%;
  height: 100%;
  aspect-ratio: var(--ar);
  object-fit: cover;
}

.tile-grid li { overflow: hidden; }
.tile-grid img { transition: transform 0.5s ease, filter 0.5s ease; }
.tile-grid a:hover img { transform: scale(1.04); filter: brightness(0.6); }
.tile-title {
  position: absolute;
  inset: auto 0 0 0;
  padding: 24px 14px 12px;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  background: linear-gradient(transparent, rgb(0 0 0 / 0.75));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s, transform 0.3s;
}
.tile-grid a:hover .tile-title,
.tile-grid a:focus-visible .tile-title { opacity: 1; transform: none; }

@media (hover: none) {
  .tile-title { opacity: 1; transform: none; }
}

@media (max-width: 600px) {
  :root { --row: 160px; --gap: 6px; }
}

/* Tile detail ------------------------------------------------------------ */

.tile-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: start;
  margin-bottom: clamp(32px, 6vw, 72px);
}
.tile-cover { margin: 0; position: sticky; top: 90px; }
.tile-cover img { width: 100%; }
.tile-text h1 {
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  margin: 0 0 0.3em;
}
.tile-place {
  margin: 0 0 1.5em;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}
.tile-more {
  margin-top: 1em;
}

@media (max-width: 800px) {
  .tile-head { grid-template-columns: 1fr; }
  .tile-cover { position: static; max-width: 420px; }
}

.gallery { --row: 200px; }
.gallery a { cursor: zoom-in; }

.pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-weight: 600;
}
.pager a { text-decoration: none; }
.pager .all { color: var(--muted); }

/* Prose ------------------------------------------------------------------ */

.prose { max-width: 42em; }
.prose p { margin: 0 0 1em; }
.prose a { color: var(--accent); text-underline-offset: 3px; }
.prose a:hover { color: var(--text); }
.prose h2 { font-size: 1.4rem; margin: 2em 0 0.7em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 0.45em; }
.prose li::marker { color: var(--accent); }

/* About ------------------------------------------------------------------ */

.about {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
}
.about-side figure { margin: 0 0 40px; }
.about-side h2 {
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.sponsors { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.sponsors a {
  display: block;
  padding: 16px;
  background: #fff;
  border-radius: 4px;
}
.sponsors img { margin: 0 auto; max-height: 90px; width: auto; }

@media (max-width: 800px) {
  .about { grid-template-columns: 1fr; }
}

/* Map -------------------------------------------------------------------- */

.map {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  aspect-ratio: 16 / 9;
  margin-top: 24px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  text-align: center;
  padding: var(--pad);
}
.map.is-loaded { display: block; padding: 0; }
.map iframe { width: 100%; height: 100%; border: 0; display: block; }
.small { font-size: 0.8rem; color: var(--muted); max-width: 30em; }

.button {
  font: inherit;
  font-weight: 700;
  padding: 12px 24px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #111;
  cursor: pointer;
}

@media (max-width: 600px) {
  .map { aspect-ratio: 3 / 4; }
}

/* Footer ----------------------------------------------------------------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  padding: 32px var(--pad);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}
.site-footer p { margin: 0; }

/* Lightbox --------------------------------------------------------------- */

.lightbox {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgb(8 8 8 / 0.96);
  color: var(--text);
}
.lightbox::backdrop { background: rgb(0 0 0 / 0.8); }
.lightbox figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100%;
  margin: 0;
  padding: 56px 64px 16px;
}
.lightbox img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.lightbox figcaption {
  min-height: 2.5em;
  padding-top: 12px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.lightbox button {
  position: absolute;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 2rem;
  line-height: 1;
  padding: 12px 16px;
  cursor: pointer;
}
.lightbox button:hover { color: var(--accent); }
.lightbox .lb-close { top: 4px; right: 4px; }
.lightbox .lb-prev { left: 4px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 4px; top: 50%; transform: translateY(-50%); }

@media (max-width: 600px) {
  .lightbox figure { padding: 56px 8px 16px; }
  .lightbox .lb-prev, .lightbox .lb-next { top: auto; bottom: 0; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
