/*
 * Legal pages — imprint, terms, privacy, returns, contact (2026-11-22 redesign, shared by every site).
 * Used by templates/layout/legal.php + templates/element/legal/page.php only; nothing else loads it.
 * Neutral ink-on-white palette so it sits with any site's logo; system fonts (no web-font request).
 */

:root {
    --lg-ink: #0b1324;
    --lg-text: #2b3546;
    --lg-muted: #5d6879;
    --lg-line: #e4e8ef;
    --lg-soft: #f5f7fa;
    --lg-softer: #fafbfc;
    --lg-ring: rgba(11, 19, 36, 0.14);
    --lg-radius: 14px;
    --lg-header-h: 64px;
    --lg-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

body.lg-body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    color: var(--lg-text);
    font-family: var(--lg-font);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.lg-body img {
    max-width: 100%;
    height: auto;
}

.lg-wrap {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
}

.lg-body a:focus-visible,
.lg-body summary:focus-visible,
.lg-body button:focus-visible {
    outline: 2px solid var(--lg-ink);
    outline-offset: 3px;
    border-radius: 6px;
}

/* ---------------------------------------------------------------- header */

.lg-header {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--lg-line);
}

.lg-header__in {
    height: var(--lg-header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.lg-logo {
    display: inline-flex;
    align-items: center;
    min-width: 0;
}

.lg-logo__img {
    display: block;
    height: auto;
    max-height: 44px;
    max-width: min(260px, 56vw);
    width: auto;
    object-fit: contain;
}

.lg-logo__text {
    color: var(--lg-ink);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lg-logo:has(.lg-logo__text) {
    text-decoration: none;
}

.lg-header__mail {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--lg-line);
    border-radius: 999px;
    color: var(--lg-ink);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color .15s ease, background-color .15s ease;
}

.lg-header__mail:hover {
    border-color: #cfd6e0;
    background: var(--lg-soft);
}

.lg-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    overflow: hidden;
    pointer-events: none;
}

.lg-progress span {
    display: block;
    height: 100%;
    background: var(--lg-ink);
    transform: scaleX(0);
    transform-origin: 0 50%;
}

/* ---------------------------------------------------------------- hero */

.lg-main {
    flex: 1 0 auto;
}

.lg-hero {
    position: relative;
    padding: 56px 0 36px;
    background:
        radial-gradient(1200px 320px at 85% -120px, rgba(120, 140, 170, 0.12), transparent 70%),
        linear-gradient(180deg, var(--lg-soft) 0%, #fff 100%);
    border-bottom: 1px solid var(--lg-line);
}

.lg-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    padding: 6px 12px 6px 10px;
    border: 1px solid var(--lg-line);
    border-radius: 999px;
    background: #fff;
    color: var(--lg-muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;
    line-height: 1.2;
}

.lg-eyebrow svg {
    flex: none;
    color: var(--lg-ink);
}

.lg-title {
    margin: 0;
    max-width: 22ch;
    color: var(--lg-ink);
    font-size: clamp(1.75rem, 1rem + 3vw, 3.1rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.028em;
    overflow-wrap: break-word;
    -webkit-hyphens: auto;
    hyphens: auto;
}

.lg-tabs {
    margin-top: 28px;
}

.lg-tabs ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.lg-tabs a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 16px;
    border: 1px solid var(--lg-line);
    border-radius: 999px;
    background: #fff;
    color: var(--lg-text);
    font-size: 14.5px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.lg-tabs a:hover {
    border-color: #c9d1dc;
    color: var(--lg-ink);
}

.lg-tabs a.is-active {
    border-color: var(--lg-ink);
    background: var(--lg-ink);
    color: #fff;
}

/* ---------------------------------------------------------------- layout */

.lg-layout {
    padding-top: 44px;
    padding-bottom: 88px;
}

.lg-content {
    min-width: 0;
    max-width: 760px;
}

@media (min-width: 1024px) {
    .lg-layout.has-toc {
        display: grid;
        grid-template-columns: 264px minmax(0, 1fr);
        gap: 64px;
        align-items: start;
    }
}

/* ---------------------------------------------------------------- table of contents */

.lg-toc {
    display: none;
}

@media (min-width: 1024px) {
    .lg-toc {
        display: block;
        position: sticky;
        top: calc(var(--lg-header-h) + 28px);
        max-height: calc(100vh - var(--lg-header-h) - 56px);
        overflow-y: auto;
        overscroll-behavior: contain;
        padding-right: 6px;
        scrollbar-width: thin;
    }
}

.lg-toc__title {
    margin: 0 0 12px;
    color: var(--lg-ink);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.lg-toc__list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-left: 1px solid var(--lg-line);
}

.lg-toc__list a {
    display: block;
    margin-left: -1px;
    padding: 7px 0 7px 16px;
    border-left: 2px solid transparent;
    color: var(--lg-muted);
    font-size: 14px;
    line-height: 1.4;
    text-decoration: none;
    transition: color .15s ease, border-color .15s ease;
}

.lg-toc__list a:hover {
    color: var(--lg-ink);
}

.lg-toc__list a.is-active {
    border-left-color: var(--lg-ink);
    color: var(--lg-ink);
    font-weight: 600;
}

/* phone / tablet: folded panel above the text */
.lg-toc-m {
    margin: 0 0 32px;
    border: 1px solid var(--lg-line);
    border-radius: var(--lg-radius);
    background: var(--lg-softer);
}

@media (min-width: 1024px) {
    .lg-toc-m {
        display: none;
    }
}

.lg-toc-m summary {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 12px 18px;
    color: var(--lg-ink);
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.lg-toc-m summary::-webkit-details-marker {
    display: none;
}

.lg-toc-m summary::after {
    content: "";
    width: 9px;
    height: 9px;
    margin-left: auto;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform .2s ease;
}

.lg-toc-m[open] summary::after {
    transform: translateY(2px) rotate(-135deg);
}

.lg-toc-m__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--lg-line);
    color: var(--lg-muted);
    font-size: 12px;
    font-weight: 600;
}

.lg-toc-m .lg-toc__list {
    margin: 0 18px 16px;
    max-height: 60vh;
    overflow-y: auto;
}

.lg-toc-m .lg-toc__list a {
    padding-top: 9px;
    padding-bottom: 9px;
    font-size: 15px;
}

/* ---------------------------------------------------------------- document */

.lg-doc {
    color: var(--lg-text);
    font-size: 1.0625rem;
    line-height: 1.75;
    overflow-wrap: break-word;
    -webkit-hyphens: auto;
    hyphens: auto;
}

@media (max-width: 640px) {
    .lg-doc {
        font-size: 1rem;
        line-height: 1.7;
    }
}

.lg-doc > :first-child {
    margin-top: 0;
}

.lg-doc > :last-child {
    margin-bottom: 0;
}

.lg-doc p {
    margin: 0 0 1.05em;
}

.lg-doc h2,
.lg-doc h3,
.lg-doc h4 {
    color: var(--lg-ink);
    -webkit-hyphens: manual;
    hyphens: manual;
    scroll-margin-top: calc(var(--lg-header-h) + 24px);
}

.lg-doc h2 {
    margin: 2.6em 0 .7em;
    padding-top: 1.6em;
    border-top: 1px solid var(--lg-line);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.015em;
}

.lg-doc > h2:first-child {
    padding-top: 0;
    border-top: 0;
}

.lg-doc h3 {
    margin: 2em 0 .5em;
    font-size: 1.08rem;
    font-weight: 650;
    line-height: 1.45;
    letter-spacing: -0.005em;
}

.lg-doc h2 + h3 {
    margin-top: 1em;
}

.lg-doc h4 {
    margin: 1.6em 0 .4em;
    font-size: 1rem;
    font-weight: 650;
}

.lg-doc strong {
    color: var(--lg-ink);
    font-weight: 650;
}

.lg-doc a {
    color: var(--lg-ink);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: rgba(11, 19, 36, 0.3);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: text-decoration-color .15s ease;
    overflow-wrap: anywhere;
}

.lg-doc a:hover {
    text-decoration-color: var(--lg-ink);
}

.lg-doc u {
    text-decoration-thickness: 1px;
    text-decoration-color: rgba(11, 19, 36, 0.35);
    text-underline-offset: 3px;
}

.lg-doc ul,
.lg-doc ol {
    margin: 0 0 1.1em;
    padding-left: 1.4em;
}

.lg-doc li {
    margin: .4em 0;
    padding-left: .2em;
}

.lg-doc ul > li::marker {
    color: #9aa4b2;
}

.lg-doc ol > li::marker {
    color: var(--lg-muted);
    font-weight: 600;
}

.lg-doc blockquote {
    margin: 1.4em 0;
    padding: .2em 0 .2em 1.1em;
    border-left: 3px solid var(--lg-line);
    color: var(--lg-muted);
}

.lg-doc hr {
    margin: 2.4em 0;
    border: 0;
    border-top: 1px solid var(--lg-line);
}

.lg-doc table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    margin: 1.4em 0;
    border-collapse: collapse;
    font-size: .95em;
}

.lg-doc th,
.lg-doc td {
    padding: 10px 12px;
    border: 1px solid var(--lg-line);
    text-align: left;
    vertical-align: top;
}

.lg-doc th {
    background: var(--lg-soft);
    color: var(--lg-ink);
}

/* Imprint: "Label<br>value" paragraphs as cards */
.lg-doc--facts {
    display: grid;
    gap: 14px;
}

@media (min-width: 720px) {
    .lg-doc--facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }
}

.lg-doc--facts > p {
    margin: 0;
    padding: 20px 22px;
    border: 1px solid var(--lg-line);
    border-radius: var(--lg-radius);
    background: #fff;
    box-shadow: 0 1px 2px rgba(11, 19, 36, 0.04);
    color: var(--lg-ink);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-hyphens: manual;
    hyphens: manual;
}

.lg-doc--facts > p > strong:first-child {
    display: block;
    margin-bottom: 8px;
    color: var(--lg-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    line-height: 1.3;
    text-transform: uppercase;
}

.lg-doc--facts > p > strong:first-child + br {
    display: none;
}

.lg-doc--facts > :not(p) {
    grid-column: 1 / -1;
}

.lg-empty {
    padding: 28px 24px;
    border: 1px dashed #cfd6e0;
    border-radius: var(--lg-radius);
    background: var(--lg-softer);
    color: var(--lg-muted);
    font-size: 1.05rem;
}

.lg-empty p {
    margin: 0;
}

/* ---------------------------------------------------------------- flash messages */

.lg-body .message {
    max-width: 1160px;
    margin: 16px auto 0;
    padding: 12px 20px;
    border-radius: 10px;
    background: var(--lg-soft);
    color: var(--lg-ink);
}

/* ---------------------------------------------------------------- footer */

.lg-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--lg-line);
    background: var(--lg-soft);
    color: var(--lg-muted);
    font-size: 14px;
}

.lg-footer__in {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 32px;
    padding-top: 28px;
    padding-bottom: max(28px, env(safe-area-inset-bottom));
}

.lg-footer__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
}

.lg-footer__nav a {
    color: var(--lg-text);
    text-decoration: none;
}

.lg-footer__nav a:hover,
.lg-footer__nav a[aria-current="page"] {
    color: var(--lg-ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.lg-footer__copy {
    margin: 0;
}

/* ---------------------------------------------------------------- back to top */

.lg-top {
    position: fixed;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 40;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid var(--lg-line);
    border-radius: 999px;
    background: #fff;
    color: var(--lg-ink);
    box-shadow: 0 6px 20px rgba(11, 19, 36, 0.12);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}

.lg-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(11, 19, 36, 0.16);
}

.lg-top[hidden],
.lg-progress[hidden] {
    display: none;
}

/* ---------------------------------------------------------------- small screens */

@media (max-width: 640px) {
    :root {
        --lg-header-h: 58px;
    }

    .lg-logo__img {
        max-height: 34px;
    }

    .lg-header__mail {
        width: 40px;
        padding: 0;
        justify-content: center;
    }

    .lg-header__mail-text {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .lg-hero {
        padding: 34px 0 26px;
    }

    .lg-tabs {
        margin: 22px -20px 0;
    }

    /* one row that scrolls sideways instead of three rows of pills */
    .lg-tabs ul {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 2px 20px;
        scroll-padding-left: 20px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .lg-tabs ul::-webkit-scrollbar {
        display: none;
    }

    .lg-tabs li {
        flex: none;
    }

    .lg-tabs a {
        min-height: 38px;
        padding: 7px 14px;
        font-size: 14px;
        white-space: nowrap;
    }

    .lg-doc h2 {
        margin-top: 2.2em;
        padding-top: 1.3em;
        font-size: 1.3rem;
    }

    .lg-layout {
        padding-top: 30px;
        padding-bottom: 64px;
    }

    .lg-doc--facts > p {
        padding: 18px;
    }

    .lg-footer__in {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lg-body *,
    .lg-body *::before,
    .lg-body *::after {
        transition: none !important;
    }
}

/* ---------------------------------------------------------------- print */

@media print {
    .lg-header,
    .lg-tabs,
    .lg-toc,
    .lg-toc-m,
    .lg-footer,
    .lg-top,
    .lg-eyebrow {
        display: none !important;
    }

    body.lg-body {
        display: block;
        font-size: 11pt;
    }

    .lg-hero {
        padding: 0 0 12pt;
        background: none;
        border: 0;
    }

    .lg-title {
        max-width: none;
        font-size: 20pt;
    }

    .lg-layout {
        display: block !important;
        padding: 0;
    }

    .lg-content {
        max-width: none;
    }

    .lg-doc {
        font-size: 10.5pt;
        line-height: 1.5;
    }

    .lg-doc h2 {
        break-after: avoid;
    }

    .lg-doc--facts > p {
        box-shadow: none;
        break-inside: avoid;
    }
}
