:root {
  --max-width: 720px;
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --border: #e6e6e6;
  --accent: #1d4ed8;
  --card-bg: #f7f7f8;
  --radius: 10px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
}

a { color: var(--accent); text-decoration: none; overflow-wrap: break-word; }
a:hover { text-decoration: underline; }

img, svg { max-width: 100%; height: auto; display: block; }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header / nav */
header.site-header {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}
header.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.site-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}
.site-title:hover { text-decoration: none; opacity: 0.85; }
.site-logo { display: block; height: 32px; width: auto; max-width: 220px; }
.site-favicon { display: block; height: 28px; width: 28px; flex: none; border-radius: 6px; }
nav.main-nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}
nav.main-nav a {
  color: var(--text);
  font-weight: 500;
}

/* Main content */
main { padding: 32px 0 48px; min-height: 60vh; }

h1, h2, h3, h4 { line-height: 1.3; }
h1 { font-size: 2rem; margin: 0 0 8px; }
article h1 { font-size: 1.9rem; }

.post-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 28px;
}
.post-meta .updated { font-style: italic; }

article.post-content p { margin: 1.1em 0; }
article.post-content pre {
  background: var(--card-bg);
  padding: 14px 16px;
  border-radius: var(--radius);
  overflow-x: auto;
}
article.post-content code {
  background: var(--card-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}
article.post-content pre code { background: none; padding: 0; }
article.post-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.2em 0;
  padding: 0.2em 1em;
  color: var(--muted);
}

/* Comparison tables inside posts */
article.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4em 0;
  font-size: 0.95em;
}
article.post-content th,
article.post-content td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
}
article.post-content thead th {
  background: var(--card-bg);
  font-weight: 700;
}
article.post-content tbody tr:nth-child(even) { background: var(--card-bg); }
article.post-content th:empty::after,
article.post-content td:empty::after { content: "\00a0"; }

/* Post grid (home + blog index) — modern 3-column card layout */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 0;
  padding: 0;
}
.post-card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
}
.post-card h2 { font-size: 1.1rem; margin: 0 0 8px; line-height: 1.35; }
.post-card h2 a { color: var(--text); }
.post-card h2 a:hover { text-decoration: none; opacity: 0.85; }
.post-card .post-meta { margin-bottom: 10px; }
.post-card .excerpt { color: var(--muted); margin: 0 0 14px; flex: 1; font-size: 0.95rem; }
.post-card .read-more { font-weight: 600; font-size: 0.9rem; align-self: flex-start; }

/* Category badges — shown on post cards and at the top of each post */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.post-card .post-tags { margin: 0 0 10px; }
article.post-content > .post-tags { margin: 0 0 24px; }
.tag-badge {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
}
.tag-badge:hover { background: var(--card-bg); text-decoration: none; }

.load-more-wrap { display: flex; justify-content: center; margin: 36px 0 12px; }
.load-more-btn {
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 12px 28px;
  cursor: pointer;
}
.load-more-btn:hover { background: var(--border); }

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

/* Author bio box */
.author-bio {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 18px;
  margin: 40px 0 32px;
}
.author-bio .avatar {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}
.author-bio h3 { margin: 0 0 4px; font-size: 1rem; }
.author-bio p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.author-social {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
}
.author-social a { font-weight: 600; font-size: 0.9rem; }

/* Related posts */
.related-posts { margin: 20px 0 40px; }
.related-posts h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 12px;
}
.related-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.related-grid a {
  display: block;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
}
.related-grid a:hover { text-decoration: none; opacity: 0.85; }

/* Ad slot (AdSense) */
.ad-slot { margin: 28px 0; text-align: center; }

/* Footer */
footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 40px;
  color: var(--muted);
  font-size: 0.9rem;
}
footer.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}
footer.site-footer ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 0;
  padding: 0;
}
footer.site-footer a { color: var(--muted); }

/* Tablet / small desktop: tighten side padding a little */
@media (max-width: 700px) {
  .wrap { padding: 0 18px; }
  main { padding: 24px 0 40px; }
}

/* Mobile */
@media (max-width: 480px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  main { padding: 20px 0 36px; }

  h1 { font-size: 1.5rem; }
  article h1 { font-size: 1.4rem; }
  h2 { font-size: 1.2rem; }

  header.site-header { padding: 14px 0; }
  header.site-header .wrap { flex-direction: column; align-items: flex-start; gap: 10px; }
  nav.main-nav ul { gap: 16px; padding: 2px 0; }
  nav.main-nav a { display: inline-block; padding: 4px 0; } /* bigger tap target */

  .post-grid { gap: 16px; }
  .post-card { padding: 16px; }
  .author-bio { flex-direction: column; align-items: flex-start; padding: 16px; margin: 32px 0 24px; }
  .related-grid { grid-template-columns: 1fr; }

  article.post-content pre { padding: 12px; font-size: 0.85em; }
  article.post-content table { display: block; overflow-x: auto; min-width: 100%; font-size: 0.88em; }
  article.post-content th, article.post-content td { padding: 6px 9px; }
  article.post-content, .post-list, .related-posts { overflow-wrap: break-word; word-wrap: break-word; }

  footer.site-footer { padding: 20px 0 32px; }
  footer.site-footer .wrap { flex-direction: column; gap: 14px; }
  footer.site-footer ul { gap: 12px 16px; }
}

/* Very small phones */
@media (max-width: 340px) {
  .wrap { padding: 0 14px; }
  h1 { font-size: 1.35rem; }
}


/* Amazon affiliate blocks (AMZ posts) */
.amz-disclosure {
  font-size: 0.82rem;
  color: #6b7280;
  margin: 0 0 0.9rem;
}
.amz-table { width: 100%; max-width: 100%; overflow-x: auto; margin: 1.4em 0; }
.amz-table table { width: 100%; border-collapse: collapse; }
.amz-table th,
.amz-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: middle;
}
.amz-table img { border-radius: 8px; object-fit: contain; }
.amz-rating { font-weight: 600; }
.amz-rating-empty { color: #6b7280; font-weight: 500; }
.amz-rating-count { color: #6b7280; font-size: 0.85em; }
.amz-btn {
  display: inline-block;
  background: #ff9900;
  color: #111 !important;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none !important;
  white-space: nowrap;
}
.amz-btn:hover { background: #e88a00; }
.amz-btn--off { display: none !important; }
.amz-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  margin: 1.6rem 0;
}
.amz-card-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  align-items: start;
}
.amz-card-media { margin: 0; text-align: center; }
.amz-card-media img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  object-fit: contain;
}
.amz-card-title { margin-top: 0; }
.amz-card-cta { margin-top: 10px; }
@media (max-width: 640px) {
  .amz-card-grid { grid-template-columns: 1fr; }
  .amz-card-media img { max-width: 220px; }
}


/* Amazon review component library (AMZ posts).
   Reusable blocks the writer composes into a different structure for each
   article: hero, split, compact row, feature cards, chips, spec list,
   pros/cons, callouts, rating summary and FAQ. Every multi-column block
   collapses to a single column on a phone, and nothing scrolls sideways. */
.amz-hero,
.amz-split { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: center; margin: 1.6rem 0; }
.amz-split--reverse .amz-split-media { order: 2; }
.amz-hero,
.amz-split,
.amz-row,
.amz-specs,
.amz-proscons,
.amz-cards,
.amz-feature-row,
.amz-score,
.amz-faq { min-width: 0; }
.amz-hero-media,
.amz-split-media,
.amz-row-media,
.amz-card-media { margin: 0; text-align: center; }
.amz-hero-media img,
.amz-split-media img,
.amz-row-media img { max-width: 100%; height: auto; border-radius: 10px; object-fit: contain; margin: 0 auto; }
.amz-hero-body > :first-child,
.amz-split-body > :first-child,
.amz-row-body > :first-child { margin-top: 0; }
.amz-row { display: grid; grid-template-columns: 150px 1fr; gap: 16px; align-items: start; }
.amz-card--stack .amz-card-grid { grid-template-columns: 1fr; }
.amz-card--stack .amz-card-media img { max-width: 260px; }
.amz-card--row { padding: 12px 14px; }
.amz-cards,
.amz-feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 1.4rem 0; }
.amz-feature { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.amz-feature h3,
.amz-feature h4 { margin: 0 0 6px; font-size: 1rem; }
.amz-feature p { margin: 0; font-size: 0.95rem; color: var(--muted); }
.amz-feature-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 1.2rem 0; padding: 0; list-style: none; }
.amz-chip { display: inline-block; background: var(--card-bg); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; font-size: 0.85rem; font-weight: 600; }
.amz-specs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 20px; margin: 1.2rem 0; }
.amz-spec { display: flex; justify-content: space-between; gap: 10px; margin: 0; padding: 8px 0; border-bottom: 1px solid var(--border); }
.amz-spec dt { color: var(--muted); }
.amz-spec dd { margin: 0; font-weight: 600; text-align: right; }
.amz-proscons { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 1.4rem 0; }
.amz-pros,
.amz-cons { border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; }
.amz-pros { border-left: 4px solid #16a34a; }
.amz-cons { border-left: 4px solid #dc2626; }
.amz-pros h3,
.amz-cons h3 { margin: 0 0 8px; font-size: 1rem; }
.amz-pros ul,
.amz-cons ul { margin: 0; padding-left: 18px; }
.amz-score { display: flex; align-items: center; gap: 14px; margin: 1.2rem 0; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--card-bg); }
.amz-score-value { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.amz-score-count { color: var(--muted); font-size: 0.9rem; }
.amz-note,
.amz-verdict,
.amz-bestfor,
.amz-avoid { margin: 1.4rem 0; padding: 14px 18px; border: 1px solid var(--border); border-radius: 10px; background: var(--card-bg); }
.amz-verdict { border-left: 4px solid var(--accent); }
.amz-note--tip,
.amz-bestfor { border-left: 4px solid #16a34a; }
.amz-note--warn,
.amz-avoid { border-left: 4px solid #d97706; }
.amz-verdict > :first-child,
.amz-note > :first-child,
.amz-bestfor > :first-child,
.amz-avoid > :first-child { margin-top: 0; }
.amz-verdict > :last-child,
.amz-note > :last-child,
.amz-bestfor > :last-child,
.amz-avoid > :last-child { margin-bottom: 0; }
.amz-faq { margin: 1.4rem 0; }
.amz-faq-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.amz-faq-item:last-child { border-bottom: 0; }
.amz-faq-item p:first-child { margin-top: 0; font-weight: 700; }
.amz-faq-item p:last-child { margin-bottom: 0; }
.amz-cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 1rem 0 0; }
.amz-product-title { margin-top: 0; }
.amz-lede { font-size: 1.05rem; color: var(--muted); }
@media (max-width: 640px) {
  .amz-hero,
  .amz-split,
  .amz-proscons,
  .amz-specs { grid-template-columns: 1fr; }
  .amz-split--reverse .amz-split-media { order: 0; }
  .amz-row { grid-template-columns: 110px 1fr; }
  .amz-score-value { font-size: 1.4rem; }
}


/* Product review boxes for AMZ posts: a short, balanced box with the image on
   one side and the summary, points and button on the other, plus the full
   review underneath. The reversed grid gives consecutive products a different
   look without changing the shape, and both collapse to one column on a phone. */
.amz-pick { display: inline-block; background: var(--accent, #2563eb); color: #fff;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  border-radius: 999px; padding: 3px 10px; margin: 0 8px 6px 0; vertical-align: middle; }
.amz-points { margin: 10px 0 0; padding-left: 18px; }
.amz-points li { margin: 3px 0; }
.amz-card-grid--reverse { grid-template-columns: 1fr 220px; }
.amz-card-grid--reverse .amz-card-media { order: 2; }
.amz-review { margin: 0 0 1.8rem; }
.amz-review > :first-child { margin-top: 0; }
@media (max-width: 640px) {
  .amz-card-grid--reverse { grid-template-columns: 1fr; }
  .amz-card-grid--reverse .amz-card-media { order: 0; }
}

@media (max-width: 640px) {
  .amz-table table,
  .amz-table thead,
  .amz-table tbody,
  .amz-table tr,
  .amz-table td { display: block; width: 100%; }
  .amz-table thead { display: none; }
  .amz-table tr { padding: 12px 0; border-bottom: 1px solid var(--border, #e5e7eb); }
  .amz-table tr:last-child { border-bottom: 0; }
  .amz-table td { border: 0; padding: 2px 0; }
  .amz-table td[data-label]::before {
    content: attr(data-label) ": "; color: var(--muted, #6b7280); font-weight: 600; }
  .amz-table .amz-col-img::before,
  .amz-table .amz-col-name::before { content: none; }
  .amz-table .amz-col-img { text-align: center; }
  .amz-card-media .amz-card-cta { margin-top: 10px; }
}


/* AMZ comparison table on a phone: stack and wrap, never scroll sideways.
   A <figure> carries the browser's default 40px side margins, so width:100%
   made the table wider than the page; resetting the margin and neutralising
   the generic article.post-content table scroll rule keeps the page still. */
.amz-table { margin-left: 0; margin-right: 0; }
@media (max-width: 640px) {
  article.post-content .amz-table,
  article.post-content .amz-table table { overflow-x: visible; }
  article.post-content .amz-table table { min-width: 0; max-width: 100%; }
  article.post-content .amz-table td { max-width: 100%; }
  .amz-table .amz-col-name { overflow-wrap: anywhere; word-break: break-word; }
}
