/* =========================================================
   Nexus Contenido Editorial
   Todos los estilos quedan limitados al widget.
========================================================= */

.nexus-editorial {
    --nce-text: #343434;
    --nce-heading: #242424;
    --nce-accent: #b49a79;
    --nce-surface: #f5f1ec;
    --nce-card: #ffffff;
    --nce-border: #ded5ca;
    --nce-dark: #242424;
    --nce-radius: 18px;
    --nce-section-gap: 40px;
    --nce-grid-columns: 2;
    --nce-grid-gap: 24px;
    width: 100%;
    max-width: 100%;
    color: var(--nce-text);
    font-family: inherit;
    font-size: 17px;
    line-height: 1.72;
    overflow-wrap: anywhere;
}

.nexus-editorial,
.nexus-editorial *,
.nexus-editorial *::before,
.nexus-editorial *::after {
    box-sizing: border-box;
}

.nexus-editorial img,
.nexus-editorial iframe,
.nexus-editorial video {
    max-width: 100%;
}

.nexus-editorial p {
    margin: 0 0 1.15em;
}

.nexus-editorial p:last-child {
    margin-bottom: 0;
}

.nexus-editorial a {
    color: var(--nce-accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.nexus-editorial strong {
    color: var(--nce-heading);
    font-weight: 650;
}

.nexus-editorial__title {
    margin: 0 0 var(--nce-section-gap);
    color: var(--nce-heading);
    font-family: inherit;
    font-size: clamp(34px, 5vw, 62px);
    font-weight: 500;
    line-height: 1.05;
}

/* Introducción dentro del cuerpo, no header global del sitio */
.nexus-editorial__hero {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: clamp(18px, 3vw, 36px);
    align-items: stretch;
    margin-bottom: var(--nce-section-gap);
}

.nexus-editorial--image_right .nexus-editorial__hero-image {
    order: 2;
}

.nexus-editorial--image_top .nexus-editorial__hero {
    grid-template-columns: 1fr;
}

.nexus-editorial__hero-image {
    min-width: 0;
    overflow: hidden;
    border-radius: var(--nce-radius);
    background: var(--nce-surface);
}

.nexus-editorial__hero-image img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 430px;
    object-fit: cover;
    object-position: center;
    margin: 0;
}

.nexus-editorial__hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: clamp(24px, 4vw, 52px);
    border-radius: var(--nce-radius);
    background: var(--nce-surface);
}

.nexus-editorial__intro-heading,
.nexus-editorial__intro-text,
.nexus-editorial__intro-highlight {
    margin: 0 0 18px;
}

.nexus-editorial__intro-heading:last-child,
.nexus-editorial__intro-text:last-child,
.nexus-editorial__intro-highlight:last-child {
    margin-bottom: 0;
}

.nexus-editorial__intro-text > :last-child,
.nexus-editorial__intro-highlight > :last-child {
    margin-bottom: 0;
}

.nexus-editorial__intro-heading {
    color: var(--nce-heading);
    font-family: inherit;
    font-size: clamp(25px, 3vw, 38px);
    font-weight: 600;
    line-height: 1.15;
}

.nexus-editorial__intro-highlight {
    padding: 16px 18px;
    border-left: 3px solid var(--nce-accent);
    background: rgba(255, 255, 255, 0.62);
    background: color-mix(in srgb, var(--nce-card) 65%, transparent);
}

.nexus-editorial__body {
    display: flex;
    flex-direction: column;
    gap: var(--nce-section-gap);
}

.nexus-editorial__prose {
    max-width: 1050px;
}

.nexus-editorial__prose > :first-child {
    margin-top: 0;
}

.nexus-editorial__prose > :last-child {
    margin-bottom: 0;
}

/* Apartados automáticos */
.nexus-editorial__cards {
    display: grid;
    grid-template-columns: repeat(var(--nce-grid-columns), minmax(0, 1fr));
    gap: var(--nce-grid-gap);
}

.nexus-editorial__card {
    position: relative;
    min-width: 0;
    padding: clamp(24px, 3vw, 36px);
    border: 1px solid var(--nce-border);
    border-radius: var(--nce-radius);
    background: var(--nce-card);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.nexus-editorial__card:hover {
    transform: translateY(-3px);
    border-color: var(--nce-accent);
    box-shadow: 0 16px 40px rgba(30, 25, 20, 0.07);
}

.nexus-editorial__card-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: 20px;
    border-radius: 50%;
    color: var(--nce-heading);
    background: var(--nce-surface);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.nexus-editorial__card-title,
.nexus-editorial__section-title {
    margin: 0 0 15px;
    color: var(--nce-heading);
    font-family: inherit;
    font-size: clamp(21px, 2.2vw, 27px);
    font-weight: 600;
    line-height: 1.22;
}

.nexus-editorial__card-content > :last-child {
    margin-bottom: 0;
}

/* Destacados */
.nexus-editorial__highlight,
.nexus-editorial__callout,
.nexus-editorial__cta {
    overflow: hidden;
    border-radius: var(--nce-radius);
}

.nexus-editorial__highlight {
    padding: clamp(24px, 4vw, 42px);
    border-left: 4px solid var(--nce-accent);
    background: var(--nce-surface);
}

.nexus-editorial__callout {
    padding: clamp(24px, 4vw, 40px);
    border: 1px solid var(--nce-border);
    background: var(--nce-card);
}

.nexus-editorial__cta {
    position: relative;
    padding: clamp(28px, 5vw, 50px);
    color: #fff;
    background: var(--nce-dark);
}

.nexus-editorial__cta::after {
    content: "+";
    position: absolute;
    top: -70px;
    right: 18px;
    color: rgba(255, 255, 255, 0.06);
    font-size: 230px;
    font-weight: 300;
    line-height: 1;
    pointer-events: none;
}

.nexus-editorial__cta > *,
.nexus-editorial__callout > *,
.nexus-editorial__highlight > * {
    position: relative;
    z-index: 1;
    margin-top: 0;
    margin-bottom: 0;
    color: inherit;
}

.nexus-editorial__cta strong {
    color: #fff;
}

/* Listas sencillas */
.nexus-editorial__feature-list {
    padding: clamp(24px, 4vw, 40px);
    border-radius: var(--nce-radius);
    background: var(--nce-surface);
}

.nexus-editorial__feature-list > ul,
.nexus-editorial__card-content > ul {
    display: grid;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nexus-editorial__feature-list > ul {
    grid-template-columns: repeat(var(--nce-grid-columns), minmax(0, 1fr));
    gap: var(--nce-grid-gap);
}

.nexus-editorial__card-content > ul {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}

.nexus-editorial__feature-list li,
.nexus-editorial__card-content > ul > li {
    position: relative;
    min-width: 0;
    padding: 13px 15px 13px 39px;
    border: 1px solid var(--nce-border);
    border-color: color-mix(in srgb, var(--nce-border) 70%, transparent);
    border-radius: calc(var(--nce-radius) * 0.65);
    background: var(--nce-card);
}

.nexus-editorial__feature-list li::before,
.nexus-editorial__card-content > ul > li::before {
    content: "✓";
    position: absolute;
    top: 13px;
    left: 15px;
    color: var(--nce-accent);
    font-weight: 700;
}

/* Procesos numerados */
.nexus-editorial__steps > ol,
.nexus-editorial__card-content > ol {
    display: grid;
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: nexus-step;
}

.nexus-editorial__steps > ol[start="4"] {
    counter-reset: nexus-step 3;
}

.nexus-editorial__steps > ol > li,
.nexus-editorial__card-content > ol > li {
    position: relative;
    min-width: 0;
    padding: 23px 24px 23px 76px;
    border: 1px solid var(--nce-border);
    border-radius: var(--nce-radius);
    background: var(--nce-card);
    counter-increment: nexus-step;
}

.nexus-editorial__steps > ol > li::before,
.nexus-editorial__card-content > ol > li::before {
    content: counter(nexus-step);
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: #fff;
    background: var(--nce-accent);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.nexus-editorial__steps ul,
.nexus-editorial__steps ol ul {
    margin: 16px 0 0;
    padding-left: 20px;
}

/* Tablas */
.nexus-editorial__table {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--nce-border);
    border-radius: var(--nce-radius);
}

.nexus-editorial__table table {
    width: 100%;
    min-width: 640px;
    margin: 0;
    border-collapse: collapse;
}

.nexus-editorial__table th,
.nexus-editorial__table td {
    padding: 15px 18px;
    border-bottom: 1px solid var(--nce-border);
    text-align: left;
    vertical-align: top;
}

.nexus-editorial__table th {
    color: var(--nce-heading);
    background: var(--nce-surface);
}

.nexus-editorial__table tr:last-child td {
    border-bottom: 0;
}

.nexus-editorial__empty {
    padding: 20px;
    border: 1px dashed #bbb;
    background: #fafafa;
    color: #666;
    font-size: 14px;
}

@media (max-width: 900px) {
    .nexus-editorial__hero,
    .nexus-editorial--image_right .nexus-editorial__hero {
        grid-template-columns: 1fr;
    }

    .nexus-editorial--image_right .nexus-editorial__hero-image {
        order: 0;
    }

    .nexus-editorial__card-content > ul {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 767px) {
    .nexus-editorial {
        --nce-grid-columns: 1;
        font-size: 16px;
        line-height: 1.68;
    }

    .nexus-editorial__hero-image img {
        min-height: 260px;
    }

    .nexus-editorial__hero-content,
    .nexus-editorial__card,
    .nexus-editorial__feature-list {
        padding: 23px 20px;
    }


    .nexus-editorial__steps > ol > li,
    .nexus-editorial__card-content > ol > li {
        padding: 68px 20px 22px;
    }

    .nexus-editorial__steps > ol > li::before,
    .nexus-editorial__card-content > ol > li::before {
        top: 18px;
        left: 20px;
    }
}

/* =========================================================
   Versión editorial avanzada 1.1
========================================================= */

.nexus-editorial__hero-image {
    position: relative;
}

.nexus-editorial__hero-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, rgba(0, 0, 0, 0.16) 100%);
    pointer-events: none;
}

.nexus-editorial__eyebrow {
    display: block;
    margin: 0 0 13px;
    color: var(--nce-accent);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 1.45px;
    text-transform: uppercase;
}

.nexus-editorial__hero-title {
    margin: 0 0 24px;
    color: var(--nce-heading);
    font-family: inherit;
    font-size: clamp(32px, 4vw, 52px);
    font-weight: 500;
    line-height: 1.08;
}

.nexus-editorial__intro-highlight--primary {
    padding: 23px 25px;
    border-left: 0;
    color: #fff;
    background: var(--nce-dark);
    border-radius: calc(var(--nce-radius) * 0.82);
}

.nexus-editorial__intro-highlight--primary,
.nexus-editorial__intro-highlight--primary strong,
.nexus-editorial__intro-highlight--primary a {
    color: #fff;
}

.nexus-editorial__intro-highlight--primary p {
    margin-bottom: 7px;
}

/* Títulos de sección reales (H2 del editor) */
.nexus-editorial__section-heading {
    display: flex;
    align-items: center;
    gap: 18px;
    width: 100%;
}

.nexus-editorial__section-heading h2 {
    flex: 0 1 auto;
    margin: 0;
    color: var(--nce-heading);
    font-family: inherit;
    font-size: clamp(26px, 3vw, 36px);
    font-weight: 500;
    line-height: 1.2;
}

.nexus-editorial__section-heading span {
    flex: 1;
    min-width: 35px;
    height: 1px;
    background: var(--nce-border);
}

/* Recomendaciones detectadas automáticamente */
.nexus-editorial__recommendation {
    display: grid;
    grid-template-columns: minmax(190px, 0.32fr) minmax(0, 0.68fr);
    overflow: hidden;
    border-radius: var(--nce-radius);
    background: var(--nce-surface);
}

.nexus-editorial__recommendation-label {
    display: flex;
    align-items: center;
    padding: clamp(28px, 4vw, 42px);
    color: #fff;
    background: var(--nce-accent);
}

.nexus-editorial__recommendation-label span {
    font-size: clamp(24px, 3vw, 33px);
    font-weight: 500;
    line-height: 1.15;
}

.nexus-editorial__recommendation-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(28px, 5vw, 48px);
}

.nexus-editorial__recommendation-content > :last-child {
    margin-bottom: 0;
}

/* Seguridad y supervisión médica */
.nexus-editorial__medical {
    position: relative;
    overflow: hidden;
    padding: clamp(32px, 5vw, 54px);
    color: #fff;
    background: var(--nce-dark);
    border-radius: var(--nce-radius);
}

.nexus-editorial__medical::before {
    content: "+";
    position: absolute;
    top: -60px;
    right: 18px;
    color: rgba(255, 255, 255, 0.055);
    font-size: 245px;
    font-weight: 300;
    line-height: 1;
    pointer-events: none;
}

.nexus-editorial__medical-content {
    position: relative;
    z-index: 1;
    max-width: 950px;
}

.nexus-editorial__medical h2 {
    margin: 0 0 21px;
    color: #fff;
    font-family: inherit;
    font-size: clamp(28px, 3vw, 39px);
    font-weight: 500;
    line-height: 1.18;
}

.nexus-editorial__medical p,
.nexus-editorial__medical li,
.nexus-editorial__medical strong,
.nexus-editorial__medical a {
    color: rgba(255, 255, 255, 0.84);
}

.nexus-editorial__medical-content > :last-child {
    margin-bottom: 0;
}

/* Fases posteriores al bloque médico */
.nexus-editorial__phases {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: calc(var(--nce-section-gap) * -0.48);
    position: relative;
    z-index: 2;
    padding: 0 clamp(14px, 3vw, 34px);
}

.nexus-editorial__phase {
    min-width: 0;
    padding: 25px;
    border: 1px solid var(--nce-border);
    border-radius: calc(var(--nce-radius) * 0.84);
    background: var(--nce-card);
    box-shadow: 0 14px 34px rgba(30, 25, 20, 0.06);
}

.nexus-editorial__phase-label {
    display: block;
    margin-bottom: 9px;
    color: var(--nce-accent);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nexus-editorial__phase-title {
    display: block;
    color: var(--nce-heading);
    font-size: 19px;
    font-weight: 600;
    line-height: 1.35;
}

/* Un poco más de profundidad en las tarjetas */
.nexus-editorial__card-number {
    background: color-mix(in srgb, var(--nce-accent) 18%, var(--nce-card));
}

@media (max-width: 900px) {
    .nexus-editorial__recommendation {
        grid-template-columns: 1fr;
    }

    .nexus-editorial__recommendation-label {
        min-height: 0;
    }

    .nexus-editorial__phases {
        grid-template-columns: 1fr;
        margin-top: calc(var(--nce-section-gap) * -0.35);
    }
}

@media (max-width: 767px) {
    .nexus-editorial__hero-title {
        font-size: 34px;
    }

    .nexus-editorial__intro-highlight--primary {
        padding: 20px;
    }

    .nexus-editorial__section-heading {
        gap: 12px;
    }

    .nexus-editorial__recommendation-label,
    .nexus-editorial__recommendation-content {
        padding: 25px 21px;
    }

    .nexus-editorial__medical {
        padding: 30px 22px;
    }

    .nexus-editorial__phases {
        padding: 0 10px;
    }

    .nexus-editorial__phase {
        padding: 21px;
    }
}

.nexus-editorial__hero-content > .nexus-editorial__intro-text:first-of-type {
    font-size: 19px;
    line-height: 1.65;
}

.nexus-editorial__intro-indication {
    margin: 0 0 20px;
    padding-left: 18px;
    border-left: 3px solid var(--nce-accent);
}

.nexus-editorial__intro-indication > :last-child {
    margin-bottom: 0;
}

.nexus-editorial__intro-highlight--primary-first {
    margin-bottom: 0;
    padding-bottom: 10px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.nexus-editorial__intro-highlight--primary-last {
    padding-top: 5px;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

.nexus-editorial__intro-highlight--primary-first strong {
    display: block;
    font-size: clamp(23px, 3vw, 33px);
    font-weight: 600;
    line-height: 1.2;
}

.nexus-editorial__intro-highlight--primary-last strong {
    font-size: 15px;
    line-height: 1.5;
}

.nexus-editorial__highlight--indication {
    border-left-width: 3px;
}

/* =========================================================
   Perfiles automáticos para contenidos sencillos
========================================================= */

/* Cuando no hay imagen, el bloque inicial ocupa todo el ancho. */
.nexus-editorial__hero--no-image {
    grid-template-columns: minmax(0, 1fr);
}

.nexus-editorial__hero--no-image .nexus-editorial__hero-content {
    width: 100%;
}

/* Texto + viñetas: se evita el aspecto de cabecera y se da protagonismo a la lista. */
.nexus-editorial--profile-simple-list .nexus-editorial__prose,
.nexus-editorial--profile-list-led .nexus-editorial__prose,
.nexus-editorial--profile-plain .nexus-editorial__prose {
    max-width: 1050px;
}

.nexus-editorial__numbered-list {
    display: grid;
    grid-template-columns: repeat(var(--nce-grid-columns), minmax(0, 1fr));
    gap: var(--nce-grid-gap);
    counter-reset: nce-simple-list;
}

.nexus-editorial__numbered-item {
    position: relative;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    min-width: 0;
    padding: clamp(22px, 3vw, 32px);
    border: 1px solid var(--nce-border);
    border-radius: var(--nce-radius);
    background: var(--nce-card);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.nexus-editorial__numbered-item:hover {
    transform: translateY(-3px);
    border-color: var(--nce-accent);
    box-shadow: 0 16px 40px rgba(30, 25, 20, 0.07);
}

.nexus-editorial__numbered-item-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: var(--nce-heading);
    background: color-mix(in srgb, var(--nce-accent) 18%, var(--nce-card));
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.nexus-editorial__numbered-item-content {
    min-width: 0;
    padding-top: 5px;
}

.nexus-editorial__numbered-item-content > :first-child {
    margin-top: 0;
}

.nexus-editorial__numbered-item-content > :last-child {
    margin-bottom: 0;
}

.nexus-editorial__numbered-item-content > strong:first-child,
.nexus-editorial__numbered-item-content > p:first-child > strong:first-child {
    display: block;
    margin-bottom: 7px;
    color: var(--nce-heading);
    font-size: 1.08em;
    line-height: 1.35;
}

.nexus-editorial__plain-list {
    padding: clamp(22px, 3vw, 34px);
    border: 1px solid var(--nce-border);
    border-radius: var(--nce-radius);
    background: var(--nce-card);
}

.nexus-editorial__plain-list ul {
    margin: 0;
    padding-left: 1.3em;
}

.nexus-editorial__plain-list li + li {
    margin-top: 0.65em;
}

@media (max-width: 767px) {
    .nexus-editorial__numbered-item {
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 14px;
        padding: 21px;
    }

    .nexus-editorial__numbered-item-number {
        width: 42px;
        height: 42px;
    }
}
