/* Site-wide typography, colours and layout.
   Loads after design.css.
   CSS changes need only a browser refresh. */


/* =========================================================
   SETTINGS
   ========================================================= */

:root {
  /* Fonts */
  --font-body: "Manrope", Arial, sans-serif;
  --font-heading: "Manrope", Arial, sans-serif;
  --font-title: "Prata", Georgia, serif;
  --font-logo: Arial, Helvetica, sans-serif;

  /* Typography */
  --body-size: 1rem;
  --body-line-height: 1.5;
  --reading-size: 1.1875rem;
  --reading-line-height: 1.65;
  --ui-size: 0.875rem;
  --small-size: 0.8125rem;
  --eyebrow-size: 0.75rem;

  --heading-weight: 400;
  --page-title-size: clamp(2.75rem, 7vw, 6rem);
  --project-title-size: clamp(2.125rem, 5vw, 4.375rem);
  --lead-size: clamp(1.625rem, 3.5vw, 2.625rem);
  --statement-size: clamp(1.875rem, 5vw, 4.375rem);

  /* Logo */
  --logo-size: 1.5625rem;
  --hero-logo-size: 1.875rem;
  --footer-logo-size: 1.25rem;
  --logo-weight: 800;

  /* Colours */
  --paper: #fafafa;
  --ink: #171717;
  --muted: #707070;
  --line: #dddddd;

  --submenu-start: #acd7e4;
  --submenu-end: #ddc5ef;
  --submenu-title-ink: #171717;
  --dropdown-background: rgba(255, 255, 255, 0.55);

  /* Page layout */
  --gutter: clamp(20px, 4vw, 64px);
  --header-height: 100px;
  --mobile-header-height: 78px;

  /* Artwork grids */
  --gallery-gap-x: 35px;
  --gallery-gap-y: 65px;
  --studio-gap-x: 45px;
  --studio-thumbnail-height: 380px;

  /* Individual project slider */
  --project-gallery-height: clamp(280px, 65svh, 760px);
  --project-gallery-gap: 24px;

  /* Series exhibition slider */
  --exhibition-gallery-height: clamp(260px, 50vh, 600px);
  --exhibition-gallery-gap: 20px;
}


/* =========================================================
   TYPOGRAPHY
   ========================================================= */

body {
  font-family: var(--font-body);
  font-size: var(--body-size);
  line-height: var(--body-line-height);
}

/* Override letter spacing inherited from design.css */
body,
body * {
  letter-spacing: normal !important;
}

h1,
h2 {
  font-family: var(--font-heading);
  font-weight: var(--heading-weight);
}

h1 {
  font-family: var(--font-title);
  font-size: var(--page-title-size);
}

.project-heading h1 {
  font-size: var(--project-title-size);
}

.small,
footer {
  font-size: var(--small-size);
}

.eyebrow,
.menu-title {
  font-size: var(--eyebrow-size);
}

.prose p {
  font-size: var(--reading-size);
  line-height: var(--reading-line-height);
}

.prose .lead {
  font-size: var(--lead-size);
}

.statement p {
  font-family: var(--font-title);
  font-size: var(--statement-size);
}


/* =========================================================
   HEADER AND NAVIGATION
   ========================================================= */

header {
  height: var(--header-height);
}

.logo {
  font-family: var(--font-logo);
  font-size: var(--logo-size);
  font-weight: var(--logo-weight);
}

.home .logo {
  font-size: var(--hero-logo-size);
}

footer .logo {
  font-size: var(--footer-logo-size);
}

header nav,
.filters,
.origin-tabs,
.breadcrumbs,
.hero-caption>div,
.hero-caption>a span,
.menu-button {
  font-size: var(--ui-size);
}

.menu-title {
  color: var(--submenu-title-ink);
  background: linear-gradient(to right,
      var(--submenu-start),
      var(--submenu-end));
}

/* Translucent dropdowns on desktop */
@media (min-width: 801px) {
  body header nav .dropdown {
    background: var(--dropdown-background);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  body header nav .dropdown .menu-links {
    background: transparent;
  }
}


/* =========================================================
   STORY AND ARTISTIC APPROACH
   ========================================================= */

.story-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 50px;
  align-items: start;
  margin: 50px auto;
}

.story-layout .story-portrait {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  margin: 0;
}

.story-layout .prose {
  min-width: 0;
  max-width: 760px;
  margin: 0;
}


/* =========================================================
   CATEGORY INTRODUCTIONS
   ========================================================= */

:is(.studio, .walls, .space, .crossover) .page-heading .intro {
  margin-left: 33.333%;
}

:is(.studio, .walls, .space, .crossover) .page-heading .intro p {
  max-width: none;
  white-space: pre-line;
}


/* =========================================================
   ARTWORK GRIDS
   ========================================================= */
.studio .grid {
  column-gap: var(--studio-gap-x);
}

.studio .grid>.work-card {
  min-width: 0;
}

.studio .card-image {
  height: var(--studio-thumbnail-height);
}

/* Only selected canvases occupy two spaces */
.studio .grid>.work-card[data-grid-span="2"] {
  grid-column: span 2;
}

.studio .grid>.work-card[data-grid-span="2"] .card-image {
  height: auto;
}

.studio .grid>.work-card[data-grid-span="2"] .card-image img {
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}


/* =========================================================
   IN SPACE COLUMN LAYOUT
   ========================================================= */

/* Three columns by default */
main.space {
  --space-columns: 3;
}

main.space .grid {
  grid-template-columns:
    repeat(var(--space-columns), minmax(0, 1fr));
}

/* Suspended page: two columns */
main.space:has(.filters a[href="space-suspended.html"][aria-current="page"]) {
  --space-columns: 2;
}


/* =========================================================
   INDIVIDUAL PROJECT PAGES
   ========================================================= */

/* Titles use the entire heading container */
main.project .project-heading {
  display: block;
}

main.project .project-heading h1 {
  width: 100%;
  max-width: none;
}

/* Preserve paragraph breaks entered as \n\n in JSON */
.project .description>p:last-child {
  white-space: pre-line;
}


/* =========================================================
   PROJECT PHOTOGRAPH SLIDER
   ========================================================= */

.project-slider {
  min-width: 0;
}

.project-track {
  display: flex;
  gap: var(--project-gallery-gap);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 0;
  padding-bottom: 18px;
}

.project .project-track figure {
  flex: 0 0 auto;
  width: max-content;
  max-width: none;
  margin: 0;
  scroll-snap-align: start;
}

.project .project-track .photo-button {
  display: block;
  width: auto;
}

.project .project-track .photo-button img {
  display: block;
  height: var(--project-gallery-height);
  width: auto;
  max-width: none;
  max-height: none;
  object-fit: contain;
}

.project-track figcaption {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.slider-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 18px;
  font-size: var(--small-size);
}

.slider-controls>div {
  display: flex;
  gap: 10px;
}

.slider-controls button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 22px;
  cursor: pointer;
}

.slider-controls button:disabled {
  opacity: 0.3;
  cursor: default;
}


/* =========================================================
   SERIES EXHIBITION SLIDER
   ========================================================= */

.exhibition-views {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 60px 0;
}

.exhibition-views h2 {
  margin-bottom: 10px;
}

.exhibition-scroll-hint {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: var(--small-size);
}

.exhibition-views-track {
  display: flex;
  gap: var(--exhibition-gallery-gap);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 18px;
}

.exhibition-views-track figure {
  flex: 0 0 auto;
  width: max-content;
  margin: 0;
  scroll-snap-align: start;
}

.exhibition-views-track img {
  display: block;
  height: var(--exhibition-gallery-height);
  width: auto;
  max-width: none;
}


/* =========================================================
   KEYBOARD FOCUS
   ========================================================= */

.project-track:focus-visible,
.exhibition-views-track:focus-visible,
.slider-controls button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}


/* =========================================================
   RESPONSIVE SETTINGS
   ========================================================= */

@media (max-width: 1050px) {
  :root {
    --studio-thumbnail-height: 290px;
  }
}

@media (max-width: 800px) {
  :root {
    --reading-size: 1.0625rem;

    --gallery-gap-x: 20px;
    --gallery-gap-y: 40px;
    --studio-gap-x: 20px;
    --studio-thumbnail-height: 280px;

    --hero-logo-size: 1.5625rem;

    --project-gallery-height: 50svh;
    --project-gallery-gap: 15px;

    --exhibition-gallery-height: 45vh;
    --exhibition-gallery-gap: 15px;
  }

  header {
    height: var(--mobile-header-height);
  }

  header nav {
    top: var(--mobile-header-height);
    max-height: calc(100svh - var(--mobile-header-height));
    font-size: 1.125rem;
  }

  .dropdown {
    font-size: var(--ui-size);
  }

  .story-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
  }

  .story-layout .story-portrait {
    max-width: 400px;
  }

  :is(.studio, .walls, .space) .page-heading .intro {
    margin-left: 0;
  }

  main.space {
    --space-columns: 2;
  }
}

@media (max-width: 500px) {
  :root {
    --page-title-size: 2.875rem;
    --statement-size: 2.125rem;

    --gallery-gap-y: 35px;
    --studio-gap-x: 15px;
    --studio-thumbnail-height: 220px;
  }

  .studio .grid>.work-card[data-grid-span="2"] {
    grid-column: 1 / -1;
  }

  /* All Space galleries: one column on phones */
  main.space {
    --space-columns: 1 !important;
  }

  .studio .grid>.work-card[data-grid-span="2"] {
    grid-column: 1 / -1;
  }
}

.project-video {
  width: min(100%, 960px);
  min-width: 0;
  margin: 0 auto 32px;
}

.project-video video {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

/* Crossover is a single gallery, so it doesn't need category filters. */
main.crossover .filters {
  display: none;
}