/* ============================================================================
   ANDERCODE — DETALLE DE BLOG
   Lectura editorial, responsive y compatible con inserciones automáticas AdSense.
============================================================================ */

:root {
    --article-primary: #7c3aed;
    --article-primary-dark: #5b21b6;
    --article-primary-soft: #f5f0ff;
    --article-ink: #18181b;
    --article-muted: #6b6875;
    --article-border: #e9e5f0;
    --article-soft: #faf9fc;
    --article-dark: #17141f;
    --article-radius-lg: 28px;
    --article-radius-md: 20px;
    --article-shadow: 0 18px 50px rgba(35, 26, 54, .08);
    --article-shadow-hover: 0 24px 65px rgba(35, 26, 54, .13);
}

.blog-article-page {
    background: #fff;
    color: var(--article-ink);
}

.blog-article-page h1,
.blog-article-page h2,
.blog-article-page h3,
.blog-article-page h4,
.blog-article-page h5,
.blog-article-page h6 {
    border: 0;
    padding-left: 0;
    color: var(--article-ink);
}

/* HEADER ------------------------------------------------------------------ */
.article-header {
    position: relative;
    padding: 3.3rem 0 2.5rem;
    background:
        radial-gradient(circle at 90% 12%, rgba(124, 58, 237, .14), transparent 27%),
        linear-gradient(180deg, #fbfaff 0%, #ffffff 100%);
    border-bottom: 1px solid rgba(124, 58, 237, .08);
}

.article-breadcrumb {
    margin-bottom: 1.4rem;
}

.article-breadcrumb .breadcrumb {
    margin: 0;
    font-size: .84rem;
}

.article-breadcrumb a {
    color: var(--article-muted);
    font-weight: 650;
}

.article-breadcrumb a:hover {
    color: var(--article-primary);
}

.article-breadcrumb .breadcrumb-item.active {
    color: #9a96a3;
}

.article-category {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin-bottom: 1rem;
    padding: .46rem .75rem;
    border-radius: 999px;
    background: var(--article-primary-soft);
    color: var(--article-primary-dark);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.article-title {
    max-width: 1050px;
    margin-bottom: 1.15rem;
    font-size: clamp(2.35rem, 5.4vw, 4.55rem);
    line-height: 1.02;
    letter-spacing: -.052em;
    font-weight: 900;
}

.article-summary {
    max-width: 880px;
    margin-bottom: 1.35rem;
    color: var(--article-muted);
    font-size: clamp(1.04rem, 1.7vw, 1.23rem);
    line-height: 1.75;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem 1.25rem;
    color: #85818c;
    font-size: .85rem;
}

.article-meta span {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
}

.article-meta i {
    color: var(--article-primary);
}

/* SHARE ------------------------------------------------------------------- */
.article-share-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .55rem;
    margin-top: 1.45rem;
}

.article-share-label {
    margin-right: .25rem;
    color: var(--article-muted);
    font-size: .82rem;
    font-weight: 700;
}

.article-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .42rem;
    min-height: 38px;
    padding: .48rem .72rem;
    border: 1px solid var(--article-border);
    border-radius: 11px;
    color: #55515d;
    background: #fff;
    font-size: .78rem;
    font-weight: 750;
    transition: transform .2s ease, border-color .2s ease, color .2s ease, background .2s ease;
}

.article-share-btn:hover {
    transform: translateY(-2px);
    color: var(--article-primary);
    border-color: rgba(124, 58, 237, .28);
    background: var(--article-primary-soft);
    text-decoration: none;
}

/* HERO IMAGE -------------------------------------------------------------- */
.article-visual-section {
    padding: 2.5rem 0 0;
}

.article-hero-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--article-radius-lg);
    background: #f3f1f6;
    border: 1px solid var(--article-border);
    box-shadow: var(--article-shadow);
}

.article-hero-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* CONTENT LAYOUT ---------------------------------------------------------- */
.article-main {
    padding: 3.5rem 0 5rem;
}

.article-reading-column {
    min-width: 0;
}

.article-content-shell {
    max-width: 860px;
}

.blog-article-content {
    color: #403c46;
    font-size: 1.075rem;
    line-height: 1.88;
}

.blog-article-content > *:first-child {
    margin-top: 0;
}

.blog-article-content p {
    margin-bottom: 1.35rem;
}

.blog-article-content h2,
.blog-article-content h3,
.blog-article-content h4 {
    margin-top: 2.4rem;
    margin-bottom: .95rem;
    line-height: 1.22;
    letter-spacing: -.025em;
}

.blog-article-content h2 {
    font-size: clamp(1.65rem, 3vw, 2.15rem);
}

.blog-article-content h3 {
    font-size: clamp(1.4rem, 2.5vw, 1.8rem);
}

.blog-article-content a {
    color: var(--article-primary-dark);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.blog-article-content strong {
    color: #28232e;
}

.blog-article-content ul,
.blog-article-content ol {
    margin-bottom: 1.45rem;
    padding-left: 1.35rem;
}

.blog-article-content li + li {
    margin-top: .4rem;
}

.blog-article-content blockquote {
    margin: 2rem 0;
    padding: 1.25rem 1.4rem;
    border-left: 4px solid var(--article-primary);
    border-radius: 0 16px 16px 0;
    background: var(--article-primary-soft);
    color: #50485e;
    font-size: 1.05rem;
}

.blog-article-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1.8rem auto;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(35, 26, 54, .08);
}

.blog-article-content iframe,
.blog-article-content video {
    max-width: 100%;
}

.blog-article-content iframe[src*="youtube"],
.blog-article-content iframe[src*="youtu.be"] {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border-radius: 16px;
}

.blog-article-content table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
    font-size: .95rem;
}

.blog-article-content th,
.blog-article-content td {
    padding: .75rem;
    border: 1px solid var(--article-border);
}

/* Mantiene espacios naturales para anuncios automáticos responsivos. */
.blog-article-content ins.adsbygoogle,
.blog-article-content .adsbygoogle {
    display: block !important;
    max-width: 100%;
    margin: 2rem auto !important;
}

.blog-article-content > div[id*="google_ads"],
.blog-article-content > div[class*="google-auto"] {
    max-width: 100%;
    margin: 2rem auto;
}

/* SIDEBAR ----------------------------------------------------------------- */
.article-sidebar {
    position: sticky;
    top: 105px;
}

.article-sidebar-card {
    overflow: hidden;
    border-radius: var(--article-radius-md);
    background: var(--article-dark);
    box-shadow: 0 16px 45px rgba(23, 20, 31, .15);
}

.article-sidebar-head {
    padding: 1.3rem 1.3rem .8rem;
}

.article-sidebar-kicker {
    display: block;
    margin-bottom: .35rem;
    color: #c4b5fd;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.article-sidebar-head h3 {
    margin: 0;
    color: #fff;
    font-size: 1.3rem;
}

.article-top-list {
    padding: .2rem .8rem .9rem;
}

.article-top-item {
    display: grid;
    grid-template-columns: 28px 74px minmax(0, 1fr);
    gap: .65rem;
    align-items: center;
    padding: .72rem .48rem;
    border-radius: 13px;
    transition: background .2s ease;
}

.article-top-item:hover {
    background: rgba(255,255,255,.055);
}

.article-top-rank {
    color: rgba(255,255,255,.28);
    font-size: 1rem;
    font-weight: 900;
    text-align: center;
}

.article-top-thumb {
    width: 74px;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 10px;
    background: rgba(255,255,255,.06);
}

.article-top-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-top-title {
    display: -webkit-box;
    margin-bottom: .2rem;
    overflow: hidden;
    color: rgba(255,255,255,.88);
    font-size: .8rem;
    font-weight: 700;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.article-top-title:hover {
    color: #fff;
    text-decoration: none;
}

.article-top-meta {
    color: rgba(255,255,255,.42);
    font-size: .68rem;
}

/* PREV / NEXT ------------------------------------------------------------- */
.article-navigation {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--article-border);
}

.article-nav-card {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    min-height: 120px;
    padding: 1.15rem;
    border-radius: 17px;
    color: var(--article-ink);
    background: var(--article-soft);
    border: 1px solid var(--article-border);
    transition: transform .22s ease, border-color .22s ease, background .22s ease;
}

.article-nav-card:hover {
    transform: translateY(-3px);
    color: var(--article-primary-dark);
    background: #fff;
    border-color: rgba(124,58,237,.24);
    text-decoration: none;
}

.article-nav-card.next {
    text-align: right;
}

.article-nav-label {
    color: var(--article-muted);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.article-nav-title {
    font-size: .94rem;
    font-weight: 750;
    line-height: 1.45;
}

/* RELATED ----------------------------------------------------------------- */
.article-related {
    padding: 0 0 5.5rem;
}

.article-related-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.article-related-kicker {
    display: block;
    margin-bottom: .4rem;
    color: var(--article-primary);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .065em;
    text-transform: uppercase;
}

.article-related-head h2 {
    margin: 0;
    font-size: clamp(1.75rem, 3vw, 2.4rem);
    letter-spacing: -.035em;
}

.article-related-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--article-border);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.article-related-card:hover {
    transform: translateY(-4px);
    border-color: rgba(124,58,237,.22);
    box-shadow: var(--article-shadow-hover);
}

.article-related-image {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f3f1f6;
}

.article-related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.article-related-card:hover img {
    transform: scale(1.035);
}

.article-related-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1rem;
}

.article-related-category {
    margin-bottom: .5rem;
    color: var(--article-primary);
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.article-related-card h3 {
    margin-bottom: .7rem;
    font-size: 1rem;
    line-height: 1.38;
}

.article-related-card h3 a {
    color: var(--article-ink);
}

.article-related-card h3 a:hover {
    color: var(--article-primary);
    text-decoration: none;
}

.article-related-link {
    margin-top: auto;
    color: var(--article-primary);
    font-size: .82rem;
    font-weight: 800;
}

/* COPY TOAST -------------------------------------------------------------- */
.article-copy-toast {
    position: fixed;
    left: 50%;
    bottom: 2rem;
    z-index: 1080;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .72rem 1rem;
    border-radius: 999px;
    color: #fff;
    background: var(--article-dark);
    box-shadow: 0 14px 35px rgba(23,20,31,.25);
    font-size: .82rem;
    font-weight: 750;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 12px);
    transition: opacity .2s ease, transform .2s ease;
}

.article-copy-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* RESPONSIVE --------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .article-header {
        padding-top: 2.8rem;
    }

    .article-sidebar {
        position: static;
        margin-top: 1rem;
    }

    .article-top-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .15rem .6rem;
    }

    .article-content-shell {
        max-width: none;
    }
}

@media (max-width: 767.98px) {
    .article-header {
        padding: 2.35rem 0 2rem;
    }

    .article-title {
        font-size: clamp(2.15rem, 11.5vw, 3.25rem);
    }

    .article-summary {
        font-size: 1rem;
    }

    .article-share-label {
        width: 100%;
    }

    .article-share-btn {
        flex: 1 1 auto;
    }

    .article-visual-section {
        padding-top: 1.7rem;
    }

    .article-hero-image {
        border-radius: 20px;
    }

    .article-main {
        padding-top: 2.6rem;
        padding-bottom: 3.75rem;
    }

    .blog-article-content {
        font-size: 1.02rem;
        line-height: 1.82;
    }

    .article-navigation {
        grid-template-columns: 1fr;
    }

    .article-nav-card.next {
        text-align: left;
    }

    .article-related {
        padding-bottom: 4rem;
    }

    .article-top-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 420px) {
    .article-share-btn span {
        display: none;
    }

    .article-share-btn {
        flex: 0 0 42px;
        width: 42px;
        padding-left: 0;
        padding-right: 0;
    }

    .article-top-item {
        grid-template-columns: 26px 66px minmax(0, 1fr);
    }

    .article-top-thumb {
        width: 66px;
    }
}
