/* Compare page (/compare/). Loaded after site.css. The picker and sectioned comparison are built by
   compare.js; the detailed table below works on its own without JavaScript. */

/* ---------- Hero: shorter, so the picker sits near the top on phones ---------- */
.cmp-hero { padding-bottom: 34px; }
.cmp-hero .lede { max-width: 56ch; }
@media (max-width: 700px) {
  .cmp-hero { padding-top: 26px; padding-bottom: 22px; }
  .cmp-hero .eyebrow { margin-bottom: 12px; }
  .cmp-hero .lede { margin-top: 12px; font-size: 1.02rem; }
}

/* ---------- Picker ---------- */
.cmp { padding: 44px 0 56px; }
.cmp[hidden] { display: none; }
.cmp-pick h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); }
.cmp-pick-help { margin-top: 6px; color: var(--paper-muted); font-size: 1rem; min-height: 1.6em; }
.cmp-opts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.cmp-opt { position: relative; display: flex; flex-direction: column; justify-content: center; min-height: 58px; padding: 8px 12px 8px 40px; border-radius: 12px; border: 1.5px solid var(--paper-line); background: #fff; color: var(--paper-ink); font: inherit; text-align: left; cursor: pointer; }
.cmp-opt b { font-size: .97rem; font-weight: 650; line-height: 1.25; }
.cmp-opt small { font-size: .8rem; color: var(--paper-muted); line-height: 1.3; }
.cmp-opt::before { content: ""; position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 5px; border: 2px solid rgba(13,107,96,.55); background: #fff; }
.cmp-opt:hover { border-color: var(--teal-ink); background: #f3faf8; }
.cmp-opt[aria-pressed="true"] { background: var(--teal-ink); border-color: var(--teal-ink); color: #fff; box-shadow: 0 2px 8px rgba(13,107,96,.25); }
.cmp-opt[aria-pressed="true"] small { color: #d4f1ec; }
.cmp-opt[aria-pressed="true"]::before { border-color: #fff; background: #fff; }
.cmp-opt[aria-pressed="true"]::after { content: ""; position: absolute; left: 18px; top: 50%; width: 6px; height: 11px; margin-top: -8px; border: solid var(--teal-ink); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.cmp-opt.is-full { opacity: .62; }
@media (max-width: 960px) { .cmp-opts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 620px) {
  .cmp { padding: 26px 0 40px; }
  .cmp-opts { grid-template-columns: 1fr 1fr; gap: 6px; }
  .cmp-opt { min-height: 54px; padding: 6px 8px 6px 36px; }
  .cmp-opt::before { left: 10px; }
  .cmp-opt[aria-pressed="true"]::after { left: 16px; }
  .cmp-opt b { font-size: .92rem; }
  .cmp-opt small { font-size: .76rem; }
}

/* ---------- Sectioned comparison ---------- */
.cmp-out { margin-top: 26px; }
.cmp-empty { background: #fff; border: 1px dashed var(--paper-line); border-radius: 12px; padding: 16px 18px; color: var(--paper-muted); margin-bottom: 16px; }
.cmp-jump { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; margin: 0 -2px; }
.cmp-jump::-webkit-scrollbar { display: none; }
.paper .cmp-jump a { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(13,107,96,.35); color: var(--teal-ink); background: #fff; text-decoration: none; font-size: .9rem; font-weight: 600; }
.paper .cmp-jump a:hover { background: rgba(13,107,96,.08); color: var(--teal-ink); }

.cmp { --cols: 220px repeat(var(--n, 2), minmax(0, 1fr)); }
.cmp-sec { padding: 0; margin-top: 30px; scroll-margin-top: calc(var(--cmp-top, 0px) + 12px); }
.cmp-sec h3 { font-size: 1.28rem; font-weight: 700; padding-bottom: 8px; border-bottom: 2px solid var(--paper-ink); }
.cmp-names { position: sticky; top: var(--cmp-top, 0px); z-index: 2; display: grid; grid-template-columns: var(--cols); gap: 10px; padding: 10px 0 8px; background: var(--paper); border-bottom: 1px solid var(--paper-line); }
.cmp-name { font-weight: 700; font-size: 1rem; line-height: 1.25; padding-top: 6px; border-top: 4px solid var(--k, var(--navy)); }
.cmp-name small { display: block; font-weight: 500; font-size: .84rem; color: var(--paper-muted); }
.k0 { --k: var(--navy); } .k1 { --k: var(--teal-ink); } .k2 { --k: #9a5d00; }

.cmp-row { display: grid; grid-template-columns: var(--cols); gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--paper-line); align-items: start; }
.cmp-lab { font-size: .98rem; font-weight: 650; line-height: 1.35; color: var(--paper-ink); }
.cmp-row dl { display: contents; }
.cmp-row dl > div { min-width: 0; }
.cmp-row dt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.cmp-row dd { font-size: 1rem; line-height: 1.5; color: var(--paper-ink); }
.cmp-row.is-same dd { color: var(--paper-muted); }
.cmp-same { display: inline-block; margin-left: 4px; font-size: .74rem; font-weight: 600; letter-spacing: .02em; color: var(--paper-muted); background: var(--paper-2); border-radius: 999px; padding: 1px 8px; vertical-align: 1px; }
.cmp-na { color: var(--paper-muted); font-style: italic; }

/* "(reported)" label, used in both views */
.cmp-rep { display: inline-block; margin-left: 4px; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #8a4b00; border: 1px solid currentColor; border-radius: 5px; padding: 0 5px; line-height: 1.5; vertical-align: 1px; }

/* Points-value caution, kept right beside the earning rows */
.cmp-note, .cmp-points { background: #fff6e0; border-left: 4px solid #9a5d00; border-radius: 0 10px 10px 0; padding: 12px 16px; color: var(--paper-ink); font-size: .95rem; line-height: 1.55; }
.cmp-note { margin: 12px 0; }
.cmp-note p, .cmp-note .cmp-points { background: none; border: 0; padding: 0; margin: 0; }
.cmp-note b, .cmp-points b { display: block; color: #6e4300; }

.cmp-more { margin-top: 24px; display: grid; gap: 12px; }
.cmp-guides { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.cmp-guides a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.cmp-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cmp-actions .btn { font: inherit; font-weight: 600; cursor: pointer; }

@media (max-width: 700px) {
  /* Phones: each section keeps the chosen lines' answers together, every answer labelled with its line. */
  .cmp-names { display: none; }
  .cmp-row { display: block; padding: 14px 0; }
  .cmp-lab { margin-bottom: 8px; }
  .cmp-row dl { display: grid; gap: 6px; }
  .cmp-row dl > div { display: grid; grid-template-columns: 7.2em minmax(0, 1fr); gap: 10px; align-items: baseline; background: #fff; border: 1px solid var(--paper-line); border-left: 4px solid var(--k); border-radius: 0 10px 10px 0; padding: 8px 12px; }
  .cmp-row dt { position: static; width: auto; height: auto; overflow: visible; clip: auto; font-size: .84rem; font-weight: 700; line-height: 1.3; color: var(--paper-ink); }
  .cmp-row dd { font-size: .98rem; }
}

/* ---------- Playing-style questions (navy band) ---------- */
.cmp-style .cmp-try { display: none; }
.cmp-js .cmp-style .cmp-try { display: block; margin-top: 12px; font-size: .92rem; }
.cmp-style .cmp-try a { color: var(--teal); font-weight: 600; display: inline-flex; align-items: center; min-height: 44px; }
.cmp-style .cmp-try a::after { content: "\2192"; margin-left: 6px; }
.cmp-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin-top: 26px; padding: 20px 22px; border-radius: var(--radius); background: rgba(232,182,76,.08); border: 1px solid rgba(232,182,76,.3); }
.cmp-cta p { color: var(--ink); font-size: 1.04rem; max-width: 52ch; }

/* ---------- Detailed view (full matrix) ---------- */
.cmp-matrix .section-head { margin-bottom: 18px; }
.cmp-hint { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--teal-ink); font-weight: 650; font-size: .95rem; }
.cmp-hint[hidden] { display: none; }
.cmp-hint span { display: inline-block; animation: cmpNudge 1.6s var(--ease) 3; }
.cmp-hint.at-end { opacity: .55; }
@keyframes cmpNudge { 50% { transform: translateX(5px); } }
.cmp-matrix .table-wrap { max-height: min(78vh, 900px); overflow: auto; overscroll-behavior-x: contain; }
.cmp-matrix .compare thead th { position: sticky; top: 0; z-index: 2; text-transform: none; letter-spacing: 0; padding-top: 4px; padding-bottom: 4px; vertical-align: middle; background: var(--paper-2); color: var(--paper-ink); font-size: .92rem; font-weight: 700; box-shadow: inset 0 -1px 0 var(--paper-line); }
.cmp-matrix .compare thead th a { display: inline-flex; align-items: center; min-height: 44px; color: var(--paper-ink); text-decoration: none; border-bottom: 1px solid rgba(11,37,69,.3); }
.cmp-matrix .compare thead th:first-child { left: 0; z-index: 3; }
.cmp-matrix .compare tbody th:first-child { z-index: 1; box-shadow: inset -1px 0 0 var(--paper-line); white-space: normal; min-width: 170px; width: 170px; }
.cmp-matrix .compare td { min-width: 165px; color: var(--paper-ink); }
.cmp-matrix .compare .cmp-grp th { position: static; padding: 18px 16px 8px; background: var(--paper-2); box-shadow: none; }
.cmp-matrix .compare .cmp-grp th span { position: sticky; left: 16px; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--teal-ink); font-weight: 700; }
.cmp-matrix .compare .cmp-note-row td { position: static; min-width: 0; background: #fff; padding: 10px 12px; }
.cmp-matrix .compare .cmp-points { position: sticky; left: 12px; max-width: min(72ch, calc(100vw - 72px)); }
.cmp-matrix .compare .is-sel { background: rgba(13,107,96,.07); }
.cmp-matrix .compare thead th.is-sel { background: #dcefeb; box-shadow: inset 0 -3px 0 var(--teal-ink); }
.cmp-matrix .compare thead th.is-sel a { color: var(--teal-ink); }
.cmp-prov { margin-top: 10px; }
@media (max-width: 700px) {
  .cmp-matrix .compare tbody th:first-child { min-width: 118px; width: 118px; font-size: .86rem; padding: 10px 10px; }
  .cmp-matrix .compare td { min-width: 148px; font-size: .94rem; padding: 10px 12px; }
  .cmp-matrix .compare thead th { padding: 10px 12px; }
}
/* Separate borders so they move with the sticky heading row and first column */
.cmp-matrix .compare { border-collapse: separate; border-spacing: 0; }
.cmp-matrix .compare tbody tr:last-child td, .cmp-matrix .compare tbody tr:last-child th { border-bottom: 1px solid var(--paper-line); }
.cmp-matrix .compare tbody:last-child tr:last-child td, .cmp-matrix .compare tbody:last-child tr:last-child th { border-bottom: 0; }
.cmp-matrix .compare thead th { border-bottom: 0; }
