/* ===== Cookie consent (Front #218) =====
   A bottom sheet, not a wall: the page stays usable behind it. Linked only on
   a site whose banner exists (`site.consent`). */

.cookie-consent {
  position: fixed;
  right: 1.6rem;
  bottom: 1.6rem;
  left: 1.6rem;
  z-index: 20;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.cookie-consent[hidden] {
  display: none;
}

.cookie-consent__panel {
  width: min(72rem, 100%);
  max-height: calc(100vh - 3.2rem);
  overflow: auto;
  padding: 2.4rem;
  border-radius: var(--ui-radius, 0);
  background: var(--color-background);
  color: var(--color-font);
  box-shadow: 0 1.2rem 4rem rgb(23 23 23 / 25%);
  pointer-events: auto;
}

.cookie-consent__title {
  margin: 0 0 0.8rem;
  font-family: var(--font-heading);
  font-size: 2.4rem;
  line-height: 1.2;
}

.cookie-consent__body {
  margin: 0 0 1.6rem;
  font-size: 1.5rem;
  line-height: 1.6;
}

.cookie-consent__policy {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.cookie-consent__choices {
  display: grid;
  gap: 1.6rem;
  margin: 0 0 1.6rem;
}

.cookie-consent__choices[hidden] {
  display: none;
}

.cookie-consent__category {
  margin: 0;
  padding: 1.2rem 1.6rem;
  border: 1px solid rgb(23 23 23 / 15%);
  border-radius: var(--ui-radius, 0);
}

.cookie-consent__category-head {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0;
  font-weight: 600;
}

.cookie-consent__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
}

.cookie-consent__toggle input {
  width: 1.8rem;
  height: 1.8rem;
  accent-color: var(--color-primary);
}

.cookie-consent__always {
  color: var(--color-light-grey);
  font-size: 1.3rem;
  font-weight: 400;
}

.cookie-consent__category-note {
  margin: 0.4rem 0 0.8rem;
  color: var(--color-light-grey);
  font-size: 1.4rem;
}

.cookie-consent__table-wrap {
  overflow-x: auto;
}

.cookie-consent__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.3rem;
}

.cookie-consent__table th,
.cookie-consent__table td {
  padding: 0.4rem 0.8rem 0.4rem 0;
  border-top: 1px solid rgb(23 23 23 / 10%);
  text-align: left;
  vertical-align: top;
}

.cookie-consent__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1rem;
}

.cookie-consent__actions .btn {
  align-self: auto;
  padding: 1.2rem 2rem;
}

.cookie-consent__actions .btn[hidden] {
  display: none;
}

.cookie-consent__ghost {
  background: transparent;
  color: var(--color-font);
  box-shadow: inset 0 0 0 1px currentColor;
}

/* The footer's way back to the banner: a button that reads as the links beside it. */
.site-footer__cookie-settings {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.site-footer__cookie-settings:hover,
.site-footer__cookie-settings:focus-visible {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .cookie-consent {
    right: 0;
    bottom: 0;
    left: 0;
  }

  .cookie-consent__panel {
    max-height: 85vh;
    padding: 2rem 1.6rem;
  }

  .cookie-consent__actions .btn {
    flex: 1 1 100%;
  }
}
