/* ==========================================================================
   Photographer portfolio — styles
   Everything is a carousel. Header sits on one line. White paper, black ink,
   one typeface, so the photographs carry the page.
   ========================================================================== */

:root {
  --font: "IBM Plex Sans", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --ink: #111111;
  --body: #555555;                /* softer tone for card body copy */
  --paper: #ffffff;
  --muted: #6f6f6f;              /* darkened from #8a8a8a — clears AA on small captions/specs/nav */
  --card: #f5f5f5;                /* formal card surface */
  --card-line: #e4e4e4;           /* hairline on cards / covers / rules */
  --radius: 4px;                  /* card container */
  --radius-sm: 2px;               /* covers + buttons (kept tight) */
  --gap: clamp(1rem, 4vw, 3rem);
  --nav-size: 0.8125rem;          /* 13px — small, gallery-neutral */
  --fade: 900ms;
  --header-h: 5rem;               /* used to size the carousel viewport */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
a:hover { opacity: 0.5; }

/* Discourage casual saving of the photographs (see note in app.js). */
img {
  max-width: 100%;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-touch-callout: none;  /* no long-press "Save Image" on iOS */
}

/* ---------- Header: logo + name + menu, ALL ON ONE LINE ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  padding: var(--gap) var(--gap) 0.75rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;                /* wraps only when it truly can't fit */
  gap: 0.4rem 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.brand:hover { opacity: 1; }
.brand:hover .wordmark { opacity: 0.5; }

.logo {
  width: 22px;
  height: 22px;
  display: block;
  color: #000000;                /* 100% black — SVG uses currentColor when inlined */
  flex: 0 0 auto;
}

.wordmark {
  font-size: var(--nav-size);
  letter-spacing: 0.01em;
  font-weight: 700;              /* bold */
}

/* ---------- Navigation (inline, right after the brand) ---------- */
nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1rem;
  font-size: var(--nav-size);
}
nav a.active     { opacity: 0.4; }
nav .sep         { color: var(--muted); }
nav .group-label { color: var(--ink); }

/* ---------- Main ---------- */
main { min-height: 50vh; }

/* ---------- Carousel (used by every showcase) ---------- */
.carousel {
  position: relative;
  height: calc(100svh - var(--header-h));
  min-height: 320px;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
  background: #f4f2ec;            /* warm off-white behind the images */
}
.carousel figure {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--fade) ease;
  pointer-events: none;
}
.carousel figure.current { opacity: 1; }
.carousel img {
  display: block;
  max-width: 100vw;
  max-height: min(calc(100svh - var(--header-h)), 800px);  /* same cap as before, wrapper-independent */
  width: auto;
  height: auto;
}

/* Image wrapper: shrinks to the image so the crop marks sit on its edges. */
.carousel .proof {
  position: relative;
  display: inline-block;
  line-height: 0;
  --cm-t: 0.5px;      /* mark thickness */
  --cm-len: 20px;     /* mark length    */
  --cm-gap: 3px;      /* gap from edge  */
  --cm-c: #b0b0b0;    /* mark colour    */
}
/* CENTRE MARKS — disabled. Delete the opening slash-star on this line and the
   closing star-slash after the last rule below to re-enable them.
.carousel .proof::before,
.carousel .proof::after {
  content: "";
  position: absolute;
  pointer-events: none;
  background-repeat: no-repeat;
  background-image:
    linear-gradient(var(--cm-c), var(--cm-c)),
    linear-gradient(var(--cm-c), var(--cm-c));
}
.carousel .proof::before {
  left: 0; right: 0;
  top: calc(-1 * (var(--cm-gap) + var(--cm-len)));
  bottom: calc(-1 * (var(--cm-gap) + var(--cm-len)));
  background-size: var(--cm-len) var(--cm-t);
  background-position:
    50% calc(var(--cm-len) - var(--cm-t)),
    50% calc(100% - (var(--cm-len) - var(--cm-t)));
}
.carousel .proof::after {
  top: 0; bottom: 0;
  left: calc(-1 * (var(--cm-gap) + var(--cm-len)));
  right: calc(-1 * (var(--cm-gap) + var(--cm-len)));
  background-size: var(--cm-t) var(--cm-len);
  background-position:
    calc(var(--cm-len) - var(--cm-t)) 50%,
    calc(100% - (var(--cm-len) - var(--cm-t))) 50%;
}
*/
/* keep a shaped placeholder if a wrapped image ever fails to load */
.carousel .proof .ph {
  width: min(70vw, 460px);
  aspect-ratio: 2 / 3;
  height: auto;
}
.carousel .meta {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  text-align: center;
  max-width: 90%;
  pointer-events: none;
}
.carousel .caption { font-size: 0.75rem; color: var(--muted); }
.carousel .index   { font-size: 0.6875rem; color: var(--muted);
                     letter-spacing: 0.08em; }

/* ---------- Title card (a text "slide" inside a carousel) ---------- */
.carousel figure.title-figure { align-items: flex-start; }
.title-card {
  max-width: 40em;                 /* wider column */
  margin: clamp(2rem, 15vh, 9rem) auto 0;   /* sits in the upper portion */
  padding: var(--gap);
  text-align: justify;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.5rem;
}
.title-card h1 {
  font-size: clamp(2rem, 7vw, 3.5rem);   /* larger title */
  font-weight: 400;
  line-height: 1.1;
  margin: 0;
}
.title-card p {
  font-size: 0.875rem;             /* smaller description */
  line-height: 1.6;
  color: var(--muted);
  margin: 0;
}
.title-card .tc-link a {
  color: var(--ink);
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}

/* ---------- Publications catalogue (grid of book cards) ----------
   Formal filled-card containers borrowed from the old site, redrawn in the
   new site's Helvetica / black-on-white identity. Cards stretch to equal
   heights per row; the CTA is pinned to the bottom so buttons line up. */
.catalogue { padding: var(--gap); }
.catalogue .grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: var(--gap);
  max-width: 1120px;
  margin: 0 auto;
  align-items: stretch;              /* rows share a height → equal cards */
}

/* Card container */
.book {
  display: flex;
  flex-direction: column;
  height: 100%;                      /* fill the stretched grid track */
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  padding: 1.15rem 1.15rem 1.25rem;
}

/* Cover — floats at its natural ratio: no mat, no border, no letterboxing */
.book__cover {
  margin: 0;
  display: block;
  overflow: hidden;
}
.book__cover img {
  width: 100%;
  height: auto;                      /* natural aspect ratio → no empty space */
  display: block;
  border-radius: var(--radius-sm);   /* gentle corners on the image itself */
}
/* Placeholder keeps a shape so a card never collapses when a cover is missing */
.book__cover .ph {
  height: auto;
  aspect-ratio: 2 / 3;               /* mirrors the real portrait covers */
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}
.book__cover.is-landscape .ph { aspect-ratio: 3 / 2; }

/* Body grows so the footer can sit at the bottom of every card */
.book__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding-top: 0.95rem;
}
.book__meta {
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.book__title {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0.3rem 0 0;
}
.book__desc {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--body);
  margin: 0.55rem 0 0;
}

/* Specs — top-ruled definition list, like the old catalogue */
.specs {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.32rem 0.9rem;
  margin: 0.9rem 0 0;
  padding-top: 0.8rem;
  border-top: 1px solid var(--card-line);
  font-size: 0.75rem;
}
.specs dt {
  color: var(--muted);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-top: 0.15em;
  white-space: nowrap;
}
.specs dd { margin: 0; color: var(--ink); }

/* Footer pinned to card bottom */
.book__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: auto;                  /* push CTAs down → aligned across row */
  padding-top: 1.1rem;
}

/* Small, low-radius bordered buttons */
.book__foot .cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 0.85rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}
.book__foot .cta:hover {
  background: transparent;
  color: var(--ink);
  opacity: 1;                        /* override global a:hover fade */
}
.book__foot .cta:active { transform: translateY(1px); }
.book__foot .cta--sold {
  background: transparent;
  color: var(--muted);
  border-color: var(--card-line);
  border-style: dashed;
  cursor: default;
}
.book__foot .cta--sold:hover { color: var(--muted); }

/* ---------- About (profile: header + accordion of formal cards) ---------- */
.about {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 var(--gap) var(--gap);
}

/* Header — Bio designed like a project title + blurb, set down from the header */
.about__head {
  max-width: 40em;
  padding: clamp(2.5rem, 12vh, 7rem) 0 2.25rem;
}
.about__name {
  margin: 0;
  font-size: clamp(2rem, 7vw, 1.5rem);
  font-weight: 400;
  line-height: 1.1;
}
.about__bio {
  margin: 1.5rem 0 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--muted);
}

/* Get in touch — inline label + plain links */
.about__contact {
  margin: 1.5rem 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}
.about__contact a {
  color: var(--ink);
}
.about__contact a::before { content: "\2192\00a0"; color: var(--muted); }

/* Accordion card */
.acc {
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  margin: 0 0 0.55rem;
}
.acc > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.85rem 1.05rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary::after {
  content: "+";
  margin-left: auto;
  font-weight: 400;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--muted);
}
.acc[open] > summary::after { content: "\2013"; }  /* en dash */
.acc__meta { font-weight: 400; font-size: 0.6875rem; color: var(--muted); }

.acc__body {
  padding: 0 1.05rem 1.1rem;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--body);
}
.acc__body > *:first-child { margin-top: 0; }
.acc__body p { margin: 0 0 0.75rem; }
.acc__body a { border-bottom: 1px solid currentColor; padding-bottom: 1px; }
.acc__body--scroll { max-height: 58vh; overflow: auto; }

/* Inner sub-labels */
.acc__body .acc__sub {
  margin: 2.75rem 0 0;              /* more space above the group; hugs its own list below */
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--card-line);   /* caps the list like a header */
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}
.acc__legend {
  margin: 0 0 0.75rem;
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}
/* Exhibition year headings — bigger, bolder, ruled like a header for the list */
.acc__body .acc__year {
  margin: 2.75rem 0 0;              /* more space above the group; hugs its own list below */
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--card-line);
  font-size: 0.9375rem;             /* reduced from 1.0625rem */
  font-weight: 700;
  letter-spacing: 0;
  color: var(--ink);
}
/* First heading inside a card shouldn't carry extra top space */
.acc__body > .acc__year:first-child,
.acc__body > .acc__sub:first-child { margin-top: 0; }
.acc__list { list-style: none; margin: 0; padding: 0; }
.acc__list li { padding: 0.4rem 0; border-top: 1px solid var(--card-line); }
.acc__list li:first-child { border-top: 0; }
.acc__list b { color: var(--ink); }
.acc__list .src { display: block; color: var(--muted); font-size: 0.75rem; margin-top: 0.15rem; }

/* Simple link column */
.acc__links { list-style: none; margin: 0; padding: 0; }
.acc__links li { padding: 0.3rem 0; }
.acc__links a { border-bottom: 0; }
.acc__links a::before { content: "\2192\00a0\00a0"; color: var(--muted); }

/* Client tags */
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; }
.tags li {
  font-size: 0.75rem;
  color: var(--ink);
  border: 1px solid var(--card-line);
  border-radius: var(--radius-sm);
  padding: 0.22rem 0.6rem;
  background: var(--paper);
}

/* Quotes */
.acc__quotes { list-style: none; margin: 0; padding: 0; }
.acc__quotes li { padding: 0.75rem 0; border-top: 1px solid var(--card-line); color: var(--ink); }
.acc__quotes li:first-child { border-top: 0; }
.acc__quotes .src { display: block; color: var(--muted); font-size: 0.75rem; margin-top: 0.35rem; }

/* ---------- Placeholder tiles (auto-shown until real images exist) ---------- */
.ph {
  width: 100%;
  height: 100%;
  background:
    repeating-linear-gradient(45deg,#f2f2f2,#f2f2f2 12px,#ededed 12px,#ededed 24px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-align: center;
  padding: 1rem;
}

/* ---------- Site footer (visible by default; hidden only on carousels) ---------- */
.site-footer {
  display: block;
  padding: 2.1rem var(--gap);
  background: var(--paper);
}
body.is-carousel .site-footer { display: none; }
.site-footer p {
  margin: 0;
  text-align: center;
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ---------- Accessibility ---------- */
:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  .carousel figure { transition: none; }
}

/* ---------- Responsive refinements ---------- */
@media (max-width: 600px) {
  :root { --header-h: 4rem; }
  header { gap: 0.3rem 1rem; padding: var(--gap) var(--gap) 0.6rem; }
  nav { gap: 0.3rem 0.8rem; }
  .book__foot { flex-direction: column; align-items: stretch; }
  .book__foot .cta { width: 100%; }
}
