/* ------------------------------------------------------------------
 * Cookie consent banner + preference centre
 * Matches the Toronto Harriers CMS design tokens (CSS custom props).
 * ------------------------------------------------------------------ */

/* ---------- Bottom banner ---------- */
.cc-banner {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 9998;
  width: min(960px, calc(100vw - 32px));
  background: #ffffff;
  color: #1f2937;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.25),
              0 4px 10px rgba(0, 0, 0, 0.08);
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px 24px;
  align-items: center;
  font-family: var(--font-body, system-ui, -apple-system, sans-serif);
  font-size: 14px;
  line-height: 1.5;
}

/* Opt-in (EU/UK/Quebec): more prominent, block-style */
.cc-banner--opt_in {
  background: #ffffff;
  border-color: color-mix(in srgb, var(--primary-color, #2563eb) 25%, transparent);
  border-width: 1px;
}

.cc-banner__body { min-width: 0; }
.cc-banner__title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-heading, inherit);
  color: #111827;
}
.cc-banner__text { margin: 0 0 8px; color: #374151; }
.cc-banner__links { margin: 0; font-size: 12px; color: #6b7280; }
.cc-banner__link {
  color: var(--primary-color, #2563eb);
  text-decoration: underline;
}

.cc-banner__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ---------- Buttons ---------- */
.cc-btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
  font-family: inherit;
  white-space: nowrap;
}
.cc-btn--primary {
  background: var(--primary-color, #2563eb);
  color: var(--button-text-color, #ffffff);
  border-color: var(--primary-color, #2563eb);
}
.cc-btn--primary:hover {
  background: var(--button-hover-bg-color, color-mix(in srgb, var(--primary-color, #2563eb) 85%, #000));
  border-color: var(--button-hover-bg-color, color-mix(in srgb, var(--primary-color, #2563eb) 85%, #000));
}
.cc-btn--secondary {
  background: #f3f4f6;
  color: #111827;
  border-color: #e5e7eb;
}
.cc-btn--secondary:hover { background: #e5e7eb; }
.cc-btn--ghost {
  background: transparent;
  color: #374151;
  border-color: transparent;
}
.cc-btn--ghost:hover { background: #f3f4f6; }
.cc-btn--link {
  background: transparent;
  color: var(--primary-color, #2563eb);
  text-decoration: underline;
  padding: 0;
  border: 0;
}

/* ---------- Preference modal ---------- */
.cc-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.cc-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}
.cc-modal__panel {
  position: relative;
  background: #ffffff;
  color: #1f2937;
  border-radius: 14px;
  max-width: 560px;
  width: 100%;
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 24px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.4);
  font-family: var(--font-body, system-ui, -apple-system, sans-serif);
}
.cc-modal__title {
  margin: 0 0 4px;
  font-size: 20px;
  font-family: var(--font-heading, inherit);
  color: #111827;
}
.cc-modal__intro {
  margin: 0 0 16px;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.5;
}

.cc-row {
  display: block;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.cc-row:hover { border-color: #d1d5db; background: #f9fafb; }
.cc-row__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cc-row__label {
  font-weight: 600;
  color: #111827;
  font-size: 14px;
}
.cc-row__desc {
  display: block;
  margin-top: 4px;
  color: #6b7280;
  font-size: 12.5px;
  line-height: 1.45;
}
.cc-row input[type=checkbox] {
  width: 38px;
  height: 22px;
  appearance: none;
  background: #e5e7eb;
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background-color 0.15s;
}
.cc-row input[type=checkbox]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #ffffff;
  border-radius: 999px;
  transition: transform 0.15s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.cc-row input[type=checkbox]:checked {
  background: var(--primary-color, #2563eb);
}
.cc-row input[type=checkbox]:checked::after { transform: translateX(16px); }
.cc-row input[type=checkbox]:disabled { opacity: 0.65; cursor: not-allowed; }

.cc-dnssmp {
  border: 1px solid #fde68a;
  background: #fffbeb;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 14px 0 0;
  font-size: 13px;
}
.cc-dnssmp h3 {
  margin: 0 0 4px;
  font-size: 14px;
  color: #92400e;
}
.cc-dnssmp p {
  margin: 0 0 8px;
  color: #78350f;
}

.cc-modal__footer {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

/* ---------- Footer preference link styling (inherits host footer colour) ---------- */
.cc-footer-link {
  color: inherit;
  text-decoration: underline;
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .cc-banner {
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    width: 100%;
    border-radius: 12px 12px 0 0;
    grid-template-columns: 1fr;
    padding: 16px 18px calc(env(safe-area-inset-bottom, 0) + 16px);
  }
  .cc-banner__actions { justify-content: stretch; }
  .cc-banner__actions .cc-btn { flex: 1 1 auto; }
}

/* ---------- Print: hide entirely ---------- */
@media print {
  .cc-banner, .cc-modal { display: none !important; }
}
