/* home.css - the front page (index.html) only.
   A port of the approved round 6 "Card" board
   (.work/front-page-mockups-2026-11-22-round6, gen8.py card() and its shared CSS).
   gallery.html and admin/ keep site.css; nothing in this file reaches them.
   The two hero columns are set by js/landing.js so Diana's photo keeps its own shape. */

:root {
  --ground: #f7f4ec;        /* ivory page */
  --band: #ede6d8;          /* the darker albums band */
  --paper: #fffdf8;         /* bar, card, captions */
  --ink: #1f1c18;
  --ink-2: #5d5a53;
  --sienna: #9a5b3c;
  --sienna-deep: #854a2f;
  --rule: #d6ccb8;
  --edge: #e2d9c6;
  --btn-edge: #d8cfbe;
  --photo-ground: #e9e2d4;
  --selection: #e6cdbd;
  --plate-shadow: 0 0 0 1px rgba(50, 38, 24, .10), 0 8px 20px rgba(60, 45, 30, .12);
  --cell-shadow: 0 0 0 1px rgba(50, 38, 24, .10), 0 8px 20px rgba(60, 45, 30, .10);
  --font-display: 'Libre Caslon Display', 'Libre Caslon Text', Georgia, serif;
  --font-text: 'Libre Caslon Text', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--ground); color: var(--ink); }

.root {
  container-type: inline-size;
  min-height: 100vh;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a:focus-visible { outline: 2px solid var(--sienna); outline-offset: 3px; border-radius: 3px; }
::selection { background: var(--selection); color: var(--ink); }

/* ---------- the light navbar bar ---------- */
.bar {
  position: relative;
  z-index: 2;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 8px 18px rgba(60, 45, 30, .06);
}
.bar-in, .wrap {
  --u: min(1cqw, 15.6px);
  max-width: 1560px;
  margin: 0 auto;
  padding-left: calc(var(--u) * 3.3);
  padding-right: calc(var(--u) * 3.3);
}
.bar-in { padding-top: 12px; padding-bottom: 12px; }
nav.browse { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 6px;
  border: 1px solid;
  font-family: var(--font-text);
  font-size: 16px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}
.btn.fill { background: var(--sienna); border-color: var(--sienna); color: #fff; }
.btn.fill:hover { background: var(--sienna-deep); border-color: var(--sienna-deep); }
.btn.line { background: var(--paper); border-color: var(--btn-edge); color: var(--ink); }
.btn.line:hover { border-color: var(--sienna); color: var(--sienna); }

/* ---------- hero: her card (left), two justified rows of paintings (right) ---------- */
.hero {
  display: grid;
  /* the solved columns at 1440 wide; landing.js replaces them for the real paintings and width */
  grid-template-columns: minmax(0, 274.23fr) minmax(0, 1030.41fr);
  column-gap: calc(var(--u) * 2.8);
  padding: calc(var(--u) * 2) 0 calc(var(--u) * 2.6);
}
.ident {
  display: grid;
  grid-template-rows: auto 1fr;
  grid-template-areas: "title" "portrait";
  gap: calc(var(--u) * 1.4);
  min-width: 0;
  padding: calc(var(--u) * 1.4);
  background: var(--paper);
  border: 1px solid var(--edge);
  box-shadow: 0 1px 2px rgba(60, 45, 30, .05), 0 10px 26px rgba(60, 45, 30, .08);
}
.title {
  grid-area: title;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, calc(var(--u) * 2.7), 44px);
  line-height: 1.08;
  letter-spacing: -.006em;
  text-wrap: balance;
}
.title span { display: block; }
/* The photo is never cropped: it is drawn at its own 722:1000 shape and the frame hugs it. */
.portrait {
  grid-area: portrait;
  align-self: start;
  margin: 0;
  overflow: hidden;
  background: var(--photo-ground);
  box-shadow: var(--plate-shadow);
}
.portrait img { display: block; width: 100%; height: auto; }

.hang { min-width: 0; }
.rows { display: flex; flex-direction: column; gap: calc(var(--u) * .9); min-width: 0; }
.jrow { display: flex; gap: calc(var(--u) * .9); }
.plate {
  position: relative;
  flex: var(--a) 1 0px;     /* --a = the painting's width / height, so a row is justified */
  min-width: 0;
  display: block;
  overflow: hidden;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--plate-shadow);
}
.plate img { display: block; width: 100%; height: auto; }
/* No lift on hover: a caption band fades in with the title and year. */
.cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 9px 12px 10px;
  background: rgba(255, 253, 248, .95);
  border-top: 1px solid var(--edge);
  opacity: 0;
  transition: opacity 200ms ease;
}
.cap .t { font-style: italic; font-size: 15px; line-height: 1.25; }
.cap .y { font-size: 13px; line-height: 1.3; color: var(--ink-2); }
.plate:hover .cap, .plate:focus-visible .cap { opacity: 1; }

/* ---------- the darker band: by year, by theme ---------- */
.albums { background: var(--band); border-top: 1px solid var(--rule); }
.albums .wrap { padding-top: calc(var(--u) * 2.4); padding-bottom: calc(var(--u) * 2.2); }
.albums h2 {
  margin: 0 0 calc(var(--u) * 1.2);
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(26px, calc(var(--u) * 2.3), 36px);
  line-height: 1.15;
  scroll-margin-top: 16px;
}
.years { display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(var(--u) * 1.4); margin-bottom: calc(var(--u) * 3); }
.themes { display: grid; grid-template-columns: repeat(5, 1fr); gap: calc(var(--u) * 1.7) calc(var(--u) * 1.4); }
.tile { display: flex; flex-direction: column; gap: 10px; color: var(--ink); text-decoration: none; }
.cell { position: relative; display: block; aspect-ratio: 4 / 3; background: #fff; box-shadow: var(--cell-shadow); }
.years .cell { aspect-ratio: 16 / 9; }
/* covers are shown whole on a white mat */
.cell img {
  position: absolute;
  left: calc(var(--u) * .8);
  top: calc(var(--u) * .8);
  width: calc(100% - var(--u) * 1.6);
  height: calc(100% - var(--u) * 1.6);
  object-fit: contain;
}
.tname { font-size: 18px; line-height: 1.3; transition: color 180ms ease; }
.yname { font-family: var(--font-display); font-size: clamp(24px, calc(var(--u) * 2.2), 34px); line-height: 1.1; transition: color 180ms ease; }
.tile:hover .tname, .tile:hover .yname,
.tile:focus-visible .tname, .tile:focus-visible .yname { color: var(--sienna); }

.foot { display: flex; justify-content: flex-end; padding: calc(var(--u) * 1.2) 0 0; }
.quiet { font-size: 14px; color: var(--ink-2); text-decoration: none; padding: 12px 0; }
.quiet:hover { color: var(--sienna); }

/* ---------- loading problems / empty catalogue ---------- */
.notice {
  max-width: 44rem;
  padding: 20px 24px;
  background: var(--paper);
  border: 1px solid var(--edge);
  color: var(--ink-2);
}
.notice h2 { margin: 0 0 8px; font-family: var(--font-display); font-weight: 400; font-size: 26px; line-height: 1.15; color: var(--ink); }
.notice p { margin: 0 0 8px; }
.notice p:last-child { margin-bottom: 0; }
.notice code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; color: var(--ink); }

/* ---------- phone: the container is under 700px ---------- */
@container (max-width: 699px) {
  .bar-in, .wrap { padding-left: 16px; padding-right: 16px; }
  .btn { padding: 0 15px; }
  .hero { display: block; padding: 22px 0 26px; }
  .ident {
    grid-template-columns: 104px 1fr;
    grid-template-rows: none;
    grid-template-areas: "portrait title";
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
    padding: 12px;
  }
  .title { font-size: 30px; }
  .title span { display: inline; }
  .portrait { align-self: center; aspect-ratio: 722 / 1000; }
  .rows { display: block; columns: 2; column-gap: 10px; }
  .jrow { display: contents; }
  .plate { margin: 0 0 10px; break-inside: avoid; }
  .jrow .plate:nth-child(n+3) { display: none; }
  .rows.is-single .plate:nth-child(n+3) { display: block; }   /* four or fewer paintings: one row, show them all */
  .albums .wrap { padding-top: 26px; padding-bottom: 18px; }
  .albums h2 { margin-bottom: 14px; }
  .years { gap: 10px; margin-bottom: 32px; }
  .years .cell { aspect-ratio: 4 / 3; }
  .themes { grid-template-columns: repeat(2, 1fr); gap: 20px 10px; }
  .cell img { left: 8px; top: 8px; width: calc(100% - 16px); height: calc(100% - 16px); }
  .tname { font-size: 17px; }
}

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