/* Artwork detail page, New layout. Loaded only on artworks that choose it.
   Keeps the site's restrained look: black headings, white page, burgundy buttons. */

.av2 {
  background: var(--paper);
  color: var(--black);
  padding: 11rem 0 6rem;
}

.av2-wrap {
  width: min(118rem, 100% - 2 * var(--page-gutter));
  margin: 0 auto;
}

.av2 a {
  color: inherit;
}
.av2 h1,
.av2 h2,
.av2 h3 {
  color: var(--black);
  letter-spacing: 0;
}

.av2-crumbs {
  margin-bottom: 2.4rem;
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.av2-crumbs a {
  text-decoration: none;
}
.av2-crumbs a:hover {
  color: var(--red);
}

/* 1. Short artist introduction */
.av2-intro {
  max-width: 78rem;
  margin-bottom: 4rem;
  padding-bottom: 2.4rem;
  border-bottom: 1px solid var(--line);
}
.av2-intro-text {
  margin: 0;
  font-size: 1.7rem;
  line-height: 1.55;
}
.av2-intro-links {
  margin: 0.9rem 0 0;
  font-size: 1.3rem;
  line-height: 1.4;
  color: var(--red);
}
.av2-intro-links a {
  color: var(--red);
  text-decoration: none;
}
.av2-intro-links a:hover {
  text-decoration: underline;
}
.av2-sep {
  margin: 0 0.9rem;
  color: var(--red);
}

/* 2. Artwork and purchase panel */
.av2-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(30rem, 0.75fr);
  gap: clamp(4rem, 6vw, 9rem);
  align-items: start;
}

.av2-media {
  min-width: 0;
}

.av2-image-button {
  display: flex;
  width: 100%;
  min-height: 40rem;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  border: 0;
  background: var(--soft);
  cursor: zoom-in;
}

/* The whole painting, never cropped. */
.av2-image-button img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 78vh;
  object-fit: contain;
}

.av2-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.4rem 0 0;
  padding: 0;
  list-style: none;
}
.av2-thumbs button {
  width: 8rem;
  height: 8rem;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--soft);
  cursor: pointer;
}
.av2-thumbs button.is-current,
.av2-thumbs button:hover {
  border-color: var(--black);
}
.av2-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.av2-panel {
  position: sticky;
  top: 10rem;
  min-width: 0;
}
.av2-artist {
  margin: 0 0 0.8rem;
  font-size: 1.3rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.av2-panel h1 {
  margin: 0 0 2.4rem;
  font-size: clamp(2.6rem, 3.2vw, 4rem);
  line-height: 1.12;
  font-weight: 400;
}

.av2-facts {
  margin: 0 0 2.4rem;
  padding: 0;
  border-top: 1px solid var(--line);
}
.av2-facts > div {
  display: grid;
  grid-template-columns: 12rem 1fr;
  gap: 1.2rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}
.av2-facts dt {
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5d5d5a;
}
.av2-facts dd {
  margin: 0;
}

.av2-price {
  margin: 0 0 2.4rem;
  font-size: 2.8rem;
  line-height: 1.1;
}
.av2-price span {
  margin-left: 0.8rem;
  font-size: 1.2rem;
  letter-spacing: 0.1em;
  color: #5d5d5a;
}

.av2-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}
a.button.av2-buy {
    color: #fff;
    font-weight: 600;
    Width: 100%;
}
a.button.wc-forward {
    color: #fff;
}
.av2-actions .button {
  min-width: 20rem;
  min-height: 4.6rem;
  margin: 0;
  text-decoration: none;
}
.av2-buy {
  font-weight: 500;
}
.av2-cart {
  flex-basis: auto;
}
.av2-cart .button {
  background: transparent;
  color: var(--red);
}
.av2-sold {
  flex-basis: 100%;
  margin: 0;
}
.av2-tools {
  margin: 2rem 0 0;
}
.av2-linkbutton {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.av2-linkbutton:hover {
  color: var(--red);
}

/* Jump bar: full width, between the artwork and section 3 */
.av2-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 2.2rem;
  margin-top: 6rem;
  padding: 1.8rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 1.6rem;
  font-weight: 600;
}
.av2-jump a {
  text-decoration: none;
}
.av2-jump a:hover {
  color: var(--red);
}
/* Sections 3 to 8 */
.av2-section {
  margin-top: 0;
  padding-top: 3.2rem;
  scroll-margin-top: 9rem;
}
.av2-jump + .av2-section {
  padding-top: 3.2rem;
}
.av2-section + .av2-section {
  margin-top: 3.6rem;
  border-top: 1px solid var(--line);
  padding-top: 3.2rem;
}
.av2-section h2 {
  margin: 0 0 2rem;
  font-size: clamp(2rem, 2vw, 2.4rem);
  font-weight: 600;
}
.av2-section h3 {
  margin: 2.4rem 0 1rem;
  font-size: 1.8rem;
  font-weight: 500;
}
.av2-text {
  max-width: 78rem;
  font-size: 1.7rem;
  line-height: 1.65;
}
.av2-text p {
  margin: 0 0 1.4rem;
}
.av2-text h3:first-child {
  margin-top: 0;
}

.av2-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 2.4rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 1.4rem;
}
.av2-links a {
  color: var(--red);
}

.av2-meta {
  margin: 0 0 0.6rem;
  font-size: 1.35rem;
  color: #5d5d5a;
}
.av2-note {
  max-width: 78rem;
  margin: 2.4rem 0 0;
  font-size: 1.3rem;
  color: #5d5d5a;
}

/* 5. Photographs */
.av2-photos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3rem;
}
.av2-photos-1 {
  grid-template-columns: minmax(0, 60rem);
}
.av2-photos-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.av2-photos figure {
  margin: 0;
}
.av2-photos img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 56rem;
  object-fit: contain;
  background: var(--soft);
}
.av2-photos figcaption {
  display: grid;
  gap: 0.5rem;
  margin-top: 1.2rem;
  font-size: 1.4rem;
  line-height: 1.45;
}
.av2-photos figcaption em {
  color: #5d5d5a;
}
.av2-photos figcaption small {
  font-size: 1.2rem;
  color: #5d5d5a;
}

/* 6. Film */
.av2-film {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 4rem;
  align-items: start;
}
.av2-player {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: #111;
  overflow: hidden;
}
.av2-player img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.av2-player iframe,
.av2-player video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}
.av2-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7rem;
  height: 7rem;
  margin: -3.5rem 0 0 -3.5rem;
  border-radius: 50%;
  background: var(--red);
}
.av2-play::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 52%;
  margin: -1.3rem 0 0 -0.9rem;
  border-style: solid;
  border-width: 1.3rem 0 1.3rem 2.2rem;
  border-color: transparent transparent transparent #fff;
}
.av2-player:hover .av2-play {
  filter: brightness(0.9);
}
.av2-film-copy h3 {
  margin-top: 0;
}
.av2-transcript {
  margin-top: 1.6rem;
  font-size: 1.4rem;
  line-height: 1.6;
}
.av2-transcript summary {
  cursor: pointer;
  text-decoration: underline;
}

/* 7. Sales */
.av2-sales {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.av2-sales li {
  padding: 2rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 1.5rem;
  line-height: 1.5;
}
.av2-sales p {
  margin: 0 0 0.6rem;
}
.av2-sale-work {
  font-size: 1.7rem;
}
.av2-result strong {
  font-weight: 500;
  font-size: 1.8rem;
}
.av2-result span {
  margin-left: 0.8rem;
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #5d5d5a;
}
.av2-sales a {
  color: var(--red);
}

/* 8. Related and sources */
.av2-related {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.av2-related a {
  display: block;
  text-decoration: none;
}
.av2-related img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: var(--soft);
}
.av2-related span {
  display: block;
  margin-top: 1rem;
  font-size: 1.5rem;
}
.av2-related small {
  display: block;
  margin-top: 0.3rem;
  font-size: 1.3rem;
  color: #5d5d5a;
}
.av2-related a:hover span {
  color: var(--red);
}
.av2-routes {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 3rem;
  margin: 3rem 0 0;
}
.av2-routes a {
  color: var(--red);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
.av2-sources {
  margin-top: 4rem;
  font-size: 1.4rem;
}
.av2-sources h3 {
  margin-top: 0;
  font-size: 1.3rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.av2-sources ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2.4rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}
.av2-sources a {
  color: var(--red);
}

.av2-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 7rem;
  padding-top: 2.4rem;
  border-top: 1px solid var(--line);
  font-size: 1.4rem;
}
.av2-pager a {
  text-decoration: none;
}
.av2-pager a:hover {
  color: var(--red);
}

@media (max-width: 1100px) {
  .av2-related {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .av2-sales {
    grid-template-columns: 1fr;
  }
}

/* Mobile: image above the purchase panel, then sections in order. */
@media (max-width: 760px) {
  .av2-cart {
    width: 100%;
}    
  .av2 {
    padding: 8rem 0 5rem;
  }
  .av2-wrap {
    width: calc(100% - 4rem);
  }
  .av2-hero {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .av2-panel {
    position: static;
  }
  .av2-image-button {
    min-height: 28rem;
    padding: 1.2rem;
  }
  .av2-actions .button {
    flex: 1 1 100%;
    width: 100%;
  }
  .av2-facts > div {
    grid-template-columns: 10rem 1fr;
  }
  .av2-jump {
    margin-top: 4rem;
    font-size: 1.5rem;
  }
  .av2-section + .av2-section {
    margin-top: 2.8rem;
  }
  .av2-photos,
  .av2-photos-2,
  .av2-photos-1 {
    grid-template-columns: 1fr;
  }
  .av2-film {
    grid-template-columns: 1fr;
    gap: 2.4rem;
  }
  .av2-related {
    gap: 2rem;
  }
}

/* View on a wall: width above the painting, height beside it (positions set by artwork-v2.js) */
.av2-dims {
  display: none;
}
.catalogue-image-modal.is-wall.has-dims .av2-dims {
  display: block;
}
.av2-dim {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  color: #1c1b1a;
}
.av2-dim::before,
.av2-dim::after {
  content: "";
  position: absolute;
  background: currentColor;
}
.av2-dim b {
  position: absolute;
  padding: 0.3rem 1.1rem;
  background: #eee;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.av2-dim-w {
  height: 0;
  border-top: 2px solid currentColor;
}
.av2-dim-w::before,
.av2-dim-w::after {
  top: -8px;
  width: 2px;
  height: 14px;
}
.av2-dim-w::before {
  left: 0;
}
.av2-dim-w::after {
  right: 0;
}
.av2-dim-w b {
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
}

.av2-dim-h {
  width: 0;
  border-left: 2px solid currentColor;
}
.av2-dim-h::before,
.av2-dim-h::after {
  left: -8px;
  width: 14px;
  height: 2px;
}
.av2-dim-h::before {
  top: 0;
}
.av2-dim-h::after {
  bottom: 0;
}
.av2-dim-h b {
  top: 50%;
  left: 0;
  padding: 1.1rem 0.3rem;
  writing-mode: vertical-rl;
  transform: translate(-50%, -50%) rotate(180deg);
}

@media (max-width: 760px) {
  .av2-dim b {
    font-size: 1.4rem;
  }
}
