@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: auto;
  margin: 0;
}

@media print {
  /* Gesamte bedruckbare Breite nutzen (A0/A1 je nach Dialog), nicht --page-width,
   * damit weniger Spalten die volle Papierbreite ausfuellen. */
  html {
    width: 100% !important;
    min-height: auto;
    height: auto;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible;
  }
  body {
    box-sizing: border-box;
    min-height: auto;
    height: auto;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible;
    width: 100% !important;
    max-width: none !important;
  }
  body.mobile-columns {
    padding: 0 !important;
  }
  .no-break { page-break-inside: avoid; }
  
  /* Force background colors and images to print */
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color-adjust: exact;
  }

  /*
   * Im PDF/Druck sollen Unterstreichungen komplett weg.
   * Firefox kann Links im Print-Rendering sonst trotzdem optisch unterstreichen,
   * daher global fuer alle Text-Decorations.
   */
  * {
    text-decoration: none !important;
    text-decoration-line: none !important;
    border-bottom: 0 !important;
    outline: none !important;
  }

  /* Firefox-spezifisch: Hyperlink-Dekorationen fuer Print abstellen. */
  a,
  a:visited,
  a:hover,
  a:active {
    -moz-hyperlink-decoration: none !important;
  }
}

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

:root {
    --accent-color: #EE7F00; /* FOSSGIS Volltonfarbe HKS 6 K, R/G/B: 238/127/0 */
    --tinted-background-color: rgb(252, 209, 22); /* FOSSGIS-Hintergrund */
    --column-headers-bg-color: #d0d0d0cc;
    --cell-padding: 2px 3px;
    --columns: 4;
    --page-width: 841mm;
    --grid-cols-header: 56px 85px 1.4fr 50px;
    --grid-cols-content: 56px 85px 1.4fr 50px;
}

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

body.mobile-columns {
    width: 100vw;
    padding: 16px;
}

body.tinted-background {
    background-color: var(--tinted-background-color);
}

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

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

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

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

.fg26-logo {
    height: 2.5em;
    min-height: 2.5em;
    width: 340px;
    max-width: 340px;
    display: block;
    margin-top: 0mm;
    background-image: url('assets/FOSSGIS_Logo_RGB-238-127-0.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: right center;
}

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

.title-section {
    display: flex;
    justify-content: space-between;
    gap: 0;
    margin-bottom: 30px;
    font-size: 36px;
    align-items: flex-end;
    width: 100%;
}

.title-left {
    display: flex;
    gap: 60px;
    align-items: flex-end;
}

.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;
}

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

.station-name a:hover {
    text-decoration: underline;
}

.column-headers {
    display: grid;
    grid-template-columns: var(--grid-cols-header);
    column-gap: 6px;
    padding: 7px 0 6px 0;
    background-color: var(--column-headers-bg-color);
    font-size: 12px;
    margin-bottom: 1px;
}

.column-headers > div {
    padding-left: 3px;
    padding-right: 3px;
}

.column-headers-wrapper {
    display: grid;
    grid-template-columns: repeat(var(--columns), 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: var(--grid-cols-header);
    gap: 6px;
    padding: 0 3px;
    background-color: #000;
    color: var(--column-headers-bg-color);
    font-size: 16px;
    font-weight: bold;
    letter-spacing: -0.5px;
    margin-top: 0;
    margin-bottom: 0;
    break-inside: avoid;
}

.time-range a {
    color: var(--column-headers-bg-color);
    text-decoration: none;
}

.time-range a:hover {
    text-decoration: underline;
}

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

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

.legend-wrapper {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    -moz-column-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 th {
    padding: 2px 8px 2px 0;
    font-weight: 600;
    text-align: left;
    vertical-align: middle;
}

.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-table a {
    color: inherit;
    text-decoration: none;
}

.legend-table a:hover {
    text-decoration: underline;
}

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

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

.qr-codes-row {
    display: grid;
    /* Versetzte Anordnung: qr1/qr2 oben, qr3/qr4 unten versetzt */
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: auto auto;
    justify-items: center;
    align-items: start;
    column-gap: 2.5em;
    row-gap: 3em;
    width: 100%;
}

.qr-codes-row > div {
    justify-self: center;
}

.qr-codes-row > div:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
}

.qr-codes-row > div:nth-child(2) {
    grid-column: 3;
    grid-row: 1;
}

.qr-codes-row > div:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
}

.qr-codes-row > div:nth-child(4) {
    grid-column: 4;
    grid-row: 2;
}

.room-plans-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1em;
    margin-top: 0.5em;
}

.room-plans-row > div {
    flex: 0 0 auto;
}

.room-plan-svg {
    display: block;
    height: 700px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    background: transparent;
}

.qr-code-placeholder {
    width: 180px;
    height: 180px;
    background-color: transparent;
    display: block;
}

.legend-footer .qr-code-placeholder {
    float: none;
    margin-left: 0;
}

.departure-table {
    display: block;
    border-bottom: 1px solid #000;
}

.departure-table-content {
    column-count: var(--columns);
    -moz-column-count: var(--columns);
    -webkit-column-count: var(--columns);
    column-gap: 12px;
    -moz-column-gap: 12px;
    -webkit-column-gap: 12px;
    column-fill: balance; /* Firefox ignores auto; balance is default */
}

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

.no-data {
    font-style: italic;
}

.departure-row.break-row {
    /* Die Hervorhebung soll nur in der ersten Zelle (Zeit) passieren. */
    border-left: 0;
}

.departure-row.break-row .time {
    /* Dezente Schraffur, nur links in der Zeit-Zelle. */
    background-color: rgba(0, 0, 0, 0.035);
    background-image: repeating-linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.14) 0px,
        rgba(0, 0, 0, 0.14) 2px,
        rgba(0, 0, 0, 0) 2px,
        rgba(0, 0, 0, 0) 6px
    );
    border-left: 3px solid rgba(0, 0, 0, 0.35);
}

.departure-row.break-row .destination {
    font-style: italic;
    color: #666;
}

.departure-row {
    display: grid;
    grid-template-columns: var(--grid-cols-content);
    column-gap: 6px;
    padding: 0;
    border-bottom: 1px solid #000;
    align-items: stretch;
    break-inside: avoid;
    -moz-column-break-inside: avoid;
    -webkit-column-break-inside: avoid;
}

.time {
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    background: var(--column-headers-bg-color);
    padding: var(--cell-padding);
}

.trains,
.route,
.row-number {
    padding: var(--cell-padding);
}

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

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

a.no-video-icon {
    color: inherit;
    text-decoration: none;
}

a.no-video-icon:hover {
    opacity: 0.8;
}

.train-number {
    font-size: 16px;
    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: 14px;
}

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

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

.destination {
    font-weight: bold;
    font-size: 18px;
    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: 16px;
    font-weight: bold;
    text-align: right;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    flex-wrap: nowrap;
}

.row-number [data-lucide] {
    width: 0.9em;
    height: 0.9em;
    stroke-width: 2px;
    flex-shrink: 0;
}