/* Fonts */

@font-face {
  font-family: JetBrains;
  src: url(../fonts/JetBrains.ttf);
}

@font-face {
  font-family: Archivo;
  src: url(../fonts/Archivo.ttf);
}

/* Colors */

:root {
  --blue: #1f2041;
  --green: #00e49b;
  --light-blue: #e3f2fd;
  --purple: #6369d1;
  --white: white;
}


/* Common tags */

html {
  background: var(--white);
  color: var(--blue);
  font: 14pt Archivo;
  line-height: 1.4;
}

body {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 100vh;
}

main {
  align-items: center;
  display: flex;
  flex: 1;
  flex-direction: column;
  width: 100%;
}

h1, h2, h3, h4 {
  font-family: JetBrains;
}

h1 {
  font-size: 0;

  a {
    background: url(../images/logo-simple.svg) center / contain no-repeat;
    display: block;
    height: 2.5rem;
    width: 9.5rem;
  }
}

h2 {
  font-size: 3em;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 1.5em 0 1em;
  text-align: center;
  text-transform: uppercase;
}

h3 {
  font-size: 2.2em;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 1.5em 0 0.75em;
}

h4 {
  font-size: 1.4em;
  line-height: 1.1;
  margin: 2em 0 0.75em;
}

a {
  color: var(--purple);
}

article {
  box-sizing: border-box;
  max-width: 90%;
  width: 60em;
}

header,
footer {
  align-items: center;
  background: var(--blue);
  box-sizing: border-box;
  color: var(--white);
  display: flex;
  flex-wrap: wrap;
  gap: 1em;
  justify-content: space-between;
  padding: 1em;
  position: relative;
  width: 100%;

  a {
    color: inherit;
    text-decoration: none;

    li.active &,
    &:hover {
      text-decoration: underline;
      text-decoration-color: var(--green);
      text-underline-offset: 0.3em;
    }
  }

  ul {
    display: flex;
    gap: 1em;
    margin: auto;
    padding: 0;

    li {
      display: block;
    }

    &#categories {
      flex-wrap: wrap;
      font-size: 0.8em;
      gap: 0 1em;
      justify-content: center;
    }
  }

  nav {
    align-items: center;
    display: flex;
    gap: 1em;

    &:has(#categories) {
      width: 100%;
    }
  }
}

footer {
  justify-content: center;
  margin-top: 5rem;
}

ul,
ol {
  padding: 0 1.5em;

  li::marker {
    color: var(--green);
  }
}

address {
  font-style: normal;
  white-space: pre-line;
}

sup {
  font-size: 0.7em;
  line-height: 1;
  vertical-align: 30%;
}

pre,
code {
  font-family: JetBrains;
}

iframe {
  border: 0;
}

img {
  max-width: 100%;
}

table {
  border-collapse: collapse;
  margin: auto;

  th,
  td {
    border: 1px solid var(--light-blue);
    padding: 0.25em;
  }
}


/* Common classes */

ul.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1em;
  margin: 1em 0;
  padding: 0;

  li {
    display: block;

    a {
      background: var(--green);
      color: var(--blue);
      display: block;
      padding: 0.75em;
      text-decoration: inherit;
      transition: 0.3s;

      &:hover {
        filter: brightness(0.8);
      }
    }
  }

  nav & {
    margin: 0;
  }

  h2 + & {
    justify-content: center;
    margin-top: -2rem;
  }
}

aside.subtitle {
  color: var(--green);
  font-weight: bold;
  font-size: 1.3em;
  text-transform: uppercase;

  &:has(+ h2) {
    margin-bottom: -4rem;
    margin-top: 4rem;
  }

  &:has(+ h3) {
    margin-bottom: -0.5rem;
    margin-top: 0.5rem;
  }
}

.event-description {
  display: flex;
  gap: 1em;

  section {
    background: var(--light-blue);
    flex: 1 0;
    padding: 2em;

    h3 {
      margin: 0.5em 0;
    }
  }
}

.sponsors img {
  display: inline-block;
  height: 100px;
  margin: 1rem;
  object-fit: contain;
  vertical-align: middle;
  width: 200px;
}

.avatar {
  border-radius: 100%;
  box-shadow: 0 0 0.2em #dddd;
  height: 3em;
  margin-right: 0.2em;
  object-fit: cover;
  vertical-align: middle;
  width: 3em;
}


/* Pages */

#index {
  main::before {
    background: url(../images/logo-full.svg) center / contain no-repeat;
    content: "";
    display: block;
    margin: 2.5em 0;
    height: 8em;
    width: 100%;
  }

  .coverboard {
    padding: 6rem 50% 6rem calc(50% - 30rem);
    position: relative;
    max-width: none;
    width: 100%;

    h2 {
      margin: 0.2em 0;
      text-align: left;
    }

    aside {
      background: var(--green);
      border-radius: 100%;
      color: var(--blue);
      height: 3.5em;
      font-size: 0.9em;
      letter-spacing: -0.03em;
      line-height: 1;
      padding: 0.7em 0.5em 0.3em;
      position: absolute;
      right: calc(50% - 4rem);
      text-align: center;
      top: 2.5rem;
      width: 3.5em;

      &:first-line {
        font-size: 2em;
      }

      sup {
        vertical-align: 15%;
      }
    }

    .pycon-date {
      color: var(--green);
      font-weight: bold;
    }

    &::before {
      background: var(--white);
      bottom: 4rem;
      content: "";
      display: block;
      left: calc(50% - 32rem);
      position: absolute;
      top: 4rem;
      width: 34rem;
      z-index: -1;
    }

    &::after {
      /* Photo by Serinus: https://www.pexels.com/photo/view-of-a-river-in-a-city-6561248/ */
      /* background: center / cover url(../images/lyon.jpg); */
      bottom: 0;
      content: "";
      left: 0;
      position: absolute;
      right: 0;
      top: 0;
      z-index: -2;
    }
  }

  .place {
    display: grid;
    gap: 1em;
    grid-auto-flow: column;
    grid-template: max-content auto / 1fr 3fr;
    margin-top: 3em;

    h2 {
      margin: 0;
      text-align: left;
    }

    img {
      margin: 1em 0;
      width: 10rem;
    }

    section:has(iframe) {
      grid-area: 1 / 2 / -1;

      iframe {
        height: 30em;
      }
    }
  }

  .afpy {
    background: var(--blue);
    color: var(--white);
    display: grid;
    gap: 1em;
    grid-auto-flow: column;
    grid-template: min-content auto / 9fr 11fr;
    margin-top: 3em;
    padding: 4em calc(50% - 30rem);
    max-width: none;
    width: 100%;

    h2,
    h3 {
      margin: 0;
      text-align: left;
    }

    .buttons {
      justify-content: left;
    }

    section {
      grid-area: 1 / 2 / -1;
    }
  }

  .become-sponsor {
    text-align: center;

    .contact-sponsor {
      background: var(--light-blue);
      margin: 2em auto;
      padding: 1em;
      width: 70%;

      a {
        display: block;
        font-size: 3em;
        text-align: center;
        transition: 0.3s;

        &:hover {
          filter: brightness(0.8);
        }
      }
    }
  }
}

#schedule {
  .keynotes {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;

    h3 {
      width: 100%;
    }

    dl {
      background: var(--light-blue);
      border-radius: 1em;
      display: flex;
      flex-direction: column;
      margin: 0;
      width: 31%;

      img {
        border-radius: 1em 1em 0 0;
        height: 20em;
        object-fit: cover;
        width: 100%;
      }

      dt {
        /* remove these 2 lines when adding links */
        font-size: 1.3em;
        font-weight: bold;
        order: 2;
        padding: 1rem 2rem;

        a {
          color: inherit;
          font-size: 1.3em;
          font-weight: bold;
          text-decoration: inherit;
        }
      }

      dd {
        margin: 0;
        order: 3;
        padding: 0 2em;

        a {
          color: inherit;
          display: block;
          padding: 1em 0 2em 1.5em;
          position: relative;
          text-decoration: inherit;

          &::before {
            color: var(--green);
            content: "“";
            font-size: 4em;
            left: 0;
            line-height: 1;
            opacity: 0.3;
            position: absolute;
          }
        }

        &:has(img) {
          order: 1;
          padding: 0;
        }

        /* remove this block when adding links */
        &:last-of-type:not(:has(img)) {
          padding: 1rem 0 2rem 3rem;
          position: relative;

          &::before {
            color: var(--green);
            content: "“";
            font-size: 5em;
            left: 1rem;
            line-height: 1;
            opacity: 0.3;
            position: absolute;
            top: -0.02em;
          }
        }
      }
    }
  }

  #calendar {
    iframe {
      height: 25em;
      width: 100%;
    }
  }
}

#full-schedule {
  background: var(--white);
  min-width: 65em;
  padding: 0;

  table {
    border-collapse: separate;
    border-spacing: 0.5rem;
    table-layout: fixed;
    width: 100%;

    a {
      color: inherit;
      font-variation-settings: "wdth" 100;
      font-weight: normal;
      text-decoration: none;
    }

    thead {
      height: 2em;
      position: sticky;
      top: 0.5rem;
      z-index: 1;

      &.rooms th {
        color: white;
      }

      &.rooms tr > :first-child::before {
        background: #1b0e29;
        box-shadow: 0 0.75em 1em #1b0e29;
        content: "";
        height: 5em;
        left: 0;
        position: absolute;
        right: 0;
        outline: 1em solid #1b0e29;
        top: -1rem;
        z-index: -1;
      }

      &.day {
        top: 3rem;
        z-index: 2;

        th {
          background-clip: content-box;
          background-color: #1b0e29;
          color: white;
          padding-bottom: 2rem;
        }
      }
    }

    tr:not(:last-child) {
      height: 2.6rem;
    }

    td {
      background: white;
      border: none;
      border-left: 0.5em solid;
      border-radius: 0 0.3em 0.3em 0;
      box-shadow: 0 0 0.1em #ddd, 0 0 1em #ddd8;
      font-size: 0.75em;
      line-height: 1.3;
      padding: 0.5rem 0.5rem 3.5em 0.5rem;
      position: relative;

      &:empty {
        background: none;
        border: none;
        box-shadow: none;
      }
    }

    th {
      border: none;
      font-weight: 600;

      tbody & {
        font-weight: 400;
        position: relative;
        transform: translatey(-52%);
        z-index: 0;
      }
    }

    tr > *:first-child {
      opacity: 0;
      width: 4.5em;
    }

    tr:nth-child(3n+1) > *:first-child {
      opacity: 1;
    }
  }

  aside.type {
    bottom: 0.5em;
    font-size: 0.7em;
    left: 0.5em;
    position: absolute;

    &::before {
      border-radius: 0.2em;
      box-shadow: 0 0 0.2em #ddd;
      content: "";
      display: inline-block;
      height: 1em;
      margin-right: 0.4em;
      vertical-align: -10%;
      width: 1em;
    }
  }

  aside.speakers {
    font-size: 0.8em;
    line-height: 1.1;
    margin-top: 0.5em;
  }

  .submission {
    &.short-plenary { --color: maroon }
    &.plenary { --color: blue }
    &.workshop { --color: turquoise }
    &.short-talk { --color: orange }
    &.long-talk { --color: red }
    &.general-assembly { --color: maroon }
    &.lightning-talk { --color: pink }
    &.lunch { --color: purple }

    border-left-color: var(--color);

    .type::before {
      background: var(--color);
    }
  }

  .extra {
    border: none;
    padding: 0;
    vertical-align: top;

    div {
      align-items: center;
      background: center / cover;
      border-radius: 0.1em;
      color: var(--white);
      display: flex;
      font-size: 2em;
      font-weight: 600;
      justify-content: center;
      position: absolute;
      text-shadow: 0 0 0.15em var(--blue);
    }
  }

  #saturday-breakfast div {
    /* background-image: url(../images/breakfast.webp); */
    height: calc(8rem / 3 * 2 + 0.5rem);
    width: calc(400% + 0.9 * 3 * 0.5rem);
  }

  #sunday-breakfast div {
    /* background-image: url(../images/breakfast.webp); */
    height: calc(8rem / 3 * 3 + 2 * 0.5rem);
    width: calc(400% + 0.9 * 3 * 0.5rem);
  }

  #saturday-lunch div,
  #sunday-lunch div {
    /* background-image: url(../images/lunch.webp); */
    height: calc(8rem / 3 * 6 + 5 * 0.5rem);
    width: calc(400% + 0.9 * 3 * 0.5rem);
  }

  #saturday-snack div {
    /* background-image: url(../images/snack.webp); */
    height: 8rem;
    width: calc(400% + 0.9 * 3 * 0.5rem);
  }
}

#venue {
  iframe {
    height: 30em;
  }
}


/* Mobile */

@media (max-width: 1200px) {
  html {
    font-size: 1em;
  }

  header {
    justify-content: left;

    nav:has(#pages) {
      align-items: center;
      flex-direction: column;
      margin-left: auto;
      order: 10;

      #pages {
        align-items: center;
        display: none;
        flex-direction: column;
        font-size: 1.3em;
        height: 3em;
        justify-content: space-evenly;
        overflow: hidden;
      }

      &:hover {
        height: 100vh;
        width: 100%;

        #pages {
          height: 100vh;
          display: flex;
        }

        &:after {
          display: none;
        }
      }

      &:after {
        align-self: end;
        content: '☰';
        font-size: 3rem;
        line-height: 1;
      }
    }

    &:has(nav:first-of-type:hover) > *:not(:has(#pages)) {
      display: none;
    }

    #languages li {
      font-size: 0.8em;
    }
  }

  footer ul {
    justify-content: center;
    flex-wrap: wrap;
  }

  h2 {
    font-size: 2em;
  }

  h3 {
    font-size: 1.6em;
  }

  h4 {
    font-size: 1.4em;
  }

  p {
    hyphens: auto;
    text-align: justify;
  }

  table {
    font-size: 0.85em;
  }

  .event-description {
    flex-direction: column;
  }

  #index {
    .coverboard {
      padding: 5em 10%;

      aside {
        right: calc(10% - 2em);
      }

      &::before {
        left: calc(10% - 1em);
        right: calc(10% - 1em);
        width: auto;
      }
    }

    .place,
    .afpy {
      display: block;

      h2 {
        margin: 0.5em 0 1em;
      }
    }

    .place {
      h2 {
        margin-bottom: 0.25em;
      }

      img {
        display: none;
      }
    }

    .afpy {
      padding: 2em 5%;
    }

    .become-sponsor .contact-sponsor a {
      font-size: 1.5em;
    }
  }

  #schedule {
    .keynotes {
      align-items: center;
      flex-direction: column;
      gap: 1em;

      dl {
        max-width: 100%;
        width: 25em;
      }
    }
  }
}


/* Print */

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

  #full-schedule {
    background: none;
    min-width: 0;

    header {
      display: none;
    }

    table {
      border-spacing: 0;
      font-size: 8.65pt;

      thead {
        height: auto;
        text-align: center;
        top: 0;

        th:not(:empty) {
          background: var(--blue);
        }

        &.rooms tr > :first-child::before {
          content: none;
        }

        &.day th {
          padding-bottom: 0;
          transform: translate(0 -4em);
        }

        &.day ~ thead.day {
          break-before: page;
        }
      }

      tr:not(:last-child) {
        height: auto;
      }

      td {
        line-height: 1.15;
        padding: 0 0.5em 2.2em 0.5em;

        &:not(:empty) {
          outline: 0.1mm solid var(--light-blue);
        }
      }

      div {
        height: 3.5em !important;
        justify-content: flex-start;
        width: 400%;

        #saturday-lunch & {
          height: 7em !important;
        }

        #saturday-breakfast &, #sunday-lunch & {
          height: 2.5em !important;
        }
      }
    }
  }
}
