/**
* Theme Name: Eroica Child
* Description: This is a child theme of Eroica.
* Author: <a href="http://themeforest.net/user/vankarwai">HeyThemers</a>
* Template: eroica
* Version: 1.0
*/

/* =================================================================== */
/* CSS PERSONALIZADO — TEMA EROICA CHILD                                */
/* Versión unificada y reorganizada                                    */
/* =================================================================== */

/* =================================================================== */
/* 1. VARIABLES GLOBALES                                                */
/* =================================================================== */

:root {
    --wp--custom--spacing--default: 25rem;
    --wp--custom--spacing--01: 0.25rem;
    --wp--custom--spacing--05: 0.375rem;
    --wp--custom--spacing--10: 0.5rem;
    --wp--custom--spacing--15: 0.75rem;
    --wp--custom--spacing--20: 1rem;
    --wp--custom--spacing--30: 1.5rem;
    --wp--custom--spacing--40: 2.5rem;
    --wp--custom--spacing--50: 1.5rem;
    --wp--custom--spacing--60: 2rem;
    --wp--custom--spacing--70: 4.5rem;
    --wp--custom--spacing--80: 6rem;
    --wp--custom--spacing--90: 4.5rem;
    --wp--custom--spacing--100: 16rem;
    --wp--custom--spacing--110: 25rem;
    --wp--preset--font-size--huge: clamp(2.05rem, 6.67vw + 1.33rem, 7.99rem);
    --scale: 1;
    --heading-font-scale: 1;
}

img {
    border-radius: 0;
}

/* =================================================================== */
/* 2. TIPOGRAFÍA BASE                                                   */
/* =================================================================== */

body {
    font-family: 'freight-neo-pro', serif;
}

:root :where(p) {
    font-family: 'freight-neo-pro', serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'freight-display-pro', sans-serif;
}

.entry-header .entry-header-inner .entry-title {
    font-family: 'freight-display-pro', sans-serif;
}

#responsive-menu #cats-in-compact-menu li a {
    font-family: 'freight-display-pro', sans-serif;
    letter-spacing: -0.12rem;
}

/* =================================================================== */
/* 3. COMPONENTES GLOBALES                                              */
/* =================================================================== */

.wp-block-image figcaption.wp-element-caption,
.wp-block-gallery figcaption.wp-element-caption,
.wp-block-gallery .wp-block-image figcaption.wp-element-caption {
    font-family: "freight-neo-pro", serif;
    max-width: 690px;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-bottom: 2rem;
    padding-top: 0;
    text-align: right !important;
    width: auto;
}

/* Override parent theme gallery-specific width rules */
.wp-block-gallery.has-nested-images figure.wp-block-image:not(.alignfull) figcaption.wp-element-caption,
.wp-block-gallery.has-nested-images.columns-3 figure.wp-block-image:not(.alignfull):last-child figcaption.wp-element-caption {
    width: auto;
    max-width: 690px;
    margin-left: auto !important;
    text-align: right !important;
}

.wp-block-image figcaption.wp-element-caption::before,
.wp-block-gallery figcaption.wp-element-caption::before,
.wp-block-gallery .wp-block-image figcaption.wp-element-caption::before {
    content: "↵";
    font-family: Arial, sans-serif;
    font-size: 1em;
    display: inline-block;
    transform: rotate(90deg) translateY(-0.1em);
    margin-right: 0.7em;
    position: static;
}

.author-card-wrapper {
    margin-top: 10px;
}

.entry-content .post-body .is-style-cnvs-paragraph-callout {
    font-size: 1.25rem;
    font-weight: 700;
}

.wp-block-media-text .wp-block-media-text__content {
    font-size: 1rem;
}

.footer-text-2 {
    max-width: 85%;
}

.entry-content p {
    opacity: 0.8;
}

/* Enlaces — evitar ruptura incorrecta de líneas */
.entry-content a,
.post-body a {
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
}

/* =================================================================== */
/* 4. HERO — BASE (todas las variantes)                                 */
/* =================================================================== */

.hero-header-automated {
    position: relative;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    color: #FFFFFF;
    overflow: hidden;
}

.hero-header-automated * {
    box-sizing: border-box;
}

.hero-background {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.hero-background::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.1);
    z-index: 2;
}

.hero-content-overlay {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 2rem;
    max-width: 900px;
}

.hero-title {
    font-family: "freight-display-pro", sans-serif;
    line-height: 1;
    max-width: 75%;
    margin-inline: auto;
    letter-spacing: calc(.045em * (-1));
}

.hero-excerpt {
    font-family: "freight-neo-pro", serif;
    line-height: 1;
    font-weight: 400;
    opacity: 0.9;
    margin-top: 1rem;
}

/* =================================================================== */
/* 5. HERO — INTEGRACIÓN HEADER (todas las plantillas hero)             */
/* =================================================================== */

body[class*="post-template-single-hero"] #site,
body[class*="post-template-single-hero"] .header-content-wrapper {
    padding-top: 0 !important;
}

body[class*="post-template-single-hero"] #site-header {
    background: transparent !important;
    box-shadow: none !important;
    transition: background-color 0.3s ease-in-out;
}

body[class*="post-template-single-hero"] #site-header::after {
    display: none !important;
}

body[class*="post-template-single-hero"] #site .site-carry {
    margin-top: 0 !important;
}

body[class*="post-template-single-hero"] #site-logo img:not(.mobile-logo) {
    display: none !important;
}

body[class*="post-template-single-hero"] #site-logo img.mobile-logo {
    display: block !important;
}

body[class*="post-template-single-hero"] .lines {
    background: #FFFFFF !important;
}

body[class*="post-template-single-hero"] .lines:nth-child(2) {
    background: transparent !important;
}

.lines:nth-child(2) {
    display: none;
}

/* Header al hacer scroll */
body[class*="post-template-single-hero"] #site-header.add-bg {
    background: #FFFFFF !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05) !important;
}

body[class*="post-template-single-hero"] #site-header.add-bg::after {
    display: block !important;
}

body[class*="post-template-single-hero"] #site-header.add-bg #site-logo img:not(.mobile-logo) {
    display: block !important;
}

body[class*="post-template-single-hero"] #site-header.add-bg #site-logo img.mobile-logo {
    display: none !important;
}

body[class*="post-template-single-hero"] #site-header.add-bg .lines {
    background: var(--wp--preset--color--contrast) !important;
}

body[class*="post-template-single-hero"] #site-header.add-bg .lines:nth-child(2) {
    background: var(--wp--preset--color--contrast) !important;
}

/* =================================================================== */
/* 6. HERO — VARIANTES                                                  */
/* =================================================================== */

/* --- 6.1 HERO LEFT --- */
.hero-header-automated.hero-left {
    justify-content: flex-start;
    align-items: center;
}

.hero-header-automated.hero-left .hero-content-overlay {
    text-align: left;
    padding: 3rem;
    max-width: max(calc(1152px * var(--heading-font-scale)), calc(80vw * var(--scale) * var(--heading-font-scale)));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.hero-header-automated.hero-left .hero-byline {
    font-family: "freight-neo-pro", serif;
    font-size: clamp(0.75rem, 1vw, 0.95rem);
    font-weight: 400;
    letter-spacing: 0.03em;
    margin-bottom: 0.75rem;
}

.hero-header-automated.hero-left .hero-byline-author {
    font-weight: 400;
}

.hero-header-automated.hero-left .hero-title {
    margin-inline: 0;
    max-width: 100%;
    font-size: max(calc(90px * var(--heading-font-scale)), calc(7.5vw * var(--scale) * var(--heading-font-scale)));
    letter-spacing: -.04em;
    line-height: 0.95;
    text-wrap: auto;
}

.hero-header-automated.hero-left .hero-excerpt {
    display: block;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    font-size: clamp(0.85rem, 1.2vw, 1.1rem);
    line-height: 1.3;
    max-width: 600px;
}

/* --- 6.2 HERO CENTER --- */
.hero-header-automated.hero-center {
    justify-content: center;
    align-items: center;
}

.hero-header-automated.hero-center .hero-content-overlay {
    text-align: center;
    padding: 3rem 2rem;
    max-width: max(calc(1152px * var(--heading-font-scale)), calc(80vw * var(--scale) * var(--heading-font-scale)));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hero-header-automated.hero-center .hero-byline {
    font-family: "freight-neo-pro", serif;
    font-size: clamp(0.75rem, 1vw, 0.95rem);
    font-weight: 400;
    letter-spacing: 0.03em;
    margin-bottom: 0.75rem;
}

.hero-header-automated.hero-center .hero-byline-author {
    font-weight: 400;
}

.hero-header-automated.hero-center .hero-title {
    max-width: 90%;
    margin-inline: auto;
    font-size: max(calc(90px * var(--heading-font-scale)), calc(7.5vw * var(--scale) * var(--heading-font-scale)));
    letter-spacing: -.04em;
    line-height: 0.95;
    text-wrap: auto;
}

.hero-header-automated.hero-center .hero-excerpt {
    display: block;
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    font-size: clamp(0.85rem, 1.2vw, 1.1rem);
    line-height: 1.3;
    max-width: 600px;
}

/* --- 6.3 HERO BOTTOM LEFT --- */
.hero-header-automated.hero-bottom-left {
    justify-content: flex-start;
    align-items: flex-end;
}

.hero-header-automated.hero-bottom-left .hero-content-overlay {
    text-align: left;
    padding: 0 5vw 5vh;
    max-width: max(calc(1152px * var(--heading-font-scale)), calc(80vw * var(--scale) * var(--heading-font-scale)));
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
}

.hero-header-automated.hero-bottom-left .hero-byline {
    font-family: "freight-neo-pro", serif;
    font-size: clamp(0.75rem, 1vw, 0.95rem);
    font-weight: 400;
    letter-spacing: 0.03em;
    margin-bottom: 0.75rem;
}

.hero-header-automated.hero-bottom-left .hero-byline-author {
    font-weight: 400;
}

.hero-header-automated.hero-bottom-left .hero-title {
    margin-inline: 0;
    max-width: 100%;
    font-size: max(calc(90px * var(--heading-font-scale)), calc(7.5vw * var(--scale) * var(--heading-font-scale)));
    letter-spacing: -.04em;
    line-height: 0.95;
    text-wrap: auto;
}

.hero-header-automated.hero-bottom-left .hero-excerpt {
    display: block;
    margin-top: 2rem;
    margin-bottom: 2.5rem;
    font-size: clamp(0.85rem, 1.2vw, 1.1rem);
    line-height: 1.3;
    max-width: 600px;
}

/* =================================================================== */
/* 7. BLOG GRID — AJUSTES                                               */
/* =================================================================== */

.entries--grid .post-read-more-btn-wrapper {
    display: none;
}

.entries--grid .entry-thumbnail + .post-cat-list {
    margin-top: 0.1rem;
}

.entries--grid .post-cat-list .cat-item a {
    font-size: 0.9rem;
    font-weight: var(--wp--custom--font-weight--medium);
}

.entry-article .entry-item__thumblink {
    aspect-ratio: 16/9;
}

.entries--grid .entry-article .entry-item__inner .entry-item__excerpt {
    font-size: 0.95rem;
    line-height: 1;
}

/* =================================================================== */
/* 8. CONTENIDO — ESCRITORIO                                            */
/* =================================================================== */

@media screen and (min-width: 1024px) {
    .entry-content .post-body,
    .entry-content.page-content {
        row-gap: 1rem;
    }

    .entry-content .post-body > *,
    .entry-content.page-content > * {
    width: 800px;
    max-width: 100vw;
    margin-left: auto;
    margin-right: auto;
    }

    .wp-block-image.alignfull img,
    .wp-block-image.alignwide img {
        border-radius: 0;
    }

    .hero-header-automated.hero-left .hero-title,
    .hero-header-automated.hero-center .hero-title,
    .hero-header-automated.hero-bottom-left .hero-title {
        font-size: 8rem;
        letter-spacing: -0.05em;
        text-wrap: auto;
    }

    .entry-content .post-body p,
    .entry-content .post-body li {
        font-size: clamp(1rem, 5vw, 1.125rem);
        line-height: 1.33;
    }

    .entry-content .post-body h2 {
        font-size: clamp(2.5rem, 5vw, 5rem);
        margin-bottom: 1rem;
        font-weight: 300;
        letter-spacing: -0.04em;
    }

    .entry-content .post-body h3 {
        font-size: 3rem;
    }

    .entry-content .post-body > .alignwide {
        max-width: 70%;
        width: 100vw;
    }

    .wp-block-image figcaption.wp-element-caption,
    .wp-block-gallery figcaption.wp-element-caption,
    .wp-block-gallery .wp-block-image figcaption.wp-element-caption {
        font-size: 14px;
        width: clamp(145px, 90%, 720px);
    }
}

/* =================================================================== */
/* 9. CONTENIDO — MÓVIL                                                 */
/* =================================================================== */

@media screen and (max-width: 768px) {
    .entry-content .post-body,
    .entry-content.page-content {
        row-gap: 1rem;
    }

    /* Hero — todas las variantes */
    .hero-header-automated.hero-left {
        justify-content: center;
        align-items: center;
    }

    .hero-header-automated.hero-left .hero-content-overlay {
        text-align: left;
        max-width: 100vw;
        padding-left: 1rem;
        align-items: flex-start;
    }

    .hero-header-automated.hero-left .hero-title,
    .hero-header-automated.hero-center .hero-title,
    .hero-header-automated.hero-bottom-left .hero-title {
        font-size: 3rem;
        letter-spacing: -0.05em;
        text-wrap: auto;
    }

    .hero-header-automated.hero-left .hero-excerpt {
        display: block;
        opacity: .6;
    }

    .hero-header-automated.hero-center .hero-content-overlay {
        max-width: 100vw;
        padding: 2rem 1.25rem;
    }

    .hero-header-automated.hero-center .hero-byline {
        font-size: 0.75rem;
    }

    .hero-header-automated.hero-center .hero-excerpt {
        font-size: 0.85rem;
        max-width: 90vw;
    }

    .hero-header-automated.hero-bottom-left {
        align-items: flex-end;
    }

    .hero-header-automated.hero-bottom-left .hero-content-overlay {
        padding: 0 1.25rem 3vh;
        max-width: 100vw;
    }

    .hero-header-automated.hero-bottom-left .hero-byline {
        font-size: 0.75rem;
    }

    .hero-header-automated.hero-bottom-left .hero-excerpt {
        font-size: 0.85rem;
        max-width: 90vw;
    }

    /* Contenido */
    .entry-content .post-body p,
    .entry-content .post-body li {
        font-size: 1rem;
        line-height: 1.33;
        letter-spacing: -0.014em;
    }

    h2, h3, h4 {
        letter-spacing: -0.04em;
        max-width: 85%;
    }

    .entry-content .post-body > *,
    .entry-content.page-content > * {
        width: 100%;
        max-width: 85vw;
        margin-left: auto;
        margin-right: auto;
    }

    #primary .wp-block-image.alignfull {
        width: 100vw !important;
        max-width: 100vw;
        margin: 24px calc(-50vw + 50%);
    }

    .wp-block-image figcaption.wp-element-caption,
    .wp-block-gallery figcaption.wp-element-caption,
    .wp-block-gallery .wp-block-image figcaption.wp-element-caption {
        font-size: 12px;
    }
}

/* Para pantallas muy pequeñas */
@media (max-width: 480px) {
    .hero-header-automated.hero-bottom-left .hero-content-overlay {
        padding: 0 1rem 2.5vh;
    }

    .hero-header-automated.hero-left .hero-content-overlay {
        padding: 1.5rem 1rem;
        max-width: 100vw;
    }

    .hero-header-automated.hero-center .hero-content-overlay {
        padding: 1.5rem 1rem;
    }
}

/* =================================================================== */
/* 10. RELATED POSTS — GRID                                             */
/* =================================================================== */

.related-posts-child {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem 5rem;
}

.related-posts-child__title {
  font-family: "freight-neo-pro", serif;
  font-family: var(--wp--preset--font-family--secondary);
  font-size: var(--wp--preset--font-size--x-small);
  font-weight: 435;
  font-variation-settings: "wght" 435;
  letter-spacing: var(--wp--custom--letter-spacing--xl-looser);
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 2.5rem;
}

.related-posts-child__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* Card */
.related-post-card {
    display: flex;
    flex-direction: column;
}

.related-post-card__thumb {
    display: block;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    margin-bottom: 1rem;
}

.related-post-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.related-post-card:hover .related-post-card__thumb img {
    transform: scale(1.03);
}

.related-post-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.related-post-card__date {
    font-family: "freight-neo-pro", serif;
    font-size: 0.8rem;
    opacity: 0.5;
    letter-spacing: 0.02em;
}

.related-post-card__title {
    font-family: "freight-display-pro", sans-serif;
    font-size: clamp(1.3rem, 1.8vw, 1.75rem);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin: 0;
}

.related-post-card__title a {
    color: inherit;
    text-decoration: none;
}

.related-post-card__title a:hover {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.related-post-card__excerpt {
    font-family: "freight-neo-pro", serif;
    font-size: 0.9rem;
    line-height: 1.4;
    opacity: 0.6;
    margin: 0;
}

/* Related posts responsive */
@media screen and (max-width: 900px) {
    .related-posts-child__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .related-post-card:last-child {
        display: none;
    }
}
/* =================================================================== */
/* MARGEN EXTRA PARA PRIMER PÁRRAFO EN PLANTILLAS HERO                 */
/* =================================================================== */

.hero-post-content > p:first-of-type {
    margin-top: 3rem;
}

@media screen and (max-width: 768px) {
    .hero-post-content > p:first-of-type {
        margin-top: 2rem;
    }
}
@media screen and (max-width: 580px) {
    .related-posts-child {
        padding: 3rem 1.25rem 4rem;
    }

    .related-posts-child__grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .related-post-card:last-child {
        display: flex;
    }
}