/* =====================================================================
   Recommended-products component  (lib/recommendations.php + js/affiliate.js)

   Loaded only by pages that actually render recommendations, so nothing
   here is paid for site-wide.

   Deliberately built from the same card language as the rest of the site —
   white card, restrained border, TestRight type — because this has to read
   as part of TestRight Academy, not as an Amazon storefront. No merchant
   colours, no merchant logos, no remote images.
   ===================================================================== */

.tra-recs { margin-top: 22px; }

.tra-recs__head { margin-bottom: 14px; }
.tra-recs__title { margin: 0 0 4px; font-size: .95rem; color: #0d2e4e; }
.tra-recs__desc { margin: 0; font-size: .82rem; color: #64748b; line-height: 1.5; }

/* The disclosure. Normal body size, normal contrast, above the products —
   an affiliate disclosure that needs hunting for is not a disclosure. */
.tra-recs__disclosure {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #94a3b8;
  border-radius: 9px;
  padding: 11px 13px;
  margin: 0 0 16px;
  font-size: .8rem;
  line-height: 1.55;
  color: #475569;
}
.tra-recs__disclosure strong { color: #334155; }

.tra-recs__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(212px, 1fr));
  gap: 12px;
}

.tra-rec {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 15px 15px 13px;
  box-shadow: 0 2px 10px rgba(13, 46, 78, .05);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.tra-rec:hover,
.tra-rec:focus-within {
  border-color: #cbd5e1;
  box-shadow: 0 6px 18px rgba(13, 46, 78, .09);
  transform: translateY(-2px);
}

.tra-rec__name { margin: 0 0 5px; font-size: .86rem; font-weight: 700; color: #0d2e4e; }
.tra-rec__blurb { margin: 0 0 13px; font-size: .78rem; line-height: 1.55; color: #64748b; flex: 1 1 auto; }

.tra-rec__cta {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .78rem;
  font-weight: 600;
  text-decoration: none;
  color: #0d2e4e;
  background: #f1f5f9;
  border: 1px solid #dbe3ec;
  border-radius: 8px;
  padding: 8px 13px;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.tra-rec__cta:hover { background: #e7eef6; border-color: #b8c6d6; color: #08203a; }
.tra-rec__cta:focus-visible { outline: 2px solid #0d2e4e; outline-offset: 2px; }
.tra-rec__cta .tra-rec__arrow { transition: transform .2s ease; }
.tra-rec__cta:hover .tra-rec__arrow { transform: translateX(3px); }

/* Screen-reader-only "(opens in a new tab)" — the arrow alone doesn't say it. */
.tra-recs .sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

@media (max-width: 480px) {
  .tra-recs__grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .tra-rec, .tra-rec__cta, .tra-rec__arrow { transition: none; }
  .tra-rec:hover, .tra-rec:focus-within { transform: none; }
}

/* Never print recommendations. Amazon's Operating Agreement bars affiliate
   links from offline/downloadable material, and a printed badge sheet with
   shopping links on it is exactly that. */
@media print {
  .tra-recs { display: none !important; }
}

/* =====================================================================
   Badge-supply purchasing funnel (lib/badge-supplies.php)
   Commerce cards, decision paths and bundles — TestRight card language,
   deliberately not Amazon's. No merchant colour, no logos, no imagery.
   ===================================================================== */

.tra-recs__foot { margin: 12px 0 0; font-size: .78rem; color: #64748b; min-height: 1em; }

/* ---- the four-step physical workflow ---- */
.tra-steps {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px; list-style: none; margin: 0 0 16px; padding: 0;
}
.tra-step {
  position: relative; background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 10px; padding: 11px 13px;
}
.tra-step__n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; background: #0d2e4e; color: #fff;
  font-size: .68rem; font-weight: 700; margin-bottom: 6px;
}
.tra-step__t { display: block; font-size: .8rem; font-weight: 700; color: #0d2e4e; }
.tra-step__d { display: block; font-size: .73rem; line-height: 1.5; color: #64748b; margin-top: 2px; }

/* ---- product cards ---- */
.tra-rec__top { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 6px; }
.tra-rec__icon { width: 26px; height: 26px; flex: 0 0 26px; color: #0d2e4e; opacity: .8; }
.tra-rec__note {
  margin: 0 0 12px; font-size: .72rem; line-height: 1.45; color: #7c8ba1;
  border-left: 2px solid #e2e8f0; padding-left: 8px;
}
.tra-rec[hidden] { display: none; }
/* Cards promoted by the current badge size read first without shouting. */
.tra-rec.is-top { border-color: #cbd5e1; box-shadow: 0 4px 14px rgba(13,46,78,.09); }

/* ---- "What do I need?" — radio-driven, works with JS off ---- */
.tra-choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tra-choice__in { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tra-choice__lb {
  display: flex; flex-direction: column; gap: 3px; cursor: pointer;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 13px 15px;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.tra-choice__lb:hover { border-color: #cbd5e1; }
.tra-choice__t { font-size: .85rem; font-weight: 700; color: #0d2e4e; }
.tra-choice__s { font-size: .75rem; line-height: 1.5; color: #64748b; }
.tra-choice__in:checked + .tra-choice__lb {
  border-color: #0d2e4e; background: #f8fafc;
  box-shadow: 0 0 0 1px #0d2e4e inset, 0 4px 14px rgba(13,46,78,.10);
}
.tra-choice__in:focus-visible + .tra-choice__lb { outline: 2px solid #0d2e4e; outline-offset: 2px; }

/* Panels live in the same grid row, under all three choices. */
.tra-panel { display: none; grid-column: 1 / -1; margin-top: 4px; }
#tra-path-have:checked   ~ .tra-panel[data-path="have"],
#tra-path-need:checked   ~ .tra-panel[data-path="need"],
#tra-path-office:checked ~ .tra-panel[data-path="office"] { display: block; }

/* ---- bundles ---- */
.tra-bundle-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.tra-bundle { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 15px; }
.tra-bundle__t { margin: 0 0 4px; font-size: .86rem; font-weight: 700; color: #0d2e4e; }
.tra-bundle__d { margin: 0 0 10px; font-size: .77rem; line-height: 1.5; color: #64748b; }
.tra-bundle__l { list-style: none; margin: 0 0 10px; padding: 0; }
.tra-bundle__l li { border-top: 1px solid #eef2f7; }
.tra-bundle__l li:first-child { border-top: 0; }
.tra-bundle__l a {
  display: block; padding: 8px 0; font-size: .8rem; font-weight: 600;
  color: #0d2e4e; text-decoration: none;
}
.tra-bundle__l a::after { content: " →"; color: #64748b; font-weight: 400; }
.tra-bundle__l a:hover { color: #b3271e; }
.tra-bundle__l a:focus-visible { outline: 2px solid #0d2e4e; outline-offset: 2px; }
.tra-bundle__cta { margin: 0; font-size: .72rem; color: #94a3b8; }

@media (max-width: 720px) {
  .tra-choice { grid-template-columns: 1fr; }
  .tra-steps  { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .tra-steps { grid-template-columns: 1fr; }
}

/* Commerce never reaches paper — see the note in css/recommendations.css. */
@media print {
  .tra-next, .tra-paths, .tra-bundles { display: none !important; }
}

/* The post-generator block always shows exactly four cards, so give it four
   columns rather than letting auto-fit orphan the last one onto its own row. */
.tra-next .tra-recs__grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .tra-next .tra-recs__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px)  { .tra-next .tra-recs__grid { grid-template-columns: 1fr; } }
