/* Works page only: the five available paintings, the in-page index, and the
   Automotive Edition special section on the black ground of the circles. */

.works-index {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  margin-top: 36px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.works-index a {
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  color: var(--ink);
  text-decoration: none;
}

.works-index a:hover,
.works-index a:focus-visible { border-color: var(--ink); }

.works-index small {
  margin-left: 10px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.works-grid.available-five { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.edition-special {
  background: var(--black);
  color: var(--paper);
  scroll-margin-top: 90px;
}

.edition-stage {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: end;
  min-height: clamp(480px, 60vw, 740px);
  overflow: hidden;
}

.edition-film,
.edition-stage::after {
  position: absolute;
  inset: 0;
}

.edition-film {
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--black);
}

.edition-stage::after {
  content: "";
  z-index: -1;
  background:
    linear-gradient(to top, rgba(5, 5, 5, 0.96) 0%, rgba(5, 5, 5, 0.78) 36%, rgba(5, 5, 5, 0.2) 74%, rgba(5, 5, 5, 0.4) 100%),
    linear-gradient(to right, rgba(5, 5, 5, 0.6) 0%, rgba(5, 5, 5, 0) 62%);
}

.edition-stage-copy {
  max-width: 820px;
  padding: clamp(120px, 14vw, 220px) var(--pad) clamp(44px, 5vw, 76px);
}

.edition-label {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c9c4bc;
}

.edition-special h2 {
  margin: 20px 0 16px;
  font-family: var(--serif);
  font-size: clamp(54px, 7.4vw, 112px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.edition-note {
  margin: 0 0 26px;
  font-family: var(--serif);
  font-size: clamp(19px, 1.9vw, 25px);
  line-height: 1.3;
}

.edition-copy {
  max-width: 54ch;
  font-size: 15px;
  line-height: 1.7;
  color: #d9d4cc;
}

.edition-copy p { margin: 0 0 16px; }
.edition-copy a { color: var(--paper); }

.edition-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 32px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.edition-links a {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  border-bottom: 1px solid #625d55;
  font-size: 13px;
  color: var(--paper);
  text-decoration: none;
}

.edition-links a:hover,
.edition-links a:focus-visible { border-color: var(--paper); }

.edition-film-toggle {
  position: absolute;
  right: var(--pad);
  top: clamp(24px, 3vw, 40px);
  z-index: 1;
  min-height: 36px;
  padding: 6px 16px;
  border: 1px solid rgba(242, 238, 232, 0.45);
  border-radius: 999px;
  background: rgba(5, 5, 5, 0.55);
  color: var(--paper);
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.edition-film-toggle:hover { border-color: var(--paper); }

.edition-special a:focus-visible,
.edition-film-toggle:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: 4px;
}

.edition-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(36px, 4.5vw, 72px) clamp(20px, 3vw, 52px);
  margin: 0;
  padding: clamp(36px, 4vw, 64px) var(--pad) clamp(80px, 10vw, 150px);
  list-style: none;
}

.edition-work a {
  display: grid;
  gap: 14px;
  color: var(--paper);
  text-decoration: none;
}

.edition-work img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  transition: transform 0.5s ease;
}

.edition-work a:hover img,
.edition-work a:focus-visible img { transform: scale(1.035); }

.edition-work span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #36322d;
  font-family: var(--serif);
  font-size: clamp(18px, 1.7vw, 23px);
}

.edition-work small {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #b7b1a8;
}

@media (max-width: 1000px) {
  .works-grid.available-five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .edition-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .edition-work span {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .edition-grid .edition-work:last-child {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc(50% - 10px);
  }
}

@media (max-width: 460px) {
  .works-grid.available-five { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .edition-work img { transition: none; }
}

/* Six available paintings (30 Sept 2026): the featured work spans two by two, and the
   other five fill a three-column grid without an orphan. Below 1000px every tile is equal. */
.works-grid.available-six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) {
  .works-grid.available-six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .works-grid.available-six .featured-work { grid-column: span 1; grid-row: span 1; }
}
@media (max-width: 460px) {
  .works-grid.available-six { grid-template-columns: 1fr; }
}
