/* badges-guide.html (2026-08-13) — layout only, on top of style.css +
   science.css tokens. Each row pairs the real generated share card with
   its unlock rule, so the card is the visual anchor and the rule is the
   thing being read. */

.bg-namebox {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 22px;
}
.bg-namebox label { font-size: 13px; font-weight: 600; color: var(--navy-dark); }
.bg-namebox input {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--navy-dark);
  width: 180px;
}
.bg-namebox input:focus { outline: 2px solid var(--teal); outline-offset: 1px; }

.bg-list { display: flex; flex-direction: column; gap: 22px; margin-top: 22px; }

.bg-badge {
  display: grid;
  grid-template-columns: minmax(0, 420px) 1fr;
  gap: 26px;
  align-items: start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  scroll-margin-top: 20px;
}
.sci-alt .bg-badge { background: var(--bg-card); }

.bg-card-frame { margin: 0; }
.bg-card-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-light);
}
/* Cards fade in as each finishes generating, so a slow first paint reads
   as loading rather than broken. */
.bg-card-img { opacity: 0; transition: opacity 0.25s ease; }
.bg-card-img.is-ready { opacity: 1; }
.bg-rendering .bg-card-img:not(.is-ready) {
  background: linear-gradient(100deg, var(--bg-light) 30%, rgba(15, 123, 138, 0.09) 50%, var(--bg-light) 70%);
  background-size: 300% 100%;
  animation: bgShimmer 1.3s ease-in-out infinite;
  opacity: 1;
}
@keyframes bgShimmer { 0% { background-position: 150% 0; } 100% { background-position: -150% 0; } }
@media (prefers-reduced-motion: reduce) {
  .bg-rendering .bg-card-img:not(.is-ready) { animation: none; }
  .bg-card-img { transition: none; }
}
.bg-card-frame figcaption {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 7px;
  text-align: center;
}

.bg-badge-body { min-width: 0; }
.bg-badge-name {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: 'Poppins', sans-serif;
  font-size: 21px;
  font-weight: 700;
  color: var(--navy-dark);
  margin: 0 0 12px;
}
.bg-badge-icon { font-size: 24px; line-height: 1; }
.bg-badge-rule {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--navy-dark);
  background: rgba(15, 123, 138, 0.07);
  border-left: 3px solid var(--teal);
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  margin: 0 0 12px;
}
.bg-badge-rule strong { color: var(--teal); }
.bg-badge-plain { font-size: 14.5px; line-height: 1.68; color: var(--text-muted); margin: 0 0 10px; max-width: 62ch; }
.bg-badge-tip {
  font-size: 13.5px;
  line-height: 1.62;
  color: var(--text-muted);
  margin: 0 0 12px;
  padding-left: 14px;
  border-left: 2px solid var(--amber);
  max-width: 62ch;
}
.bg-badge-shown {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-style: italic;
}

@media (max-width: 900px) {
  .bg-badge { grid-template-columns: 1fr; gap: 18px; padding: 18px 16px; }
  .bg-badge-name { font-size: 19px; }
}

/* Printing to PDF is the most likely way a parent keeps this, so give it
   a real print stylesheet rather than letting the site chrome through. */
@media print {
  .bg-print-hide, .sci-nav, .sci-cta { display: none !important; }
  .sci-hero, .sci-section, .sci-alt { background: #fff !important; padding: 0 0 18px !important; }
  .bg-badge, .sci-card { break-inside: avoid; page-break-inside: avoid; border-color: #ccc; }
  .bg-badge { grid-template-columns: 300px 1fr; }
  .sci-section-title { break-after: avoid; page-break-after: avoid; }
  .sci-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
