@font-face {
 font-family: 'OvertheRainbow';
 src: url(../assets/fonts/OvertheRainbow.woff) format('woff');
}

@font-face {
 font-family: 'RobotoCondensed';
 src: url(../assets/fonts/RobotoCondensed.woff) format('woff');
}

@font-face {
 font-family: 'BarlowCondensed';
 src: url(../assets/fonts/BarlowCondensed-Light.woff) format('woff');
}

@font-face {
 font-family: 'SairaCondensed';
 src: url(../assets/fonts/SairaCondensed-Medium.woff) format('woff');
}

@font-face {
 font-family: 'EBGaramond';
 src: url(../assets/fonts/EBGaramond-VariableFont.woff) format('woff');
}

* {
  box-sizing: border-box;
}

body {
  padding: 0;
  background-color: black;
  font-size: 24px;
}

h1 {
  color: rgb(255 255 240);
  text-align: center;
  font-family: OvertheRainbow, serif;
  font-size: 4rem;
  background-color: rgb(140 0 0 / 0.2);
}

nav {
  margin: 0;
  padding: 0;
  display: block;
  align-content: center;
}

nav > ol {
  margin: 0;
  padding: 0;
  height: 7rem;
  display: grid;
  grid-template-columns: repeat(11, minmax(2rem, 3rem));
  justify-content: center;
  align-content: start;
}

nav .tab {
  margin: 0;
  padding: 0;
  list-style-type: none;
  display: grid;
  grid-template-rows: auto;
  grid-gap: 1rem;
  justify-content: center;
  justify-items: center;
  align-items: start;
}

nav .tab .button {
  min-width: 2rem;
  max-width: 3rem;
  overflow: hidden;
  height: 0.5rem;
  background-color: rgb(140 0 160 / 0.5);
  border: 1px solid transparent;
  border-radius: 10px;
}

nav .tab .button:hover, nav .tab .button.highlighted {
  filter: contrast(300%); 
  transform: scale(150%, 70%) rotate(90deg);
}

nav .tab .tooltip {
  display: none;
}

nav .tab .tooltip.visible {
  display: block;
  width: calc(6rem * 4/3);
  height: 6rem;
  background-size: 100%;
  background-position: cover;
  background-repeat: no-repeat;
}

nav .tab#colirrojo-tab .tooltip.visible {
  margin-left: 2.5rem;
}

nav .tab#urraca-tab .tooltip.visible {
  margin-right: 2.5rem;
}

.tab#colirrojo-tab .button {
  background-color: rgb(154 99 56);
}

.tab#herrerillo-tab .button {
  background-color: rgb(107 140 180); 
}

.tab#petirrojo-tab .button {
  background-color: rgb(194 143 43); 
}

.tab#gorrion-tab .button {
  background-color: rgb(111 178 164); 
}

.tab#trepador-tab .button {
  background-color: rgb(99 102 120); 
}

.tab#carbonero-tab .button {
  background-color: rgb(143 141 72); 
}

.tab#mirlo-tab .button {
  background-color: rgb(232 182 99); 
}

.tab#jilguero-tab .button {
  background-color: rgb(143 51 56); 
}

.tab#verdecillo-tab .button {
  background-color: rgb(214 183 8); 
}

.tab#pinzon-tab .button {
  background-color: rgb(99 97 108); 
}

.tab#urraca-tab .button {
  background-color: rgb(232 234 240); 
}

.carousel {
  display: flex;
  overflow: auto;
  margin: 0 2%;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
}

.carousel::-webkit-scrollbar {
  background-color: black; 
}

.carousel::-webkit-scrollbar-thumb {
  background-color: rgb(140 0 160 / 0.8);
}

.carousel > .slide {
  width: 100vw;
  height: calc(100vw * 3/4);
  display: flex;
  flex: none;
  justify-content: center;
  align-items: center; 
  scroll-snap-stop: always;
  scroll-snap-align: center;
  background-color: black;
  background-repeat: no-repeat;
}

.carousel > .slide:focus {
  outline: none;
  border: solid rgb(140 0 160 / 0.7);
}

#birds > .slide:focus {
  border-width: 5px 0;
}

#songs > .slide:focus {
  border-width: 0 5px;
}

#birds > .slide {
  background-size: 95%;
  background-position: center;
}

#songs > .slide {
  display: flex;
  position: relative;
  justify-content: center;
  background-size: 95%;
  background-position: center;
  transform: scale(0.85);
}

@media (600px <= width <= 1200px) {
  .carousel > .slide {
    width: 100vw;
    height: calc(100vw * 3/4);
  }
  #songs > .slide {
    width: 100vw;
    height: calc(100vw * sqrt(2));
  }
}

@media (width > 1200px) {
  .carousel > .slide {
    width: 600px;
    height: calc(600px * 3/4);
  }
  #songs > .slide {
    width: 600px;
    height: calc(600px * sqrt(2));
  }
}

@media (height < 500px) {
  .carousel > .slide {
    height: calc(100vh - 100vh * 0.04);
    width: calc(100vh * 4/3);
  }
  #songs > .slide {
    height: 200vh;
    width: calc(100vh * 4/3);
    background-size: 95% 92%; /*tweak for this special ratio*/
  }
}

#birds > .slide > a {
  width: 100%;
  height: 30%;
  display: flex;
  justify-content: center;
  align-items: center;
}

#birds > .slide > a.animated {
  animation-delay: 0.5s;
  animation-fill-mode: backwards;
  animation-duration: 3s;
  animation-name: animate;
  animation-iteration-count: 1;
  background-image: 
    url(../assets/icons/prev-gf.svg),
    url(../assets/icons/sound-sampler-gf.svg),
    url(../assets/icons/next-gf.svg);
  background-repeat: no-repeat;
  background-size: 4rem;
  background-position: 5%, center, 95%;
  background-color: rgb(140 0 160 / 0.2);
}
   
#birds > .slide.first > a.animated {
  animation-name: animatefirst;
  background-image: 
    url(../assets/icons/sound-sampler-gf.svg),
    url(../assets/icons/next-gf.svg);
  background-position: center, 95%;
}

#birds > .slide.last > a.animated {
  animation-name: animatelast;
  background-image: 
    url(../assets/icons/prev-gf.svg),
    url(../assets/icons/sound-sampler-gf.svg);
  background-position: 5%, center;
}

#birds > .slide > a.decorated {
  background-image: url(../assets/icons/sound-sampler-gf.svg);
  background-repeat: no-repeat;
  background-size: 4rem;
  background-position: center;
  background-color: rgb(140 0 160 / 0.2);
}

#songs > .slide > .links {
  width: 20%;
  height: 10%;
  position: absolute;
  bottom: 3%; 
  right: 3%; 
  display: grid;
  grid-template-columns: repeat(2, 3.5rem);
  justify-content: end;
  align-items: center;
}

#songs > .slide > .links > a {
  width: 3.5rem;
  height: 3.5rem;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  filter: opacity(0.6);
}

#songs > .slide > .links > .song-download {
  order: 1;
  background-image: url(../assets/icons/download-ink-gf.svg);
}

#songs > .slide > .links > .license {
  order: -1;
  background-image: url(../assets/icons/copyright-ink-gf.svg);
  background-size: 85%;
}

#songs > .slide.animated::after {
  width: inherit;
  height: 30%;
  content: "";
  animation-delay: 2s;
  animation-fill-mode: backwards;
  animation-duration: 4s;
  animation-name: animatesong;
  animation-iteration-count: 1;
  background-image: 
    url(../assets/icons/prev-purple-gf.svg),
    url(../assets/icons/next-purple-gf.svg);
  background-repeat: no-repeat;
  background-size: 4rem;
  background-position: 5%, 95%;
  background-color: rgb(140 0 160 / 0.2);
}

#songs > .slide.animated.first::after {
  animation-name: animatesongfirst;
  background-image: url(../assets/icons/next-purple-gf.svg);
  background-position: 95%;
}

#songs > .slide.animated.last::after {
  animation-name: animatesonglast;
  background-image: url(../assets/icons/prev-purple-gf.svg);
  background-position: 5%;
}

@keyframes animate {
  0% {
    opacity: 0;
    background-position: 20%, center, 80%;
  }
  50% {
    opacity: 1;
    background-position: 10%, center, 90%;
  }
  100% {
    opacity: 0;
    background-position: 5%, center, 95%;
  }
}

@keyframes animatefirst {
  0% {
    opacity: 0;
    background-position: center, 80%;
  }
  50% {
    opacity: 1;
    background-position: center, 90%;
  }
  100% {
    opacity: 0;
    background-position: center, 95%;
  }
}

@keyframes animatelast {
  0% {
    opacity: 0;
    background-position: 15%, center;
  }
  50% {
    opacity: 1;
    background-position: 10%, center;
  }
  100% {
    opacity: 0;
    background-position: 5%, center;
  }
}

@keyframes animatesong {
  0% {
    opacity: 0;
    background-position: 20%, 80%;
  }
  50% {
    opacity: 1;
    background-position: 10%, 90%;
  }
  100% {
    opacity: 0;
    background-position: 5%, 95%;
  }
}

@keyframes animatesongfirst {
  0% {
    opacity: 0;
    background-position: 80%;
  }
  50% {
    opacity: 1;
    background-position: 90%;
  }
  100% {
    opacity: 0;
    background-position: 95%;
  }
}

@keyframes animatesonglast {
  0% {
    opacity: 0;
    background-position: 15%;
  }
  50% {
    opacity: 1;
    background-position: 10%;
  }
  100% {
    opacity: 0;
    background-position: 5%;
  }
}

#carbonero {
  background-image: url(../assets/photos/carbonero.jpg);
}

#colirrojo {
  background-image: url(../assets/photos/colirrojo.jpg);
}
#gorrion {
  background-image: url(../assets/photos/gorrion.jpg);
}

#herrerillo {
  background-image: url(../assets/photos/herrerillo.jpg);
}

#jilguero {
  background-image: url(../assets/photos/jilguero.jpg);
}

#mirlo {
  background-image: url(../assets/photos/mirlo.jpg);
}

#petirrojo {
  background-image: url(../assets/photos/petirrojo.jpg);
}

#pinzon {
  background-image: url(../assets/photos/pinzon.jpg);
}

#trepador {
  background-image: url(../assets/photos/trepador.jpg);
}

#urraca {
  background-image: url(../assets/photos/urraca.jpg);
}

#verdecillo {
  background-image: url(../assets/photos/verdecillo.jpg);
}

#carbonero-song {
  background-image: url(../assets/songs/carbonero-song.png);
}

#colirrojo-song {
  background-image: url(../assets/songs/colirrojo-song.png);
}

#gorrion-song {
  background-image: url(../assets/songs/gorrion-song.png);
}

#herrerillo-song {
  background-image: url(../assets/songs/herrerillo-song.png);
}

#jilguero-song {
  background-image: url(../assets/songs/jilguero-song.png);
}

#mirlo-song {
  background-image: url(../assets/songs/mirlo-song.png);
}

#petirrojo-song {
  background-image: url(../assets/songs/petirrojo-song.png);
}

#pinzon-song {
  background-image: url(../assets/songs/pinzon-song.png);
}

#trepador-song {
  background-image: url(../assets/songs/trepador-song.png);
}

#urraca-song {
  background-image: url(../assets/songs/urraca-song.png);
}

#verdecillo-song {
  background-image: url(../assets/songs/verdecillo-song.png);
}

#credits {
  margin: 4rem 0;
  padding: 1rem;
  color: white;
  background-color: rgb(140 0 0 / 0.2);
  font-family: RobotoCondensed, sans-serif;
  font-size: 1rem;
  justify-content: center;
  align-items: center;
}

#credits > p {
  margin: 0;
  padding: 3.5px 0;
  text-align: center;
}  
/*
#credits #author + p::after,
#credits #macaulay::after {
  display: block;
  margin-top: 1rem;
  content: "\1F659";
}
*/
@media (-webkit-min-device-pixel-ratio: 2) {
  #credits {
    font-family: BarlowCondensed, sans-serif;
    font-size: clamp(16px, 2.5vw, 1rem); 
  }
}

@media (width <= 600px) {
  @-moz-document url-prefix() {
    #credits {
      font-size: x-small;
    }
  }
}

#credits a {
  color: white;
  text-decoration-style: solid;
}

#credits a:visited {
  color: white;
}

#credits a:hover {
  color: navajowhite;
}

#manifest {
  display: flex;
  padding: 1rem;
  color: white;
  background-color: rgb(140 0 0 / 0.2);
  font-size: clamp(1rem, 1.5rem, 2rem);
  justify-content: center;
  align-items: center;
}

#manifest dialog {
  width: 70vw;
  height: 80vh; 
  border: 0.5rem solid rgb(140 0 160);
  border-radius: 10px;
  background-color: rgb(250 250 240);
  color: rgb(42 88 115);
  font-family: EBGaramond;
}

#manifest dialog::backdrop {
  background-color: black;
  opacity: 0.8;
}

#manifest #manifest-content {
  hyphens: auto;
}

#manifest p.heading {
  font-weight: bold;
  font-size: 110%;
  text-align: center;
}

#manifest > dialog > button.close {
  width: 2rem;
  height: 2rem;
  position: sticky;
  top: 0; 
  left: 100%;
  background-image: url(../assets/icons/close-purple-gf.svg);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 2rem;
}

#manifest button {
  border: none;
  background-color: rgb(140 0 0 / 0.2);
}

#manifest > #info {
  width: 3rem;
  height: 3rem;
  background-image: url('../assets/icons/info-gf-white.svg');
  background-repeat: no-repeat;
  background-size: 3rem;
  background-position: cover;
}
