/* Reset básico */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Colores */
:root {
  --fondo-1: #f9f9f9;
  --fondo-2: #ffffff;
  --texto: #000000;
  --link: #0056b3;
  --boton-1: #111111;
  --boton-2: #444444;
  --fondo-1o: #1a1a1a;
  --fondo-2o: #2a2a2a;
  --texto-o: #f0f0f0;
  --link-0: #4dabf7;
}

/* Reset y configuración general */
body {
  font-family: "Inter", sans-serif;
  font-size: clamp(0.9rem, 1.1vw + 0.6rem, 1.1rem);
  line-height: 1.55;
  background-color: var(--fondo-1);
  color: var(--texto);
  transition: background-color 0.3s, color 0.3s;
}

/* Encabezados */
h1,
h2,
h3 {
  font-weight: bold;
  text-align: center;
  margin-bottom: 0;
}

h1 {
  font-size: clamp(1.5rem, 2vw + 1rem, 2rem);
  line-height: 1;
}

h2 {
  font-size: clamp(1.25rem, 2vw + 0.5rem, 1.55rem);
  line-height: 1.0909;
}

h3 {
  font-size: clamp(1.1rem, 1.7vw + 0.4rem, 1.4rem);
  line-height: 1.2;
}

/* Logo página */
.logo {
  display: none;
}

.logo img {
  width: 100%;
  max-width: 20rem;
  max-height: 2.5rem;
  height: auto;
  display: block;
  margin: 0 auto;
  object-fit: contain;
}

body:not(.dark-mode) .logo.light-theme,
body.dark-mode .logo.dark-theme {
  display: block;
}

/* Párrafos */
p {
  margin: 1rem auto;
  text-align: center;
  max-width: 35.3125rem;
}

.justificado,
.justificado p {
  text-align: justify;
}
.izquierda {
  text-align: left;
}
.derecha {
  text-align: right;
}
.centrado {
  text-align: center;
}

/* Contenedores */
div {
  margin: 1em 0 auto;
}

.container-1,
.container-2 {
  padding: 2.5rem;
}

.container-2 {
  background-color: var(--fondo-2);
}

.contenido {
  max-width: 38.75rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.separador {
  height: 1rem;
}

.centrado {
  display: flex;
  justify-content: center;
}

/* Listas */
ul,
ol {
  list-style-position: inside;
  padding-left: 1rem;
}

/* Clases utiles */
.grande {
  font-size: 1.2rem;
}
.versalita {
  font-size: 0.9rem;
}
.sinmargen {
  margin: 0 !important;
}
.salto0 {
  margin-top: 0.5rem;
}
.salto1 {
  margin-top: 1.5rem;
}
.salto2 {
  margin-top: 2rem;
}
.salto3 {
  margin-top: 3rem;
}

/* Enlaces */
a {
  color: inherit;
  text-decoration: none;
}

.enlinea {
  color: var(--link);
}

.enlinea:hover,
header a:hover {
  text-decoration: underline;
}

/* Navbar */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem 0;
  max-width: 48rem;
  margin: 0 auto;
}

.nav-izquerda a,
.nav-derecha a {
  font-size: clamp(1rem, 1.2vw + 0.6rem, 1.2rem);
}

.nav-derecha a {
  margin-left: 1.2rem;
}

/* Botón con link */
.link {
  background-color: var(--boton-1);
  border: 0;
  border-radius: 0.33rem;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  font-family: inherit;
  line-height: inherit;
  margin: 1rem;
}

.link a {
  color: var(--texto-o);
  font-size: clamp(1.1rem, 1.5vw + 0.3rem, 1.2rem);
}

.link:hover {
  background-color: var(--boton-2);
}

/* Botón de descarga */
.descarga .link {
  background-color: var(--boton-1);
  color: var(--texto-o);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.8rem 1.5rem;
  font-size: clamp(1rem, 1.2vw + 0.5rem, 1.2rem);
  border: none;
  cursor: pointer;
}

.descarga .link:hover {
  background-color: var(--boton-2);
}

.descarga .icono-descarga {
  display: inline-flex;
  width: 1.5rem;
  height: 1.5rem;
  align-items: center;
}

.descarga .icono-descarga img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  vertical-align: middle;
}

/* Modal */
dialog.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background-color: var(--fondo-1);
  z-index: 1000;
  margin: 0;
  padding: 0;
  border: none;
  width: 100%;
  height: 100%;
}

/* Mostrar cuando tiene el atributo open */
dialog.modal[open] {
  display: flex;
}

dialog.modal .modal-card {
  background-color: var(--fondo-2);
  max-width: 48rem;
  max-height: 80dvh;
  width: 90%;
  overflow-y: auto;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 0 20px var(--fondo-1);
  position: relative;
  animation: modalIn 0.25s ease forwards;
  margin: 0 auto;
}

dialog.modal .cerrar {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 1rem;
  right: 1rem;
  background-color: var(--boton-1);
  border: none;
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

dialog.modal .cerrar:hover {
  background-color: var(--boton-2);
}

dialog.modal .cerrar img {
  width: 1.25rem;
  height: 1.25rem;
}

/* Animaciones */
@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Desactivar scroll */
dialog.modal .modal-card {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
dialog.modal .modal-card::-webkit-scrollbar {
  display: none;
}

/* Botón cambiar tema */
.theme-toggle {
  background-color: var(--boton-1);
  border: none;
  border-radius: 50%;
  width: 2.6rem;
  height: 2.6rem;
  font-size: clamp(1.3rem, 1.5vw + 0.5rem, 1.5rem);
  margin: 0 auto;
  cursor: pointer;
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 1000;
  line-height: 1;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.theme-toggle:hover {
  background-color: var(--fondo-1);
  color: var(--boton-1);
}

/* Modo oscuro */
.dark-mode {
  background-color: var(--fondo-1o);
  color: var(--texto-o);
}

.dark-mode .container-1 {
  background-color: var(--fondo-1o);
}

.dark-mode .container-2 {
  background-color: var(--fondo-2o);
}

.dark-mode .link {
  background-color: var(--boton-2);
}

.dark-mode .link:hover {
  background-color: var(--boton-1);
}

.dark-mode .nav-izquerda a,
.dark-mode .nav-derecha a {
  color: var(--texto-o);
}

.dark-mode .enlinea {
  color: var(--link-0);
}

.dark-mode  dialog.modal {
  background-color: var(--fondo-1o);
}

.dark-mode dialog.modal .modal-card {
  background-color: var(--fondo-2o);
  box-shadow: 0 0 20px var(--fondo-2o);
  color: var(--texto-o);
}

body.dark-mode dialog.modal .cerrar {
  background-color: var(--boton-2);
}

body.dark-mode dialog.modal .cerrar:hover {
  background-color: var(--boton-1);
}

.dark-mode .theme-toggle {
  background-color: var(--fondo-1);
}

.dark-mode .theme-toggle:hover {
  background-color: var(--boton-1);
}
