/*
 * EchoBoomer — página de artigo (template Cloud tdb_templates, Newspaper)
 * Coluna de leitura de ~740px, tipografia confortável, cabeçalho centrado com pílulas coloridas,
 * "eco" nos subtítulos, cartão do autor e barra de progresso na cor da secção.
 * Os anúncios (.td-a-ad / .td-a-rec / .adsbygoogle) NÃO são tocados.
 */

/* ---------- Cor da secção do artigo: decide a PRIMEIRA categoria ---------- */
body.single:has(.tdb_single_categories .tdb-entry-category:first-child[href*="/tecnologia/"]){--eb-sec:var(--eb-c-tech)}
body.single:has(.tdb_single_categories .tdb-entry-category:first-child[href*="/cultura/"]){--eb-sec:var(--eb-c-cultura)}
body.single:has(.tdb_single_categories .tdb-entry-category:first-child[href*="/videojogos/"]){--eb-sec:var(--eb-c-jogos)}
body.single:has(.tdb_single_categories .tdb-entry-category:first-child[href*="/sociedade/"]){--eb-sec:var(--eb-c-mesa)}
body.single:has(.tdb_single_categories .tdb-entry-category:first-child[href*="/viagens/"]){--eb-sec:var(--eb-c-viagens)}

/* barra de progresso de leitura (melhoria progressiva: só onde há scroll-driven animations) */
@supports (animation-timeline:scroll()){
  body.single::after{
    content:"";position:fixed;top:0;left:0;z-index:99998;width:100%;height:3px;pointer-events:none;
    background:var(--eb-sec);transform-origin:0 50%;transform:scaleX(0);
    animation:eb-progress linear both;animation-timeline:scroll(root block)}
  @keyframes eb-progress{to{transform:scaleX(1)}}
}

/* ---------- Cabeçalho do artigo ---------- */
body.single .tdc-content-wrap .tdb_single_categories{text-align:center}
/* pílulas: cada uma com a cor da sua categoria */
body.single .tdc-content-wrap .tdb_single_categories .tdb-entry-category{--eb-pill:var(--eb-sec)}
body.single .tdc-content-wrap .tdb_single_categories .tdb-entry-category[href*="/tecnologia/"]{--eb-pill:var(--eb-c-tech)}
body.single .tdc-content-wrap .tdb_single_categories .tdb-entry-category[href*="/cultura/"]{--eb-pill:var(--eb-c-cultura)}
body.single .tdc-content-wrap .tdb_single_categories .tdb-entry-category[href*="/videojogos/"]{--eb-pill:var(--eb-c-jogos)}
body.single .tdc-content-wrap .tdb_single_categories .tdb-entry-category[href*="/sociedade/"]{--eb-pill:var(--eb-c-mesa)}
body.single .tdc-content-wrap .tdb_single_categories .tdb-entry-category[href*="/viagens/"]{--eb-pill:var(--eb-c-viagens)}
body.single .tdc-content-wrap .tdb_single_categories .tdb-entry-category{
  color:var(--eb-pill)!important;margin:0 4px!important;padding:8px 14px!important;
  font-family:Lato,sans-serif!important;font-size:11.5px!important;font-weight:800!important;
  letter-spacing:.1em;line-height:1!important}
body.single .tdc-content-wrap .tdb_single_categories .tdb-cat-bg{background-color:var(--eb-pill)!important;opacity:.12;border-radius:999px!important}
body.single .tdc-content-wrap .tdb_single_categories .tdb-cat-bg:before{display:none}
body.single .tdc-content-wrap .tdb_single_categories .tdb-entry-category:hover .tdb-cat-bg{opacity:.2}

body.single .tdc-content-wrap .tdb_title .tdb-title-text{
  max-width:920px;margin:16px auto 0;color:var(--eb-ink)!important;
  font-size:clamp(28px,3.8vw,46px)!important;line-height:1.12!important;font-weight:700!important;
  letter-spacing:-.02em;text-wrap:balance}
body.single .tdc-content-wrap .tdb_title .tdb-title-line{display:none}

body.single .tdc-content-wrap .tdb_single_author{margin-right:12px!important}
body.single .tdc-content-wrap .tdb_single_author .tdb-author-by{color:var(--eb-muted)!important;font-weight:600!important}
body.single .tdc-content-wrap .tdb_single_author .tdb-author-name{color:var(--eb-ink)!important;font-weight:800!important}
body.single .tdc-content-wrap .tdb_single_author .tdb-author-name:hover{color:var(--eb-sec)!important}
body.single .tdc-content-wrap .tdb_single_date{color:var(--eb-muted)!important;font-weight:600!important}
/* ponto e tempo de leitura vão no <time> (em linha); no bloco exterior ficavam acima/abaixo da data */
body.single .tdc-content-wrap .tdb_single_date time::before{
  content:"";display:inline-block;width:5px;height:5px;margin-right:12px;border-radius:50%;
  background:var(--eb-sec);vertical-align:middle;position:relative;top:-1px}
/* tempo de leitura: o texto vem do PHP na variável --eb-read */
body.single .tdc-content-wrap .tdb_single_date time::after{content:var(--eb-read,"");white-space:nowrap}

body.single .tdc-content-wrap .tdb_single_bg_featured_image{border-radius:24px!important;overflow:hidden;box-shadow:0 22px 56px rgba(15,23,42,.16)}
body.single .tdc-content-wrap .tdb_single_bg_featured_image .tdb-featured-image-bg{border-radius:inherit}

/* ---------- Coluna de leitura ---------- */
body.single .tdc-content-wrap .tdb_single_content .tdb-block-inner > *:not(.td-a-ad):not(.td-a-rec){max-width:740px;margin-left:auto;margin-right:auto}
body.single .tdc-content-wrap .vc_column:has(> .wpb_wrapper > .tdb_single_content) > .wpb_wrapper >
   *:not(.tdb_single_content):not(.td-a-ad):not(.td-a-rec):not(.td_block_empty_space){max-width:740px;margin-left:auto;margin-right:auto}

/* texto */
body.single .tdc-content-wrap .tdb_single_content .tdb-block-inner > p,
body.single .tdc-content-wrap .tdb_single_content .tdb-block-inner > ul,
body.single .tdc-content-wrap .tdb_single_content .tdb-block-inner > ol{
  color:#1e293b;font-size:17px!important;line-height:1.78!important;font-weight:500!important}
body.single .tdc-content-wrap .tdb_single_content .tdb-block-inner > p{margin-top:0;margin-bottom:1.15em}

/* subtítulos com o "eco" */
body.single .tdc-content-wrap .tdb_single_content .tdb-block-inner > h2{
  margin-top:2.1em;margin-bottom:.6em;color:var(--eb-ink)!important;
  font-size:clamp(22px,2.5vw,28px)!important;line-height:1.2!important;letter-spacing:-.015em}
body.single .tdc-content-wrap .tdb_single_content .tdb-block-inner > h2::before{
  content:"";display:inline-block;width:9px;height:9px;margin:0 18px 0 8px;border-radius:50%;
  background:var(--eb-sec);vertical-align:middle;position:relative;top:-3px;
  box-shadow:0 0 0 4px rgba(1,134,253,.22),0 0 0 8px rgba(1,134,253,.09);
  box-shadow:0 0 0 4px color-mix(in srgb,var(--eb-sec) 22%,transparent),0 0 0 8px color-mix(in srgb,var(--eb-sec) 9%,transparent)}
body.single .tdc-content-wrap .tdb_single_content .tdb-block-inner > h3{margin-top:1.8em;margin-bottom:.5em;color:var(--eb-ink)!important;letter-spacing:-.01em}

/* o 1.º subtítulo logo a seguir ao anúncio do topo funciona como resumo (standfirst) */
body.single .tdc-content-wrap .tdb_single_content .td-a-ad + h2{
  margin-top:8px;margin-bottom:34px;padding-left:18px;border-left:3px solid var(--eb-sec);
  color:#334155!important;font-size:clamp(18px,1.9vw,21px)!important;line-height:1.55!important;font-weight:600!important;letter-spacing:0}
body.single .tdc-content-wrap .tdb_single_content .td-a-ad + h2::before{display:none}
body.single .tdc-content-wrap .tdb_single_content .td-a-ad + h2 strong{font-weight:600}

/* ligações, listas, citações, imagens, vídeos */
body.single .tdc-content-wrap .tdb_single_content .tdb-block-inner > p a{
  color:var(--eb-accent);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px;
  text-decoration-color:rgba(1,134,253,.45);text-decoration-color:color-mix(in srgb,var(--eb-accent) 45%,transparent)}
body.single .tdc-content-wrap .tdb_single_content .tdb-block-inner > p a:hover{text-decoration-thickness:2px;text-decoration-color:currentColor}
body.single .tdc-content-wrap .tdb_single_content .tdb-block-inner > ul,
body.single .tdc-content-wrap .tdb_single_content .tdb-block-inner > ol{padding-left:1.4em;margin-bottom:1.3em}
body.single .tdc-content-wrap .tdb_single_content .tdb-block-inner li{margin:.4em 0}
body.single .tdc-content-wrap .tdb_single_content .tdb-block-inner li::marker{color:var(--eb-sec);font-weight:800}
body.single .tdc-content-wrap .tdb_single_content .tdb-block-inner > blockquote{
  margin-top:2em;margin-bottom:2em;padding:22px 26px;border:0;border-radius:18px;background:var(--eb-panel)}
body.single .tdc-content-wrap .tdb_single_content figure{margin-top:1.6em;margin-bottom:1.8em}
body.single .tdc-content-wrap .tdb_single_content .wp-block-image img{border-radius:16px}
body.single .tdc-content-wrap .tdb_single_content figcaption{margin-top:10px;color:var(--eb-muted);font-size:13px;text-align:center}
body.single .tdc-content-wrap .tdb_single_content .wp-block-embed__wrapper{border-radius:18px;overflow:hidden;box-shadow:0 10px 30px rgba(15,23,42,.12)}

/* ---------- Depois do texto ---------- */
/* cartão "Fonte Preferida" (HTML cru com estilos inline: vence-se com !important) */
body.single .tdc-content-wrap a[href*="google.com/preferences/source"]{
  background:var(--eb-panel)!important;border:0!important;border-radius:20px!important;box-shadow:none!important;margin-top:36px}
body.single .tdc-content-wrap a[href*="google.com/preferences/source"] > span{background:var(--eb-accent)!important;border-radius:999px!important}

/* caixa do autor */
body.single .tdc-content-wrap .tdb_single_author_box{padding:24px!important;border:0!important;border-radius:20px;background:var(--eb-panel)}
body.single .tdc-content-wrap .tdb_single_author_box .avatar,
body.single .tdc-content-wrap .tdb_single_author_box .tdb-author-photo:before,
body.single .tdc-content-wrap .tdb_single_author_box .tdb-author-photo:after{border-radius:50%!important}
body.single .tdc-content-wrap .tdb_single_author_box .tdb-author-name{color:var(--eb-ink)!important;font-size:18px;font-weight:800;letter-spacing:-.01em}
body.single .tdc-content-wrap .tdb_single_author_box .tdb-author-name:hover{color:var(--eb-sec)!important}
body.single .tdc-content-wrap .tdb_single_author_box .tdb-author-descr{color:#475569;font-size:14px;line-height:1.6}
body.single .tdc-content-wrap .tdb_single_author_box .tdb-social-item{color:var(--eb-ink)}
body.single .tdc-content-wrap .tdb_single_author_box .tdb-social-item:hover{color:var(--eb-sec)}

/* comentários */
body.single .tdc-content-wrap .tdb_single_comments .comment-reply-title{color:var(--eb-ink);font-weight:800;letter-spacing:-.01em}
body.single .tdc-content-wrap .tdb_single_comments input[type="submit"]{background:var(--eb-accent)!important;border-radius:999px!important}

/* ---------- Telemóvel ---------- */
@media (max-width:767px){
  body.single .tdc-content-wrap .tdb_single_content .tdb-block-inner > p,
  body.single .tdc-content-wrap .tdb_single_content .tdb-block-inner > ul,
  body.single .tdc-content-wrap .tdb_single_content .tdb-block-inner > ol{font-size:16px!important;line-height:1.7!important}
  body.single .tdc-content-wrap .tdb_single_bg_featured_image{border-radius:16px!important}
  body.single .tdc-content-wrap .tdb_single_author_box{padding:18px!important}
}
@media (prefers-reduced-motion:reduce){
  body.single::after{animation:none;transform:scaleX(0)}
}
