/* IsaEs — minimal theme. One accent (turquoise), neutral greys, light + dark. */

:root {
  color-scheme: light;
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #18181b;
  --muted: #6b7280;
  --border: #e4e4e7;
  --accent: #0d9488;
  --accent-soft: rgba(13, 148, 136, 0.1);
  --on-accent: #ffffff;
  --code-bg: #f4f4f5;
  --phoneWidth: (max-width: 683px);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0e10;
  --surface: #14171a;
  --text: #e7e9ea;
  --muted: #8b949e;
  --border: #23282d;
  --accent: #2dd4bf;
  --accent-soft: rgba(45, 212, 191, 0.12);
  --on-accent: #04100e;
  --code-bg: #14171a;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0c0e10;
    --surface: #14171a;
    --text: #e7e9ea;
    --muted: #8b949e;
    --border: #23282d;
    --accent: #2dd4bf;
    --accent-soft: rgba(45, 212, 191, 0.12);
    --on-accent: #04100e;
    --code-bg: #14171a;
  }
}

@font-face {
  font-family: "Fira Code";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/FiraCode-Regular.woff) format("woff");
}
@font-face {
  font-family: "Fira Code";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/FiraCode-Bold.woff) format("woff");
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, .menu-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

img { display: block; max-width: 100%; height: auto; }

hr { border: 0; height: 1px; background: var(--border); margin: 2.5rem 0; }

/* Layout */
.container {
  display: flex;
  flex-direction: column;
  max-width: 720px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.content { display: flex; flex-direction: column; flex: 1; }

/* Header */
.header { position: relative; display: flex; align-items: center; gap: 1.25rem; margin-bottom: 3rem; }
.header__inner { display: contents; }
.header__logo { flex: 1; order: 0; }
.header .menu { order: 1; }
.theme-toggle { order: 2; }
.menu-trigger { order: 3; }
.header__logo a { color: var(--text); text-decoration: none; }
.logo {
  display: inline-block;
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.logo::before { content: ""; display: inline-block; width: 0.55em; height: 0.55em; margin-right: 0.55em; border-radius: 50%; background: var(--accent); }

.menu { margin: 0; }
.menu__inner { display: flex; align-items: center; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.menu__inner li a { color: var(--muted); font-size: 0.95rem; text-decoration: none; }
.menu__inner li a:hover { color: var(--text); }
.menu__inner--mobile { display: none; }
.menu .spacer { display: none; }

.language-selector, .language-selector-current { list-style: none; margin: 0; padding: 0; }
.language-selector { position: relative; }
.language-selector-current { color: var(--muted); font-size: 0.85rem; cursor: pointer; user-select: none; }
.language-selector-current:hover { color: var(--text); }
.language-selector__more {
  position: absolute; right: 0; top: 1.8rem; z-index: 10;
  list-style: none; margin: 0; padding: 0.4rem 0.9rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
}
.language-selector__more li a { font-size: 0.85rem; }
.hidden { display: none !important; }

.menu-trigger {
  display: none; cursor: pointer; user-select: none;
  color: var(--muted); font-size: 0.85rem;
  border: 1px solid var(--border); border-radius: 8px; padding: 0.25rem 0.7rem;
}

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.1rem; height: 2.1rem; padding: 0;
  background: transparent; color: var(--muted);
  border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

@media (max-width: 683px) {
  .container { padding: 1.25rem 1.1rem; }
  .header { gap: 0.5rem; }
  .menu-trigger { display: inline-block; }
  .menu__inner--desktop { display: none; }
  .menu__inner--mobile { display: block; }
  .header .menu {
    position: absolute; top: 3rem; right: 0; z-index: 20;
    min-width: 9rem; padding: 0.6rem 1rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  }
  .menu__inner { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .menu__inner--mobile hr { margin: 0.5rem 0; width: 100%; }
  .menu__inner--mobile li { padding: 0.15rem 0; }
}

/* Posts */
.posts, .post { width: 100%; }
.post { padding: 0 0 2.5rem; margin: 0 0 2.5rem; }
.post.on-list { border-bottom: 1px solid var(--border); }
.post.on-list:last-of-type { border-bottom: 0; }

.post-title {
  margin: 0 0 0.4rem;
  font-size: 1.65rem; line-height: 1.25; font-weight: 700; letter-spacing: -0.02em;
}
.post-title a { color: var(--text); text-decoration: none; }
.post-title a:hover { color: var(--accent); text-decoration: none; }
.post.on-list .post-title { font-size: 1.35rem; }

.post-meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.4rem; }
.post-author { display: none; }
.post-tags { display: block; margin-bottom: 0.4rem; font-size: 0.85rem; color: var(--muted); }
.post-tags a { color: var(--muted); }
.post-tags a:hover { color: var(--accent); }

.post-content { margin-top: 1.25rem; }
.post.on-list .post-content { margin-top: 0.75rem; color: var(--muted); }
.post-content p { margin: 0 0 1.1rem; }

.post-content h1, .post-content h2, .post-content h3, .post-content h4 {
  line-height: 1.3; letter-spacing: -0.015em; margin: 2.2rem 0 0.8rem;
}
.post-content h2 { font-size: 1.4rem; }
.post-content h3 { font-size: 1.15rem; }
.post-content h4 { font-size: 1rem; }
.post-content strong { font-weight: 650; }

.hanchor { color: var(--accent); margin-left: 0.5rem; visibility: hidden; text-decoration: none; }
h1:hover .hanchor, h2:hover .hanchor, h3:hover .hanchor, h4:hover .hanchor { visibility: visible; }

.post-content ul, .post-content ol { margin: 0 0 1.2rem; padding-left: 1.4rem; }
.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }
.post-content li { margin: 0.3rem 0; }
.post-content li::marker { color: var(--accent); }
.post-content li > p { margin: 0; }

.post-cover {
  width: 200px; height: 200px; object-fit: cover; margin: 1.5rem 0 2rem;
  border: 1px solid var(--border); border-radius: 16px;
}
.post-content img { margin: 1.5rem 0; border-radius: 10px; border: 1px solid var(--border); }

blockquote {
  margin: 1.5rem 0; padding: 0.2rem 1.1rem;
  border-left: 3px solid var(--accent); color: var(--muted);
}
blockquote p { margin: 0.6rem 0; }

table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; }

mark { background: var(--accent-soft); color: var(--text); padding: 0 0.2em; border-radius: 3px; }

/* Code */
code, kbd {
  font-family: var(--mono); font-size: 0.86em;
  background: var(--code-bg); border: 1px solid var(--border); border-radius: 6px;
  padding: 0.12em 0.4em;
}
pre {
  margin: 1.5rem 0; padding: 1rem 1.1rem; overflow: auto;
  background: var(--code-bg) !important; border: 1px solid var(--border); border-radius: 10px;
  font-size: 0.88rem; line-height: 1.6; tab-size: 2;
}
pre code, .highlight code { background: none !important; border: 0; padding: 0; margin: 0; font-size: inherit; }
.highlight { margin: 1.5rem 0; }
.highlight pre { margin: 0; }

.token.comment, .token.prolog, .token.doctype, .token.cdata { color: var(--muted); font-style: italic; }
.token.punctuation, .token.operator { color: var(--muted); }
.token.keyword, .token.atrule, .token.boolean, .token.control, .token.directive,
.token.statement, .token.selector, .token.tag { color: var(--accent); }
.token.string, .token.attr-value, .token.regex, .token.url, .token.char { color: var(--text); opacity: 0.85; }
.token.function, .token.class-name, .token.property, .token.attr-name { color: var(--text); font-weight: 600; }
.token.number, .token.constant, .token.variable, .token.symbol { color: var(--accent); opacity: 0.85; }
.token.namespace { opacity: 0.7; }


/* Hugo/Chroma writes Monokai colours inline; remap them to the theme palette */
.highlight pre, .highlight pre code { color: var(--text) !important; }
.highlight span[style*="#66d9ef"], .highlight span[style*="#ae81ff"] { color: var(--accent) !important; }
.highlight span[style*="#a6e22e"] { color: var(--text) !important; font-weight: 600; }
.highlight span[style*="#e6db74"] { color: var(--accent) !important; opacity: 0.8; }
.highlight span[style*="#f92672"] { color: var(--muted) !important; }
.highlight span[style*="#75715e"] { color: var(--muted) !important; font-style: italic; }
.highlight span[style*="#f8f8f2"] { color: var(--text) !important; }
.highlight span[style*="font-weight:bold"] { font-weight: 600 !important; }

/* Prism copy button */
.code-toolbar { position: relative; margin: 1.5rem 0; }
.code-toolbar > pre, .code-toolbar .highlight { margin: 0; }
.code-toolbar > .toolbar { position: absolute; top: 0.5rem; right: 0.5rem; opacity: 0; transition: opacity 0.15s ease; }
.code-toolbar:hover > .toolbar, .code-toolbar > .toolbar:focus-within { opacity: 1; }
@media (hover: none) { .code-toolbar > .toolbar { opacity: 1; } }
.toolbar-item a, .toolbar-item button {
  display: inline-block; margin: 0; padding: 0.1rem 0.55rem; font: inherit; font-size: 0.75rem;
  color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; text-decoration: none;
}
.toolbar-item a:hover, .toolbar-item button:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

/* Buttons & pagination */
.button, a.button, button.button {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-size: 0.95rem; text-decoration: none; cursor: pointer;
}
a.read-more, a.read-more:hover { display: inline-flex; padding: 0; margin: 0.5rem 0 0; background: none; border: 0; color: var(--accent); font-weight: 500; }
a.read-more:hover { text-decoration: underline; text-underline-offset: 3px; }

.pagination { margin-top: 2rem; }
.pagination__buttons { display: flex; gap: 0.75rem; justify-content: center; }
.pagination__buttons .button {
  flex: 0 1 auto; background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  transition: border-color 0.15s ease;
}
.pagination__buttons .button:hover { border-color: var(--accent); }
.pagination__buttons .button a { padding: 0.45rem 1rem; color: var(--text); text-decoration: none; display: flex; gap: 0.4rem; }
.pagination__title { display: block; text-align: center; margin: 3rem 0 1rem; }
.pagination__title-h { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.pagination__title hr { display: none; }

.terms-title { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; }
.center { text-align: left; }

/* Footer */
.footer { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); font-size: 0.85rem; color: var(--muted); }
.footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.footer a:hover { color: var(--accent); }

@media print {
  .header, .footer, .pagination { display: none; }
  body { background: #fff; color: #000; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
