/* ==========================================================================
   Keagan Klempel Art — HTML mockup
   Structure mirrors the planned WordPress theme:
   header / footer partials, artwork cards (CPT "artwork"), lightbox.
   ========================================================================== */

:root {
  --bg: #f4f1ec;
  --bg-alt: #ebe6de;
  --ink: #161514;
  --ink-soft: #5d5952;
  --line: rgba(22, 21, 20, 0.14);
  --accent: #9a4a2f;
  --overlay: rgba(16, 15, 14, 0.96);
  --overlay-ink: #f4f1ec;

  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(1rem, 4vw, 3.5rem);
  --header-h: 84px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

/* Element resets are scoped to the theme's .site wrapper so they never reach WordPress UI loaded on the page (e.g. the Media Library). */
:where(.site) img { display: block; max-width: 100%; height: auto; }

:where(.site) a { color: inherit; text-decoration: none; }

:where(.site) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.05;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1.2em; }

:where(.site) [hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75em;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding-bottom: 6px;
  border-bottom: 1px solid currentColor;
  transition: gap 0.4s var(--ease);
}
.link-arrow:hover { gap: 1.25em; }
.link-arrow::after { content: "→"; font-size: 14px; letter-spacing: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75em;
  min-height: 52px;
  padding: 0 2rem;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
  transition: background 0.3s, color 0.3s;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn--light { background: var(--overlay-ink); color: var(--ink); border-color: var(--overlay-ink); }
.btn--light:hover { background: transparent; color: var(--overlay-ink); }

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

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
  transition: background 0.4s, height 0.4s var(--ease);
}
/* The frosted background is a separate layer: a backdrop-filter on the header itself would
   trap the full-screen mobile menu (position: fixed) inside the header bar. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(244, 241, 236, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity 0.4s;
}
.site-header.is-scrolled { height: 64px; }
.site-header.is-scrolled::before { opacity: 1; }
.nav-open .site-header::before { opacity: 0; }

.site-logo {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1;
}
.site-logo__suffix { font-style: italic; color: var(--ink-soft); }

.site-nav { display: flex; align-items: center; gap: clamp(1.5rem, 3vw, 3rem); }

/* Instagram icon at the end of the menu, drawn on the link; its text is moved out of view but stays for screen readers. */
.site-social { display: inline-flex; flex: none; }
.site-nav .site-social a {
  position: relative;
  display: inline-block;
  width: 17px; height: 17px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  text-indent: 200%;
  transition: opacity 0.3s;
}
.site-nav .site-social a::before {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.4'%3E%3Crect x='3' y='3' width='18' height='18' rx='5'/%3E%3Ccircle cx='12' cy='12' r='4.2'/%3E%3Ccircle cx='17.4' cy='6.6' r='0.9' fill='%23000' stroke='none'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.4'%3E%3Crect x='3' y='3' width='18' height='18' rx='5'/%3E%3Ccircle cx='12' cy='12' r='4.2'/%3E%3Ccircle cx='17.4' cy='6.6' r='0.9' fill='%23000' stroke='none'/%3E%3C/svg%3E") center / contain no-repeat;
}
.site-nav .site-social a:hover { opacity: 0.6; }
.site-nav .site-social a::after { content: none; } /* no menu underline */

.site-nav ul {
  display: flex;
  gap: clamp(1.5rem, 3vw, 3rem);
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  position: relative;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 6px 0;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--ease);
}
.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  position: relative;
  z-index: 2;
}
.nav-toggle span {
  position: absolute;
  left: 10px; right: 10px;
  height: 1px;
  background: var(--ink);
  transition: transform 0.4s var(--ease), top 0.4s var(--ease);
}
.nav-toggle span:first-child { top: 18px; }
.nav-toggle span:last-child { top: 26px; }
.nav-open .nav-toggle span:first-child { top: 22px; transform: rotate(45deg); }
.nav-open .nav-toggle span:last-child { top: 22px; transform: rotate(-45deg); }

/* Full-screen menu below 900px, where the horizontal menu runs out of room. */
@media (max-width: 900px) {
  :root { --header-h: 68px; }
  .nav-toggle { display: block; }
  .site-nav {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s;
  }
  .nav-open .site-nav { opacity: 1; visibility: visible; }
  .site-nav { flex-direction: column; gap: 2.5rem; }
  .site-nav ul { flex-direction: column; align-items: center; gap: 1.5rem; }
  .site-nav .site-social a { width: 26px; height: 26px; }
  .site-nav a {
    font-family: var(--font-display);
    font-size: clamp(28px, 7.5vw, 40px);
    font-weight: 300;
    letter-spacing: 0;
    text-transform: none;
  }
}

/* --------------------------------------------------------------------------
   Hero (home)
   -------------------------------------------------------------------------- */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: var(--gutter);
  padding: calc(var(--header-h) + 2rem) var(--gutter) 4rem;
}
.hero__title {
  font-size: clamp(56px, 10vw, 168px);
  line-height: 0.9;
  margin: 1.5rem 0 2rem;
}
.hero__title em { display: block; font-style: italic; padding-left: 0.6em; color: var(--ink-soft); }
.hero__lede {
  max-width: 34ch;
  font-size: 17px;
  color: var(--ink-soft);
  margin-bottom: 2.5rem;
}
.hero__media {
  justify-self: end;
  width: min(100%, 520px);
  margin: 0;
  container-type: inline-size;
}
/* Each photo fits inside a 4:5 area at its own proportions; the caption takes the photo's width.
   Several opening works are stacked in one cell and fade (assets/js/main.js). */
.hero__media { display: grid; align-items: end; }
.hero__slide {
  grid-area: 1 / 1;
  width: fit-content;
  margin: 0 0 0 auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.2s var(--ease), visibility 1.2s;
}
.hero__slide.is-active { opacity: 1; visibility: visible; }
.hero__link { display: block; cursor: pointer; }
.hero__media img {
  width: auto;
  height: auto;
  max-width: 100cqw;
  max-height: 125cqw;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.35);
}
.hero__caption {
  margin-top: 1rem;
  font-size: 13px;
  color: var(--ink-soft);
}
.hero__caption-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.hero__caption em { font-family: var(--font-display); font-size: 18px; color: var(--ink); }

.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.scroll-cue::before {
  content: "";
  width: 56px; height: 1px;
  background: currentColor;
  animation: cue 2.4s var(--ease) infinite;
  transform-origin: left;
}
@keyframes cue {
  0% { transform: scaleX(0); }
  50% { transform: scaleX(1); transform-origin: left; }
  51% { transform-origin: right; }
  100% { transform: scaleX(0); transform-origin: right; }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: calc(var(--header-h) + 3rem); }
  .hero__media { justify-self: start; width: min(100%, 420px); }
  .hero__slide { margin-left: 0; }
}

/* --------------------------------------------------------------------------
   Page intro (inner pages)
   -------------------------------------------------------------------------- */

.page-intro {
  padding: calc(var(--header-h) + clamp(3rem, 8vw, 7rem)) var(--gutter) clamp(2rem, 5vw, 4rem);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}
.page-intro__title {
  font-size: clamp(52px, 8vw, 128px);
  line-height: 0.9;
  margin-top: 1rem;
}
.page-intro__title em { font-style: italic; color: var(--ink-soft); }
.page-intro__text { max-width: 42ch; color: var(--ink-soft); margin: 0; }

/* --------------------------------------------------------------------------
   Horizontal scroll gallery
   On wide screens the section is pinned and vertical scroll drives the
   track sideways. On small / touch screens it falls back to a native
   swipeable row with scroll-snap.
   -------------------------------------------------------------------------- */

.hscroll { position: relative; }

.hscroll__sticky {
  position: relative;
  overflow: hidden;
}

.hscroll__track {
  display: flex;
  align-items: center;
  gap: clamp(2.5rem, 6vw, 7rem);
  padding: 0 var(--gutter);
  will-change: transform;
}

.hscroll.is-pinned .hscroll__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
}
.hscroll.is-pinned .hscroll__track { height: 100%; padding-top: var(--header-h); padding-bottom: 4rem; }

.hscroll:not(.is-pinned) .hscroll__sticky {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-padding: 0 var(--gutter);
  padding: 2rem 0 1.5rem;
}
.hscroll:not(.is-pinned) .hscroll__sticky::-webkit-scrollbar { display: none; }
.hscroll:not(.is-pinned) .hscroll__track { width: max-content; }
.hscroll:not(.is-pinned) .hscroll__track > * { scroll-snap-align: center; }
.hscroll:not(.is-pinned) .hscroll__track { align-items: flex-end; gap: 1.5rem; }
.hscroll:not(.is-pinned) .hscroll__panel { width: min(64vw, 340px); scroll-snap-align: start; }
.hscroll:not(.is-pinned) .hscroll__panel h2 { font-size: clamp(38px, 10vw, 64px); }

.hscroll__panel {
  flex: 0 0 auto;
  width: min(80vw, 420px);
}
.hscroll__panel h2 {
  font-size: clamp(44px, 5.5vw, 88px);
  line-height: 0.95;
  margin: 1.25rem 0 1.5rem;
}
.hscroll__panel h2 em { font-style: italic; color: var(--ink-soft); }
.hscroll__panel p { color: var(--ink-soft); max-width: 32ch; }
.hscroll__panel--end { text-align: left; }

.hscroll__hud {
  position: absolute;
  left: var(--gutter);
  right: var(--gutter);
  bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  pointer-events: none;
}
.hscroll__nav { display: flex; gap: 0.6rem; pointer-events: auto; }
/* Swipe row: the counter and arrows sit under the cards and stay in view while the row scrolls. */
.hscroll:not(.is-pinned) .hscroll__hud { position: sticky; left: 0; right: auto; bottom: auto; margin-top: 1.25rem; padding: 0 var(--gutter); }
.hscroll__bar {
  position: relative;
  flex: 1;
  height: 1px;
  background: var(--line);
}
.hscroll__bar span {
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
}

/* --------------------------------------------------------------------------
   Artwork card  (WP: template-parts/artwork-card.php)
   -------------------------------------------------------------------------- */

.artwork {
  --h: 56vh; /* One height for every work, so galleries stay consistent. */
  flex: 0 0 auto;
  margin: 0;
}
.artwork__trigger {
  display: block;
  text-align: left;
  cursor: none;
}
@media (pointer: coarse) { .artwork__trigger { cursor: pointer; } }

.artwork__frame {
  position: relative;
  overflow: hidden;
  background: var(--bg-alt);
}
.artwork__frame img {
  height: var(--h, 58vh);
  width: auto;
  max-width: none;
  transition: transform 1.2s var(--ease), filter 0.6s;
}
.artwork__trigger:hover .artwork__frame img,
.artwork__trigger:focus-visible .artwork__frame img { transform: scale(1.035); }


/* Swipe row: photos scale to fit the screen, never cropped. */
.hscroll:not(.is-pinned) .artwork__frame img { width: auto; height: auto; max-height: min(var(--h), 62vh); max-width: 82vw; }

.artwork__caption {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 1rem;
  margin-top: 1rem;
  max-width: 100%;
}
.artwork__num {
  grid-row: span 2;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  padding-top: 6px;
}
.artwork__title {
  font-family: var(--font-display);
  font-size: 22px;
  font-style: italic;
  font-weight: 400;
  line-height: 1.2;
}
.artwork__meta { font-size: 12px; color: var(--ink-soft); }
.artwork__meta .dot { margin: 0 0.4em; }
.status-sold::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 0.45em;
  vertical-align: 1px;
}

/* Hidden detail payload read by the lightbox (WP: the_content / ACF). */
.artwork__details { display: none; }

/* Filtered out on the Works page */
.artwork.is-hidden { display: none; }

/* --------------------------------------------------------------------------
   Custom cursor (fine pointers only)
   -------------------------------------------------------------------------- */

.cursor {
  position: fixed;
  top: 0; left: 0;
  z-index: 60;
  width: 92px; height: 92px;
  margin: -46px 0 0 -46px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  pointer-events: none;
  transform: translate3d(-200px, -200px, 0) scale(0);
  transition: opacity 0.3s;
}
.cursor.is-active { transition: none; }
@media (pointer: coarse) { .cursor { display: none; } }

/* --------------------------------------------------------------------------
   Filter bar (Works page — WP: taxonomy "series")
   -------------------------------------------------------------------------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  padding: 0 var(--gutter);
  list-style: none;
  margin: 0 0 1rem;
}
.filters button {
  position: relative;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 8px 0;
  transition: color 0.3s;
}
.filters button sup { font-size: 9px; margin-left: 3px; letter-spacing: 0; }
.filters button:hover,
.filters button[aria-pressed="true"] { color: var(--ink); }
.filters button[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 2px;
  height: 1px;
  background: var(--ink);
}

/* --------------------------------------------------------------------------
   Content sections
   -------------------------------------------------------------------------- */

.section { padding: clamp(5rem, 12vw, 11rem) var(--gutter); }
.section--alt { background: var(--bg-alt); }

.statement {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--gutter);
}
.statement__quote {
  font-family: var(--font-display);
  font-size: clamp(30px, 3.8vw, 56px);
  font-weight: 300;
  line-height: 1.2;
  margin: 0 0 2.5rem;
}
.statement__quote em { color: var(--ink-soft); }
@media (max-width: 760px) { .statement { grid-template-columns: 1fr; } }

.split {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: clamp(2rem, 8vw, 8rem);
  align-items: start;
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.portrait {
  position: sticky;
  top: calc(var(--header-h) + 2rem);
}
.portrait__img {
  aspect-ratio: 4 / 5;
  background:
    radial-gradient(120% 80% at 30% 20%, #d6cdbd 0%, transparent 60%),
    linear-gradient(160deg, #cfc6b6, #a79d8c);
}
.portrait figcaption { margin-top: 0.9rem; font-size: 12px; color: var(--ink-soft); }
@media (max-width: 860px) { .portrait { position: static; } }

.prose { max-width: 60ch; }
.prose .lead {
  font-family: var(--font-display);
  font-size: clamp(26px, 2.6vw, 36px);
  line-height: 1.3;
  margin-bottom: 1.5em;
}
.prose h2 { font-size: clamp(32px, 3vw, 44px); margin: 3.5rem 0 1.5rem; }

.cv { margin: 0 0 1rem; }
.cv ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
/* Each entry: <strong>year</strong> <em>title</em> detail. The year sits in its own column, the title on the first line. */
.cv li {
  position: relative;
  padding: 1rem 0 1rem calc(70px + 1.5rem);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-soft);
}
.cv li > strong:first-child,
.cv li > b:first-child {
  position: absolute;
  left: 0;
  top: 1rem;
  width: 70px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  padding-top: 2px;
  font-variant-numeric: tabular-nums;
}
.cv li em,
.cv li i { display: block; font-style: normal; font-size: 15px; color: var(--ink); }
.cv p { margin: 0; }

/* Optional content (About, Contact, footer links, page intros). Empty fields reach the page only
   for Pencil editors, and stay hidden until Pencil's edit mode is on, then show as a box to fill in. */
.kk-optional-content:empty,
.kk-optional:has(.kk-optional-content:empty) { display: none; }
.pencil-selection-active .kk-optional:has(.kk-optional-content:empty) { display: revert; }
.pencil-selection-active .kk-optional-content:empty {
  display: block;
  min-height: 44px;
  border: 1px dashed var(--line);
}
.pencil-selection-active .kk-optional-content:empty::before {
  content: "Empty: click to add. Hidden on the site until filled.";
  display: block;
  padding: 11px 12px;
  font-size: 14px;
  font-style: italic;
  color: var(--ink-soft);
}

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */

.contact-details { list-style: none; margin: 0; padding: 0; }
.contact-details li { padding: 0 0 2.25rem; }
.contact-details a { font-family: var(--font-display); font-size: clamp(22px, 2.2vw, 30px); }
.contact-details a:hover { color: var(--accent); }

.form { display: grid; gap: 1.75rem; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.75rem; }
@media (max-width: 600px) { .form__row { grid-template-columns: 1fr; } }
.field label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 0.6rem 0;
  transition: border-color 0.3s;
  -webkit-appearance: none;
  appearance: none;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus { outline: none; border-color: var(--ink); }
.form__note { font-size: 13px; color: var(--ink-soft); margin: 0; }
.form__success { font-family: var(--font-display); font-size: 26px; display: none; }
.form.is-sent .form__success { display: block; }

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

.site-footer {
  padding: clamp(4rem, 8vw, 7rem) var(--gutter) 2rem;
  border-top: 1px solid var(--line);
}
.site-footer__cta {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: clamp(3rem, 7vw, 6rem);
}
.site-footer__cta h2 { font-size: clamp(44px, 6vw, 96px); line-height: 0.95; }
.site-footer__cta h2 em { font-style: italic; color: var(--ink-soft); }
.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: 12px;
  color: var(--ink-soft);
}
.site-footer__bottom ul { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.site-footer__bottom a:hover { color: var(--ink); }

/* --------------------------------------------------------------------------
   Lightbox  (WP: footer partial, populated from card data attributes)
   -------------------------------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--overlay);
  color: var(--overlay-ink);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s var(--ease), visibility 0.5s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }

.lightbox__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(4.5rem, 7vw, 6rem) clamp(1rem, 5vw, 5rem);
  min-height: 0;
}
.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: scale(0.97);
  transition: opacity 0.6s var(--ease), transform 0.8s var(--ease);
}
.lightbox.is-ready .lightbox__img { opacity: 1; transform: none; }

.lightbox__panel {
  display: flex;
  flex-direction: column;
  padding: clamp(4.5rem, 7vw, 6rem) clamp(1.5rem, 3vw, 3rem) 2rem;
  border-left: 1px solid rgba(244, 241, 236, 0.12);
  overflow-y: auto;
}
.lightbox__panel > * {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.lightbox.is-ready .lightbox__panel > * { opacity: 1; transform: none; }
.lightbox.is-ready .lightbox__panel > *:nth-child(2) { transition-delay: 0.05s; }
.lightbox.is-ready .lightbox__panel > *:nth-child(3) { transition-delay: 0.1s; }
.lightbox.is-ready .lightbox__panel > *:nth-child(4) { transition-delay: 0.15s; }
.lightbox.is-ready .lightbox__panel > *:nth-child(5) { transition-delay: 0.2s; }

.lightbox .eyebrow { color: rgba(244, 241, 236, 0.55); }
.lightbox { --specs-line: rgba(244, 241, 236, 0.14); --specs-muted: rgba(244, 241, 236, 0.55); }
.lightbox__desc { color: rgba(244, 241, 236, 0.75); font-size: 14px; }
.lightbox__actions { margin-top: auto; padding-top: 2rem; display: grid; gap: 1rem; }
.lightbox__actions .btn { width: 100%; }
.lightbox__actions .link-arrow { justify-self: start; margin-bottom: 0.5rem; }

.lightbox {
  --round-line: rgba(244, 241, 236, 0.25);
  --round-line-hover: rgba(244, 241, 236, 0.6);
  --round-fill-hover: rgba(244, 241, 236, 0.1);
}
.lightbox__close,
.lightbox__nav { position: absolute; z-index: 2; }
.lightbox__close { top: 1.25rem; right: 1.25rem; }
.lightbox__nav { top: 50%; margin-top: -26px; }
.lightbox__nav--prev { left: 1.25rem; }
.lightbox__nav--next { right: 1.25rem; }

.lightbox__count {
  position: absolute;
  top: 1.25rem;
  left: 1.5rem;
  line-height: 52px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: rgba(244, 241, 236, 0.55);
}

@media (max-width: 900px) {
  .lightbox {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    overflow-y: auto;
  }
  .lightbox__stage { height: 62svh; padding: 4.5rem 1rem 1.5rem; }
  .lightbox__panel { border-left: 0; border-top: 1px solid rgba(244, 241, 236, 0.12); padding-top: 2rem; overflow: visible; }
  .lightbox .lightbox__nav { width: 44px; height: 44px; margin-top: -22px; background: rgba(16, 15, 14, 0.5); }
  .lightbox__nav--prev { left: 0.5rem; }
  .lightbox__nav--next { right: 0.5rem; }
}

/* --------------------------------------------------------------------------
   Reveal on scroll
   -------------------------------------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s var(--ease), transform 1.2s var(--ease);
}
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   Shared artwork details: lightbox panel and single work page
   -------------------------------------------------------------------------- */

.work-title {
  font-size: clamp(38px, 3.6vw, 56px);
  font-style: italic;
  margin: 0.9rem 0 2rem;
}

.specs {
  margin: 0 0 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--specs-line, var(--line));
}
/* Direct rows only: values sit inside wrappers (Pencil managed regions) that must not pick up row styles. */
.specs > div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1rem;
  padding: 0.4rem 0;
  font-size: 14px;
}
.specs dt {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--specs-muted, var(--ink-soft));
  padding-top: 2px;
}
.specs dd { margin: 0; }

.work {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
  padding: calc(var(--header-h) + clamp(2rem, 5vw, 4rem)) var(--gutter) clamp(4rem, 8vw, 7rem);
}
/* Sized to the photo itself (no letterboxing), so the magnifier lines up with what's shown. */
.work__media img { width: auto; height: auto; max-width: 100%; max-height: calc(100vh - var(--header-h) - 4rem); }
.work__panel { position: sticky; top: calc(var(--header-h) + 2rem); }
.work__actions { display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; align-items: center; margin-top: 2.5rem; }
@media (max-width: 860px) {
  .work { grid-template-columns: 1fr; }
  .work__panel { position: static; }
}

/* --------------------------------------------------------------------------
   WordPress integration
   -------------------------------------------------------------------------- */

/* Logged-in visitors: keep the header and lightbox below the WordPress admin bar. Below 600px the bar
   scrolls away with the page, so main.js sets --kk-admin-offset to however much of it is still visible. */
.admin-bar .site-header,
.admin-bar .lightbox { top: var(--kk-admin-offset, 32px); }
@media (max-width: 782px) {
  .admin-bar .site-header,
  .admin-bar .lightbox { top: var(--kk-admin-offset, 46px); }
}

.section--flush { padding-top: 0; }
.prose__cta { margin-top: 2.5rem; }
.contact-details__text { margin: 0; }

.portrait__img { overflow: hidden; }
.portrait__img img { display: block; width: 100%; height: 100%; object-fit: cover; }

.pencil-richtext > :last-child { margin-bottom: 0; }

.form__error { color: var(--accent); margin: 0; }
.form__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }


.filters__label { display: inline; }

/* Round icon button: lightbox close/arrows and gallery arrows. Colours come from the context. */
.round-button {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  color: inherit;
  border: 1px solid var(--round-line, var(--line));
  border-radius: 50%;
  transition: background 0.3s, border-color 0.3s, opacity 0.3s;
}
.round-button:hover { background: var(--round-fill-hover, transparent); border-color: var(--round-line-hover, var(--ink)); }
.round-button:disabled { opacity: 0.3; cursor: default; }
.round-button:disabled:hover { background: none; border-color: var(--round-line, var(--line)); }
.round-button svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.25; }
.round-button--sm { width: 40px; height: 40px; }
.round-button--sm svg { width: 16px; height: 16px; }

/* Card captions keep the same height when a work has no year or size, so cards stay in line. */
.artwork__meta { min-height: 1.7em; }

/* Magnifier: a circle that follows the mouse over the lightbox and single work photos (assets/js/main.js).
   Mouse and trackpad only; touch screens never get it. */
.loupe {
  position: fixed;
  top: 0; left: 0;
  z-index: 120;
  width: 200px; height: 200px;
  border-radius: 50%;
  border: 1px solid rgba(244, 241, 236, 0.7);
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.55);
  background-color: var(--bg-alt);
  background-repeat: no-repeat;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}
.loupe.is-visible { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .has-loupe { cursor: none; }
}

/* Cloudflare Turnstile check on the contact form (when switched on in Site settings). */
.form__verify { min-height: 65px; }

/* Series names that link to their series page (lightbox and single work page). */
.eyebrow--link { display: inline-block; color: inherit; text-decoration: none; transition: color 0.3s; }
a.eyebrow--link[href]:hover { color: var(--ink); }
.lightbox a.eyebrow--link[href]:hover { color: var(--overlay-ink); }

.page-intro__text > :last-child { margin-bottom: 0; }
