/* ------------------------------------------------------------------
   Josh Wells — site styles
   Two typefaces:
     --serif : Suffix (headers, name, nav, artwork titles)
     --sans  : Helvetica / Arial (everything else)
   To use Suffix: put your licensed font files in /fonts with the names
   below, then delete the two lines marked "remove" so this block is
   switched on. Until then it uses Newsreader (loaded from Google Fonts).
------------------------------------------------------------------- */

/* remove this line to switch on Suffix
@font-face {
  font-family: "Suffix";
  src: url("../fonts/Suffix-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: "Suffix";
  src: url("../fonts/Suffix-Italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: block;
}
@font-face {
  font-family: "Suffix";
  src: url("../fonts/Suffix-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: "Suffix";
  src: url("../fonts/Suffix-BoldItalic.woff2") format("woff2");
  font-weight: 700;
  font-style: italic;
  font-display: block;
}
remove this line too */

:root {
  --serif: "Suffix", "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;

  --bg: #ffffff;
  --ink: #141414;
  --muted: #8a8a8a;
  --rule: #e6e6e6;

  --gutter: clamp(16px, 3vw, 40px);
  --small: 13px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--small);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--muted); }

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

/* ---------- layout: vertical sidebar + content ---------- */

body {
  display: grid;
  grid-template-columns: clamp(250px, 20vw, 290px) minmax(0, 1fr);
  grid-template-rows: 1fr auto;
}

.site-header {
  grid-row: 1 / 3;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: var(--gutter) var(--gutter) var(--gutter) clamp(24px, 4.5vw, 72px);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.site-name {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.site-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--serif);
  font-size: 17px;
}
.site-nav a[aria-current="page"] { font-style: italic; }

/* years: click to show / hide the works from that year */
.years,
.years ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.years > li + li { margin-top: 4px; }
.years button {
  font: inherit;
  font-family: var(--serif);
  font-size: 17px;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
}
.years button:hover { color: var(--muted); }
.years .open > button { font-style: italic; }
.years ul {
  display: none;
  margin: 4px 0 10px 14px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  line-height: 1.45;
}
.years .open > ul { display: block; }
.years ul a { color: var(--muted); }
.years ul a:hover,
.years ul a[aria-current="page"] { color: var(--ink); }

.menu-toggle {
  display: none;
  font: inherit;
  font-family: var(--serif);
  font-size: 17px;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* copyright sits just under the nav, set apart by the sidebar's usual gap */
.colophon {
  color: var(--muted);
}
.colophon p { margin: 0; }

main { padding: var(--gutter) var(--gutter) calc(var(--gutter) * 2) 0; }

/* ---------- selected works / archive grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: calc(var(--gutter) * 2) var(--gutter);
  align-items: end;
  margin-top: 4vh;
}

.grid a { display: block; }

.grid .frame {
  aspect-ratio: 4 / 5;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
}
/* artwork is never cropped — it sits inside the frame */
.grid .frame img {
  max-height: 100%;
  width: auto;
  object-fit: contain;
  transition: opacity .3s;
}
.grid a:hover img { opacity: .85; }

.grid figcaption,
.caption {
  margin-top: 12px;
}
.title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
}
.meta { color: var(--muted); }

.grid.small { grid-template-columns: repeat(5, 1fr); gap: var(--gutter); }
.grid.small .title { font-size: 14px; }

.section-label {
  font-family: var(--serif);
  font-size: 17px;
  margin: 12vh 0 0;
}
.section-label:first-child { margin-top: 2vh; }

/* ---------- single artwork page ---------- */

/* first screen of an artwork page: exactly the window's height minus the
   page margins. The painting takes whatever room the caption leaves. */
.work-top {
  height: calc(100vh - var(--gutter) * 3);
  height: calc(100svh - var(--gutter) * 3);
  display: flex;
  flex-direction: column;
}
.work-main {
  flex: 1;
  min-height: 0;
}
/* cursors: the pointing hand (same as the nav links) to open and close full screen */
:root {
  --cursor-open: pointer;
  --cursor-close: pointer;
}

.work-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: var(--cursor-open);
}
.details img {
  max-height: 86vh;
  width: auto;
  cursor: var(--cursor-open);
}

.work-info {
  max-width: 520px;
  margin: 18px auto 0;
  text-align: center;
}
.work-info { font-size: 15px; }
.work-info .title { font-size: 24px; margin-bottom: 4px; }
.work-info p { margin: 2px 0; }

.details {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(var(--gutter) * 2);
  margin-top: 14vh;
}

/* placeholder "closeup" made by zooming into the main image */
.crop {
  width: min(900px, 100%);
  aspect-ratio: 1;
  background-repeat: no-repeat;
  background-size: 320%;
  cursor: var(--cursor-open);
}

.work-nav {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 14vh;
  font-family: var(--serif);
}
.work-top .work-nav { margin-top: 18px; }
.work-nav {
  font-size: 16px;
}

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  cursor: var(--cursor-close);
  padding: 2vh;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }

/* ---------- biography & cv pages ---------- */

.info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--gutter) * 2);
  margin-top: 4px;
  max-width: 1100px;
}
.info.single { grid-template-columns: minmax(0, 620px); }
.info h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 17px;
  margin: 0 0 10px;
}
.info section + section { margin-top: 44px; }
/* CV section headings (Education, Residencies ...) are bold */
[data-page="cv"] .info h2 { font-weight: 700; }
.info p { margin: 0 0 1em; max-width: 60ch; font-size: 15px; line-height: 1.6; }
/* biography and contact text: the serif, a little larger, to match the name and nav */
.info .prose p { font-family: var(--serif); font-size: 18px; line-height: 1.55; }
.cv { list-style: none; margin: 0; padding: 0; }
/* each CV line reads like an artwork caption: the title in the serif (bold italic),
   the rest in Helvetica at the same size as the captions */
.cv li { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 4px 0; font-size: 15px; }
.cv .yr { color: var(--muted); }
.cv .yr.repeat { visibility: hidden; }  /* same year as the line above */
/* <em> = the title of the show, publication, course or prize: serif bold italic.
   <i> = plain italic, e.g. the months of a residency, Winner / Nominee. */
.cv em { font-family: var(--serif); font-size: 17px; font-weight: 700; }

.cv-download { margin: 0 0 28px; font-size: 15px; color: var(--muted); }
.cv-download a:hover { color: var(--ink); }
.print-header { display: none; }

/* ---------- printing / the PDF CV ----------
   josh-wells-cv.pdf is made by printing cv.html, so the PDF always matches the page:
   one column on A4, no sidebar, with the name and website at the top. */

@media print {
  @page { size: A4; margin: 20mm 20mm 18mm; }
  body { display: block; }
  .site-header, .cv-download { display: none; }
  main { padding: 0; }
  .print-header { display: block; text-align: center; margin-bottom: 12mm; font-size: 10pt; }
  .print-header p { margin: 0; }
  .print-header .print-name {
    font-family: var(--serif); font-weight: 700; font-size: 18pt;
    text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 2mm;
  }
  .info { display: flex; flex-direction: column; gap: 0; max-width: none; }
  .info > div { display: contents; }
  .info section { order: 0; break-inside: auto; }
  .info section.press { order: 1; }   /* press comes last in the PDF */
  .info section, .info section + section { margin-top: 8mm; }
  .info > div:first-child > section:first-child { margin-top: 0; }
  .info h2 { font-size: 12pt; margin-bottom: 2mm; break-after: avoid; }
  .cv li { grid-template-columns: 26mm 1fr; gap: 3mm; padding: 1mm 0; font-size: 9.5pt; break-inside: avoid; }
  .cv em { font-size: 10.5pt; }
  .cv i { white-space: normal; }
  /* every line keeps its year in the PDF, so a line at the top of page 2 is never left without one */
  .cv .yr.repeat { visibility: visible; }
}

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .grid.small { grid-template-columns: repeat(3, 1fr); }
  .info { grid-template-columns: 1fr; }
}
/* on phones the sidebar becomes a simple header above the work */
@media (max-width: 760px) {
  body { display: block; }
  .site-header { position: static; height: auto; gap: 16px; padding: var(--gutter); }
  .site-nav { flex-direction: row; gap: 16px; }
  /* the menu folds away behind a "menu" button so the painting comes first */
  .site-header { flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: space-between; }
  .menu-toggle { display: block; }
  .site-header .years,
  .site-header .site-nav { display: none; width: 100%; }
  .site-header.menu-open .years,
  .site-header.menu-open .site-nav { display: flex; }
  .site-header.menu-open .years { flex-direction: column; margin-top: 8px; }
  .years > li + li { margin-top: 8px; }
  .years ul { font-size: 16px; line-height: 1.7; }
  .cv li { grid-template-columns: 76px 1fr; gap: 10px; }
  .cv i { white-space: nowrap; }
  .colophon { display: none; }
  main { padding: 0 var(--gutter) calc(var(--gutter) * 2); }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .grid.small { grid-template-columns: repeat(2, 1fr); }
  .grid .frame { aspect-ratio: auto; }
  .work-top { height: auto; }
  .work-main img, .details img { max-height: none; width: 100%; height: auto; }
}
