/* =========================================================
   InfoKids — Componentes del sistema de diseño
   CSS estático (no pasa por el compilador de Tailwind).
   ========================================================= */

.glass {
    background: rgb(var(--color-glass));
    -webkit-backdrop-filter: blur(var(--glass-blur, 14px));
    backdrop-filter: blur(var(--glass-blur, 14px));
    border: 1px solid rgb(var(--color-line));
    box-shadow: 0 8px 32px rgba(0, 0, 0, .12);
}

.glass-strong {
    background: rgb(var(--color-glass));
    -webkit-backdrop-filter: blur(22px);
    backdrop-filter: blur(22px);
    border: 1px solid rgb(var(--color-line));
    box-shadow: 0 8px 32px rgba(0, 0, 0, .16);
}

/* Botónes */
.btn,
.btn-primary,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    border-radius: .375rem;
    padding: .5rem .5rem;
    font-size: .875rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: opacity .15s ease, background-color .15s ease, color .15s ease;
}

.btn-primary {
    background-color: rgb(var(--color-accent));
    color: #fff;
    border: 1px solid transparent;
}
.btn-primary:hover { opacity: .9; }

.btn-ghost {
    color: rgb(var(--color-ink));
    border: 1px solid rgb(var(--color-line));
}
.btn-ghost:hover { background-color: rgb(var(--color-accent-soft)); }

/* Chips / etiquetas */
.chip {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    border-radius: 9999px;
    background-color: rgb(var(--color-accent-soft));
    color: rgb(var(--color-ink));
    padding: .25rem .75rem;
    font-size: .75rem;
    font-weight: 500;
}

/* Tarjeta de tapa (sello visual: vidrio con n.º de edición) */
.cover-card {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    background: rgb(var(--color-glass));
    -webkit-backdrop-filter: blur(var(--glass-blur, 14px));
    backdrop-filter: blur(var(--glass-blur, 14px));
    border: 1px solid rgb(var(--color-line));
    box-shadow: 0 8px 32px rgba(0, 0, 0, .12);
    transition: transform .2s ease;
}
.cover-card:hover { transform: translateY(-4px); }

/* Navegación */
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding: .375rem .625rem;
    border-radius: .375rem;
    color: rgb(var(--color-ink));
    font-size: .875rem;
    font-weight: 500;
    transition: background-color .15s ease, color .15s ease;
}
.nav-link:hover { background-color: rgb(var(--color-accent-soft)); }

/* Ocultar elementos Alpine antes de hidratar */
[x-cloak] { display: none !important; }

/* Estados vacíos / de error */
.empty-state {
    border-radius: 1rem;
    background: rgb(var(--color-glass));
    -webkit-backdrop-filter: blur(var(--glass-blur, 14px));
    backdrop-filter: blur(var(--glass-blur, 14px));
    border: 1px dashed rgb(var(--color-line));
    color: rgb(var(--color-ink-soft));
    padding: 2.5rem 1.5rem;
    text-align: center;
}

.error-state {
    border-radius: .5rem;
    border: 1px solid rgb(252 165 165);
    background-color: rgb(254 242 242);
    color: rgb(185 28 28);
    padding: .75rem 1rem;
    font-size: .875rem;
}
.dark .error-state {
    border-color: rgb(153 27 27);
    background-color: rgb(69 10 10 / .4);
    color: rgb(252 165 165);
}

/* =========================================================
   Alertas (popup) y toasts — sistema propio (genio.alert)
   ========================================================= */
.ik-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, .45);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
.ik-modal__card {
    width: 100%;
    max-width: 24rem;
    margin: auto;
    background: rgb(var(--color-surface));
    border: 1px solid rgb(var(--color-line));
    border-radius: 1rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
    padding: 1.5rem;
}
.ik-modal__title {
    font-family: Fraunces, Georgia, serif;
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: .5rem;
}
.ik-modal__msg {
    color: rgb(var(--color-ink-soft));
    font-size: .9rem;
}
.ik-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
    margin-top: 1.5rem;
}

.ik-toast {
    position: fixed !important;
    top: 1rem;
    right: 1rem;
    z-index: 9999 !important;
    display: flex;
    align-items: center;
    gap: .5rem;
    max-width: 22rem;
    padding: .75rem 1rem;
    border-radius: .75rem;
    font-size: .875rem;
    background: rgb(var(--color-accent));
    color: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
    transition: transform .25s ease, opacity .25s ease;
}
.ik-toast.success { background: rgb(34 197 94); }
.ik-toast.error { background: rgb(239 68 68); }
.ik-toast.warn { background: rgb(245 158 11); color: #1c1917; }

[data-ik-fade] {
    opacity: 0;
    transform: translateY(6px);
}

/* Alineación de imágenes del page builder (VvvebJs) */
img.align-left, .align-left { float: left; margin: 0 1rem 1rem 0; }
img.align-right, .align-right { float: right; margin: 0 0 1rem 1rem; }
img.align-center, .align-center { display: block; margin-left: auto; margin-right: auto; }

/* Bloques de la landing (lienzo y vista pública): separación entre bloques */
[data-component-oembed] iframe {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    max-width: 100%;
}
/* En el lienzo del editor los iframes no consumen el clic: así se selecciona
   el contenedor del embed y aparecen sus propiedades (Url / Tamaño). */
[data-vvvebjs-editor] [data-component-oembed] iframe {
    pointer-events: none;
}
/* Barra de tamaño visible sobre cada embed en el lienzo */
.ik-embed-sizes {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    margin-bottom: .5rem;
}
.ik-embed-sizes button {
    font-size: .7rem;
    line-height: 1;
    padding: .3rem .55rem;
    border-radius: .375rem;
    border: 1px solid rgb(var(--color-line));
    background: rgb(var(--color-glass));
    color: rgb(var(--color-ink));
    cursor: pointer;
}
.ik-embed-sizes button:hover { background-color: rgb(var(--color-accent-soft)); }
.ik-embed-sizes button.activo {
    background-color: rgb(var(--color-accent));
    color: #fff;
    border-color: transparent;
}
/* Imágenes del page builder: w-full en móvil, tamaño nativo en escritorio */
.ik-img-responsive { max-width: 100%; height: auto; }
@media (max-width: 767px) {
    .ik-img-responsive { width: 100% !important; height: auto !important; }
}
/* Sección contenedor: 0 padding en móvil (responsive), almohadillado en escritorio */
.ik-seccion { padding: 0; }
@media (min-width: 768px) {
    .ik-seccion { padding: 4rem 1rem; }
}

/* Utilidades Tailwind usadas por los componentes del page builder (landing).
   app.css compila solo las clases que ya usa el sitio; estas faltan ahí y se
   incluyen aquí para que los bloques rendericen igual en el lienzo y en la
   vista pública. */
.inline-block { display: inline-block; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.max-w-full { max-width: 100%; }
.leading-relaxed { line-height: 1.625; }
.text-gray-700 { color: #374151; }
.bg-slate-100 { background-color: #f1f5f9; }
.bg-slate-200 { background-color: #e2e8f0; }
.bg-orange-600 { background-color: #ea580c; }
.flex-row { flex-direction: row; }
.w-1\/2 { width: 50%; }
.w-1\/3 { width: 33.333333%; }
.w-2\/3 { width: 66.666667%; }
.w-1\/4 { width: 25%; }
@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Colores del botón del page builder: usan los tokens configurados del
   sitio (var(--color-*)) y se adaptan al modo claro/oscuro. */
.ik-btn-accent { background-color: rgb(var(--color-accent)); color: #fff; }
.ik-btn-accent:hover { opacity: .92; }
.ik-btn-accent-soft { background-color: rgb(var(--color-accent-soft)); color: rgb(var(--color-accent)); }
.ik-btn-ink { background-color: rgb(var(--color-ink)); color: rgb(var(--color-canvas)); }
.ik-btn-surface { background-color: rgb(var(--color-surface)); color: rgb(var(--color-ink)); border: 1px solid rgb(var(--color-line)); }
.ik-btn-outline { background-color: transparent; color: rgb(var(--color-ink)); border: 1px solid rgb(var(--color-line)); }
.ik-btn-outline:hover { background-color: rgb(var(--color-accent-soft)); }
