/* Szaja Gottlieb — site styles */

:root {
  --serif: "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ink: #000;
  --paper: #fff;
  --red: rgb(205, 26, 26);
  --content: 980px;
  --gutter: 16px;
}

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

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

/* Leave some room above a work when jumping to it from its page. */
.work { scroll-margin-top: 40px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.4;
}

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

.nowrap { white-space: nowrap; }

figure { margin: 0; }

h1, h2 { font-weight: 600; line-height: 1.15; margin: 0; }

/* One page-heading style for every page. */
h1 {
  font-size: clamp(30px, 4.6vw, 48px);
  text-align: center;
  margin-bottom: 24px;
}
/* White on black titles; the home page is already white on black. */
body:not(.home) h1 {
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  padding: 4px 14px;
  background: var(--ink);
  color: var(--paper);
}

main {
  display: flex;
  flex-direction: column;
  max-width: var(--content);
  margin: 0 auto;
  padding: 48px var(--gutter) 16px;
}

/* Buttons */

.button {
  display: inline-block;
  min-width: 142px;
  padding: 10px 28px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  letter-spacing: 0.05em;
  text-align: center;
  text-decoration: none;
}
.button:hover, .button:focus-visible { opacity: 0.8; }

/* Page buttons sit centered, just below the page content. */
.page-nav { padding-top: 24px; text-align: center; }

/* Home */

body.home { background: var(--ink); color: var(--paper); }

.landing { align-items: center; text-align: center; padding-top: 24px; }

.landing figure img { width: min(491px, 100%); margin: 0 auto; }

.landing figcaption { margin-top: 12px; font-size: 22px; line-height: 1.4; }

.enter {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  color: var(--red);
  font-size: 27px;
  font-weight: 600;
  text-decoration: none;
}
.enter::after {
  content: "";
  width: 11px;
  height: 11px;
  border: solid var(--paper);
  border-width: 3px 3px 0 0;
  transform: rotate(45deg);
}
.enter:hover, .enter:focus-visible { text-decoration: underline; }

/* Sacred Monster */

.page-header { text-align: center; margin-bottom: 40px; }
.page-header h1 { margin-bottom: 0; }
.quote { font-size: clamp(20px, 2.5vw, 28px); font-style: italic; font-weight: 400; margin: 20px 0 0; }
.attribution { font-size: clamp(17px, 2vw, 21px); margin: 6px 0 0; }

.sm-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  gap: 12px 32px;
}
/* The two photos on each side are cropped to fill exactly the height of the main
   photo, so their tops and bottoms line up with it. */
.sm-side { position: relative; }
.sm-side > figure { position: absolute; left: 0; right: 0; }
.sm-side > figure:first-child { top: 0; bottom: calc(50% + 12px); }
.sm-side > figure:last-child { top: calc(50% + 12px); bottom: 0; }
.sm-side img { width: 100%; height: 100%; object-fit: cover; }
.sm-main img { width: 100%; }
.facts { grid-column: 2; }

.facts { width: fit-content; margin: 0 auto; padding-left: 1.2em; font-size: 17px; }

/* One line on wider screens: the font shrinks with the window to keep it there. */
.closing { margin: 32px 0 0; font-size: min(20px, calc((100vw - 32px) / 47)); text-align: center; white-space: nowrap; }

/* Story */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px 80px;
  align-items: end;
}
.photo-grid img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.photo-grid figcaption { margin-top: 4px; font-size: 15px; }

.story-text { max-width: 900px; margin: 48px auto 0; font-size: 21px; }
.story-text p { margin: 0; }
.story-text .epigraph { font-style: italic; text-align: center; margin: -8px 0 32px; }
.story-text p + p { margin-top: 0.7em; }
.story-text .dedication { font-size: 19px; font-style: italic; margin-top: 1.2em; }

/* Portfolio */

.portfolio h1 { margin-bottom: 48px; }
.series + .series { margin-top: 96px; }
.series h2 { font-size: clamp(22px, 3vw, 28px); font-weight: 500; }
.years { margin: 4px 0 0; font-size: 16px; }
.series-description { margin: 10px 0 24px; font-size: 19px; }

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 36px 28px;
  align-items: start;
}
/* Fixed-height image box, bottom-aligned, so captions in a row line up. */
.work > a, .work > img { display: flex; align-items: flex-end; height: 210px; }
.work img { max-height: 210px; width: auto; }
.work a:hover img, .work a:focus-visible img { opacity: 0.85; }
.work figcaption { margin-top: 4px; font-size: 14px; line-height: 1.25; }
.work figcaption span { display: block; }

.press p { margin: 16px 0 0; font-size: 19px; }

/* Work detail pages */

.work-page { text-align: center; }
.work-images { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; }
.work-images img { max-height: 600px; width: auto; }
.work-images:has(> a + a) img { max-height: 440px; }
.work-details { font-size: 17px; margin: 12px 0 0; }

/* Narrow screens */

@media (max-width: 760px) {
  main { padding-top: 32px; }
  .sm-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .sm-main { grid-column: 1 / -1; order: -1; }
  .sm-side { display: grid; gap: 16px; }
  .sm-side > figure { position: static; }
  .sm-side img { aspect-ratio: 3 / 4; }
  .facts { grid-column: 1 / -1; order: -1; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 24px 16px; }
  .story-text { font-size: 19px; }
  .closing { font-size: min(16px, calc((100vw - 32px) / 28)); }
  .closing span { display: block; }
  .works-grid { grid-template-columns: repeat(2, 1fr); gap: 28px 16px; }
  .work > a, .work > img { height: auto; }
  .work img { max-height: none; width: 100%; }
}
