/* ===== VARIABLES DE COLOR ===== */
:root {
  --azul-mar: #003366;
  --azul-claro: #4a90e2;
  --arena: #f4e1c1;
  --coral: #ff6f61;
  --blanco: #ffffff;
  --gris-suave: #f5f5f5;
  --fondo-tarjeta: #e4eff5;
  --texto: #333333;
  --tipografia: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}


/* ===== RESET ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== ACCESIBILIDAD ===== */


nav ul li a:focus {
  outline: 2px solid var(--coral);
  transition: outline 0.2s ease;
}


/* ===== INTRODUCTORIA ===== */

.intro {
  background-color: var(--gris-suave);
  color: var(--azul-claro);
  padding: 1rem;
  text-align: center;
  max-width: 800px;
    width: 100%;
    margin: 0 auto;
}

.intro h3 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: var(--azul-mar);
}

.intro p {
  font-size: 1rem;
  max-width: 700px;
  margin: 0 auto 2rem;
}

.intro-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.btn-inline {
  background-color: var(--coral);
  color: var(--blanco);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.3s ease;
  white-space: nowrap;
}

.btn-inline:hover {
  background-color: var(--azul-claro);
  color: var(--blanco);
}





/* ===== ESTILOS BASE ===== */
body {
  font-family: var(--tipografia);
  font-size: 16px;
  line-height: 1.6;
  color: var(--texto);
  background-color: var(--gris-suave);
}

h1, h2, h3, h4 {
  color: var(--arena);
  font-weight: 700;
}

a {
  color: var(--azul-claro);
  text-decoration: none;
}

a:hover {
  color: var(--coral);
}

/* ===== HEADER Y MENÚ ===== */
header {
  background: var(--azul-mar);
  color: var(--blanco);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  position: relative;
  flex-wrap: wrap;

}

header h1 {
  font-size: 1.5rem;
  letter-spacing: 1px;
  flex: 1 1 auto;
}

/* Menú de navegación */
nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

nav ul li a {
  color: var(--blanco);
  font-weight: 500;
}

p, h1, h2, h3, h4, a {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

img {
  max-width: 100%;
  height: auto;
  background-color: var(--blanco);
}


table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  background-color: var(--blanco);
}

th, td {
  padding: 0.75rem;
  border: 1px solid var(--gris-suave);
  text-align: left;
  vertical-align: top;
}

thead {
  background-color: var(--azul-mar);
  color: var(--blanco);
}

tbody tr:nth-child(even) {
  background-color: var(--gris-suave);
}


/* Botón hamburguesa */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  background: none;
  border: none;
  margin-left: auto;
  flex: 0 0 auto;
  transition: transform 0.3s ease;
}

.hamburger span {
  height: 3px;
  width: 25px;
  background: var(--blanco);
  margin: 4px 0;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Estado transformado (hamburguesa -> X) */
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* ===== HERO SECTION ===== */
.hero {
  background: linear-gradient(rgba(0, 51, 102, 0.6), rgba(0, 51, 102, 0.6)),
              url('../images/almadraba/EsquemaAlmadraba.png') center/cover no-repeat;
  color: var(--blanco);
  text-align: center;
  padding: 6rem 1rem;
}

.hero h2 {
  font-size: 2.5rem;
}

.hero p {
  font-size: 1.2rem;
  margin: 1rem 0;
}

.btn {
  background-color: var(--coral);
    color: var(--blanco);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.3s ease;
    white-space: nowrap;
}

.btn:hover {
  background: var(--azul-claro);
  color: var(--blanco);
}

/* ===== FOOTER ===== */
footer {
  background: var(--azul-mar);
  color: var(--blanco);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.9rem;
}

/* ===== CONTENIDO PROCESO ===== */

.contenido-proceso {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem;
  background-color: var(--gris-suave);
  color: var(--texto);
}

.contenido-proceso h2 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--azul-mar);
}

.contenido-proceso h3 {
  font-size: 1.2rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--azul-claro);
}

.contenido-proceso p {
  margin-bottom: 1rem;
  font-size: 1rem;
  line-height: 1.6;
}

.contenido-proceso * {
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

.contenido-proceso img,
.contenido-proceso iframe {
  background-color: var(--blanco);
  max-width: 100%;
  height: auto;
}


/* ===== INFOGRAFÍA ===== */

.infografia {
  margin: 2rem auto;
  text-align: center;
}

.infografia figcaption {
  font-size: 0.85rem;
  color: var(--texto);
  margin-top: 0.5rem;
  font-style: italic;
}

/* ===== RESPONSIVE ===== */

@media (prefers-color-scheme: dark) {
  .tarjeta {
    background-color: #e4eff5;
  }
}

@media (max-width: 900px) {

  .hamburger {
    display: flex;
  }


  nav ul {
    display: none;
    flex-direction: column;
    background: var(--azul-mar);
    position: absolute;
    top: 70px;
    right: 0;
	left: auto;
    width: 220px;
	max-width: 100vw;
    padding: 1rem;
	transition: opacity 0.3s ease;
	overflow-x: auto;
  }

  nav ul.active {
    display: flex;
  }
  
  nav ul li a {
    white-space: normal;
    word-break: break-word;
  }
}


/* ===== BLOQUE DE VÍDEO INCRUSTADO ===== */

.video-block {
	max-width: 800px;
	  width: 100%;
	  margin: 0 auto;
	  padding: 1rem;
  text-align: center;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%; /* proporción 16:9 */
  height: 0;
  overflow: hidden;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  max-width: 800px;
  width: 100%;
  height: 100%;
}

.video-block figcaption {
  font-size: 0.85rem;
  color: var(--texto);
  margin-top: 0.5rem;
  font-style: italic;
}


/* ===== VÍDEO BAJO DEMANDA ===== */

.video-lazy{
	text-align: center;
}

.video-lazy button {
	display: block; /* cambia de inline-block a block para ocupar toda la línea */
		  margin: 1.5rem auto 0 auto; /* margen superior + centrado horizontal */
		  background-color: var(--coral);
		  color: var(--blanco);
		  padding: 0.5rem 1rem;
		  border-radius: 20px;
		  font-size: 0.9rem;
		  font-weight: 600;
		  text-decoration: none;
		  transition: background 0.3s ease;
		  white-space: nowrap;
	  
}

.video-lazy button:hover,
.video-lazy button:focus {
  background-color: var(--azul-claro); /* tono más oscuro */
  color: var(--blanco);
  transform: scale(1.03);
  outline: none;
}

.video-lazy button:active {
  transform: scale(0.98);
}

.video-lazy figcaption {
  font-size: 0.85rem;
  color: var(--texto);
  margin-top: 0.5rem;
  font-style: italic;
}


/* ===== ÍNDICE TEMÁTICO ===== */

.volver-indice {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.9rem;
}


.volver-indice a {
  display: inline-block;
  margin-top: 2rem;
  font-weight: 600;
  background-color: var(--coral);
  color: var(--blanco);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.volver-indice a:hover {
  background-color: var(--azul-claro);
}


/* ===== TARJETAS HISTORIA ===== */

.tarjetas-historia {
  display: grid;
  overflow: visible;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  background-color: var(--gris-suave);
  
}

@media (min-width: 600px) {
  .tarjetas-historia {
    grid-template-columns: repeat(2, 1fr);
  }
}

.tarjeta {
  background-color: #e4eff5;
  min-height: 1px;
  background-image: none;
  isolation: isolate;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.tarjeta .subtitulo {
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--azul-mar);
}

.tarjeta:hover {
  transform: scale(1.02);
}

.tarjeta h3 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--azul-mar);
}

.tarjeta p {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--texto);
}

.tarjeta img{
	width: 90%;
	height: auto;
}

/* ===== INFOGRAfÍA MAPA ===== */

.infografia-mapa {
  background-color: var(--fondo-tarjeta);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.infografia-mapa h3 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: var(--azul-mar);
}

.infografia-mapa ul {
  list-style: none;
  padding: 0;
}

.infografia-mapa li {
  margin-bottom: 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
}


.nav-flotante-movil {
  display: none;
}


/* ===== MENÚ FLOTANTE MÓVIL Y TABLETS ===== */

@media (max-width: 900px) {
  .nav-flotante-movil {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--azul-mar);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.5rem 0;
    box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.2);
    z-index: 1000;
  }

  .nav-flotante-movil button {
    background: none;
    border: none;
    color: var(--blanco);
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s ease;
  }

  .nav-flotante-movil button:hover,
  .nav-flotante-movil button:focus {
    transform: scale(1.2);
    outline: none;
  }

  footer {
    padding-bottom: 4rem; /* espacio para que no lo tape */
    position: relative;
    z-index: 999;
  }
}

/* ===== TABLAS ===== */

.tabla-indice {
  width: 100%;
  border-collapse: collapse;
}

.celda-indice {
  padding-left: 1rem;
}

.celda-subindice {
  padding-left: 2rem;
}


/* ===== IMPRESIÓN DE ALMADRABA ===== */

@media print {
  body {
    background: white;
    color: black;
    font-family: var(--tipografia);
    font-size: 12pt;
    line-height: 1.6;
  }

  header, .nav-flotante-movil, footer, #menu-placeholder {
    display: none !important;
  }

  .contenido-proceso {
    background: white;
    padding: 2rem;
  }

  .contenido-proceso img,
  .contenido-proceso iframe {
    background: white;
    max-width: 100%;
    height: auto;
    page-break-inside: avoid;
  }

  .volver-indice {
    display: none;
  }
  
  iframe,
  button {
    display: none !important;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }

  /* Créditos al final */
  .creditos-pdf {
    margin-top: 4rem;
    font-size: 0.9rem;
    color: #333;
    border-top: 1px solid #ccc;
    padding-top: 1rem;
  }
}

@media screen and (max-width: 600px) {
  .volver-indice a {
    display: inline-block;
    width: auto;
    background-color: var(--coral);
    color: var(--blanco);
    padding: 0.6rem 1rem;
    border-radius: 20px;
    font-size: 1rem;
  }
  
  .tarjeta {
      margin-bottom: 2.5rem;
  }
  
  #tabla .tabla-indice td {
      font-size: 1rem;
  }
  
  .tarjeta h3 {
      font-size: 1.2rem;
  }
  
  .tabla-indice td {
      font-size: 1rem;
      padding: 0.8rem;
  }
  
  .contenido-proceso section {
      margin-bottom: 2.5rem;
  }
  
  .contenido-proceso h3 {
      font-size: 1.2rem;
  }
}

.acceso-usuario {
  text-align: right;
  margin-bottom: 1em;
  font-size: 0.95em;
}
.acceso-usuario a {
  color: var(--coral);
  text-decoration: none;
  margin-left: 1em;
  font-weight: bold;
  padding: 0.3em 0.6em;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.acceso-usuario a:hover {
  background-color: var(--azul-claro);
  color: var(--blanco);
}

form {
  max-width: 500px;
  margin: 2em auto;
  padding: 2em;
  background-color: #fdfaf7;
  border: 2px solid var(--coral, #e6735c);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

form label {
  display: block;
  margin-top: 1em;
  font-weight: bold;
  color: #333;
}

form input[type="text"],
form input[type="email"],
form input[type="password"] {
  width: 100%;
  padding: 0.6em;
  margin-top: 0.3em;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1em;
  background-color: #fff;
}

form button {
  margin-top: 1.5em;
  padding: 0.8em 1.2em;
  background-color: var(--coral, #e6735c);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

form button:hover {
  background-color: var(--azul-claro);
}

.hero-foro {
  background: linear-gradient(rgba(0, 51, 102, 0.6), rgba(0, 51, 102, 0.6));
  color: var(--blanco);
  text-align: center;
  padding: 6rem 1rem;
}

.hero-foro h2 {
  font-size: 2.5rem;
}

.hero-foro p {
  font-size: 1.2rem;
  margin: 1rem 0;
}