/* NMRA Achievement Program and OPSIG-AP checklists (ap/index.html, ap/opsig.html, ap/log.html) */

.ap-wrap { max-width: 60rem; }

.ap-key {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin: 0.4rem 0 1.4rem;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.ap-mark {
  display: inline-block;
  min-width: 4.6rem;
  padding: 0.1rem 0.4rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
  border: 1px solid var(--rule);
  background: var(--paper-2);
  color: var(--ink-soft);
}
.ap-mark.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.ap-mark.part { background: var(--card); border-color: var(--accent); color: var(--accent-text); }
.ap-mark.todo { background: var(--card); border-color: var(--rule); color: var(--muted); }
.ap-mark.ask { background: var(--card); border-color: var(--brand-2); color: var(--brand-2); }
.ap-mark.ready { background: var(--card); border: 2px solid var(--ok); color: var(--ok); }

.ap-priority {
  margin: 0 0 1.6rem;
  padding: 0;
  list-style: none;
  counter-reset: prio;
}
.ap-priority li {
  counter-increment: prio;
  position: relative;
  padding: 0.6rem 0.8rem 0.6rem 2.8rem;
  margin-bottom: 0.4rem;
  background: var(--card);
  border-left: 4px solid var(--brand);
}
.ap-priority li::before {
  content: counter(prio);
  position: absolute;
  left: 0.8rem;
  top: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--brand);
}
.ap-priority a { font-weight: 600; }

.ap-path {
  width: 100%;
  border-collapse: collapse;
  margin: 0.4rem 0 1.6rem;
  font-size: 0.95rem;
}
.ap-path th,
.ap-path td {
  text-align: left;
  vertical-align: top;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--rule);
}
.ap-path th { font-family: var(--font-display); letter-spacing: 0.03em; color: var(--brand); }

.ap-cert {
  margin: 0 0 1rem;
  background: var(--card);
  border: 1px solid var(--rule);
  scroll-margin-top: calc(var(--header-h) + 1rem);
}
.ap-cert > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.8rem;
  padding: 0.7rem 0.9rem;
  cursor: pointer;
  list-style: none;
}
.ap-cert > summary::-webkit-details-marker { display: none; }
.ap-cert > summary::before {
  content: "▸";
  color: var(--brand-2);
  transition: transform 0.15s;
}
.ap-cert[open] > summary::before { transform: rotate(90deg); }
.ap-cert h3 {
  margin: 0;
  flex: 1 1 14rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  color: var(--brand);
}
.ap-group { font-size: 0.85rem; color: var(--muted); }
.ap-score {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
}
.ap-body { padding: 0 0.9rem 0.9rem; }
.ap-body > p { margin: 0 0 0.6rem; }
.ap-next {
  margin: 0.6rem 0 0;
  padding: 0.5rem 0.7rem;
  border-left: 4px solid var(--accent);
  background: var(--paper);
}

.ap-list { margin: 0; padding: 0; list-style: none; }
.ap-list li {
  display: grid;
  grid-template-columns: 5.4rem 1fr;
  gap: 0.6rem;
  padding: 0.4rem 0;
  border-top: 1px solid var(--rule);
}
.ap-list li:first-child { border-top: 0; }
.ap-list .ap-mark { align-self: start; margin-top: 0.1rem; }
.ap-list small { display: block; color: var(--muted); font-size: 0.86rem; }
.ap-list .ap-rule { font-size: 0.8rem; margin-left: 0.3rem; white-space: nowrap; color: var(--muted); }
.ap-list .ap-rule::after { content: " \2197"; }

.ap-tools { margin: 0 0 1rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Progress dashboards (ap/index.html, ap/opsig.html); scores and marks filled from each .ap-cert by achievements.js */
.ap-dash { margin: 0 0 1.8rem; }
.ap-dash-sum { margin: 0 0 0.8rem; color: var(--ink-soft); }
.ap-dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr));
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ap-dash-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  height: 100%;
  padding: 0.7rem 0.8rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-top: 4px solid var(--brand);
  color: inherit;
  text-decoration: none;
}
.ap-dash-card:hover,
.ap-dash-card:focus-visible {
  border-left-color: var(--brand-2);
  border-right-color: var(--brand-2);
  border-bottom-color: var(--brand-2);
}
.ap-dash-group { font-size: 0.8rem; color: var(--muted); }
.ap-dash-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  color: var(--brand);
}
.ap-dash-bar {
  display: block;
  height: 0.5rem;
  margin-top: auto;
  background: var(--paper-2);
  border: 1px solid var(--rule);
}
.ap-dash-bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
}
.ap-dash-card.is-option { border-top-color: var(--rule); }
.ap-dash-card.is-done .ap-dash-bar > span { background: var(--ok); }
.ap-dash-card.is-ready .ap-dash-bar > span { background: var(--ok); opacity: 0.6; }
.ap-dash-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.ap-dash-score { font-size: 0.85rem; color: var(--ink-soft); text-align: right; }

@media (max-width: 560px) {
  .ap-list li { grid-template-columns: 1fr; gap: 0.2rem; }
  .ap-list .ap-mark { justify-self: start; }
  .ap-path { font-size: 0.88rem; }
}

@media print {
  .ap-cert { break-inside: avoid; }
  .ap-tools { display: none; }
}
