/* =====================================================================
   Cabecera, Sally dormida, pie y pausa de animaciones.
   Portado de wcag.lililimon.vip (misma marca): el rosa #ff69b4 se queda
   como fondo y el texto encima va en tinta oscura (#48152f = 5.6:1).
   ===================================================================== */

/* ---------- Encaje ---------- */
.lace {
  height: 10px;
  width: 100%;
  background-image: linear-gradient(to right, transparent 50%, #fff 50%),
    linear-gradient(var(--hot-pink), var(--hot-pink));
  background-size: 20px 100%, 100% 100%;
}

/* ---------- Cabecera ---------- */
.site-header {
  background: var(--hot-pink);
  color: var(--ink);
  border-bottom: 5px solid #fff; /* la línea donde duerme Sally */
  position: relative;
  z-index: 100;
  padding: 0;
  text-align: left;
  overflow-x: clip; /* Sally nunca provoca scroll lateral */
}

.site-header .header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px 0;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  animation: none;
}

.site-header .logo {
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  padding-bottom: 10px;
}
.site-header .logo:hover {
  color: var(--ink);
}
.site-header .logo-name {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.site-header .logo-sub {
  font-size: 1rem;
  font-weight: 600;
}

/* Navegación centrada */
.site-header nav {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -40%);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 110;
  margin: 0;
}

/* #b8005c sobre blanco = 6.6:1 */
.site-header .nav-button {
  background: #fff;
  color: var(--dark-pink);
  border: 2px solid var(--primary-pink);
  box-shadow: 3px 3px 0 var(--primary-pink);
  border-radius: 25px;
  padding: 7px 16px;
  margin: 0;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.25s ease,
    background-color 0.2s;
}
.site-header .nav-button:hover,
.site-header .nav-button:focus-visible {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 5px 5px 0 var(--ink);
  color: #8f0047;
  background: #fff0f5;
}
.site-header .nav-logout {
  padding: 8px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ---------- Sally dormida sobre la línea ---------- */
/* La imagen (745x500, fondo transparente) es Sally acostada boca abajo: la
   cabeza termina al 78 % de la altura y debajo quedan los brazos. Esa altura
   se alinea con la línea blanca, así los brazos cuelgan sobre la página.
   Al hacer scroll se hunde detrás de la línea (--hide 0->1, lo pone layout.html). */
.sleeper {
  --h: 150px;
  --arms: 0.78;
  position: absolute;
  right: 20px;
  bottom: 0;
  width: calc(var(--h) * 1.49);
  height: calc(var(--h) * var(--arms));
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  clip-path: inset(-90px -70px calc(var(--h) * -0.3 * (1 - var(--hide, 0))) -70px);
  z-index: 105;
}
.sleeper:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: -3px;
  border-radius: 14px;
}
.sleeper-move {
  position: absolute;
  inset: 0;
  display: block;
  transform: translateY(calc(var(--hide, 0) * 104%));
  transition: transform 0.18s linear;
  will-change: transform;
}
.site-header .header-character {
  position: absolute;
  left: 0;
  bottom: calc(var(--h) * (var(--arms) - 1));
  height: var(--h);
  width: auto;
  display: block;
  transform-origin: 50% 78%;
  animation: sleepBreath 4.2s ease-in-out infinite;
  will-change: transform;
  -webkit-mask-image: linear-gradient(to bottom, #000 90%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 90%, transparent 100%);
  filter: drop-shadow(0 3px 2px rgba(72, 21, 47, 0.18));
}
@keyframes sleepBreath {
  /* respiración lenta de alguien dormido */
  0%, 100% { transform: scale(1, 1) translateY(0); }
  45% { transform: scale(1.018, 1.05) translateY(-1px); }
  55% { transform: scale(1.018, 1.05) translateY(-1px); }
}
.sleeper:hover .header-character,
.sleeper:focus-visible .header-character {
  animation-play-state: paused;
  transform: translateY(-8px) rotate(-2deg);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.zzz {
  position: absolute;
  left: 78%;
  top: -4px;
  width: 40px;
  height: 40px;
  pointer-events: none;
}
.zzz i {
  position: absolute;
  left: 0;
  bottom: 0;
  font-style: normal;
  font-weight: 800;
  color: var(--ink);
  opacity: 0;
  animation: zzz 4.2s ease-out infinite;
}
.zzz i:nth-child(1) { font-size: 0.85rem; }
.zzz i:nth-child(2) { font-size: 1.05rem; animation-delay: 1.4s; }
.zzz i:nth-child(3) { font-size: 1.3rem; animation-delay: 2.8s; }
@keyframes zzz {
  0% { opacity: 0; transform: translate(0, 6px) rotate(-8deg); }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(18px, -26px) rotate(8deg); }
}

/* ---------- Pie ---------- */
.site-footer {
  background: var(--hot-pink);
  color: var(--ink);
  text-align: center;
  padding: 0 20px 18px;
  margin-top: auto;
  position: relative;
  z-index: 1;
}
.site-footer .lace {
  margin: 0 -20px 14px;
  width: calc(100% + 40px);
  transform: scaleY(-1);
}
.site-footer p {
  margin: 4px 0;
  font-weight: 600;
}
.site-footer .socials {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
/* icono #48152f sobre blanco = 13:1; al pasar el mouse blanco sobre #b8005c = 6.6:1 */
.site-footer .social-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--primary-pink);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.2s;
}
.site-footer .social-dot:hover,
.site-footer .social-dot:focus-visible {
  background: var(--dark-pink);
  color: #fff;
  transform: translateY(-3px);
}
.site-footer .footer-admin {
  color: var(--ink);
  font-weight: 700;
  font-size: 0.85rem;
}

/* ---------- Pausar animaciones (WCAG 2.2.2) ---------- */
.fab {
  position: fixed;
  left: 16px; /* a la izquierda: a la derecha está el botón ❤ de favoritos */
  bottom: 16px;
  z-index: 900;
  background: var(--dark-pink);
  color: #fff;
  border: 2px solid #fff;
  border-radius: 999px;
  padding: 8px 16px;
  font: 700 0.9rem "Outfit", sans-serif;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--primary-pink), 0 6px 16px rgba(72, 21, 47, 0.25);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.2s;
}
.fab:hover {
  background: #8f0047;
  transform: translateY(-2px);
}
body.lb-open .fab {
  display: none;
}

body.paused,
body.paused *,
body.paused *::before,
body.paused *::after {
  animation-play-state: paused !important;
}
body.paused .sakura-container {
  display: none;
}
body.paused .zzz i {
  opacity: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .site-header .header-inner {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 8px;
    min-height: 120px;
    padding: 12px 150px 12px 16px;
  }
  .site-header .logo {
    padding-bottom: 0;
  }
  .site-header .logo-name {
    font-size: 1.9rem;
  }
  .site-header nav {
    position: static;
    transform: none;
    flex-wrap: wrap;
    justify-content: flex-start;
    width: auto;
  }
  .sleeper {
    --h: 96px;
    right: 4px;
  }
  .site-footer {
    padding-bottom: 70px;
  }
}

/* ---------- Barra de scroll rosa ---------- */
html {
  scroll-behavior: smooth;
}
::-webkit-scrollbar {
  width: 14px;
  height: 12px;
}
::-webkit-scrollbar-track {
  background: #fff0f5;
  border-left: 1px solid #ffd6e6;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #e0478f, #d6417f); /* sobre #fff0f5 >= 3.4:1 (WCAG 1.4.11) */
  border: 3px solid #fff0f5;
  border-radius: 999px;
  min-height: 48px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #e0478f, #b8005c);
}
::-webkit-scrollbar-thumb:active {
  background: #b8005c;
}
::-webkit-scrollbar-corner {
  background: #fff0f5;
}
/* Firefox (no entiende ::-webkit-scrollbar) */
@supports not selector(::-webkit-scrollbar) {
  html {
    scrollbar-color: #e0478f #fff0f5;
    scrollbar-width: auto;
  }
}
