/* U4 Marsch – printable route sheet (A4 portrait) */

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

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font: 10.5pt/1.4 Arial, Helvetica, sans-serif;
    color: #1f2937;
    background: #e5e7eb;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

/* --- toolbar (screen only) --- */
.sheet-toolbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    padding: 0.6rem 1rem;
    background: #1f2937;
    color: #fff;
    font-size: 14px;
}
.sheet-toolbar a {
    color: #fff;
}
.sheet-toolbar label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
}
.sheet-toolbar input[type="time"] {
    padding: 2px 4px;
    font-size: 14px;
}
.sheet-toolbar button {
    padding: 0.4rem 0.9rem;
    border: 1px solid #9ca3af;
    border-radius: 4px;
    background: #fff;
    color: #1f2937;
    font-size: 14px;
    cursor: pointer;
}
.sheet-toolbar button.primary {
    background: #007a33;
    border-color: #007a33;
    color: #fff;
    font-weight: 700;
}
.sheet-toolbar button:focus-visible,
.sheet-toolbar input:focus-visible {
    outline: 3px solid #f0b400;
    outline-offset: 2px;
}
.sheet-toolbar-note {
    flex-basis: 100%;
    margin: 0;
    font-size: 12px;
    color: #d1d5db;
}

/* --- the sheet --- */
.sheet {
    width: 210mm;
    max-width: 100%;
    margin: 1rem auto;
    padding: 12mm;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

h1, h2, h3 {
    margin: 0;
    line-height: 1.2;
}
h2 {
    font-size: 12pt;
    margin: 0 0 2mm;
    padding-bottom: 1mm;
    border-bottom: 1.5px solid #007a33;
    color: #005a27;
}
section {
    margin-top: 5mm;
}

.sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 6mm;
    padding-bottom: 3mm;
    border-bottom: 3px solid #007a33;
}
.sheet-brand {
    font-size: 9pt;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #007a33;
}
.sheet-header h1 {
    font-size: 19pt;
    margin: 1mm 0;
}
.sheet-sub {
    color: #4b5563;
    font-size: 10pt;
}
.sheet-qr {
    flex: 0 0 24mm;
    width: 24mm;
    height: 24mm;
}
.sheet-qr svg,
.sheet-qr img {
    width: 100%;
    height: 100%;
}

.sheet-figures {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2mm;
    margin-top: 4mm;
}
.sheet-figures div {
    padding: 2mm 3mm;
    background: #f3f4f6;
    border-radius: 2mm;
}
.sheet-figures span {
    display: block;
    font-size: 8pt;
    color: #6b7280;
}
.sheet-figures strong {
    font-size: 13pt;
}

.sheet-notices {
    padding: 2mm 4mm;
    background: #fff7e6;
    border: 1px solid #f0b400;
    border-left-width: 4px;
}
.sheet-notices ul {
    margin: 1mm 0 0;
    padding-left: 5mm;
}

.sheet-map .sheet-map-svg,
.sheet-profile .sheet-profile-svg {
    display: block;
    width: 100%;
    height: auto;
}
.sheet-map {
    border: 1px solid #d1d5db;
}
#sheet-map-tiles {
    height: 120mm;
}
#sheet-map-tiles[hidden] {
    display: none;
}
.sheet-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1mm 5mm;
    padding: 1.5mm 3mm;
    font-size: 8.5pt;
    border-top: 1px solid #e5e7eb;
}
.sheet-legend span {
    display: inline-flex;
    align-items: center;
    gap: 1.5mm;
}
.sheet-legend i {
    display: inline-block;
    width: 8mm;
    height: 1.6mm;
    border-radius: 1mm;
    border: 0.4mm solid #374151;
}
.sheet-legend b {
    display: inline-block;
    width: 4mm;
    height: 4mm;
    line-height: 4mm;
    text-align: center;
    color: #fff;
    font-size: 7pt;
}
.poi-u {
    background: #0a5aa5;
}
.poi-h {
    background: #007a33;
    border-radius: 50%;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 9pt;
}
th, td {
    padding: 1.2mm 1.5mm;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}
th {
    font-size: 8pt;
    color: #4b5563;
    border-bottom: 1.5px solid #9ca3af;
}
.num {
    text-align: right;
    white-space: nowrap;
}
.check {
    width: 7mm;
    text-align: center;
}
.box {
    display: inline-block;
    width: 3.5mm;
    height: 3.5mm;
    border: 1px solid #4b5563;
}
tr {
    page-break-inside: avoid;
    break-inside: avoid;
}
i.seg {
    display: inline-block;
    width: 3mm;
    height: 3mm;
    margin-right: 1.5mm;
    border-radius: 50%;
    border: 0.3mm solid #374151;
    vertical-align: -0.3mm;
}
.sheet-hint {
    margin: 1mm 0 0;
    font-size: 8pt;
    color: #6b7280;
}

/* route description; text and photos can be switched off in the toolbar */
.sheet-description {
    display: none;
}
body.show-text .sheet-description {
    display: block;
}
.sheet-photo {
    display: none;
}
body.show-photos .sheet-photo {
    display: block;
    float: right;
    width: 38mm;
    height: 26mm;
    object-fit: cover;
    margin: 0 0 1mm 3mm;
    border-radius: 1mm;
}
.sheet-desc-segment {
    margin-bottom: 3mm;
}
.sheet-desc-segment h3 {
    font-size: 10.5pt;
    margin: 2mm 0 1mm;
}
.sheet-desc-segment ol {
    margin: 0;
    padding-left: 5mm;
    font-size: 9pt;
}
.sheet-desc-segment li {
    margin-bottom: 1.5mm;
    overflow: hidden;
    break-inside: avoid;
}
.sheet-desc-segment li p {
    margin: 0 0 1mm;
}

.sheet-bottom {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 6mm;
    break-inside: avoid;
}
.sheet-bottom p {
    margin: 0 0 2mm;
}
.line {
    display: inline-block;
    width: 55mm;
    border-bottom: 1px solid #4b5563;
}
.line.short {
    width: 16mm;
}
.record {
    font-weight: 700;
    color: #005a27;
}
.small {
    font-size: 8pt;
    color: #6b7280;
}

/* --- print --- */
@media print {
    body {
        background: #fff;
    }
    .sheet-toolbar {
        display: none;
    }
    .sheet {
        width: auto;
        margin: 0;
        padding: 0;
        box-shadow: none;
    }
    .sheet-map,
    .sheet-profile,
    .sheet-figures,
    .sheet-header {
        break-inside: avoid;
    }
    .sheet-table,
    .sheet-description {
        break-before: auto;
    }
    a {
        color: inherit;
        text-decoration: none;
    }
}

/* --- small screens (preview on a phone) --- */
@media screen and (max-width: 700px) {
    .sheet {
        padding: 4mm;
        margin: 0;
    }
    .sheet-figures {
        grid-template-columns: repeat(2, 1fr);
    }
    .sheet-bottom {
        grid-template-columns: 1fr;
    }
    .sheet-table {
        overflow-x: auto;
    }
}

/* keep headings with their content; limit the map height so a single segment fits on one page */
h2 {
    break-after: avoid;
    page-break-after: avoid;
}
.sheet-map .sheet-map-svg {
    max-height: 125mm;
}
body.single .sheet-map .sheet-map-svg {
    max-height: 85mm;
}
body.single .sheet-profile .sheet-profile-svg {
    max-height: 42mm;
}

/* compact bottom block */
.sheet-bottom {
    font-size: 9pt;
    margin-top: 4mm;
}
.sheet-bottom h2 {
    font-size: 10.5pt;
}
.sheet-bottom p {
    margin: 0 0 1.2mm;
}
body.single .sheet-map .sheet-map-svg {
    max-height: 80mm;
}
