/* ══════════════════════════════════════════════════════════════
   Top10Scout Article Design System — v3
   
   Design Direction: "Editorial Clean" (Wirecutter-inspired)
   - 680px max-width for optimal reading comfort
   - 20px body text, 1.8 line-height  
   - Clean product cards with left-aligned image
   - Dark comparison table header
   - Generous whitespace between sections
   
   Reference: NYT Wirecutter, RTINGS.com
   ══════════════════════════════════════════════════════════════ */

/* ── Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;0,6..72,700;1,6..72,400&family=DM+Sans:wght@400;500;600;700&display=swap');

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --font-heading: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #737373;
  --bg-page: #ffffff;
  --bg-card: #f7f7f5;
  --bg-highlight: #fef9ef;
  --border: #e5e5e5;
  --border-light: #f0f0f0;
  --accent: #d4483b;
  --accent-green: #1a7a4c;
  --accent-amber: #b45309;
  --amazon-orange: #ff9900;
  --max-w: 680px;
  --max-w-wide: 780px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-page);
  line-height: 1.8;
  margin: 0;
  padding: 0;
  font-size: 19px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Site Header ── */
body::before {
  content: '';
  display: block;
  width: 100%;
  height: 3px;
  background: var(--accent);
}

/* ── Article Wrapper ── */
.article-wrapper {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Breadcrumb ── */
.breadcrumb {
  padding: 20px 0 0;
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

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

/* ── Article Header ── */
.article-header {
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

h1 {
  font-family: var(--font-heading);
  font-size: 40px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin: 0 0 16px;
}

.meta-line {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.5;
}

.meta-line strong {
  color: var(--text-primary);
}

/* ── Body Text ── */
p {
  font-size: 19px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin: 0 0 20px;
}

strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ── Headings ── */
h2 {
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin: 56px 0 20px;
  padding: 0;
  border: none;
}

h3 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 40px 0 16px;
}

/* ── Quick Answer Box ── */
.quick-answer {
  background: var(--bg-highlight);
  border: 1px solid #e8dcc8;
  border-radius: 8px;
  padding: 24px 28px;
  margin: 28px 0 36px;
}

.quick-answer strong {
  font-size: 16px;
  color: var(--accent-amber);
  display: block;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.quick-answer p {
  margin: 0;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* ── Comparison Table ── */
table, .comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0 36px;
  font-size: 15px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

div:has(> table) {
  overflow-x: auto;
  margin: 28px 0 36px;
  -webkit-overflow-scrolling: touch;
}

div:has(> table) table {
  margin: 0;
}

thead tr {
  background: #1a1a1a;
}

thead th {
  color: #fff;
  font-weight: 600;
  padding: 14px 16px;
  text-align: left;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tbody td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  color: var(--text-secondary);
}

tbody tr:first-child {
  background: var(--bg-highlight);
}

tbody tr:first-child td {
  font-weight: 500;
  color: var(--text-primary);
}

tbody tr:hover {
  background: #fafafa;
}

/* ── Product Cards ── */
.product-card {
  display: block;
  /* gap/align removed: original generator uses inline flex styles */
  margin: 40px 0;
  padding: 32px;
  background: var(--bg-card);
  border-radius: 12px;
  border: none;
}

.product-card-image {
  flex: 0 0 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  min-height: 160px;
}

.product-card-image a {
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-card-image img {
  max-width: 140px;
  max-height: 180px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0;
  transition: transform 0.2s ease;
}

.product-card:hover .product-card-image img {
  transform: scale(1.04);
}

.product-card-info {
  flex: 1;
  min-width: 200px;
}

/* Product card heading */
.product-card h2,
.product-card-info h2 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 8px;
  padding: 0;
  border: none;
  color: var(--text-primary);
  line-height: 1.3;
}

/* Star rating */
.product-card p:nth-child(2),
.product-card-info > p:first-of-type {
  font-size: 14px;
  color: var(--accent-amber);
  margin: 0 0 6px;
}

/* Price */
.product-card p:nth-child(3),
.product-card-info > p:nth-of-type(2) {
  font-family: var(--font-body);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-green);
  margin: 0 0 16px;
  letter-spacing: -0.01em;
}

/* ── Amazon CTA Button ── */
a[href*="amazon.com"]:not(:has(img)) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--amazon-orange);
  color: #111;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  text-align: center;
  border: none;
  box-shadow: none;
  transition: background 0.2s, transform 0.15s;
  margin: 4px 0 0;
  line-height: 1.2;
}

a[href*="amazon.com"]:not(:has(img)):hover {
  background: #e88600;
  transform: translateY(-1px);
}

a[href*="amazon.com"]:not(:has(img))::before {
  content: none;
}

/* Big centered CTA */
p:has(> a[href*="amazon.com"]:only-child) {
  text-align: center;
  margin: 36px 0;
}

p:has(> a[href*="amazon.com"]:only-child) a[href*="amazon.com"] {
  padding: 14px 32px;
  font-size: 16px;
}

/* ── Product Review Text ── */
.product-review-text {
  margin: 0 0 24px;
  padding: 0;
}

.product-review-text p {
  font-size: 19px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.product-review-text p:last-child {
  margin-bottom: 0;
}

/* ── Methodology ── */
.methodology {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 28px 32px;
  margin: 48px 0;
}

.methodology h2 {
  font-size: 22px;
  margin: 0 0 12px;
}

.methodology p {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-muted);
  margin: 0;
}

/* ── FAQ Section ── */
.faq-item {
  border-bottom: 1px solid var(--border-light);
  padding: 20px 0;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item h2,
.faq-item .faq-q {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 8px;
  padding: 0;
  border: none;
  color: var(--text-primary);
}

.faq-item p,
.faq-item .faq-a {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0;
}

/* ── Author Box ── */
.author-box {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 28px 0;
  margin: 48px 0 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-bottom: none;
  background: transparent;
}

.author-box > div {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.author-box img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.author-box strong {
  font-size: 16px;
  color: var(--text-primary);
}

.author-box span {
  font-size: 14px;
  color: var(--text-muted);
}

.author-box p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 8px 0 0;
}

.author-box p:last-child {
  font-style: italic;
  font-size: 13px;
}

/* ── Links ── */
a:not([href*="amazon.com"]) {
  color: var(--accent);
  text-decoration: none;
}

a:not([href*="amazon.com"]):hover {
  text-decoration: underline;
}

/* ── Lists ── */
ul, ol {
  padding-left: 24px;
  margin: 16px 0;
}

li {
  margin-bottom: 8px;
  line-height: 1.7;
}

/* ── Mobile Responsive ── */
@media (max-width: 768px) {
  .article-wrapper {
    padding: 0 16px;
  }

  h1 {
    font-size: 30px;
  }

  h2 {
    font-size: 24px;
    margin-top: 40px;
  }

  p, .product-review-text p {
    font-size: 17px;
  }

  .product-card {
    flex-direction: column;
    gap: 20px;
    padding: 24px;
  }

  .product-card-image {
    flex: 1 1 auto;
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
  }

  .product-card-info {
    min-width: unset;
    width: 100%;
  }

  .product-card-info h2,
  .product-card h2 {
    font-size: 20px;
  }

  table {
    font-size: 13px;
  }

  thead th, tbody td {
    padding: 10px 12px;
  }
}

/* ── Print ── */
@media print {
  body::before { display: none; }
  .product-card { break-inside: avoid; page-break-inside: avoid; }
  a[href*="amazon.com"] { box-shadow: none; }
}


/* .product-img alias rules removed — original HTML uses product-card-image class with inline styles */

/* =========================================
   Restored Related Articles & Reviews Styling
   ========================================= */
.related-articles {
    margin: 48px 0;
    padding: 24px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}
.related-articles h2 {
    font-size: 1.4rem !important;
    margin-top: 0 !important;
    margin-bottom: 16px !important;
    border-bottom: none !important;
    color: #0f172a !important;
}
.related-articles div {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.related-link {
    color: #ea580c !important;
    font-weight: 600;
    text-decoration: none !important;
    display: flex;
    align-items: center;
    gap: 8px;
}
.related-link::before {
    content: "?;
    color: #cbd5e1;
}
.related-link:hover {
    color: #c2410c !important;
    text-decoration: underline !important;
}

.related-reviews {
    margin: 48px 0;
}
.related-reviews h2 {
    font-size: 1.6rem !important;
    margin-bottom: 24px !important;
    border-bottom: 2px solid #E2E8F0 !important;
    padding-bottom: 10px !important;
    color: #0f172a !important;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}
.related-card {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none !important;
    color: #1e293b !important;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
    border-color: #cbd5e1;
}
.related-card img, 
.article-content .related-card img,
.article-content section.related-reviews img {
    width: 100% !important;
    height: 130px !important;
    max-height: 130px !important;
    object-fit: contain !important;
    background: #fff !important;
    border-radius: 0 !important;
    margin: 0 !important;
}
.related-card span {
    padding: 12px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
    display: block;
    border-top: 1px solid #f1f5f9;
}

