/* PensacolaSEO Audit Theme — Light/Dark Mode */
:root {
  --bg: #0d1117;
  --surface: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --accent: #2a7f8e;
  --accent-light: #3a9fae;
  --heading: #ffffff;
  --strong: #ffffff;
  --row-alt: rgba(22, 27, 34, 0.5);
  --scrollbar-track: #0d1117;
  --scrollbar-thumb: #30363d;
  --toggle-bg: #30363d;
  --toggle-fg: #e6edf3;
}

[data-theme="light"] {
  --bg: #ffffff;
  --surface: #f6f8fa;
  --border: #d0d7de;
  --text: #1f2328;
  --text-muted: #656d76;
  --accent: #1a6673;
  --accent-light: #0969da;
  --heading: #1f2328;
  --strong: #1f2328;
  --row-alt: rgba(246, 248, 250, 0.8);
  --scrollbar-track: #ffffff;
  --scrollbar-thumb: #d0d7de;
  --toggle-bg: #d0d7de;
  --toggle-fg: #1f2328;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  max-width: 920px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  font-size: 16px;
  transition: background 0.3s ease, color 0.3s ease;
}

/* Theme toggle button */
.theme-toggle {
  position: fixed;
  top: 1.2rem;
  right: 1.5rem;
  z-index: 999;
  background: var(--toggle-bg);
  color: var(--toggle-fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.theme-toggle:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.theme-toggle .icon { font-size: 1.1rem; }

/* Headings */
h1 {
  font-size: 2.2rem;
  border-bottom: 3px solid var(--accent);
  padding-bottom: 0.5rem;
  margin-top: 2rem;
  color: var(--heading);
}
h2 {
  font-size: 1.6rem;
  color: var(--accent-light);
  margin-top: 3rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}
h3 {
  font-size: 1.3rem;
  color: var(--heading);
  margin-top: 2rem;
}
h4 { color: var(--heading); margin-top: 1.5rem; }

/* Content */
hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
p { margin: 0.8rem 0; }
strong { color: var(--strong); }
em { color: var(--text-muted); }
a { color: var(--accent-light); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { padding-left: 1.5rem; }
li { margin: 0.4rem 0; }
code {
  white-space: pre-wrap;
  background: var(--surface);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.92rem;
}
th {
  background: var(--surface);
  color: var(--accent-light);
  text-align: left;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  font-weight: 600;
}
td {
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  vertical-align: top;
}
tr:nth-child(even) td { background: var(--row-alt); }

/* Bold findings */
p > strong:first-child {
  display: inline;
  font-size: 1.05rem;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Print */
@media print {
  .theme-toggle { display: none; }
  body { background: #fff; color: #000; max-width: none; }
  h1, h2, h3, h4, strong { color: #000; }
  th { background: #eee; color: #000; }
  td, th { border-color: #ccc; }
}

/* Responsive */
@media (max-width: 600px) {
  body { padding: 1rem; font-size: 15px; }
  h1 { font-size: 1.6rem; }
  table { font-size: 0.82rem; }
  td, th { padding: 0.4rem 0.5rem; }
  .theme-toggle { top: 0.8rem; right: 0.8rem; padding: 0.4rem 0.7rem; font-size: 0.8rem; }
}

/* Pandoc leftovers */
span.smallcaps { font-variant: small-caps; }
div.columns { display: flex; gap: min(4vw, 1.5em); }
div.column { flex: auto; overflow-x: auto; }
div.hanging-indent { margin-left: 1.5em; text-indent: -1.5em; }
ul.task-list[class] { list-style: none; }
ul.task-list li input[type="checkbox"] { font-size: inherit; width: 0.8em; margin: 0 0.8em 0.2em -1.6em; vertical-align: middle; }
.display.math { display: block; text-align: center; margin: 0.5rem auto; }
