/* ============================================================
   links.css
   Compact interactive components that carry semantic
   in-content links (internal + external).

   Components:
   1. .cg-compare  — CSS-only tabbed pay comparison (radios + :has)
   2. .cg-faq      — native <details>/<summary> quick answers

   No JavaScript required. Link AFTER style.css / pin-modal.css.
   Prefix: cg- (careerguide) to avoid collisions.
   ============================================================ */

/* ---------- shared: section shell (matches .spec-pin-teaser) ---------- */

.cg-linkblock {
  max-width: 1200px;
  margin: 32px auto 0;
  padding: 0 20px;
}

.cg-linkblock-inner {
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 14px;
  padding: 26px 30px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.cg-eyebrow {
  color: #6366F1;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 8px;
}

.cg-linkblock h2 {
  color: #2c3e50;
  font-size: 1.45rem;
  margin: 0 0 6px;
}

.cg-linkblock .cg-lede {
  color: #4a5568;
  margin: 0 0 18px;
  line-height: 1.6;
}

/* ---------- shared: semantic in-content links ---------- */

.cg-link {
  color: #4F46E5;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: #C7D2FE;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
}

.cg-link:hover,
.cg-link:focus-visible {
  color: #6366F1;
  text-decoration-color: #6366F1;
}

/* external links (target="_blank") get a small arrow */
.cg-link[target="_blank"]::after {
  content: "\2197";           /* ↗ */
  font-size: 0.8em;
  margin-left: 0.2em;
  display: inline-block;
}

/* ============================================================
   1. PAY COMPARISON SWITCHER  (.cg-compare)
   CSS-only tabs: hidden radios + :has(). Every panel's text
   and links live in the DOM at all times (crawlable).
   ============================================================ */

.cg-compare-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  background: #EEF2FF;
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 18px;
}

.cg-compare-tabs input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.cg-compare-tabs label {
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #4F46E5;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.cg-compare-tabs label:hover {
  background: #E0E7FF;
}

/* checked state — gradient pill, matches .spec-pin-open-btn */
.cg-compare:has(#cg-cmp-1:checked) label[for="cg-cmp-1"],
.cg-compare:has(#cg-cmp-2:checked) label[for="cg-cmp-2"],
.cg-compare:has(#cg-cmp-3:checked) label[for="cg-cmp-3"] {
  background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.25);
}

/* keyboard focus ring on the pill */
.cg-compare-tabs input[type="radio"]:focus-visible + label {
  outline: 3px solid #A5B4FC;
  outline-offset: 2px;
}

/* panels */
.cg-compare-panel {
  display: none;
  grid-template-columns: 170px 1fr;
  gap: 24px;
  align-items: center;
}

.cg-compare:has(#cg-cmp-1:checked) .cg-compare-panel[data-panel="1"],
.cg-compare:has(#cg-cmp-2:checked) .cg-compare-panel[data-panel="2"],
.cg-compare:has(#cg-cmp-3:checked) .cg-compare-panel[data-panel="3"] {
  display: grid;
}

/* stat block */
.cg-compare-stat {
  text-align: center;
  background: #EEF2FF;
  border-radius: 12px;
  padding: 18px 12px;
}

.cg-compare-delta {
  display: block;
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.1;
  background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.cg-compare-stat small {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 600;
}

.cg-compare-panel p {
  color: #4a5568;
  line-height: 1.7;
  margin: 0;
}

/* fallback: browsers without :has() show all panels stacked, tabs hidden */
@supports not selector(:has(*)) {
  .cg-compare-tabs { display: none; }
  .cg-compare-panel { display: grid; }
  .cg-compare-panel + .cg-compare-panel { margin-top: 18px; }
}

/* ============================================================
   2. QUICK ANSWERS ACCORDION  (.cg-faq)
   Native <details>/<summary> — zero JS, keyboard accessible,
   closed content stays in the DOM (crawlable).
   ============================================================ */

.cg-faq-item {
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  margin-top: 12px;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.cg-faq-item:first-of-type {
  margin-top: 0;
}

.cg-faq-item[open] {
  border-color: #C7D2FE;
}

.cg-faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  font-weight: 700;
  color: #2c3e50;
  cursor: pointer;
  list-style: none;
}

.cg-faq-item summary::-webkit-details-marker {
  display: none;
}

.cg-faq-item summary::after {
  content: "\2039";            /* ‹ rendered rotated = chevron */
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #EEF2FF;
  color: #4F46E5;
  font-size: 1.3rem;
  line-height: 1;
  transform: rotate(-90deg);
  transition: transform 0.2s ease, background 0.15s ease, color 0.15s ease;
}

.cg-faq-item[open] summary::after {
  transform: rotate(90deg);
  background: #6366F1;
  color: #ffffff;
}

.cg-faq-item summary:hover {
  background: #F8FAFF;
}

.cg-faq-item summary:focus-visible {
  outline: 3px solid #A5B4FC;
  outline-offset: -3px;
}

.cg-faq-item p {
  margin: 0;
  padding: 0 18px 16px;
  color: #4a5568;
  line-height: 1.7;
}

/* ---------- mobile ---------- */

@media (max-width: 768px) {
  .cg-linkblock {
    margin-top: 24px;
  }

  .cg-linkblock-inner {
    padding: 22px 18px;
  }

  .cg-compare-panel {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .cg-compare-stat {
    max-width: 220px;
    margin: 0 auto;
  }

  .cg-compare-tabs {
    display: flex;
  }

  .cg-compare-tabs label {
    flex: 1;
    text-align: center;
    padding: 9px 10px;
    font-size: 0.84rem;
  }
}
