/* Reset y variables */
:root {
    --primary: #fff;
    --primary-dark: #6B2DFF;
    --secondary: #FF7D4F;
    --accent: #FFD14F;
    --light: #000;
    --dark: #fff;
    --bg-color: #736AE1;
    --text-color: #fff;
    --text-light: #fff;
    --card-bg: #8F88E7;
    --font-title: 'Fredoka One', 'Baloo 2', cursive;
    --font-text: 'Poppins', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-text);
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Tipografía */
h1, h2, h3, h4 {
    font-family: var(--font-title);
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--primary);
}

h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    text-align: center;
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--accent);
    margin: 1rem auto;
    border-radius: 2px;
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--dark);
}

p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-light);
}

.subtitle {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 2rem;
    text-align: center;
    color: var(--text-light);
}

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

section {
    padding: 4rem 0;
}

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.preloader-content {
    text-align: center;
}

.preloader img {
    width: 100px;
    height: 100px;
    margin-bottom: 1rem;
    animation: bounce 1.5s infinite;
}

.preloader p {
    font-family: var(--font-title);
    color: var(--primary);
    font-size: 1.5rem;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Header */
.header {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
    background: var(--bg-color);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-title);
    font-size: 1.5rem;
    color: var(--primary);
    text-decoration: none;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: var(--font-text);
}

.btn-primary {
    background: var(--primary);
    color: var(--light);
}

.btn-primary:hover {
    background: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(138, 79, 255, 0.3);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.2rem;
}

/* Blog Hero */
.blog-hero {
    padding-top: 6rem;
    text-align: center;
    background: #736AE1;
}

/* Blog Posts */
.blog-posts {
    background-color: var(--bg-color);
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.post-card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.post-image {
    height: auto;
    overflow: hidden;
    border-radius: 20px;
}

.post-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-card:hover .post-image img {
    transform: scale(1.05);
}

.post-content {
    padding: 1.5rem;
}

.post-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-align: left;
    color: var(--dark);
}

.post-content h2::after {
    display: none;
}

.post-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.post-full {
    margin-bottom: 1.5rem;
}

.read-more {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: var(--accent);
}

.read-more i {
    transition: transform 0.3s ease;
}

.read-more.active i {
    transform: rotate(180deg);
}

/* Blog CTA */
.blog-cta {
    text-align: center;
    background: #736AE1;
    color: #fff;
}

/* Footer */
.footer {
    background: #736AE1;
    color: var(--light);
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-links h3, .footer-social h3 {
    color: var(--accent);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--accent);
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #fff;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.social-icons a:hover {
    background: var(--accent);
    color: var(--dark);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 1s ease forwards;
}

.slide-down {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

/* Responsive */
@media (min-width: 768px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    section {
        padding: 3rem 0;
    }

    .blog-hero {
        padding-top: 5rem;
    }
}