@font-face {
  font-family: 'Yukarimobil';
  src: url('../fonts/yukarimobil-webfont.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Literata';
  src: url('../fonts/Literata-VariableFont_opsz_wght.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}

@font-face {
    font-family: 'Golos Text';
    src: url('../fonts/GolosText-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Golos Text';
    src: url('../fonts/GolosText-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Golos Text';
    src: url('../fonts/GolosText-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'Golos Text';
    src: url('../fonts/GolosText-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Golos Text';
    src: url('../fonts/GolosText-ExtraBold.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
}

@font-face {
    font-family: 'Golos Text';
    src: url('../fonts/GolosText-Black.woff2') format('woff2');
    font-weight: 900;
    font-style: normal;
}

:root {
  --accent: #f60173;
  --secondary: #00001d; 
  --bg: #fafafa;
  --text-main: #1a1a1a; 
  --text-muted: #545961;
  --border: #e0e0e0;
  --btn-bg: #ffffff;
  --font-family: Golos Text, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

body {
  font-family: 'Golos Text', 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--secondary);
  background-color: var(--bg);
  margin: 0;
  padding: 0;
}

main {
  max-width: 970px;
  margin: 0 auto;
  padding: 0.5rem 1rem;
  box-sizing: border-box;
}

.posts-container {
  max-width: 700px; 
  margin: 0 auto; 
  padding: 2rem 1rem;
  box-sizing: border-box;
}

.posts-container img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem auto; 
}

article img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem auto;  
  max-height: auto;
  max-inline-size: 700px;
}

mark {
  background: linear-gradient(to top, #fffd7a 40%, transparent 40%);
  color: inherit;
  padding: 0 0.2em;
  border-radius: 0;
}

strong, b {
  font-weight: 600;
}

.inline-spoiler {
  font-size: inherit;
  position: relative;
  display: inline-block;
  color: transparent;
  cursor: pointer;
  border-radius: 2px;
  transition: filter 0.3s ease, color 0.3s ease;
}

.label {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: bold;
  color: #fff;
  background-color: gray;
  padding: 0.2em 0.6em;
  border-radius: 0.25em;
  text-transform: uppercase;
  margin-top: 1em; 
  margin-bottom: 1em;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

/* Стили для светлой темы */
@media (prefers-color-scheme: light) {
  .inline-spoiler {
    background-color: rgba(0, 0, 0, 0.1);
  }
}

/* Стили для открытого спойлера */
.inline-spoiler.open {
  color: inherit; 
  background-color: transparent;
}

/* Запасной вариант для случаев, когда JavaScript отключен */
.no-js .inline-spoiler {
  color: inherit;
  background-color: transparent;
}

/* Шапка по умолчанию (для мобилок) */
header {
  position: relative;
  text-align: center;
  padding: 0.5rem 0;
  background-color: #fafafab3;
}

header .logo a {
  background: -webkit-linear-gradient(10deg, var(--accent) 30%, #fa80b9 100%);
  background: linear-gradient(10deg, var(--accent) 30%, #fa80b9 100%);
  font-family: 'Yukarimobil', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  display: inline-block;
  background-clip: text;
  text-decoration: none;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  transition: transform 0.3s ease;
  padding-top: 0.35rem;
}

header .logo a:hover {
  transform: scale(1.05);
}

header nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

header nav ul li {
  margin: 0;
  padding: 0;
}

header nav ul li a {
  text-decoration: none;
  color: inherit !important;
  font-weight: 400;
  transition: color 0.3s ease;
}

header nav ul li a:hover {
  color: var(--accent) !important;
}

header nav ul li a.active {
  background: -webkit-linear-gradient(10deg, var(--accent) 30%, #fa80b9 100%);
  background: linear-gradient(10deg, var(--accent) 30%, #fa80b9 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-weight: 500;
}

:target {
  scroll-margin-top: 100px;
}

/* ====== Бейдж "Переведено с ИИ" ====== */
.ai-translation-badge {
  position: absolute;
  top: 0.25rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  opacity: 0.45;
  pointer-events: none;
  white-space: nowrap;
  z-index: 10;
  transition: color 0.3s ease, opacity 0.3s ease;
}

/* Адаптация под тёмную тему */
@media (prefers-color-scheme: dark) {
  .ai-translation-badge {
    color: #aaa;
    opacity: 0.75;
  }
}

/* ====== Мобильная версия ====== */
@media (max-width: 767px) {
  header {
    text-align: left;
    padding: 0.25rem 1rem 0.5rem 1rem;
  }

  .ai-translation-badge {
    position: relative;
    top: 0;
    left: 0; 
    transform: none;
    display: block;
    text-align: left; 
    font-size: 0.65rem;
    width: fit-content;
    line-height: 1;
    padding-left: 0; 
  }

  header .logo a {
    margin-bottom: 0.2rem;
    display: inline-block;
  }

  header nav ul {
    flex-direction: row;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.4rem 0.8rem;
  }
}

/* =========================
   Типографика
========================= */
h1, h2, h3 {
  margin: 0 0 .6rem;
  line-height: 1.2; 
}
h1 { font-family: 'Literata'; font-size: 2.4rem; }
h2 { font-size: 1.6rem; }
.muted { color: var(--muted); }

code, pre {
  overflow-wrap: break-word; 
  font-size: 10px;
}

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

::selection {
  background: hotpink;
  color: white;
}

/* --- Общие ссылки --- */
a {
  color: rgba(0, 0, 0, 0.9);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: rgba(246, 1, 115, 0.5);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
  transition: text-decoration-color 0.2s ease, text-decoration-thickness 0.2s ease;
}

a:hover, .footer-language-list a:hover {
  color: inherit;
  text-decoration-color: var(--accent);
  text-decoration-style: solid;
  text-underline-offset: 4px;
}

/* --- Внешние ссылки --- */
a[href^="http"]:not([href*="localhost"]):not(.footer-badge-link) {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

a[href^="http"]:not([href*="localhost"]):not(.footer-badge-link)::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="%23888" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M7 17L17 7"/><path d="M7 7h10v10"/></svg>') no-repeat center;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.meta {
  margin-top: 1.4em;
}

.author {
  font-family: "Literata";
  font-size: 1.4em;
  margin-top: 1.4em;
}

.dates {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2.2em;
}

figcaption {
  text-align: center;
  margin-top: -1em;
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  object-fit: cover;
}

/* Стили для <details> / <summary> */
details {
  background-color: rgba(249, 249, 249, 0.25);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 12px;
  margin: 1.2em 0;
  transition: background-color 0.2s, border-color 0.2s;
}

details:hover {
  background-color: rgba(249, 249, 249, 0.35);
  border-color: rgba(0, 0, 0, 0.12);
}

summary {
  font-weight: 600;
  cursor: pointer;
  outline: none;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

/* Убираем стандартный маркер во всех браузерах */
summary::-webkit-details-marker,
summary::marker {
  display: none;
}

/* Кастомная стрелка (иконка) */
summary::after {
  content: "▸";
  font-size: 1.1em;
  color: #777;
  transition: transform 0.25s ease, color 0.2s;
  flex-shrink: 0;
  margin-left: 8px;
}

/* Поворот при открытии */
details[open] summary::after {
  transform: rotate(90deg);
  color: #555;
}

/* === Таблица — базовый стиль === */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.5em auto;
  background: transparent;
  font-size: 0.95em;
  line-height: 1.4;
}

/* Скругление всей таблицы */
table thead th:first-child { border-top-left-radius: 6px; }
table thead th:last-child { border-top-right-radius: 6px; }
table tbody tr:last-child td:first-child { border-bottom-left-radius: 6px; }
table tbody tr:last-child td:last-child { border-bottom-right-radius: 6px; }

th,
td {
  padding: 0.75em 1em;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  transition: background-color 0.15s ease;
}

/* Заголовки */
th {
  font-weight: 600;
  color: #222;
  background-color: rgba(0, 0, 0, 0.03);
  border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

/* Строки — зебра */
tbody tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.02);
}

tbody tr:nth-child(odd) {
  background-color: transparent;
}

/* Наведение */
tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.06) !important;
}

code,
pre {
  font-family: 'Menlo', 'Consolas', 'Courier New', monospace;
  border-radius: 4px;
}

code {
  font-size: 0.85em;
  padding: 0.2em 0.4em;
  background-color: rgba(27, 31, 35, 0.05);
  color: #d73a49;
}

pre {
  display: block;
  overflow-x: auto; /* ← прокрутка по горизонтали */
  -webkit-overflow-scrolling: touch; /* плавная прокрутка на iOS */
  font-size: 0.9em;
  white-space: pre;
  margin: 1.5em 0;
  padding: 1em 1.2em;
  line-height: 1.5;
  background-color: rgba(27, 31, 35, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.06);
  position: relative; /* для позиционирования кнопки */
}

pre code {
  padding: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

.tag {
  text-decoration: none;
}

/* TOC */
.toc {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc li {
  margin: 0.2rem 0;
}

.toc a {
  text-decoration: none;
  color: var(--accent);
}

/* Две колонки */
.two-columns {
    display: flex;
    gap: 2.5rem;
    margin: 1.5rem 0;
}

.two-columns__col {
    flex: 1;
    min-width: 0;
}

/* Заметка */
.note {
  position: relative;
  padding: 0 20px;
  margin: 30px 0;
  border-radius: 8px;
  font-size: 1rem;
  background: var(--bg);
  overflow: hidden;
}

.note::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: linear-gradient(10deg, var(--accent) 30%, #fa80b9 100%);
  padding: 1px;
  
  -webkit-mask:
    linear-gradient(#000 0 0) content-box, 
    linear-gradient(#000 0 0);
  -webkit-mask-composite: exclude;
  mask-composite: exclude;
  
  pointer-events: none;
}

.video-embed {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 */
  margin: 1.5em 0;
}

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