/* Holzkunst Dost – Rechtliche & barrierefreie Hilfen
   1. Button "Vertrag widerrufen" + Seite /vertrag-widerrufen (templates/widerruf.php)
   2. Fußzeile (Button mittig)
   3. Cookie-Banner (templates/consent-banner.php, assets/js/consent.js)
   4. Barrierefreiheits-Werkzeug (templates/a11y-tool.php, assets/js/a11y.js)
   5. Darstellungs-Modi des Werkzeugs (Klassen a11y-* auf <html>)
   Eigene Datei, damit theme.css nicht weiter wächst; eingebunden nach theme.css. */

/* ---------- 1. Vertrag widerrufen ---------- */
/* ".site-footer .withdraw-button": sonst überschreibt ".site-footer a" die Schriftfarbe. */
.withdraw-button,
.site-footer .withdraw-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 7px 8px 7px 16px;
  background: #fff;
  color: #b3261e;
  border: 2px solid #b3261e;
  border-radius: 8px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.15;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.withdraw-button:hover,
.withdraw-button:focus-visible,
.site-footer .withdraw-button:hover,
.site-footer .withdraw-button:focus-visible {
  color: #8c1d18;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px -6px rgba(0, 0, 0, 0.5);
}
.withdraw-button:focus-visible { outline: 3px solid var(--color-accent-light); outline-offset: 3px; }
.withdraw-button__x {
  position: relative;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: #c62828;
}
.withdraw-button__x::before,
.withdraw-button__x::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 13px;
  width: 18px;
  height: 4px;
  border-radius: 2px;
  background: #fff;
  transform: rotate(45deg);
}
.withdraw-button__x::after { transform: rotate(-45deg); }

.withdraw-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin: 0 0 26px;
  padding: 18px 22px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}
.withdraw-cta p { margin: 0; color: var(--color-text-muted); }

.withdraw-page { max-width: 820px; }
.withdraw-intro { color: var(--color-text-muted); }
.withdraw-errors { border-color: #c94227; margin-bottom: 20px; padding: 18px 22px; }
.withdraw-errors p { margin: 0; color: var(--color-text); }
.withdraw-errors p + p { margin-top: 6px; }
.withdraw-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}
@media (max-width: 640px) {
  .withdraw-form__grid { grid-template-columns: 1fr; }
}
.withdraw-done { padding: 26px 28px; }
.withdraw-summary {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 18px;
  margin: 18px 0;
  padding: 16px 18px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: var(--radius);
}
.withdraw-summary dt { color: var(--color-text-muted); font-size: 0.9rem; }
.withdraw-summary dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .withdraw-summary { grid-template-columns: 1fr; }
  .withdraw-summary dd { margin-bottom: 6px; }
}

/* ---------- 2. Fußzeile: Text | Button (mittig) | Rechtliches ---------- */
.site-footer__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px 24px;
}
.site-footer__text { justify-self: start; }
.site-footer__withdraw { justify-self: center; }
.site-footer__nav { justify-self: end; text-align: right; }
.site-footer__link-button {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--color-text-muted);
  cursor: pointer;
}
.site-footer__link-button:hover,
.site-footer__link-button:focus-visible { color: var(--color-accent-light); }
@media (max-width: 860px) {
  .site-footer__inner { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .site-footer__text,
  .site-footer__withdraw,
  .site-footer__nav { justify-self: center; text-align: center; }
  .site-footer__withdraw { order: -1; }
}

/* ---------- 3. Cookie-Banner ---------- */
.consent {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 300;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.consent[hidden] { display: none; }
.consent__box {
  pointer-events: auto;
  width: 100%;
  max-width: 760px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--color-bg-dark);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-strong);
  padding: 22px 24px;
  color: var(--color-text);
}
.consent__title { font-size: 1.15rem; margin-bottom: 0.5em; color: var(--color-text); }
.consent__text { font-size: 0.9rem; color: var(--color-text-muted); margin-bottom: 14px; }
.consent__details { display: grid; gap: 10px; margin-bottom: 16px; }
.consent__details[hidden] { display: none; }
.consent__group {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 0.88rem;
}
.consent__group p { margin: 6px 0; color: var(--color-text-muted); }
.consent__group-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.consent__group-title { font-weight: 700; }
.consent__switch { display: inline-flex; align-items: center; gap: 8px; font-size: 0.85rem; }
.consent__switch input { width: 18px; height: 18px; accent-color: var(--color-accent); margin: 0; }
.consent__switch--locked { color: var(--color-text-muted); }
.consent__group summary { cursor: pointer; color: var(--color-accent-light); font-size: 0.85rem; }
.consent__table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 0.8rem; }
.consent__table th,
.consent__table td { text-align: left; vertical-align: top; padding: 5px 6px; border-top: 1px solid var(--border-subtle); }
.consent__table th { color: var(--color-text-muted); font-weight: 600; }
@media (max-width: 560px) {
  .consent__table thead { display: none; }
  .consent__table tr { display: block; padding: 6px 0; border-top: 1px solid var(--border-subtle); }
  .consent__table td { display: block; border: 0; padding: 1px 0; }
}
.consent__actions { display: flex; flex-wrap: wrap; gap: 10px; }
/* "Alle akzeptieren" und "Nur notwendige" bewusst identisch gestaltet. */
.consent__btn {
  flex: 1 1 180px;
  appearance: none;
  border: 2px solid var(--color-accent);
  background: var(--color-accent);
  color: #241a00;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
}
.consent__btn:hover { background: var(--color-accent-light); border-color: var(--color-accent-light); }
.consent__btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.consent__btn--link { flex: 0 1 auto; background: transparent; color: var(--color-text); border-color: rgba(255, 255, 255, 0.35); }
.consent__btn--link:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.6); }
.consent__btn[hidden] { display: none; }

/* Platzhalter für Karten/Videos ohne Einwilligung (src/Consent.php) */
.consent-embed__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 320px;
  margin-top: 20px;
  padding: 24px;
  text-align: center;
  background: rgba(0, 0, 0, 0.25);
  border: 1px dashed rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  color: var(--color-text-muted);
}
.consent-embed__placeholder p { margin: 0; max-width: 420px; }
.consent-embed__title { font-weight: 700; color: var(--color-text); }
.consent-embed__remember { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; cursor: pointer; }
.consent-embed__remember input { accent-color: var(--color-accent); }

/* ---------- 4. Barrierefreiheits-Werkzeug ---------- */
.a11y { --dock-offset: 0px; }
.a11y__toggle {
  position: fixed;
  left: 20px;
  bottom: calc(20px + var(--dock-offset));
  z-index: 250;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #1565c0;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s ease, bottom 0.15s ease;
}
.a11y__toggle:hover { transform: scale(1.06); }
.a11y__toggle:focus-visible { outline: 3px solid var(--color-accent-light); outline-offset: 3px; }
.a11y--right .a11y__toggle { left: auto; right: 20px; bottom: calc(76px + var(--dock-offset)); }

.a11y__panel {
  position: fixed;
  left: 20px;
  bottom: calc(82px + var(--dock-offset));
  z-index: 251;
  width: min(360px, calc(100vw - 32px));
  max-height: calc(100vh - 100px - var(--dock-offset));
  overflow-y: auto;
  background: #fff;
  color: #1a1a1a;
  border-radius: 14px;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.6);
  padding: 16px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.35;
}
.a11y__panel[hidden] { display: none; }
.a11y--right .a11y__panel { left: auto; right: 20px; bottom: calc(138px + var(--dock-offset)); max-height: calc(100vh - 156px - var(--dock-offset)); }
@media (max-width: 480px) {
  .a11y__panel,
  .a11y--right .a11y__panel { left: 16px; right: 16px; width: auto; }
}
.a11y__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.a11y__title { margin: 0; font-family: Arial, Helvetica, sans-serif; font-size: 17px; color: #1a1a1a; letter-spacing: 0; }
.a11y__close {
  appearance: none;
  border: 0;
  background: #eee;
  color: #1a1a1a;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.a11y__close:hover,
.a11y__close:focus-visible { background: #1565c0; color: #fff; outline: none; }
.a11y__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.a11y__option {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 92px;
  padding: 10px 6px;
  border: 2px solid #d6dbe1;
  border-radius: 10px;
  background: #f5f7fa;
  color: #1a1a1a;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}
.a11y__option:hover { border-color: #1565c0; }
.a11y__option:focus-visible { outline: 3px solid #1565c0; outline-offset: 2px; }
.a11y__option[aria-pressed="true"] { background: #1565c0; border-color: #1565c0; color: #fff; }
.a11y__state { font-size: 12px; font-weight: 400; min-height: 14px; }
.a11y__footer { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.a11y__small {
  flex: 1 1 auto;
  appearance: none;
  border: 1px solid #c3cad3;
  background: #fff;
  color: #1a1a1a;
  border-radius: 999px;
  padding: 7px 10px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.a11y__small:hover,
.a11y__small:focus-visible { background: #1565c0; border-color: #1565c0; color: #fff; outline: none; }

.a11y__structure {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.a11y__structure[hidden] { display: none; }
.a11y__structure-box {
  width: min(560px, 100%);
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #1a1a1a;
  border-radius: 14px;
  padding: 16px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
}
.a11y__tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.a11y__tabs button {
  flex: 1;
  appearance: none;
  border: 2px solid #d6dbe1;
  background: #f5f7fa;
  color: #1a1a1a;
  border-radius: 8px;
  padding: 7px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.a11y__tabs button[aria-selected="true"] { background: #1565c0; border-color: #1565c0; color: #fff; }
.a11y__tabs button:focus-visible { outline: 3px solid #1565c0; outline-offset: 2px; }
.a11y__structure-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
.a11y__structure-list li { border-top: 1px solid #e3e7ec; }
.a11y__structure-item {
  appearance: none;
  display: block;
  width: 100%;
  border: 0;
  background: none;
  color: #1a1a1a;
  text-align: left;
  padding: 9px 12px;
  font: inherit;
  cursor: pointer;
}
.a11y__structure-item:hover,
.a11y__structure-item:focus-visible { background: #e8f0fb; outline: 2px solid #1565c0; outline-offset: -2px; }

.a11y__guide {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  top: -100px;
  height: 36px;
  z-index: 240;
  pointer-events: none;
  border-top: 3px solid #ffd600;
  border-bottom: 3px solid #ffd600;
  background: rgba(255, 214, 0, 0.12);
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.35);
}
.a11y__guide.is-active { display: block; }
.a11y__tooltip {
  position: fixed;
  z-index: 260;
  max-width: 320px;
  padding: 7px 10px;
  background: #111;
  color: #fff;
  border: 2px solid #ffd600;
  border-radius: 6px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.35;
  pointer-events: none;
}
.a11y__tooltip[hidden] { display: none; }

/* ---------- 5. Darstellungs-Modi (Klassen auf <html>) ---------- */
/* Kontrast: invertiert / Graustufen über Filter; Bilder beim Invertieren zurückdrehen. */
html.a11y-contrast-invert { filter: invert(1) hue-rotate(180deg); }
html.a11y-contrast-invert img,
html.a11y-contrast-invert video,
html.a11y-contrast-invert iframe { filter: invert(1) hue-rotate(180deg); }
html.a11y-contrast-gray { filter: grayscale(1); }

/* Kontrast dunkel / hell: einheitliche Flächen, maximale Lesbarkeit. */
html.a11y-contrast-dark body,
html.a11y-contrast-dark body *:not(.a11y *):not(svg):not(svg *):not(img) {
  background-color: #000 !important;
  background-image: none !important;
  color: #fff !important;
  border-color: #fff !important;
  text-shadow: none !important;
  box-shadow: none !important;
}
html.a11y-contrast-dark body a:not(.a11y *),
html.a11y-contrast-dark body a:not(.a11y *) * { color: #ffeb3b !important; }
html.a11y-contrast-dark .btn,
html.a11y-contrast-dark .withdraw-button { border: 2px solid #ffeb3b !important; }

html.a11y-contrast-light body,
html.a11y-contrast-light body *:not(.a11y *):not(svg):not(svg *):not(img) {
  background-color: #fff !important;
  background-image: none !important;
  color: #000 !important;
  border-color: #000 !important;
  text-shadow: none !important;
  box-shadow: none !important;
}
html.a11y-contrast-light body a:not(.a11y *),
html.a11y-contrast-light body a:not(.a11y *) * { color: #0033cc !important; }
html.a11y-contrast-light .btn,
html.a11y-contrast-light .withdraw-button { border: 2px solid #000 !important; }

/* Links hervorheben */
html.a11y-links body a:not(.a11y *) {
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
  text-underline-offset: 3px;
  outline: 2px solid #ffeb3b;
  outline-offset: 1px;
  background-color: rgba(0, 0, 0, 0.55) !important;
  color: #ffeb3b !important;
}

/* Zeichen-Abstand (entspricht den Werten aus WCAG 2.1, Kriterium 1.4.12) */
html.a11y-spacing body *:not(.a11y *) {
  letter-spacing: 0.12em !important;
  word-spacing: 0.16em !important;
  line-height: 1.6 !important;
}
html.a11y-spacing body p:not(.a11y *) { margin-bottom: 2em !important; }

/* Lesbare Schrift: schlichte, gut unterscheidbare Systemschrift */
html.a11y-font body,
html.a11y-font body *:not(.a11y *):not(svg):not(svg *) {
  font-family: Verdana, Tahoma, Arial, sans-serif !important;
}

/* Großer Mauszeiger */
html.a11y-cursor,
html.a11y-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l15 9-6.5 1.6L16 20l-3 1.4-3.5-7.3L4 18z' fill='%23000' stroke='%23fff' stroke-width='1.2' stroke-linejoin='round'/%3E%3C/svg%3E") 8 4, auto !important;
}

/* Animationen pausieren */
html.a11y-noanim *,
html.a11y-noanim *::before,
html.a11y-noanim *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

/* Tastatur-Fokus deutlich sichtbar */
html.a11y-focus *:focus,
html.a11y-focus *:focus-visible {
  outline: 4px solid #ff1744 !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 7px #fff !important;
}
