/* ============================================
   paginawebbarata.cl - Article Styles
   Complement to styles.css
   ============================================ */

/* ---------- Breadcrumb ---------- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0;
    font-size: 0.875rem;
    color: var(--gray-500);
    flex-wrap: wrap;
    margin-top: 5rem;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.breadcrumb span {
    color: var(--gray-600);
    font-weight: 500;
}

.breadcrumb-sep {
    color: var(--gray-400);
}

/* ---------- Article Hero ---------- */
.article-hero {
    position: relative;
    width: 100%;
    min-height: 420px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
}

.article-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(99, 102, 241, 0.82) 0%,
        rgba(6, 182, 212, 0.65) 60%,
        rgba(15, 23, 42, 0.80) 100%
    );
    display: flex;
    align-items: center;
    width: 100%;
    padding: 3rem 0;
}

.article-hero-overlay .container {
    position: relative;
    z-index: 1;
    color: white;
}

.article-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    line-height: 1.2;
    margin: 1rem 0 0.75rem;
    color: white;
    max-width: 820px;
}

.article-excerpt {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.88);
    max-width: 680px;
    line-height: 1.7;
    margin: 0;
}

/* ---------- Article Meta ---------- */
.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.article-meta .blog-tag {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.article-meta span:not(.blog-tag) {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.article-meta span:not(.blog-tag)::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
}

.article-meta span:first-child::before {
    display: none;
}

/* ---------- Article Layout Grid ---------- */
.article-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 3rem;
    padding-top: 2.5rem;
    padding-bottom: 4rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .article-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* ---------- Article Body (Prose) ---------- */
.article-body {
    min-width: 0;
    font-family: var(--font-primary);
}

.article-body h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 2.5rem 0 1rem;
    padding-left: 1rem;
    border-left: 4px solid transparent;
    border-image: var(--gradient-primary) 1;
    line-height: 1.3;
    scroll-margin-top: 6rem;
}

.article-body h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: 2rem 0 0.75rem;
    line-height: 1.4;
    scroll-margin-top: 6rem;
}

.article-body h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-700);
    margin: 1.5rem 0 0.5rem;
}

.article-body p {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--gray-600);
    margin: 0 0 1.25rem;
}

.article-body strong {
    color: var(--gray-800);
    font-weight: 600;
}

.article-body a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-color: var(--primary-light);
    text-underline-offset: 3px;
    transition: color 0.2s;
}

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

/* Lists */
.article-body ul,
.article-body ol {
    margin: 0 0 1.25rem;
    padding-left: 0;
    list-style: none;
}

.article-body ul li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.6rem;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--gray-600);
}

.article-body ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gradient-primary);
}

.article-body ol {
    counter-reset: article-ol;
}

.article-body ol li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 0.6rem;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--gray-600);
    counter-increment: article-ol;
}

.article-body ol li::before {
    content: counter(article-ol);
    position: absolute;
    left: 0;
    top: 0;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin-top: 0.15em;
}

/* Blockquote */
.article-body blockquote {
    position: relative;
    background: var(--gray-50);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--gray-600);
    font-size: 1.05rem;
    line-height: 1.75;
}

.article-body blockquote p {
    margin: 0;
    color: inherit;
}

.article-body blockquote::before {
    content: '"';
    position: absolute;
    top: -0.5rem;
    left: 1rem;
    font-size: 3rem;
    color: var(--primary-light);
    font-family: Georgia, serif;
    line-height: 1;
    opacity: 0.4;
}

/* Highlight Box */
.highlight-box {
    background: var(--primary-50);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    padding: 1.5rem 1.75rem;
    margin: 2rem 0;
}

.highlight-box p {
    margin: 0;
    color: var(--primary-900);
    font-weight: 500;
}

.highlight-box .highlight-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    display: block;
}

.highlight-box .btn {
    margin-top: 1rem;
}

/* Table */
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.925rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.article-body table thead {
    background: var(--gradient-primary);
    color: white;
}

.article-body table thead th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
    border: none;
}

.article-body table tbody tr:nth-child(odd) {
    background: var(--gray-50);
}

.article-body table tbody tr:nth-child(even) {
    background: white;
}

.article-body table tbody tr:hover {
    background: var(--primary-50);
    transition: background 0.15s;
}

.article-body table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
    vertical-align: middle;
}

.article-body table tbody td strong {
    color: var(--primary-dark);
}

/* Article Image */
.article-image {
    margin: 2rem 0;
}

.article-image img {
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: block;
}

.article-image figcaption {
    text-align: center;
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-top: 0.5rem;
    font-style: italic;
}

/* ---------- Article Sidebar ---------- */
.article-sidebar {
    position: sticky;
    top: 6rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-self: start;
}

@media (max-width: 1024px) {
    .article-sidebar {
        position: static;
        order: -1;
    }
}

/* TOC */
.toc {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.toc-title {
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--gray-800);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toc-title::before {
    content: '';
    display: block;
    width: 3px;
    height: 1em;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.toc ol {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: toc-counter;
}

.toc ol li {
    counter-increment: toc-counter;
    padding: 0;
    margin: 0;
}

.toc ol li::before {
    display: none;
}

.toc ol li a {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    padding: 0.45rem 0;
    font-size: 0.875rem;
    color: var(--gray-600);
    text-decoration: none;
    border-bottom: 1px solid var(--gray-100);
    transition: color 0.2s;
    line-height: 1.4;
}

.toc ol li:last-child a {
    border-bottom: none;
}

.toc ol li a::before {
    content: counter(toc-counter);
    min-width: 1.3rem;
    height: 1.3rem;
    background: var(--primary-50);
    color: var(--primary);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toc ol li a:hover {
    color: var(--primary);
}

.toc ol li a:hover::before {
    background: var(--primary);
    color: white;
}

/* Sidebar CTA */
.sidebar-cta {
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.5rem;
    color: white;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.sidebar-cta h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    margin: 0 0 0.75rem;
    line-height: 1.3;
}

.sidebar-cta p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.88);
    margin: 0 0 1.25rem;
    line-height: 1.6;
}

.sidebar-cta .btn-wa {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #25d366;
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
    width: 100%;
}

.sidebar-cta .btn-wa:hover {
    background: #1ebe5a;
    transform: translateY(-2px);
}

.sidebar-cta .price-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-full);
    padding: 0.3rem 0.875rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    margin-bottom: 0.75rem;
}

/* ---------- Related Articles ---------- */
.related-section {
    background: var(--gray-50);
    padding: var(--section-padding) 0;
}

.related-section h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 2rem;
    text-align: center;
}

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

@media (max-width: 900px) {
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .related-grid {
        grid-template-columns: 1fr;
    }
}

.related-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s, box-shadow 0.25s;
    display: flex;
    flex-direction: column;
    text-decoration: none;
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.related-card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

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

.related-card-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.5rem;
}

.related-card-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.4;
    margin: 0 0 0.75rem;
    flex: 1;
}

.related-card-meta {
    font-size: 0.8rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.related-card-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    margin-top: 1rem;
    transition: gap 0.2s;
}

.related-card:hover .related-card-arrow {
    gap: 0.6rem;
}

/* ---------- Pros/Cons Boxes ---------- */
.pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin: 1.5rem 0;
}

@media (max-width: 600px) {
    .pros-cons {
        grid-template-columns: 1fr;
    }
}

.pros-box,
.cons-box {
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.pros-box {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}

.cons-box {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.pros-box h4 {
    color: #065f46;
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.cons-box h4 {
    color: #991b1b;
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pros-box ul li {
    color: #065f46;
    font-size: 0.875rem;
}

.pros-box ul li::before {
    background: #10b981;
}

.cons-box ul li {
    color: #991b1b;
    font-size: 0.875rem;
}

.cons-box ul li::before {
    background: #ef4444;
}

/* ---------- Dark Mode Overrides ---------- */
[data-theme="dark"] .article-body h2 {
    color: var(--gray-100);
}

[data-theme="dark"] .article-body h3 {
    color: var(--gray-200);
}

[data-theme="dark"] .article-body h4 {
    color: var(--gray-300);
}

[data-theme="dark"] .article-body p {
    color: var(--gray-400);
}

[data-theme="dark"] .article-body strong {
    color: var(--gray-200);
}

[data-theme="dark"] .article-body ul li,
[data-theme="dark"] .article-body ol li {
    color: var(--gray-400);
}

[data-theme="dark"] .article-body blockquote {
    background: var(--gray-800);
    border-left-color: var(--primary-light);
    color: var(--gray-300);
}

[data-theme="dark"] .highlight-box {
    background: rgba(99, 102, 241, 0.12);
    border-left-color: var(--primary-light);
}

[data-theme="dark"] .highlight-box p {
    color: var(--gray-200);
}

[data-theme="dark"] .highlight-box .highlight-title {
    color: var(--primary-light);
}

[data-theme="dark"] .article-body table thead {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--accent-dark) 100%);
}

[data-theme="dark"] .article-body table tbody tr:nth-child(odd) {
    background: var(--gray-800);
}

[data-theme="dark"] .article-body table tbody tr:nth-child(even) {
    background: var(--gray-900);
}

[data-theme="dark"] .article-body table tbody tr:hover {
    background: rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] .article-body table tbody td {
    color: var(--gray-300);
    border-bottom-color: var(--gray-700);
}

[data-theme="dark"] .article-body table tbody td strong {
    color: var(--primary-light);
}

[data-theme="dark"] .toc {
    background: var(--gray-800);
    border-color: var(--gray-700);
}

[data-theme="dark"] .toc-title {
    color: var(--gray-200);
}

[data-theme="dark"] .toc ol li a {
    color: var(--gray-400);
    border-bottom-color: var(--gray-700);
}

[data-theme="dark"] .toc ol li a:hover {
    color: var(--primary-light);
}

[data-theme="dark"] .toc ol li a::before {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
}

[data-theme="dark"] .related-section {
    background: var(--gray-900);
}

[data-theme="dark"] .related-section h2 {
    color: var(--gray-100);
}

[data-theme="dark"] .related-card {
    background: var(--gray-800);
}

[data-theme="dark"] .related-card-title {
    color: var(--gray-100);
}

[data-theme="dark"] .breadcrumb span {
    color: var(--gray-400);
}

[data-theme="dark"] .breadcrumb a {
    color: var(--primary-light);
}

[data-theme="dark"] .pros-box {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .pros-box h4 {
    color: #6ee7b7;
}

[data-theme="dark"] .pros-box ul li {
    color: #a7f3d0;
}

[data-theme="dark"] .cons-box {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

[data-theme="dark"] .cons-box h4 {
    color: #fca5a5;
}

[data-theme="dark"] .cons-box ul li {
    color: #fecaca;
}

/* ---------- Responsive Tweaks ---------- */
@media (max-width: 768px) {
    .article-hero {
        min-height: 340px;
    }

    .article-hero h1 {
        font-size: 1.5rem;
    }

    .article-excerpt {
        font-size: 0.95rem;
    }

    .article-body h2 {
        font-size: 1.3rem;
    }

    .article-body h3 {
        font-size: 1.1rem;
    }

    .article-body table {
        font-size: 0.8rem;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .article-body table thead th,
    .article-body table tbody td {
        padding: 0.6rem 0.75rem;
        white-space: nowrap;
    }

    .breadcrumb {
        font-size: 0.8rem;
    }
}
