/* Auction artwork galleries, auction index, artist index + profile, and the
   artwork lightbox. High specificity (.x-col/.x-row mirrors) for Cornerstone/Pro
   resets; colours from the shared brand tokens in me-shared.css. */

/* --- Shared grid ------------------------------------------------------- */

.me-auction-index-links,
.x-col .me-auction-index-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.me-auction-index-links a,
.x-col .me-auction-index-links a {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 4px;
  background: var(--me-pink, #BE5B8F);
  color: #fff;
  text-decoration: none;
}

.me-auction-index-links a:hover,
.me-auction-index-links a:focus-visible {
  filter: brightness(0.9);
  text-decoration: underline;
}

.me-artwork-gallery,
.me-auction-index,
.me-artist-index,
.x-col .me-artwork-gallery,
.x-col .me-auction-index,
.x-col .me-artist-index {
  display: block;
  width: 100%;
}

.me-artwork-grid,
.me-auction-index-grid,
.me-artist-grid,
.x-col .me-artwork-grid,
.x-col .me-auction-index-grid,
.x-col .me-artist-grid {
  display: grid;
  grid-template-columns: repeat(var(--me-artwork-cols, 4), minmax(0, 1fr));
  gap: 24px;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* --- Artwork card ------------------------------------------------------ */

.me-artwork-card,
.x-col .me-artwork-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}

.me-artwork-thumb,
.x-col .me-artwork-thumb {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--me-pink-tint, #f7ecf3);
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
}

.me-artwork-thumb img,
.x-col .me-artwork-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.me-artwork-thumb:hover img,
.me-artwork-thumb:focus-visible img {
  transform: scale(1.04);
}

.me-artwork-thumb:focus-visible,
.x-col .me-artwork-thumb:focus-visible {
  outline: 3px solid var(--me-pink-accessible, #8E2F63);
  outline-offset: 2px;
}

.me-artwork-count,
.x-col .me-artwork-count {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-family: "Quicksand", "Poppins", Arial, sans-serif;
  font-weight: 700;
  font-size: 12px;
  line-height: 22px;
  text-align: center;
}

.me-artwork-noimage,
.x-col .me-artwork-noimage {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--me-pink-tint, #f7ecf3);
}

.me-artwork-name,
.x-col .me-artwork-name {
  margin: 0;
  padding: 0;
  color: var(--me-ink, #000000);
  font-family: "Quicksand", "Poppins", Arial, sans-serif;
  /* Upper case and not bold, the same decision as the auction lot cards, so
     the two galleries read as one set. Client decision, 2026-07-31. */
  font-weight: 400;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  line-height: 1.3;
  text-transform: uppercase;
}

.me-artwork-artist,
.x-col .me-artwork-artist {
  margin: 0;
  padding: 0;
  color: var(--me-grey-light, #9D9D9C);
  font-family: "Open Sans", "Poppins", Arial, sans-serif;
  /* Matched to the auction lot cards, where the artist is 15px and the title is
     the same size below it. Client request, 2026-07-31. */
  font-size: 15px;
  line-height: 1.4;
}

.me-artwork-artist a,
.x-col .me-artwork-artist a {
  color: var(--me-ink, #000000);
  text-decoration: none;
}

.me-artwork-artist a:hover,
.x-col .me-artwork-artist a:hover {
  color: var(--me-ink-hover, #6C6C6C);
  text-decoration: underline;
}

/* --- Grid filter controls (search / artist / medium) -------------------
   Deliberately self-contained: this stylesheet loads me-shared.css as a
   dependency for the brand tokens above, but does not reuse its generic
   .me-resource-controls/.me-resource-control rules, so this block keeps
   working even if that shared styling changes. */

.me-artwork-controls,
.x-col .me-artwork-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px 24px;
  width: 100%;
  margin: 0 0 20px;
  padding: 0;
}

.me-artwork-control,
.x-col .me-artwork-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  min-width: 200px;
}

.me-artwork-control:first-child,
.x-col .me-artwork-control:first-child {
  flex: 1 1 280px;
}

.me-artwork-control > span,
.x-col .me-artwork-control > span {
  display: block;
  color: var(--me-ink, #000000);
  font-family: "Quicksand", "Poppins", Arial, sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.2;
}

.me-artwork-control input[type="search"],
.me-artwork-control select,
.x-col .me-artwork-control input[type="search"],
.x-col .me-artwork-control select {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 10px 4px 8px;
  border: 0;
  border-bottom: 2px solid var(--me-grey-light, #9D9D9C);
  border-radius: 0;
  background-color: transparent;
  box-shadow: none;
  color: var(--me-grey, #706F6F);
  font-family: "Open Sans", "Poppins", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  -webkit-appearance: none;
  appearance: none;
}

.me-artwork-control select,
.x-col .me-artwork-control select {
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--me-pink, #BE5B8F) 50%), linear-gradient(135deg, var(--me-pink, #BE5B8F) 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% + 2px), calc(100% - 11px) calc(50% + 2px);
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  padding-right: 28px;
}

.me-artwork-control input[type="search"]:focus,
.me-artwork-control select:focus {
  outline: none;
  border-bottom-color: var(--me-pink, #BE5B8F);
}

.me-artwork-control input[type="search"]:focus-visible,
.me-artwork-control select:focus-visible {
  outline: 2px solid var(--me-pink-accessible, #8E2F63);
  outline-offset: 2px;
}

/* USE-17: the native ::-webkit-search-cancel-button is suppressed by the
   -webkit-appearance:none above, and since v0.15.3 the search box is the only
   filter control there is. me-shared.js injects this button next to the input
   and unhides it whenever the value is non-empty. */

.me-filter-clear,
.x-col .me-filter-clear {
  flex: 0 0 auto;
  margin: 0 0 4px;
  padding: 8px 14px;
  border: 2px solid var(--me-pink-accessible, #8E2F63);
  border-radius: 999px;
  background: transparent;
  color: var(--me-ink, #000000);
  font-family: "Quicksand", "Poppins", Arial, sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
  cursor: pointer;
}

.me-filter-clear:hover,
.x-col .me-filter-clear:hover {
  background: var(--me-grey-tint, #F2F2F2);
  color: var(--me-ink-hover, #6C6C6C);
}

.me-filter-clear[hidden] {
  display: none;
}

.me-artwork-gallery .me-resource-empty-filtered,
.me-artist-index .me-resource-empty-filtered,
.x-col .me-artwork-gallery .me-resource-empty-filtered,
.x-col .me-artist-index .me-resource-empty-filtered {
  margin: 0 0 20px;
  padding: 12px;
  border: 1px dashed var(--me-grey-light, #9D9D9C);
  color: var(--me-grey, #706F6F);
  font-family: "Open Sans", "Poppins", Arial, sans-serif;
}

.me-artwork-card.me-resource-hidden {
  display: none;
}

/* PERF-12: this stylesheet dropped its me-shared.css dependency, and with it the
   generic `.me-resource-hidden { display: none !important }` utility that the
   artists-index filter (FEAT-2) was relying on to hide non-matching cards. The
   artwork rule above already made the gallery self-sufficient; this is its
   missing counterpart for the artists index. Both are scoped to a card class, so
   neither needs !important. */
.me-artist-card.me-resource-hidden {
  display: none;
}

/* --- Load more (FEAT-1) ------------------------------------------------
   A real <a> (it navigates to ?me_all=1 without JavaScript), styled as the
   filled counterpart to the outlined .me-filter-clear pill above. It sits
   outside the <ul>, so an active search never hides it. */

.me-artwork-more,
.x-col .me-artwork-more {
  display: flex;
  justify-content: center;
  margin: 28px 0 0;
  padding: 0;
}

.me-artwork-more-button,
.x-col .me-artwork-more-button {
  display: inline-block;
  padding: 12px 28px;
  border: 2px solid var(--me-pink-accessible, #8E2F63);
  border-radius: 999px;
  background: var(--me-pink-accessible, #8E2F63);
  color: #fff;
  font-family: "Quicksand", "Poppins", Arial, sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

.me-artwork-more-button:hover,
.me-artwork-more-button:focus,
.x-col .me-artwork-more-button:hover,
.x-col .me-artwork-more-button:focus {
  background: transparent;
  color: var(--me-ink-hover, #6C6C6C);
  text-decoration: none;
}

.me-artwork-more-button[aria-busy="true"],
.x-col .me-artwork-more-button[aria-busy="true"] {
  cursor: progress;
  opacity: 0.7;
}

@media (max-width: 600px) {
  .me-artwork-controls,
  .x-col .me-artwork-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .me-artwork-control,
  .x-col .me-artwork-control {
    min-width: 0;
  }

  /* Stacked, the container's main axis is vertical, so the 280px flex-basis
     above would become a 280px *height* — a tall empty gap under the input. */
  .me-artwork-control:first-child,
  .x-col .me-artwork-control:first-child {
    flex: 0 0 auto;
  }

  /* align-items:stretch would run the Clear button the full width of a phone. */
  .me-filter-clear,
  .x-col .me-filter-clear {
    align-self: flex-start;
    margin: 0;
  }
}

/* --- Auction grouping (artist profile: pieces grouped per auction) ----- */

.me-artwork-auction-title,
.x-col .me-artwork-auction-title {
  margin: 0 0 16px;
  padding: 0;
  color: var(--me-ink, #000000);
  font-family: "Quicksand", "Poppins", Arial, sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.2;
}

.me-artwork-auction-title:not(:first-child),
.x-col .me-artwork-auction-title:not(:first-child) {
  margin-top: 32px;
}

/* --- Auction index card ------------------------------------------------ */

.me-auction-card,
.x-col .me-auction-card {
  margin: 0;
  padding: 0;
  list-style: none;
}

.me-auction-card-link,
.x-col .me-auction-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

a.me-auction-card-link:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.me-auction-card-cover,
.x-col .me-auction-card-cover {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--me-pink-tint, #f7ecf3);
  overflow: hidden;
}

.me-auction-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.me-auction-card-body,
.x-col .me-auction-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
}

.me-auction-card-name {
  color: var(--me-grey, #706F6F);
  font-family: "Quicksand", "Poppins", Arial, sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.2;
}

.me-auction-card-subtitle {
  color: var(--me-ink, #000000);
  font-family: "Open Sans", "Poppins", Arial, sans-serif;
  font-size: 14px;
}

.me-auction-card-count {
  color: var(--me-grey-light, #9D9D9C);
  font-family: "Open Sans", "Poppins", Arial, sans-serif;
  font-size: 13px;
}

/* --- Artist index card ------------------------------------------------- */

.me-artist-card,
.x-col .me-artist-card {
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.me-artist-grid,
.x-col .me-artist-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 40px;
  row-gap: 34px;
}

.me-artist-card-link,
.x-col .me-artist-card-link {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  height: 100%;
  gap: 18px;
  border-radius: 6px;
  background: #fff;
  color: var(--me-ink, #000000);
  text-decoration: none;
  overflow: hidden;
}

.me-artist-card-visual,
.x-col .me-artist-card-visual {
  display: flex;
  flex: 0 0 96px;
  align-items: center;
  justify-content: center;
  width: 96px;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  overflow: hidden;
  background: var(--me-pink-tint, #f7ecf3);
}

.me-artist-card-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.me-artist-card-link:hover .me-artist-card-visual img,
.me-artist-card-link:focus-visible .me-artist-card-visual img {
  transform: scale(1.035);
}

.me-artist-card-initials {
  color: var(--me-ink, #000000);
  font-family: "Quicksand", "Poppins", Arial, sans-serif;
  font-weight: 700;
  font-size: 2rem;
}

.me-artist-card-content {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  padding: 1px 0 0;
}

.me-artist-card-name {
  color: var(--me-ink, #000000);
  font-family: "Quicksand", "Poppins", Arial, sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.3;
}

.me-artist-card-meta {
  color: var(--me-grey, #706F6F);
  font-family: "Open Sans", "Poppins", Arial, sans-serif;
  font-weight: 400;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.me-artist-card-bio {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--me-grey, #706F6F);
  font-family: "Open Sans", "Poppins", Arial, sans-serif;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
}

.me-artist-previous-toggle,
.x-col .me-artist-previous-toggle {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  margin: 0 0 1px;
  color: var(--me-ink, #000000);
  font-family: "Open Sans", "Poppins", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
}

.me-artist-previous-filter,
.x-col .me-artist-previous-filter {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--me-pink-accessible, #8E2F63);
}

.me-artist-previous-filter:focus-visible,
.x-col .me-artist-previous-filter:focus-visible {
  outline: 3px solid var(--me-pink-accessible, #8E2F63);
  outline-offset: 3px;
}

/* --- Artist profile ---------------------------------------------------- */

.me-artist-profile,
.x-col .me-artist-profile {
  display: block;
  width: 100%;
}

.me-artist-header,
.x-col .me-artist-header {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: flex-start;
  margin-bottom: 32px;
}

.me-artist-photo {
  flex: 0 0 auto;
  width: 200px;
  max-width: 100%;
  border-radius: 6px;
  overflow: hidden;
}

.me-artist-photo img {
  width: 100%;
  height: auto;
  display: block;
}

.me-artist-intro {
  flex: 1 1 320px;
  min-width: 0;
}

.me-artist-name {
  margin: 0 0 12px;
  color: var(--me-grey, #706F6F);
  font-family: "Quicksand", "Poppins", Arial, sans-serif;
  font-weight: 700;
}

.me-artist-bio {
  color: var(--me-grey, #706F6F);
  font-family: "Open Sans", "Poppins", Arial, sans-serif;
  line-height: 1.6;
}

.me-artist-website a {
  color: var(--me-ink, #000000);
}

.me-artist-website a:hover {
  color: var(--me-ink-hover, #6C6C6C);
}

.me-artist-section {
  margin-top: 36px;
}

.me-artist-section-title,
.x-col .me-artist-section-title {
  margin: 0 0 18px;
  color: var(--me-ink, #000000);
  font-family: "Quicksand", "Poppins", Arial, sans-serif;
  font-weight: 400;
  font-size: 1.2em;
}

/* --- Empty state ------------------------------------------------------- */

.me-artwork-empty,
.x-col .me-artwork-empty {
  padding: 24px;
  text-align: center;
  color: var(--me-grey, #706F6F);
  font-family: "Open Sans", "Poppins", Arial, sans-serif;
}

/* --- Lightbox ---------------------------------------------------------- */

body.me-artwork-modal-open {
  overflow: hidden;
}

.me-artwork-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.me-artwork-modal[hidden] {
  display: none;
}

.me-artwork-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.me-artwork-modal-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  column-gap: 28px;
  row-gap: 14px;
  width: 100%;
  max-width: 1100px;
  height: calc(100vh - 48px);
  height: min(820px, calc(100dvh - 48px));
  max-height: 100%;
  color: #fff;
  overflow: hidden;
}

.me-artwork-modal-close {
  position: absolute;
  /* Was -6px. The dialog now scrolls (A11Y-18), and an overflow container
     clips absolutely positioned children above its padding box, which would
     shave the top off this button. */
  top: 0;
  right: 0;
  /* Sit above the stage/figure, which follows in the DOM and would otherwise
     paint over the button and swallow the click. */
  z-index: 3;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.me-artwork-modal-stage {
  position: relative;
  display: flex;
  grid-column: 1;
  grid-row: 1;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
}

.me-artwork-modal-figure {
  margin: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.me-artwork-modal-figure img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.me-artwork-modal-prev,
.me-artwork-modal-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.me-artwork-modal-prev { left: 4px; }
.me-artwork-modal-next { right: 4px; }

.me-artwork-modal-prev:hover,
.me-artwork-modal-next:hover {
  background: rgba(255, 255, 255, 0.3);
}

.me-artwork-modal-prev[hidden],
.me-artwork-modal-next[hidden] {
  display: none;
}

.me-artwork-modal-thumbs {
  display: flex;
  grid-column: 1;
  grid-row: 2;
  gap: 8px;
  justify-content: center;
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 2px;
}

.me-artwork-modal-thumbs button {
  width: 56px;
  height: 56px;
  padding: 0;
  border: 2px solid transparent;
  background: none;
  cursor: pointer;
  border-radius: 3px;
  overflow: hidden;
}

.me-artwork-modal-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.me-artwork-modal-thumbs button[aria-current="true"] {
  border-color: var(--me-pink, #BE5B8F);
}

.me-artwork-modal-caption {
  grid-column: 2;
  grid-row: 1 / 3;
  min-width: 0;
  min-height: 0;
  padding: 52px 12px 16px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  text-align: left;
}

.me-artwork-modal-caption .me-artwork-modal-title {
  margin: 0 0 4px;
  font-family: "Quicksand", "Poppins", Arial, sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
}

.me-artwork-modal-caption .me-artwork-modal-artist {
  margin: 0 0 8px;
  font-family: "Open Sans", "Poppins", Arial, sans-serif;
  color: #ddd;
}

.me-artwork-modal-caption .me-artwork-modal-artist a {
  color: #fff;
  text-decoration: underline;
}

.me-artwork-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  justify-content: flex-start;
  margin: 0 0 8px;
  font-family: "Open Sans", "Poppins", Arial, sans-serif;
  font-size: 14px;
  color: #ddd;
}

.me-artwork-modal-meta div {
  display: flex;
  gap: 6px;
}

.me-artwork-modal-meta dt {
  font-weight: 700;
}

.me-artwork-modal-meta dd {
  margin: 0;
}

.me-artwork-modal-desc {
  max-width: 640px;
  margin: 6px 0 0;
  font-family: "Open Sans", "Poppins", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #eee;
}

.me-artwork-modal-counter {
  font-family: "Open Sans", "Poppins", Arial, sans-serif;
  font-size: 13px;
  color: #bbb;
}

/* --- Focus visibility (A11Y-15) ----------------------------------------
   .me-artwork-thumb already carried a 3px pink outline; these are the controls
   the same pattern was never applied to. Inside the lightbox the outline is
   white — pink on the rgba(0,0,0,0.85) backdrop is not a reliable focus
   indicator, and the UA default is worse there in Firefox and Safari. Both card
   links set text-decoration:none, so focus has no other visual cue at all. */

.me-artwork-modal-close:focus-visible,
.me-artwork-modal-prev:focus-visible,
.me-artwork-modal-next:focus-visible,
.me-artwork-modal-thumbs button:focus-visible,
.me-artwork-modal-caption a:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.me-auction-card-link:focus-visible,
.me-artist-card-link:focus-visible,
.me-filter-clear:focus-visible,
.me-artwork-more-button:focus-visible,
.x-col .me-auction-card-link:focus-visible,
.x-col .me-artist-card-link:focus-visible,
.x-col .me-filter-clear:focus-visible,
.x-col .me-artwork-more-button:focus-visible {
  outline: 3px solid var(--me-pink-accessible, #8E2F63);
  outline-offset: 2px;
}

/* --- Reduced motion (A11Y-13) ------------------------------------------
   The gallery scales thumbnails on hover/focus and lifts auction cards on
   hover. Both are decorative; drop the movement (and the transition that
   carries it) rather than only shortening it. */

@media (prefers-reduced-motion: reduce) {
  .me-artwork-thumb img,
  .x-col .me-artwork-thumb img {
    transition: none;
  }

  .me-artwork-thumb:hover img,
  .me-artwork-thumb:focus-visible img,
  .x-col .me-artwork-thumb:hover img,
  .x-col .me-artwork-thumb:focus-visible img {
    transform: none;
  }

  .me-auction-card-link,
  .x-col .me-auction-card-link,
  .me-artist-card-visual img,
  .x-col .me-artist-card-visual img {
    transition: none;
  }

  a.me-auction-card-link:hover,
  .me-artist-card-link:hover .me-artist-card-visual img,
  .me-artist-card-link:focus-visible .me-artist-card-visual img {
    transform: none;
  }
}

/* --- Responsive -------------------------------------------------------- */

@media (max-width: 991px) {
  .me-artwork-grid,
  .me-auction-index-grid,
  .me-artist-grid,
  .x-col .me-artwork-grid,
  .x-col .me-auction-index-grid,
  .x-col .me-artist-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .me-artist-grid,
  .x-col .me-artist-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 32px;
    row-gap: 32px;
  }
}

@media (max-width: 767px) {
  .me-artwork-grid,
  .me-auction-index-grid,
  .me-artist-grid,
  .x-col .me-artwork-grid,
  .x-col .me-auction-index-grid,
  .x-col .me-artist-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .me-artwork-modal {
    padding: 12px;
  }

  .me-artwork-modal-dialog {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: auto;
    max-height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .me-artwork-modal-stage {
    flex: 0 0 auto;
  }

  .me-artwork-modal-figure {
    width: 100%;
    height: auto;
    max-height: 50dvh;
  }

  .me-artwork-modal-figure img {
    max-height: 50dvh;
  }

  .me-artwork-modal-thumbs {
    flex: 0 0 auto;
    flex-wrap: wrap;
    justify-content: center;
    overflow: visible;
    padding-bottom: 0;
  }

  .me-artwork-modal-caption {
    flex: 0 0 auto;
    padding: 0 4px 16px;
    overflow: visible;
    text-align: center;
  }

  .me-artwork-modal-meta {
    justify-content: center;
  }

  .me-artwork-modal-desc {
    margin-right: auto;
    margin-left: auto;
  }

  .me-artist-previous-toggle,
  .x-col .me-artist-previous-toggle {
    flex-basis: 100%;
  }

  .me-artist-grid,
  .x-col .me-artist-grid {
    column-gap: 24px;
    row-gap: 28px;
  }
}

/* Phones: two columns leaves the thumbnails too small to read, so drop to a
   single full-width column. */
@media (max-width: 479px) {
  .me-artwork-grid,
  .me-auction-index-grid,
  .me-artist-grid,
  .x-col .me-artwork-grid,
  .x-col .me-auction-index-grid,
  .x-col .me-artist-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
}
