@import url("https://fonts.googleapis.com/css2?family=PT+Serif:ital,wght@0,400;0,700;1,400;1,700&family=PT+Sans:ital,wght@0,400;0,700;1,400;1,700&display=swap&subset=cyrillic,cyrillic-ext");

:root[data-theme="light"] {
  --bg: #fff;
  --bg-translucent: rgba(255, 255, 255, 0.85);
  --text: #222;
  --text-muted: #666;
  --text-faint: #999;
  --link: #2a6496;
  --accent: #d97706;
  --border: #ddd;
  --code-bg: #f5f5f5;
  --quote-border: #ccc;
  --quote-text: #555;
  --tag-border: #ddd;
  --tag-text: #666;
  --img-caption: #888;
  --placeholder-bg: #f0f0f0;
  --placeholder-text: #bbb;
}

:root[data-theme="dark"] {
  --bg: #1a1a1a;
  --bg-translucent: rgba(26, 26, 26, 0.85);
  --text: #d8d8d8;
  --text-muted: #999;
  --text-faint: #666;
  --link: #7db4d8;
  --accent: #f59e0b;
  --border: #333;
  --code-bg: #242424;
  --quote-border: #444;
  --quote-text: #aaa;
  --tag-border: #444;
  --tag-text: #999;
  --img-caption: #777;
  --placeholder-bg: #2a2a2a;
  --placeholder-text: #555;
}

body {
  max-width: 680px;
  margin: 0 auto;
  padding: 80px 20px 0;
  font-family: "PT Sans", sans-serif;
  font-size: 1.125rem;
  background: var(--bg);
  color: var(--text);
  transition:
    background 0.3s,
    color 0.3s;
}

@media (max-width: 768px) {
  body {
    font-size: 1rem;
  }
}

h2 {
  font-family: "PT Serif", serif;
  font-size: 2rem;
}

h3 {
  font-family: "PT Serif", serif;
  font-size: 1.4rem;
}

a {
  color: var(--accent);
}

#site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 16px;
  height: 56px;
  padding: 0 16px;
  background: var(--bg-translucent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition:
    background 0.3s,
    border-color 0.3s;
}

#site-nav .site-name {
  font-family: "PT Serif", serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
}

#site-nav .nav-links {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  flex-shrink: 0;
  white-space: nowrap;
}

#site-nav .nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

#site-nav .nav-links a:hover {
  color: var(--text);
}

#theme-toggle {
  position: relative;
  width: 36px;
  height: 20px;
  margin-left: auto;
  flex-shrink: 0;
  background: var(--border);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
  transition: background 0.3s;
  -webkit-appearance: none;
  appearance: none;
}

#theme-toggle::before {
  content: "☀️";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
  transition: transform 0.3s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

#theme-toggle.dark {
  background: var(--accent);
}

#theme-toggle.dark::before {
  content: "🌙";
  transform: translateX(16px);
}

article {
  margin: 48px 0;
}

article h2 a {
  color: inherit;
  text-decoration: none;
}

article h2 a:hover {
  text-decoration: underline;
}

.meta {
  color: var(--text-muted);
  font-size: 0.78rem;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 48px 0;
}

footer {
  color: var(--text-faint);
  font-size: 0.78rem;
  margin-top: 64px;
}

img {
  max-width: 100%;
  border-radius: 4px;
}

blockquote {
  border-left: 3px solid var(--accent);
  margin-left: 0;
  padding-left: 16px;
  color: var(--quote-text);
  font-size: 1.05rem;
  font-family: "PT Serif", serif;
}

pre {
  background: var(--code-bg);
  padding: 16px;
  overflow-x: auto;
  font-size: 0.82rem;
  border-radius: 4px;
  transition: background 0.3s;
}

code {
  background: var(--code-bg);
  padding: 2px 5px;
  font-size: 0.88em;
  border-radius: 3px;
  transition: background 0.3s;
}

pre code,
pre code.hljs {
  background: none;
  padding: 0;
  font-size: 0.85em;
  border-radius: 0;
}

ul,
ol {
  padding-left: 24px;
}

li {
  margin-bottom: 6px;
}

.tag {
  display: inline-block;
  font-size: 0.72rem;
  color: var(--tag-text);
  border: 1px solid var(--tag-border);
  padding: 2px 8px;
  border-radius: 3px;
  margin-right: 4px;
  transition:
    border-color 0.3s,
    color 0.3s;
}

.img-caption {
  font-size: 0.76rem;
  color: var(--img-caption);
  margin: 0 0 24px 0;
  font-style: italic;
}

.post-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 8px 0 12px;
}

.back-link {
  font-size: 0.85rem;
  margin-bottom: 24px;
  display: block;
}

.post-content p {
  line-height: 1.7;
  margin-bottom: 16px;
}

.post-content h3 {
  margin-top: 32px;
}

#consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--code-bg);
  border-top: 1px solid var(--border);
  padding: 14px 20px;
  font-size: 0.82rem;
  text-align: center;
  z-index: 100;
  transition:
    background 0.3s,
    border-color 0.3s;
}

#consent-banner p {
  margin: 0;
  color: var(--text-muted);
}

#consent-banner button {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.78rem;
  padding: 4px 14px;
  border-radius: 3px;
  cursor: pointer;
  margin-left: 10px;
  font-family: inherit;
  transition:
    border-color 0.3s,
    color 0.3s;
}

#consent-banner button:hover {
  border-color: var(--text-muted);
}

#consent-banner #consent-accept {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.lang-toggle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.lang-toggle a {
  color: var(--text-muted);
  text-decoration: none;
}

.lang-toggle a:hover {
  color: var(--accent);
}

.lang-toggle .active {
  font-weight: 700;
  color: var(--text);
}
