/* Black And White Boy — Report Styling
   Colour palette: Navy #07133d, Gold #fec404, White #ffffff
   Matches blackandwhiteboy.com brand aesthetic */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --black: #07133d;
  --white: #ffffff;
  --gold: #fec404;
  --gold-light: #fff8e0;
  --gold-dark: #d4a800;
  --gray-dark: #0a1a4d;
  --gray-mid: #6b7280;
  --gray-light: #f5f5f5;
  --gray-border: #e5e5e5;
  --text: #1f2937;
  --text-light: #6b7280;

  /* Severity / status colours */
  --red: #ef4444;
  --red-bg: #fef2f2;
  --amber: #f59e0b;
  --amber-bg: #fffbeb;
  --green: #22c55e;
  --green-bg: #f0fdf4;
  --blue-highlight: #eff6ff;

  --radius: 12px;
  --radius-sm: 6px;
  --radius-full: 9999px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  line-height: 1.7;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem 3rem;
  background: var(--white);
}

/* === COVER / HEADER === */

.report-header {
  text-align: center;
  padding: 4rem 2rem 3rem;
  margin: 0 -2rem 3rem;
  background: linear-gradient(135deg, var(--black) 0%, var(--gray-dark) 100%);
  color: var(--white);
  border-radius: 0 0 var(--radius) var(--radius);
  position: relative;
  overflow: hidden;
}

.report-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(254, 196, 4, 0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.report-header::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(254, 196, 4, 0.05) 0%, transparent 70%);
  border-radius: 50%;
}

.report-header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  line-height: 1.3;
  color: var(--white) !important;
  position: relative;
  z-index: 1;
}

.report-header .meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem 2rem;
  max-width: 460px;
  margin: 0 auto;
  text-align: left;
  font-size: 0.9rem;
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

.report-header .meta strong {
  color: var(--gold);
  font-weight: 500;
}

/* === HEADINGS === */

h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--black);
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.65rem;
  font-weight: 700;
  margin: 3.5rem 0 1.2rem;
  padding-bottom: 0.6rem;
  border-bottom: 3px solid var(--gold);
  page-break-after: avoid;
}

h2 .section-num {
  display: inline-block;
  background: var(--black);
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 600;
  width: 2rem;
  height: 2rem;
  line-height: 2rem;
  text-align: center;
  border-radius: 50%;
  margin-right: 0.6rem;
  vertical-align: middle;
  position: relative;
  top: -2px;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 2.2rem 0 0.8rem;
  color: var(--black);
  page-break-after: avoid;
}

h4 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.8rem 0 0.6rem;
  color: var(--black);
}

/* === PARAGRAPHS & LISTS === */

p {
  margin: 0 0 1rem;
}

ul, ol {
  margin: 0 0 1.2rem;
  padding-left: 1.6rem;
}

li {
  margin-bottom: 0.4rem;
}

li strong:first-child {
  color: var(--black);
}

/* Checkbox lists */
li input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid var(--gray-border);
  border-radius: 3px;
  margin-right: 0.5rem;
  vertical-align: middle;
  position: relative;
  top: -1px;
  cursor: pointer;
}

li input[type="checkbox"]:checked {
  background: var(--gold);
  border-color: var(--gold);
}

li input[type="checkbox"]:checked::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border: solid var(--black);
  border-width: 0 2px 2px 0;
  position: absolute;
  top: 1px;
  left: 4px;
  transform: rotate(45deg);
}

/* === TABLES === */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0 1.8rem;
  font-size: 0.88rem;
  line-height: 1.5;
  page-break-inside: avoid;
  display: table;
}

thead th {
  background: var(--black);
  color: var(--gold);
  font-weight: 600;
  padding: 0.7rem 0.8rem;
  text-align: left;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

thead th:first-child {
  border-radius: var(--radius-sm) 0 0 0;
}

thead th:last-child {
  border-radius: 0 var(--radius-sm) 0 0;
}

tbody td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--gray-border);
  vertical-align: top;
}

tbody tr:nth-child(even) {
  background: var(--gray-light);
}

tbody tr:hover {
  background: var(--gold-light);
}

/* Highlight Sparrow rows */
tbody tr td:first-child strong {
  color: var(--gold-dark);
}

/* Right-align numeric columns */
td:nth-child(n+3) {
  text-align: right;
}

th:nth-child(n+3) {
  text-align: right;
}

/* Reset alignment for text-heavy tables */
table.text-table td,
table.text-table th {
  text-align: left;
}

/* === LINKS === */

a {
  color: var(--black);
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
  transition: all 0.2s ease;
}

a:hover {
  color: var(--gold-dark);
  border-bottom-color: var(--gold-dark);
}

/* === CALLOUT BOXES === */

.callout {
  border-left: 4px solid var(--gold);
  background: var(--gold-light);
  padding: 1rem 1.2rem;
  margin: 1.2rem 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.92rem;
}

.callout-critical {
  border-left-color: var(--red);
  background: var(--red-bg);
}

.callout-success {
  border-left-color: var(--green);
  background: var(--green-bg);
}

.callout-warning {
  border-left-color: var(--amber);
  background: var(--amber-bg);
}

/* === CODE / URLS === */

code {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 0.85em;
  background: var(--gray-light);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--black);
  border: 1px solid var(--gray-border);
}

pre {
  background: var(--black);
  color: #e2e8f0;
  padding: 1.2rem 1.4rem;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  font-size: 0.82rem;
  line-height: 1.6;
}

pre code {
  background: none;
  border: none;
  color: inherit;
  padding: 0;
}

/* === SEVERITY BADGES === */

.severity-critical {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15em 0.5em;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.severity-high {
  display: inline-block;
  background: #dd6b20;
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15em 0.5em;
  border-radius: 3px;
  text-transform: uppercase;
}

.severity-medium {
  display: inline-block;
  background: var(--amber);
  color: var(--white);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15em 0.5em;
  border-radius: 3px;
  text-transform: uppercase;
}

/* === HORIZONTAL RULES === */

hr {
  border: none;
  height: 1px;
  background: var(--gray-border);
  margin: 2.5rem 0;
}

/* === EMPHASIS === */

em {
  font-style: italic;
  color: var(--text-light);
}

strong {
  font-weight: 600;
}

/* === BLOCKQUOTES === */

blockquote {
  border-left: 4px solid var(--gold);
  padding: 0.8rem 1.2rem;
  margin: 1rem 0;
  background: var(--gold-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text);
}

/* === TABLE OF CONTENTS === */

.toc {
  background: var(--gray-light);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  margin: 0 0 3rem;
}

.toc h2 {
  font-size: 1.1rem;
  margin: 0 0 1rem;
  padding: 0;
  border: none;
  color: var(--black);
}

.toc ul, .toc ol {
  list-style: none;
  padding: 0;
}

.toc > nav > ul > li {
  margin-bottom: 0.5rem;
  padding-left: 0;
}

.toc a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.toc a:hover {
  border-bottom-color: var(--gold);
  color: var(--black);
}

/* === COMPETITOR PROFILES === */

.competitor-header {
  background: var(--gray-light);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  margin: 0.5rem 0 1rem;
  font-size: 0.88rem;
  line-height: 1.7;
}

/* === FOOTER === */

.report-footer {
  text-align: center;
  padding: 2rem 0 0;
  margin-top: 3rem;
  border-top: 2px solid var(--gray-border);
  color: var(--text-light);
  font-size: 0.85rem;
}

.report-footer p + p {
  margin-top: 0.3rem;
}

/* === RESPONSIVE === */

@media (max-width: 600px) {
  body {
    padding: 0 1rem 2rem;
    font-size: 0.9em;
  }

  .report-header {
    padding: 3rem 1.5rem 2rem;
    margin: 0 -1rem 2rem;
  }

  .report-header h1 {
    font-size: 1.6rem;
  }

  .report-header .meta {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }

  h2 {
    font-size: 1.35rem;
    margin-top: 2.5rem;
  }

  h3 {
    font-size: 1.1rem;
  }

  table {
    display: block;
    overflow-x: auto;
    font-size: 0.8rem;
  }

  .toc {
    padding: 1rem 1.2rem;
  }

  pre {
    padding: 0.8rem 1rem;
    font-size: 0.75rem;
  }
}

/* === PRINT / PDF === */

@media print {
  body {
    max-width: none;
    padding: 0;
    font-size: 11pt;
  }

  .report-header {
    margin: 0 0 2rem;
    border-radius: 0;
    padding: 3rem 2rem;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  h2 {
    page-break-after: avoid;
    margin-top: 2rem;
  }

  h3, h4 {
    page-break-after: avoid;
  }

  table {
    page-break-inside: avoid;
    font-size: 9pt;
    display: table;
  }

  thead th {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  tbody tr:nth-child(even) {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  pre {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    white-space: pre-wrap;
  }

  .toc {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .callout, .callout-critical, .callout-success, .callout-warning {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .competitor-header {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  a {
    color: var(--text);
    border-bottom: none;
  }
}

@page {
  margin: 2cm 1.5cm;
  size: A4;
}
