/* Cookie consent banner + external media permission dialog */

.ijc-consent[hidden],
.ijc-consent-ask[hidden],
.ijc-consent [hidden] {
  display: none !important;
}

.ijc-consent {
  position: fixed;
  left: 24px;
  right: 24px;
  bottom: 24px;
  z-index: 11000;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "body actions"
    "prefs prefs";
  align-items: center;
  column-gap: 40px;
  max-width: 1240px;
  max-height: calc(100vh - 48px);
  margin: 0 auto;
  overflow-y: auto;
  padding: 22px 24px 22px 28px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(var(--navy-rgb), .18), 0 2px 8px rgba(var(--navy-rgb), .06);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.6;
  box-sizing: border-box;
}

.ijc-consent__body {
  grid-area: body;
  max-width: 760px;
}

.ijc-consent__title {
  margin: 0 0 4px;
  color: var(--navy);
  font-size: 1.25rem;
  font-weight: var(--fw-heavy);
  letter-spacing: -.01em;
  line-height: 1.3;
}

.ijc-consent__text {
  margin: 0;
}

.ijc-consent a {
  color: var(--accent);
  font-weight: var(--fw-semibold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ijc-consent__prefs {
  grid-area: prefs;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0 0;
}

.ijc-consent__cat {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.ijc-consent__cat p {
  margin: 4px 0 0;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.ijc-consent__cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

label.ijc-consent__cat-head {
  cursor: pointer;
}

.ijc-consent__cat-title {
  color: var(--heading);
  font-weight: var(--fw-bold);
}

.ijc-consent__always {
  color: var(--teal);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
}

.ijc-consent__switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 40px;
  height: 22px;
  margin: 0;
  border-radius: var(--radius-pill);
  background: var(--slate-400);
  cursor: pointer;
  transition: background .2s;
}

.ijc-consent__switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
}

.ijc-consent__switch:checked {
  background: var(--accent);
}

.ijc-consent__switch:checked::after {
  transform: translateX(18px);
}

.ijc-consent__switch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ijc-consent__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.ijc-consent > .ijc-consent__actions {
  grid-area: actions;
}

.ijc-consent__btn {
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  font: inherit;
  font-size: var(--fs-body);
  font-weight: var(--fw-bold);
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s, box-shadow .15s;
}

.ijc-consent__btn--primary {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 8px 20px rgba(var(--navy-rgb), .28);
}

.ijc-consent__btn--primary:hover {
  background: var(--navy-800);
}

.ijc-consent__btn--outline {
  background: #eef1f7;
  color: var(--navy);
}

.ijc-consent__btn--outline:hover {
  background: #e2e7f1;
}

.ijc-consent__btn--ghost {
  padding: 0 6px;
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.ijc-consent__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* The WhatsApp button would cover the banner's buttons */
body.ijc-consent-open .wa-widget {
  display: none;
}

@media (max-width: 900px) {
  .ijc-consent {
    left: 12px;
    right: 12px;
    bottom: 12px;
    grid-template-columns: 1fr;
    grid-template-areas:
      "body"
      "prefs"
      "actions";
    row-gap: 16px;
    padding: 20px;
    font-size: var(--fs-small);
  }

  .ijc-consent__title {
    font-size: 1.125rem;
  }

  .ijc-consent__prefs {
    grid-template-columns: 1fr;
    margin: 0;
  }

  .ijc-consent > .ijc-consent__actions {
    justify-content: stretch;
  }

  .ijc-consent__actions .ijc-consent__btn--outline,
  .ijc-consent__actions .ijc-consent__btn--primary {
    flex: 1 1 0;
  }

  .ijc-consent__actions .ijc-consent__btn--ghost {
    flex: 1 0 100%;
    order: 3;
    min-height: 32px;
  }

}

.ijc-consent-ask {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.ijc-consent-ask__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 20, 45, .55);
}

.ijc-consent-ask__dialog {
  position: relative;
  width: min(420px, 100%);
  padding: 22px;
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: 0 28px 70px rgba(8, 20, 45, .28);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-small);
  line-height: 1.55;
}

.ijc-consent-ask__dialog p {
  margin: 0 0 10px;
}

.ijc-consent-ask__link {
  margin-bottom: 16px !important;
}

.ijc-consent-ask__link a {
  color: var(--accent);
  font-weight: var(--fw-semibold);
}
