/* ==================================
   AEO/SEO/GEO Optimization Styles
   ================================== */

/* Table of Contents Styling */
.table-of-contents {
    background: var(--cream);
    border-left: 4px solid var(--gold-primary);
    padding: 2rem;
    margin: 2rem 0 3rem 0;
    border-radius: 4px;
    transition: var(--transition-normal);
}

.table-of-contents h2 {
    margin-top: 0;
    font-size: 1.5rem;
    font-family: var(--font-headline);
    color: var(--navy-primary);
    margin-bottom: 1rem;
    transition: var(--transition-normal);
}

.toc-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.toc-item {
    margin-bottom: 0.75rem;
}

.toc-item a {
    color: var(--navy-primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
}

.toc-item a:hover {
    color: var(--gold-primary);
}

.toc-sub-item {
    margin-left: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.toc-sub-item a {
    font-weight: 400;
    color: var(--text-secondary);
}

/* Dark Mode Support */
[data-theme="dark"] .table-of-contents {
    background: rgba(26, 26, 46, 0.6);
    border-left-color: var(--gold-champagne);
}

[data-theme="dark"] .table-of-contents h2 {
    color: var(--white);
}

[data-theme="dark"] .toc-item a {
    color: var(--white);
}

[data-theme="dark"] .toc-sub-item a {
    color: var(--cream);
}

[data-theme="dark"] .toc-item a:hover,
[data-theme="dark"] .toc-sub-item a:hover {
    color: var(--gold-champagne);
}

/* Quick Answer Boxes */
h2 + p strong:first-child {
    color: var(--gold-primary);
}

[data-theme="dark"] h2 + p strong:first-child {
    color: var(--gold-champagne);
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.95rem;
    font-family: var(--font-ui);
    overflow: hidden;
    border-radius: 4px;
    transition: var(--transition-normal);
}

.data-table caption {
    font-size: 1.1rem;
    font-weight: 600;
    font-family: var(--font-headline);
    color: var(--navy-primary);
    margin-bottom: 1rem;
    text-align: left;
    transition: var(--transition-normal);
}

.data-table thead {
    background: var(--navy-primary);
    color: var(--white);
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--light-gray);
    transition: var(--transition-fast);
}

.data-table tbody tr:nth-child(even) {
    background: var(--cream);
}

.data-table tbody tr:hover {
    /* background: rgba(201, 169, 97, 0.1); */
}

.data-table td {
    padding: 0.875rem 1rem;
    color: var(--text-primary);
    transition: var(--transition-normal);
}

.data-table tfoot {
    background: var(--cream);
    font-size: 0.85rem;
    font-style: italic;
    color: var(--text-tertiary);
    transition: var(--transition-normal);
}

.data-table tfoot td {
    padding: 0.75rem 1rem;
}

/* Dark Mode - Data Tables */
[data-theme="dark"] .data-table {
    /* box-shadow: 0 2px 8px rgba(0,0,0,0.4); */
}

[data-theme="dark"] .data-table caption {
    color: var(--white);
}

[data-theme="dark"] .data-table thead {
    background: var(--navy-deep);
}

[data-theme="dark"] .data-table tbody tr {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .data-table tbody tr:nth-child(even) {
    background: rgba(26, 26, 46, 0.4);
}

[data-theme="dark"] .data-table tbody tr:hover {
    background: rgba(201, 169, 97, 0.15);
}

[data-theme="dark"] .data-table td {
    color: var(--light-gray);
}

[data-theme="dark"] .data-table tfoot {
    background: rgba(26, 26, 46, 0.6);
    color: var(--medium-gray);
}

/* FAQ Section Styling */
h2 + h3 {
    color: var(--navy-primary);
    font-family: var(--font-headline);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    transition: var(--transition-normal);
}

.faq-question {
    color: var(--navy-primary);
    font-family: var(--font-headline);
    margin-top: 2rem;
    margin-bottom: 1rem;
    transition: var(--transition-normal);
}

.faq-answer {
    margin-left: 0;
    padding-left: 1.5rem;
    border-left: 3px solid var(--gold-primary);
    color: var(--text-secondary);
}

[data-theme="dark"] h2 + h3,
[data-theme="dark"] .faq-question {
    color: var(--white);
}

[data-theme="dark"] .faq-answer {
    border-left-color: var(--gold-champagne);
    color: var(--light-gray);
}

/* Sources Section */
h2:contains("Sources") {
    border-top: 2px solid var(--light-gray);
    padding-top: 2rem;
    margin-top: 3rem;
}

[data-theme="dark"] h2:contains("Sources") {
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* Reading Time & Last Updated */
.reading-time,
.last-updated {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-family: var(--font-ui);
    color: var(--medium-gray);
    margin-right: 1rem;
    transition: var(--transition-normal);
}

.reading-time svg,
.last-updated svg {
    opacity: 0.7;
}

[data-theme="dark"] .reading-time,
[data-theme="dark"] .last-updated {
    color: var(--medium-gray);
}

/* Quick Summary Box */
article > p:first-of-type strong:first-child:contains("Quick Summary") {
    display: block;
    background: var(--cream);
    border-left: 4px solid var(--gold-primary);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
    font-size: 1.05rem;
    line-height: 1.7;
    transition: var(--transition-normal);
}

[data-theme="dark"] article > p:first-of-type strong:first-child:contains("Quick Summary") {
    background: rgba(26, 26, 46, 0.6);
    border-left-color: var(--gold-champagne);
}

/* Responsive Tables */
@media (max-width: 768px) {
    .data-table {
        font-size: 0.85rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
    
    .table-of-contents {
        padding: 1.5rem;
    }
}

/* Schema-ready content highlighting */
[itemscope] {
    border-left: 2px solid transparent;
}

/* Print Styles */
@media print {
    .table-of-contents {
        page-break-inside: avoid;
    }
    
    .data-table {
        page-break-inside: avoid;
    }
}
