* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #f0f6fb;
    color: #1a1a2e;
    font-family: 'Georgia', serif;
}

/* ========================
   NAVBAR
======================== */
.navbar {
    background: linear-gradient(135deg, #0770ad, #0a4f80);
    box-shadow: 0 2px 12px rgba(7, 112, 173, 0.3);
    padding: 16px 0;
    text-align: center;
}

.navbar-brand {
    font-size: 1.4rem;
    font-weight: bold;
    letter-spacing: 0.5px;
    color: #fff !important;
    text-decoration: none;
    display: block;
}

.navbar-nav {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.navbar-nav a {
    color: #fff !important;
    font-weight: 500;
    text-decoration: none;
    padding: 4px 12px;
    border-radius: 20px;
    transition: background-color 0.2s, color 0.2s;
}

.navbar-nav a:hover {
    background-color: #f87f34;
    color: #fff !important;
}

/* ========================
   PORTADA / HERO
======================== */
.portada {
    background: linear-gradient(135deg, #0770ad 0%, #0a4f80 50%, #f87f34 100%);
    min-height: 340px;
    border-radius: 0 0 24px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    color: #fff;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.portada::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.portada::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -40px;
    width: 250px;
    height: 250px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
}

.portada h1 {
    font-size: 3rem;
    font-weight: bold;
    text-shadow: 0 2px 8px rgba(0,0,0,0.2);
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.portada p {
    font-size: 1.2rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* ========================
   SECCIONES Y TÍTULOS
======================== */
h2 {
    text-decoration: none;
    font-size: 1.8rem;
    color: #0770ad;
    border-left: 5px solid #f87f34;
    padding-left: 14px;
    margin-bottom: 20px;
}

.top    { margin-top: 40px; }
.bottom { margin-bottom: 20px; }

/* ========================
   BOTONES DE FILTRO DE GÉNERO
======================== */
.btn-dark {
    background-color: #0770ad;
    border-color: #0770ad;
    border-radius: 20px;
    padding: 6px 18px;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-dark:hover {
    background-color: #f87f34;
    border-color: #f87f34;
}

.btn-outline-dark {
    color: #0770ad;
    border-color: #0770ad;
    border-radius: 20px;
    padding: 6px 18px;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-outline-dark:hover {
    background-color: #0770ad;
    color: #fff;
}

/* ========================
   TARJETAS DE LIBROS
======================== */
.libros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 28px;
    padding: 20px 0;
}

.libro-card {
    background: #fff;
    color: #1a1a2e;
    padding: 0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(7, 112, 173, 0.1);
    transition: transform 0.25s, box-shadow 0.25s;
    display: flex;
    flex-direction: column;
}

.libro-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(7, 112, 173, 0.2);
}

.libro-card img {
    width: 100%;
    height: 240px;
    object-fit: cover;
}

.libro-card h3 {
    font-size: 1.1rem;
    color: #0770ad;
    margin: 14px 18px 6px;
}

.libro-texto {
    font-size: 0.9rem;
    color: #555;
    margin: 0 18px 12px;
    flex-grow: 1;
}

.libro-card .btn {
    margin: 0 18px 18px;
    align-self: flex-start;
}

/* ===========================
    SINGLE LIBRO - contenido 
=============================*/
.single-libros .col-md-8 p,
.single-libros .col-md-8 div {
    line-height: 1.8;
    margin-bottom: 16px;
    font-size: 0.95rem;
    color: #333;
}

/* ========================
   TARJETAS DEL BLOG
======================== */
.card {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transition: transform 0.25s, box-shadow 0.25s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(7, 112, 173, 0.15);
}

.card-img-top {
    height: 200px;
    object-fit: cover;
}

.card-body {
    padding: 20px;
    background: #fff;
}

.card-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: #0770ad;
    margin-bottom: 8px;
}

.card-text {
    font-size: 0.88rem;
    color: #555;
    max-height: 3.5em;
    overflow: hidden;
}

.btn-primary {
    background-color: #f87f34;
    border-color: #f87f34;
    border-radius: 20px;
    padding: 6px 18px;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-primary:hover {
    background-color: #e06820;
    border-color: #e06820;
}

/* ========================
   FOOTER
======================== */
footer {
    background: linear-gradient(135deg, #0a4f80, #0770ad);
    color: #fff;
    text-align: center;
    padding: 28px 0;
    margin-top: 60px;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
}

/* ========================
   PÁGINA DE AUTOR
======================== */
.autor-card {
    max-width: 600px;
    margin: auto;
}

.autor-card img {
    border-radius: 12px;
}

.autor-img {
    width: 100%;
    height: 75vh;
    object-fit: cover;
    display: block;
}

/* BOTÓN VOLVER ARRIBA */
#btn-arriba {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #0770ad;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: background-color 0.2s;
    z-index: 999;
}

#btn-arriba:hover {
    background-color: #f87f34;
}

/* ANIMACIÓN TARJETAS */
.libro-card, .card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.libro-card.visible, .card.visible {
    opacity: 1;
    transform: translateY(0);
}