/*
Theme Name: Storefront Child
Theme URI: http://editorialmilenio.com
Description: Tema fill de Storefront per a Editorial Milenio
Author: Joan Besa Recasens
Template: storefront
Version: 1.0.8
*/

/* --- 1. TIPOGRAFÍA Y GENERAL --- */
body, p, li, a {
    font-family: 'Roboto', sans-serif;
    font-weight: 400;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Roboto', sans-serif;
    font-weight: 500; 
    color: #222;
}

body a { text-decoration: none !important; transition: color 0.25s ease; }
body a:hover { color: rgba(0,0,0,0.75); }

/* --- 2. ESTRUCTURA Y CENTRADO --- */
.single-product .col-full, #content .col-full {
    margin: 0 auto !important;
    max-width: 1200px !important;
    float: none !important;
    display: block !important;
    padding: 0 20px !important;
}

/* --- 3. ESCRIPTORI (min-width: 769px) --- */
@media (min-width: 769px) {
    .milenio-columns-container { 
        display: flex !important; 
        gap: 60px; 
        align-items: flex-start; 
        justify-content: center; 
    }
    .milenio-col-left { flex: 0 0 30% !important; max-width: 30% !important; }
    .milenio-col-right { flex: 1; padding-left: 20px; }

    .milenio-author-block,
    .autor-flex {
        display: flex !important;
        gap: 40px;
        align-items: flex-start;
    }
    .autor-foto, .milenio-author-photo { flex-shrink: 0; width: 180px !important; }
    .autor-bio, .milenio-bio-text { flex: 1; }
}

/* --- 4. CATÁLOGO / TIENDA --- */
ul.products li.product {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important; /* Centrado horizontal */
    text-align: center !important;
}

/* Forzamos el marco de la imagen en el catálogo para el efecto vitrina */
ul.products li.product .woocommerce-LoopProduct-link img {
    height: 250px !important; 
    min-height: 250px !important;
    width: 100% !important;
    object-fit: contain !important;
    object-position: bottom center !important;
    margin-bottom: 20px !important;
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.product-author-loop {
    display: block !important;
    width: 100% !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 0.85rem !important; 
    color: #444 !important;
    min-height: 2.4em !important;
    line-height: 1.2 !important;
    margin-bottom: 8px !important;
    font-weight: 500 !important;
    text-align: center !important;
}

.woocommerce-loop-product__title {
    display: block !important;
    width: 100% !important;
    font-family: 'Jost', sans-serif !important;
    font-weight: 800 !important; 
    font-size: 1.15rem !important; 
    color: #000 !important;
    line-height: 1.1 !important;
    min-height: 2.6em !important;
    letter-spacing: -0.02em;
    margin-bottom: 15px !important;
    text-align: center !important;
}

/* --- 5. FICHA DE PRODUCTO INDIVIDUAL --- */
.product_title {
    font-family: 'Jost', sans-serif !important;
    font-weight: 800 !important;
    font-size: 2.4em !important; 
    line-height: 1.1;
    margin-bottom: 10px !important;
}

.subtitulo-producto-final {
    font-family: 'Montserrat', sans-serif !important;
    font-size: 1.3em;
    color: #666;
    margin-top: -5px;
    margin-bottom: 15px;
}

.single-product .milenio-main-price-container .amount {
    font-family: 'Montserrat', sans-serif;
    font-size: 28px !important;
    font-weight: 700 !important;
}

/* --- 6. BOTONES Y NAVEGACIÓN --- */
ul.products li.product .button,
.single-product .cart .button {
    font-family: 'Montserrat', sans-serif !important;
    border-radius: 25px !important;
    padding: 10px 24px !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.main-navigation ul li ul {
    background-color: #007D57 !important;
}
.main-navigation ul li ul li a { color: #ffffff !important; }

/* --- 7. BLOQUES DE AUTORES Y BIOS --- */
.autor-header { 
    background: #ffffff; 
    padding: 20px; 
    border: 1px solid #eee; 
    border-radius: 5px; 
}

.autor-foto img, .milenio-author-photo img {
    width: 180px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.milenio-bio-content, .description {
    line-height: 1.7;
    color: #555;
}

/* --- 8. ÍNDICE ALFABÉTICO (Shortcode) --- */
.autors-alfabetic {
    margin-top: 30px;
}

.autors-letters a {
    transition: all 0.2s ease;
}

.autors-letters a:hover {
    color: #16502e !important;
    font-size: 1.2em;
}

.autors-alfabetic h2 {
    font-family: 'Jost', sans-serif;
    font-weight: 800;
}

.autors-alfabetic ul li a {
    transition: color 0.2s ease;
}

.autors-alfabetic ul li a:hover {
    color: #16502e !important;
    text-decoration: underline !important;
}

/* --- 9. MÒBIL (max-width: 768px) --- */
@media (max-width: 768px) {
    .milenio-columns-container, .autor-flex, .milenio-author-block { 
        display: block !important; 
    }
    .milenio-col-left, .milenio-col-right, .autor-bio, .milenio-bio-text { 
        width: 100% !important; 
        max-width: 100% !important; 
        padding: 0 !important; 
    }
    .autor-foto, .milenio-author-photo { 
        margin: 0 auto 20px auto !important; 
        display: block !important; 
        text-align: center;
    }
    .product_title { font-size: 1.9em !important; }
}

/* --- 10. BLOQUES PORTADA Y CARRUSELES (Gutenberg) --- */
.wc-block-grid__product {
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

.wc-block-grid__product-image img {
    height: 250px !important; 
    object-fit: contain !important;
    object-position: bottom center !important;
    margin: 0 auto !important;
    display: block !important;
}

/* Atacamos los carruseles específicos de las secciones de portada */
#bloque-vendidos .wc-block-grid__product-image img,
#bloque-recomendados .wc-block-grid__product-image img {
    height: 270px !important;
    width: auto !important;
    margin: 0 auto !important;
}

.wc-block-grid__product-title,
.wc-block-grid__product-authors,
.wc-block-grid__product-price {
    text-align: center !important;
    width: 100% !important;
}

/* --- 11. DISEÑO DE NOTICIAS (Archive) --- */
@media (min-width: 768px) {
    .archive.category #main {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 40px !important;
    }
    .archive.category .page-header { grid-column: 1 / -1 !important; }
}

/* --- 12. AJUSTES FINALES DE CENTRADO CRÍTICO --- */
.wc-block-grid__product-link {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
}

.wc-block-grid__product-add-to-cart {
    justify-content: center !important;
}

/* --- 13. AJUSTE DE IMÁGENES EN ENTRADAS (Blog) --- */
.single-post article.post .post-thumbnail img, 
.blog article.post .post-thumbnail img, 
.archive article.post .post-thumbnail img,
.single-post .wp-post-image {
    max-width: 500px !important; 
    width: 100% !important;
    height: auto !important;
    margin: 0 auto 2em auto !important;
    display: block !important;
}

/* Centrar también el título de la entrada para que guarde simetría */
.single-post .entry-header, 
.blog .entry-header {
    text-align: center !important;
    margin-bottom: 1.5em !important;
}

/* --- 14. TAMAÑO DE TÍTULOS EN ENTRADAS (Blog) --- */

/* Título principal cuando abres la noticia */
.single-post .entry-title {
    font-size: 2rem !important; /* Estaba en 2.4em o más */
    line-height: 1.2 !important;
    margin-bottom: 0.5em !important;
    text-align: center !important;
}

/* Títulos en el listado del blog o archivos */
.blog .entry-title, 
.archive .entry-title {
    font-size: 1.5rem !important;
    line-height: 1.2 !important;
    text-align: center !important;
}

/* Ajuste opcional para los metadatos (fecha, autor) debajo del título */
.single-post .entry-meta {
    text-align: center !important;
    font-size: 0.9rem !important;
    margin-bottom: 2em !important;
}