/*
Theme Name: Espai de Son
Theme URI: https://espaideson.com
Author: Nadia Rojas Martín
Author URI: https://espaideson.com
Description: Tema personalizado para Espai de Son - Acompañamiento al sueño infantil. Diseño minimalista con paleta salvia.
Version: 1.0.1
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: espai-de-son
Tags: full-site-editing, blocks, block-templates, one-column, custom-colors, custom-logo, custom-menu, featured-images, full-width-template, threaded-comments, translation-ready, wide-blocks
*/

/* =====================================================================
   ESPAI DE SON · Sistema de diseño "salvia"
   ===================================================================== */

/* Fuentes Google */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* Variables CSS de la paleta */
:root {
  --sage-bg: #EEF1ED;
  --sage-cream: #DDE4D9;
  --sage-accent: #C7D4C0;
  --sage-rose: #94AB87;
  --sage-rose-deep: #4F6745;
  --sage-ink: #26301F;
  --sage-ink-soft: rgba(38,48,31,0.65);
  --sage-line: rgba(38,48,31,0.14);
}

/* Reset y base */
html {
  box-sizing: border-box;
}
*, *::before, *::after {
  box-sizing: inherit;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Plus Jakarta Sans", -apple-system, sans-serif;
  color: var(--sage-ink);
  background: var(--sage-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
}

/* Tipografía */
.sg-display {
  font-family: "Quicksand", sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.sg-display-italic {
  font-family: "Quicksand", sans-serif;
  font-weight: 400;
  font-style: normal;
  letter-spacing: -0.02em;
  color: var(--sage-rose-deep);
}

.sg-hero-title {
  font-family: "Quicksand", sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.05;
  margin: 24px 0;
}

.sg-measure {
  max-width: 620px;
}

/* Tags / píldoras */
.sg-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--sage-accent);
  color: var(--sage-rose-deep);
  font: 600 12px/1 "Quicksand", sans-serif;
  letter-spacing: 0.04em;
  width: fit-content;
  margin: 0 0 24px;
}

.sg-tag-soft {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--sage-bg);
  color: var(--sage-rose-deep);
  font: 600 11px/1 "Quicksand", sans-serif;
  letter-spacing: 0.06em;
  border: 1px solid var(--sage-line);
  width: fit-content;
  margin: 0 0 16px;
}

.sg-tag-on-dark {
  background: rgba(255,255,255,0.12);
  color: var(--sage-bg);
}

.sg-meta {
  letter-spacing: 0.02em;
}

/* Tarjetas */
.sg-card {
  background: var(--sage-bg) !important;
  border-radius: 24px;
  padding: 32px !important;
  border: 1px solid var(--sage-line);
  transition: transform .2s, box-shadow .2s;
}

.sg-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 50px -25px rgba(0,0,0,0.25);
}

.sg-card-feat {
  background: var(--sage-ink) !important;
  color: var(--sage-bg);
}

.sg-card-feat .sg-tag-soft {
  background: rgba(255,255,255,0.12);
  color: var(--sage-bg);
  border-color: rgba(255,255,255,0.2);
}

/* Botones de WordPress (estilo fill) */
.wp-block-button.is-style-fill .wp-block-button__link {
  background: var(--sage-ink);
  color: var(--sage-bg);
  border-radius: 999px;
  padding: 14px 26px;
  font: 600 14px/1 "Quicksand", sans-serif;
  border: 0;
  transition: transform .15s, background .15s;
}

.wp-block-button.is-style-fill .wp-block-button__link:hover {
  transform: translateY(-2px);
}

.wp-block-button.is-style-outline .wp-block-button__link,
.wp-block-button.is-style-outline--2 .wp-block-button__link {
  background: transparent !important;
  color: var(--sage-ink) !important;
  border: 2px solid var(--sage-ink) !important;
  border-radius: 999px;
  padding: 14px 26px;
  font: 600 14px/1 "Quicksand", sans-serif;
}

.sg-btn-on-dark.is-style-fill .wp-block-button__link {
  background: var(--sage-bg);
  color: var(--sage-ink);
}

/* Listas de agenda */
.sg-agenda {
  list-style: none !important;
  padding-left: 0 !important;
  margin: 16px 0;
}

.sg-agenda li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--sage-ink-soft);
  list-style: none !important;
}

.sg-agenda li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sage-rose);
}

.sg-agenda-light li {
  color: rgba(255,255,255,0.8);
}

.sg-agenda-light li::before {
  background: var(--sage-bg);
}

.sg-past-list {
  columns: 2;
  gap: 40px;
}

@media (max-width: 600px) {
  .sg-past-list {
    columns: 1;
  }
}

/* FAQ - bloque details */
.sg-faq {
  border-bottom: 1px solid var(--sage-line);
  padding: 20px 0;
}

.sg-faq summary {
  font: 600 18px/1.3 "Quicksand", sans-serif;
  cursor: pointer;
  list-style: none;
}

.sg-faq summary::-webkit-details-marker {
  display: none;
}

.sg-faq summary::after {
  content: "+";
  float: right;
  color: var(--sage-rose-deep);
}

.sg-faq[open] summary::after {
  content: "–";
}

/* Header (nav) - estilo de píldora flotante */
.site-header {
  position: sticky;
  top: 16px;
  z-index: 100;
  margin: 16px 32px;
}

.site-header .wp-block-group {
  background: rgba(238, 241, 237, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 999px !important;
  padding: 12px 24px !important;
  border: 1px solid var(--sage-line);
}

@media (max-width: 768px) {
  .site-header {
    margin: 12px 16px;
  }
}

/* Footer */
.site-footer {
  background: var(--sage-bg);
  padding: 60px 64px 40px;
  border-top: 1px solid var(--sage-line);
}

@media (max-width: 768px) {
  .site-footer {
    padding: 40px 24px 24px;
  }
}

/* Secciones con clases sage */
.sg-section {
  padding: clamp(60px, 8vw, 120px) clamp(24px, 5vw, 64px);
  width: 100%;
}

.has-sage-bg-background-color {
  background-color: var(--sage-bg) !important;
}

.has-sage-cream-background-color {
  background-color: var(--sage-cream) !important;
}

.has-sage-ink-background-color {
  background-color: var(--sage-ink) !important;
}

.has-sage-ink-color {
  color: var(--sage-ink) !important;
}

.has-sage-bg-color {
  color: var(--sage-bg) !important;
}

.has-sage-ink-soft-color {
  color: var(--sage-ink-soft) !important;
}

.has-sage-rose-deep-color {
  color: var(--sage-rose-deep) !important;
}

/* Rejilla responsive de columnas */
.wp-block-columns {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 20px;
}

.wp-block-columns > .wp-block-column {
  flex: 1 1 240px !important;
  min-width: 240px !important;
  width: auto !important;
}

@media (max-width: 980px) {
  .wp-block-columns > .wp-block-column {
    flex: 1 1 calc(50% - 20px) !important;
    min-width: calc(50% - 20px) !important;
  }
}

@media (max-width: 600px) {
  .wp-block-columns > .wp-block-column {
    flex: 1 1 100% !important;
    min-width: 100% !important;
  }
  .sg-measure {
    max-width: 100%;
  }
}

/* Texto bonito para móvil */
@media (max-width: 600px) {
  .sg-hero-title {
    font-size: clamp(32px, 8vw, 48px);
  }
}

/* Formulario provisional "avísame" */
.sg-notify-input {
  width: 100%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--sage-bg);
  margin-bottom: 12px;
  box-sizing: border-box;
}

.sg-notify-btn {
  background: var(--sage-bg);
  color: var(--sage-ink);
  border: 0;
  border-radius: 999px;
  padding: 14px 28px;
  font: 600 14px/1 "Quicksand", sans-serif;
  cursor: pointer;
}

/* Asegurar headings con tipografía Quicksand */
h1, h2, h3, h4, h5, h6 {
  font-family: "Quicksand", sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--sage-ink);
}

/* Links generales */
a {
  color: var(--sage-ink);
}

/* Editor de WordPress */
.wp-block-post-title {
  display: none; /* Ocultamos el título por defecto, lo controlamos nosotros */
}

/* Para usuarios logueados en backoffice, dejar visible */
body.logged-in.is-admin .wp-block-post-title {
  display: block;
}

/* =====================================================================
   HERO — las bolas van como HTML inline en el bloque, no como CSS
   ===================================================================== */
.sg-hero {
  position: relative;
  overflow: hidden;
}

/* Todo el contenido por encima de las bolas */
.sg-hero > .wp-block-paragraph,
.sg-hero > .wp-block-heading,
.sg-hero > .wp-block-buttons {
  position: relative;
  z-index: 1;
}

/* =====================================================================
   FOTO CON FORMA IRREGULAR (blob)
   ===================================================================== */
.sg-photo-blob img {
  border-radius: 60% 40% 55% 45% / 45% 55% 40% 60% !important;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.sg-photo-col {
  position: relative;
}

/* En móvil la foto va encima del texto */
@media (max-width: 768px) {
  .sg-photo-col {
    order: -1;
    max-width: 280px;
    margin: 0 auto 32px;
  }
}

/* =====================================================================
   BOLAS DECORATIVAS — van en las plantillas HTML como SVG inline
   ===================================================================== */

/* Contenedor de bolas: detrás de todo, sin cortar el contenido */
.sg-balls-wrap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

/* Todo el contenido de la página por encima */
.sg-page-wrap {
  position: relative;
  z-index: 1;
}

/* Contenedor raíz relativo para que las bolas SVG se posicionen bien */
.wp-site-blocks {
  position: relative;
}

/* Primera sección (hero) — fondo transparente para que se vean las bolas */
.sg-page-wrap section.wp-block-group:first-child,
.sg-page-wrap section.wp-block-group.sg-hero {
  background-color: transparent !important;
}

/* Fondos de sección por clase — sin depender de has-*-background-color */
.sg-section-cream { background-color: var(--sage-cream) !important; }
.sg-section-dark {
  background-color: var(--sage-ink) !important;
  color: var(--sage-bg) !important;
}
.sg-section-dark h1,
.sg-section-dark h2,
.sg-section-dark h3,
.sg-section-dark p { color: var(--sage-bg); }

/* Tabla comparativa */
.sg-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.sg-table th {
  background: var(--sage-cream);
  color: var(--sage-rose-deep);
  font: 600 12px/1 "Quicksand", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 16px 20px;
  text-align: center;
}
.sg-table th:first-child { text-align: left; }
.sg-table td {
  padding: 16px 20px;
  border-top: 1px solid var(--sage-line);
  color: var(--sage-ink-soft);
  text-align: center;
}
.sg-table td:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--sage-ink);
}


/* =====================================================================
   FORMULARIOS WPFORMS — estilos universales (funciona con cualquier ID)
   ===================================================================== */

/* Inputs en sección oscura (sage-ink) */
.sg-section-dark [id^="wpforms-"] input[type=text],
.sg-section-dark [id^="wpforms-"] input[type=email],
.sg-section-dark [id^="wpforms-"] input[type=number],
.sg-section-dark [id^="wpforms-"] textarea,
.sg-section-dark [id^="wpforms-"] select,
.has-sage-ink-background-color [id^="wpforms-"] input[type=text],
.has-sage-ink-background-color [id^="wpforms-"] input[type=email],
.has-sage-ink-background-color [id^="wpforms-"] input[type=number],
.has-sage-ink-background-color [id^="wpforms-"] textarea,
.has-sage-ink-background-color [id^="wpforms-"] select {
  background-color: rgba(255,255,255,0.08) !important;
  border: 1px solid rgba(255,255,255,0.2) !important;
  border-radius: 12px !important;
  padding: 14px 16px !important;
  color: #EEF1ED !important;
  font-family: "Plus Jakarta Sans", sans-serif !important;
  font-size: 14px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.sg-section-dark [id^="wpforms-"] .wpforms-field-label,
.sg-section-dark [id^="wpforms-"] .wpforms-field-sublabel,
.sg-section-dark [id^="wpforms-"] legend,
.has-sage-ink-background-color [id^="wpforms-"] .wpforms-field-label,
.has-sage-ink-background-color [id^="wpforms-"] .wpforms-field-sublabel,
.has-sage-ink-background-color [id^="wpforms-"] legend {
  color: rgba(238,241,237,0.85) !important;
  font-size: 13px !important;
}

.sg-section-dark [id^="wpforms-"] button[type=submit],
.sg-section-dark [id^="wpforms-"] input[type=submit],
.has-sage-ink-background-color [id^="wpforms-"] button[type=submit],
.has-sage-ink-background-color [id^="wpforms-"] input[type=submit] {
  background: #EEF1ED !important;
  color: #26301F !important;
  border: 0 !important;
  border-radius: 999px !important;
  padding: 14px 28px !important;
  font: 600 14px/1 "Quicksand", sans-serif !important;
  cursor: pointer !important;
  margin-top: 12px !important;
  width: auto !important;
}

/* Inputs en sección clara (sage-bg o sage-cream) */
.has-sage-bg-background-color [id^="wpforms-"] input[type=text],
.has-sage-bg-background-color [id^="wpforms-"] input[type=email],
.has-sage-bg-background-color [id^="wpforms-"] input[type=number],
.has-sage-bg-background-color [id^="wpforms-"] textarea,
.has-sage-cream-background-color [id^="wpforms-"] input[type=text],
.has-sage-cream-background-color [id^="wpforms-"] input[type=email],
.has-sage-cream-background-color [id^="wpforms-"] textarea {
  background-color: white !important;
  border: 1px solid rgba(38,48,31,0.14) !important;
  border-radius: 12px !important;
  padding: 14px 16px !important;
  color: #26301F !important;
  font-family: "Plus Jakarta Sans", sans-serif !important;
  font-size: 14px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.has-sage-bg-background-color [id^="wpforms-"] .wpforms-field-label,
.has-sage-bg-background-color [id^="wpforms-"] .wpforms-field-sublabel,
.has-sage-bg-background-color [id^="wpforms-"] legend,
.has-sage-cream-background-color [id^="wpforms-"] .wpforms-field-label,
.has-sage-cream-background-color [id^="wpforms-"] .wpforms-field-sublabel,
.has-sage-cream-background-color [id^="wpforms-"] legend {
  color: #26301F !important;
  font-size: 13px !important;
}

.has-sage-bg-background-color [id^="wpforms-"] button[type=submit],
.has-sage-cream-background-color [id^="wpforms-"] button[type=submit] {
  background: #26301F !important;
  color: #EEF1ED !important;
  border: 0 !important;
  border-radius: 999px !important;
  padding: 14px 28px !important;
  font: 600 14px/1 "Quicksand", sans-serif !important;
  cursor: pointer !important;
  margin-top: 12px !important;
  width: auto !important;
}

/* Estructura campos */
.wpforms-field { margin-bottom: 16px !important; }
.wpforms-field-row { display: flex !important; gap: 12px !important; }
.wpforms-field-row-block { flex: 1 !important; }

/* =====================================================================
   MENÚ MÓVIL — forzado desde style.css (más prioridad que CSS adicional)
   ===================================================================== */
@media (max-width: 599px) {
  .wp-block-navigation__responsive-container.is-menu-open {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: none !important;
    background: rgba(238,241,237,0.97) !important;
    backdrop-filter: blur(20px) !important;
    z-index: 99999 !important;
    overflow-y: auto !important;
    margin: 0 !important;
    border-radius: 0 !important;
    padding: 40px 32px !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
  }

  .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-close,
  .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-dialog {
    width: 100% !important;
    height: auto !important;
    position: static !important;
  }

  .wp-block-navigation__responsive-container-close {
    display: none !important;
  }

  .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
    position: static !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    height: auto !important;
    width: auto !important;
    overflow: visible !important;
  }
}

/* Menú móvil — forzar expansión desde nav padre */
.site-header nav.wp-block-navigation {
  overflow: visible !important;
}

.wp-block-navigation__responsive-container.is-menu-open {
  inset: 0 !important;
  height: 100vh !important;
  min-height: 100vh !important;
}