/* ---------------------------
   Article Typography
---------------------------- */
.article {
  padding: 0;
}

.articleHeader {
  padding: 40px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}

.articleMeta {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0;
  font-size: 13px;
  color: var(--muted);
}

.articleMeta time {
  margin-left: 4px;
}

.articleTitle {
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text-heading);
}

.articleSubtitle {
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 32px;
  max-width: 720px;
}

.articleFeaturedImage {
  margin-top: 12px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: var(--t);
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9; /* Consistent 16:9 aspect ratio */
  background: var(--surface-2);
}

/* Featured image in content section: match content width, no border/background, fit height */
.articleContent .articleFeaturedImage {
  margin-bottom: 40px;
  border: none;
  background: transparent;
  border-radius: 0;
  aspect-ratio: unset;
  height: auto;
  overflow: visible;
}

.articleContent .articleFeaturedImage:hover {
  transform: translateY(-2px);
  box-shadow: none;
}

.articleContent .articleFeaturedImage img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Tag bubbles below featured image - uses same .tag class as categories */
.articleTags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
  margin-top: -24px;
}

.articleFeaturedImage:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.articleFeaturedImage img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  transition: var(--t);
}

.articleContent {
  padding-bottom: 60px;
}

.articleBody {
  max-width: 680px;
}

.articleBody > * + * {
  margin-top: 24px;
}

.articleBody > h2 {
  margin-top: 48px;
  margin-bottom: 16px;
}

.articleBody > h3 {
  margin-top: 36px;
  margin-bottom: 12px;
}

.articleBody > h4,
.articleBody > h5,
.articleBody > h6 {
  margin-top: 28px;
  margin-bottom: 10px;
}

/* Headings in article body */
.articleBody h1,
.articleBody h2,
.articleBody h3,
.articleBody h4,
.articleBody h5,
.articleBody h6 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-heading);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.articleBody h1 {
  font-size: 36px;
  margin-top: 40px;
  margin-bottom: 16px;
}

.articleBody h2 {
  font-size: 28px;
  position: relative;
}

.articleBody h2::before {
  content: "";
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}

.articleBody h3 {
  font-size: 22px;
  position: relative;
}

.tldr h3::before,
.faq-item h3::before {
  display: none;
}

.articleBody h3::before {
  content: "";
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3C/svg%3E") center / contain no-repeat;
}

.articleBody h4 {
  font-size: 18px;
}

.articleBody h5 {
  font-size: 16px;
}

.articleBody h6 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Paragraphs */
.articleBody p {
  margin: 0 0 20px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
  font-weight: 400;
}

.articleBody p:last-child {
  margin-bottom: 0;
}

/* Lists */
.articleBody ul,
.articleBody ol {
  margin: 20px 0;
  padding-left: 24px;
  color: var(--text);
}

.articleBody ul {
  list-style-type: disc;
}

.articleBody ol {
  list-style-type: decimal;
}

.articleBody li {
  margin: 8px 0;
  line-height: 1.7;
  font-size: 16px;
}

.articleBody li > ul,
.articleBody li > ol {
  margin: 8px 0;
  margin-left: 20px;
}

.articleBody li > ul {
  list-style-type: circle;
}

.articleBody li > ol {
  list-style-type: lower-alpha;
}

/* Definition lists */
.articleBody dl {
  margin: 20px 0;
}

.articleBody dt {
  font-weight: 600;
  color: var(--text);
  margin-top: 16px;
  font-size: 16px;
}

.articleBody dt:first-child {
  margin-top: 0;
}

.articleBody dd {
  margin: 6px 0 0 20px;
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
}

/* Blockquotes */
.articleBody blockquote {
  margin: 28px 0;
  padding: 20px 24px;
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.articleBody blockquote p {
  margin: 0 0 12px;
  font-style: normal;
  color: var(--text);
}

.articleBody blockquote p:last-child {
  margin-bottom: 0;
}

.articleBody blockquote footer {
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
}

.articleBody blockquote cite {
  font-style: normal;
}

/* Code */
.articleBody code {
  font-family: var(--font-mono);
  font-size: 14px;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text);
  border: 1px solid var(--border);
}

/* Code block wrapper (added by JS) */
.codeBlock {
  position: relative;
  margin: 24px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.codeBlock__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: 8px;
}

.codeBlock__lang {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.codeBlock__copy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: var(--t);
  white-space: nowrap;
}

.codeBlock__copy:hover {
  color: var(--text);
  background: var(--chip-hover);
  border-color: var(--text);
}

.codeBlock__copy.copied {
  color: var(--accent-text);
  border-color: var(--accent);
}

.codeBlock__copy svg {
  width: 13px;
  height: 13px;
  stroke-width: 2;
}

.articleBody .codeBlock pre {
  margin: 0;
  padding: 18px 16px;
  background: var(--surface-2);
  border: none;
  border-radius: 0;
  overflow-x: auto;
}

.articleBody .codeBlock pre code {
  background: transparent;
  padding: 0;
  border: none;
  font-size: 13.5px;
  line-height: 1.7;
  display: block;
  tab-size: 2;
}

/* Fallback for pre blocks not yet wrapped by JS */
.articleBody pre {
  margin: 24px 0;
  padding: 18px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}

.articleBody pre code {
  background: transparent;
  padding: 0;
  border: none;
  font-size: 13.5px;
  line-height: 1.7;
  display: block;
  tab-size: 2;
}

/* Links */
.articleBody a {
  color: var(--accent-text);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--t);
}

.articleBody a:hover {
  color: var(--accent-hover);
  text-decoration: none;
}

/* Override for review card CTA - must come after articleBody a:hover */
.articleBody .review-card-cta:hover {
  color: #fff !important;
  text-decoration: none !important;
  background: var(--accent-hover) !important;
  border-color: var(--accent-hover) !important;
}

html[data-theme="dark"] .articleBody .review-card-cta:hover {
  background: var(--accent-hover) !important;
  border-color: var(--accent-hover) !important;
  color: #fff !important;
}

/* Text formatting */
.articleBody strong {
  font-weight: 600;
  color: var(--text);
}

.articleBody em {
  font-style: italic;
}

.articleBody mark {
  background: var(--accent-subtle);
  padding: 2px 4px;
  border-radius: 3px;
  color: var(--text);
}

.articleBody small {
  font-size: 13px;
  color: var(--muted);
}

.articleBody del {
  text-decoration: line-through;
  opacity: 0.7;
}

.articleBody ins {
  text-decoration: underline;
}

.articleBody sub,
.articleBody sup {
  font-size: 12px;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

.articleBody sup {
  top: -0.5em;
}

.articleBody sub {
  bottom: -0.25em;
}

/* Tables */
.articleBody table {
  width: 100%;
  margin: 24px 0;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.articleBody thead {
  background: var(--surface-2);
}

.articleBody th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  border-bottom: 2px solid var(--border);
}

.articleBody td {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.articleBody tbody tr:last-child td {
  border-bottom: none;
}

.articleBody tbody tr:hover {
  background: var(--surface-2);
}

/* Responsive table behavior on small screens */
@media (max-width: 640px) {
  /* Make the WP table wrapper scrollable instead of the table itself */
  .articleBody figure.wp-block-table,
  .comparisonTable {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .articleBody figure.wp-block-table table,
  .comparisonTable table,
  .articleBody table[style*="border-collapse"] {
    min-width: 600px;
    /* Keep cells on a single line; user can scroll horizontally */
    white-space: nowrap;
  }
}

/* Notice/Info boxes */
.article-notice,
.articleBody .notice {
  background: #e8f4f8;
  border-left: 4px solid #0073aa;
  padding: 12px 15px;
  margin: 20px 0;
  font-size: 15px;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text);
  line-height: 1.6;
}

.article-notice strong,
.articleBody .notice strong {
  color: var(--text-heading);
  font-weight: 600;
}

.article-notice a,
.articleBody .notice a {
  color: #0073aa;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: var(--t);
}

.article-notice a:hover,
.articleBody .notice a:hover {
  color: #005a87;
  text-decoration: none;
}

.article-notice img.emoji,
.articleBody .notice img.emoji {
  width: 1.2em;
  height: 1.2em;
  vertical-align: -0.1em;
  margin-right: 4px;
  display: inline-block;
}

/* Dark theme styles - improved contrast for legibility */
html[data-theme="dark"] .article-notice,
html[data-theme="dark"] .articleBody .notice {
  background: rgba(0, 115, 170, 0.2);
  border-left-color: #6bb3e0;
  color: var(--text);
}

html[data-theme="dark"] .article-notice strong,
html[data-theme="dark"] .articleBody .notice strong {
  color: var(--text-heading);
}

html[data-theme="dark"] .article-notice a,
html[data-theme="dark"] .articleBody .notice a {
  color: #8cc5f0;
  text-decoration: underline;
  font-weight: 500;
}

html[data-theme="dark"] .article-notice a:hover,
html[data-theme="dark"] .articleBody .notice a:hover {
  color: #a8d5f5;
  text-decoration: none;
}

/* Horizontal rule */
.articleBody hr {
  margin: 32px 0;
  border: none;
  border-top: 1px solid var(--border);
  height: 0;
}

/* Figures and images */
.articleBody figure {
  margin: 28px 0;
  transition: var(--t);
}

.articleBody figure:hover {
  transform: translateY(-2px);
}

.articleBody figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: var(--t);
}

.articleBody figcaption {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  font-style: italic;
}

@media (max-width: 640px) {
  /* Add horizontal padding to sections on mobile */
  .section {
    padding-left: 16px;
    padding-right: 16px;
  }

  .grid {
    grid-template-columns: 1fr;
  }
  .whatGrid {
    grid-template-columns: 1fr;
  }
  .actions .search {
    display: none;
  }
  .actions .btn {
    padding: 10px 10px;
  }
  .cover-product {
    height: 190px;
  }
  /* Stack header content and center on small screens */
  .nav {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: auto;
    padding: 8px 0 10px;
  }
  .logo {
    order: 0;
    justify-content: center;
  }
  .links {
    order: 1;
    gap: 4px;
    padding: 2px 4px;
    justify-content: center;
  }
  .actions {
    order: 2;
  }
  .navLink {
    padding: 6px 10px;
    font-size: 12px;
  }

  /* Footer: logo full width, 3 link columns below */
  .footGrid {
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--sp-4);
  }
  .footGrid > div:first-child {
    grid-column: 1 / -1;
  }
  footer {
    text-align: left;
  }

  .articleHeader {
    padding: 24px 0 20px;
  }

  .articleTitle {
    font-size: 28px;
  }

  .articleSubtitle {
    font-size: 16px;
  }

  .articleBody {
    max-width: 100%;
  }

  .articleBody h1 {
    font-size: 28px;
  }

  .articleBody h2 {
    font-size: 24px;
  }

  .articleBody h3 {
    font-size: 20px;
  }

  .articleBody p,
  .articleBody li,
  .articleBody dd {
    font-size: 15px;
  }

  .prosCons {
    grid-template-columns: 1fr;
  }

  .contentLinks {
    grid-template-columns: 1fr;
  }

  /* Latest section: stack all three cards as equal-width rows */
  .sectionFeatured .featuredGrid {
    grid-template-columns: 1fr;
  }

  .sectionFeatured .featuredSide {
    grid-template-rows: auto;
  }

  .sectionFeatured .featuredMain .cover-product {
    height: 220px;
  }
}

/* ---------------------------
   Post Single View
---------------------------- */
.postSingle {
  padding: 0;
}

/* Header aligned to content column via same grid */
.postSingle__header {
  display: grid;
  grid-template-columns: 680px 200px;
  gap: 26px;
  justify-content: center;
}

/* All header children span only the first column */
.postSingle__header > * {
  grid-column: 1;
}

/* Two-column layout: sidebar + content */
.articleLayout {
  display: grid;
  grid-template-columns: 680px 200px;
  gap: 32px;
  align-items: start;
  position: relative;
  justify-content: center;
}

/* ─── Floating TOC Sidebar ─── */
.tocSidebar {
  position: sticky;
  top: calc(var(--topbar-h) + 24px);
  max-height: calc(100vh - var(--topbar-h) - 48px);
  overflow-y: auto;
  order: 2;
}

/* Hide scrollbar but keep scrollable */
.tocSidebar::-webkit-scrollbar {
  width: 0;
}

.tocSidebar__inner {
  padding: 0;
}

.tocSidebar__head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.tocSidebar__head svg {
  width: 14px;
  height: 14px;
  stroke: var(--muted);
  flex-shrink: 0;
}

.tocSidebar__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tocSidebar__link {
  display: block;
  padding: 5px 0 5px 12px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color var(--t), border-color var(--t);
}

.tocSidebar__link:hover {
  color: var(--text);
}

.tocSidebar__link.active {
  color: var(--accent-text);
  border-left-color: var(--accent);
}

/* Indent h3-level items */
.tocSidebar__link--sub {
  padding-left: 22px;
  font-size: 12px;
}

/* Progress bar at bottom */
.tocSidebar__progress {
  margin-top: 16px;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  overflow: hidden;
}

.tocSidebar__progressBar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 1px;
  transition: width 120ms ease-out;
}

/* ─── Article Content (left column) ─── */
.articleLayout .articleContent {
  order: 1;
  min-width: 0;
}

/* ─── Post Single Tags ─── */
.postSingle__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.postSingle__tag {
  display: inline-block;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: color var(--t), background var(--t), border-color var(--t);
}

.postSingle__tag:hover {
  color: var(--accent-text);
  background: var(--accent-subtle);
  border-color: var(--accent);
}

/* ─── Post Single Footer ─── */
.postSingle__footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.postSingle__footerMeta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}

.postSingle__author {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
  color: var(--text);
}

.postSingle__author svg {
  width: 14px;
  height: 14px;
  stroke: var(--muted);
}

.postSingle__updated {
  color: var(--muted);
}

/* Hide inline TOC on desktop when sidebar has taken over */
.toc--replaced {
  display: none;
}

/* ─── Post Single Responsive ─── */
@media (max-width: 980px) {
  .articleLayout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .postSingle__header {
    grid-template-columns: 1fr;
  }
  .tocSidebar {
    display: none;
  }
  .toc--replaced {
    display: block;
  }
  .articleBody {
    max-width: 100%;
  }
}

/* ---------------------------
   Product Single (Gear & Collect CPT)
---------------------------- */
.productSingle {
  padding: 0;
}

.productSingle__body {
  max-width: 680px;
  margin: 0 auto;
  padding-bottom: 60px;
}

/* Product image container */
.productSingle__image {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  margin-bottom: 28px;
  border-radius: var(--radius-lg);
  border: none;
  background: transparent;
  transition: transform 200ms var(--ease);
}

.productSingle__image:hover {
  transform: translateY(-3px);
}

.productSingle__image a {
  display: flex;
  align-items: center;
  justify-content: center;
}

.productSingle__image img {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
  display: block;
}

/* Title between brand and category tags */
.productSingle__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(20px, 3.5vw, 26px);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-heading);
  text-align: center;
  flex: 1;
  min-width: 0;
}

/* Taxonomy row — brands left, categories right */
.productSingle__taxonomies {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.productSingle__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.productSingle__tags--right {
  margin-left: auto;
}

/* Price bar */
.productSingle__priceBar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  margin-bottom: 32px;
}

.productSingle__price {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.02em;
}

.productSingle__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  padding: 11px 24px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease), background 200ms var(--ease);
  border: none;
  white-space: nowrap;
}

.productSingle__cta:hover {
  background: var(--accent-hover);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(230, 57, 70, 0.3);
}

html[data-theme="dark"] .productSingle__cta:hover {
  box-shadow: 0 4px 16px rgba(230, 57, 70, 0.4);
}

/* Content area */
.productSingle__content {
  max-width: none;
}

/* ─── Product Single Responsive ─── */
@media (max-width: 640px) {
  .productSingle__image {
    padding: 32px 20px;
  }

  .productSingle__image img {
    max-height: 280px;
  }

  .productSingle__title {
    font-size: 20px;
  }

  .productSingle__priceBar {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 14px;
    padding: 20px;
    border-left: 1px solid var(--border);
    border-top: 3px solid var(--accent);
  }

  .productSingle__cta {
    justify-content: center;
    width: 100%;
  }
}
