@font-face {
    font-family: 'Kario39C3Var-Roman';
    src: url('fonts/Kario39C3VarWEB-Roman.woff2') format('woff2'),
            url('fonts/Kario39C3VarWEB-Roman.woff') format('woff'),
            url('fonts/Kario39C3Var-Roman.ttf') format('truetype');
    font-weight: 400 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'OfficerSans';
    src: url('fonts/OfficerSansWeb-Regular.woff2') format('woff2'),
            url('fonts/OfficerSansWeb-Regular.woff') format('woff'),
            url('fonts/OfficerSansOT-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'OfficerSans';
    src: url('fonts/OfficerSansWeb-RegularItalic.woff2') format('woff2'),
            url('fonts/OfficerSansWeb-RegularItalic.woff') format('woff'),
            url('fonts/OfficerSansOT-RegularItalic.otf') format('opentype');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'OfficerSans';
    src: url('fonts/OfficerSansWeb-Bold.woff2') format('woff2'),
            url('fonts/OfficerSansWeb-Bold.woff') format('woff'),
            url('fonts/OfficerSansOT-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'OfficerSans';
    src: url('fonts/OfficerSansWeb-BoldItalic.woff2') format('woff2'),
            url('fonts/OfficerSansWeb-BoldItalic.woff') format('woff'),
            url('fonts/OfficerSansOT-BoldItalic.otf') format('opentype');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

@page {
  size: portrait;
  width: 914.4mm; /* DIN A0+ with margins */
  height: auto;
  margin: 10mm; /* adjust as needed */
}

@media print {
  html, body {
    width: 914.4mm; /* DIN A0+ with margins */
    height: auto;
    overflow: visible;
  }
  /* ensure content scales and avoids page breaks */
  body { box-sizing: border-box; margin: 0; }
  .no-break { page-break-inside: avoid; }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --accent-color: #ff3719;
}

body {
    font-family: 'OfficerSans', "Segoe UI", Arial, sans-serif;
    background-color: white;
    padding: 40px;
    width: 914.4mm;
    margin: 0;
    overflow: visible;
}

noscript {
    display: block;
    color: var(--accent-color);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 24px;
}

.schedule-container {
    width: 100%;
    height: auto;
    margin: 0;
    background-color: white;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 36px;
}

.header-left {
    font-weight: normal;
}

.header-right {
    font-size: 36px;
    font-weight: bold;
    color: #000;
}

.c3-logo {
    display: inline-block;
    font-family: 'Kario39C3Var-Roman', 'KarioDuplexVar', "Segoe UI", Arial, sans-serif;
    font-weight: 700;
    font-kerning: none;
    color: var(--accent-color);
}

.title-section {
    display: flex;
    gap: 60px;
    margin-bottom: 30px;
    font-size: 36px;
    align-items: center;
}

.title-label {
    display: flex;
    gap: 10px;
    align-items: baseline;
    font-size: 36px;
}

.title-label-bold {
    font-weight: bold;
}

.title-label-italic {
    font-style: italic;
    font-weight: normal;
}

.station-name {
    font-weight: bold;
    font-size: 36px;
}

.column-headers {
    display: grid;
    grid-template-columns: 56px 72px 1.4fr 36px;
    gap: 2px;
    padding: 7px 3px 6px 3px;
    background-color: #d0d0d0;
    border-bottom: none;
    font-weight: bold;
    font-size: 12px;
    margin-bottom: 1px;
}

.column-headers-wrapper {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    column-gap: 12px;
    row-gap: 0;
    width: 100%;
    margin-bottom: 1px;
}

.column-headers .col-platform {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.column-header-bold {
    font-weight: bold;
}

.column-header-italic {
    font-style: italic;
    font-weight: normal;
}

.time-range {
    display: grid;
    grid-template-columns: 56px 72px 1fr 50px;
    gap: 2px;
    padding: 0 3px;
    background-color: #000;
    color: white;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: -0.5px;
    margin-top: 0;
    margin-bottom: 0;
    break-inside: avoid;
}

.time-range-group {
    -webkit-column-break-inside: avoid;
    -moz-column-break-inside: avoid;
    column-break-inside: avoid;
    break-inside: avoid;
}

.legend-title {
    break-inside: avoid;
    font-size: 16px;
}

.legend-section {
    break-inside: avoid;
    font-size: 14px;
    padding: 0.3em 0.7em;
}

.legend-table {
    border-collapse: collapse;
    margin-top: 0.5em;
    margin-left: 0.3em;
}

.legend-table td {
    padding: 2px 8px 2px 0;
    vertical-align: middle;
}

.legend-table td:first-child {
    font-weight: bold;
    padding-right: 12px;
}

.legend-group:first-of-type .legend-table td:first-child {
    color: var(--accent-color);
}

.legend-footer {
    line-height: 1.4;
}

.legend-footer a,
.legend-footer a:visited {
    color: black;
    text-decoration: none;
}

.qr-code-placeholder {
    width: 80px;
    height: 80px;

    background-color: #f5f5f5;
    float: right;
    margin-left: 12px;
}

.departure-table {
    display: block;
    column-count: 8;
    -moz-column-count: 8;
    -webkit-column-count: 8;
    column-gap: 12px;
    -moz-column-gap: 12px;
    -webkit-column-gap: 12px;
    column-fill: balance; /* Firefox ignores auto; balance is default */
}

.no-data {
    padding: 16px;
    font-size: 16px;
    font-style: italic;
    color: #333;
}

.loading {
    padding: 16px;
    font-size: 16px;
    color: #333;
}

.departure-row {
    display: grid;
    grid-template-columns: 56px 72px 1.4fr 36px;
    column-gap: 2px;
    padding: 0;
    background-color: white;
    border-bottom: 1px solid #000;
    align-items: start;
    break-inside: avoid;
    -moz-column-break-inside: avoid;
    -webkit-column-break-inside: avoid;
}

.time {
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    background: #e8e8e8;
    padding: 2px 3px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
    height: 100%;
}

.trains,
.route,
.row-number {
    padding: 2px 3px;
}

.trains {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.no-video-icon {
    font-size: 12px;
    line-height: 1.2;
}

.train-number {
    font-size: 14px;
    font-weight: bold;
    line-height: 1.2;
}

.train-prefix {
    font-weight: 900;
}

.train-num {
    font-weight: 600;
}

.train-num-long {
    font-weight: 400;
}

.train-number-red {
    color: var(--accent-color);
}

.bike-icon {
    font-size: 12px;
    line-height: 1.2;
}

.route-segment {
    display: block;
}

.station {
    font-weight: normal;
    font-size: 12px;
}

.room-name {
    font-weight: normal;
    font-size: 10px;
    display: block;
}

.station-time {
    font-weight: normal;
    font-size: 12px;
}

.destination {
    font-weight: bold;
    font-size: 16px;
    display: block;
}

.circle {
    display: inline;
    font-weight: normal;
}

/* Lucide icons sizing */
[data-lucide] {
    width: 1em;
    height: 1em;
    stroke-width: 2px;
    vertical-align: baseline;
}

.destination [data-lucide] {
    width: 0.8em;
    height: 0.8em;
    stroke-width: 3px;
    vertical-align: baseline;
}

.row-number {
    font-size: 14px;
    font-weight: bold;
    text-align: right;
    line-height: 1;
}