/*
Theme Name:   Hello Elementor Child
Theme URI:    https://silviaarzamendia.com
Description:  Hello Elementor Child Theme. Developed with AI assistance.
Author:       Silvia Arzamendia
Author URI:   https://silviaarzamendia.com
Template:     hello-elementor
Version:      1.2.0
Text Domain:  hello-elementor-child
*/

/* =============================================
   VARIABLES (defaults — se sobreescriben desde functions.php)
   ============================================= */
:root {
    --acento: #c0392b;
    --max-width-post: 820px;
}

/* =============================================
   FIX: sacar el hero del contenedor limitado
   ============================================= */
.single-post .site-main,
.page-con-hero .site-main {
    max-width: 100% !important;
    padding: 0;
}

body:has(.page-hero) {
    overflow-x: hidden;
}

/* =============================================
   HERO — posts (single.php)
   ============================================= */
.post-hero {
    position: relative;
    width: 100%;
    min-height: 420px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end;
}

.post-hero__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.post-hero__content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: var(--max-width-post);
    margin: 0 auto;
    padding: 40px 20px;
}

.post-hero .entry-title {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 700;
    line-height: 1.2;
    color: #ffffff;
    margin: 0 0 12px;
}

.post-hero .post-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.85);
}

.post-hero .post-meta .meta-sep {
    opacity: 0.6;
}

.post-hero .post-meta .meta-category a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid var(--acento);
    padding-bottom: 1px;
}

.post-hero .post-meta .meta-category a:hover {
    border-bottom-color: #fff;
}

.post-hero::after {
    content: "";
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--acento);
    z-index: 3;
}

@media (max-width: 600px) {
    .post-hero {
        min-height: 280px;
    }
}

/* =============================================
   HERO — páginas (page.php)
   ============================================= */
.page-hero {
    position: relative;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    min-height: var(--ph-altura-desktop, 420px);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: scroll;
    display: flex;
    align-items: flex-end;
    box-sizing: border-box;
}

.page-hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    /* color se aplica inline; opacity se maneja via rgba en page.php */
}

.page-hero__content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 20px;
}

/* Alineación */
.page-hero__content--left  { text-align: left; }
.page-hero__content--center { text-align: center; }

.page-hero__titulo {
    font-size: var(--ph-titulo-size, 42px);
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 12px;
    /* color se aplica inline desde PHP */
}

.page-hero__parrafo {
    font-size: var(--ph-parrafo-size, 18px);
    line-height: 1.6;
    margin: 0;
    /* color se aplica inline desde PHP */
}

@media (max-width: 768px) {
    .page-hero {
        min-height: var(--ph-altura-mobile, 260px);
    }

    .page-hero__titulo {
        font-size: clamp(1.4rem, 5vw, 2rem);
    }

    .page-hero__parrafo {
        font-size: clamp(0.9rem, 3vw, 1.1rem);
    }
}

/* =============================================
   CONTENIDO DEL POST / PÁGINA
   ============================================= */
.entry-content-wrap {
    padding: 48px 20px 64px;
}

.entry-content {
    max-width: var(--max-width-post);
    margin: 0 auto;
    font-size: 1rem;
    line-height: 1.8;
    color: #333;
}

.entry-content p {
    margin-bottom: 1.4em;
}

.entry-content h2,
.entry-content h3 {
    font-weight: 700;
    color: #1a1a1a;
    margin: 2em 0 0.6em;
}

.entry-content h2 { font-size: 1.5rem; }
.entry-content h3 { font-size: 1.25rem; }

.entry-content a {
    color: var(--acento);
    text-decoration: underline;
}

.entry-content ul,
.entry-content ol {
    padding-left: 1.5em;
    margin-bottom: 1.4em;
}

.entry-content li {
    margin-bottom: 0.5em;
}

/* =============================================
   NAVEGACIÓN ANTERIOR / SIGUIENTE
   ============================================= */
.post-navigation {
    max-width: var(--max-width-post);
    margin: 0 auto 48px;
    padding: 28px 20px 0;
    border-top: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.post-navigation a {
    color: var(--acento);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.post-navigation a:hover {
    text-decoration: underline;
}

/* =============================================
   LISTADO DE BLOG (archive, categoría, búsqueda)
   ============================================= */
.blog-listado {
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 20px 64px;
}

.listado-header {
    margin-bottom: 40px;
}

.listado-titulo {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px;
}

.listado-titulo span {
    color: var(--acento);
}

.listado-descripcion {
    color: #666;
    font-size: 1rem;
    margin: 0;
}

.listado-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    padding: 30px 0;
}

.blog-card {
    flex: 1 1 calc( (100% - (var(--card-columnas) - 1) * 28px) / var(--card-columnas) );
    max-width: calc( (100% - (var(--card-columnas) - 1) * 28px) / var(--card-columnas) );
    display: flex;
    flex-direction: column;
    list-style: none;
    margin: 0;
}

.card-imagen-link {
    display: block;
    text-decoration: none;
}

.card-imagen {
    width: 100%;
    height: var(--card-img-height);
    border-radius: var(--card-radius);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: opacity 0.25s ease;
}

.card-imagen-link:hover .card-imagen {
    opacity: 0.88;
}

.card-body {
    padding: 16px 0 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-meta {
    font-size: 0.8rem;
    color: #999;
}

.card-meta a {
    color: var(--acento);
    text-decoration: none;
}

.card-titulo {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0;
}

.card-titulo a {
    color: var(--card-titulo);
    text-decoration: none;
    transition: color 0.2s ease;
}

.card-titulo a:hover {
    color: var(--card-hover);
}

.card-excerpt {
    font-size: var(--excerpt-size);
    color: var(--excerpt-color);
    line-height: 1.6;
    margin: 0;
}

.listado-paginacion {
    margin-top: 48px;
    display: flex;
    justify-content: center;
}

.listado-paginacion .nav-links {
    display: flex;
    gap: 8px;
    align-items: center;
}

.listado-paginacion a,
.listado-paginacion span {
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--acento);
    border: 1px solid #e0e0e0;
}

.listado-paginacion .current {
    background: var(--acento);
    color: #fff;
    border-color: var(--acento);
}

.listado-vacio {
    color: #888;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .blog-card {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

/* Botón cargar más */
.cargar-mas-wrap {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.btn-cargar-mas {
    background: var(--acento);
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.btn-cargar-mas:hover {
    opacity: 0.85;
}

.btn-cargar-mas:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* =============================================
   FUENTE TIPOGRÁFICA — se aplica solo a noticias y páginas
   ============================================= */
.single-post .entry-title,
.single-post .entry-content,
.single-post .post-meta,
.post-hero__content,
.page-hero__content,
.listado-grid,
.listado-header,
.listado-paginacion {
    font-family: var(--fuente), sans-serif;
}

/* =============================================
   PAGE HERO — alineación vertical
   ============================================= */
.page-hero--valign-top    { align-items: flex-start; }
.page-hero--valign-center { align-items: center; }
.page-hero--valign-bottom { align-items: flex-end; }

/* =============================================
   META BOX — preview de imagen thumbnail
   ============================================= */
.hc-meta-img-preview {
    max-width: 200px !important;
    max-height: 120px !important;
    width: auto !important;
    height: auto !important;
    border-radius: 4px;
    margin-top: 6px;
    display: block;
    object-fit: cover;
}
/* =============================================
   MENÚ — chevron submenú (reemplaza Font Awesome)
   ============================================= */
.tahefobu-sub-icon {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    margin-left: 6px;
    vertical-align: middle;
}

.tahefobu-sub-icon::before {
    display: none;
}
