/*
 * 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);
}

/* 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) {
  :root:not([data-theme]) {

    #main-header h1,
    #site-footer p {
      background: var(--pico-card-sectioning-background-color);
      /* var(--bg-gradient-dark); */
    }
  }
}

[data-theme="dark"] {

  #main-header h1,
  #site-footer p {
    background: var(--pico-card-sectioning-background-color);
    /* var(--bg-gradient-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);
    }
  }
}

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

/* flex settings for layout of cards */
.cards {
  display: flex;
  flex-flow: row wrap;
  list-style-type: none;
  padding-left: inherit;
  justify-content: space-between;
}

/* 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 */
.article-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 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: auto;
  }
}

.article-body {
  text-align: center;

  img {
    height: 270px;
  }
}


/* settings for slide shows on wide cards */
/* see https://www.smashingmagazine.com/2012/04/pure-css3-cycling-slideshow/ */
.wcard-gallery {
  height: 270px;
  position: relative;
  overflow: visible;

  .wcard-gallery-mask {
    height: 270px;
    overflow: hidden;
  }

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

  li.wcard-image {
    position: absolute;
    list-style: none;
    height: 270px;
    width: 100%;

    animation: image-slide 20s ease-in-out infinite;
    left: -100%;
    opacity: 0;
    z-index: 0;

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

    .wcard-tooltip {
      background: rgba(0, 0, 0, 0.7);
      /*       width: 300px; */
      max-width: 100%;
      /*       height: 60px; */
      position: absolute;
      top: -75px;
      left: 20px;
      transition: top 0.3s ease-in-out;

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

  }

  li.wcard-image:hover .wcard-tooltip {
    top: 20px;
  }

}

@keyframes image-slide {

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

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

  30% {
    left: 100%;
    opacity: 0;
    z-index: 0;
  }
}

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