/*
  W7 — analytics consent controls and (release 3) ad slots. Linked by Views/Shared/_Layout.cshtml on every public page;
  every rule is scoped to W7 class names, so nothing here affects pages without these controls.
  Colours follow site.css's Night Shift tokens (this file is only loaded after it): light text on a raised slate band,
  lime buttons with near-black text (about 14:1), fine #272d38 rules.
*/

/* ---- shared ----------------------------------------------------------------------------------------------- */
.consent-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0;
}

/* Accept and Decline share one style: equally prominent, neither is the "default". */
.consent-button {
  min-height: 44px;
  min-width: 8.5rem;
  padding: 0.5rem 1rem;
  border: 2px solid var(--color-accent, #b5f23d);
  border-radius: var(--radius, 8px);
  background: var(--color-accent, #b5f23d);
  color: var(--color-on-accent, #0f1115);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.consent-button:hover {
  background: var(--color-accent-hover, #cdf779);
  border-color: var(--color-accent-hover, #cdf779);
}

.consent-button:focus-visible,
.consent-banner__close:focus-visible,
.consent-banner:focus-visible {
  outline: 3px solid var(--color-accent, #b5f23d);
  outline-offset: 2px;
}

/* Visually hidden live region used by consent.js for announcements. */
.consent-live {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---- banner (non-modal, in the page flow so it never covers content or the focused element) ----------------- */
.consent-banner {
  border-bottom: 1px solid var(--color-rule, #272d38);
  background: var(--color-surface, #161a21);
  color: var(--color-text, #e8eaed);
}

[data-consent-banner][hidden] {
  display: none !important;
}

.consent-banner__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  box-sizing: border-box;
  max-width: var(--page-width, 75rem);
  margin: 0 auto;
  padding: 0.85rem var(--gutter, 1rem);
}

.consent-banner__text {
  flex: 1 1 32rem;
  max-width: 70ch;
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
}

.consent-banner__title {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--color-heading, #f5f6f7);
  font-weight: 600;
}

.consent-banner__text a,
.consent-page a {
  color: var(--color-accent, #b5f23d);
  text-decoration: underline;
}

.consent-banner__current {
  flex: 1 1 100%;
  margin: 0;
  font-weight: 600;
}

.consent-banner__close {
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-control-border, #6b7382);
  border-radius: var(--radius, 8px);
  background: transparent;
  color: var(--color-text, #e8eaed);
  font: inherit;
  cursor: pointer;
}

/* ---- choices page (GET /consent) --------------------------------------------------------------------------- */
.consent-page {
  max-width: 70ch;
}

.consent-page__list {
  padding-left: 1.25rem;
}

.consent-page__current {
  font-weight: 600;
}

/* Kept rendered while empty: a live region that is display:none when its text changes is not reliably announced. */
.consent-page__status:empty {
  margin: 0;
}

.consent-page__form {
  margin: 1rem 0;
}

.consent-page__note {
  font-size: 0.9rem;
}

/* ---- ad slots (release 3; rendered only while Ads:Enabled) --------------------------------------------------
   Visually separate from the instruction, source attribution and share controls: own band, rules and a visible
   label. The height of the tallest creative is reserved on the unit itself before the ad loads, so an active unit
   does not shift the layout; the slot's min-height adds the frame (rules, padding and label: 46px at a 16px root
   font size, AdPlacements.FrameHeightPx). Keep the numbers in sync with Services/Ads/AdPlacements.cs. */
.ad-slot {
  clear: both;
  box-sizing: border-box;
  margin: 2.5rem 0;
  padding: 0.5rem 0.75rem 0.75rem;
  border-top: 1px solid var(--color-rule, #272d38);
  border-bottom: 1px solid var(--color-rule, #272d38);
  background: var(--color-bg-alt, #12151a);
  overflow: hidden;
}

.ad-slot--tip-after-main {
  min-height: 326px;
}

.ad-slot--tip-after-main .ad-slot__unit {
  min-height: 280px;
}

.ad-slot--listing-between-groups {
  min-height: 146px;
}

.ad-slot--listing-between-groups .ad-slot__unit {
  min-height: 100px;
}

.ad-slot__label {
  margin: 0 0 0.5rem;
  color: var(--color-muted, #a0a7b4);
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ad-slot__unit {
  display: block;
  width: 100%;
}

@media print {
  .consent-banner,
  .ad-slot {
    display: none !important;
  }
}
