/**
 * Core Web Vitals — mitigación CLS / LCP / INP (sitio público)
 */

/* Reserva espacio en imágenes (evita CLS al cargar) */
img {
    height: auto;
}

.article-hero-img,
.hub-hero__img {
    max-width: 100%;
}

.hub-hero__figure,
.hub-card__media-link,
.hub-featured__thumb {
    contain: layout style paint;
}

.hub-hero__figure {
    aspect-ratio: 16 / 10;
    min-height: 200px;
    background: rgba(255, 255, 255, 0.04);
}

.hub-hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hub-card__media-link {
    display: block;
    aspect-ratio: 16 / 9;
    background: rgba(255, 255, 255, 0.04);
}

.hub-card__thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hub-featured__thumb {
    object-fit: cover;
    background: rgba(255, 255, 255, 0.06);
}

/* Iconos Font Awesome: caja fija (evita salto al cargar webfont) */
.fas,
.far,
.fab,
.fa-solid,
.fa-regular,
.fa-brands {
    display: inline-block;
    width: 1.15em;
    min-width: 1.15em;
    text-align: center;
    line-height: 1;
}

/* Contadores: ancho estable */
.stat-number,
.result-number,
[data-count] {
    font-variant-numeric: tabular-nums;
}

/* Navbar altura fija (complementa landing.css) */
.navbar {
    min-height: 72px;
    display: flex;
    align-items: center;
}

.navbar .nav-container {
    width: 100%;
    min-height: 52px;
}

/* Fuentes del sistema hasta que cargue Inter (reduce FOUT) */
.hub-page-body,
.blog-article,
body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.logo-text {
    font-family: 'Space Grotesk', system-ui, sans-serif;
}

/* Sticky CTA / social proof: solo transform, sin mover bottom del layout percibido */
.sticky-cta-bar {
    bottom: 0 !important;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
    will-change: transform;
}

.sticky-cta-bar.visible {
    transform: translateY(0);
}

body.sticky-cta-visible .dp-chatbot-widget {
    bottom: 80px !important;
}

@media (max-width: 768px) {
    body.sticky-cta-visible .dp-chatbot-widget {
        bottom: 110px !important;
    }
}

/* Home hero grid (evita CLS; complementa critical inline) */
.hero-visual {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 190px 190px;
    gap: 10px;
    width: 100%;
    min-height: 390px;
    contain: layout style paint;
}

.hero-visual > div {
    overflow: hidden;
    border-radius: 12px;
    min-height: 0;
}

.hero-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (max-width: 1024px) {
    .hero-visual {
        display: grid !important;
        min-height: 248px;
        max-width: 420px;
        margin-left: auto;
        margin-right: auto;
        grid-template-rows: 120px 120px;
        gap: 8px;
    }
}

.stat-value {
    margin: 0;
    font-size: inherit;
    font-weight: 700;
    color: #fff;
}

.chart-section-label {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #9ca3af;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.footer-links .footer-col-title {
    margin: 0 0 12px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

/* Home hero: formas decorativas estables (CLS móvil — shape-2 etc.) */
.hero-bg {
    contain: layout size style paint;
    overflow: hidden;
}

.floating-shapes {
    contain: strict;
    pointer-events: none;
}

.floating-shapes .shape {
    animation: none !important;
    will-change: auto;
    contain: layout style paint;
}

/* Showcase: sin animación inicial que mueva layout (CLS escritorio) */
.hero-showcase .browser-window {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
}

/* Reveal: solo opacidad (evita 20 animaciones no compuestas + saltos) */
.reveal-up,
.reveal-left,
.reveal-right,
.reveal-down {
    transform: none !important;
}

.reveal-up {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.reveal-up.revealed {
    opacity: 1;
}

/* Áreas táctiles mínimas (móvil / a11y) */
.nav-toggle,
.faq-question,
.sp-close,
.nav-dropdown__toggle {
    min-width: 44px;
    min-height: 44px;
}

.faq-question {
    width: 100%;
    box-sizing: border-box;
}

.social-proof-popup {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease !important;
}

/* Reducir trabajo en scroll (INP) */
@media (prefers-reduced-motion: reduce) {
    .sticky-cta-bar,
    .social-proof-popup,
    .navbar,
    .hub-card,
    .hub-featured__card {
        transition: none !important;
    }
}
