﻿/* ---- Legal Page ---- */
.legal-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  align-items: flex-start;
}

.legal-nav {
  position: sticky;
  top: calc(var(--nav-h) + 48px); /* Stick below the main nav */
}

.legal-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.legal-nav__link {
  display: block;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-light);
  border-radius: var(--radius);
  transition: background 0.2s, color 0.2s;
  border-left: 3px solid transparent;
}

.legal-nav__link:hover {
  background: var(--bg-off);
  color: var(--text);
}

.legal-nav__link.active {
  color: var(--blue);
  background: var(--green-light);
  border-left-color: var(--blue);
}

.legal-content {
  min-height: 80vh;
}

.legal-content h1, .legal-content h2, .legal-content h3, .legal-content h4 {
  margin: 2em 0 1em;
  color: var(--text);
}
.legal-content h1 { font-size: 1.8rem; }
.legal-content h2 { font-size: 1.5rem; }
.legal-content h3 { font-size: 1.2rem; }
.legal-content p, .legal-content li {
  font-size: .95rem;
  line-height: 1.7;
  color: var(--text-mid);
  margin-bottom: 1em;
}

/* ---- Legal Refinements ---- */
.legal-layout {
  gap: 56px;
}

.legal-content {
  max-width: 820px;
}

.legal-content h1:first-child,
.legal-content h2:first-child,
.legal-content h3:first-child {
  margin-top: 0;
}

/* ---- Cookie preferences button (top of the Cookie Policy page) ---- */
.legal-content__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.legal-content .legal-content__head h1 {
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: .3em;
}

.legal-cookie-btn {
  flex: 0 0 auto;
  padding: 6px 14px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-light);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: color .18s, border-color .18s, background .18s;
}

.legal-cookie-btn:hover {
  color: var(--text);
  border-color: var(--text-light);
  background: var(--bg-off);
}

@media (max-width: 640px) {
  .legal-content .legal-content__head h1 {
    /* Force the heading onto its own line instead of squeezing beside
       the button — avoids a short button floating next to a
       multi-line-wrapped h1 on narrow screens. */
    flex-basis: 100%;
  }

  .legal-cookie-btn {
    font-size: .74rem;
    padding: 6px 12px;
  }
}

.legal-content .trust-badges {
  margin-top: .5em;
}

.legal-imprint__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
  gap: clamp(32px, 6vw, 72px);
  align-items: start;
  margin-bottom: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

.legal-imprint__details > :first-child {
  margin-top: 0;
}

.legal-imprint__details p {
  margin-bottom: .3em;
}

.legal-imprint__recognition {
  min-width: 0;
  padding-left: 28px;
  border-left: 1px solid var(--border);
}

.legal-imprint__recognition .label {
  margin-bottom: 16px;
}

.legal-imprint__recognition .trust-badges {
  align-items: flex-start;
  gap: 10px;
  margin: 0;
}

.legal-imprint__recognition .trust-badge {
  padding: 4px;
}

.legal-imprint__recognition .trust-badge img {
  /* Larger on wide screens where the recognition rail has room; settles
     back to the original 76-88px range once the layout stacks on mobile. */
  height: clamp(76px, 11vw, 132px);
  width: auto;
  max-width: 100%;
}

.legal-imprint__recognition .trust-badge__caption {
  font-size: .68rem;
}

.legal-content--terms > ol {
  margin: 1.8em 0 2.4em;
  padding-left: 2.4rem;
  list-style-type: upper-roman;
}

.legal-content--terms > ol > li {
  padding-left: .45rem;
  margin-bottom: 1.8rem;
}

.legal-content--terms > ol > li::marker {
  color: var(--blue);
  font-weight: 700;
}

.legal-content--terms > ol > li > strong:first-child,
.legal-content--terms > ol > li > strong:first-child em {
  color: var(--text);
  font-style: normal;
}

.legal-content--terms > ol > li > ol {
  margin: 1em 0 0;
  padding-left: 1.65rem;
  list-style-type: decimal;
  /* Own counter, tracked in parallel to the native decimal marker above,
     so the third level below can read "which clause is this?" reliably.
     (The built-in `list-item` counter can't be used for that: it's reset
     by the nearest ancestor <ol>, which is the third-level list itself —
     so it only ever recounts 1, 2, 3… within that list, never the clause
     number it's nested under.) */
  counter-reset: legal-clause;
}

.legal-content--terms > ol > li > ol > li {
  padding-left: .35rem;
  margin-bottom: 1em;
  counter-increment: legal-clause;
}

.legal-content--terms > ol > li > ol > li::marker {
  color: var(--text);
  font-weight: 600;
}

.legal-content--terms > ol > li > ol > li > ol {
  margin: .8em 0 0;
  padding-left: 0;
  list-style: none;
  counter-reset: legal-subclause;
}

.legal-content--terms > ol > li > ol > li > ol > li {
  display: flex;
  align-items: baseline;
  gap: .5em;
  margin-bottom: .8em;
  counter-increment: legal-subclause;
}

.legal-content--terms > ol > li > ol > li > ol > li::before {
  content: counter(legal-clause) '.' counter(legal-subclause) '.';
  flex: 0 0 auto;
  /* Fixed, right-aligned column wide enough for double-digit numbers
     (e.g. "10.10.") so the body text always lines up at the same x
     position, whether the marker is "3.1." or "10.10.". */
  min-width: 2.75em;
  text-align: right;
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .legal-imprint__top {
    grid-template-columns: 1fr;
    gap: 28px;
    margin-bottom: 36px;
    padding-bottom: 32px;
  }

  .legal-imprint__recognition {
    padding: 24px 0 0;
    border-top: 1px solid var(--border);
    border-left: 0;
  }

  .legal-content--terms > ol {
    padding-left: 1.9rem;
  }

  .legal-content--terms > ol > li > ol {
    padding-left: 1.35rem;
  }
}
