/*
 * TasteRay overrides for the Silktide Consent Manager (v2.0.1).
 * Loaded AFTER silktide-consent-manager.css — equal-specificity rules here win
 * by source order. Selectors mirror the lib's exactly; re-audit on lib upgrade.
 * Everything is scoped under the lib's own #stcm-* ids — nothing leaks.
 */

/* Theme variables the lib reads on the wrapper */
#stcm-wrapper {
  --fontFamily: var(--font-body);
  --primaryColor: var(--pink);     /* links, checked toggle track, close-icon fill */
  --backgroundColor: var(--card);  /* banner/modal surface (#121214) */
  --textColor: var(--fg);
}

/* Cards: hairline border, radius within DESIGN.md's 16px ceiling; the lib's
   --boxShadow var is unused (shadows are hardcoded on the elements), so
   override the hardcoded shadow here directly. */
#stcm-banner,
#stcm-modal {
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

/* No floating cookie icon — re-entry is the "Cookie preferences" footer link.
   JS sets inline style.display='flex' after any choice, hence !important. */
#stcm-wrapper #stcm-icon { display: none !important; }

/* ---- Buttons -----------------------------------------------------------
   The lib marks ALL four action buttons .stcm-button-primary. Reset the base
   to the site's secondary "glassy" style, then re-promote ONLY .stcm-accept-all. */
#stcm-wrapper .stcm-button {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  border-radius: 10px;                    /* DESIGN.md: buttons 10–12px */
  padding: 12px 24px;
  border: 1px solid var(--border);        /* replaces lib's 2px primary border */
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  white-space: nowrap;
}
#stcm-wrapper .stcm-button-primary:hover { /* kills the lib's bg/text swap */
  background: rgba(255, 255, 255, 0.12);
  color: var(--fg);
}

/* The one true primary: brand gradient, near-black ink (white fails AA). */
#stcm-wrapper .stcm-accept-all {
  background: linear-gradient(135deg, var(--pink), var(--blue));
  border-color: transparent;
  color: #0a0a0b;
}
#stcm-wrapper .stcm-accept-all:hover {   /* must come after the -primary:hover rule */
  background: linear-gradient(135deg, var(--pink), var(--blue));
  color: #0a0a0b;
  filter: brightness(1.1);
}

/* Quiet text button in the banner */
#stcm-banner .stcm-preferences-button { color: var(--muted); }
#stcm-banner .stcm-preferences-button span:hover { color: var(--fg); }

/* Silktide attribution (logo + modal credit link): stays, but quieted */
#stcm-banner a.stcm-logo { fill: var(--muted); }
#stcm-banner a.stcm-logo:hover { fill: var(--fg); }
#stcm-modal footer a.stcm-credit-link { color: var(--muted); }
#stcm-modal footer a.stcm-credit-link:hover { color: var(--fg); }

/* Modal headings in the display face */
#stcm-modal h1 { font-family: var(--font-heading); font-weight: 600; letter-spacing: -0.01em; }
#stcm-modal legend { font-family: var(--font-heading); font-weight: 600; }

/* ---- Focus -------------------------------------------------------------
   Site-wide pink focus ring (DESIGN.md), replacing the lib's two-ring shadow.
   The lib rule also hardcodes border-radius:5px on :focus, which would deform
   the 10px buttons — reset it. Selector list mirrors the lib's exactly. */
#stcm-wrapper a:focus,
#stcm-wrapper #stcm-banner button:focus,
#stcm-wrapper #stcm-modal button:focus {
  outline: 2px solid var(--pink);
  outline-offset: 1px;
  box-shadow: 0 0 0 4px rgba(255, 107, 157, 0.15);
  border-radius: 10px;
}
#stcm-modal .stcm-toggle:focus-within {
  box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--pink);
}

/* The lib gates only its "nudge" animation; gate the entrances too (DESIGN.md). */
@media (prefers-reduced-motion: reduce) {
  #stcm-banner, #stcm-modal { animation: none; opacity: 1; transform: none; }
}
