/* norapaints.store: the wall and its labels */

@font-face { font-family: "Spectral"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/spectral-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Spectral"; font-style: italic; font-weight: 400; font-display: swap; src: url("../fonts/spectral-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Spectral"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/spectral-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/public-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/public-sans-latin-500-normal.woff2") format("woff2"); }

:root {
  --wall: #ECEEEC;      /* cool plaster */
  --plate: #F8F9F8;     /* wall label card */
  --ink: #22272B;       /* slate */
  --muted: #646B70;
  --hairline: #C8CDCB;
  --link: #2E5A61;      /* Pacific slate-teal */
  --dot: #C0262D;       /* the gallery's sold sticker */

  --serif: "Spectral", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Public Sans", "Helvetica Neue", Arial, sans-serif;

  /* 1.25 scale on a 17px base */
  --step--1: 0.8rem;
  --step-0: 1.0625rem;
  --step-1: 1.328rem;
  --step-2: 1.66rem;
  --step-3: 2.075rem;

  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --canvas-shadow: 0 1px 1px rgb(34 39 43 / 0.12), 0 14px 28px -14px rgb(34 39 43 / 0.45);
}

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

html {
  background: var(--wall);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--serif);
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; padding: 0 var(--gutter); }

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

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 4px; border-radius: 1px; }

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

.skip { position: absolute; left: var(--gutter); top: -3rem; padding: 0.5rem 0.75rem; background: var(--ink); color: var(--wall); font: 500 var(--step--1) var(--sans); z-index: 10; }
.skip:focus { top: 0.75rem; }

/* ------------------------------------------------------------ masthead */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding: clamp(1.5rem, 4vw, 2.75rem) var(--gutter) clamp(1.5rem, 3vw, 2.25rem);
}

.wordmark {
  font: 500 var(--step-2)/1 var(--serif);
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.masthead nav { display: flex; gap: 1.75rem; font: 400 var(--step--1)/1 var(--sans); letter-spacing: 0.01em; }
.masthead nav a { color: var(--muted); text-decoration: none; padding-block: 0.4rem; }
.masthead nav a:hover, .masthead nav a[aria-current="page"] { color: var(--ink); }
.masthead nav a[aria-current="page"] { box-shadow: inset 0 -1px 0 var(--ink); }

.intro {
  max-width: 34ch;
  margin: 0 0 clamp(2.5rem, 6vw, 4.5rem);
  font: 400 var(--step-1)/1.45 var(--serif);
}

/* ------------------------------------------------------------ the hang
   Justified rows: flex-grow and flex-basis both scale with each painting's
   aspect ratio (--ar, from works.css), so every image in a row shares a height. */

.hang {
  --row: clamp(13rem, 24vw, 22rem);
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: clamp(2.5rem, 5vw, 4.5rem) clamp(1.75rem, 4vw, 3.5rem);
  align-items: flex-start;
}
.hang::after { content: ""; flex: 4 1 0; }  /* keeps a short last row from stretching */

.piece { flex: var(--ar, 1) 1 calc(var(--ar, 1) * var(--row)); min-width: 0; }
.piece > a { display: block; color: inherit; text-decoration: none; }

.art { width: 100%; background: var(--hairline); box-shadow: var(--canvas-shadow); }

.tag { display: block; margin-top: 1.1rem; }
.tag-title { font-style: italic; font-size: var(--step-0); }
.tag-meta { display: block; font: 400 var(--step--1)/1.5 var(--sans); color: var(--muted); margin-top: 0.15rem; }
.piece > a:hover .tag-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }

.dot {
  display: inline-block;
  width: 0.62em;
  height: 0.62em;
  border-radius: 50%;
  background: var(--dot);
  vertical-align: 0.05em;
  box-shadow: inset 0 -1px 1px rgb(0 0 0 / 0.18);
}

.legend {
  margin: clamp(3rem, 7vw, 5rem) 0 0;
  font: 400 var(--step--1)/1.5 var(--sans);
  color: var(--muted);
}
.tag .dot { margin-left: 0.4em; }
.legend .dot { margin-right: 0.35em; }

/* ------------------------------------------------------------ a single work */

.work {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(14rem, 17rem);
  justify-content: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: end;
}

.work-frame {
  position: relative;
  isolation: isolate;
  margin: 0;
  padding: clamp(0.5rem, 3vw, 2.5rem) 0;
}
/* a picture light: a soft wash on the wall behind the canvas, fading out on every side */
.work-frame::before {
  content: "";
  position: absolute;
  inset: -1rem -12% 20%;
  z-index: -1;
  background: radial-gradient(closest-side, rgb(255 255 255 / 0.8), rgb(255 255 255 / 0));
  pointer-events: none;
}

.art-large { width: auto; max-height: calc(100vh - 11rem); object-fit: contain; }

.label {
  background: var(--plate);
  border: 1px solid var(--hairline);
  padding: 1.35rem 1.4rem 1.2rem;
  font: 400 var(--step--1)/1.55 var(--sans);
  margin-bottom: clamp(0.5rem, 3vw, 2.5rem);
}
:where(.label) p { margin: 0; }  /* low specificity, so the rules below win */
.label-title { margin: 0 0 0.2rem; font: italic 400 var(--step-1)/1.2 var(--serif); }
.label-meta { margin-top: 0.6rem; color: var(--muted); }
.label-text { margin-top: 0.9rem; font: 400 0.92rem/1.6 var(--serif); max-width: 60ch; }
.label-status { margin-top: 1.1rem; padding-top: 0.9rem; border-top: 1px solid var(--hairline); }
.label-status .dot { margin-right: 0.4em; }
.sold, .available { font-weight: 500; }
.price { font: 500 var(--step-0) var(--serif); margin-bottom: 0.7rem; }
.label-full { margin-top: 0.9rem; }
.muted { color: var(--muted); }

.buy {
  display: inline-block;
  padding: 0.6rem 1rem;
  background: var(--link);
  color: #fff;
  font-weight: 500;
  text-decoration: none;
  border-radius: 2px;
}
.buy:hover { background: var(--ink); color: #fff; }

.walk {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 1rem;
  margin-top: clamp(2.5rem, 6vw, 4rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--hairline);
  font: 400 var(--step--1)/1.4 var(--sans);
}
.walk a { color: var(--ink); text-decoration: none; }
.walk a:hover .walk-title { text-decoration: underline; text-underline-offset: 0.2em; }
.walk-dir { display: block; color: var(--muted); }
.walk-title { font: italic 400 var(--step-0) var(--serif); }
.walk-next { text-align: right; }
.walk-count { color: var(--muted); }

/* ------------------------------------------------------------ prose */

.prose { max-width: 38rem; padding-bottom: 2rem; }
.prose h1 { font: 400 var(--step-3)/1.15 var(--serif); letter-spacing: -0.01em; margin: 0 0 1.5rem; }
.prose h2 { font: 500 var(--step-1)/1.3 var(--serif); margin: 2.25rem 0 0.5rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1rem; line-height: 1.7; }
.prose > p:first-of-type { font-size: var(--step-1); line-height: 1.5; }
.prose img { margin: 2rem 0; box-shadow: var(--canvas-shadow); }

/* ------------------------------------------------------------ footer */

.colophon {
  padding: clamp(3rem, 8vw, 6rem) var(--gutter) 2rem;
  font: 400 0.75rem/1.5 var(--sans);
  color: var(--muted);
}
.colophon p { margin: 0; max-width: 60ch; }

/* ------------------------------------------------------------ motion: images settle in once loaded */

.js .art { opacity: 0; transition: opacity 0.6s ease-out; }
.js .art.loaded { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .js .art { transition: none; }
}

/* ------------------------------------------------------------ small screens */

@media (max-width: 52rem) {
  .work { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .work-frame { display: flex; justify-content: center; }
  .art-large { max-height: 75vh; }
  .label { margin-bottom: 0; }
}

@media (max-width: 34rem) {
  .piece { flex: 1 1 100%; }
  .hang::after { display: none; }
  .walk { grid-template-columns: 1fr 1fr; }
  .walk-count { display: none; }
}

@media print {
  .masthead nav, .walk, .skip { display: none; }
  .js .art { opacity: 1; }
}
