/* DropBlockCMS — Cookie consent banner (scope-briefs/020 Coin 2a).
   Loaded only on public pages by the consent module's head fragment. Every colour, space and
   type value is a design token (one source of truth); the public Branding palette applies
   automatically. Non-blocking bottom bar (D4): the page stays usable behind it, no overlay,
   no focus trap. Accept all / Reject all are the SAME class — equal prominence is a rule. */

.consent {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
  padding: var(--space-4);
  pointer-events: none;                 /* only the bar itself takes clicks */
}
.consent[hidden] { display: none; }
.consent__bar {
  pointer-events: auto;
  max-width: var(--max-width-wide); margin: 0 auto;
  background: var(--color-surface-white); color: var(--color-text-primary);
  border: 1px solid var(--color-border-medium); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-5) var(--space-6);
  display: grid; grid-template-columns: 1fr auto; gap: var(--space-4) var(--space-6); align-items: center;
  font-family: var(--font-ui);
  animation: consent-rise 0.25s ease-out;
}
@keyframes consent-rise { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

.consent__title { font-size: var(--text-md); font-weight: var(--weight-semibold); margin: 0 0 var(--space-1); }
.consent__body  { font-size: var(--text-sm); line-height: var(--leading-normal); color: var(--color-text-secondary); margin: 0; }
.consent__link  { color: var(--color-brand-primary); text-decoration: underline; }
.consent__link:hover { color: var(--color-brand-dark); }

.consent__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; }
.consent__btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-ui); font-size: var(--text-sm); font-weight: var(--weight-medium);
  padding: var(--space-3) var(--space-5); min-width: 8.5rem;
  border-radius: var(--radius-pill); border: 1px solid var(--color-brand-primary);
  background: var(--color-brand-primary); color: var(--color-surface-white);
  cursor: pointer; transition: background 0.2s ease, color 0.2s ease;
}
.consent__btn:hover { background: var(--color-brand-dark); border-color: var(--color-brand-dark); }
.consent__btn--manage {
  background: transparent; color: var(--color-brand-primary); border-color: transparent; min-width: 0;
  text-decoration: underline;
}
.consent__btn--manage:hover { background: var(--color-brand-lightest); color: var(--color-brand-dark); border-color: transparent; }
.consent__btn:focus-visible, .consent__check:focus-visible, .consent-reopen__btn:focus-visible {
  outline: 3px solid var(--color-brand-mid); outline-offset: 2px;
}

.consent__panel { grid-column: 1 / -1; border-top: 1px solid var(--color-border-default); padding-top: var(--space-4); }
.consent__panel[hidden] { display: none; }
.consent__cats { list-style: none; margin: 0 0 var(--space-4); padding: 0; display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.consent__cat-label { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); font-weight: var(--weight-medium); cursor: pointer; }
.consent__check { width: 1.1rem; height: 1.1rem; accent-color: var(--color-brand-primary); }
.consent__cat-always { font-size: var(--text-xs); color: var(--color-text-tertiary); font-weight: var(--weight-regular); }
.consent__cat-purpose { margin: var(--space-1) 0 0 1.7rem; font-size: var(--text-xs); color: var(--color-text-secondary); line-height: var(--leading-normal); }
.consent__cookies { list-style: none; margin: var(--space-2) 0 0 1.7rem; padding: 0; font-size: var(--text-xs); color: var(--color-text-tertiary); line-height: var(--leading-normal); }
.consent__cookies li { margin: 0 0 var(--space-1); }
.consent__cookies code { font-family: var(--font-mono); color: var(--color-text-secondary); }
.consent__cookie-life { white-space: nowrap; }
.consent__actions--panel { justify-content: flex-start; }
.consent__ref { margin: var(--space-3) 0 0; font-size: var(--text-xs); color: var(--color-text-tertiary); }
.consent__ref code { font-family: var(--font-mono); }

/* The reopen link — a quiet line at the very bottom of every page, present even when the
   banner is hidden, so a visitor can always change their mind (D16). */
.consent-reopen { text-align: center; margin: 0; padding: var(--space-3) var(--space-4) var(--space-4); font-family: var(--font-ui); font-size: var(--text-xs); }
.consent-reopen__btn {
  background: none; border: 0; padding: var(--space-1) var(--space-2); cursor: pointer;
  color: var(--color-text-tertiary); text-decoration: underline; font: inherit;
}
.consent-reopen__btn:hover { color: var(--color-brand-primary); }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Phone width: text above, buttons full-width and still identical (equal prominence holds). */
@media (max-width: 640px) {
  .consent { padding: var(--space-2); }
  .consent__bar { grid-template-columns: 1fr; padding: var(--space-4); }
  .consent__actions { justify-content: stretch; }
  .consent__btn { flex: 1 1 100%; }
  .consent__btn--manage { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .consent__bar { animation: none; }
  .consent__btn { transition: none; }
}
