/*
 * info_legal – public pages of the legal texts (T444): /rechtliches, /impressum, /agb, /widerruf, /datenschutz, /avv and
 * /<document>/fassung/<label>. Typography after the design system (Comfortaa title, Museo Sans text), cards and pills like the
 * other info pages (no own reference screen – derived from "Quantiz Atrium Hilfe" and the page "Verträge hier kündigen").
 * Base components: info_page (section, pretext, description, actions, footer), breadcrumbs (breadcrumbs_info), content_tags,
 * content_annotation, content_link_button.
 *
 * Structure: info_legal_breadcrumbs (breadcrumbs) · info_legal (section) > info_legal_body >
 *              info_legal_header (pretext · info_legal_title · description · info_legal_meta (content_tags · _meta_text) ·
 *                                 info_legal_controls (content_link_button ×n))
 *              info_legal_notice? (content_annotation, variant _scheduled)
 *              info_legal_layout (_single) > info_legal_outline (_title · _items > _item (_sub) > _link) · info_legal_text (_file)
 *              info_legal_versions (info_legal_section_title · _items > _item (_current) > _link · content_tag · _range)
 *              info_legal_related (info_legal_section_title · _items > info_legal_related_item (_icon · _label))
 *            /rechtliches: info_legal_index > _item > _link (_icon · _body > _title · _description · _meta)
 * The text itself is the fragment of Legal\LegalRenderer: h2/h3 with id and info_legal_text_anchor, p, lists, tables in
 * info_legal_text_table, hr, strong/em/code, links.
 */

/* T535: in line with the text (info_legal_body, 1120 px) – padding outside the width like the sections */
.info_legal_breadcrumbs { box-sizing: content-box; max-width: 1120px; margin: 0 auto; padding: 18px clamp(20px, 5vw, 72px) 0; }
.info_legal { padding-top: clamp(28px, 4vw, 56px); }
.info_legal_body { max-width: 1120px; gap: 28px; }

/* Head --------------------------------------------------------------------- */
.info_legal_header { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
/* long German words ("Geschäftsbedingungen"): hyphenated where the browser can, otherwise broken – never wider than the screen */
.info_legal_title { margin: 0; max-width: 100%; font-family: var(--font-display); font-size: clamp(26px, 3vw + 14px, 44px); font-weight: 600; line-height: 1.15; color: var(--q-highlight-2); text-wrap: balance; hyphens: auto; overflow-wrap: anywhere; }
.info_legal_meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: var(--fs-14); color: var(--q-dark); }
.info_legal_meta_text { color: var(--q-highlight-2); font-weight: var(--w-regular); }
.info_legal_controls { margin-top: 2px; }
.info_legal_notice { margin: 0; }
.info_legal_notice { font-size: var(--fs-13); }
.info_legal_notice a { margin-left: 0; font-weight: var(--w-bold); }
.info_legal_notice_scheduled { background: rgba(21, 165, 181, .12); border-color: transparent; color: var(--q-highlight-2); }

/* Outline beside the text ---------------------------------------------------- */
.info_legal_layout { display: grid; grid-template-columns: minmax(200px, 270px) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
.info_legal_layout_single { grid-template-columns: minmax(0, 1fr); }
/* T653: sticks below the sticky info_header (--info-header-height, kept by info.js) – never hidden behind it */
.info_legal_outline { position: sticky; top: calc(var(--info-header-height, 82px) + 16px); max-height: calc(100vh - var(--info-header-height, 82px) - 32px); max-height: calc(100dvh - var(--info-header-height, 82px) - 32px); overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 18px 14px 14px; border-radius: var(--radius-lg); background: var(--q-highlight-4); }
.info_legal_outline_title { margin: 0; padding: 0 8px; font-family: inherit; font-size: var(--fs-12); font-weight: var(--w-bold); letter-spacing: .10em; text-transform: uppercase; color: var(--q-highlight-2); }
.info_legal_outline_items { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 1px; }
.info_legal_outline_link { display: block; padding: 6px 8px; border-radius: var(--radius-sm); font-size: var(--fs-13); line-height: 1.35; font-weight: var(--w-bold); color: var(--q-highlight-2); text-decoration: none; }
.info_legal_outline_item_sub .info_legal_outline_link { padding-left: 20px; font-weight: var(--w-light); color: var(--q-dark); }
.info_legal_outline_link:hover { background: var(--q-white); color: var(--q-highlight-2); }
.info_legal_outline_link:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }

/* The text ------------------------------------------------------------------ */
.info_legal_text { min-width: 0; max-width: 760px; font-size: var(--fs-16); line-height: 1.65; color: var(--q-dark); overflow-wrap: anywhere; }
.info_legal_text > :first-child { margin-top: 0; }
.info_legal_text h2, .info_legal_text h3, .info_legal_text h4, .info_legal_text h5, .info_legal_text h6 { position: relative; scroll-margin-top: calc(var(--info-header-height, 0px) + 16px); color: var(--q-highlight-2); line-height: 1.3; text-wrap: balance; hyphens: auto; }
.info_legal_text h2 { margin: 2.1em 0 .6em; font-family: var(--font-display); font-size: clamp(22px, 2.2vw, 26px); font-weight: 600; }
.info_legal_text h3 { margin: 1.7em 0 .5em; font-size: var(--fs-18); font-weight: var(--w-bold); }
.info_legal_text h4, .info_legal_text h5, .info_legal_text h6 { margin: 1.4em 0 .4em; font-size: var(--fs-16); font-weight: var(--w-bold); }
.info_legal_text p, .info_legal_text ul, .info_legal_text ol, .info_legal_text blockquote { margin: 0 0 1em; }
.info_legal_text ul, .info_legal_text ol { padding-left: 1.4em; }
.info_legal_text li { margin: .25em 0; }
.info_legal_text li::marker { color: var(--q-highlight-3); }
.info_legal_text strong { font-weight: var(--w-bold); color: var(--q-highlight-2); }
.info_legal_text a { color: var(--link); font-weight: var(--w-bold); text-decoration: underline; text-underline-offset: 2px; }
.info_legal_text a:hover { color: var(--link-hover); }
.info_legal_text code { padding: 1px 6px; border-radius: var(--radius-xs); background: var(--q-highlight-4); font-family: var(--font-mono); font-size: .9em; }
.info_legal_text hr { margin: 2em 0; border: 0; border-top: 1px solid var(--divider); }
.info_legal_text blockquote { padding: 10px 16px; border-left: 3px solid var(--q-highlight-1); background: var(--q-highlight-4); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.info_legal_text_table { margin: 0 0 1.2em; overflow-x: auto; border: 1px solid var(--divider); border-radius: var(--radius-md); }
.info_legal_text table { width: 100%; border-collapse: collapse; font-size: var(--fs-14); line-height: 1.5; }
.info_legal_text th, .info_legal_text td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--divider); }
.info_legal_text tr:last-child td { border-bottom: 0; }
.info_legal_text th { background: var(--q-highlight-4); color: var(--q-highlight-2); font-weight: var(--w-bold); }
.info_legal_text .info_legal_text_anchor { margin-left: .4em; font-family: var(--font-sans); font-weight: var(--w-bold); color: var(--q-medium); text-decoration: none; opacity: 0; transition: opacity var(--dur-fast) var(--ease-std); }
.info_legal_text :is(h2, h3):hover .info_legal_text_anchor, .info_legal_text .info_legal_text_anchor:focus-visible { opacity: 1; }
.info_legal_text .info_legal_text_anchor:hover { color: var(--q-highlight-3); }
.info_legal_text :is(h2, h3):target { animation: info_legal_target 1.6s var(--ease-std); }
@keyframes info_legal_target { from { background: var(--brand-soft); } to { background: transparent; } }
.info_legal_text_file { padding: 22px; border-radius: var(--radius-lg); background: var(--q-highlight-4); }

/* Versions and related ------------------------------------------------------- */
.info_legal_section_title { margin: 0 0 12px; font-family: inherit; font-size: var(--fs-12); font-weight: var(--w-bold); letter-spacing: .10em; text-transform: uppercase; color: var(--q-highlight-2); }
.info_legal_versions, .info_legal_related { padding-top: 22px; border-top: 1px solid var(--divider); }
.info_legal_versions_items { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.info_legal_versions_item { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 10px 0; border-bottom: 1px solid var(--divider); font-size: var(--fs-14); }
.info_legal_versions_item:last-child { border-bottom: 0; }
.info_legal_versions_item_link { min-width: 110px; font-weight: var(--w-bold); color: var(--q-highlight-2); }
.info_legal_versions_item_current .info_legal_versions_item_link { text-decoration: underline; text-decoration-color: var(--q-highlight-1); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.info_legal_versions_item_range { margin-left: auto; color: var(--q-dark); }
.info_legal_related_items { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 4px 16px; }
.info_legal_related_item { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 10px 4px 4px; border-radius: var(--radius-md); color: var(--q-highlight-2); font-weight: var(--w-bold); font-size: var(--fs-14); text-decoration: none; transition: background-color var(--dur-fast) ease; }
.info_legal_related_item:hover { background: var(--q-highlight-4); color: var(--q-highlight-2); }
.info_legal_related_item_icon { width: 32px; height: 32px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-circle); background: var(--q-highlight-4); }
.info_legal_related_item_icon .info_page_icon { width: 15px; height: 15px; }

/* /rechtliches -------------------------------------------------------------- */
.info_legal_index { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px; }
.info_legal_index_item { display: flex; }
.info_legal_index_item_link { display: flex; align-items: flex-start; gap: 14px; width: 100%; padding: 20px; border-radius: var(--radius-lg); border: 2px solid var(--divider); background: var(--q-white); color: inherit; text-decoration: none; transition: border-color 300ms ease; }
.info_legal_index_item_link:hover { border-color: var(--q-highlight-2); color: inherit; }
.info_legal_index_item_link:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.info_legal_index_item_icon { width: 42px; height: 42px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-circle); background: var(--brand-soft); color: var(--q-highlight-2); }
.info_legal_index_item_icon .info_page_icon { width: 18px; height: 18px; }
.info_legal_index_item_body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.info_legal_index_item_title { font-family: var(--font-display); font-size: var(--fs-18); font-weight: 600; color: var(--q-highlight-2); line-height: 1.3; hyphens: auto; overflow-wrap: anywhere; }
.info_legal_index_item_description { font-size: var(--fs-14); line-height: 1.5; color: var(--q-dark); }
.info_legal_index_item_meta { margin-top: 4px; font-size: var(--fs-12); font-weight: var(--w-bold); color: var(--q-highlight-2); }

@media (max-width: 860px) {
  .info_legal_layout { grid-template-columns: minmax(0, 1fr); }
  .info_legal_outline { position: static; max-height: none; }
  .info_legal_versions_item_range { margin-left: 0; flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .info_legal_text .info_legal_text_anchor, .info_legal_related_item, .info_legal_index_item_link { transition: none; }
  .info_legal_text :is(h2, h3):target { animation: none; }
}
@media print {
  .info_header, .info_legal_breadcrumbs, .info_legal_controls, .info_legal_outline, .info_legal_versions, .info_legal_related, .info_page_footer, .visually_hidden { display: none !important; }
  .info_legal_layout { display: block; }
  .info_legal_text { max-width: none; font-size: 11pt; }
  .info_legal_text .info_legal_text_anchor { display: none; }
}
