/*
 * Additional fonts
 */
/* LinBiolinum is sans-serif; see linuxlibertine.org */
@font-face {
  font-family: "LinBiolinum";
  src: url("../fonts/LinLibertine/LinBiolinum_R.otf") format("opentype");
}

@font-face {
  font-family: "LinBiolinum";
  font-weight: bold;
  src: url("../fonts/LinLibertine/LinBiolinum_RB.otf") format("opentype");
}

@font-face {
  font-family: "LinBiolinum";
  font-style: italic;
  src: url("../fonts/LinLibertine/LinBiolinum_RI.otf") format("opentype");
}

/*
 * General settings  
 */
:root {
  --pico-font-family-sans-serif: LinBiolinum, system-ui, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, Helvetica, Arial, "Helvetica Neue", sans-serif,
    var(--pico-font-family-emoji);
  --card-height: 300px;
}

/* don't underline links by default */
a {
  --pico-text-decoration: none;
}



/* Override breakpoint settings for hamburger menu in Yohn's Pico fork */
@media (max-width: 767px) {
  nav[role=navigation][data-breakpoint=my-md] {
    flex-wrap: wrap;
    overflow: hidden;
  }

  nav[role=navigation][data-breakpoint=my-md]:has(input[type=checkbox]:checked) {
    overflow: visible;
  }

  nav[role=navigation][data-breakpoint=my-md] label {
    display: block;
  }

  nav[role=navigation][data-breakpoint=my-md]>[role=list] {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    width: 90vw;
    max-height: 0;
    margin: 0 auto;
    background-color: var(--pico-muted-border-color);
    box-shadow: var(--pico-box-shadow);
    opacity: 0;
    transition: max-height var(--pico-transition), opacity var(--pico-transition);
  }

  nav[role=navigation][data-breakpoint=my-md]>[role=list] li {
    width: calc(100% - var(--pico-nav-link-spacing-vertical) * 2);
    margin: calc(var(--pico-nav-link-spacing-vertical) * 0.5) var(--pico-nav-link-spacing-vertical);
    padding: 0;
  }

  nav[role=navigation][data-breakpoint=my-md]>[role=list] li>details.dropdown {
    width: 100%;
  }

  nav[role=navigation][data-breakpoint=my-md]>[role=list] li>form[role=search] {
    margin-block-end: 0;
  }

  nav[role=navigation][data-breakpoint=my-md]>[role=list] a {
    display: block;
    margin: 0;
    border-radius: 0;
    border-block-end: 1px solid transparent;
    transition: border-color var(--pico-transition), color var(--pico-transition);
  }

  nav[role=navigation][data-breakpoint=my-md]>[role=list] a:hover {
    border-bottom-color: var(--pico-underline);
    text-decoration: none;
  }

  nav[role=navigation][data-breakpoint=my-md] input[type=checkbox]:checked~[role=list] {
    display: block;
    max-height: 100vh;
    opacity: 1;
  }
}

/* end override hamburger settings */

/* Two cards side by side on small screens */
@media (min-width: 576px) {
  .card {
    max-width: calc(50% - var(--pico-block-spacing-horizontal) / 2);
  }
}

/* Three cards side by side on large screens */
@media (min-width: 1024px) {
  .card {
    max-width: calc(33% - var(--pico-block-spacing-horizontal) * 2 / 3);
  }
}

/* Four cards side by side on xs-large screens */
@media screen and (min-width: 1536px) {
  .card {
    max-width: calc(25% - var(--pico-block-spacing-horizontal) * 3 / 4);
  }

  .container {
    max-width: 1280px;
  }
}

/* Smaller container width on x-large screens */
@media (min-width: 1280px) {
  .container {
    max-width: 1170px;
  }
}


/*
 * Light/Dark mode settings (adapted from Yohn's Pico fork)
 */
/* Light color scheme (default); can be forced with data-theme="light" */
[data-theme="light"],
:root:not([data-theme="dark"]) {}

/* Dark color scheme. Everything must be set twice:
  - once for automatically enabled dark mode
  - and once for when dark mode is forced via toggle 
 */
@media only screen and (prefers-color-scheme: dark) {}

[data-theme="dark"] {}

/*
 * Specific elements on the page
 */
/* Jumbotron */
#jumbotron-title {
  border-bottom: thin solid var(--pico-h1-color);

  h1 {
    font-size: 3rem;
    font-weight: 500;
    margin-bottom: calc(var(--pico-spacing) * 0.5);

    a {
      color: var(--pico-h1-color);
      text-decoration-color: var(--pico-h1-color);
    }
  }
}

#jumbotron-subtitle h2 {
  font-size: 2.1rem;
  font-weight: 500;
  margin-top: calc(var(--pico-spacing) * 0.5);
}

/* Navbar */
#site-navbar {
  ul {
    margin-left: 0;
    margin-right: 0;

    li:last-child {
      padding-right: 0;
    }

    li[aria-current=page] a {
      text-decoration: underline;
    }
  }

  a {
    font-size: calc(var(--pico-font-size) * 0.9);
    font-weight: bold;
    text-align: right;
  }
}

/* make hamburger icon bigger */
#hamburger-label {
  font-size: calc(var(--pico-font-size) * 2);
}

/* change color of sun icon to white*/
#sun-moon:not(:checked)::before {
  background-color: var(--pico-color);
}

/* change background & border color of theme toggle */
#sun-moon:not([aria-invalid]) {
  background-color: var(--pico-primary-background);
  border-color: var(--pico-primary-border);
}

/* move theme toggle switch to the right when inside dropdown menu */
#sun-moon-label {
  margin-left: auto;
  margin-right: 0;
}

/* Main content */
#main-header h1,
#site-footer p {
  background: var(--pico-card-sectioning-background-color);
  box-shadow: var(--pico-card-box-shadow);
  padding: calc(var(--pico-block-spacing-horizontal) * 0.5) calc(var(--pico-block-spacing-vertical) * 0.5);
  text-align: center;
}

/* grid settings for event list */
.event-grid {
  display: grid;
  grid-template-columns: minmax(auto, 250px) minmax(60%, auto);
}

/* flex settings for layout of cards */
.cards {
  display: flex;
  flex-flow: row wrap;
  list-style-type: none;
  padding-left: inherit;
  column-gap: var(--pico-block-spacing-horizontal);
}

/* flexitem settings for cards, flex settings for single card */
.card {
  display: flex;
  flex-flow: column nowrap;
  flex: 1 0 100%;
  list-style-type: none;
  padding-left: calc(var(--pico-spacing) * 0.5);
  padding-right: calc(var(--pico-spacing) * 0.5);
  box-shadow: var(--pico-card-box-shadow);
}

/* flexitem settings for single card */
.card-header {
  flex: 0 0 3.5lh;
  /* set card header to fixed height equivalent to two lines of text */
  margin-left: calc(var(--pico-nav-element-spacing-horizontal) * -1);
  margin-right: calc(var(--pico-nav-element-spacing-horizontal) * -1);

  /* Use overflow on card heading if it's longer than two lines of text */
  h3 {
    color: var(--pico-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: auto;
  }
}

.card-body img {
  height: var(--card-height);
}


/* settings for articles */
.article-body {
  overflow: hidden;

  img {
    height: var(--card-height);
    max-width: 270px;
    aspect-ratio: auto;
  }

  img.article-cover {
    float: left;
    padding-right: var(--pico-spacing);
    padding-bottom: var(--pico-spacing);
  }

  img:not(.article-cover) {
    float: right;
    padding-left: var(--pico-spacing);
    padding-bottom: var(--pico-spacing);
  }

  .no-content {
    display: flex;
    justify-content: center;
  }
}

.article-content {
  padding-left: 10px;
  padding-right: 10px;
}

.klappentext,
.article-footer {
  clear: both;
}

/* settings for slide shows on wide cards */
/* see https://www.smashingmagazine.com/2012/04/pure-css3-cycling-slideshow/ */
.wcard {
  display: flex;
  flex-flow: wrap;
  column-gap: calc(var(--pico-nav-element-spacing-horizontal) * 2);

  .wcard-gallery {
    flex: 1 0 calc((100% - (2 * var(--pico-nav-element-spacing-horizontal))) * 0.618);
    min-width: 300px;
  }

  .wcard-title {
    flex: 1 0 calc((100% - (2 * var(--pico-nav-element-spacing-horizontal))) * 0.382);
    min-width: 185px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
}

.wcard-gallery {
  height: var(--card-height);
  position: relative;
  overflow: visible;

  .wcard-gallery-mask {
    height: var(--card-height);
    overflow: hidden;
  }

  ul {
    margin: 0;
    padding: 0;
    position: relative;
  }

  li.wcard-image {
    position: absolute;
    list-style: none;
    height: var(--card-height);
    width: 100%;
    animation: image-slide 20s ease-in-out infinite;
    left: -100%;
    opacity: 0;

    a {
      display: block;
      position: absolute;
      overflow-y: visible;
      height: 100%;
      width: 100%;
    }

    img {
      bottom: 0%;
      width: 100%;
      position: relative;
    }

    .wcard-tooltip {
      background: rgba(0, 0, 0, 0.7);
      max-width: 80%;
      position: absolute;
      top: 20px;
      left: 20px;
      transition: top 0.3s ease-in-out;
      opacity: 0;

      p {
        color: var(--pico-tooltip-color);
        font-size: var(--pico-font-size);
        padding: var(--pico-nav-element-spacing-horizontal);
        margin: 0;
      }
    }

  }

  li.wcard-image:hover .wcard-tooltip {
    opacity: 1;
  }
}

@keyframes image-slide {

  0%,
  31% {
    left: -100%;
    opacity: 0;
  }

  5%,
  25% {
    left: 0px;
    opacity: 1;
  }

  30% {
    left: 100%;
    opacity: 0;
  }
}

/*
.article-footer {
  margin-left: calc(var(--pico-nav-element-spacing-horizontal) * -1);
  margin-right: calc(var(--pico-nav-element-spacing-horizontal) * -1);
}*/