/* This file is part of Indico.
 * Copyright (C) 2002 - 2026 CERN
 *
 * Indico is free software; you can redistribute it and/or
 * modify it under the terms of the MIT License; see the
 * LICENSE file for more details.
 */

:root {
  --primary-color: #09c;
  --primary-color-trans: #09c5;
}

* {
  font-family: 'Lato', sans-serif;
}

body {
  font-size: 0.8em;
}

.pagebreak {
  break-before: always;
}

.cover .logo {
  max-width: 80%;
  max-height: 300px;
  padding: 5px;
}

.cover h1 > i {
  margin-top: 20px;
  display: block;
}

.cover h4.location {
  margin-bottom: 4px;
}

.cover .address {
  display: block;
}

.cover > div.cover-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  /* height of the div must be: 197mm (A4 height) minus 25mm added by WeasyPrint by default */
  height: 272mm;
  width: 100%;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  border: 5px solid var(--primary-color);
  border-radius: 5px;
}

.cover > div.cover-wrapper > div {
  text-align: center;
  width: 100%;
  box-sizing: border-box;
  padding: 20px;
}

/* TOC */

.toc {
  page: toc;
}

.toc > div {
  margin-bottom: 5px;
}

.toc h1 {
  text-align: center;
}

.toc .toc-sessions > .toc-item:not(:last-child) {
  border-bottom: 2px solid var(--primary-color-trans);
}

.toc .toc-sessions .toc-item a {
  display: block;
  padding: 5px 0;
}

.toc .toc-sessions .toc-item a::after {
  margin-left: 3px;
  margin-right: 10px;
  text-align: center;
  content: leader(' ') target-counter(attr(href), program-page, decimal);
  margin-bottom: 5px;
  border-radius: 2px;
  font-weight: bold;
}

.toc-item-main {
  font-size: 1.2em;
  display: flex;
  font-weight: bold;
}

.toc-item-main a::before {
  display: inline-block;
  font-size: 1em;
  padding: 0.6em 0;
  text-align: center;
  width: 2.4em;
  border-radius: 3px;
  margin-right: 15px;
  content: target-counter(attr(href), program-page, decimal);
  background-color: var(--primary-color);
  color: white;
}

.toc .toc-item a {
  text-decoration: none;
  color: black;
}

/* Numbering */

#footer {
  position: running(footer);
}

#footer::after {
  content: target-counter('#footer', program-page, decimal);
}

/* Main content */
.session-block.contribution :is(.inherited-bg-color, .inherited-bg-color-trans) {
  background-color: var(--primary-color-trans);
}

.session-block.contribution .inherited-txt-color {
  color: black;
}

.session-block.contribution .inherited-border-color {
  border-color: rgb(146, 182, 219);
}

.session-block-wrapper {
  flex-grow: 0;
  flex-shrink: 1;
  width: 100%;
}

.session-block-title {
  break-inside: avoid;
  margin: 0;
  padding: 10px;
  border-radius: 5px;
  flex-grow: 1;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.session-block-title.only-round-top {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.session-block-title > h3 {
  margin: 0 0 2px 0;
}

.session-block-title-info {
  display: flex;
  flex-wrap: wrap;
  line-height: 1.4em;
  font-size: 0.8em;
}

.session-block-title-info > * {
  margin: 0;
  display: block;
  word-wrap: break-word;
}

.session-block-title-info > *:not(:last-child)::after {
  content: '|';
  opacity: 0.5;
  margin: 0 5px;
}

.session-block-title > h2 {
  margin: 0;
}

.session-block-content {
  width: 100%;
}

.day-title {
  margin: 40px 0;
  text-align: center;
}

.contrib-timeline,
.sub-contrib-timeline {
  margin: 0;
  padding: 0;
  flex-direction: column;
  list-style-type: none;
}

.contrib-timeline > li {
  margin: 0;
  padding: 10px;
}

.contrib-timeline > li:not(:last-child) {
  border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.contrib-timeline > li > h4 {
  margin: 0;
  break-after: avoid;
}

.timebox {
  text-align: center;
  padding: 0.4em 0.8em 0.4em 1em;
  font-size: 0.8em;
  border-radius: 100px;
  font-weight: normal;
  margin-right: 10px;
  margin-bottom: 5px;
}

.sub-contrib-timeline .timebox {
  margin-right: 6px;
}

.contrib-timeline > li > .contrib-timeline-content {
  padding: 0 5px;
}

.contrib-timeline > li > .contrib-timeline-content > *:first-child {
  margin-top: 5px;
}

.contrib-timeline > li > .contrib-timeline-content > *:last-child {
  margin-top: 5px;
}

.sub-contrib-timeline .contrib-timeline-content {
  font-size: 1em;
  padding: 0 10px;
}

.sub-contrib-timeline .contrib-timeline-content > *:first-child {
  margin-top: 10px;
}

.sub-contrib-timeline .contrib-timeline-content > *:last-child {
  padding-bottom: 10px;
}

.contrib-timeline-content {
  font-size: 0.8em;
}

.contrib-timeline-content > * {
  margin: 0;
}

.contrib-timeline-content > :is(p, div) b {
  line-height: 2em;
}

:is(.contrib-timeline-content, .sub-contrib-timeline) > :is(p, div):not(:last-child) {
  margin: 0;
  margin-bottom: 10px;
}

.description {
  break-inside: avoid;
}

:is(.contrib-timeline-content, .sub-contrib-timeline) .description > *:last-child {
  margin: 0;
  padding: 1px 10px;
  border-radius: 3px;
  background-color: rgba(0, 0, 0, 0.1);
  word-break: break-all;
}

.sub-contrib-timeline {
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 3px;
  padding: 10px;
}

.sub-contrib-timeline > li > p > b {
  font-style: italic;
}

.sub-contrib-timeline > li {
  padding: 5px;
  background-color: white;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-bottom-width: 3px;
  border-radius: 3px;
  display: block;
  break-inside: avoid;
}

.sub-contrib-timeline > li:not(:last-child) {
  margin-bottom: 5px;
}

.sub-contrib-timeline > li > h4 {
  margin: 0;
  font-size: 1em;
  font-style: normal;
}

.sub-contrib-timeline .contrib-timeline-content > :is(p, div):not(:last-child) {
  margin: 0;
  margin-bottom: 5px;
}

.pagebreak.pagebreak-children > .day-entry:not(:last-of-type) {
  break-after: always;
}

.session-block-date {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0 10px 5px;
  break-after: avoid;
}

.session-block-date > .timebox {
  border: 1px solid rgba(0, 0, 0, 0.1);
  margin: 0;
}

/* Day */

.day-entry > section {
  /* break-inside: avoid; */
  padding-left: 36px;
  border-left: 3px solid rgba(0, 0, 0, 0.1);
  margin-left: 36px;
}

/* .day-wrapper {
  break-inside: avoid;
} */

/* Content box */
.session-block-content-box {
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-top: 0;
}

.session-block-content-box:last-child {
  border-radius: 0 0 3px 3px;
}

.session-block-content-box.description {
  margin-top: 0;
  border-top: 0;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  break-inside: avoid;
}

.session-block-content-box.description li > * {
  margin: 0;
  break-inside: avoid;
}

.session-block-content-box.description li > *:last-child {
  font-size: 0.8em;
  line-height: 1.5em;
  margin: 5px 0 0 0;
  opacity: 0.8;
}

/* Time */

.day-entry {
  position: relative;
  display: block;
  margin-bottom: 10px;
}

.time-text {
  color: rgba(0, 0, 0, 0.5);
  width: 75px;
  text-align: center;
  line-height: 1.4em;
  font-size: 1em;
  background-color: white;
}

.time-from {
  position: absolute;
  top: 0;
}

.time-to {
  margin-top: -1.4em;
  break-before: avoid;
}

.contrib-heading {
  break-inside: avoid;
}

.contrib-heading > :is(h4, span) {
  display: inline-block;
  margin: 0;
}

.contrib-heading > span {
  margin-right: 5px;
}

.contrib-heading > h4 {
  margin-right: 5px;
  line-height: 1.4em;
}
