/**
 * SAMinfo consent UI — banner + preferences modal.
 * Colors reference theme.json design tokens (CSS custom props) per project rule.
 * Pairings are chosen for WCAG AA contrast: white on navy, navy on white.
 */

.sam-consent[hidden] { display: none; }
.sam-consent *,
.sam-consent *::before,
.sam-consent *::after { box-sizing: border-box; }

/* ── bottom banner ───────────────────────────────────────────────────── */
.sam-consent__banner {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 2147483000;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding: 1.1rem clamp(1rem, 4vw, 3rem);
  background: var(--wp--preset--color--navy, #04024D);
  color: #fff;
  box-shadow: 0 -8px 30px rgba(2, 0, 51, 0.35);
  border-top: 3px solid var(--wp--preset--color--cyan, #00AEEF);
  font-family: var(--wp--preset--font-family--sans, "Overpass", system-ui, sans-serif);
  animation: sam-consent-rise 0.3s ease-out both;
}
@keyframes sam-consent-rise { from { transform: translateY(100%); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .sam-consent__banner { animation: none; } }

.sam-consent__body { flex: 1 1 30rem; }
.sam-consent__title {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
}
.sam-consent__text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.88);
  max-width: 64ch;
}
.sam-consent__text a,
.sam-consent__gpc a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }

.sam-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  flex: 0 0 auto;
}
.sam-consent__actions--prefs { justify-content: flex-end; margin-top: 1.25rem; }

.sam-consent__btn {
  font: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.6rem 1.25rem;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.sam-consent__btn:focus-visible { outline: 3px solid var(--wp--preset--color--cyan, #00AEEF); outline-offset: 2px; }
.sam-consent__btn--ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.6);
}
.sam-consent__btn--ghost:hover { background: rgba(255, 255, 255, 0.12); border-color: #fff; }
.sam-consent__btn--solid {
  background: #fff;
  color: var(--wp--preset--color--navy, #04024D);
}
.sam-consent__btn--solid:hover { background: var(--wp--preset--color--cyan, #00AEEF); color: var(--wp--preset--color--navy, #04024D); }

/* ── preferences modal ───────────────────────────────────────────────── */
.sam-consent__prefs[hidden] { display: none; }
.sam-consent__prefs {
  position: fixed;
  inset: 0;
  z-index: 2147483001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(2, 0, 51, 0.55);
  backdrop-filter: blur(2px);
}
.sam-consent__panel {
  position: relative;
  width: min(40rem, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--wp--preset--color--base, #FAFAFA);
  color: var(--wp--preset--color--ink, #414042);
  border-radius: 8px;
  padding: clamp(1.25rem, 4vw, 2.25rem);
  box-shadow: 0 30px 80px rgba(2, 0, 51, 0.45);
  font-family: var(--wp--preset--font-family--sans, "Overpass", system-ui, sans-serif);
}
.sam-consent__panel .sam-consent__title { color: var(--wp--preset--color--navy, #04024D); font-size: 1.4rem; }
.sam-consent__close {
  position: absolute;
  top: 0.75rem;
  right: 0.9rem;
  width: 2rem; height: 2rem;
  border: 0; background: transparent;
  font-size: 1.6rem; line-height: 1;
  color: var(--wp--preset--color--ink, #414042);
  cursor: pointer; border-radius: 4px;
}
.sam-consent__close:hover { background: var(--wp--preset--color--base-3, #EBEBEB); }
.sam-consent__close:focus-visible { outline: 3px solid var(--wp--preset--color--cyan, #00AEEF); outline-offset: 2px; }

.sam-consent__gpc {
  margin: 0.75rem 0 1.25rem;
  padding: 0.75rem 1rem;
  background: var(--wp--preset--color--cyan-tint, #E6F7FD);
  border-left: 3px solid var(--wp--preset--color--cyan, #00AEEF);
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--wp--preset--color--navy, #04024D);
}
.sam-consent__form { margin-top: 1rem; }
.sam-consent__cat {
  display: block;
  padding: 1rem 0;
  border-top: 1px solid var(--wp--preset--color--rule, #D1D3D4);
}
.sam-consent__cat:first-child { border-top: 0; }
.sam-consent__cat-head { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; color: var(--wp--preset--color--navy, #04024D); }
.sam-consent__cat-head input { width: 1.1rem; height: 1.1rem; accent-color: var(--wp--preset--color--cyan, #00AEEF); }
.sam-consent__cat-head em { font-weight: 400; font-style: normal; color: var(--wp--preset--color--ink-3, #6b6d70); font-size: 0.8rem; }
.sam-consent__cat-desc { display: block; margin: 0.35rem 0 0 1.7rem; font-size: 0.85rem; line-height: 1.5; color: var(--wp--preset--color--ink, #414042); }

/* ── footer "Your Privacy Choices" control + opt-out icon ────────────── */
.sam-privacy-choices {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.sam-privacy-choices:hover { color: var(--wp--preset--color--cyan, #00AEEF); }
.sam-privacy-choices__icon { flex: 0 0 auto; }

/* ── form privacy notice + legal pages ───────────────────────────────── */
.sam-form-privacy {
  margin: 0.75rem 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  /* Inherit the container's text color: the notice renders on both navy
     callouts (newsletter) and light panels (classifieds). Matching the parent's
     already-AA-compliant color guarantees contrast in every context. */
  color: inherit;
}
.sam-form-privacy a { color: inherit; text-decoration: underline; }
.sam-legal-note {
  padding: 0.85rem 1.1rem;
  background: var(--wp--preset--color--cyan-tint, #E6F7FD);
  border-left: 3px solid var(--wp--preset--color--cyan, #00AEEF);
  border-radius: 4px;
  font-size: 0.9rem;
  color: var(--wp--preset--color--navy, #04024D);
}
.sam-legal-table table { font-size: 0.9rem; }
.sam-legal-table th { background: var(--wp--preset--color--navy, #04024D); color: #fff; }
