/* Импорт современных шрифтов с отличной поддержкой кириллицы через Google Fonts */

/* Inter - для основного текста (отличная кириллица, очень читаемый) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap&subset=cyrillic,latin');

/* JetBrains Mono - для кода (лучший моноширинный с лигатурами и кириллицей) */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,400;0,500;1,400;1,500&display=swap&subset=cyrillic,latin');

/* Переопределяем шрифты */
html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

p, li, td, th, div {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
}

/* Моноширинный для кода - с повышенной специфичностью */
code, 
pre, 
kbd, 
samp, 
tt,
pre code,
.highlight pre code,
.highlight pre code[class*="language-"] {
  font-family: 'JetBrains Mono', 'Consolas', 'Monaco', 'Courier New', monospace !important;
  font-variant-ligatures: normal !important;
}

/* Дополнительно для inline code */
p code,
li code,
td code {
  font-family: 'JetBrains Mono', 'Consolas', 'Monaco', 'Courier New', monospace !important;
}

/* Улучшаем читаемость */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Более тонкая полоска под ссылками (1.5px вместо 3px) с зелёным цветом - только для текстовых ссылок */
a {
  border-bottom: 1.5px solid #28a745 !important;
}

/* Убираем подчёркивание с нетекстовых элементов */
a img,
a:has(img),
.header a,
.nav a,
.soc a,
.social a,
.logo a,
header a,
nav a {
  border-bottom: none !important;
}

.callout a {
  border-bottom: 1.5px solid #fff !important;
}

.tags a {
  border-bottom: 1.5px solid #28a745 !important;
}

/* Убираем зелёный фон и смену цвета при наведении на ссылки */
a:hover {
  background-color: transparent !important;
  color: inherit !important;
}

.tags a:hover {
  background-color: transparent !important;
  color: inherit !important;
}

.site-description a:hover {
  background-color: transparent !important;
  color: inherit !important;
}

/* Фикс отображения блоков кода на мобильных устройствах (особенно iOS Safari) */
pre {
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

pre code {
  white-space: pre !important;
  word-wrap: normal !important;
  word-break: normal !important;
  display: inline-block !important;
  min-width: 100% !important;
  box-sizing: border-box !important;
}

.highlight {
  overflow-x: auto !important;
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.highlight pre {
  overflow-x: visible !important;
  margin: 0 !important;
  width: auto !important;
}

.highlight pre code {
  display: inline-block !important;
  min-width: 100% !important;
}

/* Специфичные фиксы для iOS Safari */
@supports (-webkit-touch-callout: none) {
  /* Это сработает только в iOS Safari */
  pre {
    -webkit-text-size-adjust: 100% !important;
  }
  
  pre code {
    -webkit-text-size-adjust: 100% !important;
    display: inline-block !important;
    min-width: 100% !important;
  }
  
  .highlight pre code {
    width: max-content !important;
  }
}

/* Для мобильных - убедимся что контент не обрезается */
@media (max-width: 768px) {
  .content {
    overflow-x: hidden !important;
  }
  
  pre,
  .highlight {
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-radius: 4px !important;
  }
  
  pre code {
    font-size: 0.85em !important;
    padding-right: 1em !important;
  }
}

