@import url("https://fonts.googleapis.com/css2?family=Bai+Jamjuree:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;1,200;1,300;1,400;1,500;1,600;1,700&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* scroll bar styles */
body::-webkit-scrollbar {
  width: 0.75em;
}

body::-webkit-scrollbar-track {
  background: transparent;
}

body::-webkit-scrollbar-thumb {
  background-color: #fa0f0f;
}

/* general styles */
body {
  font-family: "Bai Jamjuree", sans-serif;
  background-color: #f1f1f1;
  color: #1a1b22;
  transition: all;
  transition-duration: 0.5s;
  background-image: url(../src/base_img/metallic-textured-background.webp);
  background-size: cover;
}

h2 {
  font-size: 1.5em;
}

h3 {
  color: #fa0f0f;
  text-align: center;
  font-size: 2rem;
  padding: 1em 0;
  text-shadow: 0.05em 0.05em 0.01em rgba(0, 0, 0, 0.3);
}

h5 {
  color: #fa0f0f;
  margin-bottom: 0.5em;
}

body {
  display: grid;
  grid-template-columns: 110px 3fr;
  grid-template-rows: 140px 1fr 1fr;
  grid-template-areas:
    "header header header"
    "navigation content content"
    "footer footer footer";
}

header {
  background-image: url(../src/base_img/flag-transparent2.webp);
  background-size: cover;
  grid-area: header;
}

a {
  color: #fa0f0f;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
}

p {
  font-weight: 500;
  font-size: 1rem;
}

h1 {
  font-size: 5rem;
  background-size: cover;
  color: #fa0f0f;
  text-align: center;
  padding: 0.25em;
  filter: drop-shadow(0.05em 0.05em 0.01em rgba(0, 0, 0, 0.3));
}

.nav-list {
  grid-area: navigation;
  list-style: none;
  padding: 0 1em;
  height: 100%;
  margin-top: 9rem;
  position: fixed;
  border-top: 1em solid transparent;
}

.container-btn-mode {
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 2px solid #fa0f0f;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 0.5em;
}

.nav-item>a {
  margin-top: 3em;
  text-decoration: underline;
  color: #fa0f0f;
  font-weight: 600;
}

.nav-item a:hover {
  color: #b30b0b;
  text-decoration: underline;
}

.btn-mode {
  color: #1a1b22;
}

#id-sun,
#id-moon {
  padding: 0 0.5em;
  padding-left: 0;
}

main {
  grid-area: content;
  height: 100vh;
}

footer {
  grid-area: footer;
  margin: 2em 0;
  text-align: center;

}

/* dark mode styles */

.dark-mode,
.dark-mode .navbar>ul {
  background-color: #30323e;
  color: #f1f1f1;
  transition: background-color 0.5s;
  background-image: url(../src/base_img/black-smooth-textured-background.webp);
}

.dark-mode .nav-item a:hover {
  color: #f1f1f1;
  font-weight: 400;
}

.dark-mode div img {
  background-color: #4f5366;
}

.dark-mode p,
.dark-mode,
.dark-mode #about {
  color: #f1f1f1;
  text-shadow: 0.1em 0.1em 0.1em rgba(0, 0, 0, 0.6);
}

.dark-mode .btn-mode {
  /* border: 1px solid #fa0f0f; */
  color: #f1f1f1;
}

.dark-mode #id-sun {
  opacity: 1;
}

.dark-mode #id-moon {
  opacity: 0.3;
}

span img {
  height: 1em;

}

/* media queries */
@media (min-width: 1024px) {
  #feed-news {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 90%;
  }

  .container-races {
    grid-template-columns: repeat(4, 1fr);
  }

  .container-constructors {

    display: grid;
    grid-template-columns: repeat(5, 2fr);
    align-items: center;
    justify-content: center;

  }

  article {
    width: 60vw;
    height: auto;
  }

  .article-image {
    height: 200px;
  }

  .driver-card,
  .constructor-card {
    width: 25%;

  }

  .race {
    height: auto;
  }

}


@media (max-width: 1024px) {
  .navbar>h1 {
    font-size: 3.25rem;

  }

  #feed-news {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    /* Reduce el espacio entre elementos */
    max-width: 90%;
  }

  article {
    width: 60%;
    /* Ajuste del ancho relativo para pantallas medianas */
    height: fit-content;
  }

  .article-image {
    height: 75px;
  }

  #pilotsInfo {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 1fr 1fr;

  }

  .container-races,
  .container-constructors {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 1fr;

  }

  .driver-card {
    width: 50%;
  }

  .next-race {
    width: 75%;
  }

  .race {
    height: auto;
  }

  .constructor-card {
    width: 50%;
  }

  .next-race {
    width: 75%;
  }

  .race {
    height: auto;
  }

  .about,
  .about p {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .navbar>h1 {
    font-size: 2rem;
  }

  #feed-news {
    grid-template-columns: 1fr;
    /* Cambia a una sola columna */
    gap: 1.5rem;
    /* Ajusta el espacio entre elementos */
    max-width: 95%;
  }

  article {
    width: 60%;
    /* Más ancho en dispositivos móviles */
    height: auto;
  }

  .news-card {
    height: auto;
    /* Ajusta automáticamente la altura */
  }

  .article-image {
    height: 150px;
    /* Reduce el tamaño de la imagen en móviles */
  }

  #pilotsInfo {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: 1fr;
  }

  .container-races,
  .container-constructors {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: 1fr;
    gap: 1em;
  }

  .driver-card,
  .constructor-card {
    width: 80%;
  }

  h3 {
    font-size: 2.1rem;
  }

  .next-race {
    width: 90%;
  }

  .race h4 {
    font-size: 1rem;
  }

  .race {
    width: fit-content;
    height: auto;
    gap: 0.25em;
  }

  .about,
  .about p {
    width: 100%;
  }
}

@media (max-width: 541px) {
  .navbar>h1 {
    font-size: 2.25rem;
  }

  h3 {
    font-size: 2.1rem;
  }

  #feed-news {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1rem auto;
  }

  article {
    width: 70vw;
    height: auto;
  }

  .news-title {
    font-size: 1.25em;
    /* Ajuste de tamaño de fuente */
  }

  .news-date {
    font-size: 0.9em;
    /* Ajuste de tamaño de fuente */
  }

  .article-image {
    width: auto;
    /* Imagen aún más pequeña para pantallas pequeñas */
  }

  #pilotsInfo {
    grid-template-columns: 1fr;
    /* grid-template-rows: 1fr; */
  }

  .container-races,
  .container-constructors {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .driver-card,
  .constructor-card {
    width: fit-content;
    min-width: 200px;
    border-radius: 5px;
  }

  .next-race {
    width: 90%;
  }

  .race h4 {
    font-size: 1rem;
    padding: 0;
  }

  .race {
    height: fit-content;
    width: 100%;
  }

  .about,
  .about p {
    width: 100%;
  }

  footer span {
    display: none;
      }
  
  footer p{
    text-align: center;
  }
}

/* Header animation */

header {
  overflow-x: hidden;
}

@keyframes slidein {
  from {
    transform: translateX(100vw) scaleX(2);
  }

  to {
    transform: translateX(0) scaleX(1);
  }
}

h1 {
  animation: slidein 2s ease-out forwards;
}