/* site_kit/css/base.css
   Shared base styles for k1monfared sites.
   Dark mode is the default (:root). Light mode via [data-theme="light"]. */

:root {
  --bg-dark: #1a1a2e;
  --text-dark: #e0e0e0;
  --bg-light: #fff;
  --text-light: #222;

  --bg: var(--bg-dark);
  --text: var(--text-dark);
  --toggle-bg: var(--bg-light);
  --toggle-text: var(--text-light);
  --text-muted: #999;
  --link: #58a6ff;
  --link-hover: #79c0ff;
  --border: #30363d;
  --code-bg: #161b22;
  --header-bg: #16213e;
  --blockquote-border: #3b4048;
  --blockquote-text: #8b949e;

  --container-max-width: 720px;
  --container-padding: 1.5rem;
  --nav-button-size: 34px;
  --nav-button-radius: 6px;
}

[data-theme="light"] {
  --bg: var(--bg-light);
  --text: var(--text-light);
  --toggle-bg: var(--bg-dark);
  --toggle-text: var(--text-dark);
  --text-muted: #666;
  --link: #0366d6;
  --link-hover: #0550ae;
  --border: #e1e4e8;
  --code-bg: #f6f8fa;
  --header-bg: #fafbfc;
  --blockquote-border: #dfe2e5;
  --blockquote-text: #6a737d;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  padding: 0;
  transition: background 0.2s, color 0.2s;
  overflow-x: hidden;
}

/* Container */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* Header */
header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
}

header a:hover {
  color: var(--link);
}

/* Main content */
main {
  padding: 2rem 0 4rem;
}

/* Typography */
a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

h2 { font-size: 1.4rem; }
h3 { font-size: 1.2rem; }

p {
  margin: 0 0 1em;
}

ul, ol {
  padding-left: 1.5em;
}

li {
  margin-bottom: 0.3em;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

/* Video embeds */
.video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin: 1em 0;
  border-radius: 4px;
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Code */
code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

pre {
  background: var(--code-bg);
  padding: 1em;
  border-radius: 6px;
  overflow-x: auto;
  line-height: 1.5;
  margin: 1em 0;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.85em;
}

/* Blockquote */
blockquote {
  margin: 1em 0;
  padding: 0.5em 1em;
  border-left: 4px solid var(--blockquote-border);
  color: var(--blockquote-text);
  background: var(--code-bg);
  border-radius: 0 4px 4px 0;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* Tables */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1em 0;
  font-size: 0.95em;
  display: block;
  overflow-x: auto;
}

thead {
  background: var(--header-bg);
}

th, td {
  padding: 0.5em 0.75em;
  border: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

th {
  font-weight: 600;
}

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

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

/* RTL support */
[dir="rtl"] {
  text-align: right;
}

[dir="rtl"] blockquote {
  border-left: none;
  border-right: 4px solid var(--blockquote-border);
  border-radius: 4px 0 0 4px;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    font-size: 16px;
  }

  .container {
    padding: 0 1rem;
  }
}
