/* UnitWise — buying guides (index and articles). Builds on styles.css. */

/* ---------- Page header: the hero's dot grid, tinted per guide ---------- */

.page-hero {
  --tint: #fdfcff;
  padding: 72px 0 64px;
  background:
    radial-gradient(circle at 17px 19px, rgba(117, 107, 168, .2) .8px, transparent 1.2px) 0 0 / 32px 32px,
    var(--tint);
}
.page-hero--lavender { --tint: var(--lavender-tint); }
.page-hero--yellow { --tint: var(--accent-soft); }
.page-hero--coral { --tint: var(--coral-soft); }

.crumbs {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}
.crumbs a { color: var(--blue); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.page-hero__title {
  max-width: 860px;
  font-size: clamp(44px, 5.2vw, 72px);
  line-height: 1.05;
  color: var(--navy);
  text-wrap: balance;
}
.page-hero__lead {
  max-width: 660px;
  margin-top: 24px;
  font-size: 20px;
  line-height: 1.5;
  color: var(--muted);
}
.page-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}
.page-hero__meta li {
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(23, 25, 67, .08);
}

/* ---------- Guides index ---------- */

.guides-list { padding: 64px 0 112px; }
.guide-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.guide-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: 24px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(23, 25, 67, .06), 0 14px 36px rgba(23, 25, 67, .08);
  transition: transform .15s ease, box-shadow .15s ease;
}
.guide-card:hover { transform: translateY(-3px); box-shadow: 0 1px 2px rgba(23, 25, 67, .06), 0 20px 44px rgba(23, 25, 67, .14); }
.guide-card__visual {
  display: grid;
  place-items: center;
  min-height: 200px;
  padding: 28px;
}
.guide-card--lavender .guide-card__visual { background: var(--lavender-soft); }
.guide-card--yellow .guide-card__visual { background: var(--accent); }
.guide-card--coral .guide-card__visual { background: var(--coral-soft); }

.guide-card__mini { display: grid; gap: 8px; width: 100%; max-width: 280px; }
.guide-card__mini > span {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
}
.guide-card__mini i {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--lavender);
  color: var(--navy);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}
.guide-card__mini b { font-variant-numeric: tabular-nums; }
.guide-card__mini .is-best { box-shadow: inset 0 0 0 2px var(--navy); }
.guide-card__mini .is-best b { padding: 2px 8px; border-radius: 6px; background: var(--accent); }

.guide-card__formula {
  color: var(--navy);
  font-size: 40px;
  line-height: 1.1;
  text-align: center;
}
.guide-card__stat { display: grid; justify-items: center; gap: 6px; text-align: center; }
.guide-card__stat b { color: var(--coral-ink); font-size: 56px; line-height: 1; }
.guide-card__stat > span { font-size: 15px; font-weight: 700; color: var(--navy); }

.guide-card__body { display: flex; flex: 1; flex-direction: column; padding: 26px 28px 28px; }
.guide-card__kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--blue);
}
.guide-card__title { margin-top: 12px; font-size: 22px; font-weight: 700; line-height: 1.3; color: var(--navy); }
.guide-card__text { flex: 1; margin-top: 10px; font-size: 16px; line-height: 1.5; color: var(--muted); }
.guide-card__more { margin-top: 20px; font-size: 16px; font-weight: 700; color: var(--navy); }
.guide-card:hover .guide-card__more { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Article layout ---------- */

.article {
  display: grid;
  grid-template-columns: minmax(0, 720px) 300px;
  justify-content: space-between;
  column-gap: 64px;
  padding: 64px 0 96px;
}
.article__aside { display: grid; align-content: start; gap: 20px; position: sticky; top: 112px; align-self: start; }

.toc { padding: 22px 24px; border-radius: 20px; background: var(--lavender-tint); }
.toc__title { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--blue); }
.toc ol { display: grid; gap: 4px; margin-top: 12px; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  padding: 6px 0;
  color: var(--navy);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
}
.toc a::before { content: counter(toc); font-weight: 700; color: var(--blue); }
.toc a:hover { text-decoration: underline; text-underline-offset: 3px; }

.aside-cta { padding: 24px; border-radius: 20px; background: var(--navy); color: #fff; }
.aside-cta__title { font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1.1; color: var(--accent); }
.aside-cta__text { margin-top: 10px; font-size: 15px; line-height: 1.5; color: var(--navy-soft); }
.aside-cta__button { width: 100%; height: 48px; margin-top: 18px; background: var(--accent); color: var(--navy); }
.aside-cta__button:hover { background: #ffe466; }

/* ---------- Prose ---------- */

.prose { color: #2a2d3a; font-size: 18px; line-height: 1.65; }
.prose > * + * { margin-top: 20px; }
.prose h2 {
  margin-top: 56px;
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--navy);
  scroll-margin-top: 112px;
}
.prose h2:first-child { margin-top: 0; }
.prose h2 + p { margin-top: 16px; }
.prose a { color: var(--blue); font-weight: 700; text-underline-offset: 3px; }
.prose strong { color: var(--navy); }
.prose ul { display: grid; gap: 10px; }
.prose ul > li { position: relative; padding-left: 28px; }
.prose ul > li::before {
  content: "";
  position: absolute;
  top: .62em;
  left: 4px;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--lavender);
}

.steps-list { display: grid; gap: 12px; counter-reset: step; }
.steps-list li {
  position: relative;
  padding: 18px 20px 18px 72px;
  border-radius: 16px;
  background: var(--lavender-tint);
  counter-increment: step;
}
.steps-list li::before {
  content: counter(step);
  position: absolute;
  top: 16px;
  left: 18px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--navy);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

/* Callouts */
.callout { padding: 24px 28px; border-radius: 20px; }
.callout > * + * { margin-top: 10px; }
.callout__label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.35;
  text-transform: uppercase;
}
.callout--tip { background: var(--lavender-soft); }
.callout--tip .callout__label { color: var(--blue); }
.callout--formula { background: var(--navy); color: #fff; }
.callout--formula .callout__label { color: var(--lavender); }
.formula { font-family: var(--font-display); font-size: clamp(28px, 3vw, 38px); font-weight: 700; line-height: 1.15; color: var(--accent); }
.callout--stat { background: var(--coral-soft); }
.callout--stat .callout__label { color: var(--coral-ink); }
.stat-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; font-weight: 500; }
.stat-line b { font-size: 40px; line-height: 1.1; color: var(--coral-ink); }
.callout__small { font-size: 16px; color: var(--muted); }
.callout--brand { background: var(--accent); color: var(--navy); }
.callout--brand .button { margin-top: 18px; }

/* Worked tables */
.table-wrap { overflow-x: auto; border-radius: 20px; box-shadow: inset 0 0 0 1px var(--line-table); }
.worked { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.4; }
.worked caption {
  padding: 18px 20px 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-align: left;
  text-transform: uppercase;
  color: var(--blue);
}
.worked th, .worked td { padding: 14px 20px; text-align: left; white-space: nowrap; }
.worked thead th { font-size: 13px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--line-table); }
.worked tbody tr + tr > * { border-top: 1px solid var(--line-row); }
.worked tbody th { font-weight: 700; color: var(--navy); }
.worked td { font-variant-numeric: tabular-nums; }
.worked .is-best > * { background: var(--accent-soft); }
.best-tag {
  margin-left: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--navy);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* Worked example cards */
.examples { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.example { padding: 22px 24px; border-radius: 20px; }
.example > * + * { margin-top: 6px; }
.example--lavender { background: var(--lavender-soft); }
.example--yellow { background: var(--accent-soft); }
.example--coral { background: var(--coral-soft); }
.example--navy { background: var(--navy); color: #fff; }
.example__label { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--blue); }
.example--navy .example__label { color: var(--lavender); }
.example__pack { font-size: 16px; font-weight: 700; }
.example__sum { font-size: 15px; color: var(--muted); }
.example--navy .example__sum { color: var(--navy-soft); }
.example__result { margin-top: 8px; font-size: 32px; line-height: 1.1; color: var(--navy); white-space: nowrap; }
.example--navy .example__result { color: var(--accent); }

/* One supplier or several */
.compare-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.compare-card { padding: 22px 24px; border-radius: 20px; background: var(--lavender-tint); }
.compare-card + .compare-card { background: var(--accent-soft); }
.compare-card__title { font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1.1; color: var(--navy); }
.compare-card ul { margin-top: 12px; font-size: 16px; line-height: 1.5; }

/* ---------- More guides ---------- */

.related { padding: 0 0 112px; }
.related__title { font-size: 40px; line-height: 1.1; color: var(--navy); }
.related__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 28px; }
.related-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px 20px;
  padding: 24px 26px;
  border-radius: 20px;
  color: var(--navy);
  text-decoration: none;
  transition: transform .15s ease;
}
.related-card:hover { transform: translateY(-2px); }
.related-card--lavender { background: var(--lavender-soft); }
.related-card--yellow { background: var(--accent); }
.related-card--coral { background: var(--coral-soft); }
.related-card__kicker { grid-column: 1 / -1; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--blue); }
.related-card--yellow .related-card__kicker { color: var(--navy); }
.related-card__title { font-size: 20px; font-weight: 700; line-height: 1.3; }
.related-card__arrow {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--navy);
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
}

/* Current page in the top bar */
.nav__links a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }

@media (prefers-reduced-motion: reduce) {
  .guide-card, .related-card { transition: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
  .article { grid-template-columns: minmax(0, 1fr) 280px; column-gap: 48px; }
  .guide-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .article { grid-template-columns: minmax(0, 1fr); padding: 48px 0 72px; }
  .article__aside { position: static; order: -1; margin-bottom: 40px; }
  .aside-cta { display: none; }
  .related { padding-bottom: 88px; }
}

@media (max-width: 760px) {
  .guide-cards, .related__grid, .examples, .compare-cards { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .page-hero { padding: 40px 0 44px; }
  .page-hero__lead { font-size: 18px; }
  .guides-list { padding: 40px 0 64px; }
  .guide-card__visual { min-height: 170px; }
  .prose { font-size: 17px; }
  .prose h2 { margin-top: 44px; font-size: 32px; }
  .callout { padding: 20px 20px; }
  .worked th, .worked td { padding: 12px 14px; }
  .related { padding-bottom: 64px; }
  .related__title { font-size: 34px; }
}
