/* siskodotter.com — public site
   "The studio wall": the paintings are the only colour; the interface is Payne's grey on gesso.
   Breakpoints: mobile < 760px · tablet 760–1099px · desktop ≥ 1100px. */

/* ------------------------------------------------------------------------------------------
   Fonts */

@font-face {
  font-family: 'Castoro';
  src: url('/static/fonts/castoro-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Castoro';
  src: url('/static/fonts/castoro-latin-400-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'Schibsted Grotesk';
  src: url('/static/fonts/schibsted-grotesk-latin-wght-normal.woff2') format('woff2');
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

/* ------------------------------------------------------------------------------------------
   Tokens */

:root {
  color-scheme: light;

  --gesso: #f3f3ef;
  --paynes: #23272c;
  --graphite: #5f6368;
  --pencil: #d5d5ce;
  --sheet: #ffffff;

  --serif: 'Castoro', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: 'Schibsted Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --fs-13: 0.8125rem;
  --fs-15: 0.9375rem;
  --fs-18: 1.125rem;
  --fs-21: 1.3125rem;
  --fs-28: 1.75rem;
  --fs-36: 2.25rem;
  --fs-48: 3rem;
  --fs-64: 4rem;

  --gutter: clamp(20px, 4vw, 64px);
  --gap: clamp(16px, 2vw, 32px);
  --measure: 68ch;
  --header-h: 72px;
  --max: 1760px;
  --ease: cubic-bezier(0.25, 0.6, 0.2, 1);
}

/* ------------------------------------------------------------------------------------------
   Base */

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

html {
  background: var(--gesso);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--gesso);
  color: var(--paynes);
  font-family: var(--serif);
  font-size: var(--fs-18);
  font-weight: 400;
  line-height: 1.6;
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
}

h1,
h2,
h3,
p,
figure,
dl,
dd {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 400;
  line-height: 1.15;
  text-wrap: balance;
}

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

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

strong {
  font-weight: 700;
}

:focus-visible {
  outline: 2px solid var(--paynes);
  outline-offset: 3px;
}

:focus:not(:focus-visible) {
  outline: none;
}

.site-main:focus {
  outline: none;
}

::selection {
  background: var(--paynes);
  color: var(--gesso);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 12px;
  left: var(--gutter);
  z-index: 100;
  padding: 10px 16px;
  background: var(--paynes);
  color: var(--gesso);
  font-family: var(--sans);
  font-size: var(--fs-15);
  line-height: 1.2;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* ------------------------------------------------------------------------------------------
   Shell */

.shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.site-main {
  flex: 1 0 auto;
  padding-block: clamp(24px, 4vw, 64px) clamp(96px, 12vw, 192px);
}

/* Text */

.prose {
  max-width: var(--measure);
  text-wrap: pretty;
  overflow-wrap: break-word;
}

.prose p + p {
  margin-top: 1em;
}

.prose--lead {
  font-size: var(--fs-21);
  line-height: 1.55;
}

.page-title {
  font-size: clamp(var(--fs-36), 1.6rem + 1.6vw, var(--fs-48));
  line-height: 1.1;
  letter-spacing: -0.005em;
  margin-bottom: clamp(40px, 6vw, 88px);
  overflow-wrap: break-word;
  hyphens: auto;
}

/* ------------------------------------------------------------------------------------------
   Header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding-block: clamp(20px, 2.6vw, 40px);
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  font-size: inherit;
  line-height: 0;
}

.brand__link {
  display: inline-block;
}

.wordmark {
  display: block;
  width: auto;
  height: 34px;
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0 clamp(16px, 1.9vw, 32px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav__link {
  display: inline-block;
  padding-block: 6px;
  font-size: var(--fs-21);
  line-height: 1.3;
  text-decoration: none;
}

.site-nav__link:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.site-nav__link[aria-current] {
  font-style: italic;
}

.site-nav__item--lang {
  margin-left: clamp(4px, 1vw, 16px);
}

.site-nav__link--lang {
  color: var(--graphite);
  font-size: var(--fs-18);
}

.menu-toggle,
.site-nav__close-nojs {
  display: none;
}

@media (min-width: 760px) and (max-width: 1099.98px) {
  .site-header {
    column-gap: 20px;
  }

  .wordmark {
    height: 27px;
  }

  .site-nav__list {
    column-gap: clamp(12px, 1.5vw, 16px);
  }

  .site-nav__item--lang {
    margin-left: 4px;
  }

  .site-nav__link {
    font-size: var(--fs-18);
  }

  .site-nav__link--lang {
    font-size: var(--fs-15);
  }
}

@media (max-width: 759.98px) {
  .site-header {
    display: block;
    min-height: var(--header-h);
    padding-block: 0;
  }

  .site-header__bar {
    height: var(--header-h);
  }

  .wordmark {
    height: 26px;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-right: -8px;
    padding: 8px;
    border: 0;
    background: none;
    color: var(--paynes);
    font-family: var(--serif);
    font-size: var(--fs-21);
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
  }

  .menu-toggle[hidden] {
    display: none;
  }

  .site-nav {
    display: none;
  }

  html:not(.js) .site-nav:target,
  .menu-open .site-nav {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    padding: calc(var(--header-h) + clamp(24px, 8vh, 64px)) var(--gutter) 40px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--gesso);
    animation: fade-in 200ms var(--ease);
  }

  .site-nav__list {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .site-nav__link {
    padding-block: 4px;
    font-size: var(--fs-36);
    line-height: 1.2;
  }

  .site-nav__item--lang {
    margin: 28px 0 0;
  }

  .site-nav__link--lang {
    font-size: var(--fs-21);
  }

  html:not(.js) .site-nav:target .site-nav__close-nojs {
    position: absolute;
    top: 0;
    right: var(--gutter);
    display: flex;
    align-items: center;
    height: var(--header-h);
    font-size: var(--fs-21);
    text-decoration: none;
  }

  .menu-open {
    overflow: hidden;
  }

  .menu-open .site-header__bar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 50;
    padding-inline: var(--gutter);
    background: var(--gesso);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

/* ------------------------------------------------------------------------------------------
   Footer */

.site-footer {
  border-top: 1px solid var(--pencil);
  padding-block: 24px 36px;
  color: var(--graphite);
  font-family: var(--sans);
  font-size: var(--fs-15);
  line-height: 1.5;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 32px;
}

.site-footer__social {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer a {
  display: inline-block;
  padding-block: 4px;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--paynes);
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.site-footer__lang {
  margin-left: auto;
}

/* ------------------------------------------------------------------------------------------
   Frames: exact aspect ratio, the painting's average colour until the image has decoded */

.frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: var(--ar, 0.8);
  overflow: hidden;
  background-color: var(--c, var(--pencil));
}

.frame__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.frame--empty {
  background: transparent;
  border: 1px solid var(--pencil);
}

.frame__empty-label {
  position: absolute;
  inset: auto 16px 14px;
  color: var(--graphite);
  font-family: var(--sans);
  font-size: var(--fs-13);
  line-height: 1.4;
}

/* The one orchestrated moment: works fade in once decoded (site.js adds .is-loaded). */
.js .work .frame__img {
  opacity: 0;
  transition: opacity 400ms var(--ease);
}

.js .work .frame__img.is-loaded {
  opacity: 1;
}

/* A work with its wall label */

.work {
  position: relative;
  width: min(100%, calc(78vh * var(--ar, 0.8)));
}

@supports (height: 1svh) {
  .work {
    width: min(100%, calc(78svh * var(--ar, 0.8)));
  }
}

.work__link {
  display: block;
}

/* The whole work, label included, is one click target; the link itself keeps the focus ring. */
.work__link::after {
  content: '';
  position: absolute;
  inset: 0;
}

.label {
  margin-top: 12px;
}

.label__title {
  font-size: var(--fs-18);
  font-style: italic;
  line-height: 1.35;
}

.label__meta {
  margin-top: 2px;
  color: var(--graphite);
  font-family: var(--sans);
  font-size: var(--fs-13);
  line-height: 1.45;
}

.work:hover .label__title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

/* ------------------------------------------------------------------------------------------
   Home */

.statement {
  padding-block: clamp(20px, 4.5vw, 80px) clamp(56px, 7vw, 120px);
}

.statement--none {
  padding-block: clamp(8px, 2vw, 24px) 0;
}

.statement__text {
  max-width: 22ch;
  font-size: clamp(var(--fs-36), 5vw, var(--fs-64));
  line-height: 1.1;
  letter-spacing: -0.012em;
  text-wrap: balance;
  overflow-wrap: break-word;
  hyphens: auto;
}

.statement__text p + p {
  margin-top: 0.45em;
}

.statement__text a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
}

/* The collage wall ------------------------------------------------------------------------ */

.wall {
  display: flex;
  flex-direction: column;
  gap: clamp(44px, 13vw, 72px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.wall__item {
  min-width: 0;
}

/* Mobile: one column, still asymmetric */
@media (max-width: 759.98px) {
  .wall__item--m1 {
    width: 88%;
  }

  .wall__item--m2 {
    width: 72%;
    margin-left: auto;
  }

  .wall__item--m3 {
    width: 100%;
  }

  .wall__item--m4 {
    width: 80%;
    margin-left: 12%;
  }

  .wall__item--m2 + .wall__item--m3,
  .wall__item--m4 + .wall__item--m1 {
    margin-top: 16px;
  }
}

@media (min-width: 760px) {
  .wall {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: start;
    column-gap: var(--gap);
    row-gap: clamp(64px, 9vw, 104px);
  }
}

/* Tablet: 6 columns */
@media (min-width: 760px) and (max-width: 1099.98px) {
  .wall__item--tc1 { grid-column-start: 1; }
  .wall__item--tc2 { grid-column-start: 2; }
  .wall__item--tc3 { grid-column-start: 3; }
  .wall__item--tc4 { grid-column-start: 4; }
  .wall__item--tc5 { grid-column-start: 5; }
  .wall__item--tc6 { grid-column-start: 6; }

  .wall__item--ts1 { grid-column-end: span 1; }
  .wall__item--ts2 { grid-column-end: span 2; }
  .wall__item--ts3 { grid-column-end: span 3; }
  .wall__item--ts4 { grid-column-end: span 4; }
  .wall__item--ts5 { grid-column-end: span 5; }
  .wall__item--ts6 { grid-column-end: span 6; }

  .wall__item--to1 { margin-top: 5vw; }
  .wall__item--to2 { margin-top: 10vw; }
  .wall__item--to3 { margin-top: 14vw; }
}

/* Desktop: 12 columns */
@media (min-width: 1100px) {
  .wall {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    row-gap: clamp(88px, 8vw, 152px);
  }

  .wall__item--dc1 { grid-column-start: 1; }
  .wall__item--dc2 { grid-column-start: 2; }
  .wall__item--dc3 { grid-column-start: 3; }
  .wall__item--dc4 { grid-column-start: 4; }
  .wall__item--dc5 { grid-column-start: 5; }
  .wall__item--dc6 { grid-column-start: 6; }
  .wall__item--dc7 { grid-column-start: 7; }
  .wall__item--dc8 { grid-column-start: 8; }
  .wall__item--dc9 { grid-column-start: 9; }
  .wall__item--dc10 { grid-column-start: 10; }
  .wall__item--dc11 { grid-column-start: 11; }
  .wall__item--dc12 { grid-column-start: 12; }

  .wall__item--ds1 { grid-column-end: span 1; }
  .wall__item--ds2 { grid-column-end: span 2; }
  .wall__item--ds3 { grid-column-end: span 3; }
  .wall__item--ds4 { grid-column-end: span 4; }
  .wall__item--ds5 { grid-column-end: span 5; }
  .wall__item--ds6 { grid-column-end: span 6; }
  .wall__item--ds7 { grid-column-end: span 7; }
  .wall__item--ds8 { grid-column-end: span 8; }
  .wall__item--ds9 { grid-column-end: span 9; }
  .wall__item--ds10 { grid-column-end: span 10; }
  .wall__item--ds11 { grid-column-end: span 11; }
  .wall__item--ds12 { grid-column-end: span 12; }

  .wall__item--do1 { margin-top: min(4vw, 72px); }
  .wall__item--do2 { margin-top: min(8vw, 140px); }
  .wall__item--do3 { margin-top: min(12vw, 210px); }
}

.wall-section__more {
  margin-top: clamp(64px, 8vw, 128px);
  font-size: var(--fs-21);
}

/* An empty wall still looks hung */

.wall-empty__frames {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
  column-gap: var(--gap);
}

.wall-empty__frame {
  display: block;
  border: 1px solid var(--pencil);
}

.wall-empty__frame--1 {
  grid-column: 1 / span 7;
  aspect-ratio: 4 / 5;
}

.wall-empty__frame--2 {
  grid-column: 9 / span 4;
  margin-top: 18vw;
  aspect-ratio: 1;
}

.wall-empty__frame--3 {
  display: none;
}

.wall-empty__text {
  max-width: 34ch;
  margin-top: 28px;
  font-size: var(--fs-21);
  line-height: 1.45;
}

@media (min-width: 760px) {
  .wall-empty__frame--1 {
    grid-column: 1 / span 4;
  }

  .wall-empty__frame--2 {
    grid-column: 6 / span 3;
    margin-top: 10vw;
  }

  .wall-empty__frame--3 {
    display: block;
    grid-column: 10 / span 3;
    margin-top: 4vw;
    aspect-ratio: 3 / 4;
  }
}

/* Book teaser */

.teaser {
  display: grid;
  gap: 24px var(--gap);
  margin-top: clamp(96px, 12vw, 192px);
  padding-top: clamp(40px, 5vw, 64px);
  border-top: 1px solid var(--pencil);
}

.teaser__cover {
  width: 42%;
  max-width: 200px;
}

.teaser__title {
  font-size: var(--fs-28);
  line-height: 1.2;
}

.teaser__title a {
  text-decoration: none;
}

.teaser__title a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.teaser__subtitle {
  margin-top: 4px;
  color: var(--graphite);
  font-style: italic;
}

.teaser__sentence {
  max-width: 52ch;
  margin-top: 14px;
}

.teaser__more {
  margin-top: 14px;
}

@media (min-width: 760px) {
  .teaser {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: end;
  }

  .teaser__cover {
    grid-column: 1 / span 2;
    width: auto;
    max-width: none;
  }

  .teaser__text {
    grid-column: 3 / span 4;
  }
}

@media (min-width: 1100px) {
  .teaser {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .teaser__cover {
    grid-column: 1 / span 2;
  }

  .teaser__text {
    grid-column: 3 / span 6;
  }
}

/* ------------------------------------------------------------------------------------------
   Paintings index */

.year {
  display: grid;
  gap: 20px var(--gap);
}

.year + .year {
  margin-top: clamp(64px, 9vw, 144px);
}

.year__heading {
  font-size: var(--fs-28);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.works {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 48px var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.works .work {
  width: min(100%, calc(64vh * var(--ar, 0.8)));
}

@supports (height: 1svh) {
  .works .work {
    width: min(100%, calc(64svh * var(--ar, 0.8)));
  }
}

@media (max-width: 759.98px) {
  .works .work {
    max-width: 88%;
  }

  .works__item:nth-child(2n) .work {
    margin-left: auto;
  }
}

@media (min-width: 760px) {
  .works {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: clamp(56px, 6vw, 96px);
  }

  .works__item:nth-child(2n) {
    margin-top: clamp(40px, 7vw, 88px);
  }
}

@media (min-width: 1100px) {
  .year {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .year__heading {
    position: sticky;
    top: 24px;
    grid-column: 1 / span 2;
    align-self: start;
  }

  .works {
    grid-column: 3 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .works__item:nth-child(2n) {
    margin-top: 0;
  }

  .works__item:nth-child(3n + 2) {
    margin-top: clamp(48px, 5vw, 96px);
  }
}

/* ------------------------------------------------------------------------------------------
   Painting detail */

.artwork {
  display: grid;
  gap: 32px var(--gap);
  align-items: start;
}

.artwork__media {
  min-width: 0;
}

.artwork__zoom {
  display: block;
  width: min(100%, calc(88vh * var(--ar, 0.8)));
  cursor: zoom-in;
}

@supports (height: 1svh) {
  .artwork__zoom {
    width: min(100%, calc(88svh * var(--ar, 0.8)));
  }
}

.frame--detail {
  width: 100%;
}

.artwork__media > .frame--empty {
  width: min(100%, 560px);
}

.artwork__img {
  view-transition-name: artwork;
}

.artwork__title {
  font-size: var(--fs-36);
  line-height: 1.12;
  overflow-wrap: break-word;
  hyphens: auto;
}

.facts {
  margin-top: 14px;
  color: var(--graphite);
  font-family: var(--sans);
  font-size: var(--fs-15);
  line-height: 1.55;
}

.facts__row--status {
  margin-top: 10px;
  color: var(--paynes);
}

.artwork__description {
  margin-top: 28px;
}

.artwork__inquiry {
  margin-top: 28px;
  font-size: var(--fs-21);
}

@media (min-width: 1100px) {
  /* The image takes up to 8 of 12 columns (and at most 88vh tall); the narrow text column
     follows it directly, so portraits do not leave a gap between painting and label. */
  .artwork {
    display: flex;
    align-items: flex-start;
    gap: clamp(40px, 4.5vw, 88px);
  }

  .artwork__media {
    flex: 0 1 auto;
    width: min(66.6667%, calc(88vh * var(--ar, 0.8)));
  }

  @supports (height: 1svh) {
    .artwork__media {
      width: min(66.6667%, calc(88svh * var(--ar, 0.8)));
    }
  }

  .artwork__zoom,
  .artwork__media > .frame--empty {
    width: 100%;
  }

  .artwork__text {
    position: sticky;
    top: 32px;
    flex: 0 1 25rem;
    min-width: 17rem;
  }
}

.pager {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: 24px var(--gap);
  margin-top: clamp(72px, 9vw, 144px);
  padding-top: 24px;
  border-top: 1px solid var(--pencil);
}

.pager__slot--all {
  padding-top: 20px;
  text-align: center;
}

.pager__slot--next {
  text-align: right;
}

.pager__link {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
}

.pager__label {
  color: var(--graphite);
  font-family: var(--sans);
  font-size: var(--fs-13);
  line-height: 1.4;
}

.pager__title {
  font-size: var(--fs-21);
  font-style: italic;
  line-height: 1.3;
}

.pager__link:hover .pager__title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

@media (max-width: 759.98px) {
  .pager {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .pager__slot--all {
    order: 3;
    grid-column: 1 / -1;
    padding-top: 0;
    text-align: left;
  }
}

/* Lightbox */

.lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--gesso);
  color: var(--paynes);
}

@supports (height: 1dvh) {
  .lightbox {
    height: 100dvh;
    max-height: 100dvh;
  }
}

.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 200ms var(--ease);
}

.lightbox::backdrop {
  background: var(--gesso);
}

.lightbox__img {
  width: auto;
  max-width: calc(100vw - 2 * var(--gutter));
  height: auto;
  max-height: calc(100% - 2 * var(--header-h));
  cursor: zoom-out;
}

.lightbox__close {
  position: absolute;
  top: 12px;
  right: var(--gutter);
  min-height: 44px;
  padding: 8px;
  margin-right: -8px;
  border: 0;
  background: none;
  color: inherit;
  font-family: var(--serif);
  font-size: var(--fs-21);
  line-height: 1;
  cursor: pointer;
}

html:has(dialog[open]) {
  overflow: hidden;
}

/* ------------------------------------------------------------------------------------------
   Books */

.books__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.book {
  display: grid;
  gap: 28px var(--gap);
  align-items: start;
}

.books__list .book + .book {
  margin-top: clamp(56px, 7vw, 104px);
  padding-top: clamp(56px, 7vw, 104px);
  border-top: 1px solid var(--pencil);
}

.book__cover {
  width: 64%;
}

.book__cover-link,
.teaser__cover-link {
  display: block;
  text-decoration: none;
}

.cover {
  position: relative;
  display: block;
  aspect-ratio: var(--ar, 0.667);
  border: 1px solid var(--pencil);
  background-color: var(--c, var(--sheet));
}

/* A hairline of light along the spine */
.cover::after {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 1px;
  background: var(--sheet);
  opacity: 0.55;
}

.cover__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover--empty {
  display: flex;
  align-items: flex-end;
  aspect-ratio: 2 / 3;
  padding: 18px;
  background: var(--sheet);
}

.cover__title {
  font-size: var(--fs-21);
  font-style: italic;
  line-height: 1.2;
  overflow-wrap: break-word;
}

.book__title {
  font-size: var(--fs-36);
  line-height: 1.12;
  overflow-wrap: break-word;
  hyphens: auto;
}

.book__title a {
  text-decoration: none;
}

.book__title a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

.book__subtitle {
  margin-top: 6px;
  font-size: var(--fs-21);
  font-style: italic;
  line-height: 1.35;
}

.book__facts {
  margin-top: 16px;
  color: var(--graphite);
  font-family: var(--sans);
  font-size: var(--fs-15);
  line-height: 1.55;
}

.book__description {
  margin-top: 24px;
}

.book__more,
.book__buy,
.book__back {
  margin-top: 20px;
}

.book__buy {
  margin-top: 28px;
}

.book--detail .book__title {
  font-size: clamp(var(--fs-36), 1.6rem + 1.6vw, var(--fs-48));
  line-height: 1.08;
}

.book--detail .book__description {
  font-size: var(--fs-21);
  line-height: 1.55;
}

.book--detail .book__back {
  margin-top: clamp(40px, 6vw, 72px);
}

@media (min-width: 760px) {
  .book {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .book__cover {
    grid-column: 1 / span 2;
    width: auto;
  }

  .book__text {
    grid-column: 3 / -1;
  }

  .book--detail .book__cover {
    grid-column: 1 / span 3;
  }

  .book--detail .book__text {
    grid-column: 4 / -1;
  }
}

@media (min-width: 1100px) {
  .book {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .book__cover {
    grid-column: 1 / span 4;
  }

  .book__text {
    grid-column: 6 / span 6;
  }

  .book--detail .book__cover {
    grid-column: 1 / span 5;
  }

  .book--detail .book__text {
    grid-column: 7 / span 6;
  }
}

/* ------------------------------------------------------------------------------------------
   About */

.about {
  display: grid;
  gap: 0 var(--gap);
  align-items: start;
}

.about__portrait {
  width: 84%;
  margin-bottom: 36px;
}

.frame--portrait {
  width: min(100%, calc(80vh * var(--ar, 0.8)));
}

.about__fallback {
  font-size: var(--fs-21);
}

@media (min-width: 760px) {
  .about {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: auto 1fr;
  }

  .about__title,
  .about__body {
    grid-column: 4 / -1;
  }

  .about__portrait {
    grid-column: 1 / span 3;
    grid-row: 1 / span 2;
    width: auto;
    margin-bottom: 0;
  }

  .about--text-only .about__title,
  .about--text-only .about__body {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1100px) {
  .about {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .about__title,
  .about__body {
    grid-column: 7 / span 6;
  }

  .about__portrait {
    grid-column: 1 / span 5;
  }

  .about--text-only .about__title,
  .about--text-only .about__body {
    grid-column: 1 / span 8;
  }
}

/* ------------------------------------------------------------------------------------------
   Exhibitions */

.exhibitions__group + .exhibitions__group {
  margin-top: clamp(72px, 9vw, 144px);
}

.exhibitions__heading {
  padding-bottom: 18px;
  font-size: var(--fs-28);
  line-height: 1.2;
}

.exhibitions__list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--pencil);
}

.exhibition {
  display: grid;
  gap: 6px var(--gap);
  padding-block: 22px 26px;
  border-bottom: 1px solid var(--pencil);
}

.exhibition__dates {
  color: var(--graphite);
  font-family: var(--sans);
  font-size: var(--fs-15);
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.exhibition__now {
  display: block;
  color: var(--paynes);
}

.exhibition__title {
  font-size: var(--fs-21);
  line-height: 1.3;
}

.exhibition__place {
  color: var(--graphite);
}

.exhibition__description {
  margin-top: 8px;
}

.exhibitions__none,
.exhibitions__empty {
  max-width: 44ch;
  padding-block: 22px;
  border-top: 1px solid var(--pencil);
  color: var(--graphite);
}

.exhibitions__empty {
  border-top: 0;
  padding-top: 0;
  color: var(--paynes);
  font-size: var(--fs-21);
}

@media (min-width: 760px) {
  .exhibition {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .exhibition__dates {
    grid-column: 1 / span 2;
    padding-top: 0.2em;
  }

  .exhibition__body {
    grid-column: 3 / -1;
  }
}

@media (min-width: 1100px) {
  .exhibition {
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .exhibition__dates {
    grid-column: 1 / span 3;
  }

  .exhibition__body {
    grid-column: 4 / span 7;
  }

  .exhibition__title {
    font-size: var(--fs-28);
    line-height: 1.2;
  }
}

/* ------------------------------------------------------------------------------------------
   Contact */

.contact__intro {
  margin-bottom: clamp(28px, 4vw, 48px);
}

.contact__email {
  font-size: clamp(var(--fs-28), 0.9rem + 4.6vw, var(--fs-64));
  line-height: 1.1;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.contact__email a {
  text-underline-offset: 0.14em;
}

.contact__details {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px 48px;
  margin-top: clamp(40px, 6vw, 80px);
  font-size: var(--fs-21);
}

.contact__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact__fallback {
  font-size: var(--fs-21);
}

/* ------------------------------------------------------------------------------------------
   Empty states and errors */

.empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

.empty__frame {
  display: block;
  width: min(60vw, 300px);
  aspect-ratio: 4 / 5;
  border: 1px solid var(--pencil);
}

.empty--book .empty__frame {
  width: min(44vw, 200px);
  aspect-ratio: 2 / 3;
}

.empty__text {
  max-width: 36ch;
  font-size: var(--fs-21);
  line-height: 1.45;
}

.error {
  padding-block: clamp(16px, 5vw, 80px) 0;
}

.error__title {
  font-size: clamp(var(--fs-36), 5vw, var(--fs-64));
  line-height: 1.08;
}

.error__text {
  max-width: 44ch;
  margin-top: 18px;
  font-size: var(--fs-21);
  line-height: 1.5;
}

.error__block--secondary {
  margin-top: clamp(56px, 8vw, 112px);
  padding-top: 24px;
  border-top: 1px solid var(--pencil);
  color: var(--graphite);
}

.error__block--secondary .error__title {
  font-size: var(--fs-28);
}

.error__block--secondary .error__text {
  margin-top: 8px;
  font-size: var(--fs-18);
}

/* ------------------------------------------------------------------------------------------
   Motion */

@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 220ms;
}

::view-transition-group(artwork) {
  animation-duration: 420ms;
  animation-timing-function: var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------------------------------------------------
   Print */

@media print {
  .skip-link,
  .site-nav,
  .menu-toggle,
  .pager,
  .lightbox,
  .site-footer__lang {
    display: none !important;
  }

  .js .work .frame__img {
    opacity: 1;
  }
}
