/* ─────────────────────────────────────────────────────────
   Blue Terra — the Terms of Service page

   A long legal document, so the job here is readability: one narrow
   column of text, a contents list that stays in view, and generous
   space between clauses. Colours and typefaces come from styles.css.
   ───────────────────────────────────────────────────────── */

.terms-page main { padding-top: var(--header-h); background: var(--cream); }

/* ── Title band ─────────────────────────────────────────── */
.tm-head {
  max-width: var(--wrap-content);
  padding-top: clamp(28px, 5vw, 52px);
  padding-bottom: clamp(18px, 3vw, 28px);
}
.tm-crumbs {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: .85rem; color: var(--muted); margin-bottom: 1rem;
}
.tm-crumbs a { color: inherit; text-decoration: none; }
.tm-crumbs a:hover { color: var(--navy); text-decoration: underline; }

/* "Geschäftsbedingungen" is wider than a 320 px phone, so let it hyphenate
   at a proper syllable rather than break anywhere. */
.tm-head h1 { margin-bottom: 0; -webkit-hyphens: auto; hyphens: auto; }
/* Same reasoning as on the privacy page: make the title fit outright. */
@media (max-width: 389px) { .tm-head h1 { font-size: 24px; } }

/* ── The two columns ────────────────────────────────────── */
.tm-layout {
  max-width: var(--wrap-content);
  /* minmax(0, …) rather than a bare 1fr: a grid column refuses to become
     narrower than its longest word, and the terms contain long web
     addresses. Without this the page scrolls sideways on a 320 px phone. */
  display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(24px, 4vw, 56px);
  padding-bottom: clamp(48px, 7vw, 88px);
  align-items: start;
}

/* ── Contents ───────────────────────────────────────────── */
.tm-toc {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 4px 18px;
}
.tm-toc-summary {
  cursor: pointer; list-style: none; font-weight: 600; color: var(--heading);
  padding: 14px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.tm-toc-summary::-webkit-details-marker { display: none; }
/* A chevron that turns over when the list opens. */
.tm-toc-summary::after {
  content: ''; width: 9px; height: 9px; flex: none;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translate(-2px, -2px); transition: transform .18s ease;
}
.tm-toc[open] .tm-toc-summary::after { transform: rotate(-135deg) translate(-2px, -2px); }

.tm-toc-nav { padding-bottom: 14px; }
.tm-toc-part {
  margin: 12px 0 8px; font-size: .72rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.tm-toc-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.tm-toc-list a {
  display: block; padding: 6px 10px; border-radius: 8px;
  font-size: .85rem; line-height: 1.35; color: var(--text); text-decoration: none;
  border-left: 2px solid transparent;
}
.tm-toc-list a:hover { background: var(--sky-bg); color: var(--navy-dark); }
.tm-toc-list a[aria-current] {
  background: var(--sky-bg); color: var(--navy-dark);
  font-weight: 600; border-left-color: var(--navy);
}

/* ── The document ───────────────────────────────────────── */
.tm-body {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: clamp(22px, 4vw, 46px);
  /* Terms like "Übernachtungsmöglichkeiten" are wider than a phone column. */
  overflow-wrap: break-word;
}
.tm-body p { margin: 0 0 1rem; font-size: .95rem; line-height: 1.75; }
.tm-body a { color: var(--navy); }

.tm-lead { margin-bottom: 2rem; }
.tm-lead p:first-child { font-weight: 600; color: var(--heading); }

.tm-part + .tm-part { margin-top: clamp(32px, 5vw, 52px); }
.tm-part-title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(21px, 2.6vw, 27px); line-height: 1.25;
  color: var(--navy-dark);
  padding-top: 1.4rem; border-top: 2px solid var(--line); margin-bottom: 1.4rem;
}

.tm-section { scroll-margin-top: calc(var(--header-h) + 18px); }
.tm-section + .tm-section { margin-top: 2rem; }
.tm-section-title {
  font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--navy); margin-bottom: .9rem;
}

.tm-list { margin: 0 0 1rem; padding-left: 1.1rem; }
.tm-list li {
  position: relative; padding-left: .85rem; margin-bottom: .5rem;
  font-size: .95rem; line-height: 1.7;
}
.tm-list li::before {
  content: ''; position: absolute; left: 0; top: .72em;
  width: 5px; height: 5px; border-radius: 50%; background: var(--navy);
}

.tm-address {
  background: var(--stone-bg); border-radius: var(--radius-sm);
  padding: 14px 18px; line-height: 1.6;
}

/* ── Desktop: contents beside the text, and it stays put ── */
@media (min-width: 900px) {
  .tm-layout { grid-template-columns: 265px minmax(0, 1fr); }
  .tm-toc-wrap { position: sticky; top: calc(var(--header-h) + 16px); }
  .tm-toc {
    padding: 4px 14px;
    max-height: calc(100vh - var(--header-h) - 48px);
    overflow-y: auto;
  }
  /* Open permanently here — the summary would only be in the way. */
  .tm-toc-summary { cursor: default; }
  .tm-toc-summary::after { display: none; }
}

@media (max-width: 899px) {
  /* Keep the folded contents within reach while scrolling the clauses. */
  .tm-toc-nav { max-height: 55vh; overflow-y: auto; }
}
