/*
 * The cookie banner (vanilla-cookieconsent v3.1.0, TA-1689), styled as on the
 * website. Everything below the first block is the website's own override
 * (assets/css/src.css, "Cookie consent ... brand overrides") copied unchanged but
 * for the cookie icon's URL (app/assets/images/cookie.svg here),
 * so the two banners can be compared line for line. The first block gives the
 * website's token names their app values (tokens.css, the Tailwind theme).
 * The library's base stylesheet is vendor/cookieconsent.css, loaded before this.
 */
#cc-main {
  --corner-scale: 1;
  --radius-md: calc(6px * var(--corner-scale));
  --radius-lg: calc(8px * var(--corner-scale));
  --radius-xl: calc(12px * var(--corner-scale));
  --btn-radius: var(--radius-lg);
  --btn-radius-sm: var(--radius-md);
  --btn-h-sm: 36px;
  --btn-h-md: 44px;
  --font-size-body-lg: 1.125rem;
  --font-size-body: 1rem;
  --font-size-body-sm: 0.875rem;
  --text-primary: var(--ink);
  --text-body: var(--ink-muted);
  --surface-page: var(--canvas);
  --accent: var(--color-orange-500);
  --bone-200: var(--color-bone-200);
  --bone-300: var(--color-bone-300);
  --bone-400: var(--color-bone-400);
  --overlay-bg: var(--scrim);
  --overlay-blur: var(--scrim-blur);
}
/* Squircle corners are drawn at twice the radius, as on the website. */
@supports (corner-shape: squircle) {
  #cc-main {
    --corner-scale: 2;
  }
}

#cc-main {
  --cc-font-family: "Plus Jakarta Sans", "Plus Jakarta Sans Fallback", sans-serif;
  --cc-btn-primary-bg: var(--primary);
  --cc-btn-primary-color: var(--primary-fg);
  --cc-btn-primary-hover-bg: var(--primary-hover);
  --cc-btn-secondary-bg: var(--bone-200);
  --cc-btn-secondary-color: var(--ink);
  --cc-btn-secondary-hover-bg: var(--bone-400);
  --cc-link-color: var(--accent);
  /* Toggles: ink = on, danger red = off (ink tick / red cross on the white knob). Readonly
     (strictly-necessary) keeps the library default. */
  --cc-toggle-on-bg: var(--ink);
  --cc-toggle-off-bg: var(--danger);
  --cc-toggle-on-knob-bg: var(--surface-page);
  --cc-toggle-enabled-icon-color: var(--ink);
  --cc-toggle-disabled-icon-color: var(--danger);
  /* No block fill behind each category row — a divider line separates them instead (see below) */
  --cc-cookie-category-block-bg: transparent;
  --cc-cookie-category-block-hover-bg: transparent;
  --cc-cookie-category-block-border: transparent;
  --cc-modal-margin: 24px; /* gap from the viewport edge, so it clears page content */
  --cc-modal-border-radius: var(--radius-xl);
  --cc-btn-border-radius: var(--btn-radius); /* 40px tall: same step as the default button */
  --cc-overlay-bg: var(--overlay-bg); /* the same frosted wash as the open nav menu */
}
#cc-main .pm-overlay {
  -webkit-backdrop-filter: blur(var(--overlay-blur));
  backdrop-filter: blur(var(--overlay-blur));
}

/* Consent card — generous, even padding so the minimal copy breathes. Overrides the library's
   tighter per-section padding; ID specificity beats its .cm--box rules. */
#cc-main .cm__texts {
  padding: 28px 28px 18px !important;
}
/* Cookie icon sits inline, to the left of the title */
#cc-main .cm__title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 !important;
  font-size: var(--font-size-body-lg);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-transform: none;
}
#cc-main .cm__title::before {
  content: "";
  flex: none;
  width: 22px;
  height: 22px;
  background: url("/assets/cookie-6f8bf3e6.svg") no-repeat center / contain;
}
#cc-main .cm__desc {
  padding: 0 !important;
  font-size: var(--font-size-body-sm);
  line-height: 1.55;
  color: var(--text-body);
}

/* All three actions in one horizontal row, equal width. display:contents flattens the library's
   button groups so every button shares the same flex row. */
#cc-main .cm__btns {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px;
  padding: 4px 28px 28px !important;
  border-top: none !important;
}
/* Dissolve BOTH the inner groups and the library's "uneven" wrapper (which otherwise pushes the
   preferences button off to one side with space-between), so all three buttons become direct flex
   children of .cm__btns and split the row equally. */
#cc-main .cm__btn-group,
#cc-main .cm__btn-group--uneven {
  display: contents !important;
}
/* Banner and panel buttons are the site's default .btn (the nav's "Start a sprint"): 44px tall,
   20px side padding, 15/500, hugging their label. The library sets `all: initial` on <button>,
   which also wipes the font smoothing (so labels render heavier than the nav) and corner-shape
   (so corners fall back to plain arcs); both are restored here. */
#cc-main .cm__btn,
#cc-main .pm__btn {
  flex: 0 0 auto !important;
  min-width: 0 !important;
  height: var(--btn-h-md) !important;
  min-height: 0 !important;
  padding: 0 20px !important;
  border-radius: var(--btn-radius) !important;
  font-family: "Plus Jakarta Sans", "Plus Jakarta Sans Fallback", sans-serif !important;
  font-size: var(--font-size-body) !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  letter-spacing: -0.01em !important;
  border: 1px solid transparent !important; /* a 1px line on every variant, as .btn */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  outline: none !important;
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease,
    box-shadow 0.3s ease !important;
}
#cc-main .cm__btn:focus-visible,
#cc-main .pm__btn:focus-visible,
#cc-main .cm__close-x:focus-visible,
#cc-main .pm__close-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}
/* Variants — the same colours, lines, hover and pressed states as .btn--primary / --secondary /
   --ghost (the library can't take our classes, so they are restated here).
   Primary: Accept all (banner and panel). */
#cc-main .cm__btn[data-role="all"],
#cc-main .pm__btn[data-role="all"] {
  color: var(--primary-fg) !important;
  background: var(--primary) !important;
  border-color: var(--primary-line) !important;
}
#cc-main .cm__btn[data-role="all"]:hover,
#cc-main .pm__btn[data-role="all"]:hover {
  background: var(--primary-hover) !important;
  border-color: var(--primary-hover-line) !important;
}
#cc-main .cm__btn[data-role="all"]:active,
#cc-main .pm__btn[data-role="all"]:active {
  background: var(--primary-active) !important;
  border-color: var(--primary-active-line) !important;
}
/* Secondary: Settings and Reject in the banner, Save my choices in the panel. */
#cc-main .cm__btn[data-role="necessary"],
#cc-main .cm__btn[data-role="show"],
#cc-main .pm__btn[data-role="save"] {
  color: var(--ink-muted) !important;
  background: var(--surface) !important;
  border-color: var(--hairline) !important;
}
#cc-main .cm__btn[data-role="necessary"]:hover,
#cc-main .cm__btn[data-role="show"]:hover,
#cc-main .pm__btn[data-role="save"]:hover {
  color: var(--ink) !important;
  background: var(--surface-hover) !important;
  border-color: var(--hairline-hover) !important;
}
#cc-main .cm__btn[data-role="necessary"]:active,
#cc-main .cm__btn[data-role="show"]:active,
#cc-main .pm__btn[data-role="save"]:active {
  color: var(--ink) !important;
  background: var(--sunk) !important;
  border-color: var(--hairline-active) !important;
}
/* Ghost: Reject non-essential in the panel. */
#cc-main .pm__btn[data-role="necessary"] {
  color: var(--ink-muted) !important;
  background: transparent !important;
  border-color: transparent !important;
}
#cc-main .pm__btn[data-role="necessary"]:hover {
  color: var(--ink) !important;
  background: var(--hover) !important;
  border-color: var(--hairline-hover) !important;
}
#cc-main .pm__btn[data-role="necessary"]:active {
  color: var(--ink) !important;
  background: var(--surface) !important;
  border-color: var(--hairline-active) !important;
}
@supports (corner-shape: squircle) {
  #cc-main .cm__btn,
  #cc-main .pm__btn,
  #cc-main .cm__close-x,
  #cc-main .pm__close-btn {
    corner-shape: squircle;
  }
}
/* The library adds a top margin between stacked buttons/groups for its column layout. In our single
   row that offsets the later buttons and, under align-items:stretch, shrinks them — zero it so all
   three sit at the same height and their labels line up. */
#cc-main .cm__btn + .cm__btn,
#cc-main .cm__btn-group + .cm__btn-group {
  margin: 0 !important;
}
/* Banner buttons split the row equally — bigger targets, and Settings carries the same weight as
   Accept all */
#cc-main .cm__btn {
  flex: 1 1 50% !important;
}
/* Fixed left-to-right order once the groups are flattened */
#cc-main .cm__btn[data-role="all"] {
  order: 1;
}
#cc-main .cm__btn[data-role="necessary"] {
  order: 2;
}
#cc-main .cm__btn[data-role="show"] {
  order: 3;
}
/* Close buttons — the app's .btn-ghost: muted-ink cross on nothing at rest; on hover a faint fill and
   hairline appear and the cross goes full ink. Shared by the banner's injected Reject-X (top-right)
   and the preferences panel's close button. */
#cc-main .cm__close-x {
  position: absolute;
  top: 20px;
  right: 20px;
}
#cc-main .cm__close-x,
#cc-main .pm__close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--btn-h-sm);
  height: var(--btn-h-sm);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--btn-radius-sm); /* the 36px step */
  color: var(--ink-muted);
  cursor: pointer;
  outline: none;
  transition:
    background-color 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease,
    box-shadow 0.3s ease;
}
#cc-main .cm__close-x:hover,
#cc-main .pm__close-btn:hover {
  background: var(--hover);
  border-color: var(--hairline-hover);
  color: var(--ink);
}
#cc-main .cm__close-x:active,
#cc-main .pm__close-btn:active {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--hairline-active);
}
/* The library's cross is a 15/24 path scaled to half the button; size it to match the banner's
   16px icon (an 8px cross at a 1.33px stroke) and let it follow the button's text colour. */
#cc-main .pm__close-btn span {
  align-items: center;
  justify-content: center;
}
#cc-main .pm__close-btn svg,
#cc-main .pm__close-btn:hover svg {
  width: 13px;
  height: 13px;
  transform: none;
  stroke: currentColor;
  stroke-width: 2.5;
}
/* Explicit icon size — beats the base reset's `svg { height: auto }`, which otherwise ignores the
   SVG's width/height attributes and leaves the cross oversized. */
#cc-main .cm__close-x svg {
  width: 16px;
  height: 16px;
}

/* Card size — width is set; height hugs its content (no forced ratio, so no empty space). 400px lands
   the natural content height at roughly 16:9. A hard 16:9 lock with a content-hugging height can't be
   expressed reliably in CSS for text (width → line wrapping → height is circular), so nudge this one
   width value if the ratio looks off. Full width on mobile (below). */
#cc-main .cm--box {
  width: 440px !important;
  max-width: calc(100vw - 48px) !important;
}
@media (max-width: 640px) {
  #cc-main .cm--box {
    left: 12px !important;
    right: 12px !important;
    bottom: 12px !important;
    margin: 0 !important; /* the library's bottom-right placement adds a 24px left margin */
    width: auto !important;
    max-width: none !important;
    aspect-ratio: auto; /* full-width sheet sizes to its content, not a fixed ratio */
    justify-content: flex-start;
  }
}

/* ---- Preferences modal (the "Customise" panel) ---- */

/* Title — cookie icon to the left, same weight/size as the banner's "Your data, your choice" */
#cc-main .pm__title {
  gap: 8px;
  font-size: var(--font-size-body-lg) !important;
  font-weight: 500 !important;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
#cc-main .pm__title::before {
  content: "";
  flex: none;
  width: 22px;
  height: 22px;
  background: url("/assets/cookie-6f8bf3e6.svg") no-repeat center / contain;
}

/* Taller panel so the content fits without a small scrollbar — hugs content up to the viewport */
#cc-main .pm--box {
  height: auto !important;
  max-height: calc(100vh - 3em) !important;
}

/* Category rows — no block fill or box border; a 1px bone divider separates the toggle rows */
#cc-main .pm__section,
#cc-main .pm__section--toggle,
#cc-main .pm__section-desc-wrapper {
  border: none !important;
  border-radius: 0 !important;
  margin-bottom: 0 !important;
}
#cc-main .pm__section--toggle + .pm__section--toggle {
  border-top: 1px solid var(--bone-300) !important;
}
#cc-main .pm__section-title {
  background: transparent !important;
  border: none !important;
}
/* Chevron — no circle behind it */
#cc-main .pm__section-arrow {
  background: transparent !important;
}
/* Expanded category detail — 13px body text, tucked up under its label and starting at the label's
   left edge (the title button insets its text by 3.4em of its 15.2px font, ≈52px). */
#cc-main .pm__section--toggle .pm__section-desc-wrapper {
  /* pulls into the title's 16.7px bottom padding: ~13px from label to detail. On the wrapper, not the
     text — the library clips the wrapper's overflow, which would cut off the first line. */
  margin-top: -8px !important;
}
#cc-main .pm__section--toggle .pm__section-desc {
  padding: 0 82px 18px 52px; /* right inset matches the title's 5.4em, so text wraps before the toggle */
  font-size: var(--font-size-body-sm);
  line-height: 1.55;
  color: var(--text-body);
}
/* Space around the toggle group: ~40px from the intro paragraph's last line to the first row's label,
   a little more (~52px) from the last row's label to "Your California rights" (each row already pads
   its label ~20px top and bottom). The library renders the group as an inline element, which ignores
   vertical spacing, so make it a block first. */
#cc-main .pm__section-toggles {
  display: block;
  margin-top: 18px !important;
}
#cc-main .pm__section-toggles + .pm__section {
  margin-top: 16px !important;
}

/* Footer — Save my choices (secondary) then Reject non-essential (ghost) on the left;
   Accept all (primary) alone on the right. Colours come from the variant rules above. display:contents flattens the library's two button groups so `order` can rearrange all
   three; !important beats the library's mobile `display:flex!important` on the groups. */
#cc-main .pm__footer {
  gap: 10px;
}
#cc-main .pm__btn-group {
  display: contents !important;
}
#cc-main .pm__btn + .pm__btn,
#cc-main .pm__btn-group + .pm__btn-group {
  margin: 0 !important;
}
#cc-main .pm__btn[data-role="save"] {
  order: 1;
}
#cc-main .pm__btn[data-role="necessary"] {
  order: 2;
  margin-right: auto !important;
}
#cc-main .pm__btn[data-role="all"] {
  order: 3;
}
/* Phones — the library stacks the footer into a column; lead with the primary action */
@media (max-width: 640px) {
  #cc-main .pm__btn[data-role="all"] {
    order: 1;
  }
  #cc-main .pm__btn[data-role="save"] {
    order: 2;
  }
  #cc-main .pm__btn[data-role="necessary"] {
    order: 3;
    margin-right: 0 !important;
  }
}
