:root {
  --max-width: 1280px;

  --bg: #333;
  --header-bg: #333;
  --fg: #DDD;
  --header-fg: #DDD;
  --header-focus: #00AADD;
  --header-name-height: 75px;

  --button-padding: 0.5em;

  /* Hamburger and sidebar */
  --hamburger-menu-bg: #333;
  --sidebar-width: 60px;
  --sidebar-vertical-padding: 100px;
  --sidebar-height: 8px;
  --sidebar-gap: 1.5em;
  --sidebar-margin: 37px;
  --hamburger-menu-size: 30px;

  --transition-time: 0.3s;

  /* Gallery */
  --gallery-item-border-radius: .4em;
  --gallery-gap: 0.2em;
  --gallery-items-per-row: 3;

  /* Slider */
  --slider-background-color: #444444;

}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  max-width: var(--max-width);
  margin: auto;
  padding: 1em 5vw;
}

/* Restyle links */
a {
  color: #EEE;
  text-decoration: underline;
}

a:hover { background: #777; }
.logo a:hover { background: transparent; }

/* Header */
header {
  display: flex;
  flex: grow;
  align-items: center;
  justify-content: space-between;
  color: var(--header-fg);
  background-color: var(--header-bg);
}

.logo {
  max-height: var(--header-name-height);
  padding: 0 20px 0 0;
}

.logo img { max-height: var(--header-name-height); }

.hamburger-menu {
  position: absolute;
  top: var(--sidebar-margin);
  right: var(--sidebar-margin);
  width: var(--hamburger-menu-size);
  height: var(--hamburger-menu-size);
  background: linear-gradient(
    to bottom,
    var(--fg)  0%, var(--fg)  20%,
    var(--bg) 20%, var(--bg)  40%,
    var(--fg) 40%, var(--fg)  60%,
    var(--bg) 60%, var(--bg)  80%,
    var(--fg) 80%, var(--fg) 100%
  );
  z-index: 13;
}

.hamburger-menu::before,
.hamburger-menu::after,
.hamburger-menu input,
.hamburger-menu {
  display: none;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  background: black;
  z-index: 11;
}

nav {
  display: flex;
  flex-grow: 1;
  z-index: 12;
}

nav ul {
  display: flex;
  padding: 0;
  justify-content: space-between;
  list-style: none;
  align-items: center;
  transition: width var(--transition-time);
}

nav ul li a {
  color: var(--header-fg);
  text-decoration: none;
  white-space: nowrap;
  padding: var(--button-padding);
}

nav ul li a.active {
  text-decoration: underline;
}


/* Language Switch */
.lang-switch {
  flex-grow: 0;
  margin-left: auto;
}

.cur-lang {
  text-decoration: underline;
}

/* Ensure images do not go out of the frame */
img {
  max-width: calc(min(100vw, 100%));
  max-height: calc(min(100vw, 100%));
}

/* Enable side-by-side header links if there is enough space */
@media screen and (max-width: 42rem) {
  .hamburger-menu { display: flex; }

  nav {
    height: 0;
    width: 0;
    position: fixed;
    top: 0;
    right: 0;
    flex-direction: column;
    overflow: hidden;
    gap: var(--sidebar-gap);
  }

  nav ul {
    flex-direction: column;
    width: 0%;
    overflow: hidden;
    justify-content: initial;
    padding: var(--sidebar-vertical-padding) 0px;
    margin: 0px;
    gap: var(--sidebar-gap);
  }

  .hamburger-menu:has(input:checked) + nav {
    height: 100%;
    width: 100%;
    justify-content: inherit;
    background: var(--bg);
  }

  .hamburger-menu:has(input:checked) + nav ul {
    width: 100%;
    padding: var(--sidebar-vertical-padding) 0;
  }

  /* Enable overlay transition only when hovering on the hamburger menu - avoids flashing on page load */
  .hamburger-menu:hover ~ .overlay { transition: var(--transition-time); }

  .hamburger-menu:has(input:checked) ~ .overlay {
    visibility: visible;
    opacity: 0.6;
  }

  .hamburger-menu:has(input:checked) {
    position: fixed;
  }

  .lang-switch {
    margin-left: 0;
    flex-direction: row;
    justify-content: center;
  }
}

/* End of HEADER */

hr {
  height: 2px;
  background-color: var(--fg);
}

h1 {
  text-align: center;
  color: var(--header-fg);
}

blockquote {
  text-align: left;
  font-style: oblique;
}

/* Full page painting */
.painting-container {
  display: flex;
  padding: 2em 0 0 0;
  flex-direction: row;
}

.painting-data {
  max-width: 50%;
  display: flex;
  flex-grow: 1;
  flex-direction: column;
  text-align: center;
  padding: 1em;
}

.painting-data h1 { margin: 0; }

@media only screen and (max-width: 42rem) {
  .painting {
    max-width: 100%;
    max-height: 500px;
  }
  .painting-container {
    flex-direction: column;
    align-items: center;
  }
}

/* Footer */
footer {
  text-align: center;
  bottom: 0;
  background: transparent;
  padding: 2em 0.5em 1em;
}

footer span {
  padding: 0.2em 0.5em;
  background: var(--bg);
}

footer span a {
  text-decoration: none;
  padding: 0.1em;
}

/* Socials */
footer p a img {
  max-height = 25px;
  vertical-align: middle;
  height = 25px;
}
footer p a {
  padding: 5px;
  border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;

}
footer p a:hover {
  transition: 0.2s; -webkit-transition: 0.2s;
}

/* SERIES */
.serie ul {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: 1fr;
  align-items: center;
  list-style: none;
  padding: 0;
}

.serie ul li {
  display: block;
  height: 100%;
  margin: 2px;
  text-align: center;
}

.serie ul li img,
.serie ul li div {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}

.serie ul li div a.more {
  height: 100%;
  width: 100%;
	display: flex;
	flex-direction: column;
	justify-content: center;
  font-size: 30px;
  border: 2px dashed var(--fg);
}

.serie h1 {
  margin: 0;
}

.serie h2 {
  font-size: 1rem;
  padding: 0;
  margin: 0;
  text-align: center;
  font-weight: normal;
}

/* Gallery */
.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gallery-gap);
}

.gallery-entry {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: var(--gallery-item-border-radius);
}

.gallery-entry img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--gallery-item-border-radius);
  max-width: 100%;
  vertical-align: middle;
  height: auto;
  transition: 0.3s;
}

.gallery-entry img:hover {
  opacity: 20%;
  transition: 0.1s;
}

.gallery-entry-overlay {
  pointer-events: none;
  text-align: center;
  position: absolute;
  width: 100%;
  opacity: 0%;
}

.gallery-entry:hover .gallery-entry-overlay {
  opacity: 100%;
  transition: 0.1s;
}

.gallery-entry figure { margin: 0; }

.gallery-entry figcaption { margin-top: .5rem; }

.gallery-entry a { border-radius: var(--gallery-item-border-radius); }

.gallery-entry {
  flex: 0 0
  calc(
    100% / var(--gallery-items-per-row) - var(--gallery-gap) *
      (var(--gallery-items-per-row) - 1) / var(--gallery-items-per-row)
  );
}

@media only screen and (width >= 1024px) {
  .gallery {
    --gallery-items-per-row: 5;
  }
}
@media only screen and (768px < width < 1024px) {
  .gallery {
    --gallery-items-per-row: 4;
  }
}


/* ABOUT */
.about p img {
  float: left;
  padding-right: 1em;
  width: 30%;
}

/* ensure the bio part appears *after* the photo */
.about h1 {
  clear: left;
}

@media only screen and (max-width: 872px) {
  .about p:has(img) {
    display: flex;
    flex-grow: 1;
    flex-direction: column;
    align-items: center;
  }

  .about p img {
    float: none;
    max-width: 100%;
    width: 70%;
  }
}

/* Slideshow */
.slider-container {
  max-width: 65%;
  max-height: 75vh;
  background: var(--slider-background-color);
  display: flex;
}
.slider-container ul.slider {
  display: flex;
  gap: 2em;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0;
  margin: 0;
}
.slider-container ul.slider li.slide {
  display: flex;
  scroll-snap-align: start;
  max-height: 100%;
  min-width: 100%;
  justify-content: center;
  align-items: center;
}
.slider-container ul.slider li.slide img {
  max-width: 100%;
  max-height: 100%;
}
@media only screen and (max-width: 872px) {
  .slider-container {
    max-width: 100%;
  }
}

/* Events and Event List */
.event-list {
  list-style: none;
  padding: 0;
}

.event-name {
  font-size: 20px;
  display: block;
}

.event-summary p img {
  max-height: 65vh;
  max-width: 100%;
}

.event-summary p:has(img) {
  text-align: center;
}

.event p:has(img) {
  text-align: center;
}

.event p img {
  max-height: 75vh;
}

.event h1 {
  padding: 0.5em 0 0 0;
  margin: 0;
}

.event h2 {
  font-size: 1rem;
  padding: 0;
  margin: 0;
  text-align: center;
  font-weight: normal;
}

/* SVG Icons */
.svg-icon {
  display: inline-block;
  margin: auto;
  width: 1em;
  height: 1em;
  vertical-align: sub;
}

.svg-icon * {
  fill: var(--fg);
}
