/* The site of LHTML and lhtml-site: over docs.css of the docs theme (its variables). */

:root {
  --lx-heading: #b4232c;
  --lx-item: #0b7a75;
  --lx-tag: #6f42c1;
  --lx-sel: #b35900;
  --lx-style: #0550ae;
  --lx-attr: #8a6d00;
  --lx-jinja: #6e7781;
}
:root[data-theme="dark"] {
  --lx-heading: #ff8b8b;
  --lx-item: #5fd4c8;
  --lx-tag: #c8a6ff;
  --lx-sel: #ffb366;
  --lx-style: #79c0ff;
  --lx-attr: #e3c766;
  --lx-jinja: #8b949e;
}

/* the link to the other language, in the top bar (site.js) */
.lang-switch { font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-decoration: none !important; width: auto; padding: 0 8px; }

/* ── Examples: source | result ── */
.lx {
  margin: 1.4em 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  overflow: hidden;
}
.lx-title {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.lx-panes { display: grid; grid-template-columns: 1fr 1fr; }
.lx-pane { min-width: 0; }
.lx-source { border-right: 1px solid var(--border); background: var(--code-bg); }
.lx-label {
  padding: 6px 14px 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.lx-source pre {
  margin: 0;
  padding: 8px 14px 14px;
  background: transparent;
  border: 0;
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.lx-source pre code { background: none; padding: 0; }
.lx-result { background: #fff; }
.lx-result .lx-label { color: #6b7380; }
.lx-frame { display: block; width: 100%; height: 160px; border: 0; background: #fff; }
.lx-html { border-top: 1px solid var(--border); }
.lx-html summary {
  cursor: pointer;
  padding: 7px 14px;
  font-size: 13px;
  color: var(--muted);
}
.lx-html pre {
  margin: 0;
  padding: 10px 14px 14px;
  border: 0;
  border-radius: 0;
  font-size: 12.5px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media (max-width: 720px) {
  .lx-panes { grid-template-columns: 1fr; }
  .lx-source { border-right: 0; border-bottom: 1px solid var(--border); }
}

.lx-heading { color: var(--lx-heading); font-weight: 700; }
.lx-item { color: var(--lx-item); font-weight: 700; }
.lx-tag { color: var(--lx-tag); font-weight: 600; }
.lx-sel { color: var(--lx-sel); }
.lx-style { color: var(--lx-style); }
.lx-attr { color: var(--lx-attr); }
.lx-strong, .lx-em { color: var(--lx-tag); font-weight: 700; }
.lx-code { color: var(--c-string); }
.lx-jinja, .lx-markup { color: var(--lx-jinja); }

/* ── Home page (pagetype: home) ── */
.hero { padding: 8px 0 4px; }
.hero-kicker {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--accent-text);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 999px;
}
.page-home article h1 {
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.12;
  letter-spacing: -.02em;
  margin: .45em 0 .35em;
}
.hero-lead { font-size: 18.5px; color: var(--text-soft); max-width: 40em; margin: 0 0 1.2em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 1.6em; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none !important;
  border: 1px solid var(--border-strong);
  color: var(--text);
  background: var(--bg-elev);
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn:hover { filter: brightness(1.05); }

.outputs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 1.2em 0 1.6em; }
.output {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--bg-soft);
}
.output-name { font-weight: 700; margin-bottom: 2px; }
.output p { margin: 0; font-size: 14.5px; color: var(--text-soft); }
.output code { font-size: 12.5px; }

.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 1em 0 1.6em; }
.card {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: inherit !important;
  text-decoration: none !important;
  background: var(--bg-elev);
  transition: border-color .15s, box-shadow .15s;
}
.card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.card-step { font-size: 12px; font-weight: 700; color: var(--accent-text); letter-spacing: .05em; text-transform: uppercase; }
.card-title { font-weight: 700; font-size: 16.5px; margin: 2px 0 3px; }
.card p { margin: 0; font-size: 14.5px; color: var(--text-soft); }
@media (max-width: 720px) {
  .outputs, .cards { grid-template-columns: 1fr; }
}

/* screenshots, two per row */
.shots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 1.2em 0 1.6em; }
.shots .figure { margin: 0; }
.shots.one { grid-template-columns: 1fr; max-width: 680px; }
.shots img { border: 1px solid var(--border); border-radius: 8px; display: block; width: 100%; }
.shots figcaption { font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.output img { display: block; width: 100%; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 10px; }
@media (max-width: 720px) {
  .shots { grid-template-columns: 1fr; }
}

/* where a reference page comes from (plugins/repo_include.py) */
.ref-source {
  font-size: 14px;
  color: var(--muted);
  border-left: 3px solid var(--border-strong);
  padding-left: 10px;
}

/* a page still to write */
.todo {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 12px 16px;
  background: var(--bg-soft);
  color: var(--text-soft);
  font-size: 15px;
}
.todo strong { color: var(--text); }

/* ── Comparisons with other markups: <lhtml-compare> (plugins/lhtml_example.py) ── */
.cmp { display: grid; gap: 14px; margin: 1.2em 0 1.6em; }
.cmp-row {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  overflow: hidden;
}
.cmp-panes { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.cmp-pane { min-width: 0; background: var(--code-bg); border-right: 1px solid var(--border); }
.cmp-pane:last-child { border-right: 0; }
.cmp-pane pre {
  margin: 0;
  padding: 6px 12px 12px;
  background: transparent;
  border: 0;
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.cmp-pane pre code { background: none; padding: 0; }
.cmp-pane:not(.cmp-lhtml) pre { color: var(--text-soft); }
.cmp-lhtml { box-shadow: inset 0 3px 0 var(--accent); }
.cmp-lhtml .lx-label { color: var(--accent-text); }
.cmp-result { border-top: 1px solid var(--border); background: #fff; }
.cmp-result .lx-label { color: #6b7380; }
@media (max-width: 720px) {
  .cmp-panes { grid-auto-flow: row; }
  .cmp-pane { border-right: 0; border-bottom: 1px solid var(--border); }
}

/* the principle of LHTML, on the home page */
.principle {
  margin: 0 0 1.8em;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
}
.principle-title { font-weight: 700; font-size: 16.5px; margin-bottom: 4px; color: var(--accent-text); }
.principle p { margin: 0; font-size: 15.5px; color: var(--text); }

/* a note on what lhtml-site adds, in the pages of the language */
.site-note {
  margin: 1.2em 0;
  padding: 10px 16px 2px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  border-radius: var(--radius);
}
.site-note::before {
  content: 'lhtml-site';
  display: inline-block;
  font: 600 12px var(--font-mono);
  color: var(--muted);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 0 6px;
}
.site-note > :first-child { margin-top: 6px; }

/* the tables of the pages: gray lines between the cells (the .table-wrap of the docs theme is
   never generated for Markdown tables) */
article.doc table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 1.2em 0 1.6em;
  font-size: 14.5px;
}
article.doc th, article.doc td {
  padding: 7px 12px;
  text-align: left;
  vertical-align: top;
  border: 1px solid var(--border-strong);
}
article.doc th { background: var(--bg-soft); font-weight: 650; color: var(--text-soft); }
article.doc tbody tr:nth-child(even) td { background: var(--bg-soft); }

/* a screenshot that opens the real page: the example built by examples.sh, or a site made with LHTML */
a.demo { position: relative; display: block; }
a.demo::after {
  content: attr(data-label) ' ↗';
  position: absolute; top: 8px; right: 8px;
  font: 600 12px/1.6 inherit;
  color: #fff; background: var(--accent);
  border-radius: 5px; padding: 0 7px;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
a.demo:hover img { border-color: var(--accent); }
.demo-links { font-size: 14.5px; }

/* Made with LHTML: a card per site or talk */
.made { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; margin: 1.2em 0 1.8em; }
.made-item { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.made-item a.demo img { display: block; width: 100%; border-bottom: 1px solid var(--border); }
.made-body { padding: 10px 14px 12px; }
.made-kind { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.made-title { font-weight: 700; margin: 2px 0 4px; }
.made-body p { margin: 0 0 6px; font-size: 14.5px; color: var(--text-soft); }
.made-links a { margin-right: 14px; font-size: 14px; }

/* a callout in a page: <div class="callout"><div class="callout-title">...</div> markdown ... </div>;
   .callout.warn for a trap */
.callout {
  margin: 1.2em 0;
  padding: 10px 16px 2px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
}
.callout.warn { border-left-color: #d97706; background: color-mix(in srgb, #d97706 8%, var(--bg)); }
.callout-title { font-weight: 700; margin-top: 4px; }
.callout > :last-child { margin-bottom: 10px; }

/* the top of a recipe or a tutorial: what it needs, how long, what you get */
.needs {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  margin: 0 0 1.4em; padding: 8px 14px;
  font-size: 14.5px; color: var(--text-soft);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.needs strong { color: var(--text); }

/* reference pages (plugins/repo_include.py): "Read from ..." is a small line, not the lead
   paragraph the docs theme makes of the first one under the title (.doc > h1 + p) */
.doc > h1 + p.ref-source { font-size: 13px; color: var(--muted); margin-top: -0.3em; }

/* the tables of options and keys of the reference: a flag or a key in the first column stays on
   one line (the docs theme breaks inline code anywhere) */
.doc td > a[id]:first-child ~ code { white-space: nowrap; overflow-wrap: normal; }

/* the home page: the repositories, under the buttons of the hero */
.hero-actions + .repos { margin-top: -0.6em; }
.repos { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin: 0 0 1.8em; font-size: 14.5px; color: var(--muted); }
.repos a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-soft); text-decoration: none; }
.repos a:hover { color: var(--accent-text); }
