/* =========================================================
   CRENOE: /comparison hub & comparison article styles
   Uses tokens from site.css and primitives from home.css / coach.css.
   Safari 16 compatible: uses @media queries (no @container range syntax or light-dark()).
   ========================================================= */

.cmp-page {
  overflow-x: clip;
  --label-crenoe: "Crenoe";
  --label-other: "ChatGPT, Claude & Gemini";
}

.cmp-table--mcp {
  --label-other: "Strava MCP + Claude / Gemini";
}

.cmp-table--restortrain {
  --label-other: "RestOrTrain";
}

.cmp-table--runna {
  --label-other: "Runna";
}

.cmp-page h1,
.cmp-page h2,
.cmp-page h3 {
  font-family: var(--font-display);
  font-weight: 800;
  margin: 0;
  text-wrap: balance;
  color: inherit;
}

.cmp-page p {
  margin: 0;
}

/* ── Breadcrumb ── */
.cmp-crumb {
  margin-bottom: clamp(14px, 2vw, 22px);
}

.cmp-crumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
}

.cmp-crumb li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cmp-crumb li + li::before {
  content: "/";
  color: var(--muted);
  opacity: .55;
  aria-hidden: true;
}

.cmp-crumb a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 2px;
  color: var(--muted);
  text-decoration: none;
}

.cmp-crumb a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cmp-crumb [aria-current="page"] {
  color: var(--text);
  padding: 8px 2px;
}

/* ── Hero ── */
.cmp-hero {
  padding: calc(76px + clamp(16px, 2.4vw, 32px)) 0 clamp(44px, 5.5vw, 76px);
}

.cmp-hero-inner {
  display: grid;
  gap: 18px;
  max-width: 780px;
}

.cmp-hero h1 {
  font-size: clamp(34px, 4.8vw, 62px);
  line-height: 1.06;
  letter-spacing: -.045em;
  max-width: 17ch;
}

.cmp-hero :is(h1):has(.hl) {
  line-height: 1.14;
}

@media (max-width: 390px) {
  .cmp-hero h1 {
    font-size: clamp(29px, 8.2vw, 35px);
  }
}

.cmp-hero .lead {
  max-width: 56ch;
}

.cmp-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  margin-top: 6px;
}

.cmp-hero-actions .cta-row {
  margin-top: 0;
}

/* ── Bands ── */
.cmp-sec {
  padding: clamp(52px, 6.8vw, 92px) 0;
}

.cmp-sec.sec-alt {
  background: var(--s1);
}

.cmp-sec-head {
  display: grid;
  gap: 12px;
  max-width: 660px;
  margin-bottom: clamp(24px, 3.2vw, 36px);
}

.cmp-sec h2 {
  font-size: clamp(26px, 3.4vw, 42px);
  line-height: 1.08;
  letter-spacing: -.04em;
}

.cmp-sec h3 {
  font-size: clamp(18px, 1.9vw, 22px);
  line-height: 1.24;
  letter-spacing: -.02em;
}

.cmp-prose {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--muted);
  overflow-wrap: break-word;
}

.cmp-prose strong {
  color: var(--text);
  font-weight: 700;
}

.cmp-prose a {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.cmp-prose a:hover {
  text-decoration-thickness: 2px;
}

.cmp-subhead {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 58ch;
}

/* ── Hub: Live comparison cards ── */
.cmp-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 760px) {
  .cmp-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cmp-card--lead {
    grid-column: 1 / -1;
    max-width: 780px;
  }
}

.cmp-card {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: clamp(22px, 3vw, 32px);
  border-radius: var(--radius-lg);
  background: var(--s2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: var(--text);
  transition: background-color .18s ease, border-color .18s ease, transform .18s ease;
}

.cmp-card:hover {
  background: var(--s3);
  border-color: var(--border-md);
  transform: translateY(-2px);
}

.cmp-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.cmp-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 10px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: var(--control);
  color: var(--brand-ink);
}

.cmp-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: .25em;
  text-decoration-thickness: 1px;
  margin-top: 2px;
}

.cmp-card:hover .cmp-card-cta {
  text-decoration-thickness: 2px;
}

/* ── Hub: Upcoming series cards ── */
.cmp-upcoming-grid {
  display: grid;
  gap: 14px;
}

@media (min-width: 760px) {
  .cmp-upcoming-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.cmp-upcoming-card {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--s1);
  border: 1px solid var(--border);
}

.cmp-soon-tag {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 9px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  background: var(--control);
  color: var(--muted);
}

/* ── Hub: Principles ── */
.cmp-principles {
  display: grid;
  gap: 14px;
}

@media (min-width: 820px) {
  .cmp-principles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.cmp-principle-card {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--s2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

/* ── Article: Short answer ── */
.cmp-tldr-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 760px) {
  .cmp-tldr-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.cmp-tldr-card {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: clamp(22px, 2.8vw, 28px);
  border-radius: var(--radius-lg);
  background: var(--s2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.cmp-tldr-card--crenoe {
  border-color: var(--border-md);
}

.cmp-tldr-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.cmp-tldr-list li {
  position: relative;
  padding-left: 18px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}

.cmp-tldr-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .6em;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--muted);
}

.cmp-tldr-card--crenoe .cmp-tldr-list li::before {
  background: var(--brand-ink);
}

/* ── Article: Responsive Comparison Table (Modern Web Guidance pattern + Safari 16) ── */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  background: var(--s2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.table-wrapper:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.cmp-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

.cmp-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--s3);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: -.01em;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-md);
}

.cmp-table thead th:nth-child(2) {
  color: var(--brand-ink);
}

.cmp-table tbody th,
.cmp-table tbody td {
  padding: 16px 20px;
  vertical-align: top;
  font-size: 14.5px;
  line-height: 1.6;
  border-bottom: 1px solid var(--border);
}

.cmp-table tbody tr:last-child th,
.cmp-table tbody tr:last-child td {
  border-bottom: 0;
}

.cmp-table tbody th[scope="row"] {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--text);
  width: 24%;
}

.cmp-table tbody td:nth-of-type(1) {
  color: var(--text);
  width: 38%;
  background: rgba(255, 255, 255, .015);
}

.cmp-table tbody td:nth-of-type(2) {
  color: var(--muted);
  width: 38%;
}

@media (prefers-color-scheme: light) {
  .cmp-table tbody td:nth-of-type(1) {
    background: rgba(15, 20, 32, .018);
  }
}

.cmp-table-note {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.cmp-sources-line {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

@media (max-width: 639px) {
  .table-wrapper {
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
    border-radius: 0;
  }

  .cmp-table,
  .cmp-table tbody,
  .cmp-table tr,
  .cmp-table th,
  .cmp-table td {
    display: block;
    width: 100%;
  }

  .cmp-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .cmp-table tbody tr {
    background: var(--s2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 18px;
    margin-bottom: 12px;
  }

  .cmp-table tbody tr:last-child {
    margin-bottom: 0;
  }

  .cmp-table tbody th[scope="row"] {
    width: 100%;
    font-size: 16.5px;
    line-height: 1.3;
    padding: 0 0 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
  }

  .cmp-table tbody td {
    width: 100%;
    padding: 0;
    border-bottom: 0;
  }

  .cmp-table tbody td:nth-of-type(1) {
    width: 100%;
    background: transparent;
    color: var(--text);
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px dashed var(--border);
  }

  .cmp-table tbody td:nth-of-type(2) {
    width: 100%;
    color: var(--muted);
  }

  .cmp-table tbody td:nth-of-type(1)::before {
    content: var(--label-crenoe);
    display: block;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--brand-ink);
    margin-bottom: 4px;
  }

  .cmp-table tbody td:nth-of-type(2)::before {
    content: var(--label-other);
    display: block;
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
  }
}

/* ── Article: 4 Real Moments ── */
.cmp-moments-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 760px) {
  .cmp-moments-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.cmp-moment-card {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: clamp(20px, 2.6vw, 26px);
  border-radius: var(--radius-lg);
  background: var(--s2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.cmp-moment-num {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--brand-ink);
}

/* ── Article: Using both together ── */
.cmp-both-card {
  display: grid;
  gap: 16px;
  padding: clamp(24px, 3.2vw, 36px);
  border-radius: var(--radius-lg);
  background: var(--s1);
  border: 1px solid var(--border);
  max-width: 820px;
}

.cmp-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  align-items: center;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .cmp-card,
  .cmp-card:hover {
    transform: none;
    transition: none;
  }
}
