/* ============================================================
   COOKIE CONSENT (banner + settings dialog)
   Shares the .site-chrome token scope from header.css. Accept and
   reject use the same button style on purpose: refusing must be as
   easy and as visible as accepting.
   ============================================================ */

.cc-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 1000;
  max-width: 1040px;
  margin: 0 auto;
  border-radius: 0;
  background: var(--white);
  color: var(--text);
  box-shadow: 0 20px 50px rgba(11, 29, 51, 0.28), 0 2px 8px rgba(11, 29, 51, 0.14);
}

.cc-banner[hidden] {
  display: none;
}

.cc-banner__inner {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 26px;
}

.cc-banner__text {
  min-width: 0;
}

.cc-banner__title {
  margin: 0 0 6px;
  font: 700 1.0625rem/1.25 var(--font-sans);
  color: var(--ink);
}

.cc-banner__text p {
  margin: 0;
  font: 400 0.875rem/1.55 var(--font-sans);
  color: var(--text-2);
}

.cc-banner a,
.cc-dialog a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cc-banner__actions,
.cc-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}


/* Dialog buttons share the row equally: Accept, Reject, Save. */
.cc-dialog__actions .btn {
  flex: 1 1 0;
  min-width: max-content;
  padding-inline: 14px;
  white-space: nowrap;
}

/* "Customise" is the least prominent choice, so it is a text link, not a button. */
.cc-link-btn {
  padding: 8px 6px;
  border: 0;
  background: none;
  color: var(--ink);
  font: 500 0.875rem/1.2 var(--font-sans);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
  cursor: pointer;
}

.cc-link-btn:hover {
  text-decoration-thickness: 2px;
}

.cc-link-btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 0;
}

.cc-btn--ghost {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

.cc-btn--ghost:hover {
  background: rgba(11, 29, 51, 0.06);
  border-color: var(--ink);
}

.cc-banner .btn:focus-visible,
.cc-dialog .btn:focus-visible,
.cc-dialog__close:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.cc-banner .btn:disabled,
.cc-dialog .btn:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* ---------- Settings dialog ---------- */

.cc-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--white);
  color: var(--text);
  box-shadow: 0 30px 70px rgba(11, 29, 51, 0.35), 0 4px 12px rgba(11, 29, 51, 0.18);
  overflow: auto;
}

.cc-dialog::backdrop {
  background: rgba(11, 29, 51, 0.55);
}

.cc-dialog__panel {
  position: relative;
  margin: 0;
  padding: 28px 28px 24px;
}

.cc-dialog__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.cc-dialog__close:hover {
  background: rgba(11, 29, 51, 0.08);
}

.cc-dialog__title {
  margin: 0 40px 10px 0;
  font: 700 1.375rem/1.2 var(--font-sans);
  letter-spacing: -0.01em;
  color: var(--ink);
}

.cc-dialog__intro {
  margin: 0 0 20px;
  font: 400 0.9rem/1.55 var(--font-sans);
  color: var(--text-2);
}

.cc-cats {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.cc-cat {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.cc-cat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cc-cat__label {
  font: 600 0.9375rem/1.3 var(--font-sans);
  color: var(--ink);
  cursor: pointer;
}

.cc-cat__desc {
  margin: 6px 0 0;
  font: 400 0.84rem/1.5 var(--font-sans);
  color: var(--text-2);
}

/* Toggle: a real checkbox stretched over the track, so it stays keyboard- and screen-reader-native. */
.cc-switch {
  position: relative;
  flex-shrink: 0;
  width: 42px;
  height: 24px;
}

.cc-switch input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.cc-switch input:disabled {
  cursor: not-allowed;
}

.cc-switch__track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #b8bec7;
  transition: background-color 0.2s;
}

.cc-switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s;
}

.cc-switch input:checked + .cc-switch__track {
  background: var(--ink);
}

.cc-switch input:checked + .cc-switch__track::after {
  transform: translateX(18px);
}

.cc-switch input:disabled + .cc-switch__track {
  opacity: 0.55;
}

.cc-switch input:focus-visible + .cc-switch__track {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.cc-dialog__msg:empty {
  display: none;
}

.cc-dialog__msg {
  margin: 0 0 12px;
  font: 400 0.84rem/1.4 var(--font-sans);
  color: #b42318;
}

@media (max-width: 760px) {
  .cc-banner {
    left: 8px;
    right: 8px;
    bottom: 8px;
  }

  .cc-banner__inner {
    gap: 16px;
    padding: 18px;
  }

  /* Phones: stack the buttons, Accept on top, in the same order as on desktop. */
  .cc-banner__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .cc-banner__actions .btn {
    width: 100%;
  }

  .cc-link-btn {
    align-self: center;
  }

  .cc-dialog__panel {
    padding: 22px 18px 18px;
  }
}

/* The dialog is at most 560px wide, so its three buttons only need to stack on genuinely narrow screens. */
@media (max-width: 520px) {
  .cc-dialog__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .cc-dialog__actions .btn {
    flex: 0 0 auto;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cc-switch__track,
  .cc-switch__track::after {
    transition: none;
  }
}
