/* Theme for the self-hosted consent manager and the Worker-injected legal footer.
   Colours arrive as custom properties injected by the Worker (per site, spec §4). */
#cc-main {
  --cc-font-family: inherit;
  --cc-bg: #ffffff;
  --cc-primary-color: var(--hgv-ink, #1b2941);
  --cc-secondary-color: var(--hgv-secondary, #5a6472);
  --cc-btn-primary-bg: var(--hgv-accent, #1b2941);
  --cc-btn-primary-color: #ffffff;
  --cc-btn-primary-border-color: var(--hgv-accent, #1b2941);
  --cc-btn-primary-hover-bg: var(--hgv-ink, #1b2941);
  --cc-btn-primary-hover-color: #ffffff;
  --cc-btn-primary-hover-border-color: var(--hgv-ink, #1b2941);
  --cc-btn-secondary-bg: #ffffff;
  --cc-btn-secondary-color: var(--hgv-ink, #1b2941);
  --cc-btn-secondary-border-color: var(--hgv-rule, #e5e8eb);
  --cc-btn-secondary-hover-bg: var(--hgv-rule, #e5e8eb);
  --cc-btn-secondary-hover-color: var(--hgv-ink, #1b2941);
  --cc-btn-secondary-hover-border-color: var(--hgv-rule, #e5e8eb);
  --cc-separator-border-color: var(--hgv-rule, #e5e8eb);
  --cc-toggle-on-bg: var(--hgv-accent, #1b2941);
  --cc-toggle-readonly-bg: var(--hgv-rule, #e5e8eb);
  --cc-toggle-readonly-knob-bg: #ffffff;
  --cc-link-color: var(--hgv-accent, #1b2941);
  --cc-btn-border-radius: 6px;
  --cc-modal-border-radius: 10px;
  font-family: var(--hgv-font-body, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
}
#cc-main .cm__desc a,
#cc-main .pm__section-desc a { text-decoration: underline; }

/* ── The consent bar — spec §9: as small as it can legally be ─────────────────────────────────────
   A slim bar pinned to the bottom: no overlay, no title, the page readable and scrollable behind it.
   Desktop: one row (text left, buttons right), ~52 px. Mobile: text, then the buttons side by side, ~96 px.
   Sizes are in px on purpose: 13 px is the legibility floor and must not scale down with a page's root size.
   The library's narrow-screen rules carry !important, so the overrides that fight them do too. */
:root { --hgv-consent-height: 0px; }

#cc-main .cm.cm--bar {
  background: #ffffff;
  border-top: 1px solid var(--hgv-rule, #e5e8eb);
  box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.07);
}
#cc-main .cm.cm--bar .cm__body {
  box-sizing: border-box;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 16px !important;
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
#cc-main .cm.cm--bar .cm__texts { padding: 0; min-width: 0; }
#cc-main .cm.cm--bar .cm__desc {
  padding: 0 !important;
  margin: 0;
  max-height: none;
  overflow: visible;
  font-size: 13px;
  line-height: 1.35;
  color: var(--hgv-secondary, #5a6472);
}
#cc-main .cm.cm--bar .cm__btns {
  flex: 0 0 auto;
  flex-direction: row !important;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  max-width: none;
  padding: 0 !important;
  border: 0 !important;
}
#cc-main .cm.cm--bar .cm__btn-group {
  display: grid !important;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 8px;
}
#cc-main .cm.cm--bar .cm__btn + .cm__btn,
#cc-main .cm.cm--bar .cm__btn-group + .cm__btn-group { margin: 0 !important; }

/* Refusing must be exactly as easy as accepting: both first-layer choices share one rule. */
#cc-main .cm.cm--bar .cm__btn[data-role="all"],
#cc-main .cm.cm--bar .cm__btn[data-role="necessary"] {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 32px;
  min-height: 32px;
  padding: 0 12px;
  background: var(--cc-btn-primary-bg);
  color: var(--cc-btn-primary-color);
  border: 1px solid var(--cc-btn-primary-border-color);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  justify-self: stretch;
}
/* "Einstellungen" is a small text link — the equal-prominence rule covers accept versus refuse only. */
#cc-main .cm.cm--bar .cm__btn[data-role="show"] {
  width: auto;
  min-width: 0;
  min-height: 32px;
  padding: 0 2px;
  background: none;
  border: 0;
  color: var(--hgv-secondary, #5a6472);
  font-size: 13px;
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}
#cc-main .cm.cm--bar .cm__btn[data-role="show"]:hover { background: none; color: var(--hgv-ink, #1b2941); }

@media screen and (max-width: 640px) {
  #cc-main .cm.cm--bar .cm__body {
    flex-direction: column !important;
    align-items: stretch;
    gap: 6px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
  }
  #cc-main .cm.cm--bar .cm__btns { justify-content: space-between; gap: 10px; }
  #cc-main .cm.cm--bar .cm__btn-group:first-child { flex: 1 1 auto; }
}

.hgv-legal {
  margin: 4rem auto 0;
  padding: 1.5rem 1rem calc(2.5rem + var(--hgv-consent-height, 0px));
  border-top: 1px solid var(--hgv-rule, #e5e8eb);
  text-align: center;
  font: 400 0.875rem/1.6 var(--hgv-font-body, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
  color: var(--hgv-secondary, #5a6472);
  background: var(--hgv-ground, #ffffff);
}
.hgv-legal a,
.hgv-legal__btn {
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
}
.hgv-legal a:hover,
.hgv-legal__btn:hover { color: var(--hgv-ink, #1b2941); }
