/* MedicinasNaturistas - Biblioteca de artículos */
.article-page {
    width: min(1080px, 92%);
    margin: auto;
    padding: 120px 0 85px;
    color: var(--text, #e9f7ef)
}

.article-breadcrumb {
    font-size: .85rem;
    color: var(--text-soft, #bad4c8);
    margin-bottom: 24px;
    line-height: 1.6
}

.article-breadcrumb a {
    color: #9be5b7;
    text-decoration: none
}

.article-hero {
    padding: clamp(24px, 5vw, 52px);
    border: 1px solid rgba(149, 230, 188, .2);
    border-radius: 30px;
    background: radial-gradient(circle at 10% 20%, rgba(60, 160, 123, .25), transparent 42%), linear-gradient(135deg, #123d34, #062620);
    margin-bottom: 35px
}

.article-eyebrow {
    font-size: .78rem;
    letter-spacing: .15em;
    text-transform: uppercase;
    color: #a0eab6;
    margin-bottom: 12px
}

.article-hero h1 {
    font-size: clamp(2rem, 5vw, 3.6rem);
    line-height: 1.15;
    margin: 0 0 16px;
    overflow-wrap: anywhere
}

.article-date {
    font-size: .85rem;
    color: #b4d6c5;
    margin: 0 0 18px
}

.article-lead {
    font-size: 1rem;
    line-height: 1.8;
    color: #d0e6d9;
    max-width: 800px
}

.article-content {
    max-width: 790px;
    margin: 0 auto 42px;
    font-size: 1.03rem;
    line-height: 1.9;
    color: #d7e8df;
    overflow-wrap: anywhere
}

.article-content p {
    margin: 0 0 22px
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
    gap: 16px
}

.article-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    padding: 25px;
    border: 1px solid rgba(149, 230, 188, .18);
    border-radius: 20px;
    background: linear-gradient(145deg, #103a31, #072923);
    text-decoration: none;
    color: #f1fff7;
    transition: transform .2s, border-color .2s
}

.article-card:hover {
    transform: translateY(-3px);
    border-color: #7adba4
}

.article-card:focus-visible,
.article-back:focus-visible {
    outline: 2px solid #a0efbf;
    outline-offset: 3px
}

.article-card h2 {
    font-size: 1.06rem;
    line-height: 1.45;
    margin: 0
}

.article-card span,
.article-back {
    color: #9be9b5;
    font-size: .9rem
}

.article-back {
    display: inline-block;
    margin-top: 25px;
    text-decoration: none
}

@media(max-width:600px) {
    .article-page {
        padding-top: 100px
    }

    .article-hero {
        border-radius: 22px
    }

    .article-content {
        font-size: .97rem
    }
}

@media(prefers-reduced-motion:reduce) {
    .article-card {
        transition: none
    }
}

/* Estructura editorial de artículos históricos */
.article-content h2 {
    font-size: clamp(1.45rem, 3vw, 2rem);
    line-height: 1.3;
    margin: 42px 0 18px;
    color: #f3fff8
}

.article-content h3 {
    font-size: clamp(1.18rem, 2.3vw, 1.5rem);
    line-height: 1.35;
    margin: 30px 0 14px;
    color: #d3f5de
}

.article-content h4,
.article-content h5,
.article-content h6 {
    font-size: 1.08rem;
    margin: 25px 0 12px;
    color: #d3f5de
}

.article-content ul,
.article-content ol {
    padding-left: 1.5rem;
    margin: 0 0 24px
}

.article-content li {
    margin-bottom: 9px
}

.article-content a {
    color: #9debbb;
    text-decoration: underline;
    text-underline-offset: 3px;
    overflow-wrap: anywhere
}

.article-content a:focus-visible {
    outline: 2px solid #a0efbf;
    outline-offset: 3px
}

.article-content strong,
.article-content b {
    color: #f3fff8;
    font-weight: 700
}

.article-content blockquote {
    margin: 28px 0;
    padding: 14px 22px;
    border-left: 3px solid #81d9a2;
    background: rgba(45, 111, 85, .14);
    border-radius: 0 12px 12px 0
}

.article-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 24px auto;
    border-radius: 14px
}

.article-content figure {
    max-width: 100%;
    margin: 28px 0
}

.article-content figcaption {
    font-size: .85rem;
    color: #b3d1c1;
    text-align: center
}

.article-content table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    margin: 24px 0;
}

.article-content th,
.article-content td {
    padding: 12px 15px;
    border: 1px solid rgba(149, 230, 188, .22);
    text-align: left;
    min-width: 90px
}

.article-content th {
    background: rgba(39, 103, 80, .4)
}

.article-content pre {
    overflow-x: auto;
    padding: 16px;
    border-radius: 12px;
    background: #092d26
}

.article-content h2[id],
.article-content h3[id] {
    scroll-margin-top: 110px
}



/* Imagen principal del artículo */

.article-featured {
    width: min(790px, 100%);
    margin: 0 auto 38px;
    text-align: center;
}

.article-featured img {
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    margin: 0 auto;
    border-radius: 16px;
}

@media (max-width: 600px) {
    .article-featured {
        margin-bottom: 28px;
    }

    .article-featured img {
        border-radius: 12px;
    }
}



/* Encabezado de artículo: imagen y datos */

.article-hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
    gap: 32px;
    align-items: center;
}

.article-hero .article-featured {
    width: 100%;
    margin: 0;
}

.article-hero .article-featured img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 240px;
    object-fit: contain;
    border-radius: 14px;
}

.article-hero-info {
    min-width: 0;
}

.article-hero-info h1 {
    font-size: clamp(1.7rem, 3vw, 2.7rem);
    line-height: 1.2;
}

/* Cuando el artículo no tiene imagen */
.article-hero-layout:not(:has(.article-featured)) {
    grid-template-columns: 1fr;
}

/* Móviles */
@media (max-width: 700px) {
    .article-hero-layout {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .article-hero .article-featured {
        max-width: 320px;
        margin: 0 auto;
    }

    .article-hero .article-featured img {
        max-height: auto;
    }
}



/* Fechas discretas debajo del extracto */

.article-hero-info .article-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 6px 18px;
    margin-top: 18px;
    font-size: 0.72rem;
    line-height: 1.5;
    color: #a8c8b8;
}

.article-hero-info .article-meta span {
    white-space: nowrap;
}

.article-hero-info .article-meta time {
    color: #c7dfd1;
}




/* Biblioteca general: búsqueda y paginación (no afecta artículos individuales) */
.article-library-search {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 12px;
    margin: 0 0 18px;
}

.article-library-field {
    display: grid;
    gap: 7px;
    flex: 1 1 220px;
}

.article-library-field label {
    font-size: .82rem;
    color: #b8dbcb;
}

.article-library-field input,
.article-library-field select {
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    border: 1px solid rgba(149, 230, 188, .28);
    border-radius: 12px;
    background: #0b3028;
    color: #f3fff8;
    font: inherit;
}

.article-library-search button {
    min-height: 46px;
    padding: 10px 22px;
    border: 0;
    border-radius: 12px;
    background: #87e6a7;
    color: #08261d;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.article-library-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 10px 20px;
    border: 1px solid rgba(149, 230, 188, .35);
    border-radius: 12px;
    background: #0b3028;
    color: #a5edbf;
    font: inherit;
    text-decoration: none;
    white-space: nowrap;
}

.article-library-clear:hover {
    background: #16483a;
    border-color: #87e6a7;
}

.article-library-count {
    margin: 0 0 20px;
    color: #b8dbcb;
    font-size: .88rem;
}

.article-library-empty {
    padding: 24px 0;
    color: #d7e8df;
}

.article-library-pages {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 9px;
    margin: 34px 0 0;
}

.article-library-pages a {
    min-width: 42px;
    padding: 10px 14px;
    text-align: center;
    border: 1px solid rgba(149, 230, 188, .25);
    border-radius: 10px;
    color: #d7f5e2;
    text-decoration: none;
    background: #0b3028;
}

.article-library-pages a[aria-current="page"] {
    background: #87e6a7;
    color: #08261d;
    font-weight: 700;
}

.article-library-search :focus-visible,
.article-library-pages a:focus-visible {
    outline: 2px solid #a0efbf;
    outline-offset: 3px;
}

/* Transición de la paginación dinámica */
#biblioteca-resultados {
    transition: opacity 180ms ease;
}

#biblioteca-resultados.biblioteca-cargando {
    opacity: 0.55;
    pointer-events: none;
}

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

/* Transición discreta durante el cambio de página de la biblioteca */
#biblioteca-resultados {
    transition: opacity 160ms ease;
}

#biblioteca-resultados.biblioteca-cargando {
    opacity: .65;
    pointer-events: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

.article-library-clear[hidden] {
    display: none;
}

/* Biblioteca: formulario en dispositivos móviles */
@media (max-width: 600px) {

    .article-library-search {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .article-library-field {
        grid-column: 1 / -1;
        min-width: 0;
    }

    .article-library-search button,
    .article-library-clear {
        width: 100%;
        min-height: 46px;
        margin: 0;
    }

    .article-library-search button {
        grid-column: 1;
    }

    .article-library-clear {
        grid-column: 2;
    }
}


/* Fichas botánicas: galería y videos. Añadir al final de articulos.css */
.plant-section { margin: 3rem 0; }
.plant-section > h2 { margin-bottom: 1.2rem; }
.plant-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 1.25rem; }
.plant-gallery__item { margin: 0; padding: 0 0 1rem; overflow: hidden; border: 1px solid rgba(149,230,188,.2); border-radius: 16px; background: rgba(8,39,34,.5); }
.plant-gallery__item a { display: block; }
.plant-gallery__item img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .2s ease; }
.plant-gallery__item a:hover img { transform: scale(1.025); }
.plant-gallery__item figcaption, .plant-gallery__item p, .plant-gallery__item small { display: block; margin: .65rem 1rem 0; line-height: 1.5; }
.plant-gallery__item small { color: #b6d4c4; }
.plant-videos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 1.5rem; }
.plant-video__frame { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 14px; background: #03110f; }
.plant-video__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.plant-video h3 { margin: .8rem 0 .3rem; }
.plant-video p { margin: 0; line-height: 1.6; }
@media (prefers-reduced-motion: reduce) { .plant-gallery__item img { transition: none; } }



/* Fuentes: tarjetas de igual altura por fila, datos compactos */
.fuentes-page .fuentes-grid {
    align-items: stretch;
}
.fuentes-page .fuente-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: .45rem;
    height: 100%;
    min-height: 100%;
    box-sizing: border-box;
}
.fuentes-page .fuente-card > h2,
.fuentes-page .fuente-card > p {
    margin: 0;
}
.fuentes-page .fuente-card > h2 {
    margin-bottom: .35rem;
}
.fuentes-page .fuente-card > a {
    margin: 0;
    align-self: flex-start;
}

/* Relacionados: cada artículo en su propio rectángulo */
.fuentes-page .fuente-relacionados {
    width: 100%;
    margin-top: .65rem;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
.fuentes-page .fuente-relacionados > strong {
    display: block;
    margin: 0 0 .55rem;
    font-size: .88rem;
}
.fuentes-page .fuente-relacionados ul,
.fuentes-page .fuente-relacionados-lista {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .45rem;
}
.fuentes-page .fuente-relacionados li {
    list-style: none;
    margin: 0;
    padding: 0;
}
.fuentes-page .fuente-relacionados li + li {
    margin-top: 0;
}
.fuentes-page .fuente-relacionados li a {
    display: block;
    padding: .65rem .75rem;
    border: 1px solid rgba(149, 230, 188, .22);
    border-radius: .6rem;
    background: rgba(122, 222, 161, .055);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
    font-size: .82rem;
    line-height: 1.45;
    text-decoration: none;
    overflow-wrap: anywhere;
}
.fuentes-page .fuente-relacionados li a:hover,
.fuentes-page .fuente-relacionados li a:focus-visible {
    border-color: rgba(149, 230, 188, .55);
    background: rgba(122, 222, 161, .12);
}


/* Catálogo de preparaciones: estilos aislados */
.preparaciones-page .preparaciones-grid { align-items: stretch; }
.preparaciones-page .preparacion-card { display:flex; flex-direction:column; align-items:stretch; gap:.7rem; height:100%; box-sizing:border-box; }
.preparaciones-page .preparacion-card > h2,
.preparaciones-page .preparacion-card > p { margin:0; }
.preparaciones-page .preparacion-tipo { align-self:flex-start; font-size:.8rem; font-weight:700; letter-spacing:.03em; text-transform:uppercase; opacity:.85; }
.preparaciones-page .preparacion-descripcion { line-height:1.6; overflow-wrap:anywhere; }
.preparaciones-page .preparacion-fecha { margin-top:auto !important; font-size:.8rem; opacity:.75; }


/* Preparaciones: enlaces visibles y toda la tarjeta clicable */
.preparaciones-page .preparacion-card { position: relative; }
.preparaciones-page .preparacion-card-link {
  color: #f1fff7;
  text-decoration: none;
}
.preparaciones-page .preparacion-card-link::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.preparaciones-page .preparacion-card:hover .preparacion-card-link,
.preparaciones-page .preparacion-card-link:focus-visible {
  color: #9be9b5;
  text-decoration: underline;
}
.preparaciones-page .preparacion-card:focus-within {
  outline: 2px solid #9be9b5;
  outline-offset: 3px;
}

/* Ficha de Preparaciones: estilos exclusivos, sin afectar el catálogo */
.preparaciones-page.preparacion-ficha .preparacion-cabecera{display:grid;grid-template-columns:minmax(0, .8fr) minmax(0, 1.2fr);align-items:center;gap:2rem}
.preparaciones-page.preparacion-ficha .preparacion-cabecera:not(:has(.preparacion-imagen)){display:block}
.preparaciones-page .preparacion-imagen{width:100%;height:auto;max-height:360px;object-fit:cover;border-radius:1rem;display:block}
.preparaciones-page .preparacion-tema{margin:.7rem 0;color:#c6f5dc}
.preparaciones-page .preparacion-tema a{color:#9be9b5}
.preparaciones-page .preparacion-seccion{margin:1.5rem 0;padding:1.4rem;border:1px solid rgba(149,230,188,.2);border-radius:1rem;background:rgba(122,222,161,.045)}
.preparaciones-page .preparacion-seccion>h2{margin:0 0 1rem}
.preparaciones-page .preparacion-lista{margin:0;padding-left:1.3rem}
.preparaciones-page .preparacion-lista li+li{margin-top:.65rem}
.preparaciones-page .preparacion-nota{opacity:.82}
.preparaciones-page .preparacion-contenido{line-height:1.75;overflow-wrap:anywhere}
.preparaciones-page .preparacion-contenido img{max-width:100%;height:auto;border-radius:.75rem}
.preparaciones-page .preparacion-contenido h2,.preparaciones-page .preparacion-contenido h3{margin-top:1.4rem}
.preparaciones-page .preparacion-relaciones{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr));gap:.8rem}
.preparaciones-page .preparacion-relacion{display:flex;flex-direction:column;gap:.35rem;padding:1rem;border:1px solid rgba(149,230,188,.25);border-radius:.75rem;background:rgba(122,222,161,.055);color:inherit;text-decoration:none;overflow-wrap:anywhere}
.preparaciones-page a.preparacion-relacion:hover,.preparaciones-page a.preparacion-relacion:focus-visible{border-color:#9be9b5;color:#9be9b5}
.preparaciones-page .preparacion-relacion small{opacity:.85}
.preparaciones-page .preparacion-relacion a{color:#9be9b5}
.preparaciones-page .preparacion-videos{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));gap:1.2rem}
.preparaciones-page .preparacion-video-marco{position:relative;aspect-ratio:16/9;overflow:hidden;border-radius:.75rem}
.preparaciones-page .preparacion-video-marco iframe{position:absolute;inset:0;width:100%;height:100%;border:0}
.preparaciones-page .preparacion-video h3{font-size:1rem;margin:.7rem 0 .3rem}
.preparaciones-page .preparacion-aviso{font-size:.9rem;opacity:.8;margin:1.5rem 0}
@media(max-width:700px){.preparaciones-page.preparacion-ficha .preparacion-cabecera{grid-template-columns:1fr;gap:1.2rem}.preparaciones-page .preparacion-seccion{padding:1rem}}


/* Artículos individuales: índice y enlaces relacionados */
.article-toc { width: min(790px, 100%); margin: 0 auto 2.5rem; padding: 1.4rem 1.7rem; border: 1px solid rgba(149,230,188,.25); border-radius: 18px; background: rgba(8,39,34,.7); }
.article-toc h2 { margin: 0 0 .9rem; font-size: 1.3rem; }
.article-toc ol { margin: 0; padding-left: 1.4rem; }
.article-toc li { padding: .25rem 0; line-height: 1.55; }
.article-toc .article-toc__sub { margin-left: 1.1rem; list-style-type: lower-alpha; }
.article-toc a { color: #b9f3cd; text-decoration: none; }
.article-toc a:hover, .article-toc a:focus-visible { text-decoration: underline; }
.article-content h2[id], .article-content h3[id] { scroll-margin-top: 110px; }
.article-related { margin: 2.6rem 0; }
.article-related > h2 { margin: 0 0 1rem; font-size: clamp(1.35rem, 3vw, 1.75rem); }
.article-related__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr)); gap: .85rem; }
.article-related__card { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; padding: 1.1rem 1.2rem; border: 1px solid rgba(149,230,188,.22); border-radius: 14px; background: linear-gradient(145deg,#103a31,#072923); color: #f1fff7; text-decoration: none; overflow-wrap: anywhere; transition: border-color .2s, transform .2s; }
.article-related__card strong { line-height: 1.45; }
.article-related__card small { color: #c3e3d2; }
.article-related__card span { margin-top: auto; color: #9be9b5; font-size: .87rem; }
.article-related__card:hover { border-color: #7adba4; transform: translateY(-2px); }
.article-related__card:focus-visible { outline: 2px solid #a0efbf; outline-offset: 3px; }
/* Lectura de artículos históricos: listas e imágenes internas */
.article-content ul, .article-content ol { padding-left: 1.65rem; }
.article-content li { padding-left: .25rem; line-height: 1.75; }
.article-content li::marker { color: #9be9b5; font-weight: 700; }
.article-content img { max-width: 100%; height: auto; }
@media(max-width:600px) { .article-toc { padding: 1.1rem; } .article-toc .article-toc__sub { margin-left: .4rem; } }
@media(prefers-reduced-motion:reduce) { .article-related__card { transition: none; } }


/* Ajustes editoriales 2026: no cambian los tamaños de letra */
/* Listas: separación y marcadores sin alterar la jerarquía */
.article-content ul,
.article-content ol {
    margin: 1.1rem 0 1.7rem;
    padding: .85rem 1.15rem .85rem 2.4rem;
    border-left: 2px solid rgba(149, 230, 188, .38);
    border-radius: 0 12px 12px 0;
    background: rgba(122, 222, 161, .045);
}
.article-content li { margin-bottom: .55rem; padding-left: .2rem; }
.article-content li:last-child { margin-bottom: 0; }
.article-content li::marker { color: #9be9b5; }
.article-content li > ul,
.article-content li > ol { margin: .65rem 0; background: transparent; border-left-color: rgba(149,230,188,.22); }

/* Imágenes dentro del cuerpo: mantienen proporción y no desbordan */
.article-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1.6rem auto;
    border-radius: 14px;
}
.article-content figure { max-width: 100%; margin: 1.8rem auto; }
.article-content figure img { margin: 0 auto; }
.article-content figcaption { margin-top: .55rem; line-height: 1.5; }

/* Tablas: apariencia uniforme y desplazamiento horizontal en pantallas pequeñas */
.article-content table {
    display: block;
    width: max-content;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1.6rem 0 0.6rem;
    border: 1px solid rgba(149,230,188,.25);
    border-radius: 12px;
    background: rgba(8,39,34,.55);
    -webkit-overflow-scrolling: touch;
}
.article-content th,
.article-content td {
    padding: .8rem 1rem;
    border: 0;
    border-right: 1px solid rgba(149,230,188,.16);
    border-bottom: 1px solid rgba(149,230,188,.16);
    min-width: 110px;
    vertical-align: top;
    text-align: left;
}
.article-content tr > :last-child { border-right: 0; }
.article-content tbody tr:last-child > * { border-bottom: 0; }
.article-content th { background: #17493a; color: #f3fff8; font-weight: 700; }
.article-content tbody tr:nth-child(even) { background: rgba(149,230,188,.055); }
.article-content caption { caption-side: top; text-align: center; padding: 0 0 .65rem; color: #d7e8df; }

/* Fuentes consultadas: solo espacio vertical, sin cambiar fuentes */
.article-related--sources li + li,
.article-sources li + li,
.article-fuentes li + li { margin-top: .65rem; }
@media (max-width: 600px) {
    .article-content ul, .article-content ol { padding: .75rem .8rem .75rem 1.9rem; }
    .article-content th, .article-content td { padding: .7rem .8rem; }
}


/* Publicidad en artículos */
.article-ad {
    width: 100%;
    margin: 2rem auto;
    text-align: center;
}

.article-ad__label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    color: #777;
}