/* Cookie consent banner.
 *
 * Dark brand panel, so every foreground value here was checked against
 * #3E3D35 for WCAG AA. White text is 10.92:1 and the pale link is 7.43:1.
 * The brand secondary #89826E is deliberately NOT used for text on this
 * panel: it lands at 2.85:1 against #3E3D35, well under AA. See
 * memory/design-system.md on the dark-panel trap.
 *
 * Nothing here depends on a guide or tool stylesheet, because the banner
 * renders on every page type including the homepage and the samples.
 */

.oh-consent {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 2147483000; /* above the WhatsApp and tools widgets */
  margin: 0 auto;
  max-width: 48rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  padding: 1.1rem 1.35rem;
  background: #3E3D35;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  font-family: 'Avenir', 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  animation: oh-consent-in 0.28s ease-out;
}

@keyframes oh-consent-in {
  from { opacity: 0; transform: translateY(0.75rem); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .oh-consent { animation: none; }
}

/* Scoped past .article-content p, which is 0,1,1 and sets color #444.
   An unscoped .oh-consent-text would tie on specificity and lose or win
   on source order alone, which is how dark panels on this site have
   shipped with unreadable copy twice. */
.oh-consent .oh-consent-text,
.article-content .oh-consent .oh-consent-text {
  flex: 1 1 18rem;
  margin: 0;
  color: #fff;
  font-size: 0.9rem;
  line-height: 1.55;
}

.oh-consent .oh-consent-text a {
  color: #D9D5C7;
  text-decoration: underline;
}

.oh-consent .oh-consent-text a:hover,
.oh-consent .oh-consent-text a:focus {
  color: #fff;
}

.oh-consent-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 0.6rem;
}

/* Accept and Decline are the same size and weight. Neither is visually
   preferred, which is what "clear affirmative action" requires. */
.oh-consent .oh-consent-btn {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  min-width: 6.5rem;
}

.oh-consent .oh-consent-accept {
  background: #F8F8F4;
  color: #3E3D35;
  border: 1px solid #F8F8F4;
}

.oh-consent .oh-consent-accept:hover {
  background: #fff;
}

.oh-consent .oh-consent-decline {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.oh-consent .oh-consent-decline:hover {
  background: rgba(255, 255, 255, 0.12);
}

.oh-consent .oh-consent-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

@media (max-width: 560px) {
  .oh-consent {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    padding: 1rem;
    gap: 0.9rem;
  }
  .oh-consent-actions {
    width: 100%;
  }
  .oh-consent .oh-consent-btn {
    flex: 1 1 0;
  }
}
