/* WTCA — analytics consent notice.

   A small, non-modal card anchored to the bottom-inline-start corner. There is
   no backdrop, no scroll lock and no focus trap: the page stays completely
   usable before a choice is made, and making no choice simply leaves analytics
   off.

   Visually it is built from the site's own design system rather than being
   bolted on — the paper ground, navy ink, gold hairline, Cinzel display type,
   3px radii and 3px gold focus ring are all taken from assets/css/site.css.
   Every token is referenced with a literal fallback, so the component still
   renders correctly if it is ever loaded on a page without site.css.

   Geometry uses logical properties throughout (inset-inline, margin-inline,
   padding-inline, text-align:start), so adding an RTL locale later is a matter
   of the `dir` the script already sets, with no new stylesheet. */

.wtca-consent,
.wtca-consent *,
.wtca-consent-pill {
  box-sizing: border-box;
}

/* ------------------------------------------------------------- Notice card */

.wtca-consent {
  position: fixed;
  /* Above page content and the sticky masthead (z-index 100/120), below the
     site search overlay (300) and the skip link (999), both of which must stay
     on top of a notice that is deliberately subordinate. */
  z-index: 290;
  inset-block-end: 16px;
  inset-inline-start: 24px;
  inset-inline-end: auto;
  width: calc(100% - 48px);
  max-width: 544px;
  max-height: 76vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0;
  padding: 0;
  background: var(--paper, #FCFAF5);
  color: var(--ink, #15263A);
  border: 1px solid var(--line, rgba(15, 50, 81, .13));
  border-radius: 3px;
  box-shadow: 0 20px 44px -32px rgba(11, 37, 64, .55), 0 2px 10px rgba(11, 37, 64, .10);
  font-family: var(--serif, 'Source Serif 4', Georgia, 'Times New Roman', serif);
  font-size: 14px;
  line-height: 1.55;
  text-align: start;
  animation: wtca-consent-in 180ms ease-out;
}

/* The masthead's signature gold rule, restated along the top of the card so it
   reads as part of the institution rather than as a third-party widget. */
.wtca-consent::before {
  content: "";
  display: block;
  height: 2px;
  background: linear-gradient(90deg, var(--gold, #C08422), var(--gold-lt, #E0BC6B) 42%, transparent 78%);
}

.wtca-consent [hidden] {
  display: none !important;
}

.wtca-consent__inner {
  padding-block: 15px 16px;
  padding-inline: 18px;
}

.wtca-consent__title {
  margin: 0 0 6px;
  padding: 0;
  font-family: var(--display, 'Cinzel', Georgia, serif);
  font-weight: 600;
  font-size: 13.5px;
  line-height: 1.3;
  letter-spacing: .06em;
  color: var(--navy, #0F3251);
}

.wtca-consent__text {
  margin: 0;
  padding: 0;
  font-size: 13.5px;
  line-height: 1.58;
  color: var(--muted, #5A6675);
}

.wtca-consent__current {
  margin: 8px 0 0;
  padding: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted, #5A6675);
}

.wtca-consent__current-value {
  color: var(--navy, #0F3251);
  font-weight: 600;
}

/* ----------------------------------------------------------------- Actions */

.wtca-consent__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 13px 0 0;
  padding: 0;
}

/* Shared button shell, matching the site's .btn treatment: Cinzel, uppercase,
   wide tracking, 3px radius. Accept and Reject are deliberately identical in
   size, weight, shape and type — only the fill distinguishes them. */
.wtca-consent__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 11px 17px;
  /* Matches the touch target of the site's own .btn / .btn2 controls. */
  min-height: 44px;
  min-width: 104px;
  border: 1px solid transparent;
  border-radius: 3px;
  font-family: var(--display, 'Cinzel', Georgia, serif);
  font-weight: 600;
  font-size: 11.5px;
  line-height: 1.2;
  letter-spacing: .09em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  background-image: none;
  box-shadow: none;
  appearance: none;
  transition: background-color .18s, color .18s, border-color .18s;
}

/* Keyboard focus only, matching site.css. The ring must not fire on a mouse
   click, which is why :focus is not used here. */
.wtca-consent__btn:focus-visible,
.wtca-consent-pill:focus-visible {
  outline: 3px solid var(--gold, #C08422);
  outline-offset: 2px;
}

/* Engines without :focus-visible fall back to a plain :focus ring rather than
   losing the indicator entirely. */
@supports not selector(:focus-visible) {
  .wtca-consent__btn:focus,
  .wtca-consent-pill:focus {
    outline: 3px solid var(--gold, #C08422);
    outline-offset: 2px;
  }
}

.wtca-consent__btn--accept {
  color: #fff;
  background-color: var(--navy, #0F3251);
  border-color: var(--navy, #0F3251);
}

.wtca-consent__btn--accept:hover {
  background-color: var(--navy-2, #1A4E78);
  border-color: var(--navy-2, #1A4E78);
}

/* The resting border is #6E7F91 rather than the site's very light --line: at
   this size the control is a standalone boundary and needs the 3:1 WCAG
   non-text minimum, which --line (about 1.2:1 over paper) does not reach.
   #6E7F91 gives about 3.9:1, so Reject never reads as disabled. */
.wtca-consent__btn--reject {
  color: var(--navy, #0F3251);
  background-color: transparent;
  border-color: #6E7F91;
}

.wtca-consent__btn--reject:hover {
  background-color: var(--panel, #F2EBDC);
  border-color: var(--navy, #0F3251);
}

.wtca-consent__btn--close {
  color: var(--muted, #5A6675);
  background-color: transparent;
  border-color: #6E7F91;
  letter-spacing: .075em;
}

.wtca-consent__btn--close:hover {
  color: var(--navy, #0F3251);
  background-color: var(--panel, #F2EBDC);
  border-color: var(--navy, #0F3251);
}

/* "More information" is a quieter, borderless control, but still a real
   button at a full 4.8:1 against paper — quiet by weight, not by faintness. */
.wtca-consent__btn--info {
  min-width: 0;
  padding-inline: 6px;
  color: var(--gold-dp, #94651A);
  background-color: transparent;
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: normal;
}

.wtca-consent__btn--info:hover {
  color: var(--navy, #0F3251);
}

/* The stored choice in manage mode. Paired with aria-pressed in the script, so
   the current selection is never signalled by colour alone. */
.wtca-consent__btn.is-current {
  box-shadow: 0 0 0 2px var(--gold-lt, #E0BC6B);
}

/* ------------------------------------------------- "More information" panel */

.wtca-consent__more {
  max-height: 34vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: 12px 0 0;
  padding-block: 11px;
  padding-inline: 13px;
  background: var(--panel, #F2EBDC);
  border-radius: 3px;
  border-inline-start: 2px solid var(--gold, #C08422);
}

.wtca-consent__more-title {
  margin: 0 0 7px;
  padding: 0;
  font-family: var(--display, 'Cinzel', Georgia, serif);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--navy, #0F3251);
}

.wtca-consent__list {
  margin: 0;
  padding: 0;
  padding-inline-start: 18px;
  list-style: disc outside;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted, #5A6675);
}

.wtca-consent__list li {
  margin: 0 0 5px;
  padding: 0;
  list-style: disc outside;
}

.wtca-consent__list li:last-child {
  margin-bottom: 0;
}

/* ------------------------------------------ Persistent preference control */

/* Shown only after a choice is stored. Discreet through size and placement
   rather than through low opacity, so it keeps full contrast and stays a
   dependable way back to the choice. */
.wtca-consent-pill {
  position: fixed;
  z-index: 289;
  inset-block-end: 12px;
  inset-inline-start: 12px;
  margin: 0;
  padding: 7px 12px;
  min-height: 32px;
  background: var(--paper, #FCFAF5);
  color: var(--navy, #0F3251);
  border: 1px solid #6E7F91;
  border-radius: 3px;
  font-family: var(--display, 'Cinzel', Georgia, serif);
  font-weight: 600;
  font-size: 10px;
  line-height: 1.3;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  background-image: none;
  box-shadow: 0 1px 6px rgba(11, 37, 64, .10);
  appearance: none;
  transition: background-color .18s, border-color .18s;
}

.wtca-consent-pill:hover {
  background: var(--panel, #F2EBDC);
  border-color: var(--navy, #0F3251);
}

/* -------------------------------------------------------------- Responsive */

@media (max-width: 600px) {
  .wtca-consent {
    inset-block-end: 8px;
    inset-inline-start: 8px;
    inset-inline-end: 8px;
    width: auto;
    max-width: none;
    max-height: 72vh;
  }

  .wtca-consent__inner {
    padding-block: 13px 14px;
    padding-inline: 14px;
  }

  .wtca-consent__title,
  .wtca-consent__text {
    font-size: 13px;
  }

  .wtca-consent__actions {
    gap: 7px;
  }

  .wtca-consent__btn {
    padding: 10px 14px;
    min-width: 96px;
    font-size: 11px;
  }

  .wtca-consent-pill {
    inset-block-end: 8px;
    inset-inline-start: 8px;
  }
}

/* At 360px and below the row is too narrow to hold all three controls, so
   "More information" takes a line of its own and Accept and Reject share the
   first one. flex-basis stays auto and min-width is only relaxed, never zeroed:
   a flex item with min-width:0 shrinks past its own text, which paints the
   label outside the button. */
@media (max-width: 360px) {
  .wtca-consent__btn--accept,
  .wtca-consent__btn--reject {
    flex: 1 1 auto;
    min-width: 88px;
    padding-inline: 10px;
  }

  .wtca-consent__btn--info,
  .wtca-consent__btn--close {
    flex: 1 0 100%;
  }
}

/* ------------------------------------------------------------ Motion, print */

/* Opacity only. The card is anchored to a corner, so a transform-based
   entrance would slide it across the page while the animation runs. */
@keyframes wtca-consent-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

  .wtca-consent__btn,
  .wtca-consent-pill {
    transition: none;
  }
}

@media print {
  .wtca-consent,
  .wtca-consent-pill {
    display: none !important;
  }
}
