:root {
  --primary-color: #A13E3E;
  --secondary-color: #F2D856;
  --gray-100: #222222;
  --gray-80: #282828;
  --gray-50: #383838;
  --gray-40: #484848;
  --gray-30: #C8C8C8;
  --gray-20: #e6e6e6;
  --gray-10: #F8F8F8;
  --black: #000;
  --white: #FFFFFF;
  --menu-text: var(--white);
}

#main {
  background-color: var(--bg);
}

header, footer, .image-mosaic {
  color: var(--menu-text);
  background-color: var(--primary-color);
}

#goto-top, #go-back {
  background-color: var(--primary-color);
  color: var(--secondary-color);
  border-color: var(--bg);
}

.anchor-as-button, p.anchor-button a, .button-group p a {
  display: inline-block;
  padding: 0.35em 0.7em;
  text-decoration: none !important;
}

p.anchor-button a, .button-group p a {
  color: white !important;
  background-color: hsl(0, 44%, 44%);
  border: 2px solid var(--gray-40);
}
p.anchor-button a:hover, .button-group p a:hover {
  background-color: hsl(0, 44%, 54%);
}

.button-group p a:not(:first-child) {
  color: var(--black) !important;
  background-color: hsl(50, 86%, 64%);
}
.button-group p a:not(:first-child):hover {
  background-color: hsl(50, 86%, 74%);
}

.image-gallery .slide-container {
  background-color: var(--gray-30);
}

/* Common */
:root {
  --nav-menu-dropdown-color: white;
  --nav-menu-dropdown-bg: var(--primary-color);
}

/* Light theme variables */
@media only screen and (min-width: 1200px) {
  [theme=light] nav#menu .dropdown-content > a:hover {
    color: var(--black);
    background-color: var(--gray-30);
  }
}
[theme=light] ul.decorated-list {
  list-style-image: url("data:image/svg+xml,%3Csvg width='10.85mm' height='5.1mm' version='1.1' viewBox='0 0 10.85 5.1' xmlns='http://www.w3.org/2000/svg'%3E%3Cg transform='translate(-51.828 -45.901)' fill='none'%3E%3Crect x='51.828' y='45.901' width='10.85' height='5.1' stop-color='%23000000' stroke-linecap='square' stroke-linejoin='round' stroke-width='10.214' style='paint-order:fill markers stroke'/%3E%3Cpath d='m52.452 48.666c0.68101 0.41584 1.4281 0.72654 2.2058 0.90482 0.68857 0.15784 1.4139 0.21557 2.1088 0.06119 0.52355-0.1163 1.0188-0.379 1.3852-0.7743 0.17011-0.18354 0.31392-0.39052 0.43795-0.60746 0.11964-0.20927 0.18684-0.44786 0.18732-0.69037 5.19e-4 -0.26397-0.10552-0.52958-0.30374-0.70792-0.33956-0.30553-0.8924-0.34024-1.2658-0.07209-0.17381 0.1248-0.28208 0.32062-0.33661 0.52439-0.09981 0.37299-0.02455 0.77262 0.135 1.118 0.17495 0.37878 0.35368 0.7651 0.63118 1.0811 0.20413 0.23244 0.47187 0.40211 0.75295 0.52554 0.58967 0.25894 1.2512 0.32895 1.8873 0.25772 0.59746-0.06691 1.1954-0.24806 1.6874-0.60086 0.0129-0.0092 0.02571-0.01861 0.03842-0.0281' stroke='%23a13e3e' stroke-width='1.2871'/%3E%3C/g%3E%3C/svg%3E%0A");
}
[theme=light] .image-gallery .slide-container {
  background-color: var(--gray-30);
}
[theme=light] code {
  background-color: var(--gray-30);
}
[theme=light] {
  --bg: var(--gray-10);
  --text: var(--gray-100);
  --link: #9F2828;
  --visited: #9F2828;
  --border-h2: 8px solid var(--primary-color);
}

/* Dark theme variables */
@media only screen and (min-width: 1200px) {
  [theme=dark] nav#menu .dropdown-content > a:hover {
    color: var(--white);
    background-color: var(--gray-50);
  }
}
[theme=dark] ul.decorated-list {
  list-style-image: url("data:image/svg+xml,%3Csvg width='10.85mm' height='5.1mm' version='1.1' viewBox='0 0 10.85 5.1' xmlns='http://www.w3.org/2000/svg'%3E%3Cg transform='translate(-51.828 -45.901)' fill='none'%3E%3Crect x='51.828' y='45.901' width='10.85' height='5.1' stop-color='%23000000' stroke-linecap='square' stroke-linejoin='round' stroke-width='10.214' style='paint-order:fill markers stroke'/%3E%3Cpath d='m52.452 48.666c0.68101 0.41584 1.4281 0.72654 2.2058 0.90482 0.68857 0.15784 1.4139 0.21557 2.1088 0.06119 0.52355-0.1163 1.0188-0.379 1.3852-0.7743 0.17011-0.18354 0.31392-0.39052 0.43795-0.60746 0.11964-0.20927 0.18684-0.44786 0.18732-0.69037 5.19e-4 -0.26397-0.10552-0.52958-0.30374-0.70792-0.33956-0.30553-0.8924-0.34024-1.2658-0.07209-0.17381 0.1248-0.28208 0.32062-0.33661 0.52439-0.09981 0.37299-0.02455 0.77262 0.135 1.118 0.17495 0.37878 0.35368 0.7651 0.63118 1.0811 0.20413 0.23244 0.47187 0.40211 0.75295 0.52554 0.58967 0.25894 1.2512 0.32895 1.8873 0.25772 0.59746-0.06691 1.1954-0.24806 1.6874-0.60086 0.0129-0.0092 0.02571-0.01861 0.03842-0.0281' stroke='%23f2d856' stroke-width='1.2871'/%3E%3C/g%3E%3C/svg%3E%0A");
}
[theme=dark] .image-gallery .slide-container {
  background-color: var(--gray-50);
}
[theme=dark] code {
  background-color: var(--gray-50);
}
[theme=dark] {
  --bg: var(--gray-80);
  --text: var(--white);
  --link: var(--secondary-color);
  --visited: var(--secondary-color);
  --border-h2: 8px solid var(--primary-color);
}

.image-gallery {
  position: relative;
  width: 100%;
  border-top: 4px solid var(--primary-color);
}
.image-gallery ul {
  display: none;
}
.image-gallery .slide-caption {
  text-align: center;
  font-size: 1.25rem;
  height: 40px;
  padding-top: 0.2em;
  overflow: hidden;
}
.image-gallery .slide-container {
  width: 100%;
  height: 264px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.image-gallery .slide-container .slide {
  display: none;
  max-height: 100%;
  margin: auto;
}
.image-gallery .slide-container .slide.active {
  display: block;
}
.image-gallery .gallery-nav {
  color: white;
  background-color: gray;
  opacity: 0.8;
  cursor: pointer;
  position: absolute;
  top: 132px;
  font-size: 50px;
  padding: 0 5px;
}
.image-gallery .gallery-nav.prev {
  left: 0;
  border-radius: 0 10px 10px 0;
  display: none;
}
.image-gallery .gallery-nav.prev:after {
  content: "<";
}
.image-gallery .gallery-nav.next {
  right: 0;
  border-radius: 10px 0 0 10px;
}
.image-gallery .gallery-nav.next:after {
  content: ">";
}

@media only screen and (min-width: 576px) {
  .image-gallery {
    margin-bottom: 2em;
    height: 400px;
  }
  .image-gallery .slide-container {
    height: 380px;
  }
  .image-gallery .gallery-nav {
    top: 186px;
  }
}
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  position: relative;
  min-height: 100vh;
}

/*
Enllasos ocults per millorar accessibilitat en la navegacio
<https://www.w3schools.com/accessibility/accessibility_accessibility_skip_links.php>
*/
.accessibility-skip {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  font-size: 0.9em;
}

.accessibility-skip:focus {
  position: static;
  width: auto;
  height: auto;
}

/* Cos <view-source:https://bestmotherfucking.website/> */
body {
  margin: 0 auto;
  font: 1.3em/1.62 "Poppins", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  zoom: 100%;
}

.hidden {
  display: none;
}

/* Margins */
.mt-1 {
  margin-top: 0.5em;
}

.mt-2 {
  margin-top: 0.75em;
}

.mt-2 {
  margin-top: 1em;
}

.mt-3 {
  margin-top: 1.25em;
}

/* Main content */
#main {
  max-width: 38em;
  margin: 0 auto 2em;
  padding: 0.62rem;
  /* Enllasos https://www.w3schools.com/html/html_links_colors.asp */
}
#main a {
  text-decoration: underline;
}
#main a:link {
  color: var(--link);
}
#main a:visited {
  color: var(--visited);
  text-decoration: none;
}
#main a:hover {
  transition: 0.35s;
  text-decoration: none;
}
#main ul {
  margin-bottom: 1.7rem;
  padding-left: 1.5rem;
}
#main ul.decorated-list {
  padding-left: 3rem;
  list-style-type: none;
}
#main ul.decorated-list li {
  line-height: 1.5em;
  padding-bottom: 0.5em;
}
#main ul.decorated-list li:last-child {
  padding-bottom: 0;
}
#main img, #main video {
  max-width: 100%;
  height: auto;
}
#main code {
  font-size: 1.2em;
  padding: 0 0.2em;
}

.image-mosaic {
  margin: 1em 0;
  padding-top: 1em;
}
.image-mosaic p {
  margin: 0;
  text-align: center;
  font-size: 0.8em;
}
.image-mosaic p img {
  margin-top: 0.5em;
  margin-bottom: 1em;
  display: inline-block;
  height: revert-layer !important;
}

.button-group {
  margin-bottom: -0.5em;
}
.button-group p a {
  margin-bottom: 0.25em;
}

.fixed-nav-buttons div {
  border-width: thick;
  border-style: solid;
  cursor: pointer;
  display: none;
  position: fixed;
  bottom: env(safe-area-inset-bottom);
  right: 10px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
}
.fixed-nav-buttons #goto-top {
  margin-bottom: 80px;
  padding-left: 8px;
}
.fixed-nav-buttons #goto-top svg {
  margin-top: 7px;
  margin-left: 0.7px;
}
.fixed-nav-buttons #go-back {
  margin-bottom: 10px;
  padding-left: 7px;
}
.fixed-nav-buttons #go-back svg {
  margin-top: 9px;
  margin-left: 0px;
}

details {
  padding: 0 1rem 0.5rem 1rem;
}
details summary {
  cursor: pointer;
  margin-left: -1rem;
}
details[open] {
  padding-bottom: 0.75em;
}
details[open] summary {
  margin-bottom: 0.5rem;
}
details ul {
  margin: 1.5rem -1rem 0 -1rem !important;
}

@media only screen and (min-width: 576px) {
  .image-mosaic {
    display: flex;
    justify-content: space-evenly;
    align-items: top;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1em 0.5em;
  }
  .image-mosaic p img {
    margin-bottom: 0;
  }
}
@media only screen and (min-width: 1200px) {
  body {
    font: 1.5em/1.62 "Poppins", sans-serif;
  }
  .button-group {
    margin-bottom: 1em;
  }
  .button-group p a {
    margin-bottom: 0;
  }
  .fixed-nav-buttons div {
    right: 40px;
  }
  .fixed-nav-buttons #goto-top {
    margin-bottom: 135px !important;
  }
  .fixed-nav-buttons #go-back {
    margin-bottom: 65px !important;
  }
  #main ul {
    padding-left: 3rem;
  }
  #main ul.decorated-list li {
    padding-left: 0.5rem;
    line-height: 2.2rem;
  }
}
h1, h2, h3, h2.h2-as-h3 {
  font-family: "Literata", serif;
}

h1 {
  font-size: 1.9em;
  line-height: 1.25em;
}

h2 {
  font-size: 1.7em;
  border-bottom: var(--border-h2);
  display: inline;
  padding-bottom: 0.05em;
}

h2.h2-as-h3 {
  border: 0;
}

.h3, h3, h2.h2-as-h3 {
  font-size: 1.25em;
  margin: 0.6em 0 0 0;
  line-height: 1.25em;
}

.sm-text {
  font-size: 0.85em;
}

/* Tipografia Libre Baskerville */
@font-face {
  font-family: "Libre Baskerville";
  src: url("/assets/fonts/libre-baskerville/LibreBaskerville-Bold.otf") format("opentype");
  font-weight: bold;
  font-style: normal;
}
@font-face {
  font-family: "Libre Baskerville";
  src: url("/assets/fonts/libre-baskerville/LibreBaskerville-Italic.otf") format("opentype");
  font-weight: normal;
  font-style: italic;
}
@font-face {
  font-family: "Libre Baskerville";
  src: url("/assets/fonts/libre-baskerville/LibreBaskerville-Regular.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: "Literata";
  src: url("/assets/fonts/literata/Literata-Bold.ttf") format("TrueType");
  font-weight: bold;
  font-style: normal;
}
@font-face {
  font-family: "Literata";
  src: url("/assets/fonts/literata/Literata-Italic.ttf") format("TrueType");
  font-weight: normal;
  font-style: italic;
}
@font-face {
  font-family: "Literata";
  src: url("/assets/fonts/literata/Literata-Regular.ttf") format("TrueType");
  font-weight: normal;
  font-style: normal;
}
/* Tipografia Poppins */
@font-face {
  font-family: "Poppins";
  src: url("/assets/fonts/poppins/Poppins-Bold.otf") format("opentype");
  font-weight: bold;
  font-style: normal;
}
@font-face {
  font-family: "Poppins";
  src: url("/assets/fonts/poppins/Poppins-Italic.otf") format("opentype");
  font-weight: normal;
  font-style: italic;
}
@font-face {
  font-family: "Poppins";
  src: url("/assets/fonts/poppins/Poppins-Regular.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
}
header {
  overflow: hidden;
}
header .sm-screen-only {
  display: initial;
}
header .lg-screen-only {
  display: none;
}
header a.brand > img {
  padding: 10px 0 0 10px;
}
header nav#menu {
  display: none;
  margin: 0;
  padding: 0;
  vertical-align: top;
}
header nav#menu ul {
  margin-top: 6px;
}
header nav#menu li[id=lang-selector].dropdown {
  cursor: pointer;
}
header nav#menu li[id=lang-selector].dropdown img {
  padding: 0;
}
header nav#menu li[id=lang-selector].dropdown > .dropdown-content {
  display: none;
}
header nav#menu .dropdown-content {
  display: contents;
  margin-top: -0.75rem;
}
header nav#menu .dropdown-content#languages {
  display: none;
}
header nav#menu a, header nav#menu li[id=lang-selector].dropdown span {
  color: white;
  padding: 8px 0px;
  text-decoration: none;
  font-size: 17px;
  display: block;
}
header #sm-header-icons {
  position: absolute;
  right: 1rem;
  top: 1.55rem;
}
header #sm-header-icons svg {
  color: var(--menu-text);
}
header .sm-screen-only a {
  display: inline-block !important;
}
header .sm-screen-only a:last-child {
  margin-left: 20px;
}

@media only screen and (min-width: 1200px) {
  header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    height: 105px;
    padding-left: 2rem;
    padding-right: 2rem;
  }
  header a.brand > img {
    padding-left: 0;
    height: 100px;
  }
  header .sm-screen-only {
    display: none !important;
  }
  header .lg-screen-only {
    display: initial;
  }
  header nav#menu {
    list-style: none;
    padding: 0;
    display: inline-block !important;
  }
  header nav#menu ul {
    display: flex;
    justify-content: center;
    margin-top: 32px;
  }
  header nav#menu ul li {
    display: inline-block;
  }
  header nav#menu ul li:not(#lang-selector) {
    /* First level menu items */
  }
  header nav#menu ul li:not(#lang-selector) > a:first-child {
    padding: 0 16px;
    margin-top: -6px;
    text-decoration: none;
    font: 0.98em "Literata", serif;
    text-align: center;
  }
  header nav#menu ul li:not(#lang-selector) > a.toggle-theme {
    margin-top: -2px;
  }
  header nav#menu ul li[id=lang-selector] {
    margin-right: 16px;
    margin-top: -6px;
  }
  header nav#menu ul li.lg-screen-only a {
    padding-right: 0 !important;
  }
  header nav#menu .dropdown:hover > .dropdown-content {
    display: block;
    z-index: 99;
  }
  header nav#menu .dropdown-content {
    margin-top: -2px;
  }
  header nav#menu .dropdown-content#languages {
    margin-top: -14px;
  }
  header nav#menu .dropdown-content {
    padding: 14px 16px;
    background-color: var(--nav-menu-dropdown-bg);
  }
  header nav#menu .dropdown-content a {
    color: var(--nav-menu-dropdown-color);
    margin: 0 -1rem;
    padding: 0.5rem 1rem 0.5rem 1rem;
  }
  header nav#menu .dropdown-content {
    display: none;
    position: absolute;
    z-index: 1;
    min-width: 150px;
  }
}
footer {
  min-width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9em;
  position: absolute;
  bottom: 0;
  height: auto;
}
footer > div:not(:first-child) {
  margin-top: 1em;
}
footer > div:last-child {
  display: flex;
  align-items: center;
  margin-top: 1.25em;
}
footer > div:last-child img {
  height: 28px;
  margin-right: 0.25em;
}
footer a:link, footer a:visited {
  color: var(--white);
}
footer img {
  vertical-align: sub;
  padding-right: 0.25rem;
  height: 16px;
}

@media only screen and (min-width: 768px) {
  footer {
    padding: 0.75rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  footer > div:not(:first-child) {
    margin-top: 0;
  }
  footer > div:nth-child(2) {
    text-align: center;
  }
}