/* The comparison pages and their list, /compare (internal/web/compare.go).
   Linked only from templates/compare.html, after style.css and diagrams.css,
   which it builds on: .compare-table, .compare-wrap and .compare-list are
   style.css's. Colours are the site's tokens only, so it follows a theme. */

/* The answer comes first and is read as prose: a heading and a paragraph set
   from the left, as an article's are, not centred like a banner; and no line
   of the page's prose runs the width of a wide screen. */
.compare-page .pricing-hero { text-align: left; }
.compare-page .pricing-hero p { max-width: 46em; margin: 0 0 14px; }
.compare-page .pricing-hero .compare-dated { margin: 0; font-size: 15px; }
.compare-page .site-section > p, .compare-page .site-section > .compare-list { max-width: 820px; }
.compare-page .compare-list a { text-decoration: underline; }

/* style.css's .pricing-hero sets its padding with the shorthand, which takes
   .site-wrap's gutter away from the hero: put it back, or the answer runs to
   the edge of a phone's screen. */
.compare-page .pricing-hero.site-wrap { padding-right: 32px; padding-left: 32px; }
@media (max-width: 760px) {
  .compare-page .pricing-hero.site-wrap { padding-right: 16px; padding-left: 16px; }
}

/* Where the page sits, above its heading. */
.compare-crumbs { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 0 0 18px;
  color: var(--muted); font: 500 13px/1.5 var(--mono); }
.compare-crumbs a { color: var(--accent); }
.compare-crumbs-sep { color: var(--line-strong); }

/* Said to a screen reader, not shown. */
.compare-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* A reason, then where it is said. */
.compare-reasons li + li { margin-top: 10px; }
.compare-reasons .compare-source { margin-top: 2px; }

/* The other comparisons, from one of them. */
.compare-others { display: grid; gap: 10px; margin: 0 0 18px; padding: 0; list-style: none; }
.compare-others li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.compare-others a { font: 600 17px/1.35 var(--display); }
.compare-others .compare-dated { font-size: 13px; }

/* The list's table: the comparison, which fits, and when its facts were read. */
.compare-page .compare-fits tbody th { width: 18%; }
.compare-fits tbody th a { font-weight: 600; }
.compare-fits td:last-child, .compare-fits th:last-child { width: 14%; white-space: nowrap; }

/* Each comparison, as a card. */
.compare-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 18px; }
.compare-card { padding: 22px 22px 18px; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--panel); }
.compare-card h3 { margin: 0 0 10px; font: 700 21px/1.2 var(--display); }
.compare-card p { margin: 0 0 10px; color: var(--muted); line-height: 1.55; }
.compare-card p:last-child { margin-bottom: 0; }

/* The roundup of Heroku's alternatives: the table at a glance, then each option
   as a card of four facts, each fact a term and what is said of it. A card is
   where a link from the table lands, below the sticky header. */
.compare-page .roundup-glance tbody th { width: 24%; }
.roundup-glance td:nth-child(2) { width: 18%; }
.roundup-options { display: grid; gap: 18px; }
.roundup-option { padding: 22px 22px 18px; border: 1px solid var(--line-strong); border-radius: 18px;
  background: var(--panel); scroll-margin-top: 130px; }
.roundup-option h3 { margin: 0 0 8px; font: 700 21px/1.2 var(--display); }
.roundup-links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 14px; font-size: 15px; }
.roundup-links a { text-decoration: underline; }
.roundup-facts { display: grid; gap: 12px; margin: 0; }
.roundup-facts > div { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 4px 18px; }
.roundup-facts dt { color: var(--muted); font: 600 12px/1.9 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.roundup-facts dd { margin: 0; line-height: 1.6; overflow-wrap: anywhere; }
.roundup-us { border-color: var(--accent); }
@media (max-width: 640px) {
  .roundup-option { padding: 18px 16px 14px; }
  .roundup-facts > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* On a phone, a table of sentences reads as a stack: each row a card, its
   topic first, then each side under its name. The roles in the markup keep it
   a table to a screen reader once it is laid out as blocks. */
@media (max-width: 640px) {
  .compare-page .compare-wrap { overflow-x: visible; border: 0; border-radius: 0; background: none; }
  .compare-page .compare-stack { display: block; min-width: 0; }
  .compare-page .compare-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .compare-page .compare-stack tbody, .compare-page .compare-stack tr { display: block; }
  .compare-page .compare-stack tr { margin: 0 0 12px; overflow: hidden; border: 1px solid var(--line-strong);
    border-radius: 14px; background: var(--panel); }
  .compare-page .compare-stack tbody th, .compare-page .compare-stack td { display: block; width: auto;
    white-space: normal; border-bottom: 0; }
  .compare-page .compare-stack tbody th { padding: 13px 16px 4px; font: 700 17px/1.3 var(--display); }
  .compare-page .compare-stack td { padding: 10px 16px 13px; }
  .compare-page .compare-stack td + td { border-top: 1px solid var(--line); }
  .compare-page .compare-stack td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px;
    color: var(--muted); font: 600 12px/1.4 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
}
