/*
 * legal.css - Rechtstexte: conditions-generales.html und, seit 15.09.2026,
 * politique-confidentialite.html. Wer hier etwas aendert, sieht beide Seiten an.
 *
 * Baut auf styles.css auf: Farben, Kopf- und Fussleiste kommen von dort und
 * bleiben damit auf allen Seiten gleich. Muss nach styles.css eingebunden
 * werden.
 *
 * Alle Klassen beginnen mit cg-. styles.css vergibt kurze Namen wie .row,
 * .text und .icon schon und setzt Regeln direkt auf header, nav und footer:
 * ein <nav> fuer das Inhaltsverzeichnis erbt dort Flex, Hoehe und
 * Innenabstand der Kopfleiste und wird deshalb unten zurueckgesetzt.
 */

.cg {
    --cg-paper: #fbfaf8;
    --cg-ink: #1a1613;
    --cg-ink-soft: #5c544d;      /* 7:1 auf --cg-paper */
    --cg-perforation: #b3aba3;
    --cg-muted: #938a82;         /* 5.8:1 auf --black */
}

/* Die feste Kopfleiste ist 60px hoch; ein Sprung zu einem Artikel soll
   dessen Titel nicht darunter verstecken. */
html {
    scroll-padding-top: calc(60px + 1.5rem);
}

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

/* Kopfleiste: statt Warenkorb (braucht app.js) ein Weg zurueck in die
   Bestellung. Markenfarbe nach der Regel in styles.css. */
.footer-link[aria-current="page"] {
    color: var(--white);
}

/* ------------------------------------------------------------------
   Seitenkopf: Titel links, Bon rechts
   ------------------------------------------------------------------ */
.cg-wrap {
    max-width: 70rem;
    margin: 0 auto;
    padding-inline: 1.5rem;
    padding-block: 3.5rem 5rem;
}

.cg-head {
    display: grid;
    gap: 2.5rem;
    align-items: start;
    margin-bottom: 4.5rem;
}

@media (min-width: 60rem) {
    .cg-head {
        grid-template-columns: minmax(0, 1fr) 28rem;
        gap: 4rem;
    }
}

.cg-title {
    font-family: var(--carte-display);
    font-size: clamp(2.5rem, 1.4rem + 4.2vw, 4.4rem);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.01em;
    color: var(--white);
    text-wrap: balance;
    hyphens: manual;
}

.cg-lede {
    margin-top: 1.4rem;
    max-width: 30rem;
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--text-gray);
}

.cg-updated {
    margin-top: 1.25rem;
    font-size: 0.875rem;
    color: var(--cg-muted);
}

/* ------------------------------------------------------------------
   Der Bon

   Thermopapier mit gerissener Unterkante, wie ihn die Borne druckt. Die
   Zaehne schneidet eine Maske aus der Flaeche: ein Rechteck fuer alles
   ausser dem untersten Streifen, darunter ein Muster aus nach unten
   zeigenden Dreiecken.
   ------------------------------------------------------------------ */
/* Ein Bon ist schmal: auch einspaltig nicht breiter als 30rem, sonst
   laufen die Punktlinien ueber den halben Bildschirm. */
.cg-ticket {
    --tooth: 0.55rem;
    container-type: inline-size;
    max-width: 30rem;
    background: var(--cg-paper);
    color: var(--cg-ink);
    padding: 1.6rem 1.6rem calc(1.4rem + var(--tooth));
    -webkit-mask:
        linear-gradient(#000 0 0) top / 100% calc(100% - var(--tooth)) no-repeat,
        conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg)
            left bottom / calc(2 * var(--tooth)) var(--tooth) repeat-x;
    mask:
        linear-gradient(#000 0 0) top / 100% calc(100% - var(--tooth)) no-repeat,
        conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg)
            left bottom / calc(2 * var(--tooth)) var(--tooth) repeat-x;
}

.cg-ticket-shop {
    text-align: center;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--cg-ink-soft);
}

.cg-ticket-title {
    margin-top: 0.5rem;
    text-align: center;
    font-family: var(--carte-display);
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--cg-ink);
    text-wrap: balance;
}

.cg-ticket-rows {
    list-style: none;
    margin-top: 1.1rem;
    padding: 0.55rem 0;
    border-top: 2px dashed var(--cg-perforation);
    border-bottom: 2px dashed var(--cg-perforation);
}

.cg-ticket-row {
    position: relative;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.6rem 0;
    font-size: 0.9375rem;
    line-height: 1.35;
}

/* Die Artikelnummer ist der Link; ihr ::after spannt ihn ueber die ganze
   Zeile, damit auf dem Handy die Zeile selbst die Tippflaeche ist. */
.cg-ticket-ref {
    flex: 0 0 2.25rem;
    color: var(--brand);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    text-decoration: none;
}

.cg-ticket-ref::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 0.3rem;
}

.cg-ticket-ref:focus {
    outline: none;
}

.cg-ticket-ref:focus-visible::after {
    outline: 2px solid var(--focus-color);
    outline-offset: 1px;
}

.cg-ticket-row:hover .cg-ticket-label {
    text-decoration: underline;
    text-decoration-color: var(--brand);
    text-underline-offset: 3px;
}

.cg-ticket-label {
    font-weight: 600;
}

.cg-ticket-leader {
    flex: 1 1 1rem;
    min-width: 1rem;
    border-bottom: 2px dotted var(--cg-perforation);
    transform: translateY(-0.2em);
}

.cg-ticket-value {
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Schmaler Bon: Wert unter die Bezeichnung, Punktlinie weg. */
@container (max-width: 22rem) {
    .cg-ticket-row {
        flex-wrap: wrap;
        row-gap: 0.1rem;
    }

    .cg-ticket-leader {
        display: none;
    }

    .cg-ticket-label {
        flex: 1 1 0;
        font-weight: 500;
        color: var(--cg-ink-soft);
    }

    .cg-ticket-value {
        flex-basis: 100%;
        padding-left: 2.75rem;
        text-align: left;
    }
}

.cg-ticket-call {
    margin-top: 1.1rem;
    text-align: center;
    font-size: 0.9375rem;
    line-height: 1.5;
    text-wrap: balance;
}

.cg-ticket-call a {
    color: var(--cg-ink);
    font-weight: 800;
    white-space: nowrap;
    text-decoration-color: var(--brand);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

@media (pointer: coarse) {
    .cg-ticket-call a {
        display: inline-block;
        padding-block: 0.6rem;
    }
}

.cg-ticket-note {
    margin-top: 0.5rem;
    text-align: center;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--cg-ink-soft);
}

/* ------------------------------------------------------------------
   Sommaire und Artikel
   ------------------------------------------------------------------ */
.cg-body {
    display: grid;
    gap: 2.5rem;
}

@media (min-width: 64rem) {
    .cg-body {
        grid-template-columns: 15rem minmax(0, 39rem);
        column-gap: 5rem;
    }
}

nav.cg-toc {
    display: block;
    height: auto;
    max-width: none;
    margin: 0;
    padding: 0;
}

nav.cg-toc-side {
    display: none;
}

@media (min-width: 64rem) {
    nav.cg-toc-side {
        display: block;
        position: sticky;
        top: calc(60px + 2rem);
        align-self: start;
        max-height: calc(100vh - 60px - 4rem);
        overflow-y: auto;
    }

    .cg-toc-mobile {
        display: none;
    }
}

.cg-toc-title {
    margin-bottom: 0.6rem;
    font-family: var(--carte-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--white);
}

.cg-toc-list {
    list-style: none;
}

.cg-toc-list a {
    display: flex;
    gap: 0.6rem;
    padding: 0.3rem 0;
    color: var(--text-gray);
    text-decoration: none;
    font-size: 0.875rem;
    line-height: 1.35;
}

.cg-toc-list a:hover,
.cg-toc-list a:focus-visible {
    color: var(--white);
}

.cg-toc-num {
    flex: 0 0 1.3rem;
    color: var(--cg-muted);
    font-variant-numeric: tabular-nums;
}

.cg-toc-mobile {
    border: 1px solid var(--border-gray);
    border-radius: 0.6rem;
}

.cg-toc-mobile summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    padding: 0.7rem 1rem;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.cg-toc-mobile summary::-webkit-details-marker {
    display: none;
}

.cg-toc-mobile summary::after {
    content: '+';
    font-size: 1.4rem;
    font-weight: 400;
    line-height: 1;
    color: var(--text-gray);
}

.cg-toc-mobile[open] summary::after {
    content: '\2212';
}

.cg-toc-mobile .cg-toc-list {
    padding: 0 1rem 0.6rem;
}

.cg-toc-mobile .cg-toc-list a {
    align-items: center;
    min-height: 44px;
    padding: 0.35rem 0;
}

/* Artikel ------------------------------------------------------------ */
.cg-article + .cg-article {
    margin-top: 3.25rem;
}

.cg-article > * + * {
    margin-top: 0.9rem;
}

.cg-article > h3 {
    margin-top: 2rem;
}

.cg-article > h2 + h3 {
    margin-top: 1.2rem;
}

.cg-article h2 {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    font-family: var(--carte-display);
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: 0;
    color: var(--white);
    text-wrap: balance;
}

.cg-article h3 {
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--white);
}

/* Die Nummern sind echte Verweise ("art. 6"), keine Dekoration. Auf
   breiten Schirmen haengen sie im Rand, damit die Titel buendig bleiben. */
.cg-num,
.cg-subnum {
    border-radius: 0.25rem;
    background-color: transparent;
    box-shadow: 0 0 0 0.3rem transparent;
    font-variant-numeric: tabular-nums;
}

.cg-num {
    flex: 0 0 auto;
    min-width: 1.5rem;
    color: var(--brand-text);
}

.cg-subnum {
    margin-right: 0.35rem;
    color: var(--cg-muted);
}

@media (min-width: 64rem) {
    .cg-article {
        position: relative;
    }

    .cg-article h2 .cg-num {
        position: absolute;
        left: -3.5rem;
        width: 2.5rem;
        min-width: 0;
        text-align: right;
    }
}

/* Wer ueber Sommaire oder Bon springt, sieht kurz, wo er gelandet ist. */
@keyframes cg-arrive {
    0%, 55% {
        color: var(--white);
        background-color: var(--brand);
        box-shadow: 0 0 0 0.3rem var(--brand);
    }
}

.cg-article:target .cg-num,
.cg-article h3:target .cg-subnum {
    animation: cg-arrive 1.8s ease-out;
}

.cg-article p,
.cg-article li {
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--text-gray);
}

.cg-article ul,
.cg-article ol {
    padding-left: 1.3rem;
}

.cg-article li {
    padding-left: 0.3rem;
}

.cg-article li + li {
    margin-top: 0.3rem;
}

.cg-article li::marker {
    color: var(--cg-muted);
}

/* 4.1 ist eine echte Reihenfolge. */
.cg-article ol li::marker {
    color: var(--brand-text);
    font-weight: 700;
}

.cg-article a {
    color: var(--white);
    text-decoration-color: var(--brand);
    text-underline-offset: 3px;
}

.cg-article a:hover {
    text-decoration-thickness: 2px;
}

/* Saetze, auf die sich ein Kunde verlassen muss. */
.cg-key {
    padding: 0.1rem 0 0.1rem 1.1rem;
    border-left: 3px solid var(--brand);
}

.cg-article .cg-key,
.cg-article .cg-key p {
    color: var(--white);
}

.cg-key > * + * {
    margin-top: 0.4rem;
}

.cg-article .cg-entity {
    color: var(--white);
    font-weight: 700;
}

.cg-facts {
    border-top: 1px solid var(--border-gray);
}

.cg-facts > div {
    display: grid;
    gap: 0.1rem 1.5rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--border-gray);
}

@media (min-width: 36rem) {
    .cg-facts > div {
        grid-template-columns: 12rem minmax(0, 1fr);
    }
}

.cg-facts dt {
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--cg-muted);
}

.cg-facts dd {
    line-height: 1.5;
    color: var(--white);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.cg-facts a {
    color: var(--white);
    text-decoration-color: var(--brand);
    text-underline-offset: 3px;
}

@media (max-width: 48rem) {
    .cg-wrap {
        padding-inline: 1rem;
        padding-block: 2.25rem 3.5rem;
    }

    .cg-head {
        margin-bottom: 3rem;
    }

    .cg-ticket {
        padding-inline: 1.2rem;
    }
}

/* ------------------------------------------------------------------
   Druck: AGB werden ausgedruckt. Schwarz auf Weiss, ohne Navigation.
   ------------------------------------------------------------------ */
@media print {
    header,
    .skip-link,
    nav.cg-toc-side,
    .cg-toc-mobile,
    .footer-links {
        display: none !important;
    }

    body,
    .cg-ticket {
        background: #fff;
    }

    .page-main {
        margin-top: 0;
    }

    .cg-wrap {
        max-width: none;
        padding: 0;
    }

    .cg-head {
        display: block;
        margin-bottom: 2rem;
    }

    .cg-ticket {
        margin-top: 1.5rem;
        border: 1px dashed #000;
        -webkit-mask: none;
        mask: none;
    }

    .cg-body {
        display: block;
    }

    .cg-title,
    .cg-lede,
    .cg-updated,
    .cg-num,
    .cg-subnum,
    .cg-article h2,
    .cg-article h3,
    .cg-article p,
    .cg-article li,
    .cg-article a,
    .cg-facts dt,
    .cg-facts dd,
    .cg-facts a,
    .footer-bottom {
        color: #000 !important;
    }

    .cg-article h2 .cg-num {
        position: static;
    }

    .cg-article h2,
    .cg-article h3 {
        break-after: avoid;
    }

    footer {
        border: 0;
    }
}
