/* ==========================================================================
   LEMONLABS - HOJA DE ESTILOS MAESTRA (V2.0 POLISHED)
   Estilo: Hero Aurora + Clean Content + Dev Friendly + Modern UI
   ========================================================================== */


/* =====================================================
   1. CONFIGURACIÓN BASE & VARIABLES
   ===================================================== */

:root {
    /* --- Paleta de Colores --- */
    --color-acento: #00cc99;
    --color-acento-hover: #00a37a;
    --color-texto-principal: #0b0f19;
    --color-texto-secundario: #58627a;
    --color-texto-terciario: #9ca3af;
    /* --- Fondos --- */
    --color-fondo: #ffffff;
    --color-fondo-secundario: #f7f9fc;
    --color-fondo-gris: #F3F4F6;
    --color-fondo-oscuro: #1f2937;
    --color-borde: #e2e6ea;
    --color-blanco: #ffffff;
    /* --- Efectos Visuales --- */
    --sombra-suave: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --sombra-media: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --sombra-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --sombra-card: 0 0 0 1px rgba(0, 0, 0, 0.03), 0 2px 8px rgba(0, 0, 0, 0.04);
    --blur-cristal: blur(16px) saturate(180%);
    /* --- Medidas & Animaciones --- */
    --radio-btn: 8px;
    /* Un poco menos redondo para software se ve más pro */
    --radio-card: 16px;
    --radio-input: 8px;
    --header-height: 80px;
    --transicion-rapida: all 0.2s ease-in-out;
    --transicion-suave: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}


/* --- Reset & Bases --- */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    background-color: var(--color-fondo);
    color: var(--color-texto-principal);
    line-height: 1.6;
    overflow-x: hidden;
}


/* --- Scrollbar Personalizado (Toque Premium) --- */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-acento);
}


/* --- Accesibilidad (Focus States) --- */

:focus-visible {
    outline: 2px solid var(--color-acento);
    outline-offset: 2px;
}


/* --- Tipografía --- */

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--color-texto-principal);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transicion-rapida);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}


/* =====================================================
   2. ELEMENTOS UI (BOTONES & FORMULARIOS)
   ===================================================== */


/* Botones */

.btn-acento {
    background-color: var(--color-texto-principal);
    color: var(--color-blanco);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radio-btn);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    transition: var(--transicion-rapida);
    cursor: pointer;
}

.btn-acento:hover {
    background-color: var(--color-acento);
    color: var(--color-blanco);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 204, 153, 0.3);
}

.btn-secundario {
    background: transparent;
    color: var(--color-texto-principal);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radio-btn);
    font-weight: 600;
    border: 1px solid var(--color-borde);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.btn-secundario:hover {
    border-color: var(--color-texto-principal);
    background: var(--color-fondo-secundario);
}


/* Formularios (NUEVO - Esencial para SaaS) */

input[type="text"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--color-borde);
    border-radius: var(--radio-input);
    background: #fff;
    font-size: 1rem;
    transition: var(--transicion-rapida);
    color: var(--color-texto-principal);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--color-acento);
    box-shadow: 0 0 0 3px rgba(0, 204, 153, 0.1);
}


/* =====================================================
   3. LAYOUT & SECCIONES GENERALES
   ===================================================== */

section {
    padding: 6rem 2rem;
    max-width: 1240px;
    margin: 0 auto;
}

section h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-align: center;
}

section>p {
    max-width: 680px;
    margin: 0 auto 4rem auto;
    text-align: center;
    color: var(--color-texto-secundario);
    font-size: 1.25rem;
}


/* =====================================================
   4. HEADER & NAVEGACIÓN
   ===================================================== */

header {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: var(--blur-cristal);
    -webkit-backdrop-filter: var(--blur-cristal);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 3rem;
    z-index: 1000;
    transition: var(--transicion-rapida);
}

.logo {
    font-weight: 900;
    font-size: 1.5rem;
    color: var(--color-texto-principal);
    letter-spacing: -0.04em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo span {
    color: var(--color-acento);
}

.desktop-nav ul {
    display: flex;
    gap: 2.5rem;
}

.desktop-nav a {
    color: var(--color-texto-secundario);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
}

.desktop-nav a:hover {
    color: var(--color-texto-principal);
}


/* Indicador sutil de hover en menú */

.desktop-nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--color-acento);
    transition: width 0.3s ease;
}

.desktop-nav a:hover::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-texto-principal);
}

main {
    padding-top: var(--header-height);
}


/* =====================================================
   5. HERO (AURORA REFINADO)
   ===================================================== */

@keyframes floatOrb {
    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

.hero {
    min-height: calc(90vh - var(--header-height));
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 2rem;
    position: relative;
    overflow: hidden;
    /* Importante para que las bolas no causen scroll horizontal */
}


/* Bolas de color de fondo */

.hero::before,
.hero::after {
    content: '';
    position: absolute;
    width: 50vw;
    height: 50vw;
    max-width: 600px;
    max-height: 600px;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.35;
    z-index: -1;
}

.hero::before {
    top: -10%;
    left: -5%;
    background: radial-gradient(circle, var(--color-acento) 0%, transparent 70%);
    animation: floatOrb 10s infinite ease-in-out;
}

.hero::after {
    bottom: 0%;
    right: -5%;
    background: radial-gradient(circle, #3b82f6 0%, transparent 70%);
    animation: floatOrb 12s infinite ease-in-out reverse;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    /* Tipografía responsive fluida */
    margin-bottom: 1.5rem;
    letter-spacing: -0.04em;
    line-height: 1.1;
}

.hero p {
    font-size: 1.25rem;
    color: var(--color-texto-secundario);
    margin-bottom: 2.5rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}


/* =====================================================
   6. COMPONENTES: CARDS & BLOG LIST
   ===================================================== */

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radio-card);
    padding: 2.5rem;
    transition: var(--transicion-suave);
    box-shadow: var(--sombra-suave);
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--sombra-hover);
    border-color: rgba(0, 204, 153, 0.4);
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.card p {
    color: var(--color-texto-secundario);
    flex-grow: 1;
}

.card .badge {
    position: absolute;
    top: 24px;
    right: 24px;
    background: rgba(0, 204, 153, 0.1);
    color: #008f6b;
    padding: 0.3rem 0.8rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-link {
    margin-top: 1.5rem;
    color: var(--color-acento-hover);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.card-link:hover {
    gap: 0.8rem;
}


/* Grid Blog */

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

.blog-card {
    background: #fff;
    border-radius: var(--radio-card);
    border: 1px solid var(--color-borde);
    overflow: hidden;
    transition: var(--transicion-suave);
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--sombra-media);
}

.card-image-top {
    height: 220px;
    width: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.blog-card:hover .card-image-top {
    transform: scale(1.05);
}

.card-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-meta {
    font-size: 0.8rem;
    color: var(--color-texto-terciario);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}


/* =====================================================
   7. SINGLE POST (RICH TEXT OPTIMIZADO PARA DEV)
   ===================================================== */

.single-post-wrapper {
    background-color: var(--color-fondo-gris);
    width: 100%;
    padding: 4rem 1rem;
    min-height: 100vh;
}

.single-post-container {
    max-width: 1100px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: var(--radio-card);
    box-shadow: var(--sombra-card);
    padding: 4rem;
    display: grid;
    grid-template-columns: 1fr 260px;
    /* Contenido | Sidebar */
    gap: 4rem;
    align-items: start;
}


/* Header Articulo */

.article-header {
    grid-column: 1 / -1;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--color-borde);
    padding-bottom: 2rem;
}

.article-meta {
    background: #eff6ff;
    color: #2563eb;
    padding: 6px 16px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.article-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    margin-bottom: 1.5rem;
    color: #000;
    line-height: 1.1;
}

.article-featured-image {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 3rem;
    grid-column: 1 / -1;
    max-height: 500px;
    object-fit: cover;
}


/* --- Contenido Rico (Rich Text) --- */

.article-content {
    font-size: 1.125rem;
    color: #374151;
    line-height: 1.8;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content h2 {
    font-size: 1.8rem;
    margin-top: 3rem;
    margin-bottom: 1rem;
    color: #111;
    scroll-margin-top: 140px;
    /* Offset para sticky header */
}

.article-content h3 {
    font-size: 1.4rem;
    margin-top: 2rem;
    margin-bottom: 0.8rem;
    color: #333;
}

.article-content ul,
.article-content ol {
    margin-left: 1.5rem;
    margin-bottom: 2rem;
    color: var(--color-texto-secundario);
}

.article-content li {
    margin-bottom: 0.5rem;
}


/* Code Blocks (Estilo "Software House") */

pre {
    background: #1e1e1e;
    color: #f8f8f2;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    font-family: 'Fira Code', 'Courier New', monospace;
    border: 1px solid #333;
}

code {
    background: rgba(0, 0, 0, 0.06);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Fira Code', monospace;
    color: #d63384;
}

pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}


/* Citas */

blockquote {
    border-left: 4px solid var(--color-acento);
    padding-left: 1.5rem;
    font-style: italic;
    font-size: 1.25rem;
    color: #4b5563;
    margin: 2rem 0;
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: 0 8px 8px 0;
}


/* --- Tabla de Contenidos (Sidebar) --- */

.article-toc {
    position: sticky;
    top: 120px;
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--color-borde);
}

.article-toc strong {
    display: block;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    letter-spacing: 1px;
    color: var(--color-texto-terciario);
    text-transform: uppercase;
}

.toc-list li {
    margin-bottom: 0.8rem;
}

.toc-list a {
    font-size: 0.9rem;
    color: var(--color-texto-secundario);
    display: block;
    line-height: 1.4;
    border-left: 2px solid transparent;
    padding-left: 12px;
}

.toc-list a:hover,
.toc-list a.active {
    color: var(--color-acento);
    border-left-color: var(--color-acento);
}


/* =====================================================
   8. FOOTER & CTA FINAL
   ===================================================== */

.cta-final {
    background-color: var(--color-fondo-oscuro);
    color: #fff;
    text-align: center;
    padding: 8rem 2rem;
    position: relative;
    overflow: hidden;
}

.cta-final h2 {
    color: #fff;
    margin-bottom: 1rem;
}

.cta-final p {
    color: #d1d5db;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-inline: auto;
}

footer {
    background: #fff;
    padding: 5rem 5% 2rem;
    border-top: 1px solid var(--color-borde);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    max-width: 1240px;
    margin: 0 auto;
}

footer h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--color-texto-terciario);
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
}

footer a {
    display: block;
    color: var(--color-texto-secundario);
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

footer a:hover {
    color: var(--color-acento);
}

.footer-bottom {
    text-align: center;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #f3f4f6;
    color: #9ca3af;
    font-size: 0.85rem;
}


/* =====================================================
   9. RESPONSIVE DESIGN (Media Queries)
   ===================================================== */

@media (max-width: 1024px) {
    .single-post-container {
        grid-template-columns: 1fr;
        padding: 3rem 2rem;
    }
    .article-toc {
        display: none;
    }
    /* Ocultar sidebar en tablets */
}

@media (max-width: 768px) {
    header {
        padding: 0 1.5rem;
    }
    .desktop-nav {
        display: none;
    }
    .mobile-menu-btn {
        display: block;
    }
    section {
        padding: 4rem 1.5rem;
    }
    .hero h1 {
        font-size: 2.5rem;
    }
    .hero-cta {
        flex-direction: column;
        width: 100%;
    }
    .btn-acento,
    .btn-secundario {
        width: 100%;
        text-align: center;
    }
    /* Single Post Móvil: Pantalla completa */
    .single-post-wrapper {
        padding: 0;
        background: #fff;
    }
    .single-post-container {
        box-shadow: none;
        border: none;
        border-radius: 0;
        padding: 2rem 1.5rem;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
}