/*
 Theme Name:   Astra Llunara
 Theme URI:    https://llunara.es
 Description:  Tema hijo de Astra para Llunara
 Author:       Llunara
 Author URI:   https://llunara.es
 Template:     astra
 Version:      1.0.0
 Text Domain:  astra-llunara
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
*/

/* =============================================
   HEADER PRINCIPAL - Gradiente por categoría
   ============================================= */

.single-post .ast-primary-header-bar,
.single-post .ast-main-header-wrap,
.single-post #masthead {
    background: linear-gradient(135deg, #0a0c18, #1a1f38) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.35) !important;
}

/* Gradientes por categoría */
.single-post.category-astronomia-cosmos .ast-primary-header-bar,
.single-post.category-astronomia-cosmos .ast-main-header-wrap { background: linear-gradient(135deg, #0b1d4d, #1e3a8a, #3b82f6) !important; }

.single-post.category-psicologia .ast-primary-header-bar,
.single-post.category-psicologia .ast-main-header-wrap { background: linear-gradient(135deg, #2e0a4d, #6b21a8, #a855f7) !important; }

.single-post.category-horoscopo-astrologia .ast-primary-header-bar,
.single-post.category-horoscopo-astrologia .ast-main-header-wrap { background: linear-gradient(135deg, #4a0d2e, #9f1239, #db2777) !important; }

.single-post.category-historia-civilizaciones .ast-primary-header-bar,
.single-post.category-historia-civilizaciones .ast-main-header-wrap { background: linear-gradient(135deg, #451a03, #92400e, #d97706) !important; }

.single-post.category-criptografia .ast-primary-header-bar,
.single-post.category-criptografia .ast-main-header-wrap { background: linear-gradient(135deg, #064e3b, #0f766e, #14b8a6) !important; }

.single-post.category-misterios-enigmas .ast-primary-header-bar,
.single-post.category-misterios-enigmas .ast-main-header-wrap { background: linear-gradient(135deg, #450a0a, #991b1b, #ef4444) !important; }

.single-post.category-ciencia .ast-primary-header-bar,
.single-post.category-ciencia .ast-main-header-wrap { background: linear-gradient(135deg, #0c4a6e, #0369a1, #0ea5e9) !important; }

.single-post.category-opinion .ast-primary-header-bar,
.single-post.category-opinion .ast-main-header-wrap { background: linear-gradient(135deg, #3f3f07, #854d0e, #eab308) !important; }

.single-post.category-actualidad .ast-primary-header-bar,
.single-post.category-actualidad .ast-main-header-wrap { background: linear-gradient(135deg, #14532d, #166534, #4ade80) !important; }


/* =============================================
   TARJETAS DE ÚLTIMAS PUBLICACIONES (Adaptado)
   ============================================= */

.llunara-post-card {
    background: #16213e !important;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 30px;
    border: 1px solid rgba(255,255,255,0.08);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.llunara-post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(17, 87, 208, 0.3);
}

/* 1. Fuerza a la columna de la imagen a ocupar el 100% del alto */
.llunara-post-card .wp-block-columns {
    align-items: stretch !important;
}

.llunara-post-card .wp-block-column:first-child {
    display: flex;
    flex-direction: column;
}

/* 2. Imagen con zoom completo ocupando todo el contenedor sin altura fija */
.llunara-post-card .wp-block-post-featured-image {
    height: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    overflow: hidden;
}

.llunara-post-card .wp-block-post-featured-image a {
    display: block;
    height: 100% !important;
    width: 100% !important;
}

.llunara-post-card .wp-block-post-featured-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    transition: transform 0.5s ease;
}

.llunara-post-card:hover .wp-block-post-featured-image img {
    transform: scale(1.12);
}

/* 3. Textos mejorados y visibles */
.llunara-post-card .wp-block-post-title a {
    color: #ffffff !important;
    font-size: 1.4rem !important;
    line-height: 1.3;
}

.llunara-post-card:hover .wp-block-post-title a {
    color: #60a5fa !important;
}

.llunara-post-card .wp-block-post-excerpt {
    color: #e5e7eb !important;
    font-size: 1.02rem !important;
    line-height: 1.6;
}

/* 4. "Leer artículo completo" (Blanco por defecto, Amarillo al hover) */
.llunara-post-card p a {
    color: #ffffff !important;
    font-weight: 500;
    transition: color 0.2s ease;
    text-decoration: none;
}

.llunara-post-card p a:hover {
    color: #ffff00 !important;
    text-decoration: underline;
}

/* 5. Meta (autor y fecha) */
.llunara-post-card .wp-block-post-author,
.llunara-post-card .wp-block-post-author-name a,
.llunara-post-card .wp-block-post-date {
    color: #cbd5e1 !important;
    font-size: 0.92rem !important;
}

/* =============================================
   SEPARACIÓN entre Header y Contenido (solo entradas)
   ============================================= */

.single-post #primary {
    padding-top: 70px !important;
}

.single-post .ast-container {
    padding-top: 0 !important;
}

/* Línea sutil separadora (opcional pero elegante) */
.single-post #masthead:after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.3), transparent);
}

/* Responsivo */
@media (max-width: 768px) {
    
    .llunara-post-card .wp-block-post-featured-image {
        height: 180px;
    }
}

/* ===========================
   Ficha editorial - Llunara
   =========================== */

.llunara-editorial-box{
    background:#111827;
    border:1px solid #2b3645;
    border-radius:12px;
    padding:22px;
    margin-bottom:25px;
    font-size:15px;
    color:#ffffff;
    box-shadow:0 8px 18px rgba(0,0,0,.15);
}

.llunara-editorial-box h3{
    margin:0 0 18px 0;
    padding-bottom:10px;
    border-bottom:1px solid rgba(255,255,255,.08);
    font-size:20px;
    font-weight:700;
    color:#ffffff;
}

.llunara-item{
    margin-bottom:16px;
}

.llunara-item:last-child{
    margin-bottom:0;
}

.llunara-label{
    display:block;
    margin-bottom:4px;
    font-size:13px;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:.08em;
    color:rgba(255,255,255,.70);
}

.llunara-value{
    display:block;
    font-size:15px;
    line-height:1.5;
    font-weight:500;
    color:#ffffff;
}

/* Enlaces dentro de la ficha */
.llunara-editorial-box a{
    color:#ffffff;
    text-decoration:underline;
    transition:color .2s ease;
}

.llunara-editorial-box a:hover{
    color:#d4b06a;
}

.sidebar-main {
    margin-top: 70px;
}

/* Limpia el resaltado de botones de Astra en la sección del laboratorio */
body[class*="laboratorio"] button,
body[class*="laboratorio"] a:focus,
body[class*="laboratorio"] button:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* =============================================
   FICHA DE AUTOR - Llunara
   ============================================= */

.llunara-author-profile {
    background: linear-gradient(35deg, rgb(10,12,24) 0%, rgb(30,15,80) 73%, rgb(11,87,208) 100%);
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 50px;
    color: #ffffff;
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}

.llunara-author-header {
    display: flex;
    gap: 35px;
    align-items: flex-start;
}

.llunara-author-avatar {
    flex-shrink: 0;
}

.llunara-author-avatar img,
.llunara-author-avatar .avatar {
    width: 140px !important;
    height: 140px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    display: block;
    border: 3px solid rgba(255,255,255,0.25);
}

.llunara-author-name {
    font-size: 2.3rem;
    margin: 0 0 15px;
    color: #fff;
    font-weight: 700;
}

.llunara-author-bio {
    font-size: 1.1rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.92);
    margin-bottom: 25px;
}

.llunara-author-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.llunara-author-links a {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255,255,255,0.12);
    color: #fff !important;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.92rem;
    transition: all 0.2s ease;
}

.llunara-author-links a:hover {
    background: rgba(255,255,255,0.22);
}

.llunara-author-premios {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,0.15);
    font-size: 0.95rem;
    color: rgba(255,255,255,0.9);
}

.llunara-author-posts-title {
    font-size: 1.7rem;
    margin-bottom: 30px;
}

/* =============================================
   Publicaciones del autor - Diseño Horizontal (Corregido)
   ============================================= */

.llunara-posts-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
}

.llunara-author-posts .llunara-post-card {
    background: #16213e !important;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255,255,255,0.08);
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch;
    width: 100% !important;
    max-width: 100% !important;
}

.llunara-author-posts .llunara-post-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(17, 87, 208, 0.3);
}

/* Imagen a la izquierda */
.llunara-post-thumbnail {
    flex: 0 0 280px;
    width: 280px;
    min-width: 280px;
    overflow: hidden;
}

.llunara-post-thumbnail img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.5s ease;
    display: block;
}

.llunara-post-card:hover .llunara-post-thumbnail img {
    transform: scale(1.08);
}

/* Contenido a la derecha */
.llunara-post-content {
    padding: 28px 32px;
    flex: 1 1 auto;
    min-width: 0;               /* Muy importante para que el texto no se comprima */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.llunara-post-title {
    margin: 0 0 8px 0;
}

.llunara-post-title a {
    color: #ffffff !important;
    font-size: 1.4rem !important;
    line-height: 1.35;
    text-decoration: none;
    display: block;
}

.llunara-post-title a:hover {
    color: #60a5fa !important;
}

.llunara-post-meta {
    color: #cbd5e1;
    font-size: 0.92rem;
    margin: 6px 0 14px;
}

.llunara-post-excerpt {
    color: #e5e7eb;
    font-size: 1.02rem;
    line-height: 1.6;
    margin-bottom: 18px;
}

.llunara-read-more {
    color: #ffffff !important;
    font-weight: 500;
    text-decoration: none;
    margin-top: auto;
}

.llunara-read-more:hover {
    color: #ffff00 !important;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .llunara-author-posts .llunara-post-card {
        flex-direction: column !important;
    }

    .llunara-post-thumbnail {
        flex: none;
        width: 100%;
        min-width: 100%;
        height: 200px;
    }

    .llunara-post-thumbnail img {
        height: 200px !important;
    }

    .llunara-post-content {
        padding: 22px 20px;
    }
}

/* Color blanco inicial para el enlace Leer más de esta sección */
.llunara-post-card .wp-block-read-more {
    color: #ffffff !important;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

/* Color amarillo al pasar el ratón o enfocar */
.llunara-post-card .wp-block-read-more:hover,
.llunara-post-card .wp-block-read-more:focus {
    color: #ffff00 !important;
}

/* =======================================================
   ANCHO COMPLETO PARA PÁGINAS DE LABORATORIO
   ======================================================= */

/* Anula los paddings por defecto de Astra e impide desbordamientos */
body.es-pagina-laboratorio,
body.es-pagina-laboratorio #page {
    overflow-x: hidden !important;
    background-color: #0a0c18 !important;
}

@media (max-width: 768px) {
    body.es-pagina-laboratorio .ast-container,
    body.es-pagina-laboratorio .ast-container-fluid,
    body.es-pagina-laboratorio #content,
    body.es-pagina-laboratorio #primary,
    body.es-pagina-laboratorio .site-content,
    body.es-pagina-laboratorio .entry-content {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }
}