/* fa-farbvorschau.css – Farbvorschau für einfarbig geplottete Motive
   FA 2026-11-08, Paket W:\Programmierung\fa-farbvorschau
   Nur Brand-Tokens aus brand-tokens.css. Die Folienfarbe (--fa-fv-farbe) und
   die Maske (--fa-fv-maske) setzt fa-farbvorschau.js als Custom Property am
   Element – die Farbe ist Produktdaten aus oracalcolors (r,g,b).
   Dunkle Unterlage nur als vollflächige Bildunterlage (BRAND.md, Abschnitt 2). */

.fa-farbvorschau {
  margin: 0;
}
.fa-farbvorschau[hidden] {
  display: none;
}

/* Vorschau aktiv: Foto-Link und Zoom-Hinweis ausblenden (bleiben im DOM) */
.fa-fv-verdeckt {
  display: none !important;
}

.fa-farbvorschau__flaeche {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--surf);
  border: 1px solid var(--line);
}
.fa-farbvorschau--dunkel .fa-farbvorschau__flaeche {
  background: var(--fg);
  border-color: var(--fg);
}

.fa-farbvorschau__motiv {
  position: absolute;
  inset: 24px;
  background-color: var(--fa-fv-farbe, var(--fg));
  -webkit-mask-image: var(--fa-fv-maske);
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-image: var(--fa-fv-maske);
  mask-position: center;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-mode: alpha;
}

.fa-farbvorschau__info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-top: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg);
  text-align: center;
}
.fa-farbvorschau__zeile .fa-lbl {
  margin-right: 8px;
}
.fa-farbvorschau__farbe .fa-val {
  font-weight: 500;
}
.fa-farbvorschau__hinweis {
  color: var(--mut);
}

.fa-farbvorschau__umschalten {
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  background: none;
  color: var(--acc);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.fa-farbvorschau__umschalten:hover {
  color: var(--acc-deep);
}
.fa-farbvorschau__umschalten:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}

/* Foto-Ansicht: Umschalter sitzt unter dem Foto, Fläche aus */
.fa-farbvorschau--foto .fa-farbvorschau__flaeche,
.fa-farbvorschau--foto .fa-farbvorschau__hinweis {
  display: none;
}

@media (max-width: 600px) {
  .fa-farbvorschau__motiv {
    inset: 16px;
  }
}
