/* Design system v3.1 — visual hierarchy without changing editorial meaning. */
:root {
  --green-tint: #e9f1ed;
  --accent-tint: #fdf1ec;
  --radius-card: 12px;
  --radius-button: 8px;
  --radius-pill: 9999px;
  --shadow-card: none;
  --section-gap: 80px;
  --motion: 200ms ease;
}

/* Shared surfaces */
.article-card,
.compact-grid article a,
.article-content,
.legal-page,
.category-navigation,
.article-rail-toc,
.article-rail-product,
.product-candidate,
.guide-section,
.checklist-section,
.summary-section,
.editorial-guide {
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.hero-button,
.secondary-button,
.product-cta,
.search-submit,
a.page-numbers,
span.page-numbers {
  border-radius: var(--radius-button);
}

.category-label,
.product-source,
.category-pills a {
  border-radius: var(--radius-pill);
}

/* Home */
.home-hero {
  height: min(400px, calc(100vw * .5));
  min-height: 340px;
  border-radius: var(--radius-card);
  box-shadow: none;
}

.home-hero picture,
.home-hero picture img {
  height: 100%;
}

.home-hero picture img {
  aspect-ratio: auto;
}

.hero-copy {
  border-radius: var(--radius-card);
  box-shadow: none;
  border: 1px solid rgba(220, 228, 223, .82);
}

.hero-copy h1 {
  letter-spacing: -.02em;
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: -5px 0 25px;
}

.category-pills a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  transition: border-color var(--motion), color var(--motion), background var(--motion);
}

.category-pills a:hover,
.category-pills a:focus-visible {
  border-color: var(--green);
  background: var(--green-tint);
  color: var(--green);
}

.guide-band {
  grid-template-columns: 150px minmax(0, 1fr);
  border-radius: var(--radius-card);
  box-shadow: none;
}

.guide-band > div {
  text-align: left;
}

/* One link per article card. */
.article-card {
  transition: border-color var(--motion), transform var(--motion);
}

.article-card:hover,
.article-card:focus-within {
  border-color: var(--green);
  transform: translateY(-2px);
}

.article-card-link {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.article-card-link:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.article-card-body {
  display: block;
}

.article-card p {
  display: -webkit-box;
  overflow: hidden;
  margin-bottom: 0;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* Article and product cards */
.single-with-sidebar {
  grid-template-columns: minmax(0, 700px) minmax(240px, 300px);
  justify-content: center;
}

.article-content {
  padding: clamp(22px, 4vw, 44px);
}

.product-grid {
  gap: 18px;
}

.editorial-article .product-candidate {
  display: grid !important;
  grid-template-columns: 176px minmax(0, 1fr) !important;
  min-height: 200px;
  overflow: hidden !important;
  border: 1px solid var(--line);
  border-top-width: 1px;
  background: #fff;
}

.editorial-article .product-candidate[data-placement="primary_card"] {
  border-color: #b7cfc5;
  background: linear-gradient(120deg, var(--green-tint), #fff 42%);
}

.editorial-article .product-image-link,
.editorial-article .product-image-placeholder {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 100% !important;
  padding: 18px !important;
  border-right: 1px solid var(--line);
  border-bottom: 0 !important;
  background: #f7faf8;
}

.editorial-article .product-image {
  width: 100% !important;
  height: 150px !important;
  max-width: 150px !important;
  object-fit: contain !important;
}

.editorial-article .product-image-placeholder {
  min-width: 0;
  color: var(--green);
  font-size: 34px;
  text-align: center;
}

.editorial-article .product-image-placeholder span {
  max-width: 125px;
  font-size: 11px;
  line-height: 1.5;
}

.editorial-article .product-body {
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 18px 20px !important;
}

.product-body h3 {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 6px;
  font-size: 17px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-shop {
  margin: 0 0 9px !important;
  color: var(--muted);
  font-size: 12px;
}

.product-copy {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 8px !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: auto;
}

.product-price,
.product-review {
  margin: 0 !important;
  font-size: 13px !important;
}

.product-actions {
  margin: 10px 0 0 !important;
}

.product-cta {
  min-height: 44px;
  padding: 9px 14px;
  background: var(--green) !important;
  font-size: 13px;
  justify-content: center;
}

.primary-product-section {
  margin-top: 34px;
}

.primary-product-section > h2 {
  font-size: 21px;
}

.product-list-section {
  margin-top: var(--section-gap);
}

/* Sticky desktop rail. */
.article-rail {
  position: sticky;
  top: 94px;
  display: grid;
  gap: 14px;
}

.article-rail .category-navigation {
  position: static;
  top: auto;
  padding: 18px;
}

.article-rail .category-navigation small {
  display: none;
}

.article-rail-toc,
.article-rail-product {
  padding: 18px;
  border: 1px solid var(--line);
  background: #fff;
}

.article-rail-toc h2,
.article-rail-product h2 {
  margin: 3px 0 11px;
  font-size: 16px;
}

.article-rail-toc ol {
  margin: 0;
  padding-left: 1.25em;
}

.article-rail-toc li {
  margin: 6px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.article-rail-toc a {
  color: inherit;
  text-decoration: none;
}

.article-rail-toc a:hover,
.article-rail-toc a:focus-visible {
  color: var(--green);
}

.article-rail-product-name {
  margin: 0 0 5px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.6;
}

.article-rail-product-shop {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 11px;
}

.article-rail-product .product-cta {
  width: 100%;
}

.mobile-purchase-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 45;
  display: none;
  padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(12px);
  transform: translateY(110%);
  transition: transform var(--motion);
}

.mobile-purchase-bar[hidden],
.article-rail-product[hidden],
.article-rail-toc[hidden] {
  display: none !important;
}

.mobile-purchase-bar.is-visible {
  transform: translateY(0);
}

.mobile-purchase-bar a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 520px);
  min-height: 48px;
  margin: auto;
  border-radius: var(--radius-button);
  background: var(--green);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

@media (min-width: 901px) {
  .article-content > .editorial-article > .article-toc {
    display: none;
  }
}

@media (max-width: 900px) {
  .single-with-sidebar {
    grid-template-columns: 1fr;
  }

  .article-rail {
    position: static;
  }

  .article-rail-toc,
  .article-rail-product {
    display: none;
  }
}

@media (max-width: 640px) {
  .home-hero {
    height: auto;
    min-height: 0;
  }

  .home-hero picture,
  .home-hero picture img {
    height: auto;
  }

  .home-hero picture img {
    aspect-ratio: 2 / 1;
  }

  .guide-band {
    grid-template-columns: 88px 1fr;
  }

  .guide-band img {
    width: 88px;
    height: 132px;
  }

  .guide-band > div {
    text-align: left;
  }

  .category-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: thin;
  }

  .category-pills a {
    flex: 0 0 auto;
    min-height: 44px;
  }

  .editorial-article .product-candidate {
    grid-template-columns: 112px minmax(0, 1fr) !important;
  }

  .editorial-article .product-image-link,
  .editorial-article .product-image-placeholder {
    min-height: 100% !important;
    padding: 12px !important;
    border-right: 1px solid var(--line) !important;
    border-bottom: 0 !important;
  }

  .editorial-article .product-image {
    height: 108px !important;
  }

  .editorial-article .product-body {
    padding: 15px !important;
  }

  .product-copy,
  .product-review {
    display: none !important;
  }

  .product-body h3 {
    font-size: 15px;
  }

  .product-cta {
    width: 100%;
    padding-inline: 8px;
    font-size: 12px;
  }

  .mobile-purchase-bar {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
