/*
Theme Name: La Plaziga
Theme URI: https://laplaziga.es
Author: Compañía La Chistera
Author URI: https://laplaziga.es
Description: Tema infantil y editable para la obra de teatro "La Plaziga". Incluye portada con personajes interactivos y generador de palabras, un Diario basado en las entradas nativas de WordPress, y una página de estreno retro con cuenta atrás. Todo el contenido se edita desde Apariencia → Personalizar.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: laplaziga
*/

/* ============================================================
   BASE
   ============================================================ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #FFF3DF;
  background-image: radial-gradient(#ead9b5 1.4px, transparent 1.4px);
  background-size: 22px 22px;
  font-family: 'DM Sans', sans-serif;
  color: #15153A;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: #FFCD2E; color: #15153A; }
img { max-width: 100%; }
a { color: inherit; }

/* WordPress admin bar offset for the fixed nav */
.admin-bar .lp-nav { top: 32px; }
@media screen and (max-width: 782px) { .admin-bar .lp-nav { top: 46px; } }

/* ============================================================
   KEYFRAMES
   ============================================================ */
@keyframes float1 { 0%,100% { transform: translateY(0) rotate(-7deg); } 50% { transform: translateY(-20px) rotate(-7deg); } }
@keyframes float2 { 0%,100% { transform: translateY(0) rotate(6deg); } 50% { transform: translateY(-15px) rotate(6deg); } }
@keyframes float3 { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-27px) rotate(-3deg); } }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-11px); } }
@keyframes pulseBtn { 0%,100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes sparkle { 0%,100% { opacity: .35; transform: scale(.7); } 50% { opacity: 1; transform: scale(1.2); } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes revealUp { from { opacity: 0; transform: translateY(54px); } to { opacity: 1; transform: none; } }
@keyframes popIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes blink { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }
@keyframes beat { 0%,100% { transform: scale(1); } 50% { transform: scale(1.16); } }
@keyframes floatY { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes scan { from { background-position: 0 0; } to { background-position: 0 6px; } }
@keyframes bobSprite { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes flashNew { 0%,100% { color:#e7b53b; } 50% { color:#fff; } }
@keyframes spinSlow { to { transform: rotate(360deg); } }
@keyframes eq { 0%,100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

/* Reveal-on-scroll */
.lp-rev.is-in { animation: revealUp .8s cubic-bezier(.2,.7,.2,1) both; }

/* ============================================================
   FLIP CARDS (personajes)
   ============================================================ */
.lp-flip { perspective: 1400px; height: 430px; cursor: pointer; }
.lp-flip-inner {
  position: relative; width: 100%; height: 100%;
  transition: transform .7s cubic-bezier(.6,.2,.1,1);
  transform-style: preserve-3d;
}
.lp-flip.is-flipped .lp-flip-inner { transform: rotateY(180deg); }
.lp-flip-face {
  position: absolute; inset: 0;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border: 4px solid #15153A; border-radius: 28px; padding: 30px;
  display: flex; flex-direction: column;
}
.lp-flip-back { transform: rotateY(180deg); }

/* ============================================================
   DOOR (aula segura)
   ============================================================ */
.lp-door-panel {
  position: absolute; inset: 0; transform-origin: left center;
  transition: transform .9s cubic-bezier(.5,.05,.2,1);
  transform: rotateY(0deg);
}
.lp-door.is-open .lp-door-panel { transform: rotateY(-108deg); }

/* ============================================================
   CHIPS (generador / estados de ánimo)
   ============================================================ */
.lp-chip {
  display: inline-flex; align-items: center; padding: 9px 16px; border-radius: 999px;
  border: 2.5px solid #15153A; font-family: 'DM Sans', sans-serif; font-weight: 700; font-size: 15px;
  cursor: pointer; transition: transform .12s, background .12s; line-height: 1;
  background: #fff; color: #15153A; box-shadow: 0 3px 0 #15153A;
}
.lp-chip.is-active { background: #EA5A36; color: #fff; box-shadow: 0 4px 0 #15153A; transform: translateY(-1px); }
.lp-chip-teal.is-active { background: #1FA09E; }

/* ============================================================
   ESTRENO (retro page) — scoped by body class
   ============================================================ */
body.lp-estreno {
  background: #0c1330;
  font-family: 'VT323', monospace;
  color: #f4ecd0;
  -webkit-font-smoothing: none;
}
body.lp-estreno * { image-rendering: pixelated; }
body.lp-estreno ::selection { background: #e7b53b; color: #0c1330; }

/* Generic WP content (single posts, pages) */
.lp-prose { font-size: 18px; line-height: 1.7; color: #3a3a52; }
.lp-prose h2 { font-family: 'Fredoka', sans-serif; font-weight: 700; letter-spacing: -1px; }
.lp-prose a { color: #EA5A36; }
.lp-prose img { border-radius: 16px; }
.lp-prose blockquote {
  border-left: 5px solid #EA5A36; margin: 24px 0; padding: 6px 0 6px 22px;
  font-family: 'Caveat', cursive; font-weight: 700; font-size: 26px; color: #15153A;
}

/* Menú de navegación (cuando se asigna uno en Apariencia → Menús) */
.lp-menu { display: flex; align-items: center; gap: clamp(10px,2vw,26px); list-style: none; margin: 0; padding: 0; }
.lp-menu a { color: #15153A; text-decoration: none; }
.lp-menu .current-menu-item > a { color: #EA5A36; }

/* ============================================================
   NAV MÓVIL (hamburguesa)
   ============================================================ */
.lp-burger { display: none; width: 46px; height: 44px; flex: none; border: 3px solid #15153A; border-radius: 12px; background: #FFCD2E; box-shadow: 0 4px 0 #15153A; cursor: pointer; padding: 0; align-items: center; justify-content: center; flex-direction: column; gap: 5px; }
.lp-burger span { display: block; width: 22px; height: 3px; border-radius: 3px; background: #15153A; transition: transform .25s ease, opacity .2s ease; }
.lp-burger.is-open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.lp-burger.is-open span:nth-child(2) { opacity: 0; }
.lp-burger.is-open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 860px) {
	.lp-nav { flex-wrap: wrap; }
	.lp-burger { display: flex; }
	.lp-nav-links {
		display: none !important;
		flex-direction: column !important;
		align-items: stretch !important;
		gap: 4px !important;
		width: 100%;
		margin-top: 12px;
		padding-top: 12px;
		border-top: 2px dashed rgba(21,21,58,.25);
	}
	.lp-nav-links.is-open { display: flex !important; }
	.lp-nav-links > a,
	.lp-nav-links .lp-menu { width: 100%; }
	.lp-nav-links > a:not(.lp-nav-cta) { padding: 12px 6px; border-radius: 10px; }
	.lp-nav-links .lp-menu { flex-direction: column; align-items: stretch; gap: 0; }
	.lp-nav-links .lp-menu li { width: 100%; }
	.lp-nav-links .lp-menu a { display: block; padding: 12px 6px; border-radius: 10px; }
	.lp-nav-links .lp-nav-cta { justify-content: center; margin-top: 8px; padding: 13px 18px; }
}

/* Funciones: apila panel de datos bajo las fechas en pantallas estrechas */
.lp-funciones-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 720px) { .lp-funciones-grid { grid-template-columns: 1fr; } }

/* Comments + utility */
.lp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
