/* ═══════════════════════════════════════════════════════════════════════════
   DNS Panopticon — Security Posture
   Landing (public/posture/index.html) and results
   (public/posture/posture-results.html): the overall grade, one card per area
   and the findings grouped by card.  Hairlines, no fills or shadows on cards.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Landing ─────────────────────────────────────────────────────────────── */
.posture-form { width: 100%; }

/* The search bar chrome lives in page-template.css (.landing-search). */
.posture-input { font-family: var(--font-data); }
.posture-input::placeholder { color: var(--txt-4); }

.landing-checks.posture-coverage {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 24px;
}

.posture-coverage .landing-check span:last-child {
  font-size: var(--text-caption);
  line-height: 1.5;
  color: var(--txt-3);
}

@media (max-width: 720px) {
  .landing-checks.posture-coverage { grid-template-columns: 1fr; }
}

/* ── Results: views ──────────────────────────────────────────────────────── */
.posture-main {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 28px 24px 56px;
}

.posture-view { display: none; }
.posture-view.active { display: block; }

#view-scanning.active,
#view-error.active {
  display: flex;
  justify-content: center;
  padding: 56px 0;
}

#view-results.active {
  display: grid;
  gap: 32px;
}

/* ── Results: top line and overall grade ─────────────────────────────────── */
.posture-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  font-size: var(--text-compact);
  color: var(--txt-3);
}

.posture-topline a {
  color: var(--primary-ink);
  font-weight: var(--weight-action);
  text-decoration: none;
}

.posture-topline .btn-ghost { margin-left: auto; }

.posture-overall {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 32px;
  align-items: center;
}

.posture-big { display: grid; justify-items: start; }

.posture-big-grade {
  font-size: 4.5rem;
  font-weight: var(--weight-display);
  line-height: 1;
  letter-spacing: -0.04em;
}

.posture-big-score,
.posture-card-grade small {
  font-family: var(--font-data);
  font-weight: var(--weight-medium);
  color: var(--txt-3);
  font-variant-numeric: tabular-nums;
}

.posture-big-score { font-size: var(--text-small); }

.posture-overall-text { display: grid; gap: 6px; min-width: 0; }

.posture-domain {
  margin: 0;
  font-family: var(--font-data);
  font-size: 1.75rem;
  font-weight: var(--weight-heading);
  line-height: var(--leading-heading);
  overflow-wrap: anywhere;
}

.posture-summary { margin: 0; color: var(--txt-2); max-width: 60ch; }

.posture-howto { margin: 0; font-size: var(--text-compact); color: var(--txt-3); }
.posture-howto a { color: var(--primary-ink); text-decoration: underline; text-underline-offset: 2px; }
.posture-howto a:hover { text-decoration-thickness: 2px; }

/* Letter colours: A green, B ink, C amber, D and F red. */
.is-grade-a { color: var(--green); }
.is-grade-b { color: var(--txt); }
.is-grade-c { color: var(--amber); }
.is-grade-d { color: var(--red); }

/* ── Results: cards ──────────────────────────────────────────────────────── */
.posture-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 40px;
  border-top: 1px solid var(--border);
}

.posture-card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
  padding: 20px 0 22px;
  border-bottom: 1px solid var(--border);
}

.posture-card-head { display: flex; align-items: baseline; gap: 12px; }

.posture-card-head h3 {
  margin: 0 auto 0 0;
  font-size: var(--text-card-title);
  font-weight: var(--weight-heading);
}

.posture-card-grade {
  font-size: 1.75rem;
  font-weight: var(--weight-display);
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.posture-card-grade small {
  margin-left: 6px;
  font-size: var(--text-compact);
  letter-spacing: 0;
}

.posture-card-status { margin: 0; font-size: var(--text-small); color: var(--txt-2); }

.posture-checks {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-compact);
  color: var(--txt);
}

.posture-checks li {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}

.posture-checks li::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sev-info);
  transform: translateY(-1px);
}

.posture-checks li.is-pass::before { background: var(--green); }
.posture-checks li.is-warn::before { background: var(--sev-medium); }
.posture-checks li.is-fail::before { background: var(--sev-critical); }

.posture-card-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--text-compact);
  color: var(--txt-3);
}

.posture-card-foot a,
.posture-findings-head a,
.posture-finding a {
  color: var(--primary-ink);
  font-weight: var(--weight-action);
  text-decoration: none;
}

.posture-card-foot a:hover,
.posture-findings-head a:hover,
.posture-finding a:hover { text-decoration: underline; }

/* ── Results: Attack surface card (not graded; posture-surface.js) ───────── */
.posture-surface-level {
  font-size: var(--text-compact);
  font-weight: var(--weight-action);
  white-space: nowrap;
}

.posture-surface-lock a,
.posture-surface-note a {
  color: var(--primary-ink);
  font-weight: var(--weight-action);
  text-decoration: underline;
}

.posture-finding-text small.posture-surface-hosts {
  font-family: var(--font-data);
  overflow-wrap: anywhere;
}

.posture-surface-list {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.posture-surface-list h4 {
  margin: 0 0 8px;
  font-size: var(--text-compact);
  font-weight: var(--weight-heading);
  color: var(--txt-2);
}

.posture-surface-list ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-data);
  font-size: var(--text-compact);
}

.posture-surface-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.posture-surface-name { color: var(--txt); overflow-wrap: anywhere; }
.posture-surface-list li.is-flagged .posture-surface-name { color: var(--amber); font-weight: var(--weight-action); }
.posture-surface-target { color: var(--txt-3); overflow-wrap: anywhere; }

/* ── Results: findings by card ───────────────────────────────────────────── */
.posture-findings { display: grid; gap: 14px; }

.posture-findings-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 20px;
  font-size: var(--text-compact);
}

.posture-findings-head h2 {
  margin: 0 auto 0 0;
  font-size: var(--text-h3);
}

#posture-groups { display: grid; gap: 8px; }

.posture-group {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.posture-group summary {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 12px 16px;
  font-size: var(--text-small);
  font-weight: var(--weight-heading);
  cursor: pointer;
  list-style: none;
}

.posture-group summary::-webkit-details-marker { display: none; }

.posture-group summary::after {
  content: 'Show';
  font-weight: var(--weight-medium);
  color: var(--txt-3);
}

.posture-group[open] summary::after { content: 'Hide'; }

.posture-group summary span:first-child { margin-right: auto; }

.posture-group-count {
  font-family: var(--font-data);
  font-weight: var(--weight-medium);
  color: var(--txt-3);
}

.posture-finding {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: baseline;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: var(--text-small);
}

.posture-sev {
  font-size: var(--text-caption);
  font-weight: var(--weight-action);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--txt-3);
}

.posture-sev.is-pass { color: var(--green); }
.posture-sev.is-warn { color: var(--amber); }
.posture-sev.is-fail { color: var(--red); }

.posture-finding-text { min-width: 0; color: var(--txt); overflow-wrap: anywhere; }

.posture-finding-text small {
  display: block;
  margin-top: 2px;
  font-size: var(--text-compact);
  color: var(--txt-3);
}

.posture-finding-text .posture-finding-names { font-family: var(--font-data); overflow-wrap: anywhere; }

.posture-finding a { font-size: var(--text-compact); white-space: nowrap; }

.posture-empty {
  margin: 0;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-size: var(--text-small);
  color: var(--txt-3);
}

/* A card that couldn't be checked this time (no website answered). */
.posture-card.is-ungraded h3 { color: var(--txt-2); }

/* ── Results: card tags (Not graded, Paid) ──────────────────────────────── */
.posture-soon-tag,
.posture-card-ungraded {
  font-size: var(--text-caption);
  font-weight: var(--weight-action);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--txt-3);
}

/* ── Narrow screens ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .posture-cards { column-gap: 32px; }
}

@media (max-width: 600px) {
  .posture-main { padding: 20px 16px 40px; }
  .posture-cards { grid-template-columns: 1fr; }
  .posture-overall { gap: 6px 18px; }
  .posture-big-grade { font-size: 3.5rem; }
  .posture-domain { font-size: 1.25rem; }
  .posture-checks li.is-minor { display: none; }
  .posture-finding { grid-template-columns: minmax(0, 1fr) auto; }
  .posture-sev { grid-column: 1 / -1; }
  .posture-surface-list li { grid-template-columns: 1fr; gap: 0; }
}
