/* ==========================================================
   COPYPCV Dynamic News 3.0
   Todos los estilos quedan limitados al Hero y a sus tarjetas.
   ========================================================== */

#hero-noticia {
    --copypcv-news-primary: #17375e;
    --copypcv-news-accent: #0069a8;
    --copypcv-news-text: #3f4650;
    --copypcv-news-muted: #77808c;
    --copypcv-news-border: #dce2e8;

    position: relative;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

#hero-noticia.cargando-noticia {
    opacity: 0.5;
    transform: translateY(6px);
    pointer-events: none;
}

#hero-noticia.error-noticia::after {
    content: "No se ha podido cargar la noticia.";
    display: block;
    margin-top: 20px;
    padding: 14px 18px;
    border: 1px solid #d9a5a5;
    border-radius: 6px;
    background: #fff2f2;
    color: #8f2525;
}

#hero-imagen {
    min-height: clamp(260px, 42vw, 540px);
    width: 100%;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    border-radius: 10px;
}

#hero-imagen.sin-imagen {
    min-height: 0;
    display: none;
}

#hero-titulo {
    margin: 30px 0 10px;
    color: var(--copypcv-news-primary);
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.025em;
}

#hero-titulo h1,
#hero-titulo h2,
#hero-titulo h3,
#hero-titulo .elementor-heading-title {
    margin: 0;
    color: inherit;
    font: inherit;
    line-height: inherit;
    letter-spacing: inherit;
}

#hero-fecha {
    margin: 0 0 30px;
    color: var(--copypcv-news-muted);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#hero-fecha p,
#hero-fecha .elementor-widget-container {
    margin: 0;
}

#hero-contenido {
    max-width: 920px;
    margin: 0 auto;
    color: var(--copypcv-news-text);
    font-size: clamp(1rem, 1.2vw, 1.16rem);
    line-height: 1.8;
    overflow-wrap: anywhere;
}

#hero-contenido p {
    margin: 0 0 1.45em;
}

#hero-contenido h2,
#hero-contenido h3,
#hero-contenido h4 {
    color: var(--copypcv-news-primary);
    font-weight: 700;
    line-height: 1.25;
}

#hero-contenido h2 {
    margin: 2em 0 0.65em;
    font-size: clamp(1.55rem, 2.4vw, 2.15rem);
}

#hero-contenido h3 {
    margin: 1.7em 0 0.6em;
    font-size: clamp(1.3rem, 2vw, 1.7rem);
}

#hero-contenido h4 {
    margin: 1.5em 0 0.5em;
    font-size: 1.15rem;
}

#hero-contenido a {
    color: var(--copypcv-news-accent);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

#hero-contenido a:hover,
#hero-contenido a:focus-visible {
    text-decoration-thickness: 2px;
}

#hero-contenido img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 2em auto;
    border-radius: 8px;
}

#hero-contenido figure {
    max-width: 100%;
    margin: 2em auto;
}

#hero-contenido figcaption {
    margin-top: 8px;
    color: var(--copypcv-news-muted);
    font-size: 0.85rem;
    line-height: 1.5;
    text-align: center;
}

#hero-contenido ul,
#hero-contenido ol {
    margin: 1.4em 0 1.6em;
    padding-left: 1.6em;
}

#hero-contenido li {
    margin-bottom: 0.55em;
}

#hero-contenido blockquote {
    margin: 2em 0;
    padding: 0.4em 0 0.4em 1.4em;
    border-left: 4px solid var(--copypcv-news-accent);
    color: #5c6570;
    font-size: 1.08em;
    font-style: italic;
}

#hero-contenido iframe,
#hero-contenido video,
#hero-contenido embed {
    max-width: 100%;
}

#hero-contenido table {
    width: 100%;
    margin: 2em 0;
    border-collapse: collapse;
    font-size: 0.95rem;
}

#hero-contenido th,
#hero-contenido td {
    padding: 10px 12px;
    border: 1px solid var(--copypcv-news-border);
    text-align: left;
    vertical-align: top;
}

/* Tarjeta seleccionada en la página Noticias. */
#hero-noticia ~ * .copypcv-loop-activo,
.copypcv-loop-activo {
    outline: 2px solid var(--copypcv-news-accent, #0069a8);
    outline-offset: 5px;
    border-radius: 6px;
}

@media (max-width: 767px) {
    #hero-titulo {
        margin-top: 22px;
    }

    #hero-fecha {
        margin-bottom: 22px;
    }

    #hero-contenido {
        line-height: 1.7;
    }
}

@media (prefers-reduced-motion: reduce) {
    #hero-noticia {
        transition: none;
    }

    html {
        scroll-behavior: auto;
    }
}
