/* Ferrosa AsciiDoc Theme
 * Dark theme matching ferrosadb.com design language.
 * For use with: asciidoctor -a stylesheet=ferrosa.css
 */

/* ── Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&display=swap');

/* ── Variables ── */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #111118;
  --bg-card: #16161f;
  --bg-card-hover: #1c1c28;
  --text-primary: #e8e8ed;
  --text-secondary: #9494a3;
  --text-muted: #6b6b7a;
  --accent: #e2725b;
  --accent-warm: #d4a574;
  --accent-green: #6bc9a0;
  --accent-cool: #7c9cf5;
  --border: #1e1e2a;
  --code-bg: #0d0d14;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* ── Body ── */
body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Main container ── */
#content {
  max-width: 960px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
}

#header {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 2rem 0;
}

#footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8125rem;
}

#footer-text {
  color: var(--text-muted);
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.02em;
}

h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-top: 4rem;
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

h4 {
  font-size: 1rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

p, .paragraph p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
  max-width: 720px;
  line-height: 1.7;
}

/* ── Preamble ── */
#preamble .sectionbody p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 640px;
  line-height: 1.7;
}

/* ── Links ── */
a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── Lists ── */
ul, ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

li {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

li p {
  margin-bottom: 0.25rem;
}

/* ── Inline code ── */
code, .literal {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--accent-cool);
}

/* ── Code blocks (listingblock) ── */
.listingblock {
  margin-bottom: 1.5rem;
}

.listingblock .title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.listingblock .content {
  position: relative;
}

.listingblock pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.listingblock pre code {
  background: none;
  border: none;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  color: inherit;
}

/* ── Literal blocks ── */
.literalblock pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* ── Syntax highlighting (Rouge / Pygments) ── */
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs,
.highlight .cp {
  color: #546e7a;
}

.highlight .k, .highlight .kd, .highlight .kn, .highlight .kp,
.highlight .kr, .highlight .kt, .highlight .kw {
  color: #c792ea;
}

.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb,
.highlight .sc, .highlight .sd, .highlight .se, .highlight .sh,
.highlight .si, .highlight .sx, .highlight .sr, .highlight .ss {
  color: #c3e88d;
}

.highlight .m, .highlight .mi, .highlight .mf, .highlight .mh,
.highlight .mo, .highlight .mb, .highlight .mx,
.highlight .nv, .highlight .vc, .highlight .vg, .highlight .vi {
  color: #f78c6c;
}

.highlight .na {
  color: #ffcb6b;
}

.highlight .nt {
  color: #f07178;
}

.highlight .nc, .highlight .nn {
  color: #82aaff;
}

.highlight .o, .highlight .ow {
  color: #89ddff;
}

.highlight .p {
  color: var(--text-secondary);
}

.highlight .nb {
  color: #82aaff;
}

.highlight .nf {
  color: #82aaff;
}

/* ── Tables ── */
table.tableblock {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
}

table.tableblock th,
table.tableblock td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

table.tableblock thead th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}

table.tableblock td {
  color: var(--text-secondary);
}

table.tableblock td:first-child {
  color: var(--text-primary);
  font-weight: 600;
}

table.tableblock td code {
  font-size: 0.8125rem;
}

table.tableblock tbody tr:hover {
  background: rgba(226, 114, 91, 0.04);
}

/* ── Admonition blocks (NOTE, TIP, IMPORTANT, WARNING, CAUTION) ── */
.admonitionblock {
  margin: 1.5rem 0;
}

.admonitionblock table {
  border: none;
  margin: 0;
}

.admonitionblock td {
  border: none;
  padding: 0;
}

.admonitionblock > table {
  background: rgba(226, 114, 91, 0.08);
  border: 1px solid rgba(226, 114, 91, 0.2);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}

.admonitionblock td.icon {
  vertical-align: top;
  padding-right: 0.75rem;
  width: auto;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding-top: 0.125rem;
}

.admonitionblock td.icon .title {
  color: var(--accent);
  font-weight: 700;
}

.admonitionblock td.content {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
}

.admonitionblock td.content .paragraph:last-child p {
  margin-bottom: 0;
}

/* TIP variant */
.admonitionblock.tip > table {
  background: rgba(107, 201, 160, 0.08);
  border-color: rgba(107, 201, 160, 0.2);
}

.admonitionblock.tip td.icon .title {
  color: var(--accent-green);
}

/* IMPORTANT variant */
.admonitionblock.important > table {
  background: rgba(212, 165, 116, 0.08);
  border-color: rgba(212, 165, 116, 0.2);
}

.admonitionblock.important td.icon .title {
  color: var(--accent-warm);
}

/* WARNING variant */
.admonitionblock.warning > table {
  background: rgba(247, 140, 108, 0.08);
  border-color: rgba(247, 140, 108, 0.2);
}

.admonitionblock.warning td.icon .title {
  color: #f78c6c;
}

/* CAUTION variant */
.admonitionblock.caution > table {
  background: rgba(199, 146, 234, 0.08);
  border-color: rgba(199, 146, 234, 0.2);
}

.admonitionblock.caution td.icon .title {
  color: #c792ea;
}

/* ── TOC ── */
#toc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin-bottom: 2rem;
}

#toctitle {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 600;
}

#toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#toc li {
  margin-bottom: 0.375rem;
}

#toc a {
  font-size: 0.9375rem;
  font-weight: 500;
}

#toc ul ul {
  padding-left: 1rem;
  margin-top: 0.375rem;
}

/* ── Sidebar / example blocks (card-like) ── */
.sidebarblock {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.sidebarblock .title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.sidebarblock .content p {
  margin-bottom: 0.5rem;
}

/* ── Example blocks ── */
.exampleblock {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.exampleblock .title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

/* ── Quote blocks ── */
.quoteblock {
  border-left: 3px solid var(--accent);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
}

.quoteblock blockquote p {
  color: var(--text-secondary);
  font-style: italic;
}

.quoteblock .attribution {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

/* ── Section body spacing ── */
.sect1 + .sect1 {
  margin-top: 1rem;
}

.sectionbody {
  margin-top: 1rem;
}

/* ── Bold and emphasis ── */
strong {
  color: var(--text-primary);
  font-weight: 600;
}

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

/* ── Images ── */
.imageblock {
  margin: 1.5rem 0;
}

.imageblock .title {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.imageblock img {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* ── Ordered list (step) styling ── */
.olist .title {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

/* ── Description lists ── */
.dlist dt {
  color: var(--text-primary);
  font-weight: 600;
  margin-top: 1rem;
}

.dlist dd {
  color: var(--text-secondary);
  margin-left: 1.5rem;
  margin-bottom: 0.5rem;
}

/* ── Horizontal rule ── */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  #content {
    padding: 2rem 1rem 3rem;
  }

  #header {
    padding: 1rem 1rem 0;
  }

  .listingblock pre {
    padding: 1rem;
    font-size: 0.8125rem;
  }

  table.tableblock {
    font-size: 0.8125rem;
  }

  table.tableblock th,
  table.tableblock td {
    padding: 0.5rem 0.75rem;
  }
}
