/* ── Tourenblatt: Druckansicht (?print=1) und PDF (?pdf=1) einer Tour ──
   A4 hoch, Ziel: eine Seite. Text, Karte und Höhenprofil haben Vorrang; Fotos der Tour
   werden nicht gedruckt. Auf dem Bildschirm liegt das Blatt als weiße A4-Karte auf
   grauem Grund, im Druck füllt es die Seite (Seitenränder über @page). Das Skript in
   tour-print.html.twig verkleinert den Beschreibungstext stufenweise (bis 7 pt), bis
   das Blatt auf eine Seite passt. */

:root {
    --p-ink: #2b2a27;
    --p-muted: #6b665d;
    --p-line: #d9d2c5;
    --p-paper: #f5f1e8;
    --p-accent: #2c5b5d;
    --p-warm: #b9683f;
    --p-ff-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --p-ff-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

@page {
    size: A4 portrait;
    margin: 10mm 12mm 9mm;
}

* {
    box-sizing: border-box;
}

html {
    background: #d9d5cd;
}

body.print-body {
    margin: 0;
    font-family: var(--p-ff-body);
    color: var(--p-ink);
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

/* Werkzeugleiste nur am Bildschirm */
.print-toolbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: #1e1f1d;
    color: #fffaf2;
    font-size: 0.9rem;
}

.print-toolbar__button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border: 2px solid var(--p-warm);
    border-radius: 6px;
    background: var(--p-warm);
    color: #fffaf2;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.print-toolbar__button--ghost {
    background: transparent;
    border-color: rgba(255, 250, 242, 0.5);
}

.print-toolbar__button:hover,
.print-toolbar__button:focus-visible {
    filter: brightness(1.12);
}

.print-toolbar__hint {
    margin-left: auto;
    opacity: 0.75;
}

/* Das Blatt */
.sheet {
    position: relative;
    width: 210mm;
    min-height: 297mm;
    margin: 1.2rem auto 2.5rem;
    padding: 10mm 12mm 9mm;
    background: #fff;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
    font-size: 9.5pt;
    line-height: 1.38;
    /* Lange Links und Wörter (Bildnachweise, Adressen) brechen um, statt aus der Spalte zu laufen */
    overflow-wrap: anywhere;
}

/* Unsichtbarer Maßstab: 297 mm in Bildschirm-Pixeln für das Einpassen per Skript */
.sheet-ruler {
    position: absolute;
    left: -9999px;
    top: 0;
    width: 1px;
    height: 297mm;
}

.sheet__head {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1mm 6mm;
    align-items: start;
    padding-bottom: 3mm;
    margin-bottom: 3.5mm;
    border-bottom: 1.2pt solid var(--p-ink);
}

.sheet__brand {
    grid-column: 2;
    grid-row: 1 / span 2;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    font-size: 7pt;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--p-muted);
    white-space: nowrap;
}

.sheet__brand-title {
    font-family: var(--p-ff-display);
    font-size: 12.5pt;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--p-ink);
    line-height: 1.1;
}

.sheet__brand-kind {
    margin-top: 1.2mm;
    padding: 0.5mm 1.6mm;
    border-radius: 1mm;
    background: var(--p-accent);
    color: #fffaf2;
}

.sheet__eyebrow {
    grid-column: 1;
    margin: 0;
    font-size: 7.5pt;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--p-accent);
}

.sheet__title {
    grid-column: 1;
    margin: 0.5mm 0 0;
    font-family: var(--p-ff-display);
    font-weight: 600;
    font-size: 21pt;
    line-height: 1.08;
    letter-spacing: -0.01em;
}

.sheet__lead {
    grid-column: 1 / -1;
    margin: 1.5mm 0 0;
    font-size: 9.5pt;
    color: var(--p-muted);
}

/* Kenndaten als Kachelreihe */
.sheet__facts {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 2mm;
    margin: 0 0 3.5mm;
    padding: 0;
}

.sheet__facts > div {
    margin: 0;
    padding: 1.4mm 2mm 1.3mm;
    border-radius: 1.6mm;
    background: var(--p-paper);
    min-width: 0;
}

.sheet__facts dt {
    margin: 0 0 0.6mm;
    font-size: 6.6pt;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--p-muted);
    line-height: 1.15;
}

.sheet__facts dd {
    margin: 0;
    font-size: 9.5pt;
    font-weight: 700;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.sheet__facts dd small {
    display: block;
    margin-top: 0.4mm;
    font-size: 7pt;
    font-weight: 400;
    color: var(--p-muted);
}

.sheet__equipment {
    margin: -1.5mm 0 3mm;
    font-size: 7.5pt;
    color: var(--p-muted);
}

.sheet__equipment strong {
    color: var(--p-ink);
}

/* Karte und Höhenprofil */
.sheet__map,
.sheet__profile {
    margin: 0 0 3mm;
    break-inside: avoid;
}

.sheet__map img {
    display: block;
    width: 100%;
    aspect-ratio: 2 / 1;
    object-fit: cover;
    border: 0.4pt solid var(--p-line);
    border-radius: 1.6mm;
    background: var(--p-paper);
}

.sheet__profile svg {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 1.6mm;
}

.sheet figcaption {
    display: flex;
    justify-content: space-between;
    gap: 3mm;
    margin-top: 1mm;
    font-size: 6.8pt;
    color: var(--p-muted);
}

/* Beschreibung in zwei Spalten; Schriftgröße und ggf. drei Spalten setzt das Skript (Einpassen) */
.sheet__text {
    column-count: 2;
    column-gap: 6mm;
    column-rule: 0.4pt solid var(--p-line);
    orphans: 3;
    widows: 3;
    hyphens: auto;
}

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

.sheet__text h2,
.sheet__text h3,
.sheet__text h4 {
    margin: 1.1em 0 0.3em;
    font-family: var(--p-ff-display);
    font-weight: 600;
    font-size: 1.22em;
    line-height: 1.15;
    break-after: avoid;
}

.sheet__text p,
.sheet__text ul,
.sheet__text ol {
    margin: 0 0 0.65em;
}

.sheet__text ul,
.sheet__text ol {
    padding-left: 1.2em;
}

.sheet__text a {
    color: inherit;
    text-decoration: none;
}

.sheet__text img,
.sheet__text figure,
.sheet__text iframe,
.sheet__text video,
.sheet__text .image-credit {
    display: none;
}

.sheet__text table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.sheet__text td,
.sheet__text th {
    padding: 0.2em 0.4em;
    border-bottom: 0.4pt solid var(--p-line);
    text-align: left;
    vertical-align: top;
}

.sheet__foot {
    display: flex;
    flex-wrap: wrap;
    gap: 1mm 5mm;
    margin-top: 3.5mm;
    padding-top: 2mm;
    border-top: 0.6pt solid var(--p-line);
    font-size: 6.8pt;
    color: var(--p-muted);
}

.sheet__foot-note {
    flex-basis: 100%;
}

@media (max-width: 230mm) {
    .sheet {
        width: auto;
        min-height: 0;
        margin: 0;
        box-shadow: none;
    }
}

@media print {
    html {
        background: #fff;
    }

    .print-toolbar,
    .sheet-ruler {
        display: none;
    }

    .sheet {
        width: auto;
        min-height: 0;
        margin: 0;
        padding: 0;
        box-shadow: none;
    }

    .sheet__text {
        break-inside: auto;
    }
}
