/* =================================================================
   PAES Practice · Job Card overlay
   Each game has a 📋 button in the header that opens this overlay.
   Print-ready single-page card a teacher can hand to a student.
   ================================================================= */

/* Floating button in game header (added by shared/job-card.js) */
.job-card-btn {
  background: rgba(217,164,65,0.18);
  border: 1px solid rgba(217,164,65,0.4);
  color: var(--paes-gold);
  padding: 7px 14px;
  border-radius: 100px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s var(--easing, ease);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  letter-spacing: 0.4px;
}

.job-card-btn:hover {
  background: rgba(217,164,65,0.3);
  color: #fff;
  transform: translateY(-1px);
}

.job-card-btn .icon { font-size: 14px; }

/* Overlay backdrop */
.jc-overlay {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(217,164,65,0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 70% 80%, rgba(29,139,139,0.1) 0%, transparent 55%),
    linear-gradient(180deg, #081a2d 0%, #04101c 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  overflow-y: auto;
  padding: 40px 20px;
}

.jc-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* The card itself — letter-size for printing */
.jc-card {
  background: #fff;
  color: #1a1a1a;
  width: 816px;
  max-width: 100%;
  border-radius: 16px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.4);
  overflow: hidden;
  font-family: -apple-system, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  position: relative;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.jc-overlay.show .jc-card { transform: scale(1) translateY(0); }

/* Header */
.jc-header {
  background: linear-gradient(135deg, var(--paes-navy, #0F2E4C) 0%, #1a3d65 100%);
  color: #fff;
  padding: 22px 36px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.jc-header:before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--paes-gold, #D9A441);
}

.jc-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.jc-brand .dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--paes-gold, #D9A441);
}

.jc-brand .name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.jc-brand .practice-tag {
  font-weight: 400;
  color: rgba(255,255,255,0.65);
  margin-left: 2px;
}

.jc-job-code {
  background: var(--paes-gold, #D9A441);
  color: var(--paes-navy, #0F2E4C);
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 1px;
}

/* Title section */
.jc-title-row {
  padding: 28px 36px 18px;
  border-bottom: 1px solid #E5E7EB;
}

.jc-unit {
  font-size: 11px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: var(--paes-gold, #D9A441);
  font-weight: 700;
  margin-bottom: 8px;
}

.jc-title {
  font-size: 30px;
  font-weight: 800;
  color: var(--paes-navy, #0F2E4C);
  letter-spacing: -0.6px;
  line-height: 1.15;
  margin-bottom: 14px;
}

.jc-meta {
  display: flex;
  gap: 28px;
  font-size: 12.5px;
  color: #4A5878;
}

.jc-meta .item { display: flex; gap: 6px; align-items: center; }
.jc-meta .label {
  font-weight: 700;
  color: var(--paes-navy, #0F2E4C);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 10px;
}
.jc-meta .val { font-weight: 600; }

/* Body sections */
.jc-body {
  padding: 22px 36px 28px;
}

.jc-section {
  margin-bottom: 22px;
}

.jc-section:last-child { margin-bottom: 0; }

.jc-section-h {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--paes-navy, #0F2E4C);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--paes-gold, #D9A441);
  display: inline-block;
}

/* Materials grid */
.jc-materials {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 24px;
}

.jc-materials li {
  list-style: none;
  font-size: 13px;
  color: #1a1a1a;
  padding: 5px 0 5px 22px;
  position: relative;
  line-height: 1.4;
}

.jc-materials li:before {
  content: '☐';
  position: absolute;
  left: 0;
  top: 4px;
  color: var(--paes-navy, #0F2E4C);
  font-size: 14px;
}

/* Procedure */
.jc-procedure {
  counter-reset: jc-step;
}

.jc-procedure li {
  list-style: none;
  position: relative;
  padding: 8px 0 8px 38px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #1a1a1a;
  border-bottom: 1px dashed #E5E7EB;
  counter-increment: jc-step;
}

.jc-procedure li:last-child { border-bottom: none; }

.jc-procedure li:before {
  content: counter(jc-step);
  position: absolute;
  left: 0;
  top: 8px;
  width: 26px;
  height: 26px;
  background: var(--paes-navy, #0F2E4C);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

/* Scoring rubric */
.jc-scoring {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.jc-scoring th, .jc-scoring td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #E5E7EB;
}

.jc-scoring th {
  background: #FAF7F1;
  color: var(--paes-navy, #0F2E4C);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.jc-scoring tbody tr:last-child td { border-bottom: 2px solid var(--paes-navy, #0F2E4C); }

.jc-scoring .points {
  font-weight: 800;
  color: var(--paes-gold, #C68F2F);
  text-align: center;
  font-variant-numeric: tabular-nums;
  width: 60px;
}

.jc-scoring .desc {
  font-size: 12px;
  color: #4A5878;
  font-style: italic;
}

.jc-scoring tfoot td {
  font-weight: 800;
  background: #FAF7F1;
  font-size: 13px;
  color: var(--paes-navy, #0F2E4C);
}

/* Safety callout */
.jc-safety {
  background: linear-gradient(135deg, rgba(217,164,65,0.12), rgba(217,164,65,0.04));
  border-left: 4px solid var(--paes-gold, #D9A441);
  padding: 14px 18px;
  border-radius: 4px;
}

.jc-safety .h {
  font-weight: 800;
  color: var(--paes-navy, #0F2E4C);
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.jc-safety ul li {
  list-style: none;
  font-size: 13px;
  line-height: 1.5;
  padding: 3px 0 3px 18px;
  position: relative;
}

.jc-safety ul li:before {
  content: '⚠';
  position: absolute;
  left: 0;
  color: #C53030;
}

/* Footer signature row */
.jc-sign {
  display: grid;
  grid-template-columns: 1fr 1fr 140px;
  gap: 24px;
  padding: 18px 36px 24px;
  border-top: 1px solid #E5E7EB;
}

.jc-sign-block .label {
  font-size: 9px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #4A5878;
  font-weight: 700;
  margin-bottom: 4px;
}

.jc-sign-block .line {
  border-bottom: 1.5px solid #1a1a1a;
  height: 24px;
  font-size: 14px;
  font-weight: 600;
}

.jc-sign-block .score-line {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  font-size: 22px;
  font-weight: 800;
  color: var(--paes-navy, #0F2E4C);
  font-variant-numeric: tabular-nums;
  border-bottom: 1.5px solid #1a1a1a;
  height: 30px;
}

.jc-sign-block .score-line .out { font-size: 14px; color: #4A5878; font-weight: 600; }

/* Footer brand row */
.jc-footer {
  background: var(--paes-navy, #0F2E4C);
  color: rgba(255,255,255,0.7);
  padding: 12px 36px;
  font-size: 11px;
  text-align: center;
  letter-spacing: 0.4px;
}

.jc-footer .url { color: var(--paes-gold, #D9A441); font-weight: 700; }

/* Floating action toolbar (close + print) */
.jc-actions {
  position: absolute;
  top: 22px;
  right: 22px;
  display: flex;
  gap: 8px;
  z-index: 5;
}

.jc-action {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.15s ease;
}

.jc-action:hover {
  background: rgba(255,255,255,0.25);
  transform: scale(1.05);
}

.jc-action.print {
  background: var(--paes-gold, #D9A441);
  color: var(--paes-navy, #0F2E4C);
  border-color: var(--paes-gold, #D9A441);
  width: auto;
  padding: 0 18px;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 800;
  gap: 6px;
  letter-spacing: 0.4px;
}

.jc-action.print:hover { background: #E8BD6B; }

/* Print styles */
@media print {
  body * { visibility: hidden; }
  .jc-overlay, .jc-overlay * { visibility: visible; }
  .jc-overlay {
    position: absolute;
    inset: 0;
    background: #fff !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding: 0;
    overflow: visible;
  }
  .jc-card {
    box-shadow: none !important;
    border-radius: 0 !important;
    transform: none !important;
    width: 100% !important;
    max-width: none !important;
  }
  .jc-actions { display: none !important; }
  .jc-header:before { display: none !important; }
  @page { size: letter; margin: 0; }
}

@media (max-width: 700px) {
  .jc-materials { grid-template-columns: 1fr; }
  .jc-meta { flex-direction: column; gap: 10px; }
  .jc-sign { grid-template-columns: 1fr; }
  .jc-title { font-size: 22px; }
}
