/* ============================================================= */
/*  ESTILOS GENERALES DE UNA TRIBU DIFERENT                     */
/* ============================================================= */

:root {
  --color-principal: #0077b6;
  --color-secundario: #00b4d8;
  --color-fondo: #f7f9fc;
  --color-texto: #003049;
  --color-acento: #ffb703;
}

body {
  margin: 0;
  font-family: "Atkinson Hyperlegible", Arial, sans-serif;
  background-color: var(--color-fondo);
  color: var(--color-texto);
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3 {
  font-weight: 700;
  color: var(--color-texto);
}

/* ============================================================= */
/* CABECERA COMPACTA Y NAVEGACIÓN                                */
/* ============================================================= */

.site-header {
  background-color: var(--color-principal);
  color: #fff;
  width: 100%;
}

.header-inner {
  padding: 0.6rem 1rem;
}

/* ====== Bloque superior ====== */
.brand-and-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand h1 {
  font-size: 1.4rem;
  margin: 0;
  color: #fff;
}

.logo {
  width: 45px;
  height: auto;
}

/* ====== Iconos sensoriales ====== */
.top-controls {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.control-btn {
  background: #fff;
  border: none;
  border-radius: 10px;
  padding: 4px 6px;
  cursor: pointer;
  font-size: 1.2rem;
  transition: transform 0.2s ease, background 0.2s ease;
}
/* 🔹 Mantiene azul cuando el modo está activo */
.control-btn:hover,
.control-btn.modo-activo {
  outline: 2px solid white !important;
  background-color: #b3e0ff !important;
}

/* 🔹 Elimina el azul automático del navegador */
.control-btn:focus {
  outline: none;
}


/* ====== Tooltip accesible ====== */
.control-btn {
  position: relative;
}

.control-btn::after {
  content: attr(title);
  position: absolute;
  bottom: -36px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.control-btn:hover::after,
.control-btn:focus::after {
  opacity: 1;
}

/* ====== Botón hamburguesa ====== */
.menu-toggle {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  display: none;
  margin-left: 0.5rem;
}

/* ====== Menú principal ====== */
.main-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.main-nav a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 0.3rem 0.8rem;
  border-radius: 6px;
}

.main-nav a:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* ============================================================= */
/* SECCIÓN PRINCIPAL                                             */
/* ============================================================= */

.main-content {
  padding: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}


.hero {
  margin: 0;
  border-radius: 0;
}


.hero h2 {
  font-size: 1.8rem;
  color: var(--color-principal);
}

.hero p {
  max-width: 700px;
  margin: 0 auto 1rem;
  line-height: 1.6;
}

.btn-primary {
  background-color: var(--color-principal);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.3s ease;
}

.btn-primary:hover {
  background-color: var(--color-secundario);
}

/* ============================================================= */
/* TARJETAS Y SECCIONES INFORMATIVAS                             */
/* ============================================================= */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.2rem;
}

.feature-card {
  background-color: #fff;
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.feature-card:hover {
  transform: scale(1.02);
}

.feature-card i {
  font-size: 2rem;
  color: var(--color-principal);
  margin-bottom: 0.5rem;
}

/* ============================================================= */
/* PIE DE PÁGINA                                                 */
/* ============================================================= */

.site-footer {
  text-align: center;
  padding: 1.2rem;
  background-color: var(--color-principal);
  color: #fff;
  margin-top: 2rem;
  font-size: 0.95rem;
}

.footer-links a {
  color: #fff;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* ============================================================= */
/* BANNER DE MODOS SENSORIALES                                   */
/* ============================================================= */

.mode-banner {
  display: none;
  position: fixed;
  top: 10px;
  right: 10px;
  background: #fff;
  border-left: 5px solid var(--color-principal);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  max-width: 250px;
  font-size: 0.9rem;
}

.mode-banner.visible {
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: fadeIn 0.3s ease;
}

#close-banner {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
}

/* ============================================================= */
/* MODOS SENSORIALES (COLORES Y TIPOS)                           */
/* ============================================================= */

body.modo-tranquilo {
  background-color: #dfeef3;
  color: #002d47;
}

body.modo-colorido {
  background-color: #fff8e1;
  color: #3b0068;
}

body.modo-facil {
  background-color: #fff;
  color: #000;
  font-size: 1.1rem;
}

body.modo-contraste {
  background-color: #000;
  color: #fff;
}

body.modo-dislexia {
  font-family: "OpenDyslexic", Arial, sans-serif;
  line-height: 1.7;
}

/* ============================================================= */
/* BOTÓN FLOTANTE DE AUDIO                                       */
/* ============================================================= */

#floating-reader {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 65px;
  height: 65px;
  border-radius: 50%;
  border: none;
  background: var(--color-principal);
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, background 0.3s ease;
  z-index: 10000;
}

#floating-reader:hover,
#floating-reader:focus {
  background: var(--color-secundario);
  transform: scale(1.08);
}

/* ============================================================= */
/* MENÚ RESPONSIVO (MÓVIL / TABLET)                              */
/* ============================================================= */

@media (max-width: 900px) {
  .brand-and-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .top-controls {
    justify-content: center;
    width: 100%;
    margin-top: 0.4rem;
  }

  .menu-toggle {
    display: block;
    align-self: flex-end;
    margin-top: 0.5rem;
  }

  .main-nav {
    display: none;
    flex-direction: column;
    background: #006ba1;
    width: 100%;
    padding: 1rem;
    border-radius: 0 0 10px 10px;
  }

  .main-nav.open {
    display: flex;
    animation: slideDown 0.25s ease forwards;
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* ============================================================= */
/* ANIMACIONES SUAVES Y ACCESIBLES                               */
/* ============================================================= */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ====== BANNER DE COOKIES ====== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #fff;
  border-top: 3px solid var(--color-principal);
  color: var(--color-texto);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 10000;
  text-align: center;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.cookie-banner.hidden {
  display: none;
}

.cookie-banner p {
  margin: 0 0 0.5rem 0;
  font-size: 0.95rem;
  max-width: 700px;
}

.cookie-link {
  color: var(--color-principal);
  font-weight: 600;
}

.btn-accept {
  background: var(--color-principal);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.3s ease;
}

.btn-accept:hover {
  background: var(--color-secundario);
}

/* ====== MENÚ FLOTANTE ====== */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  z-index: 900;
}

.menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Panel flotante */
.main-nav-float {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 320px;
  height: 100%;
  background: #006ba1;
  color: #fff;
  padding: 1rem;
  box-shadow: -4px 0 12px rgba(0, 0, 0, 0.3);
  transition: right 0.3s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.main-nav-float.active {
  right: 0;
}

.main-nav-float ul {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.main-nav-float a {
  color: #fff;
  font-weight: 600;
  font-size: 1.1rem;
  text-decoration: none;
}

/* ====== EFECTO HOVER AZUL TRANSLÚCIDO (como antes) ====== */
.main-nav-float a {
  display: block;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.main-nav-float a:hover,
.main-nav-float a:focus {
  background: rgba(255, 255, 255, 0.25);
  transform: translateX(4px);
  color: #fff;
}


/* Botón cerrar */
.close-menu {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  align-self: flex-end;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.close-menu:hover {
  transform: scale(1.1);
}

/* ====== MENÚ DE ESCRITORIO Y FLOTANTE ====== */

/* En pantallas grandes: mostrar menú horizontal */
@media (min-width: 901px) {
  .main-nav {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    background: transparent;
  }

  .main-nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    transition: background 0.2s ease, transform 0.2s ease;
  }

  .main-nav a:hover,
  .main-nav a:focus {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
  }

  /* Ocultar menú flotante y overlay */
  .main-nav-float,
  .menu-overlay,
  .menu-toggle {
    display: none !important;
  }
}

/* En móvil: ocultar menú de escritorio */
@media (max-width: 900px) {
  .main-nav {
    display: none !important;
  }
}

/* ====== ENLACE ACTIVO EN MENÚ (LÍNEA BLANCA) ====== */
.main-nav a.active,
.main-nav-float a.active {
  position: relative;
  color: #fff;
}

.main-nav a.active::after,
.main-nav-float a.active::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: #fff; /* línea blanca */
  border-radius: 2px;
}
/* ============================================================= */
/* 🔳 AJUSTE PARA MODO ALTO CONTRASTE                            */
/* ============================================================= */

body.modo-contraste {
  background-color: #000 !important;
  color: #fff !important;
}

/* Recuadros principales (tarjetas, secciones, banners, paneles, etc.) */
body.modo-contraste .feature-card,
body.modo-contraste .info-card,
body.modo-contraste .card,
body.modo-contraste .mode-banner,
body.modo-contraste #reader-panel,
body.modo-contraste .cookie-banner,
body.modo-contraste .main-nav-float,
body.modo-contraste .site-footer,
body.modo-contraste .btn-primary {
  background-color: #000 !important;
  color: #fff !important;
  border: 1px solid #fff !important;
  box-shadow: none !important;
}

/* Botones sensoriales en contraste */
body.modo-contraste .control-btn {
  background-color: #000 !important;
  color: #fff !important;
  border: 2px solid #fff !important;
}

body.modo-contraste .control-btn:hover,
body.modo-contraste .control-btn:focus {
  background-color: #fff !important;
  color: #000 !important;
}

/* Enlaces en modo contraste */
body.modo-contraste a {
  color: #00bfff !important;
}

body.modo-contraste a:hover {
  color: #fff !important;
  text-decoration: underline;
}

/* Borde visible en botones principales */
body.modo-contraste .btn-primary {
  border: 2px solid #fff !important;
}

/* Menú flotante y navegación */
body.modo-contraste .main-nav-float a {
  color: #fff !important;
}

body.modo-contraste .main-nav-float a:hover {
  background: rgba(255, 255, 255, 0.2) !important;
}

/* Banners e indicadores */
body.modo-contraste .mode-banner {
  border-left: 5px solid #fff !important;
}
/* Cabecera coherente con el modo alto contraste */
body.modo-contraste .site-header {
  background-color: #000 !important;
  color: #fff !important;
  border-bottom: 1px solid #fff !important;
}

body.modo-contraste .brand h1,
body.modo-contraste .main-nav a {
  color: #fff !important;
}

body.modo-contraste .main-nav a:hover,
body.modo-contraste .main-nav a:focus {
  background: rgba(255, 255, 255, 0.2) !important;
  color: #fff !important;
}

/* ====== Texto del menú principal azul en modo contraste ====== */
body.modo-contraste .main-nav a {
  color: var(--color-principal) !important;
}

/* En hover o foco, invertir colores para mantener legibilidad */
body.modo-contraste .main-nav a:hover,
body.modo-contraste .main-nav a:focus {
  background-color: var(--color-principal) !important;
  color: #fff !important;
}

/* Enlaces del menú principal */
body.modo-contraste .main-nav a {
  color: var(--color-principal) !important;
}

body.modo-contraste .main-nav a:hover,
body.modo-contraste .main-nav a:focus {
  background-color: var(--color-principal) !important;
  color: #fff !important;
}

/* Enlaces del menú flotante */
body.modo-contraste .main-nav-float a {
  color: var(--color-principal) !important;
}

body.modo-contraste .main-nav-float a:hover,
body.modo-contraste .main-nav-float a:focus {
  background-color: var(--color-principal) !important;
  color: #fff !important;
}

/* Título y logo de la cabecera */
body.modo-contraste .brand h1 {
  color: var(--color-principal) !important;
}

/* ============================================================= */
/* FORMATO UNIFICADO DEL BOTÓN DE AYUDA (❓)                     */
/* ============================================================= */

/* Mismo formato base que los botones sensoriales */
#btn-help {
  background: #fff;
  color: var(--color-principal);
  border: none;
  border-radius: 10px;
  padding: 4px 6px;
  cursor: pointer;
  font-size: 1.2rem;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

/* Efecto hover/focus */
#btn-help:hover,
#btn-help:focus {
  background: var(--color-secundario);
  color: #fff;
  transform: scale(1.1);
}

/* Activo (cuando el pop-up está abierto) */
#btn-help.modo-activo {
  background: var(--color-principal) !important;
  color: #fff !important;
  box-shadow: 0 0 10px rgba(0, 119, 182, 0.45);
  transform: scale(1.1);
  transition: all 0.25s ease;
}

/* Mismo estilo en modo alto contraste */
body.modo-contraste #btn-help {
  background-color: #000 !important;
  color: #fff !important;
  border: 2px solid #fff !important;
}

body.modo-contraste #btn-help:hover,
body.modo-contraste #btn-help:focus {
  background-color: #fff !important;
  color: #000 !important;
}

body.modo-contraste #btn-help.modo-activo {
  background: #fff !important;
  color: #000 !important;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.9);
}

/* Quitar contorno negro al hacer clic */
#btn-help:focus {
  outline: none !important;
}

/* ============================================================= */
/* SECCIÓN DESTACADA (.hero) - BLOQUE DE BIENVENIDA              */
/* ============================================================= */

.hero {
  background: #ffffff;
  border: 2px solid var(--color-principal);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin: 2rem auto;
  max-width: 900px;
  text-align: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  transition: background 0.3s ease, color 0.3s ease, border 0.3s ease;
}

.hero h2 {
  color: var(--color-principal);
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.hero p {
  color: var(--color-texto);
  font-size: 1.05rem;
  line-height: 1.6;
}

/* En modo alto contraste */
body.modo-contraste .hero {
  background: #000 !important;
  color: #fff !important;
  border: 2px solid #fff !important;
  box-shadow: none !important;
}

body.modo-contraste .hero h2 {
  color: var(--color-principal) !important;
}

body.modo-contraste .hero p {
  color: #fff !important;
}

/* ============================================================= */
/* SECCIÓN DESTACADA (.hero) - BLOQUE DE BIENVENIDA              */
/* ============================================================= */

.hero {
  background: #ffffff;
  border: 2px solid var(--color-principal);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin: 2rem auto;
  max-width: 900px;
  text-align: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  transition: background 0.3s ease, color 0.3s ease, border 0.3s ease;
}

.hero h2 {
  color: var(--color-principal);
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.hero p {
  color: var(--color-texto);
  font-size: 1.05rem;
  line-height: 1.6;
}

/* En modo alto contraste */
body.modo-contraste .hero {
  background: #000 !important;
  color: #fff !important;
  border: 2px solid #fff !important;
  box-shadow: none !important;
}

body.modo-contraste .hero h2 {
  color: var(--color-principal) !important;
}

body.modo-contraste .hero p {
  color: #fff !important;
}

 /* ============================================================= */
/* FORMULARIO DE CONTACTO - ESTRUCTURA Y ESTILO ORIGINAL          */
/* ============================================================= */

/* Estructura general del formulario */
.form-two-column {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem 2rem;
  margin-top: 1.5rem;
}

/* Fila individual */
.form-row,
.form-group {
  display: flex;
  flex-direction: column;
}

/* Etiquetas */
.form-two-column label {
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--color-principal);
}

/* Campos de texto y área */
.form-two-column input,
.form-two-column textarea {
  padding: 0.7rem 0.9rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  font-family: "Atkinson Hyperlegible", Arial, sans-serif;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Efecto al enfocar */
.form-two-column input:focus,
.form-two-column textarea:focus {
  border-color: var(--color-principal);
  box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.2);
  outline: none;
}

/* Campo de texto que ocupa todo el ancho */
.form-group.full-width {
  grid-column: 1 / -1;
}

/* Mensajes de error */
.error-text {
  color: #d32f2f;
  font-size: 0.9rem;
  margin-top: 0.3rem;
  display: block;
}

/* Botón de envío */
.wide-button {
  width: 100%;
  padding: 1rem;
  background: var(--color-principal);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.wide-button:hover,
.wide-button:focus {
  background: var(--color-secundario);
  transform: scale(1.02);
}

/* Adaptación a pantallas pequeñas */
@media (max-width: 768px) {
  .form-two-column {
    grid-template-columns: 1fr;
  }
  .form-group.full-width {
    grid-column: 1;
  }
}

}



/* ============================================================= */
/* BOTONES SENSORIALES ACTIVOS - FORMATO UNIFICADO               */
/* ============================================================= */

.control-btn.modo-activo {
  background: var(--color-principal) !important;
  color: #fff !important;
  border: 2px solid #fff !important;
  box-shadow: 0 0 10px rgba(0, 119, 182, 0.45);
  transform: scale(1.1);
  transition: all 0.25s ease;
}

/* ===== ÚNICA EXCEPCIÓN: modo alto contraste ===== */
body.modo-contraste .control-btn.modo-activo {
  background: #fff !important;
  color: #000 !important;
  border: 2px solid #000 !important;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.9);
}

/* ===== Transición accesible ===== */
@media (prefers-reduced-motion: reduce) {
  .control-btn.modo-activo {
    transition: none !important;
    transform: none !important;
  }
}

/* ============================================================= */
/* Desactivar completamente el tooltip negro            */
/* ============================================================= */
/* 🔇 Desactivar completamente el tooltip negro */
.control-btn::after {
  display: none !important;
  content: none !important;
}

