/* =========================================================
   REVISTA PREMIUM (WordPress + Elementor + "Añadir medios")
   Activo solo con <body class="dwpro-cat-lectura">
   ========================================================= */

body.dwpro-cat-lectura{
  --dw-ink: #111;
  --dw-text: #2f2f2f;
  --dw-muted: #666;
  --dw-line: rgba(0,0,0,.10);
  --dw-surface: #fff;
  --dw-surface-2: rgba(0,0,0,.035);
  --dw-shadow: 0 18px 50px rgba(0,0,0,.08);

  /* Azul editorial */
  --dw-link: #1f4ed8;
  --dw-link-hover: #163bb0;

  /* CTA */
  --dw-cta: #1f4ed8;
  --dw-cta-hover: #163bb0;
}

/* =========================================================
   CABECERA (H1 real del tema)
   <div class="page-header"><h1 class="entry-title">...</h1></div>
   ========================================================= */

body.dwpro-cat-lectura .page-header{
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(28px, 3.5vw, 60px) clamp(18px, 3vw, 42px) 0;
}

body.dwpro-cat-lectura .page-header .entry-title{
  margin: 0;
  padding: 12px 0 20px;
  font-size: clamp(30px, 3.8vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--dw-ink);
}

body.dwpro-cat-lectura .page-header .entry-title::after{
  content: "";
  display: block;
  width: min(110px, 32%);
  height: 3px;
  margin-top: 16px;
  background: rgba(0,0,0,.16);
  border-radius: 999px;
}

/* =========================================================
   CONTENIDO — tarjeta editorial
   (varios contenedores comunes + fallback)
   ========================================================= */

body.dwpro-cat-lectura :where(
  .entry-content,
  .single-entry-content,
  .the-content,
  .post-content,
  .post_content,
  .wp-block-post-content,
  .elementor-widget-theme-post-content,
  .site-main
){
  max-width: 760px;
  margin: 16px auto 0;
  padding: clamp(22px, 3vw, 42px);
  background: var(--dw-surface);
  border: 1px solid var(--dw-line);
  border-radius: 18px;
  box-shadow: var(--dw-shadow);

  font-size: 18px;
  line-height: 1.9;
  color: var(--dw-text);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Ritmo de lectura */
body.dwpro-cat-lectura :where(p, ul, ol, blockquote){
  margin: 0 0 18px 0;
}

body.dwpro-cat-lectura :where(ul, ol){
  padding-left: 1.15em;
  margin-top: 8px;
}

body.dwpro-cat-lectura li{
  margin: 7px 0;
}

/* =========================================================
   DEK / LEAD (primer párrafo) — compatible con Elementor
   - En escritorio: un poco mayor y más “gris editorial”
   ========================================================= */

body.dwpro-cat-lectura :where(
  .entry-content,
  .single-entry-content,
  .the-content,
  .post-content,
  .post_content,
  .wp-block-post-content,
  .elementor-widget-theme-post-content,
  .site-main
) :where(.elementor-text-editor, .elementor-widget-container, .entry-content, .post-content, .the-content) p:first-of-type{
  font-size: 1.08em;
  line-height: 1.95;
  color: rgba(0,0,0,.70);
  margin-top: 2px;
  margin-bottom: 24px;
}

/* =========================================================
   H2 / H3 — jerarquía revista (escritorio)
   ========================================================= */

body.dwpro-cat-lectura :where(
  .entry-content,
  .single-entry-content,
  .the-content,
  .post-content,
  .post_content,
  .wp-block-post-content,
  .elementor-widget-theme-post-content,
  .site-main
) h2{
  margin: 44px 0 14px;
  padding-top: 6px;
  padding-bottom: 12px;                 /* separador estilo prensa */
  border-bottom: 1px solid rgba(0,0,0,.08);
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--dw-ink);
  position: relative;
}

body.dwpro-cat-lectura :where(
  .entry-content,
  .single-entry-content,
  .the-content,
  .post-content,
  .post_content,
  .wp-block-post-content,
  .elementor-widget-theme-post-content,
  .site-main
) h2::before{
  content: "";
  position: absolute;
  left: -14px;
  top: 14px;
  width: 6px;
  height: 24px;
  background: rgba(0,0,0,.18);
  border-radius: 999px;
}

body.dwpro-cat-lectura :where(
  .entry-content,
  .single-entry-content,
  .the-content,
  .post-content,
  .post_content,
  .wp-block-post-content,
  .elementor-widget-theme-post-content,
  .site-main
) h3{
  margin: 28px 0 10px;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--dw-ink);
}

body.dwpro-cat-lectura :where(
  .entry-content,
  .single-entry-content,
  .the-content,
  .post-content,
  .post_content,
  .wp-block-post-content,
  .elementor-widget-theme-post-content,
  .site-main
) h3::after{
  content: "";
  display: block;
  width: 56px;
  height: 2px;
  margin-top: 10px;
  background: rgba(0,0,0,.12);
  border-radius: 999px;
}

/* =========================================================
   ENLACES — azul distinguible
   ========================================================= */

body.dwpro-cat-lectura :where(
  .entry-content,
  .single-entry-content,
  .the-content,
  .post-content,
  .post_content,
  .wp-block-post-content,
  .elementor-widget-theme-post-content,
  .site-main
) a{
  color: var(--dw-link);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;   /* “prensa”, más limpio */
  text-underline-offset: 3px;
  transition: color .15s ease, background-color .15s ease;
}

body.dwpro-cat-lectura :where(
  .entry-content,
  .single-entry-content,
  .the-content,
  .post-content,
  .post_content,
  .wp-block-post-content,
  .elementor-widget-theme-post-content,
  .site-main
) a:hover{
  color: var(--dw-link-hover);
  background: rgba(31, 78, 216, .06);
  border-radius: 6px;
}

/* =========================================================
   CTA — SOLO botones/bloques (no enlaces dentro de frases, no imágenes)
   Gutenberg Buttons: .wp-block-button__link
   Gutenberg File:    .wp-block-file__button
   Manual opcional:   a.dwpro-cta
   ========================================================= */

body.dwpro-cat-lectura :where(.wp-block-buttons, .wp-block-file){
  margin: 26px 0;
}

body.dwpro-cat-lectura :where(
  .wp-block-button__link,
  .wp-block-file__button,
  a.dwpro-cta
){
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  padding: 12px 22px;
  border-radius: 999px;
  background: var(--dw-cta);
  color: #fff !important;
  text-decoration: none !important;
  font-weight: 700;

  border: 1px solid var(--dw-cta);
  box-shadow: 0 10px 24px rgba(31, 78, 216, .18);
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}

body.dwpro-cat-lectura :where(
  .wp-block-button__link,
  .wp-block-file__button,
  a.dwpro-cta
)::after{
  content: "→";
  opacity: .9;
  transform: translateY(-1px);
}

body.dwpro-cat-lectura :where(
  .wp-block-button__link,
  .wp-block-file__button,
  a.dwpro-cta
):hover{
  background: var(--dw-cta-hover);
  border-color: var(--dw-cta-hover);
  transform: translateY(-2px);
}

body.dwpro-cat-lectura :where(
  .wp-block-button__link,
  .wp-block-file__button,
  a.dwpro-cta
) img{
  max-height: 1.2em;
  width: auto;
}

/* =========================================================
   BLOCKQUOTE — premium
   ========================================================= */

body.dwpro-cat-lectura blockquote{
  margin: 24px 0;
  padding: 18px 20px;
  background: var(--dw-surface-2);
  border-left: 4px solid rgba(0,0,0,.18);
  border-radius: 14px;
  color: #444;
}

body.dwpro-cat-lectura blockquote p{
  margin: 0;
}

/* =========================================================
   IMÁGENES — "Añadir medios" (clásico) + captions
   Respeta aligncenter/alignleft/alignright
   ========================================================= */

body.dwpro-cat-lectura :where(
  .entry-content,
  .single-entry-content,
  .the-content,
  .post-content,
  .post_content,
  .wp-block-post-content,
  .elementor-widget-theme-post-content,
  .site-main
) img{
  max-width: 100%;
  height: auto;
  border-radius: 16px;
}

/* Centrado */
body.dwpro-cat-lectura :where(
  .entry-content,
  .single-entry-content,
  .the-content,
  .post-content,
  .post_content,
  .wp-block-post-content,
  .elementor-widget-theme-post-content,
  .site-main
) :where(img.aligncenter, .aligncenter img),
body.dwpro-cat-lectura :where(
  .entry-content,
  .single-entry-content,
  .the-content,
  .post-content,
  .post_content,
  .wp-block-post-content,
  .elementor-widget-theme-post-content,
  .site-main
) a > img.aligncenter{
  display: block !important;
  margin: 20px auto !important;
}

/* Izquierda / derecha */
body.dwpro-cat-lectura :where(
  .entry-content,
  .single-entry-content,
  .the-content,
  .post-content,
  .post_content,
  .wp-block-post-content,
  .elementor-widget-theme-post-content,
  .site-main
) img.alignleft{
  float: left !important;
  margin: 8px 18px 14px 0 !important;
}

body.dwpro-cat-lectura :where(
  .entry-content,
  .single-entry-content,
  .the-content,
  .post-content,
  .post_content,
  .wp-block-post-content,
  .elementor-widget-theme-post-content,
  .site-main
) img.alignright{
  float: right !important;
  margin: 8px 0 14px 18px !important;
}

/* Captions (wp-caption clásico) */
body.dwpro-cat-lectura :where(
  .entry-content,
  .single-entry-content,
  .the-content,
  .post-content,
  .post_content,
  .wp-block-post-content,
  .elementor-widget-theme-post-content,
  .site-main
) :where(figure.wp-caption, div.wp-caption){
  max-width: 100% !important;
  margin: 20px 0;
}

body.dwpro-cat-lectura :where(
  .entry-content,
  .single-entry-content,
  .the-content,
  .post-content,
  .post_content,
  .wp-block-post-content,
  .elementor-widget-theme-post-content,
  .site-main
) :where(figure.wp-caption.aligncenter, div.wp-caption.aligncenter){
  margin-left: auto !important;
  margin-right: auto !important;
  text-align: center;
}

body.dwpro-cat-lectura :where(.wp-caption-text, figcaption){
  margin-top: 8px;
  font-size: .92em;
  line-height: 1.5;
  color: var(--dw-muted);
}

/* Limpieza de floats */
body.dwpro-cat-lectura :where(
  .entry-content,
  .single-entry-content,
  .the-content,
  .post-content,
  .post_content,
  .wp-block-post-content,
  .elementor-widget-theme-post-content,
  .site-main
) :where(p, ul, ol, figure, div.wp-caption){
  clear: both;
}

/* =========================================================
   MÓVIL
   - Tipografía global un poco mayor
   - H1 ajustado
   - H2/H3 más visibles + aire a la izquierda
   - Barra lateral del H2 más larga
   - Primer párrafo nunca más pequeño (incluye hijos)
   ========================================================= */

@media (max-width: 680px){
  body.dwpro-cat-lectura :where(
    .entry-content,
    .single-entry-content,
    .the-content,
    .post-content,
    .post_content,
    .wp-block-post-content,
    .elementor-widget-theme-post-content,
    .site-main
  ) img.alignleft,
  body.dwpro-cat-lectura :where(
    .entry-content,
    .single-entry-content,
    .the-content,
    .post-content,
    .post_content,
    .wp-block-post-content,
    .elementor-widget-theme-post-content,
    .site-main
  ) img.alignright{
    float: none !important;
    display: block !important;
    margin: 16px auto !important;
  }
}

@media (max-width: 520px){

  body.dwpro-cat-lectura .page-header{
    padding: 22px 16px 0;
  }

  body.dwpro-cat-lectura .page-header .entry-title{
    font-size: clamp(30px, 8vw, 40px);
    padding: 10px 0 18px;
  }

  body.dwpro-cat-lectura :where(
    .entry-content,
    .single-entry-content,
    .the-content,
    .post-content,
    .post_content,
    .wp-block-post-content,
    .elementor-widget-theme-post-content,
    .site-main
  ){
    padding: 20px 16px;
    font-size: 18px; /* +1 respecto a escritorio base */
    line-height: 1.8;
    border-radius: 16px;
  }

  /* Encabezados con aire a la izquierda */
  body.dwpro-cat-lectura :where(
    .entry-content,
    .single-entry-content,
    .the-content,
    .post-content,
    .post_content,
    .wp-block-post-content,
    .elementor-widget-theme-post-content,
    .site-main
  ) :where(h2, h3){
    padding-left: 12px;
  }

  body.dwpro-cat-lectura :where(
    .entry-content,
    .single-entry-content,
    .the-content,
    .post-content,
    .post_content,
    .wp-block-post-content,
    .elementor-widget-theme-post-content,
    .site-main
  ) h2{
    font-size: 1.35em;
    line-height: 1.22;
    font-weight: 800;
    margin: 34px 0 12px;
  }

  body.dwpro-cat-lectura :where(
    .entry-content,
    .single-entry-content,
    .the-content,
    .post-content,
    .post_content,
    .wp-block-post-content,
    .elementor-widget-theme-post-content,
    .site-main
  ) h2::before{
    left: -14px;
    width: 7px;
    height: 34px;
    top: 10px;
    background: rgba(0,0,0,.24);
  }

  body.dwpro-cat-lectura :where(
    .entry-content,
    .single-entry-content,
    .the-content,
    .post-content,
    .post_content,
    .wp-block-post-content,
    .elementor-widget-theme-post-content,
    .site-main
  ) h3{
    font-size: 1.15em;
    line-height: 1.25;
    font-weight: 750;
    margin: 24px 0 10px;
  }

  body.dwpro-cat-lectura :where(
    .entry-content,
    .single-entry-content,
    .the-content,
    .post-content,
    .post_content,
    .wp-block-post-content,
    .elementor-widget-theme-post-content,
    .site-main
  ) h3::after{
    width: 64px;
    height: 3px;
    background: rgba(0,0,0,.16);
  }

  /* Párrafos base móvil */
  body.dwpro-cat-lectura :where(
    .entry-content,
    .single-entry-content,
    .the-content,
    .post-content,
    .post_content,
    .wp-block-post-content,
    .elementor-widget-theme-post-content,
    .site-main
  ) p{
    font-size: 1em !important;
    line-height: 1.75;
  }

  /* Primer párrafo: ligeramente mayor y SIEMPRE consistente */
  body.dwpro-cat-lectura :where(
    .entry-content,
    .single-entry-content,
    .the-content,
    .post-content,
    .post_content,
    .wp-block-post-content,
    .elementor-widget-theme-post-content,
    .site-main
  ) > p:first-of-type{
    font-size: 1.12em !important;
    line-height: 1.85 !important;
  }

  body.dwpro-cat-lectura :where(
    .entry-content,
    .single-entry-content,
    .the-content,
    .post-content,
    .post_content,
    .wp-block-post-content,
    .elementor-widget-theme-post-content,
    .site-main
  ) > p:first-of-type *{
    font-size: inherit !important;
    line-height: inherit !important;
  }

  body.dwpro-cat-lectura :where(
    .entry-content,
    .single-entry-content,
    .the-content,
    .post-content,
    .post_content,
    .wp-block-post-content,
    .elementor-widget-theme-post-content,
    .site-main
  ) :where(.has-small-font-size, .is-small-text, .small-text){
    font-size: inherit !important;
  }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce){
  body.dwpro-cat-lectura a,
  body.dwpro-cat-lectura :where(.wp-block-button__link, .wp-block-file__button, a.dwpro-cta){
    transition: none;
  }
}
