/* ============================================
   ARTICLE CONTENT STYLES
   Comprehensive styling for news/post detail pages
   Including tables, code blocks, lists, quotes, etc.
   ============================================ */

/* ============================================
   TABLES - Modern, Responsive Design
   ============================================ */

.article-content table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    font-size: 0.95rem;
    border: 1px solid var(--border-color);
}

.article-content table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
}

.article-content table thead th {
    color: white;
    font-weight: 600;
    padding: 1rem 1.25rem;
    text-align: right;
    border: none;
    white-space: nowrap;
}

.article-content table thead th:first-child {
    border-top-right-radius: 11px;
}

.article-content table thead th:last-child {
    border-top-left-radius: 11px;
}

.article-content table tbody tr {
    transition: all 0.2s ease;
}

.article-content table tbody tr:nth-child(odd) {
    background-color: var(--bg-secondary);
}

.article-content table tbody tr:nth-child(even) {
    background-color: var(--bg-primary);
}

.article-content table tbody tr:hover {
    background-color: var(--bg-tertiary);
    transform: scale(1.005);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.article-content table td {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    color: var(--text-primary);
}

.article-content table tbody tr:last-child td {
    border-bottom: none;
}

.article-content table tbody tr:last-child td:first-child {
    border-bottom-right-radius: 11px;
}

.article-content table tbody tr:last-child td:last-child {
    border-bottom-left-radius: 11px;
}

/* Table caption */
.article-content table caption {
    caption-side: bottom;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: right;
    font-style: italic;
}

/* Responsive table wrapper */
.article-content .table-responsive,
.article-content>div[style*="overflow"] {
    margin: 1.5rem 0;
    border-radius: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Small/Compact table variant */
.article-content table.table-sm td,
.article-content table.table-sm th {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

/* Bordered table variant */
.article-content table.table-bordered td,
.article-content table.table-bordered th {
    border: 1px solid var(--border-color);
}

/* ============================================
   CODE BLOCKS & INLINE CODE
   ============================================ */

.article-content code {
    font-family: 'Fira Code', 'Menlo', 'Monaco', 'Consolas', monospace;
    background: var(--bg-tertiary);
    color: var(--danger-color);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9em;
    direction: ltr;
    text-align: left;
    border: 1px solid var(--border-color);
}

.article-content pre {
    margin: 1.5rem 0;
    padding: 1.25rem;
    background: #1e293b;
    color: #e2e8f0;
    border-radius: 12px;
    overflow-x: auto;
    direction: ltr;
    text-align: left;
    font-size: 0.9rem;
    line-height: 1.7;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    border: 1px solid #334155;
}

[data-theme="dark"] .article-content pre {
    background: #0f172a;
    border-color: #475569;
}

.article-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    border: none;
    font-size: 0.875rem;
    display: block;
    white-space: pre;
}

/* Code block with language label */
.article-content pre[class*="language-"]::before {
    content: attr(class);
    display: block;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   BLOCKQUOTES
   ============================================ */

.article-content blockquote {
    margin: 2rem 0;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-right: 5px solid var(--primary-color);
    border-radius: 0 12px 12px 0;
    position: relative;
    font-style: italic;
    color: var(--text-secondary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.article-content blockquote::before {
    content: '\201C';
    position: absolute;
    top: -10px;
    right: 20px;
    font-size: 4rem;
    color: var(--primary-color);
    opacity: 0.3;
    font-family: Georgia, serif;
    line-height: 1;
}

.article-content blockquote p {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.8;
}

.article-content blockquote p:last-child {
    margin-bottom: 0;
}

.article-content blockquote cite,
.article-content blockquote footer {
    display: block;
    margin-top: 1rem;
    font-size: 0.9rem;
    font-style: normal;
    color: var(--text-muted);
}

.article-content blockquote cite::before,
.article-content blockquote footer::before {
    content: '— ';
}

/* Nested blockquotes */
.article-content blockquote blockquote {
    margin: 1rem 0 0 0;
    border-radius: 0 8px 8px 0;
}

/* ============================================
   LISTS - Ordered & Unordered
   ============================================ */

.article-content ul,
.article-content ol {
    margin: 1.5rem 0;
    padding-right: 1.5rem;
    line-height: 1.9;
}

.article-content ul {
    list-style: none;
    padding-right: 0;
}

.article-content ul li {
    position: relative;
    padding-right: 1.75rem;
    margin-bottom: 0.75rem;
}

.article-content ul li::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0.65em;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-secondary) 100%);
    border-radius: 50%;
}

.article-content ol {
    list-style: none;
    padding-right: 0;
    counter-reset: item;
}

.article-content ol>li {
    position: relative;
    padding-right: 2.5rem;
    margin-bottom: 0.75rem;
    counter-increment: item;
}

.article-content ol>li::before {
    content: counter(item);
    position: absolute;
    right: 0;
    top: 0;
    width: 1.75rem;
    height: 1.75rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-secondary) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Nested lists */
.article-content ul ul,
.article-content ol ol,
.article-content ul ol,
.article-content ol ul {
    margin: 0.5rem 0;
}

.article-content ul ul li::before {
    background: var(--text-muted);
    width: 6px;
    height: 6px;
}

.article-content ol ol>li::before {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--primary-color);
    font-size: 0.75rem;
}

/* ============================================
   LINKS WITHIN CONTENT
   ============================================ */

.article-content a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    font-weight: 500;
}

.article-content a:hover {
    color: var(--primary-hover);
    border-bottom-color: var(--primary-color);
}

/* External link indicator */
.article-content a[target="_blank"]::after {
    content: ' ↗';
    font-size: 0.75em;
    vertical-align: super;
    opacity: 0.7;
}

/* ============================================
   HEADINGS WITHIN ARTICLES
   ============================================ */

.article-content h2 {
    margin: 2.5rem 0 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--primary-color);
    font-size: 1.75rem;
    color: var(--heading-color);
    font-weight: 700;
}

.article-content h3 {
    margin: 2rem 0 1rem;
    font-size: 1.5rem;
    color: var(--heading-color);
    font-weight: 600;
    position: relative;
    padding-right: 1rem;
}

.article-content h3::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

.article-content h4 {
    margin: 1.75rem 0 0.875rem;
    font-size: 1.25rem;
    color: var(--heading-color);
    font-weight: 600;
}

.article-content h5 {
    margin: 1.5rem 0 0.75rem;
    font-size: 1.125rem;
    color: var(--heading-color);
    font-weight: 600;
}

.article-content h6 {
    margin: 1.25rem 0 0.5rem;
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   HORIZONTAL RULES
   ============================================ */

.article-content hr {
    margin: 2.5rem 0;
    border: none;
    height: 1px;
    background: linear-gradient(to left, transparent, var(--border-color), transparent);
    position: relative;
}

.article-content hr::before {
    content: '• • •';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-primary);
    padding: 0 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    letter-spacing: 0.5em;
}

/* ============================================
   DEFINITION LISTS
   ============================================ */

.article-content dl {
    margin: 1.5rem 0;
}

.article-content dt {
    font-weight: 700;
    color: var(--heading-color);
    margin-bottom: 0.25rem;
}

.article-content dd {
    margin: 0 1.5rem 1rem 0;
    padding-right: 1rem;
    border-right: 3px solid var(--border-color);
    color: var(--text-secondary);
}

/* ============================================
   KEYBOARD KEYS
   ============================================ */

.article-content kbd {
    font-family: 'Fira Code', monospace;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-tertiary) 100%);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.15rem 0.6rem;
    font-size: 0.85em;
    box-shadow: 0 2px 0 var(--border-color);
    color: var(--text-primary);
    margin: 0 0.15rem;
}

/* ============================================
   MARK/HIGHLIGHT
   ============================================ */

.article-content mark {
    background: linear-gradient(120deg, rgba(37, 99, 235, 0.1) 0%, rgba(59, 130, 246, 0.2) 100%);
    color: var(--text-primary);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

[data-theme="dark"] .article-content mark {
    background: linear-gradient(120deg, rgba(59, 130, 246, 0.2) 0%, rgba(37, 99, 235, 0.3) 100%);
}

/* ============================================
   ABBREVIATIONS
   ============================================ */

.article-content abbr[title] {
    text-decoration: underline dotted;
    cursor: help;
    border: none;
}

/* ============================================
   FIGURES & CAPTIONS
   ============================================ */

.article-content figure {
    margin: 2rem 0;
    text-align: center;
}

.article-content figcaption {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ============================================
   CALLOUT/ALERT BOXES
   ============================================ */

.article-content .callout,
.article-content .alert-box,
.article-content .note,
.article-content .warning,
.article-content .info,
.article-content .tip {
    margin: 1.5rem 0;
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    position: relative;
    padding-right: 3.5rem;
}

.article-content .callout::before,
.article-content .alert-box::before,
.article-content .note::before,
.article-content .warning::before,
.article-content .info::before,
.article-content .tip::before {
    position: absolute;
    right: 1.25rem;
    top: 1.25rem;
    font-size: 1.25rem;
    font-weight: bold;
}

.article-content .note,
.article-content .info {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-right: 4px solid var(--info-color);
}

.article-content .note::before,
.article-content .info::before {
    content: 'ℹ️';
}

.article-content .warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-right: 4px solid var(--warning-color);
}

.article-content .warning::before {
    content: '⚠️';
}

.article-content .tip {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-right: 4px solid var(--success-color);
}

.article-content .tip::before {
    content: '💡';
}

.article-content .callout,
.article-content .alert-box {
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-right: 4px solid var(--cat-review);
}

.article-content .callout::before,
.article-content .alert-box::before {
    content: '📌';
}

/* ============================================
   COMPARISON TABLES (Two-column)
   ============================================ */

.article-content table.comparison {
    border: none;
    box-shadow: none;
}

.article-content table.comparison thead th:first-child {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
}

.article-content table.comparison thead th:last-child {
    background: linear-gradient(135deg, var(--danger-color) 0%, #dc2626 100%);
}

/* ============================================
   PRICING/FEATURE TABLES
   ============================================ */

.article-content table.pricing td:first-child {
    font-weight: 600;
    background: var(--bg-secondary);
}

.article-content table td .checkmark,
.article-content table td .check {
    color: var(--success-color);
    font-size: 1.2em;
}

.article-content table td .crossmark,
.article-content table td .cross {
    color: var(--danger-color);
    font-size: 1.2em;
}

/* ============================================
   EMBEDDED CONTENT
   ============================================ */

.article-content iframe {
    margin: 1.5rem auto;
    display: block;
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.article-content .video-container,
.article-content .embed-container {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 */
    height: 0;
    margin: 1.5rem 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.article-content .video-container iframe,
.article-content .embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    margin: 0;
    box-shadow: none;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .article-content table {
        font-size: 0.875rem;
    }

    .article-content table thead th,
    .article-content table td {
        padding: 0.625rem 0.875rem;
    }

    .article-content blockquote {
        padding: 1rem 1.25rem;
        margin: 1.5rem 0;
    }

    .article-content blockquote::before {
        font-size: 3rem;
        right: 10px;
    }

    .article-content pre {
        padding: 1rem;
        font-size: 0.8rem;
        border-radius: 8px;
    }

    .article-content h2 {
        font-size: 1.5rem;
    }

    .article-content h3 {
        font-size: 1.25rem;
    }

    .article-content ol>li::before {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.75rem;
    }

    .article-content ol>li {
        padding-right: 2.25rem;
    }
}

@media (max-width: 576px) {
    .article-content table thead {
        display: none;
    }

    .article-content table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: 8px;
        overflow: hidden;
    }

    .article-content table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid var(--border-light);
    }

    .article-content table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--heading-color);
        margin-left: 1rem;
    }

    .article-content table tbody tr:last-child td {
        border-radius: 0;
    }

    .article-content table tbody tr:last-child td:last-child {
        border-radius: 0 0 8px 8px;
    }
}

/* ============================================
   PRINT STYLES FOR ARTICLE CONTENT
   ============================================ */

@media print {
    .article-content table {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .article-content table thead {
        background: #f5f5f5 !important;
    }

    .article-content table thead th {
        color: #333 !important;
    }

    .article-content pre {
        background: #f5f5f5 !important;
        color: #333 !important;
        border: 1px solid #ddd;
    }

    .article-content blockquote {
        border-color: #999;
        background: #f9f9f9;
    }

    .article-content a::after {
        content: ' (' attr(href) ')';
        font-size: 0.8em;
        color: #666;
    }
}