/* Galería 25 — locked layout system.
   One 12-column grid, one gutter, one section rhythm, one type scale.
   Every page and every exhibit uses only these rules; nothing is placed by hand. */

:root {
  /* color */
  --bg: #ffffff;
  --fg: #161616;
  --muted: #6b6b6b;
  --rule: #dcdcdc;
  --tint: #f3f3f2;
  --accent: #b8432a;          /* from the Mea Culpa invitation, used only for small signals */

  /* type */
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;

  --t-label: 0.75rem;          /* 12px uppercase labels */
  --t-small: 0.875rem;         /* 14px meta */
  --t-body: 1.0625rem;         /* 17px running text */
  --t-lede: 1.25rem;           /* 20px intro */
  --t-card: 1.75rem;           /* 28px card titles */
  --t-h2: clamp(2rem, 3.4vw, 2.75rem);
  --t-hero: clamp(3rem, 7vw, 5.75rem);

  /* space */
  --gutter: clamp(16px, 2vw, 28px);
  --section: clamp(56px, 8vw, 120px);
  --stack-s: 8px;
  --stack-m: 16px;
  --stack-l: 32px;
  --maxw: 1320px;
}
/* dark: warm cement greys, reversed (white) logo */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1d1c1a; --fg: #eceae5; --muted: #aaa69d; --rule: #393631; --tint: #282623; --accent: #e3714f;
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}
:root[data-theme="dark"] {
  --bg: #1d1c1a; --fg: #eceae5; --muted: #aaa69d; --rule: #393631; --tint: #282623; --accent: #e3714f;
  color-scheme: dark;
}
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
.logo-dark { display: none; }

/* ---------- the circle: the gallery's own motif (oculus, round doors, logo) ---------- */
.dot { display: inline-block; width: 0.6em; height: 0.6em; border-radius: 50%; background: var(--accent); margin-right: 0.6em; vertical-align: 0.05em; }
.round { border-radius: 50%; }

/* ---------- base ---------- */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: 1.6;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 400; text-wrap: balance; }

.wrap { max-width: var(--maxw); margin-inline: auto; }

/* language: html gets .lang-en or .lang-es */
.lang-en [lang="es"]:not(.both), .lang-es [lang="en"]:not(.both) { display: none !important; }

/* ---------- type roles ---------- */
.label {
  font-family: var(--sans); font-size: var(--t-label); font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase; line-height: 1.4;
}
.artist {
  font-family: var(--sans); font-size: var(--t-small); font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.title-hero { font-family: var(--serif); font-size: var(--t-hero); font-weight: 300; line-height: 0.98; letter-spacing: -0.015em; }
.title-h2 { font-family: var(--serif); font-size: var(--t-h2); font-weight: 300; line-height: 1.1; }
.title-card { font-family: var(--serif); font-size: var(--t-card); font-weight: 300; line-height: 1.15; }
.meta { font-size: var(--t-small); color: var(--muted); font-variant-numeric: tabular-nums; }
.lede { font-size: var(--t-lede); line-height: 1.5; }
.prose { max-width: 38rem; display: flex; flex-direction: column; gap: 1.1em; }
.more {
  font-size: var(--t-label); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  display: inline-flex; gap: 0.5em; align-items: center; padding-block: 10px;
  border-bottom: 1px solid var(--fg);
}
.more:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- header ---------- */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 16px 32px;
  flex-wrap: wrap; padding-block: 18px;
}
.logo img { width: 56px; height: 56px; }
.nav { display: flex; align-items: center; gap: 4px 26px; flex-wrap: wrap; }
.nav a, .langs button {
  font-size: var(--t-label); font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase;
  padding-block: 12px;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent); }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.langs { display: flex; gap: 2px; margin-left: 8px; }
.langs button {
  background: none; border: 0; color: var(--muted); cursor: pointer; padding-inline: 6px;
  font-family: var(--sans);
}
.langs button[aria-pressed="true"] { color: var(--fg); }

/* ---------- grid + sections ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: var(--stack-l); }
.section { padding-block: var(--section); }
.section + .section { border-top: 1px solid var(--rule); }
.section-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  margin-bottom: var(--stack-l); flex-wrap: wrap;
}

/* split: image + text, the only image/text pairing on the site */
.split > .split-media { grid-column: 1 / span 6; }
.split > .split-text  { grid-column: 8 / span 5; align-self: center; display: flex; flex-direction: column; gap: var(--stack-l); min-width: 0; }
.split.flip > .split-media { grid-column: 7 / span 6; grid-row: 1; }
.split.flip > .split-text  { grid-column: 1 / span 5; grid-row: 1; }
.split.small > .split-media { grid-column: 1 / span 4; }
.split.small > .split-text  { grid-column: 6 / span 6; }

.stack-s { display: flex; flex-direction: column; gap: var(--stack-s); }
.stack-m { display: flex; flex-direction: column; gap: var(--stack-m); }

/* image frames: fixed ratios only */
.frame { overflow: hidden; background: var(--tint); }
.frame img { width: 100%; height: 100%; object-fit: cover; }
.r-4-5 { aspect-ratio: 4 / 5; }
.r-3-2 { aspect-ratio: 3 / 2; }
.r-1-1 { aspect-ratio: 1 / 1; }
.r-16-9 { aspect-ratio: 16 / 9; }
.frame, .frame img { max-width: 100%; }

/* facts list */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 24px; margin: 0; }
.facts dt { font-size: var(--t-label); font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.facts dd { margin: 0; font-size: var(--t-body); font-variant-numeric: tabular-nums; }

/* cards: past exhibits */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--stack-l) var(--gutter); }
.card { display: flex; flex-direction: column; gap: var(--stack-m); }
.card .card-text { display: flex; flex-direction: column; gap: var(--stack-s); }
.card:hover .title-card { color: var(--accent); }

/* events */
.events { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.event {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter);
  padding-block: 24px; border-bottom: 1px solid var(--rule); align-items: baseline;
}
.event-date {
  grid-column: 1 / span 2; align-self: center; justify-self: start;
  width: 92px; height: 92px; border: 1px solid var(--fg); border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-variant-numeric: tabular-nums; margin: 0;
}
.event-date .day { font-family: var(--serif); font-size: 2.25rem; font-weight: 300; line-height: 1; }
.event-date .label { font-size: 0.6875rem; }
.event-thumb { grid-column: 3 / span 2; align-self: center; }
.event-main { grid-column: 5 / span 5; display: flex; flex-direction: column; gap: 4px; min-width: 0; align-self: center; }
.event-where { grid-column: 10 / span 3; align-self: center; }
.event .type { color: var(--accent); }
.event .event-title { font-family: var(--serif); font-size: 1.5rem; font-weight: 300; line-height: 1.2; }
.tbc { color: var(--muted); font-style: italic; }

/* exhibit page title block */
.exhibit-head .wrap { padding-block: var(--section) var(--stack-l); }
.exhibit-head .grid { align-items: end; }
.exhibit-head .names { grid-column: 1 / span 7; display: flex; flex-direction: column; gap: var(--stack-m); }
.exhibit-head .facts { grid-column: 9 / span 4; }

.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--stack-l) var(--gutter); }
.two-col > * { min-width: 0; display: flex; flex-direction: column; gap: var(--stack-m); }

.subjects { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--stack-l) var(--gutter); }
.subject { border-top: 1px solid var(--fg); padding-top: var(--stack-m); display: flex; flex-direction: column; gap: var(--stack-s); }

details.essay summary {
  list-style: none; cursor: pointer; margin-top: var(--stack-l);
  font-size: var(--t-label); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  display: inline-flex; padding-block: 10px; border-bottom: 1px solid var(--fg);
}
details.essay summary::-webkit-details-marker { display: none; }
details.essay[open] summary { display: none; }
details.essay .prose { margin-top: 1.1em; }
.essay-col { grid-column: 3 / span 8; }
.signature { margin-top: var(--stack-l); }

/* newsletter + footer */
.signup { display: flex; gap: 8px; flex-wrap: wrap; max-width: 30rem; }
.signup input {
  flex: 1 1 220px; min-width: 0; font: inherit; font-size: var(--t-small);
  background: transparent; color: var(--fg); border: 0; border-bottom: 1px solid var(--fg);
  padding: 10px 0;
}
.signup button {
  font-family: var(--sans); font-size: var(--t-label); font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  background: var(--fg); color: var(--bg); border: 0; padding: 12px 20px; cursor: pointer;
}
.signup-note { font-size: var(--t-small); color: var(--muted); min-height: 1.5em; }

.site-footer { border-top: 1px solid var(--rule); }
.site-footer .wrap { padding-block: 56px 40px; }
.site-footer .grid > div { grid-column: span 3; display: flex; flex-direction: column; gap: var(--stack-s); font-size: var(--t-small); }
.site-footer .fine { grid-column: 1 / -1 !important; color: var(--muted); padding-top: var(--stack-l); border-top: 1px solid var(--rule); flex-direction: row !important; justify-content: space-between; flex-wrap: wrap; }

.proto-note {
  background: var(--tint); font-size: var(--t-small); color: var(--muted); text-align: center;
  padding-block: 10px; margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px)));
}

/* ---------- tablet ---------- */
@media (max-width: 980px) {
  .split > .split-media, .split.flip > .split-media, .split.small > .split-media { grid-column: 1 / span 6; }
  .split > .split-text, .split.flip > .split-text, .split.small > .split-text { grid-column: 7 / span 6; }
  .subjects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .essay-col { grid-column: 1 / span 10; }
  .site-footer .grid > div { grid-column: span 6; }
}

/* ---------- phone: everything stacks in source order ---------- */
@media (max-width: 720px) {
  .grid > * , .split > .split-media, .split > .split-text,
  .split.flip > .split-media, .split.flip > .split-text,
  .split.small > .split-media, .split.small > .split-text,
  .exhibit-head .names, .exhibit-head .facts, .essay-col { grid-column: 1 / -1 !important; grid-row: auto !important; }
  .cards, .two-col, .subjects { grid-template-columns: minmax(0, 1fr); }
  .event { row-gap: 6px; }
  .event-date { grid-column: 1 / -1; margin-bottom: 8px; }
  .event-thumb { grid-column: 1 / span 5; margin-bottom: 8px; }
  .event-main { grid-column: 1 / -1; }
  .event-where { grid-column: 1 / -1; }
  .site-header .wrap { padding-block: 14px 6px; }
  .logo img { width: 48px; height: 48px; }
  .nav { width: 100%; flex-wrap: nowrap; overflow-x: auto; gap: 22px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; }
  .site-footer .grid > div { grid-column: 1 / -1; }
}

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

/* inner pages */
.cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.subjects-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.post > * + * { margin-top: 1.25em; }
.post .title-h2 { margin-top: 2em; }
.post-fig { margin: 2.5em 0; display: flex; flex-direction: column; gap: var(--stack-s); }
@media (max-width: 720px) { .cards-2, .subjects-3 { grid-template-columns: minmax(0, 1fr); } }

/* uncropped photos: original proportions */
.lead-fig { margin-block: 0; }
.lead-fig img { width: 100%; height: auto; max-height: 88vh; object-fit: contain; object-position: left center; background: var(--tint); }
.gallery { columns: 2; column-gap: var(--gutter); }
.gallery figure { break-inside: avoid; margin: 0 0 var(--gutter); display: flex; flex-direction: column; gap: var(--stack-s); }
.gallery img { width: 100%; height: auto; }
.pair-grid { align-items: start; }
.pair-media { grid-column: 1 / span 5; margin: 0; position: sticky; top: 24px; }
.pair-media img { width: 100%; height: auto; }
.pair-text { grid-column: 7 / span 6; display: flex; flex-direction: column; gap: var(--stack-l); min-width: 0; }
.voice { display: flex; flex-direction: column; gap: var(--stack-m); }
.voice + .voice { border-top: 1px solid var(--rule); padding-top: var(--stack-l); }
.works ul { list-style: none; padding: 0; margin: var(--stack-s) 0 0; display: flex; flex-direction: column; gap: 6px; }
.pair-intro { max-width: 38rem; }
.section.pair + .section.pair { border-top: 1px solid var(--rule); }
@media (max-width: 720px) {
  .gallery { columns: 1; }
  .pair-media { position: static; }
  .lead-fig img { max-height: none; }
}

/* video works */
.video-grid { align-items: start; }
.video-text { grid-column: 1 / span 5; display: flex; flex-direction: column; gap: var(--stack-m); min-width: 0; }
.videos { grid-column: 7 / span 6; display: flex; flex-direction: column; gap: var(--stack-l); }
.video { margin: 0; display: flex; flex-direction: column; gap: var(--stack-m); }
.video-frame { position: relative; display: block; aspect-ratio: 16 / 9; background: #161616; color: #fff; }
.video-frame .play { position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border: 1px solid currentColor; border-radius: 50%; }
.video-frame .play::after { content: ""; position: absolute; left: 31px; top: 24px; border-style: solid; border-width: 14px 0 14px 22px; border-color: transparent transparent transparent currentColor; }
.video-frame .label { position: absolute; left: 16px; bottom: 12px; color: #fff; opacity: .7; }
.video-frame:hover .play { color: var(--accent); }
.video iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; display: block; }
@media (max-width: 720px) { .video-text, .videos { grid-column: 1 / -1 !important; } }

/* press */
.press-list { display: flex; flex-direction: column; }
.press-item { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); padding-block: var(--stack-l); border-top: 1px solid var(--rule); align-items: center; }
.press-item:first-child { border-top: 0; padding-top: 0; }
.press-media { grid-column: 1 / span 4; }
.press-text { grid-column: 6 / span 7; display: flex; flex-direction: column; gap: var(--stack-s); min-width: 0; }
.ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: var(--t-label); letter-spacing: .12em; text-transform: uppercase; border: 1px dashed var(--rule); box-sizing: border-box; }
.more.is-disabled { color: var(--muted); border-color: var(--rule); cursor: default; }
@media (max-width: 720px) { .press-media, .press-text { grid-column: 1 / -1; } .press-text { margin-top: var(--stack-m); } }

/* WAY 2027 band */
.way { --way: #f6f2a9; background: var(--way); color: #161616; margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); padding-inline: max(16px, env(safe-area-inset-left, 0px)); padding-block: clamp(40px, 6vw, 80px); }
.way .wrap { align-items: start; }
.way-text { grid-column: 1 / span 6; display: flex; flex-direction: column; gap: var(--stack-m); min-width: 0; }
.way-list { grid-column: 8 / span 5; display: flex; flex-direction: column; gap: var(--stack-m); }
.way-list ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: var(--gutter); font-family: var(--serif); font-size: 1.25rem; line-height: 1.6; }
.way-list li.is-us { font-weight: 400; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.way .more { border-color: #161616; }
.way .dot { background: #161616; }
.way + .section { border-top: 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .way { --way: #f6f2a9; } }
:root[data-theme="dark"] .way { --way: #f6f2a9; }
@media (max-width: 720px) { .way-list ul { columns: 2; font-size: 1.0625rem; } }
.way-list { margin: 0; }
.way-list img { width: 100%; max-width: 30rem; height: auto; }
.pair-media { display: flex; flex-direction: column; gap: var(--gutter); }
.pair-media figure { margin: 0; display: flex; flex-direction: column; gap: var(--stack-s); }
.pair-media.multi { position: static; }
.video-frame { overflow: hidden; }
.video-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video-frame .play { background: rgba(22,22,22,.45); color: #fff; z-index: 1; }
.video-frame .label { z-index: 1; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.press-media { margin: 0; }
.press-media img { width: 100%; height: auto; }
.press-item { align-items: start; }
.press-quote { margin: var(--stack-s) 0 0; padding-left: var(--stack-m); border-left: 2px solid var(--accent); display: flex; flex-direction: column; gap: 4px; }
.press-quote p:first-child { font-family: var(--serif); font-size: 1.375rem; line-height: 1.35; font-weight: 300; }

/* contact form */
.contact-form { display: flex; flex-direction: column; gap: var(--stack-m); max-width: 30rem; border-top: 1px solid var(--rule); padding-top: var(--stack-l); }
.contact-form label { display: flex; flex-direction: column; gap: 4px; }
.contact-form input, .contact-form textarea { font: inherit; font-size: var(--t-small); background: transparent; color: var(--fg); border: 0; border-bottom: 1px solid var(--fg); padding: 8px 0; border-radius: 0; }
.contact-form textarea { border: 1px solid var(--rule); padding: 8px; resize: vertical; }
.contact-form button { font-family: var(--sans); font-size: var(--t-label); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; background: var(--fg); color: var(--bg); border: 0; padding: 12px 20px; cursor: pointer; }
