@import url("reset.css");

/* Destacado de términos buscados */
#highlight {
  background-color: #0066CC;
  scroll-margin-top: 10rem;
  color: #f1f1f1;
  font-weight: bold;
  padding: 0.2em 0.4em;
  border-radius: 0.3em;
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.6);
  transition: background-color 0.3s ease;
}

/* Main con margen inferior para footer */
main {
  margin-bottom: 10rem;
  padding: 2rem;
  font-family: 'Roboto', sans-serif;
  color: var(--color-texto-principal);
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
  font-size: 1rem;
}

/* Navegación sticky coherente con reset principal */
nav {
  position: sticky;
  top: 0;
  width: 90vw;
  max-width: 900px;
  margin: 0 auto 1rem auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem;
  text-align: center;
  z-index: 1000;
  background: var(--color-header-footer-bg);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 8px var(--color-shadow);
  border: 1px solid var(--color-borde);
  transition: background 0.3s, border-color 0.3s;
}

/* Inputs coherentes con el tema */
input {
  color: var(--color-texto-principal);
  font-family: 'Roboto', sans-serif;
  font-size: 1rem;
  padding: 0.4em 0.8em;
  border-radius: 1.5em;
  border: 1px solid var(--color-borde);
  background: var(--color-fondo-secundario);
  transition: border-color 0.2s ease, box-shadow 0.3s ease;
  cursor: text;
}

input:hover {
  border-color: var(--color-enlace-hover);
  box-shadow: 0 0 5px var(--color-borde);
}

input:focus {
  border-color: var(--color-enlace);
  outline: none;
  box-shadow: 0 0 8px var(--color-enlace);
}

/* Encabezados legibles y formales */
h3,
h4,
h5 {
  margin: 1.2rem 0 0.6rem 0;
  font-family: 'Montserrat', Arial, Helvetica, sans-serif;
  color: var(--color-titulo);
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
  padding-left: 0.4em;
}

/* Resaltar encabezados con id objetivo */
h3:target,
h4:target {
  border: solid 2px var(--color-enlace-hover);
  scroll-margin-top: 13rem;
  border-radius: var(--border-radius);
  padding: 0.75rem 1rem;
  background-color: var(--color-fondo-hover);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Contenedor índice consistente y legible */
#indice {
  width: 90vw;
  max-width: 900px;
  margin: 1rem auto;
  font-family: 'Roboto', sans-serif;
  line-height: 1.6;
}

/* Márgenes para div en índice */
div > div {
  margin-bottom: 1em;
}

/* Enlaces del índice con buena interacción */
div > div > a {
  display: block;
  color: var(--color-enlace);
  text-decoration: none;
  padding-left: 0.6em;
  font-family: 'Montserrat', Arial, Helvetica, sans-serif;
  font-weight: 600;
  border-radius: 0.3em;
  transition: border-color 0.3s, background-color 0.3s, color 0.3s;
  margin-bottom: 0.8em;
}

div > div > a:hover,
div > div > a:focus {
  border-left: 4px solid var(--color-enlace-hover);
  background-color: var(--color-fondo-hover);
  color: var(--color-enlace-hover);
  outline-offset: 4px;
}

/* Subtítulos h3 dentro de div */
div h3 {
  margin: 0.8em 0 0.3em 1.5em;
  color: var(--color-enlace);
  padding-left: 0.4em;
  font-weight: 700;
  font-family: 'Montserrat', Arial, Helvetica, sans-serif;
}

/* Estilo general para enlaces dentro de leyes y contenido legal */
a {
  color: var(--color-enlace);
  font-family: 'Montserrat', Arial, Helvetica, sans-serif;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

a:hover,
a:focus {
  color: var(--color-enlace-hover);
  background-color: var(--color-fondo-hover);
  outline: none;
  border-radius: 0.2em;
  padding: 0 0.15em;
  box-shadow: 0 0 4px var(--color-shadow-hover);
}

/* Ajustes responsivos para mobile */
@media (max-width: 768px) {
  nav {
    width: 100vw;
    border-radius: 0;
  }
  #indice {
    width: 95vw;
  }
  main {
    padding: 1rem;
    margin: 0 0.5rem;
  }
  h3, h4, h5 {
    font-size: 1.1rem;
  }
}

