/* ============================================================================
   COMPONENT: artwork-catalog-card — canonical catalog list/grid card (STRUCTURE tier)
   PHASE B REDESIGN (2026-07-06): full rewrite replacing the 2026-07-05 Phase-A
   verbatim move. This is a REDESIGN, not a mechanical hoist — see
   -Documentation Project/DOC_CSS_COMPONENT_MIGRATION_LIST.md §F6 for the approved
   plan (one canonical structure + brand-token skins, visual sign-off per brand).

   What changed vs Phase A and why:
   - Fixed-pixel media box (250x285) -> fluid `width:100%` + `aspect-ratio` token,
     so mobile no longer needs a separate override breakpoint.
   - Hover panel: kept `position:absolute; top:100%` (NOT switched to static/in-flow —
     ADC's live skin already proved this mechanism correct), but promoted the
     `max-height:0/opacity:0 -> max-height:none/opacity:1` reveal + `box-sizing:
     border-box` fix into the shared structure so EVERY brand gets it, instead of
     each brand re-deriving it (this is what silently produced the WA/TI mobile
     "-4px inset" fudges in Phase A: width:100% without border-box arithmetic).
   - `overflow:visible` on the root / `overflow:hidden` only on `__media` is now an
     explicit, permanent contract (was a comment-only convention some skins had,
     others didn't).
   - Fav-toggle: canonical is icon-only (no painted pill/ring on `__fav-group`) —
     the pattern already proven bug-free on ADC/APS/OUA. This retires the painted
     `__fav-group` border+`.active` background pill that caused the documented
     double-ring bug on WA/BPA/MFP/TI/WK.
   - The `.custom_search` scope (which held the REAL, more complete design in
     Phase A — see brand skins) is folded into the bare-root canonical rules.
     `.top100-listing` and `.museums-100` remain as narrow, documented modifiers
     (real, intentional differences — ranked-list frame treatment / museum thumb
     aspect ratio). `.artwork-similar-page` is intentionally NOT touched here —
     it out-specifies this block on WA and is unaudited on the other 7 brands;
     defer folding it to a follow-up once characterized per-brand via screenshots.
   - Zero !important (hard lint rule) — every brand skin sets tokens or narrow
     overrides on `.artwork-catalog-card`, nothing needs to fight this file.

   Token contract: every --artwork-catalog-card-* custom property below has a
   fallback equal to the brand look this component already had before the
   redesign (WA's, since WA's values were the effective "default" baked into
   Phase A's bare-root rules) — a skin that overrides nothing renders identically
   to WA today. Brand skins set only the tokens that differ.
   ============================================================================ */

.artwork-catalog-card {
  --artwork-catalog-card-radius: 0;
  --artwork-catalog-card-border-color: #DCD3BF;
  --artwork-catalog-card-border-width: 1px;
  --artwork-catalog-card-bg: transparent;
  --artwork-catalog-card-media-ratio: 250 / 285;

  --artwork-catalog-card-badge-bg: #3E342AB2;
  --artwork-catalog-card-badge-color: #EDE9DE;

  --artwork-catalog-card-artist-color: #3E342A;
  --artwork-catalog-card-artist-accent-color: #B23333;
  --artwork-catalog-card-title-color: #3E342A;
  --artwork-catalog-card-desc-color: #3E342A;

  --artwork-catalog-card-hover-bg: #E8E2CD;
  --artwork-catalog-card-hover-border: none;
  --artwork-catalog-card-hover-shadow: none;
  --artwork-catalog-card-hover-inset: 0px;
  --artwork-catalog-card-hover-padding: 16px 18px 20px;
  --artwork-catalog-card-hover-max-height: 600px;
  --artwork-catalog-card-hover-duration: 0.3s;

  --artwork-catalog-card-buy-btn-bg: #875D2A;
  --artwork-catalog-card-buy-btn-color: #EDE9DE;
  --artwork-catalog-card-buy-btn-radius: 0;

  --artwork-catalog-card-fav-icon-filter: none;
  --artwork-catalog-card-fav-icon-filter-active: none;

  --artwork-catalog-card-image-hover-transform: scale(1.05);
  --artwork-catalog-card-image-hover-filter: none;
  --artwork-catalog-card-image-hover-opacity: 1;

  --artwork-catalog-card-card-hover-bg: var(--artwork-catalog-card-bg);
  --artwork-catalog-card-card-hover-shadow: none;
  --artwork-catalog-card-card-hover-transform: none;

  position: relative;
  overflow: visible; /* never clip the hover panel — __media is the only clip boundary */
  background: var(--artwork-catalog-card-bg);
  border: var(--artwork-catalog-card-border-width) solid var(--artwork-catalog-card-border-color);
  border-radius: var(--artwork-catalog-card-radius);
  padding: 25px 15px;
}

.searchCard_sec .col-md-4:nth-child(-n+3) .artwork-catalog-card {
  border-top: var(--artwork-catalog-card-border-width) solid var(--artwork-catalog-card-border-color);
}

/* ---- media ---- */

.artwork-catalog-card__media {
  width: 100%;
  aspect-ratio: var(--artwork-catalog-card-media-ratio);
  overflow: hidden; /* the ONLY clipping boundary in the component */
  position: relative;
}

.artwork-catalog-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform var(--artwork-catalog-card-hover-duration) ease,
              filter var(--artwork-catalog-card-hover-duration) ease;
}

.artwork-catalog-card:hover .artwork-catalog-card__media img,
.artwork-catalog-card:focus-within .artwork-catalog-card__media img {
  transform: var(--artwork-catalog-card-image-hover-transform);
  filter: var(--artwork-catalog-card-image-hover-filter);
  opacity: var(--artwork-catalog-card-image-hover-opacity);
}

/* card-level hover lift — no-op by default (transparent/none/none); a brand
   opts in by setting these three tokens (e.g. TI's translateY + shadow bloom) */
.artwork-catalog-card:hover {
  background: var(--artwork-catalog-card-card-hover-bg);
  box-shadow: var(--artwork-catalog-card-card-hover-shadow);
  transform: var(--artwork-catalog-card-card-hover-transform);
  transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.artwork-catalog-card__media .search_card_model_badge {
  position: absolute;
  top: 10px;
  left: 10px;
  margin: 0;
  background: var(--artwork-catalog-card-badge-bg);
  color: var(--artwork-catalog-card-badge-color);
  padding: 8px;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 14px;
  font-weight: 500;
  z-index: 3;
  max-width: calc(100% - 40px);
  pointer-events: none;
}

/* real geometry exception: museum thumbnails read better wider/shorter */
.museums-100 .artwork-catalog-card {
  --artwork-catalog-card-media-ratio: 4 / 1.5;
}

/* ---- body (always-visible artist/title) ---- */

.artwork-catalog-card__body {
  width: 100%;
  margin-top: 16px;
}

.artwork-catalog-card__artist {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.artwork-catalog-card__artist h2 {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  line-height: 20px;
  text-transform: uppercase;
  color: var(--artwork-catalog-card-artist-accent-color);
  margin: 0;
}

.artwork-catalog-card__artist h2 a {
  color: var(--artwork-catalog-card-artist-accent-color);
  text-decoration: none;
}

.artwork-catalog-card__artist span {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  line-height: 20px;
  opacity: 0.6;
  color: var(--artwork-catalog-card-artist-color);
  white-space: nowrap;
}

.artwork-catalog-card__artist span a {
  color: var(--artwork-catalog-card-artist-color);
  text-decoration: none;
}

.artwork-catalog-card__title {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 16px;
  line-height: 20px;
  color: var(--artwork-catalog-card-title-color);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.artwork-catalog-card__title a {
  color: var(--artwork-catalog-card-title-color);
  text-decoration: none;
}

/* ---- hover-reveal panel (description + footer) ---- */

.artwork-catalog-card__hover {
  position: absolute;
  top: 100%;
  left: calc(-1 * var(--artwork-catalog-card-hover-inset));
  width: calc(100% + 2 * var(--artwork-catalog-card-hover-inset));
  box-sizing: border-box;
  margin: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: var(--artwork-catalog-card-hover-z, 20);
  background: var(--artwork-catalog-card-hover-bg);
  border: var(--artwork-catalog-card-hover-border);
  box-shadow: var(--artwork-catalog-card-hover-shadow);
  transition: max-height var(--artwork-catalog-card-hover-duration) ease,
              opacity var(--artwork-catalog-card-hover-duration) ease;
}

.artwork-catalog-card:hover .artwork-catalog-card__hover,
.artwork-catalog-card:focus-within .artwork-catalog-card__hover {
  max-height: var(--artwork-catalog-card-hover-max-height);
  opacity: 1;
  pointer-events: auto;
}

.artwork-catalog-card__content {
  width: 100%;
  padding: var(--artwork-catalog-card-hover-padding);
  box-sizing: border-box;
}

.artwork-catalog-card__content p {
  font-family: var(--font-body);
  font-weight: 500;
  font-style: italic;
  font-size: 15px;
  line-height: 22px;
  color: var(--artwork-catalog-card-desc-color);
  opacity: 0.7;
  margin: 0 0 16px;
}

.artwork-catalog-card__content p a {
  color: var(--artwork-catalog-card-desc-color);
  text-decoration: none;
}

.artwork-catalog-card__footer {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.artwork-catalog-card__cart-group {
  flex: 1 1 auto;
  display: flex;
}

.artwork-catalog-card__buy-btn {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--artwork-catalog-card-buy-btn-bg);
  color: var(--artwork-catalog-card-buy-btn-color);
  border-radius: var(--artwork-catalog-card-buy-btn-radius);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
  text-align: center;
  text-transform: uppercase;
  text-decoration: none;
  padding: 10px 20px;
  box-sizing: border-box;
  white-space: normal;
}

/* ---- fav toggle: icon-only, no painted pill (retires the double-ring bug) ---- */

.artwork-catalog-card__fav-group {
  display: flex;
  align-items: center;
  justify-content: center;
}

.artwork-catalog-card__fav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.artwork-catalog-card__fav-toggle .unfav_icon,
.artwork-catalog-card__fav-toggle .fav_icon {
  width: 18px;
  height: 18px;
  filter: var(--artwork-catalog-card-fav-icon-filter);
  transition: filter 0.15s ease, opacity 0.15s ease;
}

/* CSS-level default (belt-and-suspenders alongside the template/JS inline
   `display` toggles) so exactly one heart ever renders even if a future
   template omits the inline style — retires any residual double-heart risk. */
.artwork-catalog-card__fav-toggle .fav_icon {
  display: none;
}

.artwork-catalog-card__fav-group.active .artwork-catalog-card__fav-toggle .unfav_icon {
  display: none;
}

.artwork-catalog-card__fav-group.active .artwork-catalog-card__fav-toggle .fav_icon {
  display: inline-flex;
}

.artwork-catalog-card__fav-group.active .artwork-catalog-card__fav-toggle .unfav_icon,
.artwork-catalog-card__fav-group.active .artwork-catalog-card__fav-toggle .fav_icon {
  filter: var(--artwork-catalog-card-fav-icon-filter-active);
}

/* ---- top100-listing: narrow modifier (ranked-list card frame) ---- */

.top100-listing .artwork-catalog-card.top100-listing__card {
  --artwork-catalog-card-hover-inset: 1px;
  overflow: visible;
  position: relative;
}

.top100-listing .artwork-catalog-card.top100-listing__card .artwork-catalog-card__body {
  position: relative;
  padding-bottom: 12px;
}

.top100-listing .artwork-catalog-card.top100-listing__card .artwork-catalog-card__body::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--artwork-catalog-card-border-color);
  pointer-events: none;
}

.top100-listing .artwork-catalog-card.top100-listing__card:hover .artwork-catalog-card__body::after {
  display: none;
}

/* ---- responsive ---- */

@media (max-width: 767px) {
  .artwork-catalog-card__buy-btn {
    font-size: 12px;
    padding: 10px 12px;
  }
}

@media (min-width: 992px) and (max-width: 1200px) {
  .artwork-catalog-card__buy-btn {
    font-size: 11px;
    padding: 10px 8px;
  }
  .artwork-catalog-card__artist span {
    font-size: 11px;
  }
}
