/* ==========================================================================
   Legal pages (/impressum/, /datenschutz/) – page-specific styles
   Loaded after site.css. Uses only design-system tokens and breakpoints.
   Components used from site.css: .page-hero-compact, .breadcrumb, .kicker,
   .sheet, .legal-layout, .prose, .toc + .legal-toc (numbered TOC, scroll-spy,
   pill row on phones), .check-panel, .callout, .icon-tile, .tag, .link-arrow,
   .cta-stage, the footer aria-current style.
   ========================================================================== */

/* Compact final CTA: legal pages are reference pages, the closing stage stays shorter */
.cta-stage.legal-cta { padding-block: clamp(3.5rem, 2.4rem + 4vw, 6rem); }

/* --------------------------------------------------------------------------
   Impressum · provider card + contact / dispute blocks
   -------------------------------------------------------------------------- */
.imprint-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(1rem, 2.4vw, 2rem);
  align-items: stretch;
}

/* Dark "letterhead" card on the white sheet (figure/ground like .price-dark) */
.imprint-card {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex-direction: column;
  padding: clamp(24px, 3vw, 40px);
  border-radius: var(--r-lg);
  background:
    radial-gradient(ellipse 90% 60% at 100% 0%, color-mix(in srgb, var(--brand-blue) 42%, transparent), transparent 65%),
    radial-gradient(ellipse 60% 45% at 0% 100%, color-mix(in srgb, var(--brand-cyan) 14%, transparent), transparent 70%),
    var(--bg);
  box-shadow: var(--shadow-lift);
}
/* grid texture, faded towards the lower left (same language as .stage) */
.imprint-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 100% 0%, #000 10%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 100% 0%, #000 10%, transparent 75%);
}
/* brand rule along the bottom edge (decoration only) */
.imprint-card::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: var(--grad-brand);
}
.imprint-card-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.imprint-brand { display: inline-flex; align-items: center; gap: .55rem; }

.imprint-h {
  font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500;
  letter-spacing: .08em; line-height: 1.4; text-transform: uppercase;
  color: var(--fg-3);
}
.imprint-card .imprint-h { margin-top: auto; padding-top: clamp(2.5rem, 5vw, 4.5rem); color: var(--accent-text); }
.imprint-address {
  margin-top: .9rem;
  font-size: clamp(1.125rem, 1rem + .5vw, 1.375rem); line-height: 1.55; letter-spacing: -.012em;
  color: var(--fg-2);
}
.imprint-name { font-size: clamp(1.375rem, 1.1rem + 1vw, 1.875rem); font-weight: 620; letter-spacing: -.025em; color: var(--fg); }

.imprint-side { display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) auto; gap: clamp(1rem, 2vw, 1.25rem); }
.imprint-block {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 18px;
  padding: clamp(20px, 2.4vw, 28px);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
/* icon tile and mono label share one top line in every block (rows stay equal height) */
.imprint-block-t { display: grid; gap: .5rem; align-content: start; padding-top: .7rem; }
.imprint-block p { color: var(--fg-2); text-wrap: pretty; }
.imprint-block p:has(.imprint-mail) { display: flex; flex-wrap: wrap; align-items: center; column-gap: .4rem; font-size: 1.125rem; color: var(--fg); }
.imprint-mail {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--accent-text); font-weight: 560;
  text-decoration: underline; text-decoration-color: var(--accent-line); text-underline-offset: 5px;
  overflow-wrap: anywhere;
}
.imprint-mail:hover { text-decoration-color: currentColor; }
.legal-crosslink { display: flex; align-items: center; min-height: 44px; }

/* --------------------------------------------------------------------------
   Datenschutz · hero with plain-language overview
   -------------------------------------------------------------------------- */
.legal-hero-grid { display: grid; gap: clamp(1.75rem, 3vw, 2.5rem); }
.legal-summary { max-width: 620px; }
.legal-summary .check-panel-title { font-weight: 500; letter-spacing: .02em; }
.legal-summary .cr-t { text-wrap: pretty; }
/* Section chip is a jump link: keep the chip look, extend the hit area to 44px */
.legal-summary a.cr-v { position: relative; transition: color var(--t-fast), box-shadow var(--t-fast); }
.legal-summary a.cr-v::before { content: ""; position: absolute; inset: -10px -6px; }
.legal-summary a.cr-v:hover { color: var(--fg); box-shadow: inset 0 0 0 1px var(--accent-line); }
.legal-summary .check-panel-foot { color: var(--fg-2); background: var(--surface); }
.legal-summary .check-panel-foot .i { color: var(--accent-text); stroke-width: 1.8; }

/* --------------------------------------------------------------------------
   Datenschutz · legal text
   -------------------------------------------------------------------------- */
.legal-sec + .legal-sec { margin-top: 2.25rem; padding-top: 2.25rem; border-top: 1px solid var(--line); }
.legal-prose h2 { display: flex; align-items: baseline; gap: .7rem; }
.legal-prose p:last-child { margin-bottom: 0; }
.legal-prose p, .legal-prose .legal-callout p { text-wrap: pretty; }
/* Section numbers: accent mono numeral "1." – the same style as the TOC .toc-n */
.legal-num {
  flex: none; min-width: 1.6rem;
  font-family: var(--font-mono); font-size: .8em; font-weight: 500; letter-spacing: 0;
  color: var(--accent-text);
}
.legal-address {
  width: fit-content; max-width: 100%;
  padding: 16px 20px;
  border-radius: var(--r-md);
  line-height: 1.7; color: var(--fg);
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line);
}
.legal-address a { display: inline-flex; align-items: center; min-height: 44px; vertical-align: middle; }
.legal-prose .legal-callout p { margin: 0; }
.legal-cta .lead { text-wrap: balance; }

/* --------------------------------------------------------------------------
   Responsive (system breakpoints only)
   -------------------------------------------------------------------------- */
@media (min-width: 1100px) {
  .legal-hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 540px); align-items: start; column-gap: clamp(3rem, 6vw, 6rem); }
  .legal-summary { max-width: none; }
}

@media (max-width: 1020px) {
  .imprint-grid { grid-template-columns: minmax(0, 1fr); }
  .imprint-side { grid-template-rows: none; }
  .imprint-card .imprint-h { padding-top: 2rem; }
}

@media (max-width: 760px) {
  /* Overview: the three key facts stay, the two secondary rows go */
  .legal-summary .check-rows li.is-optional { display: none; }
  .legal-sec + .legal-sec { margin-top: 1.75rem; padding-top: 1.75rem; }
  .legal-prose h2 { font-size: 1.25rem; gap: .65rem; }
  /* Impressum blocks: text only on phones (the icon tile would squeeze the mail line) */
  .imprint-block { grid-template-columns: minmax(0, 1fr); }
  .imprint-block .icon-tile { display: none; }
  .imprint-block-t { padding-top: 0; }
}

@media (max-width: 520px) {
  .imprint-card-top .tag { display: none; }
  .legal-address { width: auto; }
}
