/*
 * Article components: the layout blocks RankeringAQ writes into reviews and guides
 * (winner card, comparison table, pros and cons, key takeaways, table of contents, alert boxes...).
 * Part of the master theme so every site shows articles the same way; no per-site Custom CSS needed.
 * Icons come from icons.css.
 */

/* === CSS Variables === */
:root {
    --primary: #4f46e5;
    --secondary: #6366f1;
    --accent: #818cf8;
    --amazon: #ff9900;
    --gold: #fbbf24;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-400: #94a3b8;
    --slate-700: #334155;
    --slate-800: #1e293b;
}

/* === Article Container === */
.amazon-review-container,
.blog-content-container {
    font-family: "Outfit", "Inter", -apple-system, sans-serif;
    color: var(--slate-800);
    line-height: 1.8;
    font-size: 18px;
    max-width: 900px;
    margin: 0 auto;
}

/* === Headings === */
.blog-content-container h2 {
    color: var(--slate-800);
    font-size: 32px;
    font-weight: 800;
    margin: 60px 0 25px;
    border-left: 6px solid var(--primary);
    padding-left: 20px;
    line-height: 1.2;
}

.blog-content-container h3 {
    color: var(--slate-700);
    font-size: 24px;
    font-weight: 700;
    margin: 40px 0 15px;
}

.amazon-review-container h2 {
    color: var(--slate-800);
    font-size: 28px;
    font-weight: 800;
    margin: 40px 0 20px;
    line-height: 1.3;
}

.amazon-review-container h3 {
    color: var(--slate-700);
    font-size: 22px;
    font-weight: 700;
    margin: 35px 0 15px;
}

.amazon-review-container h4 {
    font-size: 18px;
    font-weight: 700;
    margin: 25px 0 12px;
}

/* === Table of Contents === */
.toc-container {
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: 16px;
    padding: 25px;
    margin: 40px 0;
}

.toc-title {
    font-weight: 800;
    font-size: 20px;
    margin-bottom: 15px;
    color: var(--slate-800);
    display: flex;
    align-items: center;
    gap: 10px;
}

.toc-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    columns: 2;
    gap: 40px;
}

.toc-list li {
    margin-bottom: 10px;
    font-size: 15px;
}

.toc-list a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.toc-list a:hover {
    text-decoration: underline;
}

/* === Top Pick Card (Winner Banner) === */
.top-pick-card {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 2px solid #fbbf24;
    border-radius: 20px;
    padding: 30px;
    margin: 40px 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(251, 191, 36, 0.1);
}

.top-pick-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #fbbf24;
    color: #92400e;
    padding: 8px 18px;
    border-bottom-left-radius: 20px;
    font-weight: 900;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* === Award Badges === */
.award-badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    margin: 0;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.award-gold {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fbbf24;
}

.award-blue {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.award-green {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

/* === Pros & Cons Grid === */
.pros-cons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 30px 0;
}

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

.pc-card {
    padding: 25px;
    border-radius: 16px;
    position: relative;
}

.pc-card h5 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pc-card.pros {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.pc-card.cons {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.pc-card ul {
    margin: 0;
    padding-left: 20px;
    font-size: 16px;
}

/* === Comparison Table === */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin: 40px 0;
    border-radius: 20px;
    border: 1px solid var(--slate-200);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05);
    background: white;
    position: relative;
    -webkit-overflow-scrolling: touch;
}

/* No edge-fade overlay here: an absolutely positioned fade inside a scrolling box moves with the
   content and ends up as a shaded band across the middle of the table. The scrollbar and the
   pinned first column's shadow already show that the table scrolls. */

.comparison-matrix {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    min-width: 680px;
}

/* table-layout:fixed reads column widths from the header row — define all four so
   every column is stable and consistent across browsers. These widths are for the 4-column
   product table; data tables with more columns (sizing, runtime, worksheets) are sized by
   their content instead (see the rule after this block). */
.comparison-matrix th:nth-child(1) { width: 26%; }
.comparison-matrix th:nth-child(2) { width: 38%; }
.comparison-matrix th:nth-child(3) { width: 20%; }
.comparison-matrix th:nth-child(4) { width: 16%; }

.comparison-matrix th {
    background: var(--slate-50);
    padding: 15px 10px;
    text-align: center;
    font-weight: 800;
    color: var(--slate-700);
    border-bottom: 2px solid var(--slate-200);
}

.comparison-matrix td {
    padding: 10px;
    border-bottom: 1px solid var(--slate-100);
    vertical-align: middle;
    text-align: center;
    font-size: 14px;
    word-wrap: break-word;
}

/* Tables with 5+ columns: size columns by their content and scroll sideways, instead of
   squeezing the extra columns to nothing */
.comparison-matrix:has(tr > :nth-child(5)) {
    table-layout: auto;
    min-width: 100%;
    width: max-content;
}
.comparison-matrix:has(tr > :nth-child(5)) th,
.comparison-matrix:has(tr > :nth-child(5)) td {
    width: auto !important;
    min-width: 110px;
    max-width: 260px;
    white-space: normal;
}

/* Product column stays put while you scroll the rest horizontally */
.comparison-matrix th:first-child,
.comparison-matrix td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    text-align: left;
    background: white;
    border-right: 1px solid var(--slate-200);  /* clear edge for columns scrolling underneath */
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.05);
}
.comparison-matrix th:first-child { background: var(--slate-50); }

/* "Our Choice" badge: let it wrap onto two lines rather than forcing a fixed
   width on nowrap text — that was pushing text outside the pill. */
.comparison-matrix td:nth-child(3) .award-badge {
    white-space: normal;
    text-align: center;
    max-width: 100%;
}

/* "Action" button: real clickable area, explicitly stacked above the fade layer */
.comparison-matrix td:nth-child(4) .amz-button.small {
    position: relative;
    z-index: 2;
    display: inline-flex;
    max-width: 100%;
}

@media (max-width: 640px) {
    .comparison-matrix th { padding: 12px 8px; font-size: 12px; }
    .comparison-matrix td { padding: 10px 8px; font-size: 13px; }
    .comparison-matrix .award-badge { font-size: 10px; padding: 5px 8px; }
    .comparison-matrix .amz-button.small { padding: 5px 10px; font-size: 10px; }
}

/* === Amazon Buy Button === */
.amz-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ff9900 0%, #ffb347 100%);
    border: none;
    border-radius: 14px;
    color: white !important;
    padding: 18px 36px;
    font-size: 19px;
    font-weight: 800;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 15px -3px rgba(255, 153, 0, 0.3);
}

.amz-button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(255, 153, 0, 0.4);
}

.amz-button.small {
    padding: 5px 15px;
    font-size: 10px;
    border-radius: 10px;
    background: transparent;
    color: var(--primary) !important;
    border: 1.5px solid var(--primary);
    font-weight: 700;
    box-shadow: none;
    transition: all 0.2s ease;
}

.amz-button.small:hover {
    background: var(--primary);
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

/* === Buy Box === */
.buy-box {
    text-align: center;
    margin: 25px 0;
}

/* === Product Image Container === */
.img-container {
    text-align: center;
    margin-bottom: 15px;
    min-height: 200px;
}

.img-container img,
.product-img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    display: inline-block;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* === Product Spec List === */
.product-spec-list {
    list-style: none;
    padding: 0;
    margin: 15px 0;
    background: var(--slate-50);
    border-radius: 12px;
    padding: 15px 20px;
}

.product-spec-list li {
    padding: 6px 0;
    border-bottom: 1px solid var(--slate-200);
    font-size: 15px;
}

.product-spec-list li:last-child {
    border-bottom: none;
}

/* === Featured Image === */
.featured-image-container {
    margin: 30px 0;
    text-align: center;
}

.featured-image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* === Alert Boxes === */
.premium-alert {
    padding: 25px;
    border-radius: 16px;
    margin: 35px 0;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.alert-pro-tip {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.alert-warning {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    color: #92400e;
}

.alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* === Key Takeaways === */
.key-takeaways {
    background: white;
    border: 2px solid var(--primary);
    border-radius: 20px;
    padding: 30px;
    margin: 40px 0;
    box-shadow: 0 10px 30px -10px rgba(79, 70, 229, 0.2);
}

.takeaway-title {
    font-weight: 900;
    font-size: 22px;
    color: var(--primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--slate-200);
    padding-bottom: 15px;
}

/* === Decision Tree === */
.decision-tree {
    background: var(--slate-800);
    color: white;
    border-radius: 20px;
    padding: 30px;
    margin: 40px 0;
}

.dt-item {
    border-left: 3px solid var(--accent);
    padding-left: 20px;
    margin-bottom: 20px;
}

.dt-condition {
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 5px;
}

/* === Calculation Box === */
.calculation-box {
    background: #fdf2f8;
    border: 1px solid #fbcfe8;
    border-radius: 16px;
    padding: 25px;
    margin: 35px 0;
}

/* === Scope Box === */
.scope-box {
    border: 1px dashed var(--slate-400);
    border-radius: 12px;
    padding: 20px;
    font-size: 15px;
    color: var(--slate-700);
    margin: 30px 0;
    background: var(--slate-50);
}

/* === War Story Box === */
.war-story-box {
    background: #fff7ed;
    border-left: 6px solid #f97316;
    border-radius: 0 16px 16px 0;
    padding: 30px;
    margin: 45px 0;
    position: relative;
}

.war-story-box h3 {
    color: #c2410c !important;
    margin-top: 0 !important;
    font-size: 22px !important;
}

/* === Clustering Hook === */
.clustering-hook {
    background: #f0fdf4;
    border: 1px dashed #22c55e;
    border-radius: 12px;
    padding: 20px;
    margin: 35px 0;
    text-align: center;
    font-weight: 600;
}

.clustering-hook a {
    color: #166534;
    text-decoration: underline;
}

/* === Glossary === */
.glossary-wrapper {
    background: var(--slate-100);
    border-radius: 20px;
    padding: 30px;
    margin: 50px 0;
}

/* === Affiliate Disclosure === */
.affiliate-disclosure {
    font-size: 0.85em;
    color: #64748b;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    font-style: italic;
}

/* === Divider (hr) === */
.amazon-review-container hr {
    margin: 40px 0;
    border: 0;
    border-top: 1px solid #e2e8f0;
}