/* =====================================================================
   Entrada individual (single post) y páginas estándar — se carga solo ahí.
   Las reglas con "body:is(.single-post, .calc-pagina)" valen para ambas.
   Usa las variables de marca.css; las tarjetas de "Sigue leyendo" usan
   los estilos de noticias.css (también se carga aquí).

   Solo presentación: el título, el contenido y los metadatos siguen
   saliendo del marcado de GeneratePress sin cambios.
   ===================================================================== */

/* ---- Franja de marca con la ruta de navegación ---- */
.entrada-banda {
    padding: 1.4rem 1rem 6rem;
    background:
        radial-gradient(ellipse 55% 140% at 90% 0%, rgba(63, 159, 225, 0.5), transparent 62%),
        radial-gradient(ellipse 40% 120% at 4% 100%, rgba(63, 159, 225, 0.25), transparent 62%),
        linear-gradient(135deg, var(--marca) 0%, #0f4a8f 55%, var(--accion) 100%);
}

.entrada-banda__interior {
    max-width: 1200px;
    margin: 0 auto;
}

.entrada-ruta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
}

body .entrada-ruta a {
    color: rgba(255, 255, 255, 0.92);
    font-weight: 600;
    text-decoration: none;
}

body .entrada-ruta a:hover,
body .entrada-ruta a:focus-visible {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* La tarjeta del artículo y el sidebar solapan la franja, como en la calculadora */
body:is(.single-post, .calc-pagina) #page {
    position: relative;
    z-index: 1;
    margin-top: -4.25rem;
}

/* ---- Tarjeta del artículo ---- */
body:is(.single-post, .calc-pagina) .inside-article {
    padding: clamp(1.5rem, 4vw, 3rem);
    border-radius: 20px;
    box-shadow: 0 20px 48px rgba(11, 45, 94, 0.14), 0 2px 6px rgba(11, 45, 94, 0.05);
}

body:is(.single-post, .calc-pagina) .entry-title {
    margin: 0 0 1.5rem;
    font-size: clamp(1.9rem, 3.6vw, 2.6rem);
    line-height: 1.15;
    letter-spacing: -0.025em;
}

/* ---- Lectura ---- */
body:is(.single-post, .calc-pagina) .entry-content p { margin-bottom: 1.15em; }

/* Muchas entradas llevan un segundo <h1> dentro del contenido. El marcado no se
   toca (es contenido), pero visualmente se trata como un subtítulo para que no
   parezca el título repetido. */
body:is(.single-post, .calc-pagina) .entry-content h1 {
    margin: 2.6rem 0 0.9rem;
    font-size: clamp(1.4rem, 2.4vw, 1.75rem);
    line-height: 1.25;
    letter-spacing: -0.015em;
    scroll-margin-top: 96px;
}

body:is(.single-post, .calc-pagina) .entry-content > h1:first-child { margin-top: 0; }

body:is(.single-post, .calc-pagina) .entry-content h2 {
    margin: 2.6rem 0 0.9rem;
    font-size: clamp(1.4rem, 2.4vw, 1.75rem);
    line-height: 1.25;
    scroll-margin-top: 96px; /* por si se enlaza a un apartado: que no lo tape la cabecera fija */
}

/* 9 de las entradas llevan en cada subtítulo un estilo en línea del diseño
   anterior (barra azul a la izquierda). Se neutraliza aquí, sin tocar el
   contenido, para que todas las entradas se vean igual. */
body:is(.single-post, .calc-pagina) .entry-content h2[style],
body:is(.single-post, .calc-pagina) .entry-content h3[style] {
    border-left: 0 !important;
    padding-left: 0 !important;
}

body:is(.single-post, .calc-pagina) .entry-content h3 {
    margin: 1.9rem 0 0.6rem;
    font-size: 1.2rem;
    line-height: 1.3;
    scroll-margin-top: 96px;
}

body:is(.single-post, .calc-pagina) .entry-content ul,
body:is(.single-post, .calc-pagina) .entry-content ol {
    margin: 0 0 1.4em;
    padding-left: 1.4rem;
}

body:is(.single-post, .calc-pagina) .entry-content li { margin-bottom: 0.45rem; }
body:is(.single-post, .calc-pagina) .entry-content li::marker { color: var(--accion); }
body:is(.single-post, .calc-pagina) .entry-content ol li::marker { font-weight: 700; }

body:is(.single-post, .calc-pagina) .entry-content figure { margin: 2rem 0; }

body:is(.single-post, .calc-pagina) .entry-content figcaption {
    margin-top: 0.6rem;
    font-size: 0.82rem;
    color: var(--texto-suave);
    text-align: center;
}

/* ---- Tablas ---- */
body:is(.single-post, .calc-pagina) .entry-content table {
    width: 100%;
    margin: 1.75rem 0;
    border-collapse: separate;
    border-spacing: 0;
    border: var(--card-borde);
    border-radius: 12px;
    overflow: hidden;
    font-size: 0.92rem;
}

body:is(.single-post, .calc-pagina) .entry-content table th {
    padding: 0.8rem 1rem;
    border: 0;
    border-bottom: 1px solid #cfe3f4;
    background: var(--tinte);
    color: var(--marca);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-align: left;
    text-transform: uppercase;
}

body:is(.single-post, .calc-pagina) .entry-content table td {
    padding: 0.8rem 1rem;
    border: 0;
    border-bottom: 1px solid #eef2f7;
}

body:is(.single-post, .calc-pagina) .entry-content table tbody tr:last-child td { border-bottom: 0; }
body:is(.single-post, .calc-pagina) .entry-content table tbody tr:hover td { background: #f8fbfe; }

/* ---- Aviso hacia la calculadora ---- */
.entrada-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 2.75rem;
    padding: 1.6rem 1.75rem;
    border-radius: 16px;
    color: #fff;
    background:
        radial-gradient(ellipse 60% 140% at 100% 0%, rgba(63, 159, 225, 0.5), transparent 62%),
        linear-gradient(135deg, var(--accion), var(--marca));
}

.entrada-cta__titulo {
    margin: 0 0 0.3rem;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.25;
    color: #fff;
}

.entrada-cta__desc {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.86);
}

body .entrada-cta__boton,
body .entrada-cta__boton:hover,
body .entrada-cta__boton:focus {
    flex-shrink: 0;
    padding: 0.8rem 1.35rem;
    border-radius: 12px;
    background: #fff;
    color: var(--marca);
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, background 0.2s ease;
}

body .entrada-cta__boton:hover,
body .entrada-cta__boton:focus-visible {
    background: var(--tinte);
    transform: translateY(-2px);
}

/* ---- Sidebar: widgets limpios ---- */
body .sidebar .widget {
    padding: 1.25rem 1.35rem !important; /* el CSS adicional fija un relleno desigual con !important */
}

/* Los widgets de bloque llevan su título en un <h2> (no en .widget-title) */
body .sidebar .widget .widget-title,
body .sidebar .widget .widgettitle,
body .sidebar .widget h2,
body .sidebar .widget .wp-block-heading {
    margin: 0 0 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--tinte);
    font-size: 1rem;
    line-height: 1.3;
    letter-spacing: -0.005em;
}

body .sidebar .widget ul { margin: 0; padding: 0; }

body .sidebar .widget ul li {
    margin: 0 !important;
    padding: 0.6rem 0;
    border-bottom: 1px solid #eef2f7;
    list-style: none;
    font-size: 0.92rem;
    line-height: 1.4;
}

body .sidebar .widget ul li:last-child { border-bottom: 0; }

body .sidebar .widget ul li a { color: var(--texto); }

/* El widget de TaxDown ya es una tarjeta con su degradado: sin tarjeta blanca alrededor */
body .sidebar .widget:has(.taxdown-sidebar) {
    padding: 0 !important;
    background: transparent;
    border: 0;
    box-shadow: none;
}

/* Widget de imagen (banner): la imagen ocupa toda la tarjeta */
body .sidebar .widget_media_gallery { padding: 0 !important; overflow: hidden; }
body .sidebar .widget_media_gallery figure { margin: 0; }

body .sidebar .widget_media_gallery img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--card-radio);
}

/* Buscador */
body .sidebar .wp-block-search__label { display: none; }

body .sidebar .wp-block-search__inside-wrapper { gap: 0.5rem; }

body .sidebar .wp-block-search__input {
    height: 44px;
    padding: 0 0.9rem;
    border: 1.5px solid #dbe3ee;
    border-radius: 10px;
    background: #f8fafc;
}

body .sidebar .wp-block-search__input:focus {
    border-color: var(--accion);
    background: #fff;
    outline: none;
}

body .sidebar .wp-block-search__button {
    height: 44px;
    padding: 0 1.1rem;
    border: 0;
    border-radius: 10px;
    background: var(--accion);
    color: #fff;
    font-weight: 600;
}

body .sidebar .wp-block-search__button:hover { background: var(--accion-hover); }

/* ---- Comentarios ---- */
body:is(.single-post, .calc-pagina) .comments-area {
    margin-top: 1.5rem;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    background: #fff;
    border: var(--card-borde);
    border-radius: 20px;
    box-shadow: var(--card-sombra);
}

body:is(.single-post, .calc-pagina) .comment-form textarea,
body:is(.single-post, .calc-pagina) .comment-form input[type="text"],
body:is(.single-post, .calc-pagina) .comment-form input[type="email"],
body:is(.single-post, .calc-pagina) .comment-form input[type="url"] {
    width: 100%;
    padding: 0.8rem 0.95rem;
    border: 1.5px solid #dbe3ee;
    border-radius: 10px;
    background: #f8fafc;
    box-sizing: border-box;
}

body:is(.single-post, .calc-pagina) .comment-form textarea:focus,
body:is(.single-post, .calc-pagina) .comment-form input[type="text"]:focus,
body:is(.single-post, .calc-pagina) .comment-form input[type="email"]:focus,
body:is(.single-post, .calc-pagina) .comment-form input[type="url"]:focus {
    border-color: var(--accion);
    background: #fff;
    outline: none;
}

body:is(.single-post, .calc-pagina) .comment-form .submit,
body:is(.single-post, .calc-pagina) .comment-form input[type="submit"] {
    padding: 0.8rem 1.5rem;
    border: 0;
    border-radius: 10px;
    background: var(--accion);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

body:is(.single-post, .calc-pagina) .comment-form .submit:hover,
body:is(.single-post, .calc-pagina) .comment-form input[type="submit"]:hover { background: var(--accion-hover); }

/* ---- Sigue leyendo ---- */
.entrada-relacionadas {
    padding: 3rem 0 0;
}

.entrada-relacionadas .noticias-contenedor {
    max-width: calc(1200px + 2rem);
}

.entrada-relacionadas__rejilla {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.entrada-relacionadas .noticia-tarjeta .noticia__cuerpo { padding: 1.1rem 1.25rem 1.3rem; }

body .entrada-relacionadas .noticia-tarjeta .noticia__titulo { font-size: 1.05rem; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .entrada-relacionadas__rejilla { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .entrada-banda { padding: 1.1rem 1rem 4.5rem; }
    body:is(.single-post, .calc-pagina) #page { margin-top: -3rem; }
    body:is(.single-post, .calc-pagina) .entry-content table { display: block; overflow-x: auto; }
    .entrada-cta { flex-direction: column; align-items: flex-start; padding: 1.35rem; }
    body .entrada-cta__boton { width: 100%; text-align: center; box-sizing: border-box; }
}

@media (max-width: 620px) {
    .entrada-relacionadas__rejilla { grid-template-columns: 1fr; }
}
