/* --- VARIABLES DE COLOR (Paleta Sci-Fi/Thriller Premium) --- */
:root {
    --bg-dark: #050a10;
    /* Negro azulado más profundo */
    --bg-secondary: #0f172a;
    /* Azul oscuro elegante */
    --accent-cyan: #3b82f6;
    /* Azul eléctrico vibrante */
    --highlight: #22d3ee;
    /* Cian neón */
    --text-main: #f8fafc;
    /* Blanco hielo */
    --text-muted: #94a3b8;
    /* Gris azulado */
    --gold-btn: #fbbf24;
    /* Dorado cálido */
    --font-title: 'Oswald', sans-serif;
    --font-body: 'Lato', sans-serif;
    --gradient-hero: linear-gradient(135deg, rgba(5, 10, 16, 0.95) 0%, rgba(15, 23, 42, 0.8) 100%);
    --card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --glow: 0 0 20px rgba(34, 211, 238, 0.3);
}

/* --- RESET BÁSICO --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.7;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* --- NAVEGACIÓN --- */
header {
    background-color: rgba(5, 10, 16, 0.85);
    /* Glassmorphism */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1rem 5%;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    transition: padding 0.3s;
}

header.scrolled {
    padding: 0.8rem 5%;
    background-color: rgba(5, 10, 16, 0.95);
}

.logo {
    font-family: var(--font-title);
    font-size: 2.4rem;
    /* Increased size per request */
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-main);
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.logo span {
    color: var(--highlight);
}

nav ul {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

nav a {
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    padding-bottom: 5px;
}

nav a:not(.btn-subscribe)::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--highlight);
    transition: width 0.3s;
}

nav a:not(.btn-subscribe):hover::after {
    width: 100%;
}

nav a:hover {
    color: var(--highlight);
    text-shadow: 0 0 8px var(--highlight);
}

.btn-subscribe {
    border: 1px solid var(--highlight);
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    /* Pill shape */
    color: var(--highlight);
    background: transparent;
    transition: all 0.3s ease;
}

.btn-subscribe:hover {
    background-color: var(--highlight);
    color: var(--bg-dark);
    box-shadow: 0 0 15px var(--highlight);
}

/* --- HERO SECTION ESTÁTICO (Fallback) & SLIDER --- */
/* Slider styles will be handled by Swiper/Script but baseline here */
.hero {
    height: 100vh;
    position: relative;
    overflow: hidden;
    margin-top: 0;
    /* Removing top margin if using absolute positioning or ensuring header overlay */
    padding-top: 80px;
    /* Space for fixed header */
    display: flex;
    align-items: center;
    justify-content: center;
}

.swiper {
    width: 100%;
    height: 100%;
}

.swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    position: relative;
}

.swiper-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-hero);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    width: 100%;
    padding: 0 5%;
}

.hero-text {
    flex: 1;
    min-width: 300px;
    padding-right: 3rem;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s forwards 0.5s;
}

.hero-image {
    flex: 1;
    min-width: 300px;
    text-align: center;
    perspective: 1000px;
    opacity: 0;
    transform: scale(0.9);
    animation: popIn 1s forwards 0.8s;
}

.hero-image img {
    max-width: 380px;
    box-shadow: var(--glow);
    border-radius: 10px;
    /* Efecto 3D sutil */
    transform: rotateY(-15deg) rotateX(5deg);
    transition: transform 0.6s ease;
}

.hero-image img:hover {
    transform: rotateY(0deg) rotateX(0deg) scale(1.05);
}

h1 {
    font-family: var(--font-title);
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.subtitle {
    font-size: 1.3rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    border-left: 4px solid var(--highlight);
    padding-left: 1.5rem;
    font-weight: 300;
}

/* BOTONES */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem;
    font-family: var(--font-title);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
    border-radius: 50px;
    margin-right: 1.5rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn i {
    margin-right: 10px;
}

.btn-primary {
    background: linear-gradient(45deg, var(--gold-btn), #f59e0b);
    color: #000;
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(251, 191, 36, 0.6);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--text-main);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: var(--text-main);
    color: var(--bg-dark);
    transform: translateY(-3px);
}

/* --- SECCIONES GENERALES --- */
section {
    padding: 6rem 5%;
}

.section-title {
    text-align: center;
    font-family: var(--font-title);
    font-size: 3rem;
    margin-bottom: 4rem;
    text-transform: uppercase;
    position: relative;
    letter-spacing: 2px;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--highlight), transparent);
    margin: 15px auto 0;
}

/* --- OBRAS DESTACADAS --- */
#libros {
    background-color: var(--bg-secondary);
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    /* Larger cards */
    gap: 3rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Tarjeta destacada rediseñada */
.book-card-featured {
    background: rgba(11, 19, 43, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 12px;
    display: flex;
    gap: 2rem;
    align-items: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.book-card-featured:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: var(--highlight);
}

.book-card-featured img {
    width: 200px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.book-info h3 {
    font-size: 2rem;
    font-family: var(--font-title);
    color: var(--white);
    margin-bottom: 0.5rem;
}

.book-info .genre {
    color: var(--highlight);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    display: block;
}

.book-info .desc {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* --- BIO --- */
.bio-container {
    display: flex;
    flex-direction: column;
    /* Stacked layout per request */
    align-items: center;
    gap: 2rem;
    /* Vertical gap */
    background: linear-gradient(135deg, var(--bg-secondary), rgba(11, 19, 43, 0.8));
    padding: 4rem;
    border-radius: 20px;
    max-width: 900px;
    margin: 0 auto;
    border: 1px solid rgba(59, 130, 246, 0.1);
    text-align: center;
    /* Center text */
}

.bio-img img {
    width: 300px;
    height: 300px;
    /* Reduced from 500px inline to avoid mobile overflow, can adjust */
    max-width: 100%;
    /* Responsive safety */
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--accent-cyan);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
    filter: grayscale(100%) contrast(1.2);
    transition: filter 0.5s;
}

.bio-img img:hover {
    filter: grayscale(0%);
}

.bio-text h3 {
    font-family: var(--font-title);
    margin-bottom: 1.5rem;
    font-size: 2rem;
    color: var(--highlight);
}

.read-more {
    color: var(--gold-btn);
    font-weight: 700;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    margin-top: 1rem;
}

.read-more:hover {
    text-decoration: underline;
}

/* --- BLOG --- */
.blog-section {
    padding-bottom: 8rem;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.blog-card {
    background-color: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.blog-card:hover {
    transform: translateY(-10px);
}

.blog-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.5s;
}

.blog-card:hover .blog-img {
    transform: scale(1.1);
}

.blog-img-wrapper {
    overflow: hidden;
}

.blog-content {
    padding: 2rem;
}

.blog-date {
    font-size: 0.85rem;
    color: var(--highlight);
    text-transform: uppercase;
    font-weight: 700;
}

.blog-title {
    font-family: var(--font-title);
    font-size: 1.5rem;
    margin: 0.8rem 0;
    line-height: 1.3;
}

.blog-title:hover {
    color: var(--highlight);
}


/* --- FOOTER --- */
footer {
    background-color: #020617;
    padding: 5rem 5% 2rem;
    text-align: center;
    border-top: 1px solid #1e293b;
    position: relative;
}

.social-links {
    margin-bottom: 2rem;
}

.social-links a {
    font-size: 1.8rem;
    margin: 0 15px;
    color: var(--text-muted);
    transition: transform 0.3s;
    display: inline-block;
}

.social-links a:hover {
    color: var(--highlight);
    transform: scale(1.2);
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    .hero {
        height: auto;
        padding: 8rem 5% 4rem;
    }

    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
    }

    .hero-text {
        padding-right: 0;
        margin-top: 3rem;
    }

    /* Bio already stacked by default now, so just padding adjust if needed */
    .bio-container {
        padding: 2rem;
    }

    nav ul {
        display: none;
    }

    /* TODO: Implement mobile menu toggle */

    .books-grid {
        grid-template-columns: 1fr;
    }

    .book-card-featured {
        flex-direction: column;
        text-align: center;
    }

    .logo {
        font-size: 2rem;
    }

    /* Slightly smaller logo on mobile if needed */
}

/* ANIMATIONS */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- BREVO SUBSCRIPTION FORM STYLES --- */
.btn-suscripcion-nebadon {
    transition: all 0.3s ease;
}

.btn-suscripcion-nebadon:hover {
    background-color: #ffcc00 !important;
    box-shadow: 0 0 15px #ffb400, 0 0 30px #ffb400;
    transform: scale(1.05);
    color: #000;
}

#sib-form-container {
    max-width: 500px !important;
    margin: 0 auto 3rem;
    /* Increased bottom margin per request */
    background: transparent !important;
    padding: 0 !important;
}

#sib-container {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
}

.sib-form-message-panel {
    margin-bottom: 15px;
    border-radius: 10px;
    padding: 10px;
    display: none;
    /* Hidden by default */
}

.form-layout-flex {
    display: flex;
    gap: 1.5rem;
    /* Increased gap per request "entre lineas de los botones" */
    justify-content: center;
    align-items: center;
}

@media (max-width: 600px) {
    .form-layout-flex {
        flex-direction: column;
    }

    .form-layout-flex input,
    .form-layout-flex button {
        width: 100% !important;
    }
}

/* Overrides for Brevo Inputs to match Theme */
.sib-input input.input {
    padding: 12px 20px;
    border-radius: 25px;
    border: 1px solid #ccc;
    width: 100%;
    background-color: #ffffff;
    color: #000000;
    outline: none;
    box-sizing: border-box;
    font-family: var(--font-body);
}

.sib-form-block__button {
    padding: 12px 25px;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    background-color: var(--gold-btn);
    color: #000000;
    font-family: var(--font-title);
    font-weight: bold;
    font-size: 18px;
    text-transform: uppercase;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Brevo SVG fix */
.sib-form-block__button svg {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    fill: currentColor;
    display: none;
    /* Hide loader by default */
}

.sib-hide-loader-icon {
    display: none;
}

/* Message Icons */
.sib-notification__icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    vertical-align: middle;
    fill: currentColor;
}