/**
 * Legal pages (Datenschutz, Barrierefreiheit, AGB) – inc/legal-v4.php.
 * Layout and typography are Elementor V4 global classes (lg-*); this file only
 * styles what classes can't reach: links, bold text and lists inside
 * paragraphs, and the generated table of contents.
 */

/* Text inside paragraphs */
.lg-text a {
  color: #bf402b;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.lg-text a:hover,
.lg-text a:focus-visible {
  color: #9e3322;
}

.lg-text strong,
.lg-text b {
  color: #2b2623;
  font-weight: 600;
}

.lg-text ul,
.lg-text ol {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.lg-text ul li,
.lg-text ol li {
  position: relative;
  margin: 0;
  padding-left: 28px;
}

.lg-text ul li::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 4px;
  width: 8px;
  height: 8px;
  background: #bf402b;
}

.lg-text ol {
  counter-reset: lg-ol;
}

.lg-text ol li {
  counter-increment: lg-ol;
  padding-left: 34px;
}

.lg-text ol li::before {
  content: counter(lg-ol) ".";
  position: absolute;
  left: 0;
  color: #bf402b;
  font-weight: 600;
}

.lg-text p {
  margin: 0 0 0.9em;
}

.lg-text p:last-child {
  margin-bottom: 0;
}

/* Paragraph-like spans keep their spacing between blocks. */
.lg-section .lg-text + .lg-text {
  margin-top: 4px;
}

/* AGB clauses: the clause number (first <strong>) hangs in the left column. */
.lg-clause > strong:first-child {
  position: absolute;
  top: 0;
  left: 0;
  color: #bf402b;
  font-family: futura-pt, "Futura", sans-serif;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Sections land below the sticky header when jumped to. */
.lg-section {
  scroll-margin-top: 130px;
}

/* Table of contents (built by assets/js/legal-v4.js) */
.lg-toc-nav ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.lg-toc-nav li {
  margin: 0;
}

.lg-toc-nav a {
  display: flex;
  gap: 10px;
  padding: 7px 0 7px 14px;
  border-left: 2px solid #eadfd4;
  color: #4a403a;
  font-family: futura-pt, "Futura", sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.35;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}

.lg-toc-nav a span {
  flex: 0 0 auto;
  min-width: 20px;
  color: #b9aa9b;
  font-variant-numeric: tabular-nums;
}

.lg-toc-nav a:hover,
.lg-toc-nav a:focus-visible {
  color: #bf402b;
}

.lg-toc-nav a.is-active {
  border-left-color: #bf402b;
  color: #bf402b;
  font-weight: 500;
}

.lg-toc-nav a.is-active span {
  color: #bf402b;
}

/* Tablet / phone: the table of contents collapses. */
.lg-toc-nav details {
  border: 1px solid #eadfd4;
  background: #ffffff;
}

.lg-toc-nav summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  color: #2b2623;
  font-family: futura-pt, "Futura", sans-serif;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}

.lg-toc-nav summary::-webkit-details-marker {
  display: none;
}

.lg-toc-nav summary::after {
  content: "+";
  color: #bf402b;
  font-size: 22px;
  line-height: 1;
}

.lg-toc-nav details[open] summary::after {
  content: "–";
}

.lg-toc-nav details ol {
  padding: 4px 18px 14px;
}

/* Desktop shows the plain list, smaller screens the collapsible one. */
.lg-toc-nav .lg-toc-mobile {
  display: none;
}

@media (max-width: 1024px) {
  .lg-toc-nav .lg-toc-desktop {
    display: none;
  }

  .lg-toc-nav .lg-toc-mobile {
    display: block;
  }

  .lg-toc .lg-toc-title {
    display: none;
  }
}

/* Hero photo: one image filling the hero at any width (Elementor stores no
   size/repeat with the background, so the browser default "repeat" tiled it). */
.lg-hero {
  background-repeat: no-repeat !important;
  background-size: cover !important;
  background-position: 50% 50% !important;
}

/* Hero title: main.css sizes every h1 with !important; keep the lg-h1 scale. */
.lg-hero h1.lg-h1 {
  font-size: 68px !important;
}

@media (max-width: 1024px) {
  .lg-hero h1.lg-h1 {
    font-size: 54px !important;
  }
}

@media (max-width: 767px) {
  /* Long German words ("Geschäftsbedingungen") must fit on one line. */
  .lg-hero h1.lg-h1 {
    font-size: clamp(28px, 8.6vw, 40px) !important;
    -webkit-hyphens: manual;
    hyphens: manual;
  }
}

/* Embedded shortcode output (Borlabs buttons) */
.lg-text .brlbs-cmpnt-container {
  display: block;
  margin-top: 8px;
}

/*
 * Feedback form (Gravity Forms, Orbital theme) in "Feedback zur Barrierefreiheit".
 * GF prints its colours as variables on #gform_wrapper_N[data-form-index].gform-theme;
 * the selector below is one step more specific, so ours win.
 */
.lg-text .gform_wrapper.gform-theme[data-form-index][id] {
  --gf-color-primary: #bf402b;
  --gf-color-primary-rgb: 191, 64, 43;
  --gf-color-primary-darker: #9e3322;
  --gf-color-primary-lighter: #d0634f;
  --gf-color-in-ctrl-primary: #bf402b;
  --gf-color-in-ctrl-primary-rgb: 191, 64, 43;
  --gf-color-in-ctrl-primary-darker: #9e3322;
  --gf-color-in-ctrl-primary-lighter: #d0634f;
  --gf-color-in-ctrl-contrast: #2b2623;
  --gf-color-in-ctrl-contrast-rgb: 43, 38, 35;
  --gf-color-out-ctrl-dark: #5b524c;
  --gf-color-out-ctrl-dark-darker: #2b2623;
  --gf-color-out-ctrl-dark-lighter: #8a7d73;
  --gf-ctrl-border-color: #d8c3ad;
  --gf-ctrl-label-color-primary: #2b2623;
  --gf-ctrl-label-color-secondary: #5b524c;
  --gf-ctrl-label-color-req: #bf402b;
  --gf-radius: 0;
  display: block;
  margin-top: 14px;
  padding: 36px 40px 40px;
  border: 1px solid #eadfd4;
  border-top: 3px solid #bf402b;
  background: #ffffff;
  color: #2b2623;
  font-family: futura-pt, "Futura", sans-serif;
  -webkit-hyphens: manual;
  hyphens: manual;
}

.lg-text .gform_wrapper.gform-theme .gform_heading {
  display: none;
}

/* Two columns for the short fields on wider screens. */
.lg-text .gform_wrapper.gform-theme .gform_fields {
  row-gap: 22px;
  column-gap: 20px;
}

@media (min-width: 768px) {
  .lg-text .gform_wrapper.gform-theme .gfield--type-text,
  .lg-text .gform_wrapper.gform-theme .gfield--type-email,
  .lg-text .gform_wrapper.gform-theme .gfield--type-phone,
  .lg-text .gform_wrapper.gform-theme .gfield--type-select {
    grid-column: span 6;
  }
}

/* Labels */
.lg-text .gform_wrapper.gform-theme .gfield_label,
.lg-text .gform_wrapper.gform-theme legend.gfield_label {
  margin: 0 0 8px;
  color: #2b2623;
  font-family: futura-pt, "Futura", sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
}

.lg-text .gform_wrapper.gform-theme .gfield_required,
.lg-text .gform_wrapper.gform-theme .gfield_required_text {
  margin-left: 4px;
  color: #bf402b;
  font-size: 13px;
  font-weight: 400;
}

/* Inputs */
.lg-text .gform_wrapper.gform-theme input[type="text"],
.lg-text .gform_wrapper.gform-theme input[type="email"],
.lg-text .gform_wrapper.gform-theme input[type="tel"],
.lg-text .gform_wrapper.gform-theme select,
.lg-text .gform_wrapper.gform-theme textarea {
  min-height: 50px;
  padding: 13px 16px;
  border: 1px solid #d8c3ad;
  border-radius: 0;
  background-color: #ffffff;
  box-shadow: none;
  color: #2b2623;
  font-family: futura-pt, "Futura", sans-serif;
  font-size: 16px;
  line-height: 1.4;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.lg-text .gform_wrapper.gform-theme input::placeholder,
.lg-text .gform_wrapper.gform-theme textarea::placeholder {
  color: #b9aa9b;
  opacity: 1;
}

.lg-text .gform_wrapper.gform-theme input:hover,
.lg-text .gform_wrapper.gform-theme select:hover,
.lg-text .gform_wrapper.gform-theme textarea:hover {
  border-color: #c2a888;
}

.lg-text .gform_wrapper.gform-theme input:focus,
.lg-text .gform_wrapper.gform-theme select:focus,
.lg-text .gform_wrapper.gform-theme textarea:focus {
  border-color: #bf402b;
  outline: none;
  box-shadow: 0 0 0 3px rgba(191, 64, 43, 0.16);
}

.lg-text .gform_wrapper.gform-theme select {
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%232b2623' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 13px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.lg-text .gform_wrapper.gform-theme textarea {
  min-height: 150px;
  height: 150px;
  resize: vertical;
}

/* File upload */
.lg-text .gform_wrapper.gform-theme input[type="file"] {
  width: 100%;
  padding: 14px;
  border: 1px dashed #d8c3ad;
  border-radius: 0;
  background: #fbf7f3;
  color: #5b524c;
  font-family: futura-pt, "Futura", sans-serif;
  font-size: 15px;
  cursor: pointer;
}

.lg-text .gform_wrapper.gform-theme input[type="file"]:hover {
  border-color: #bf402b;
}

.lg-text .gform_wrapper.gform-theme input[type="file"]::file-selector-button {
  margin-right: 14px;
  padding: 10px 18px;
  border: 0;
  border-radius: 0;
  background: #2b2623;
  color: #ffffff;
  font-family: futura-pt, "Futura", sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
  line-height: 1.2;
  vertical-align: middle;
  text-transform: uppercase;
  cursor: pointer;
}

.lg-text .gform_wrapper.gform-theme .gform_fileupload_rules,
.lg-text .gform_wrapper.gform-theme .gfield_description {
  margin-top: 6px;
  color: #8a7d73;
  font-size: 13px;
}

/*
 * The old page styles (assets/src/scss/pages/_barrierefreiheitserklaerung.scss,
 * class px_barrierefreiheitserklaerung) force red borders and red text with
 * !important; inside the V4 layout these rules take over again.
 */
.lg-text .px_barrierefreiheitserklaerung input:not([type="submit"]):not([type="checkbox"]):not([type="file"]),
.lg-text .px_barrierefreiheitserklaerung select,
.lg-text .px_barrierefreiheitserklaerung textarea {
  border: 1px solid #d8c3ad !important;
  background-color: #ffffff !important;
  color: #2b2623 !important;
}

.lg-text .px_barrierefreiheitserklaerung input:not([type="submit"]):not([type="checkbox"]):not([type="file"]):hover,
.lg-text .px_barrierefreiheitserklaerung select:hover,
.lg-text .px_barrierefreiheitserklaerung textarea:hover {
  border-color: #c2a888 !important;
}

.lg-text .px_barrierefreiheitserklaerung input:not([type="submit"]):not([type="checkbox"]):not([type="file"]):focus,
.lg-text .px_barrierefreiheitserklaerung select:focus,
.lg-text .px_barrierefreiheitserklaerung textarea:focus {
  border-color: #bf402b !important;
  box-shadow: 0 0 0 3px rgba(191, 64, 43, 0.16) !important;
}

.lg-text .px_barrierefreiheitserklaerung select {
  height: auto !important;
  padding: 13px 42px 13px 16px !important;
  line-height: 1.4 !important;
}

.lg-text .px_barrierefreiheitserklaerung input[type="file"] {
  height: auto !important;
  padding: 12px !important;
  line-height: 1.4 !important;
  border: 1px dashed #d8c3ad !important;
  background-color: #fbf7f3 !important;
  color: #5b524c !important;
}

.lg-text .px_barrierefreiheitserklaerung input[type="file"]:hover {
  border-color: #bf402b !important;
}

.lg-text .px_barrierefreiheitserklaerung input[type="checkbox"] {
  border: 1px solid #c2a888 !important;
  background-color: #ffffff !important;
}

.lg-text .px_barrierefreiheitserklaerung input[type="checkbox"]:checked {
  border-color: #bf402b !important;
  background-color: #bf402b !important;
}

.lg-text .px_barrierefreiheitserklaerung input[type="checkbox"]:checked::before {
  color: #ffffff !important;
}

.lg-text .px_barrierefreiheitserklaerung input[type="checkbox"]:focus-visible {
  outline: 2px solid #bf402b;
  outline-offset: 2px;
}

/* Privacy note (HTML field) */
.lg-text .gform_wrapper.gform-theme .gfield_html {
  padding: 16px 18px;
  border-left: 3px solid #bf402b;
  background: #f8eee6;
  color: #5b524c;
  font-size: 14px;
  line-height: 1.6;
}

.lg-text .gform_wrapper.gform-theme .gfield_html p {
  margin: 0;
}

/* Consent checkboxes */
.lg-text .gform_wrapper.gform-theme .ginput_container_consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.lg-text .gform_wrapper.gform-theme .ginput_container_consent input[type="checkbox"] {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  border-color: #c2a888;
  border-radius: 0;
  cursor: pointer;
}

.lg-text .gform_wrapper.gform-theme .gfield_consent_label {
  color: #5b524c;
  font-family: futura-pt, "Futura", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  cursor: pointer;
}

.lg-text .gform_wrapper.gform-theme .gfield_consent_label a {
  color: #bf402b;
}

/* Submit */
.lg-text .gform_wrapper.gform-theme .gform_footer {
  margin-top: 28px;
  padding: 0;
}

.lg-text .gform_wrapper.gform-theme[id] .gform_footer .gform_button[id] {
  --gf-local-bg-color: #bf402b;
  --gf-local-color: #ffffff;
  --gf-local-border-color: #bf402b;
  --gf-local-radius: 0;
  min-height: 0;
  padding: 17px 48px;
  border: 0;
  border-radius: 0;
  background: #bf402b;
  color: #ffffff;
  font-family: futura-pt, "Futura", sans-serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 1.5px;
  line-height: 1.2;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.lg-text .gform_wrapper.gform-theme[id] .gform_footer .gform_button[id]:hover,
.lg-text .gform_wrapper.gform-theme[id] .gform_footer .gform_button[id]:focus-visible {
  --gf-local-bg-color: #9e3322;
  --gf-local-border-color: #9e3322;
  background: #9e3322;
}

/* Errors and confirmation */
.lg-text .gform_wrapper.gform-theme .gform_validation_errors {
  border-radius: 0;
}

.lg-text .gform_confirmation_message {
  margin-top: 14px;
  padding: 24px 28px;
  border: 1px solid #eadfd4;
  border-top: 3px solid #bf402b;
  background: #ffffff;
  color: #2b2623;
  font-size: 17px;
}

@media (max-width: 767px) {
  .lg-text .gform_wrapper.gform-theme[data-form-index][id] {
    padding: 24px 18px 28px;
  }

  .lg-text .gform_wrapper.gform-theme[id] .gform_footer .gform_button[id] {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lg-toc-nav a {
    transition: none;
  }
}
