/* Cookie consent banner (replaces CookieHub) */
.ap-consent[hidden],
.ap-consent [hidden] { display: none !important; }

.ap-consent__bar {
  position: fixed;
  z-index: 100000;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 2rem;
  padding: 1.25rem max(1rem, calc((100vw - 1336px) / 2));
  background: #fff;
  color: #000;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
  font-family: 'Open Sans', sans-serif;
  font-size: 0.95rem;
  line-height: 1.5;
}

.ap-consent__text { flex: 1 1 32rem; }
.ap-consent__text p { margin: 0; }

.ap-consent__title {
  margin: 0 0 0.35rem;
  font-family: 'Poppins', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
}

.ap-consent a { color: #4b5ac3; text-decoration: underline; }

.ap-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Accept and reject look the same on purpose: rejecting must be as easy as accepting. */
.ap-consent__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.6rem 1.25rem;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
  background: #2d9595;
  border: 1px solid #2d9595;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.ap-consent__btn:hover { background: #fff; color: #2d9595; }

.ap-consent__btn--ghost { background: #fff; color: #2d9595; }
.ap-consent__btn--ghost:hover { background: #2d9595; color: #fff; }

.ap-consent__btn:focus-visible,
.ap-consent__close:focus-visible,
.ap-consent__switch:focus-visible,
.ap-consent-link:focus-visible {
  outline: 3px solid #4b5ac3;
  outline-offset: 2px;
}

.ap-consent__overlay {
  position: fixed;
  z-index: 100001;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.ap-consent__panel {
  position: fixed;
  z-index: 100002;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  width: min(36rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  background: #fff;
  color: #000;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  font-family: 'Open Sans', sans-serif;
  font-size: 0.95rem;
  line-height: 1.5;
}

.ap-consent__panel:focus { outline: none; }

.ap-consent__panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 0.75rem;
  border-bottom: 1px solid #ecf0f6;
}

.ap-consent__panel-head .ap-consent__title { margin: 0; }

.ap-consent__close {
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.75rem;
  line-height: 1;
  color: #000;
  background: none;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.ap-consent__panel-body {
  overflow-y: auto;
  padding: 0.5rem 1.5rem;
}

.ap-consent__cat {
  padding: 0.85rem 0;
  border-bottom: 1px solid #ecf0f6;
}

.ap-consent__cat p { margin: 0.25rem 0 0; color: #323d4e; font-size: 0.9rem; }

.ap-consent__cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
}

.ap-consent__cat-name { font-weight: 600; }
.ap-consent__always { font-size: 0.85rem; font-weight: 600; color: #235041; }

/* Toggle switch */
.ap-consent .ap-consent__switch {
  appearance: none;
  position: relative;
  flex-shrink: 0;
  display: inline-block;
  width: 3rem;
  height: 1.6rem;
  margin: 0;
  background: #c9d1de;
  border: 0;
  border-radius: 1rem;
  box-shadow: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

.ap-consent .ap-consent__switch::after {
  content: '';
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: 1.2rem;
  height: 1.2rem;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.ap-consent .ap-consent__switch:checked { background: #2d9595; background-image: none; }
.ap-consent .ap-consent__switch:checked::after { transform: translateX(1.4rem); }

.ap-consent__id { margin: 1rem 0 0.5rem; font-size: 0.8rem; color: #323d4e; }
.ap-consent__id code { word-break: break-all; }

.ap-consent__actions--panel {
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid #ecf0f6;
}

.ap-consent__actions--panel .ap-consent__btn { flex: 1 1 9rem; }

/* Footer link */
.ap-consent-link {
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  background: none;
  border: 0;
  cursor: pointer;
}

/* Declaration table ([ap_cookie_declaration]) */
.ap-consent-table-wrap { overflow-x: auto; }
.ap-consent-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.ap-consent-table th,
.ap-consent-table td { padding: 0.5rem; text-align: left; vertical-align: top; border-bottom: 1px solid #dee5f0; }

@media (max-width: 600px) {
  .ap-consent__bar { padding: 1rem; font-size: 0.9rem; max-height: 85vh; overflow-y: auto; }
  .ap-consent__actions { width: 100%; }
  .ap-consent__bar .ap-consent__btn { flex: 1 1 100%; }
}

@media print {
  .ap-consent { display: none !important; }
}

.site-footer__cookie-settings-wrap { margin: 1.5rem 0 0; font-size: 0.9rem; }

/* Very short screens: scroll the whole panel instead of squeezing the list */
@media (max-height: 560px) {
  .ap-consent__panel { overflow-y: auto; }
  .ap-consent__panel-body { overflow: visible; flex: 0 0 auto; }
}
