/* Expo agenda layout (PDF + screen). Keep PDF sizing in mm; screen scales via aspect-ratio. */
.agenda-expo {
  --agenda-ink: #00463c;
  position: relative;
  color: var(--agenda-ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  box-sizing: border-box;
  overflow: hidden;
}

.agenda-expo *,
.agenda-expo *::before,
.agenda-expo *::after {
  box-sizing: border-box;
}

.agenda-expo-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  z-index: 0;
  pointer-events: none;
}

.agenda-expo-columns {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100%;
}

.agenda-expo-day {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.agenda-expo-slot {
  display: grid;
  align-items: start;
}

.agenda-expo-time,
.agenda-expo-title,
.agenda-expo-location,
.agenda-expo-empty,
.agenda-expo-footnote,
.agenda-expo-departure-note {
  margin: 0;
  color: var(--agenda-ink);
}

.agenda-expo-time,
.agenda-expo-title {
  font-weight: 700;
}

.agenda-expo-location,
.agenda-expo-empty,
.agenda-expo-footnote {
  font-weight: 400;
}

.agenda-expo-departure-note {
  font-weight: 400;
  font-style: italic;
}

.agenda-expo-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.agenda-expo-detail-row {
  display: grid;
  align-items: start;
}

.agenda-expo-footnote {
  position: absolute;
  z-index: 1;
}

/* Exact A4 landscape print layout */
.agenda-expo--pdf {
  width: 297mm;
  height: 210mm;
}

.agenda-expo--pdf .agenda-expo-columns {
  column-gap: 10mm;
  /* Clear title + green triangle tip on both columns */
  padding: 88mm 12mm 18mm 11mm;
}

.agenda-expo--pdf .agenda-expo-day {
  gap: 2.8mm;
}

.agenda-expo--pdf .agenda-expo-slot {
  grid-template-columns: 28mm 1fr;
  column-gap: 3mm;
}

.agenda-expo--pdf .agenda-expo-details {
  gap: 1mm;
}

.agenda-expo--pdf .agenda-expo-detail-row {
  grid-template-columns: minmax(0, 1fr) minmax(24mm, 34mm);
  column-gap: 2.5mm;
}

.agenda-expo--pdf .agenda-expo-time {
  font-size: 8.2pt;
  line-height: 1.25;
  white-space: nowrap;
}

.agenda-expo--pdf .agenda-expo-title {
  font-size: 8.2pt;
  line-height: 1.25;
}

.agenda-expo--pdf .agenda-expo-location {
  font-size: 7.8pt;
  line-height: 1.25;
}

.agenda-expo--pdf .agenda-expo-empty {
  font-size: 8.2pt;
  line-height: 1.35;
  opacity: 0.85;
}

.agenda-expo--pdf .agenda-expo-departure-note {
  margin-top: 3mm;
  font-size: 6.4pt;
  line-height: 1.35;
}

.agenda-expo--pdf .agenda-expo-footnote {
  left: 52%;
  right: 12mm;
  bottom: 7mm;
  font-size: 6.2pt;
  line-height: 1.35;
}

/* Browser / admin preview */
.agenda-expo--screen {
  width: 100%;
  max-width: 1100px;
  aspect-ratio: 297 / 210;
  margin-inline: auto;
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

.agenda-expo--screen .agenda-expo-columns {
  column-gap: 3.2%;
  padding: 32% 3.8% 6% 3.6%;
}

.agenda-expo--screen .agenda-expo-day {
  gap: 0.55rem;
}

.agenda-expo--screen .agenda-expo-slot {
  grid-template-columns: 5.8rem 1fr;
  column-gap: 0.55rem;
}

.agenda-expo--screen .agenda-expo-details {
  gap: 0.2rem;
}

.agenda-expo--screen .agenda-expo-detail-row {
  grid-template-columns: minmax(0, 1fr) minmax(5.5rem, 7.5rem);
  column-gap: 0.45rem;
}

.agenda-expo--screen .agenda-expo-time,
.agenda-expo--screen .agenda-expo-title {
  font-size: clamp(0.62rem, 1.05vw, 0.82rem);
  line-height: 1.25;
}

.agenda-expo--screen .agenda-expo-time {
  white-space: nowrap;
}

.agenda-expo--screen .agenda-expo-location,
.agenda-expo--screen .agenda-expo-empty {
  font-size: clamp(0.58rem, 0.95vw, 0.76rem);
  line-height: 1.25;
}

.agenda-expo--screen .agenda-expo-departure-note {
  margin-top: 0.55rem;
  font-size: clamp(0.48rem, 0.8vw, 0.64rem);
  line-height: 1.35;
}

.agenda-expo--screen .agenda-expo-footnote {
  left: 52%;
  right: 3.8%;
  bottom: 2.4%;
  font-size: clamp(0.45rem, 0.75vw, 0.62rem);
  line-height: 1.35;
}

/* Mobile / narrow: single column (Tag unter Tag). Breakpoint also asserted in test/assets/agenda_expo_css_test.rb */
@media (max-width: 768px) {
  .agenda-expo--screen {
    aspect-ratio: auto;
    overflow: visible;
    max-width: 100%;
    background-color: #e8f0ea;
  }

  .agenda-expo--screen .agenda-expo-bg {
    display: none;
  }

  .agenda-expo--screen .agenda-expo-columns {
    grid-template-columns: 1fr;
    height: auto;
    row-gap: 1.5rem;
    padding: 1rem 1rem 1.25rem;
  }

  .agenda-expo--screen .agenda-expo-day + .agenda-expo-day {
    border-top: 1px solid rgba(0, 70, 60, 0.18);
    padding-top: 1.5rem;
  }

  .agenda-expo--screen .agenda-expo-slot {
    grid-template-columns: minmax(4.25rem, 5rem) minmax(0, 1fr);
    column-gap: 0.5rem;
  }

  .agenda-expo--screen .agenda-expo-detail-row {
    grid-template-columns: 1fr;
    row-gap: 0.15rem;
  }

  .agenda-expo--screen .agenda-expo-time,
  .agenda-expo--screen .agenda-expo-title {
    font-size: 0.8125rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  .agenda-expo--screen .agenda-expo-location,
  .agenda-expo--screen .agenda-expo-empty {
    font-size: 0.75rem;
    line-height: 1.35;
  }

  .agenda-expo--screen .agenda-expo-departure-note {
    font-size: 0.6875rem;
  }

  .agenda-expo--screen .agenda-expo-footnote {
    position: static;
    margin-top: 1rem;
    padding: 0;
    font-size: 0.6875rem;
  }
}

/* In-app mobile layout (mobile_variant) may use a wide viewport; force stack via modifier. */
.agenda-expo--screen.agenda-expo--stack {
  aspect-ratio: auto;
  overflow: visible;
  max-width: 100%;
  background-color: #e8f0ea;
}

.agenda-expo--screen.agenda-expo--stack .agenda-expo-bg {
  display: none;
}

.agenda-expo--screen.agenda-expo--stack .agenda-expo-columns {
  grid-template-columns: 1fr;
  height: auto;
  row-gap: 1.5rem;
  padding: 1rem 1rem 1.25rem;
}

.agenda-expo--screen.agenda-expo--stack .agenda-expo-day + .agenda-expo-day {
  border-top: 1px solid rgba(0, 70, 60, 0.18);
  padding-top: 1.5rem;
}

.agenda-expo--screen.agenda-expo--stack .agenda-expo-slot {
  grid-template-columns: minmax(4.25rem, 5rem) minmax(0, 1fr);
  column-gap: 0.5rem;
}

.agenda-expo--screen.agenda-expo--stack .agenda-expo-detail-row {
  grid-template-columns: 1fr;
  row-gap: 0.15rem;
}

.agenda-expo--screen.agenda-expo--stack .agenda-expo-time,
.agenda-expo--screen.agenda-expo--stack .agenda-expo-title {
  font-size: 0.8125rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.agenda-expo--screen.agenda-expo--stack .agenda-expo-location,
.agenda-expo--screen.agenda-expo--stack .agenda-expo-empty {
  font-size: 0.75rem;
  line-height: 1.35;
}

.agenda-expo--screen.agenda-expo--stack .agenda-expo-departure-note {
  font-size: 0.6875rem;
}

.agenda-expo--screen.agenda-expo--stack .agenda-expo-footnote {
  position: static;
  margin-top: 1rem;
  padding: 0;
  font-size: 0.6875rem;
}

@media print {
  @page {
    size: A4 landscape;
    margin: 0;
  }

  body:has(.print-only > .agenda-expo--pdf) {
    margin: 0 !important;
    padding: 0 !important;
    width: 297mm;
    height: 210mm;
    overflow: hidden !important;
    background: #d6e6d8 !important;
  }

  #flash-messages {
    display: none !important;
  }

  .print-only:has(.agenda-expo--pdf) {
    width: 297mm;
    height: 210mm;
    overflow: hidden;
    page-break-inside: avoid;
  }

  .print-only .agenda-expo--pdf .agenda-expo-bg {
    object-fit: fill !important;
  }
}
