/* The homepage is the only consumer of this stylesheet. */
main#top {
  --home-editorial-width: 1200px;
  --home-editorial-gutter: 32px;
  --home-editorial-gap: clamp(24px, 2.35vw, 32px);
  --home-intro-gap: clamp(36px, 3.35vw, 48px);
}

.ts-why {
  --why-ink: #1e2c35;
  --why-muted: #4d5f6b;
  --why-accent: #315b73;
  --why-rule: #c4d0d8;
  color: var(--why-ink);
  background: linear-gradient(180deg, #eef2f5 0, #f5f7f8 118px, #f5f7f8 calc(100% - 55px), #f5f7f800);
  padding-block: clamp(56px, 5.3vw, 76px) clamp(62px, 5.3vw, 76px);
  scroll-margin-top: 76px;
}

.ts-why-inner { width: min(var(--home-editorial-width), calc(100% - 2 * var(--home-editorial-gutter))); margin-inline: auto; }
.ts-why-intro { max-width: 650px; }
.ts-why-intro .ts-why-label { margin: 0 0 14px; color: var(--why-accent); font-size: 13px; line-height: 1.4; font-weight: 610; }
.ts-why-intro h2 { margin: 0; max-width: 620px; font-size: clamp(32px, 3.6vw, 49px); line-height: 1.08; font-weight: 520; letter-spacing: -.047em; }
.ts-why-intro > p:last-child { margin: 16px 0 0; max-width: 57ch; color: var(--why-muted); font-size: 16px; line-height: 1.64; }

.ts-why :is(.ts-why-principles, .ts-why-reading) {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--home-editorial-gap);
  list-style: none;
  padding: 0;
}
.ts-why .ts-why-principles { margin: var(--home-intro-gap) 0 29px; }
.ts-why-principles h3 { margin: 0 0 5px; color: var(--why-ink); font-size: 17px; line-height: 1.3; font-weight: 600; letter-spacing: -.018em; }
.ts-why-principles p { margin: 0; max-width: 41ch; color: var(--why-muted); font-size: 14px; line-height: 1.6; }
.ts-why .ts-why-reading { margin: 0; border-top: 1px solid var(--why-rule); padding-top: 29px; }

.ts-why .ts-why-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: start;
  gap: 16px 8px;
  color: var(--why-ink);
  text-decoration: none;
  border-radius: 10px;
}
.ts-why-card:focus-visible { outline: 2px solid var(--why-accent); outline-offset: 5px; }
.ts-why-media {
  grid-column: 1 / -1;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  background: #e7edf1;
}
.ts-why-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 180ms ease; }
.ts-why-media-workflow { background: radial-gradient(ellipse at 48% 66%, #d5e2eb, #edf3f7 80%); }
.ts-why-media-workflow img { object-fit: contain; padding: 4%; }
.ts-why-media-compare img { object-position: 50% 68%; }
.ts-why-media-platforms img { object-position: center; }
.ts-why-card h3 { margin: 0; color: inherit; font-size: clamp(16px, 1.38vw, 19px); font-weight: 590; line-height: 1.3; letter-spacing: -.02em; transition: color 150ms ease; }
.ts-why-card p { margin: 7px 0 0; color: var(--why-muted); font-size: 14px; line-height: 1.55; }
.ts-why-arrow {
  position: relative;
  width: 16px;
  height: 16px;
  justify-self: end;
  color: var(--why-accent);
  margin-top: 4px;
  transition: transform 150ms ease;
}
.ts-why-arrow::before, .ts-why-arrow::after { position: absolute; content: ''; top: 50%; }
.ts-why-arrow::before { left: 1px; width: 12px; border-top: 1px solid currentColor; transform: translateY(-50%); }
.ts-why-arrow::after { right: 3px; width: 5px; height: 5px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; transform: translateY(-50%) rotate(45deg); }
@media (hover: hover) {
  .ts-why-card:hover h3 { color: var(--why-accent); }
  .ts-why-card:hover .ts-why-arrow { transform: translateX(3px); }
  .ts-why-card:hover .ts-why-media img { transform: scale(1.025); }
}

/* Balance the handoffs between the homepage chapters and align the editorial rails. */
main#top #why-tendersnap + #plans { padding-block-start: clamp(44px, 5.8vw, 52px); }
main#top #plans #plan-comparison { margin-block-start: clamp(50px, 5.55vw, 80px); }
main#top .homepage-resources { padding-block-start: clamp(56px, 4.45vw, 64px); }
main#top .homepage-resources > .container {
  width: min(var(--home-editorial-width), calc(100% - 2 * var(--home-editorial-gutter)));
}
main#top .homepage-resources .wv-tools { gap: var(--home-editorial-gap); margin-block-start: var(--home-intro-gap); }
main#top .homepage-closing::before { height: clamp(64px, 5vw, 76px); }

@media (max-width: 767px) {
  main#top { --home-editorial-gutter: 20px; }
  main#top .homepage-resources { padding-block-start: 48px; }
}
@media (max-width: 650px) {
  main#top { --home-intro-gap: 32px; --home-editorial-gap: 20px; }
  .ts-why { padding-block: 40px 44px; }
  .ts-why-intro .ts-why-label { margin-bottom: 10px; }
  .ts-why-intro > p:last-child { font-size: 15px; margin-top: 12px; }
  .ts-why :is(.ts-why-principles, .ts-why-reading) { grid-template-columns: 1fr; }
  .ts-why .ts-why-principles { margin-block-end: 24px; }
  .ts-why-principles h3 { font-size: 16px; margin-bottom: 3px; }
  .ts-why-principles p { max-width: none; }
  .ts-why .ts-why-reading { padding-top: 22px; }
  .ts-why .ts-why-card { grid-template-columns: clamp(82px, 25vw, 106px) minmax(0, 1fr) 16px; align-items: center; column-gap: 12px; }
  .ts-why-media { grid-column: auto; width: 100%; border-radius: 8px; }
  .ts-why-card h3 { font-size: 15px; }
  .ts-why-card p { font-size: 13px; margin-top: 5px; }
  .ts-why-arrow { margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ts-why-card h3, .ts-why-media img, .ts-why-arrow { transition: none; }
}

.ts-why-browse {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  margin-block-start: 14px;
  color: var(--why-accent);
  font-size: 14px;
  line-height: 1.4;
  font-weight: 600;
  text-decoration: none;
}
.ts-why-browse .ts-why-arrow { flex: 0 0 16px; margin-top: 0; }
.ts-why-browse:focus-visible { outline: 2px solid var(--why-accent); outline-offset: 4px; border-radius: 3px; }
@media (hover: hover) {
  .ts-why-browse:hover { text-decoration: underline; text-underline-offset: 3px; }
  .ts-why-browse:hover .ts-why-arrow { transform: translateX(3px); }
}
