/* Green Medi consent manager — reuses the site's own colour tokens (site.css :root)
   so the banner reads as part of the existing design, not a bolted-on widget. */

.consent {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 24px;
}

.consent[hidden] {
  display: none;
}

.consent__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 21, 16, 0.5);
  backdrop-filter: blur(2px);
}

.consent__modal {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: min(88vh, 780px);
  overflow-y: auto;
  padding: 34px 36px 28px;
  background: var(--white, #fffdf8);
  border: 1px solid var(--line, #d8d0c2);
  border-radius: 18px;
  box-shadow: 0 30px 70px -20px rgba(15, 21, 16, 0.35);
  font-family: var(--sans, "Source Sans 3", sans-serif);
  color: var(--ink, #1a2118);
  animation: consent-rise 220ms ease;
}

@keyframes consent-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.consent__layer {
  display: none;
}

.consent__layer.is-active {
  display: block;
}

.consent__logo {
  max-height: 40px;
  width: auto;
  margin-bottom: 16px;
  object-fit: contain;
}

.consent__title {
  margin: 0 0 12px;
  font-family: var(--display, serif);
  font-size: clamp(1.4rem, 2vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--green-deep, #14341f);
}

.consent__desc {
  margin: 0 0 14px;
  color: var(--muted, #5f675a);
  font-size: 0.96rem;
  line-height: 1.55;
}

.consent__links {
  margin: 0 0 22px;
  font-size: 0.85rem;
}

.consent__links a {
  color: var(--green, #1f4d2e);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.consent__links span {
  margin: 0 8px;
  color: var(--line, #d8d0c2);
}

.consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.consent__btn {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 46px;
  padding: 12px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}

.consent__btn:active {
  transform: translateY(1px);
}

/* Accept-all and necessary-only are deliberately equal in size, weight and
   contrast (no dark pattern steering the visitor toward either choice). */
.consent__btn--primary,
.consent__btn--secondary {
  color: var(--white, #fff);
  background: var(--green, #1f4d2e);
  border-color: var(--green, #1f4d2e);
}

.consent__btn--primary:hover,
.consent__btn--secondary:hover {
  background: var(--green-deep, #14341f);
  border-color: var(--green-deep, #14341f);
}

.consent__btn--secondary {
  color: var(--green-deep, #14341f);
  background: var(--white, #fff);
  border-color: var(--ink, #1a2118);
}

.consent__btn--secondary:hover {
  color: var(--white, #fff);
  background: var(--ink, #1a2118);
}

.consent__btn--ghost {
  flex: 0 1 auto;
  color: var(--ink, #1a2118);
  background: transparent;
  border-color: var(--line, #d8d0c2);
}

.consent__btn--ghost:hover {
  border-color: var(--ink, #1a2118);
}

.consent__categories {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}

.consent__category {
  border: 1px solid var(--line, #d8d0c2);
  border-radius: 12px;
  overflow: hidden;
}

.consent__category[open] {
  border-color: var(--green, #1f4d2e);
}

.consent__category-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.consent__category-summary::-webkit-details-marker {
  display: none;
}

.consent__category-summary::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-right: 2px solid var(--muted, #5f675a);
  border-bottom: 2px solid var(--muted, #5f675a);
  transform: rotate(-45deg);
  transition: transform 150ms ease;
}

.consent__category[open] .consent__category-summary::before {
  transform: rotate(45deg);
}

.consent__category-name {
  flex: 1;
  font-weight: 650;
  font-size: 0.98rem;
}

.consent__category-body {
  padding: 0 16px 16px 34px;
  color: var(--muted, #5f675a);
  font-size: 0.88rem;
  line-height: 1.5;
}

.consent__category-body p {
  margin: 0 0 10px;
}

.consent__service-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.consent__service {
  padding: 10px 12px;
  background: var(--paper, #f6f2ea);
  border-radius: 8px;
}

.consent__service strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink, #1a2118);
  font-size: 0.88rem;
}

.consent__service dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
  margin: 0;
  font-size: 0.8rem;
}

.consent__service dt {
  color: var(--ink, #1a2118);
  font-weight: 600;
}

.consent__service dd {
  margin: 0;
}

.consent__service-empty {
  margin: 0;
  font-style: italic;
}

/* Toggle switch built from a real checkbox (keyboard + screen-reader friendly),
   visually hidden but still focusable/operable — nothing is emulated with divs. */
.consent__switch {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
}

.consent__switch input {
  position: absolute;
  inset: 0;
  width: 44px;
  height: 26px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.consent__switch-track {
  display: inline-block;
  width: 44px;
  height: 26px;
  background: var(--line, #d8d0c2);
  border-radius: 999px;
  transition: background 150ms ease;
}

.consent__switch-thumb {
  display: block;
  width: 20px;
  height: 20px;
  margin: 3px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 150ms ease;
}

.consent__switch input:checked + .consent__switch-track {
  background: var(--green, #1f4d2e);
}

.consent__switch input:checked + .consent__switch-track .consent__switch-thumb {
  transform: translateX(18px);
}

.consent__switch input:focus-visible + .consent__switch-track {
  outline: 2px solid var(--green, #1f4d2e);
  outline-offset: 2px;
}

.consent__switch input:disabled {
  cursor: not-allowed;
}

.consent__switch input:disabled + .consent__switch-track {
  opacity: 0.7;
}

body.has-consent-modal {
  overflow: hidden;
}

/* External-media (Maps/YouTube/…) placeholder used via consent_embed() */
.consent-embed {
  position: relative;
}

.consent-embed__placeholder {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  padding: 22px;
  background: var(--paper, #f6f2ea);
  border: 1px dashed var(--line, #d8d0c2);
  border-radius: 12px;
}

.consent-embed__text {
  margin: 0;
  color: var(--muted, #5f675a);
  font-size: 0.9rem;
  line-height: 1.5;
}

.consent-embed__remember {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.82rem;
  color: var(--muted, #5f675a);
  cursor: pointer;
}

.consent-embed__btn {
  padding: 11px 18px;
  color: #fff;
  background: var(--green, #1f4d2e);
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.consent-embed__btn:hover {
  background: var(--green-deep, #14341f);
}

@media (max-width: 640px) {
  .consent {
    align-items: flex-end;
    padding: 0;
  }

  .consent__modal {
    width: 100%;
    max-height: 92vh;
    padding: 24px 20px 20px;
    border-radius: 18px 18px 0 0;
  }

  .consent__actions {
    flex-direction: column;
  }

  .consent__btn {
    width: 100%;
    min-height: 48px;
  }

  .consent__category-summary {
    padding: 14px 12px;
  }

  .consent__category-body {
    padding: 0 12px 14px 26px;
  }
}
