/* SliceSite published-page theme — styles RAW semantic HTML, no classes required.
   Linked ONLY on the public /{slug} pages (never with app.css / admin chrome).
   Token names mirror app.css where sensible; values tuned for reading, not UI. */
/* Published pages are owner-designed (design tokens drive the colours), so the
   theme does NOT auto-flip with the visitor's OS dark mode — that stays a
   front-end plugin. color-scheme:light keeps form controls light and
   the editor canvas readable (dark text on GrapesJS's white canvas). */
@layer tokens, theme, imported, class, element;
@layer tokens {
:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-subtle: #f6f7f9;
  --text: #12141a;
  --muted: #5b6472;
  --border: #e6e8eb;
  --accent: #2f6bff;
  --accent-hover: #245ae0;
  --code-bg: #f2f4f7;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

}
@layer theme {
*, *::before, *::after { box-sizing: border-box; }

body {
  /* Full-width by default (website builder): sections/containers control their
     own width. A reading column is opt-in via .sl-container, not forced here. */
  margin: 0;
  padding: 0;
  font-family: var(--font);
  font-size: clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Opt-in reading column (replaces the old forced body max-width). */
.sl-container { max-width: 760px; margin-inline: auto; padding-inline: 1.25rem; }

/* Rhythm: let content stack with consistent vertical spacing. */
body > * + * { margin-top: 1.25em; }

/* Headings */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 680;
  letter-spacing: -0.02em;
  margin: 2.2em 0 0;
}
h1 { font-size: clamp(2rem, 1.5rem + 2.2vw, 3rem); letter-spacing: -0.03em; margin-top: 0; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }
h5, h6 { font-size: 1rem; color: var(--muted); }
h1 + p, h2 + p, h3 + p { margin-top: 0.6em; }
:is(h1, h2, h3, h4, h5, h6) + :is(h2, h3, h4, h5, h6) { margin-top: 0.8em; }

p { margin: 1.15em 0; }

/* Links */
a { color: var(--accent); text-decoration: none; text-underline-offset: 0.15em; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* Emphasis */
strong, b { font-weight: 650; }
mark { background: color-mix(in srgb, var(--accent) 22%, transparent); color: inherit; padding: 0 0.15em; border-radius: 3px; }
small { font-size: 0.85em; color: var(--muted); }
abbr[title] { text-decoration: underline dotted; cursor: help; }

/* Media */
img, picture, video, canvas, svg { max-width: 100%; height: auto; display: block; }
img, video { border-radius: var(--radius); margin: 2em auto; }
figure { margin: 2em 0; }
figcaption { color: var(--muted); font-size: 0.85em; text-align: center; margin-top: 0.6em; }

/* Lists */
ul, ol { margin: 1.15em 0; padding-left: 1.4em; }
li { margin: 0.4em 0; }
li::marker { color: var(--muted); }
ul ul, ul ol, ol ul, ol ol { margin: 0.4em 0; }
dl { margin: 1.15em 0; }
dt { font-weight: 650; margin-top: 1em; }
dd { margin: 0.3em 0 0 1.4em; color: var(--muted); }

/* Blockquote */
blockquote {
  margin: 1.8em 0;
  padding: 0.4em 0 0.4em 1.2em;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-style: italic;
}
blockquote p { margin: 0.5em 0; }
blockquote cite { display: block; font-style: normal; font-size: 0.85em; margin-top: 0.6em; }

/* Code */
code, kbd, samp {
  font-family: var(--mono);
  font-size: 0.9em;
}
:not(pre) > code {
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 5px;
  border: 1px solid var(--border);
}
pre {
  margin: 1.8em 0;
  padding: 1rem 1.2rem;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  line-height: 1.55;
}
pre code { background: none; border: 0; padding: 0; font-size: 0.875rem; }
kbd {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0.1em 0.4em;
  font-size: 0.85em;
}

/* Rule */
hr { border: 0; border-top: 1px solid var(--border); margin: 3em 0; }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.8em 0;
  font-size: 0.95em;
  display: block;
  overflow-x: auto;
}
th, td { text-align: left; padding: 0.6em 0.8em; border-bottom: 1px solid var(--border); }
th { font-weight: 650; color: var(--muted); }
tbody tr:hover { background: var(--bg-subtle); }
caption { color: var(--muted); font-size: 0.85em; margin-bottom: 0.6em; text-align: left; }

/* Forms (rare on published pages, but keep them presentable) */
input, textarea, select, button { font: inherit; }

/* Selection */
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
}
