/**
 * @file
 * Styles for the cookie preferences trigger.
 *
 * The floating variant mirrors the OneTrust persistent Cookie Settings button:
 * a round button with a cookie icon. The bar and inline variants show the
 * label as visible text.
 */

.galp-cookie-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin: 0;
  padding: 0.5em 0.9em;
  border: 0;
  border-radius: 4px;
  background: var(--gct-bg, var(--color-action-brand-default, #be2e00));
  color: var(--color-text-primary-on-color, #fff);
  font: inherit;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.galp-cookie-trigger:hover,
.galp-cookie-trigger:focus {
  background: var(--gct-bg-hover, var(--color-action-brand-hover, #a32809));
  color: var(--color-text-primary-on-color, #fff);
}

.galp-cookie-trigger:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Design System colour variants (set the colour custom properties). */
.galp-cookie-trigger--color-brand,
.galp-cookie-trigger-bar.galp-cookie-trigger--color-brand {
  --gct-bg: var(--color-action-brand-default, #be2e00);
  --gct-bg-hover: var(--color-action-brand-hover, #a32809);
}

.galp-cookie-trigger--color-primary-pure,
.galp-cookie-trigger-bar.galp-cookie-trigger--color-primary-pure {
  --gct-bg: var(--color-surface-primary-pure, #ff5a00);
  --gct-bg-hover: var(--color-action-brand-default, #be2e00);
}

.galp-cookie-trigger--color-neutral,
.galp-cookie-trigger-bar.galp-cookie-trigger--color-neutral {
  --gct-bg: var(--color-text-primary, #111110);
  --gct-bg-hover: #39383a;
}

.galp-cookie-trigger--color-informative,
.galp-cookie-trigger-bar.galp-cookie-trigger--color-informative {
  --gct-bg: var(--color-surface-informative-pure, #122da5);
  --gct-bg-hover: #0d2080;
}

.galp-cookie-trigger--color-positive,
.galp-cookie-trigger-bar.galp-cookie-trigger--color-positive {
  --gct-bg: var(--color-surface-positive-pure, #006650);
  --gct-bg-hover: #004f3e;
}

/*
 * Custom colour: --gct-bg is set inline from the editor's hex value; the hover
 * shade is derived automatically by darkening that colour.
 */
.galp-cookie-trigger--color-custom,
.galp-cookie-trigger-bar.galp-cookie-trigger--color-custom {
  --gct-bg-hover: color-mix(in srgb, var(--gct-bg, #be2e00) 85%, #000);
}

.galp-cookie-trigger__icon {
  display: inline-flex;
}

.galp-cookie-trigger__icon svg {
  display: block;
  width: 1.25em;
  height: 1.25em;
}

/* Floating round button (OneTrust persistent button style). */
.galp-cookie-trigger--floating {
  position: fixed;
  bottom: 20px;
  z-index: 2147483646;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.galp-cookie-trigger--floating .galp-cookie-trigger__icon svg {
  width: 26px;
  height: 26px;
}

.galp-cookie-trigger--floating .galp-cookie-trigger__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.galp-cookie-trigger--floating-left {
  left: 20px;
}

.galp-cookie-trigger--floating-right {
  right: 20px;
}

/* Fixed full-width bar at the bottom of the page. */
.galp-cookie-trigger-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2147483646;
  display: flex;
  justify-content: center;
  padding: 0.5em;
  background: var(--gct-bg, var(--color-action-brand-default, #be2e00));
}

.galp-cookie-trigger-bar .galp-cookie-trigger {
  background: transparent;
}

.galp-cookie-trigger-bar .galp-cookie-trigger:hover,
.galp-cookie-trigger-bar .galp-cookie-trigger:focus {
  background: rgba(255, 255, 255, 0.12);
}
