/* legal – Impressum, Datenschutz, Barrierefreiheit */

/* ---------- Header band ---------- */
.legal-hero {
  position: relative;
  padding: calc(165px + var(--ag-sp-80)) 0 0;   /* clear the floating logo */
  background:
    radial-gradient(800px 380px at 90% 0%, rgba(var(--ag-primary-rgb), .10), transparent 60%),
    linear-gradient(180deg, var(--ag-cream) 0%, #fff 100%);
  border-bottom: 1px solid #eee9e1;
}
@media (max-width: 768px) { .legal-hero { padding-top: 175px; } }

.legal-hero__kicker {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .35rem .8rem;
  margin: 0 0 1.2rem;
  border-radius: 999px;
  background: rgba(var(--ag-primary-rgb), .1);
  color: var(--ag-primary-dark);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.legal-hero__title {
  font-size: clamp(2.2rem, 2.2rem + ((1vw - .2rem) * 2.4), 3.75rem);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.05;
  margin: 0 0 1rem;
}
.legal-hero__intro {
  max-width: 640px;
  font-size: var(--ag-fs-medium);
  color: #555;
  margin: 0 0 var(--ag-sp-50);
}

/* Tabs to the other legal pages */
.legal-tabs { display: flex; gap: .25rem 1.75rem; flex-wrap: wrap; }
.legal-tabs__link {
  position: relative;
  padding: .9rem 0;
  font-size: .9rem;
  font-weight: 600;
  color: #6b6b6b;
  text-decoration: none;
  transition: color .2s ease;
}
.legal-tabs__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--ag-primary);
  transform: scaleX(0);
  transition: transform .3s ease;
}
.legal-tabs__link:hover { color: var(--ag-primary-dark); }
.legal-tabs__link:hover::after { transform: scaleX(.4); }
.legal-tabs__link.is-active { color: var(--ag-text); }
.legal-tabs__link.is-active::after { transform: scaleX(1); }

/* ---------- Body ---------- */
.legal { padding: var(--ag-sp-60) 0 var(--ag-sp-80); }
.legal__grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 760px);
  gap: clamp(32px, 5vw, 80px);
  align-items: start;
}
.legal__grid--single { grid-template-columns: minmax(0, 760px); }
@media (max-width: 991px) { .legal__grid { grid-template-columns: minmax(0, 1fr); } }

/* Table of contents */
.legal__toc { position: sticky; top: 90px; }
@media (max-width: 991px) { .legal__toc { position: static; } }
.legal__toc details {
  border: 1px solid #eee9e1;
  border-radius: 16px;
  background: #fff;
  padding: 1.1rem 1.1rem .8rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .04);
}
.legal__toc summary {
  list-style: none;
  cursor: pointer;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ag-grey);
  margin-bottom: .6rem;
}
.legal__toc summary::-webkit-details-marker { display: none; }
@media (min-width: 992px) { .legal__toc summary { pointer-events: none; } }
@media (max-width: 991px) {
  .legal__toc summary { margin: 0; display: flex; justify-content: space-between; }
  .legal__toc summary::after { content: "\F282"; font-family: "bootstrap-icons"; transition: transform .2s ease; }
  .legal__toc details[open] summary { margin-bottom: .6rem; }
  .legal__toc details[open] summary::after { transform: rotate(180deg); }
}
.legal__toc ol { list-style: none; padding: 0; margin: 0; }
.legal__toc li { font-size: .85rem; font-weight: 500; line-height: 1.35; }
.legal__toc a {
  display: flex;
  gap: .65rem;
  padding: .45rem .5rem;
  margin: 0 -.5rem;
  border-radius: 8px;
  color: #444;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease;
}
.legal__toc a span { flex-shrink: 0; font-size: .7rem; font-weight: 700; color: var(--ag-primary); padding-top: .12rem; }
.legal__toc a:hover, .legal__toc a.is-active { background: rgba(var(--ag-primary-rgb), .08); color: var(--ag-primary-dark); }

/* Text */
.legal__body {
  font-size: var(--ag-fs-medium);
  line-height: 1.75;
  color: #2b2b2b;
}
.legal__body > * { margin: 0 0 1.1rem; }
.legal__body h2 {
  display: flex;
  align-items: baseline;
  gap: .9rem;
  scroll-margin-top: 90px;
  font-size: clamp(1.35rem, 1.35rem + ((1vw - .2rem) * .7), 1.75rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.25;
  color: var(--ag-text);
  margin: var(--ag-sp-60) 0 1.1rem;
  padding-top: var(--ag-sp-40);
  border-top: 1px solid #eee9e1;
}
.legal__body > h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.legal__num {
  flex-shrink: 0;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--ag-primary);
  background: rgba(var(--ag-primary-rgb), .1);
  border-radius: 999px;
  padding: .2rem .55rem;
  transform: translateY(-.15em);
}
.legal__body h3 { font-size: 1.1rem; font-weight: 700; letter-spacing: -.01em; margin-top: 1.8rem; color: var(--ag-primary-dark); }
.legal__body ul { padding-left: 0; list-style: none; }
.legal__body ul li { position: relative; padding-left: 1.4rem; margin-bottom: .4rem; }
.legal__body ul li::before {
  content: "";
  position: absolute;
  left: .2rem;
  top: .72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ag-primary);
}
.legal__body a {
  color: var(--ag-primary-dark);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(var(--ag-primary-rgb), .35);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
  transition: text-decoration-color .2s ease, color .2s ease;
}
.legal__body a:hover { color: var(--ag-primary); text-decoration-color: currentColor; }
.legal__body strong { color: var(--ag-text); }

@media (max-width: 600px) {
  .legal-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 1.25rem; margin-inline: calc(-1 * var(--ag-gutter)); padding-inline: var(--ag-gutter); }
  .legal-tabs::-webkit-scrollbar { display: none; }
  .legal-tabs__link { white-space: nowrap; }
}

/* Long German words (Datenschutzerklärung) must not overflow on phones */
.legal-hero__title { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
@media (max-width: 600px) { .legal-hero__title { font-size: clamp(1.8rem, 8.4vw, 2.2rem); } }
