/* === CUSTOM ELEMENTS === */
site-header {
  display: block;
  position: sticky;
  top: 0;
  z-index: 100;
  /* Mismo morado que la barra de header y el menú móvil: si al animar el
     desplegable queda algún hueco de subpíxel entre ambos, se ve morado
     (invisible) en vez de dejar ver el blanco de la página de fondo. */
  background-color: #453a7a;
}

site-footer {
  display: block;
}

:root {
  --header-h: 70px;
  --banner-h: 40px;
}

/* === HEADER === */
.site-header {
  background-color: #453a7a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
  height: var(--header-h);
  position: relative;
  overflow: hidden;
}

.header-logo {
  color: #f5f4f2;
  font-weight: 700;
  font-size: 2.25rem;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-link {
  color: #ffffff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 400;
  font-family: 'Inter', sans-serif;
  opacity: 1;
  transition: opacity 0.2s;
}

.nav-link:hover {
  opacity: 0.7;
}

.btn-contacto {
  background-color: #9787f4;
  color: #ffffff;
  font-size: 0.87rem;
  font-weight: 400;
  font-family: 'Inter', sans-serif;
  padding: 0.6rem 1.4rem;
  border-radius: 9999px;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}

.btn-contacto:hover {
  background-color: #ded7f6;
  color: #453a7a;
}

/* === PROMO BANNER === */
@keyframes banner-blink {
  0%,   86.5% { background-color: #ded7f6; }
  88%          { background-color: #9787f4; }
  90%          { background-color: #ded7f6; }
  91.5%        { background-color: #9787f4; }
  93%,  100%   { background-color: #ded7f6; }
}

.promo-banner {
  min-height: var(--banner-h);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ded7f6;
  color: #1b2d58;
  text-align: center;
  padding: 0.5rem clamp(1rem, 4vw, 2rem);
  font-family: 'Inter', sans-serif;
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  animation: banner-blink 15s ease-in-out infinite;
}

.promo-banner-text {
  display: inline-block;
}

.promo-banner-nowrap {
  white-space: nowrap;
}

.promo-banner-link {
  color: #1b2d58;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.2s;
}

.promo-banner-link:hover {
  opacity: 0.7;
}

/* === HAMBURGUESA (MÓVIL) === */
.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #ffffff;
}

/* === MENÚ MÓVIL === */
/* Panel pegado directamente al borde inferior del header (sin hueco, sin
   sombra "flotante"): se superpone al banner promocional y a la página
   (no empuja el contenido), ocupando la mitad derecha de la pantalla,
   con fondo morado (el mismo del botón "Contacto" de escritorio). */
.mobile-menu {
  position: absolute;
  top: var(--header-h);
  right: 0;
  width: 50%;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  background-color: #9787f4; /* Morado, según guía de estilo */
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  padding: 0 1rem;
  gap: 0.35rem;
  z-index: 50;
  transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.3s ease;
}

.mobile-menu.open {
  max-height: 480px; /* Margen amplio sobre el contenido real (4 enlaces) para que nunca recorte el último elemento */
  opacity: 1;
  padding: 1rem;
}

/* Los 4 elementos (Sobre mí, Terapias, Preguntas, Contacto) comparten
   exactamente el mismo formato de fila, sin distinguir "Contacto" como
   píldora aparte. */
.mobile-menu .nav-link,
.mobile-menu .btn-contacto {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 400;
  color: #ffffff;
  background-color: transparent;
  padding: 0.7rem 0.75rem;
  border-radius: 12px;
  transition: background-color 0.2s;
}

.mobile-menu .nav-link:hover,
.mobile-menu .btn-contacto:hover {
  background-color: rgba(69, 58, 122, 0.3);
  color: #ffffff;
  opacity: 1;
}

.nav-link-icon {
  flex-shrink: 0;
  display: inline-flex;
}

/* Textura dedicada a la barra de header + banner en móvil: oculta por
   defecto, solo se activa dentro del media query de móvil (ver más abajo).
   No cubre el desplegable, que ya tiene su propio fondo morado. */
.header-texture-mobile {
  display: none;
  background-size: cover;
  background-position: center;
}

@media (max-width: 768px) {
  .header-nav {
    display: none;
  }

  .hamburger-btn {
    display: flex;
  }

  .header-texture-desktop {
    display: none;
  }

  /* Velo sutil sobre la barra de header y el banner promocional (no sobre
     el desplegable, que tiene su propio fondo lavanda opaco). Va por
     encima (z-index superior) porque header y banner tienen fondo de
     color propio; con opacidad baja y pointer-events:none no bloquea el
     texto ni los enlaces. */
  .header-texture-mobile {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.05;
    z-index: 2;
    pointer-events: none;
  }
}

/* === FOOTER === */
.site-footer {
  background-color: #453a7a;
  padding: clamp(4rem, 7vw, 6rem) clamp(1.25rem, 4vw, 2.5rem);
}

/* Layout de 3 columnas en escritorio: copyright | favicon+redes | políticas */
.footer-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-copyright {
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 400;
  font-family: 'Inter', sans-serif;
  flex: 1;
  min-width: 200px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  flex-shrink: 0;
}

.footer-favicon-link {
  display: inline-block;
}

.footer-favicon {
  height: clamp(76px, 7vw, 96px);
  width: auto;
  display: block;
}

.footer-socials {
  display: flex;
  gap: 0.85rem;
}

.footer-legal {
  display: flex;
  gap: 0.3rem 0;
  flex-wrap: wrap;
  flex: 1;
  min-width: 200px;
  justify-content: flex-end;
}

/* Separador "·" entre enlaces, tanto en el formato largo (ordenador) como en el corto (responsive) */
.footer-legal a:not(:first-child)::before {
  content: '·';
  margin: 0 0.6rem;
  color: #ffffff;
  opacity: 0.6;
}

.footer-nav-link {
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 400;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  opacity: 1;
  transition: opacity 0.2s;
}

.footer-nav-link:hover {
  opacity: 0.7;
}

/* En ordenadores de escritorio grandes se muestra el texto completo; en cualquier pantalla
   más pequeña (móvil, tablet u ordenador pequeño) se usa la versión corta, ver media query */
.footer-nav-short {
  display: none;
}

.footer-col-title {
  display: block;
  font-family: 'BricolageGrotesque', sans-serif;
  font-weight: 700;
  font-size: calc(0.9rem + 5px);
  color: #ffffff;
  margin-bottom: 1.1rem;
}

.footer-social {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  text-decoration: none;
  transition: background-color 0.2s;
}

.footer-social:hover {
  background-color: rgba(255, 255, 255, 0.25);
}

/* Responsive: favicon arriba, redes debajo, políticas debajo, copyright debajo. Todo centrado. */
@media (max-width: 768px) {
  .footer-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-brand {
    order: 1;
  }

  .footer-legal {
    order: 2;
    flex: none;
    min-width: 0;
    justify-content: center;
    text-align: center;
    gap: 1rem 0;
  }

  .footer-copyright {
    order: 3;
    flex: none;
    min-width: 0;
    text-align: center;
  }
}

/* Versión corta de "Aviso legal / Política de privacidad / Política de cookies":
   se activa en cualquier pantalla más pequeña que un ordenador de escritorio
   estándar (incluye portátiles pequeños), no solo en móvil. */
@media (max-width: 1280px) {
  .footer-nav-full {
    display: none;
  }

  .footer-nav-short {
    display: inline;
  }
}

/* ============================================================
   ACCESIBILIDAD: enlace "Saltar al contenido", foco visible,
   texto solo para lectores de pantalla y movimiento reducido
   ============================================================ */
.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 10000;
  background: #453a7a;
  color: #ffffff;
  padding: 0.7rem 1.2rem;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  text-decoration: none;
}
.skip-link:focus {
  top: 0.75rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Anillo de foco visible solo al navegar con teclado */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid #453a7a;
  outline-offset: 3px;
}

/* Quien tiene activado "reducir movimiento" en su sistema no ve transiciones */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Las imágenes llevan width/height en el HTML (evita saltos de diseño al cargar).
   Esta regla, con especificidad cero, hace que mantengan su proporción salvo que
   otra regla CSS indique expresamente su alto. */
:where(img[width][height]) {
  height: auto;
}
