/* ===== Cookie consent banner (every public page) =====
   Built and inserted by js/cookie-consent.js, so there is no markup to keep in
   step across pages; this file only styles it. Linked from every page that
   loads main.js.

   A small card fixed to the bottom-centre of the screen (full width, inset
   12px, on phones). It never covers the page with a backdrop, so the page stays
   readable and scrollable behind it. z-index 100 sits above the sticky nav
   (50), its mega menus (60) and the back-to-top button (40).

   The three main buttons share one style on purpose: "Accept all" must not
   look more inviting than "Reject non-essential". Don't give one of them a
   filled variant. */

.cc {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 24px;
  margin: 0 auto;   /* centres it; a transform would fight the slide-in animation */
  z-index: 100;
  width: min(560px, calc(100% - 48px));
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  padding: 20px 24px 22px;
  background: #131316;
  color: var(--text, #f5f5f7);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 14px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, .5);
  font-family: var(--font-body, "Manrope", "Manrope Fallback", "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
  animation: cc-in .28s ease-out both;
}
.cc [hidden] { display: none !important; }

@keyframes cc-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.cc__title {
  margin: 0 0 8px;
  font-family: var(--font-heading, "Cairo", "Cairo Fallback", "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
  font-size: 18px;
  font-weight: 600;
  line-height: 24px;
  color: #fff;
}
.cc__text {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 21px;
  color: var(--text-muted, #b5b5bd);
}
.cc__link {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--brand-orange, #f57e20);
}
.cc__link:hover { color: var(--brand-orange, #f57e20); }

/* Buttons: one shared style, the site's outlined brand-orange button. */
.cc__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.cc__btn {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  background: transparent;
  color: var(--brand-orange, #f57e20);
  border: 1.5px solid var(--brand-orange, #f57e20);
  border-radius: var(--radius, 8px);
  font-family: "Cairo", "Cairo Fallback", var(--font-heading, "Cairo", "Cairo Fallback", "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
  font-size: 14px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
.cc__btn:hover {
  background: var(--brand-orange, #f57e20);
  color: #0a0a0b;
}

/* Visible focus for every control in the banner: a white ring reads on the dark card. */
.cc__btn:focus-visible,
.cc__link:focus-visible,
.cc__switch-input:focus-visible + .cc__switch-track {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* Settings panel */
.cc__cats {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  border-top: 1px solid rgba(255, 255, 255, .12);
}
.cc__cat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.cc__cat-name {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
  color: #fff;
  cursor: pointer;
}
.cc__cat-desc {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 19px;
  color: var(--text-muted, #b5b5bd);
}

/* Toggle switch: a real checkbox (role="switch") laid over a drawn track, so
   it keeps native keyboard, focus and screen-reader behaviour. */
.cc__switch {
  position: relative;
  flex: none;
  width: 46px;
  height: 26px;
}
.cc__switch-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.cc__switch-track {
  position: absolute;
  inset: 0;
  border-radius: 13px;
  background: #71717b;
  transition: background-color .15s;
}
.cc__switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform .15s;
}
.cc__switch-input:checked + .cc__switch-track { background: var(--brand-orange, #f57e20); }
.cc__switch-input:checked + .cc__switch-track::after { transform: translateX(20px); }
.cc__switch-input:disabled { cursor: not-allowed; }
.cc__switch-input:disabled + .cc__switch-track { opacity: .55; }

/* Phones: inset card, buttons stacked full width. */
@media (max-width: 600px) {
  .cc {
    left: 12px;
    right: 12px;
    bottom: 12px;
    margin: 0;
    width: auto;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    padding: 16px 16px 18px;
  }
  .cc__title { font-size: 17px; }
  .cc__text { margin-bottom: 12px; }
  .cc__actions { flex-direction: column; gap: 8px; }
  .cc__btn { flex: none; width: 100%; min-height: 42px; }
}

/* Tablet only: on first paint, Safari can report 100dvh using its taller
   pre-scroll chrome state before the address bar has settled, so the card
   sizes a bit larger than what's actually visible and its top gets clipped
   until the user scrolls once. svh is the guaranteed-smallest viewport
   (chrome fully shown), so capping against it keeps the whole card on-screen
   from the very first paint instead of requiring a scroll to reveal it. */
@media (min-width: 601px) and (max-width: 1210px) {
  .cc { max-height: calc(100svh - 48px); }
}

@media (prefers-reduced-motion: reduce) {
  .cc { animation: none; }
  .cc__btn,
  .cc__switch-track,
  .cc__switch-track::after { transition: none; }
}

@media print {
  .cc { display: none; }
}
