/* =============================================================
   RecordBreach — report rendering styles
   Scoped under .rb-report to avoid conflicts with app.css
   ============================================================= */

/* --- Report shell --- */
.rb-report {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}

/* --- Report header --- */
.rb-report__header {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-8);
}
.rb-report__subject {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: var(--space-2);
}
.rb-report__title {
  font-size: 2rem;
  margin-bottom: var(--space-3);
}
.rb-report__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.rb-report__meta-item strong {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: var(--space-2);
}

/* --- Snapshot notice --- */
.rb-report__snapshot-notice {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
}
.rb-report__snapshot-notice strong { color: var(--gold); }

/* --- Sections --- */
.rb-report__sections { display: flex; flex-direction: column; gap: var(--space-6); }

.rb-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.rb-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border);
}
.rb-section__title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin: 0;
}
.rb-section__body { padding: var(--space-6); }

/* --- Narrative block --- */
.rb-narrative { line-height: 1.75; color: var(--text-primary); }
.rb-narrative p { margin-bottom: var(--space-4); max-width: 75ch; }
.rb-narrative p:last-child { margin-bottom: 0; }

/* --- Finding block --- */
.rb-finding {
  border-left: 4px solid var(--border);
  padding-left: var(--space-4);
  margin-bottom: var(--space-4);
}
.rb-finding:last-child { margin-bottom: 0; }
.rb-finding--critical { border-left-color: var(--severity-critical); }
.rb-finding--high     { border-left-color: var(--severity-high); }
.rb-finding--medium   { border-left-color: var(--severity-medium); }
.rb-finding--low      { border-left-color: var(--severity-low); }
.rb-finding--info     { border-left-color: var(--severity-info); }

.rb-finding__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}
.rb-finding__title {
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-body);
  margin: 0;
  flex: 1;
}
.rb-finding__body { color: var(--text-secondary); font-size: 0.9375rem; line-height: 1.7; }

/* --- Entity profile block --- */
.rb-entity {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4) var(--space-8);
}
@media (max-width: 600px) { .rb-entity { grid-template-columns: 1fr; } }
.rb-entity__field {}
.rb-entity__field-label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}
.rb-entity__field-value { font-size: 0.9375rem; color: var(--text-primary); }

/* --- Timeline block --- */
.rb-timeline {
  list-style: none;
  position: relative;
  padding-left: var(--space-8);
}
.rb-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}
.rb-timeline__item {
  position: relative;
  margin-bottom: var(--space-6);
}
.rb-timeline__item:last-child { margin-bottom: 0; }
.rb-timeline__dot {
  position: absolute;
  left: calc(var(--space-8) * -1 + 2px);
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--panel);
}
.rb-timeline__item--critical .rb-timeline__dot { background: var(--severity-critical); }
.rb-timeline__item--high     .rb-timeline__dot { background: var(--severity-high); }
.rb-timeline__item--medium   .rb-timeline__dot { background: var(--severity-medium); }
.rb-timeline__item--low      .rb-timeline__dot { background: var(--severity-low); }
.rb-timeline__date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}
.rb-timeline__event { font-weight: 600; margin-bottom: var(--space-1); font-size: 0.9375rem; }
.rb-timeline__detail { color: var(--text-secondary); font-size: 0.875rem; line-height: 1.6; }

/* --- Ingredient block --- */
.rb-ingredient__grade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: var(--space-4);
}
.rb-ingredient__grade--A { background: rgba(68,187,68,0.15); color: var(--severity-low); }
.rb-ingredient__grade--B { background: rgba(68,153,255,0.15); color: var(--severity-info); }
.rb-ingredient__grade--C { background: rgba(255,215,0,0.15);  color: var(--severity-medium); }
.rb-ingredient__grade--D { background: rgba(255,68,68,0.15);  color: var(--severity-critical); }

.rb-ingredient__dosage-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--space-4);
  font-size: 0.9375rem;
}
.rb-ingredient__dosage-table th,
.rb-ingredient__dosage-table td {
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--border);
  text-align: left;
}
.rb-ingredient__dosage-table th {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  background: var(--panel-raised);
}

/* --- Locked section overlay --- */
.rb-locked {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  min-height: 160px;
}
.rb-locked__blur {
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
  opacity: 0.4;
}
.rb-locked__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  background: rgba(15,15,15,0.85);
  backdrop-filter: blur(2px);
  padding: var(--space-8);
  text-align: center;
}
.rb-locked__icon {
  font-size: 1.5rem;
  line-height: 1;
  /* Uses text, not background color, for screen reader support */
}
.rb-locked__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.rb-locked__desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  max-width: 30ch;
  margin: 0;
}
.rb-locked__tier {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  padding: 2px var(--space-3);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: var(--radius-sm);
}

/* --- Responsive report --- */
@media (max-width: 768px) {
  .rb-report { padding: var(--space-6) var(--space-4); }
  .rb-report__title { font-size: 1.5rem; }
  .rb-section__body { padding: var(--space-4); }
}
