/* DICIO • MEU • NÁRIO — Beatriz Loureiro, Guilherme Costa, Lucas Palhares, João Barbosa, Sofia Laranjo — FBAUP, Projeto 4.3, 2024 */

/* ================================================= COISAS GERAIS ================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  color: white;
  user-select: none; /* Maioria dos browsers */
  -webkit-user-select: none; /* Safari */
  color-scheme: dark;
}

html {
  position: relative;
  display: block;
  margin: 0;
  background-color: black;
  font-family: "DunbarText Regular", Arial, Helvetica, sans-serif;
  width: 100%;
  height: 100%;
}

body {
  padding-bottom: 1px;
}

/* =================================================== TÍTULOS ====================================================== */
h1 {
  pointer-events: none;
  position: fixed;
  display: inline-block;
  font-family: "DunbarTall ExBold", Arial, Helvetica, sans-serif;
  font-size: 36px;
  text-align: center;
  top: 0;
  left: 10px;
  right: 10px;
  margin: 100px 0 20px 0;
  z-index: 3;
}

h1.title {
  display: block;
  position: absolute;
  margin: 0 auto;
  margin-top: 100px;
}

p {
  text-wrap: pretty;
}

p.subtitle {
  position: absolute;
  text-align: center;
  top: 200px;
  left: 0;
  right: 0;
}

@media screen and (max-width: 700px) {
  h1.title {
    font-size: calc(12px + 4vw);
    max-width: 100%;
  }

  p.subtitle {
    top: calc(150px + 7vw);
  }
}

/* ==================================================== BOTÕES ====================================================== */
/* Botão de texto */
.button-text {
  position: fixed;
  display: inline-block;
  bottom: 0;
  left: 50%;
  translate: -50% 0;
  width: auto;
  background-color: black;
  font-family: "DunbarText Regular";
  text-decoration: none;
  text-transform: lowercase;
  color: white;
  padding: 8px 15px 12px;
  border: 1px solid white;
  border-radius: 50px;
  margin-bottom: 100px;
  z-index: 3;
  transition-duration: 0.25s;
  transition-property: background-color, color;
}

.button-text:hover,
.button-text:focus {
  outline: none;
  color: black;
  background-color: white;
  transition-duration: 0.25s;
  transition-property: background-color, color;
}

/* Botão de imagem */
button {
  border: none;
  position: fixed;
  cursor: pointer;
  display: block;
  position: fixed;
  right: calc(20% - 45px);
  width: 30px;
  height: 30px;
  border: 1px solid white;
  filter: invert(0);
  border-radius: 30px;
  background-color: rgba(0, 0, 0, 0.3);
  transition-duration: 0.2s;
  transition-property: background-color, border-color, filter;
  z-index: 4;

  & img {
    height: 100%;
  }
}

button#submit {
  position: fixed;
  display: block;
  bottom: 50px;
}

button#info,
button#close {
  position: fixed;
  display: block;
  top: 25px;
}

button:hover,
button:focus {
  outline: none;
  filter: invert(1);
  border: 1px solid black;
  background-color: black;
  transition-duration: 0.2s;
  transition-property: background-color, border-color, filter;
}

/* Só para transição, caso os profs queiram :p */
@media screen and (min-width: 700px) and (max-width: 1039px) {
  button#info,
  button#close {
    top: calc(7vw - 25px);
  }
}

@media screen and (min-width: 1040px) {
  button {
    min-width: 30px;
    right: calc(35% - 200px);
  }

  button#info,
  button#close {
    top: 45px;
  }
}

/* ==================================================== LOADING ===================================================== */
span#loading {
  height: 100%;
  width: 100%;
  position: fixed;
  display: block;
  background-color: black;
  z-index: 5;
}

span#loading::after {
  position: fixed;
  display: block;
  width: 50px;
  height: 50px;
  content: "•";
  font-family: Arial, sans-serif;
  font-size: 50px;
  text-align: center;
  animation-name: loading;
  animation-duration: 0.5s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
  animation-direction: alternate-reverse;
}

@keyframes loading {
  0% {
    transform: translate(calc(50vw - 25px), calc(50vh - 25px));
  }
  100% {
    transform: translate(calc(50vw - 25px), calc(50vh - 55px));
  }
}

/* :::::::::::::::::::::::::::::::::::::::::::::::::: BULLET POINTS ::::::::::::::::::::::::::::::::::::::::::::::::: */
span.bullet {
  font-family: Arial, sans-serif;
  font-size: inherit;
  font-weight: inherit;
  padding: 0 calc(0.3em - 3px);
  color: inherit;
}

@media screen and (max-width: 300px) {
  span.bullet {
    padding: 0 0.5vw;
  }
}

/* ================================================== PÁGINA INFO =================================================== */
main section#info-text {
  display: block;
  position: relative;
  width: 90%;
  text-align: center;
  margin: auto;
  margin-top: 300px;

  & p.briefing {
    line-height: 1.75em;
    font-size: calc(1.5em - 5px);
  }
}

main section#info-text section:nth-of-type(2) {
  display: block;
  position: relative;
  text-align: center;
  width: calc(30% + 200px);
  max-width: 100%;
  line-height: 1.75em;
  font-size: calc(1em - 5px);
  margin: auto;
  margin-top: calc(20vw + 10vh - 80px);
  margin-bottom: 50px;

  & p.footer {
    margin-bottom: 20px;
    text-wrap: pretty;
  }

  & span.no-wrap {
    white-space: nowrap;
  }
}

@media screen and (min-width: 900px) {
  main section#info-text section:nth-of-type(2) {
    position: fixed;
    left: 50%;
    translate: -50% 0;
    bottom: 50px;
    margin: 0;
    width: 80%;

    & p.footer {
      margin: 0;
    }
  }
}

/* ================================================= PÁGINA PALAVRA ================================================= */
/* Palavra */
h1#palavra {
  font-size: 56px;
}

/* Sílabas */
p#silabas {
  position: fixed;
  text-align: center;
  font-size: 1.5rem;
  font-family: "DunbarText Bold", sans-serif;
  top: 180px;
  text-align: center;
  left: 0;
  right: 0;
}

@media screen and (max-width: 700px) {
  h1#palavra {
    font-size: calc(40px + 2vw);
    max-width: 100%;
  }

  p#silabas {
    font-size: calc(1.3rem + 0.5vw);
    top: calc(160px + 3vw);
  }
}

/* Imagem */
img#imagem {
  position: fixed;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background-color: #111111;
  z-index: -1;
}

/* Sombra nas margens do site (para a imagem) */
body::after {
  position: fixed;
  display: block;
  width: 100%;
  height: 100%;
  content: "";
  background: none;
  box-shadow: inset 0 0 100px 25px black;
  z-index: -1;
}

/* Etiqueta para entrada do significado */
label {
  position: fixed;
  display: block;
  bottom: 150px;
  left: 50%;
  translate: -50% 0;
  width: 60%;
  max-width: 630px;
  height: 40px;
  padding: 5px;
  background-color: white;
  color: black;
  font-family: "DunbarText Bold";
  text-transform: lowercase;
  text-align: center;
  font-size: 1.25rem;
  border-radius: 5px 5px 0 0;
}

/* Entrada do significado */
textarea {
  position: absolute;
  display: block;
  bottom: 0;
  left: 50%;
  translate: -50% 0;
  background-color: rgba(0, 0, 0, 0.3);
  resize: none;
  color: white;
  border: 1px solid white;
  margin-bottom: 50px;
  width: 60%;
  height: 100px;
  max-width: 630px;
  font-size: 0.85em;
  font-family: "DunbarText Regular";
  padding: 10px;
  outline: none;
  border-radius: 0 0 5px 5px;
}

/* =============================================== PÁGINA ARQUIVO =================================================== */
/* ----------------------------------------------- CONTAINER GERAL -------------------------------------------------- */
div#container {
  display: flex;
  position: relative;
  flex-wrap: wrap;
  justify-content: center;
  width: calc(65% + 50px);
  text-align: center;
  margin: 0 auto;
  margin-top: 200px;
  margin-bottom: 160px;
  gap: 30px 40px;
  color: black;
  flex-grow: 1;
  z-index: 2;
}

/* Gradiente superior (para o scroll) */
div#container::before {
  pointer-events: none;
  position: fixed;
  display: block;
  width: 100%;
  height: 200px;
  left: 0;
  top: 0;
  content: "";
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 1) 30%,
    rgba(0, 0, 0, 0.8) 60%,
    rgba(0, 0, 0, 0.5) 80%,
    rgba(0, 0, 0, 0) 100%
  );
  z-index: 1;
}

/* Gradiente inferior (para o scroll) */
div#container::after {
  pointer-events: none;
  position: fixed;
  display: block;
  width: 100%;
  height: 150px;
  left: 0;
  bottom: 0;
  content: "";
  background: linear-gradient(
    0deg,
    rgba(0, 0, 0, 1) 30%,
    rgba(0, 0, 0, 0.8) 60%,
    rgba(0, 0, 0, 0.5) 80%,
    rgba(0, 0, 0, 0) 100%
  );
}

/* -------------------------------------------- CONTAINER DE CADA PALAVRA ------------------------------------------- */
div#container div {
  width: 100%;
  max-width: 260px;
  height: 190px;
  background-color: white;
  position: relative;
  display: block;
  border: 1px solid white;
  border-radius: 5px;
}

/* O mais recente fica realçado */
div#container div:first-of-type {
  box-shadow: 0 0 20px 10px #555555;
}

/* Palavra */
div#container div h3 {
  position: relative;
  display: inline-block;
  text-transform: lowercase;
  text-align: center;
  width: 100%;
  padding: 5px;
  background-color: white;
  color: black;
  height: 40px;
  border-radius: 5px 5px 0 0;
  transition: 0.25s opacity;
  opacity: 1;
}

/* Sílabas */
div#container div h3:nth-of-type(2) {
  position: absolute;
  left: 0;
  opacity: 0;
  font-family: "DunbarText Regular", sans-serif;
  font-weight: 700;
}

div#container div:hover h3:nth-of-type(2),
div#container div:focus-visible h3:nth-of-type(2) {
  opacity: 1;
}

/* Imagem */
div#container div img {
  position: relative;
  display: block;
  width: 100%;
  height: calc(100% - 40px);
  object-fit: cover;
  border-radius: 0 0 5px 5px;
}

/* Significado */
div#container div p {
  position: absolute;
  display: block;
  word-wrap: break-word;
  opacity: 0;
  color: white;
  bottom: 0;
  font-family: "DunbarText Regular", sans-serif;
  font-size: 0.85em;
  width: 100%;
  height: calc(100% - 40px);
  background-color: rgba(0, 0, 0, 0.8);
  padding: 15px;
  text-align: start;
  transition: 0.25s opacity;
  border-radius: 0 0 5px 5px;
}

div#container div:hover p,
div#container div:focus-visible p {
  position: absolute;
  display: block;
  opacity: 100%;
  transition: 0.25s opacity;
}

/* ================================================= OUTRAS COISAS ================================================== */
/* --------------------------------------------------- SCROLLBAR ---------------------------------------------------- */
/* Tamanho da scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

/* Cor do fundo da scrollbar */
::-webkit-scrollbar-track {
  background: transparent;
  padding: 3px;
}

/* Cor do botão da scrollbar */
::-webkit-scrollbar-thumb {
  background: #555555;
  border-radius: 20px;
}

/* Cor do canto da scrollbar (onde a horizontal e vertical se encontram) */
::-webkit-scrollbar-corner {
  background-color: transparent;
}

/* -------------------------------------------------- PLACEHOLDER --------------------------------------------------- */

::placeholder, /* Maioria dos browsers */
::-ms-input-placeholder /* Firefox */ {
  color: white;
  opacity: 0.5;
}

::selection, /* Maioria dos browsers */
::-moz-selection /* Cor da seleção no Firefox */ {
  color: black;
  background: white;
}

/* ============================================= FONTES TIPOGRÁFICAS ================================================ */
@font-face {
  font-family: "DunbarTall ExBold";
  src: url("fonts/DunbarTall-ExtraBold.woff2"),
    url("fonts/DunbarTall-ExtraBold.woff") format("woff"),
    url("fonts/DunbarTall-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
}

/* @font-face {
  font-family: "DunbarLow Light";
  src: url("fonts/DunbarLow-Light.woff2"),
    url("fonts/DunbarLow-Light.woff") format("woff"),
    url("fonts/DunbarLow-Light.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "DunbarLow Medium";
  src: url("fonts/DunbarLow-Medium.woff2"),
    url("fonts/DunbarLow-Medium.woff") format("woff"),
    url("fonts/DunbarLow-Medium.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
} */

@font-face {
  font-family: "DunbarText Regular";
  src: url("fonts/DunbarText-Regular.woff2"),
    url("fonts/DunbarText-Regular.woff") format("woff"),
    url("fonts/DunbarText-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "DunbarText Bold";
  src: url("fonts/DunbarText-Bold.woff2"),
    url("fonts/DunbarText-Bold.woff") format("woff"),
    url("fonts/DunbarText-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
}
