/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Кастомные стили для мобильного меню */
.mobile-menu-bg {
  background-color: #ffffff !important;
  border-left: 1px solid #e2e8f0 !important;
}

.mobile-overlay-bg {
  background-color: rgba(0, 0, 0, 0.5) !important;
}

/* Фиксы для мобильного меню */
[data-mobile-menu-target="menu"] {
  background-color: #ffffff !important;
}

[data-mobile-menu-target="overlay"] {
  background-color: rgba(0, 0, 0, 0.5) !important;
}

/* тултип */
[data-tooltip] {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted currentColor;
}

[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  z-index: 1000;
  pointer-events: none;
  margin-bottom: 5px;
  
  /* Умная ширина */
  min-width: 120px;
  max-width: min(300px, 80vw);
  white-space: normal;
  word-wrap: break-word;
  text-align: center;
  line-height: 1.3;
}

[data-tooltip]:hover::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  pointer-events: none;
}

/* Дополнительные улучшения для мобильных */
@media (max-width: 640px) {
  [data-tooltip]:hover::after {
    min-width: 100px;
    max-width: min(250px, 90vw);
    font-size: 11px;
    padding: 5px 8px;
  }
}




/* лоадер */
@keyframes fade-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Плавные переходы для встроенного индикатора */
[data-loading-target="spinner"] {
  transition: all 0.3s ease-in-out;
}

[data-loading-target="factText"] {
  transition: opacity 0.2s ease-in-out;
}

/* Анимация появления встроенного индикатора */
[data-loading-target="spinner"]:not(.hidden) {
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Плавные переходы для Turbo Frame */
turbo-frame {
  transition: opacity 0.2s ease-in-out;
}

turbo-frame[busy] {
  opacity: 0.7;
}

/* Стили для raw HTML словарных статей */
.dictionary-raw-content {
  font-family: Georgia, serif;
  line-height: 1.6;
  color: #374151;
}

/* Русские слова с ударениями */
.dictionary-raw-content b {
  font-weight: 700;
  color: #1f2937;
}

/* Курсивные пометы и примеры */
.dictionary-raw-content i {
  font-style: italic;
  color: #6b7280;
  font-size: 0.95em;
}

/* Переносы строк */
.dictionary-raw-content br {
  line-height: 2;
}

/* Испанские переводы (после номеров) */
.dictionary-raw-content {
  counter-reset: translation-counter;
}

/* Стилизуем структуру словарной статьи */
.dictionary-raw-content > br:first-child {
  display: none;
}

/* Делаем испанские слова более заметными */
.dictionary-raw-content {
  font-size: 16px;
}

/* Выделяем основные переводы */
.dictionary-raw-content i b {
  font-weight: 400;
}

/* Грамматические пометы */
.dictionary-raw-content i:contains("м."),
.dictionary-raw-content i:contains("ж."),
.dictionary-raw-content i:contains("с.") {
  background-color: #f3f4f6;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: 0.85em;
}

/* Примеры использования */
.dictionary-raw-content i:contains("—") {
  display: block;
  margin: 8px 0;
  padding: 8px 12px;
  background-color: #f8fafc;
  border-left: 3px solid #3b82f6;
  border-radius: 4px;
}

/* Номера значений */
.dictionary-raw-content {
  /* Стилизуем текст с номерами 1), 2), etc. */
}

/* Типографика для статей */
.article-content {
  color: #334155;
  font-size: 1.05rem;
  line-height: 1.8;
}

.article-content > *:first-child {
  margin-top: 0;
}

.article-content > *:last-child {
  margin-bottom: 0;
}

.article-content h1,
.article-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0f172a;
  margin: 2rem 0 0.75rem;
  line-height: 1.25;
}

.article-content h1 {
  font-size: 2.2rem;
  margin-top: 0.5rem;
}

.article-content h3 {
  font-size: 1.35rem;
  font-weight: 600;
  color: #1e293b;
  margin: 1.5rem 0 0.5rem;
  line-height: 1.35;
}

.article-content h4,
.article-content h5,
.article-content h6 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  margin: 1.25rem 0 0.5rem;
}

.article-content p {
  margin: 0.75rem 0;
  line-height: 1.75;
  color: #334155;
}

.article-content a {
  color: #ea580c;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.article-content a:hover {
  color: #c2410c;
}

.article-content strong {
  font-weight: 700;
  color: #0f172a;
}

.article-content em {
  font-style: italic;
  color: #475569;
}

.article-content hr {
  border: 0;
  border-top: 1px solid #e2e8f0;
  margin: 2rem 0;
}

.article-content ul,
.article-content ol {
  margin: 0.75rem 0 1rem 1.5rem;
  padding-left: 1.25rem;
}

.article-content ul {
  list-style: disc;
}

.article-content ol {
  list-style: decimal;
}

.article-content li {
  margin: 0.35rem 0;
  color: #334155;
}

.article-content li > ul,
.article-content li > ol {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.article-content blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #fff7ed 0%, #fffbeb 100%);
  border-left: 4px solid #f97316;
  border-radius: 0 16px 16px 0;
  color: #7c2d12;
}

.article-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
  background-color: #f1f5f9;
  color: #0f172a;
  padding: 0.15rem 0.4rem;
  border-radius: 0.4rem;
}

.article-content pre {
  margin: 1.5rem 0;
  padding: 1rem 1.1rem;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 1rem;
  overflow-x: auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.article-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: 0.95em;
}

.article-content table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}

.article-content thead {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
}

.article-content th,
.article-content td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
}

.article-content th {
  font-weight: 700;
  color: #7c2d12;
}

.article-content tbody tr:nth-child(even) {
  background-color: #f8fafc;
}

.article-content tbody tr:last-child td {
  border-bottom: 0;
}

.article-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.5rem auto;
  border-radius: 1rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.article-content-invert,
.article-content-invert p,
.article-content-invert li {
  color: rgba(255, 247, 237, 0.96);
}

.article-content-invert strong,
.article-content-invert h1,
.article-content-invert h2,
.article-content-invert h3,
.article-content-invert h4,
.article-content-invert h5,
.article-content-invert h6 {
  color: #ffffff;
}

.article-content-invert em {
  color: rgba(255, 237, 213, 0.92);
}

.article-content-invert a,
.article-content-invert a:hover {
  color: #ffffff;
}

.article-content-invert code {
  background-color: rgba(255, 255, 255, 0.14);
  color: #fff7ed;
}

.article-content-invert blockquote {
  background: rgba(255, 255, 255, 0.12);
  border-left-color: rgba(255, 255, 255, 0.55);
  color: #fff7ed;
}

.article-content-invert hr {
  border-top-color: rgba(255, 255, 255, 0.28);
}

/* Дополнительные стили для читаемости */
.dictionary-raw-content {
  max-height: 600px;
  overflow-y: auto;
}

.dictionary-raw-content::-webkit-scrollbar {
  width: 6px;
}

.dictionary-raw-content::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

.dictionary-raw-content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.dictionary-raw-content::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Простое и эффективное решение */
.dictionary-raw-content {
  font-family: Georgia, serif;
  line-height: 1.6;
  color: #374151;
  font-size: 15px;
}

/* Убираем все br в начале контента */
.dictionary-raw-content > br:first-child,
.dictionary-raw-content > br:first-child + br,
.dictionary-raw-content > br:first-child + br + br {
  display: none;
}

/* Стилизуем первое жирное слово как заголовок */
.dictionary-raw-content > b:first-child {
  display: block;
  font-size: 1.1em;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e5e7eb;
}

/* Убираем br сразу после первого b */
.dictionary-raw-content > b:first-child + br {
  display: none;
}

/* Компактное расстояние между элементами */
.dictionary-raw-content br {
  line-height: 1.4;
}

/* Стили для ссылок "см. (смотри)" */
.see-also {
  display: inline-block;
  margin: 4px 0;
  font-style: italic;
  color: #6b7280;
}

.dictionary-link {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  border: none;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 4px;
  text-decoration: none;
  font-family: inherit;
}

.dictionary-link:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.dictionary-link:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(59, 130, 246, 0.3);
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
  .dictionary-link {
    padding: 4px 10px;
    font-size: 0.95em;
  }
}

/* Компактный дизайн переключателя на мобильных */
@media (max-width: 768px) {
  /* Переключатель направления */
  .language-direction-container .flex {
    gap: 2px;
    padding: 2px;
  }
  
  .language-direction-container label {
    padding: 6px 8px !important;
    font-size: 0.75rem !important;
    line-height: 1.2;
  }
  
  /* Популярные слова компактнее */
  .popular-words-container {
    margin-top: 12px;
    margin-bottom: 12px;
  }
  
  .popular-words-container h3 {
    font-size: 0.9rem;
    margin-bottom: 8px;
  }
  
  .popular-words-grid {
    gap: 6px;
  }
  
  .popular-words-grid button {
    padding: 6px 10px !important;
    font-size: 0.8rem !important;
    min-height: 32px;
  }
  
  /* Индикатор загрузки более заметный на мобильных */
  .loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  }
  
  /* Результаты поиска с отступом сверху */
  #dictionary_results {
    margin-top: 16px;
    scroll-margin-top: 20px;
  }
}

/* Анимация появления результатов */
#dictionary_results {
  transition: opacity 0.3s ease-in-out;
}

#dictionary_results.loading {
  opacity: 0.5;
}

/* Улучшенный индикатор загрузки */
.search-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border-radius: 12px;
  margin: 16px 0;
}

.search-loading .spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #e2e8f0;
  border-top: 3px solid #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 12px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


/* Саджесты */
.suggestion-item {
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.15s ease;
}

.suggestion-item:hover,
.suggestion-item.selected {
  background-color: #f1f5f9;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-word {
  font-weight: 600;
  color: #1e293b;
}

.suggestion-translation {
  font-size: 0.9em;
  color: #64748b;
}

@media (max-width: 768px) {
  .suggestion-item {
    padding: 10px 12px;
  }
  
  .suggestion-word {
    font-size: 0.9rem;
  }
  
  .suggestion-translation {
    font-size: 0.8rem;
  }
}

.phrase-key-points {
  list-style: none;
  margin: 0;
  padding: 0;
}

.phrase-key-points li {
  position: relative;
  padding-left: 2.5rem;
}

.phrase-key-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 9999px;
  background: #ffedd5;
  box-shadow: inset 0 0 0 1px #fed7aa;
}

.phrase-key-points li::after {
  content: "";
  position: absolute;
  left: 0.625rem;
  top: 0.975rem;
  width: 0.25rem;
  height: 0.25rem;
  border-radius: 9999px;
  background: #c2410c;
}

/* Animated status border for active phrase generation steps. */
.phrase-generation-status-active {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-color: transparent !important;
}

.phrase-generation-status-active::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -2;
  background: conic-gradient(from 0deg, #38bdf8, #22c55e, #f59e0b, #38bdf8);
  animation: phrase-generation-status-spin 1.8s linear infinite;
}

.phrase-generation-status-active::after {
  content: "";
  position: absolute;
  inset: 2px;
  z-index: -1;
  border-radius: 0.9rem;
  background: #ffffff;
}

.phrase-generation-status-active.bg-slate-900::after {
  background: #0f172a;
}

@keyframes phrase-generation-status-spin {
  to {
    transform: rotate(1turn);
  }
}

@media (prefers-reduced-motion: reduce) {
  .phrase-generation-status-active::before {
    animation: none;
  }
}

.phrase-generation-status-published-pop {
  position: relative;
  overflow: visible;
  animation: phrase-generation-published-pop 1.15s ease-out;
  box-shadow: 0 18px 45px rgba(34, 197, 94, 0.22), 0 0 0 1px rgba(34, 197, 94, 0.32);
}

.phrase-generation-status-published-pop::before {
  content: "";
  position: absolute;
  inset: -7px;
  z-index: -1;
  border-radius: 1.4rem;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.24), transparent 68%);
  animation: phrase-generation-published-glow 1.15s ease-out;
}

.phrase-generation-status-delta {
  position: absolute;
  right: 1rem;
  top: -0.8rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  height: 2.2rem;
  padding: 0 0.6rem;
  border-radius: 999px;
  background: #22c55e;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: 0 12px 26px rgba(34, 197, 94, 0.36);
  animation: phrase-generation-delta-float 1.8s ease-out forwards;
}

@keyframes phrase-generation-published-pop {
  0% {
    transform: scale(1);
  }
  22% {
    transform: scale(1.045) rotate(-0.6deg);
  }
  48% {
    transform: scale(0.995) rotate(0.35deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

@keyframes phrase-generation-published-glow {
  0% {
    opacity: 0;
    transform: scale(0.86);
  }
  28% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.2);
  }
}

@keyframes phrase-generation-delta-float {
  0% {
    opacity: 0;
    transform: translateY(0.35rem) scale(0.78);
  }
  18% {
    opacity: 1;
    transform: translateY(0) scale(1.08);
  }
  72% {
    opacity: 1;
    transform: translateY(-0.5rem) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-0.95rem) scale(0.96);
  }
}

@media (prefers-reduced-motion: reduce) {
  .phrase-generation-status-published-pop,
  .phrase-generation-status-published-pop::before,
  .phrase-generation-status-delta {
    animation: none;
  }
}

/* ============================================================
   Блог (/blog) — редакционная «бумажная» типографика.
   Неймспейс .blog-* изолирован от .article-content (фразы).
   ============================================================ */

:root {
  --blog-paper: #faf6ee;
  --blog-paper-deep: #f1eadb;
  --blog-ink: #221c16;
  --blog-ink-soft: #5f564b;
  --blog-ink-faint: #8b8174;
  --blog-hairline: #e3dac7;
  --blog-accent: #a32e22;
  --blog-accent-deep: #7e2018;
  --blog-gold: #c79b3b;
  --blog-serif: "Lora", Georgia, "Times New Roman", serif;
}

.blog-shell {
  background-color: var(--blog-paper);
  /* лёгкое бумажное зерно, чтобы фон не был стерильно плоским */
  background-image: radial-gradient(rgba(34, 28, 22, 0.028) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--blog-ink);
}

.blog-serif {
  font-family: var(--blog-serif);
}

.blog-overline {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--blog-accent);
}

.blog-meta {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blog-ink-faint);
  font-variant-numeric: tabular-nums;
}

/* Двойная линейка-шапка: кивок в сторону испанского флага, но приглушённый */
.blog-rule {
  border: 0;
  height: 0;
  border-top: 3px solid var(--blog-accent);
  border-bottom: 1px solid var(--blog-gold);
  padding-top: 3px;
  background: transparent;
}

.blog-hairline {
  border: 0;
  border-top: 1px solid var(--blog-hairline);
}

.blog-title-link {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(to right, var(--blog-accent), var(--blog-accent));
  background-repeat: no-repeat;
  background-position: 0 96%;
  background-size: 0% 2px;
  transition: background-size 0.35s cubic-bezier(0.22, 1, 0.36, 1), color 0.2s ease;
}

.blog-title-link:hover {
  color: var(--blog-accent-deep);
  background-size: 100% 2px;
}

.blog-read-link {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blog-accent);
  text-decoration: none;
  transition: color 0.2s ease, gap 0.25s ease;
}

.blog-read-link:hover {
  color: var(--blog-accent-deep);
  gap: 0.75rem;
}

.blog-read-link:focus-visible,
.blog-title-link:focus-visible {
  outline: 2px solid var(--blog-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Обложки карточек ---------- */

.blog-cover {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: var(--blog-paper-deep);
  box-shadow: inset 0 0 0 1px rgba(34, 28, 22, 0.06);
}

.blog-cover__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

a:hover .blog-cover__img,
a:focus-visible .blog-cover__img {
  transform: scale(1.045);
}

/* Типографская заглушка: цвет фона + крупный испанский глиф, обрезанный краем.
   Тон и глиф детерминированы slug'ом (см. article_cover_placeholder). */
.blog-cover-ph {
  position: absolute;
  inset: 0;
  /* то же бумажное зерно, что на .blog-shell — чтобы заглушка не была плоской */
  background-image: radial-gradient(rgba(250, 246, 238, 0.10) 1px, transparent 1px);
  background-size: 16px 16px;
}

.blog-cover-ph span {
  position: absolute;
  right: -0.03em;
  bottom: -0.34em;
  font-style: italic;
  font-weight: 600;
  line-height: 1;
  user-select: none;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

a:hover .blog-cover-ph span,
a:focus-visible .blog-cover-ph span {
  transform: translateY(-0.04em) rotate(-3deg);
}

.blog-cover--thumb .blog-cover-ph span { font-size: 7.5rem; }
.blog-cover--card .blog-cover-ph span { font-size: 11rem; }
.blog-cover--hero .blog-cover-ph span { font-size: 17rem; }

.blog-cover-ph--1 { background-color: #a3361f; }
.blog-cover-ph--1 span { color: rgba(250, 246, 238, 0.26); }
.blog-cover-ph--2 { background-color: #c0913a; }
.blog-cover-ph--2 span { color: rgba(34, 28, 22, 0.20); }
.blog-cover-ph--3 { background-color: #76703c; }
.blog-cover-ph--3 span { color: rgba(250, 246, 238, 0.24); }
.blog-cover-ph--4 { background-color: #39556b; }
.blog-cover-ph--4 span { color: rgba(250, 246, 238, 0.24); }
.blog-cover-ph--5 { background-color: #2e2820; }
.blog-cover-ph--5 span { color: rgba(199, 155, 59, 0.32); }
.blog-cover-ph--6 { background-color: #8a5a44; }
.blog-cover-ph--6 span { color: rgba(250, 246, 238, 0.24); }

@media (prefers-reduced-motion: reduce) {
  .blog-cover__img,
  .blog-cover-ph span {
    transition: none;
  }
}

/* Прогресс чтения */
.blog-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 60;
  pointer-events: none;
  background: transparent;
}

.blog-progress__bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(to right, var(--blog-accent), var(--blog-gold));
  transform-origin: left center;
  transform: scaleX(0);
}

/* ---------- Тело статьи ---------- */

.blog-prose {
  font-family: var(--blog-serif);
  font-size: 1.16rem;
  line-height: 1.85;
  color: #38312a;
  text-wrap: pretty;
}

.blog-prose > *:first-child { margin-top: 0; }
.blog-prose > *:last-child { margin-bottom: 0; }

.blog-prose p {
  margin: 1.1rem 0;
}

.blog-prose h1,
.blog-prose h2 {
  font-family: var(--blog-serif);
  font-size: 1.75rem;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--blog-ink);
  margin: 2.75rem 0 1rem;
  text-wrap: balance;
}

.blog-prose h2::after {
  content: "";
  display: block;
  width: 3.5rem;
  margin-top: 0.6rem;
  border-top: 2px solid var(--blog-accent);
}

.blog-prose h3 {
  font-family: var(--blog-serif);
  font-size: 1.32rem;
  font-weight: 600;
  font-style: italic;
  color: var(--blog-ink);
  margin: 2rem 0 0.6rem;
  line-height: 1.35;
}

.blog-prose h4,
.blog-prose h5,
.blog-prose h6 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--blog-ink);
  margin: 1.5rem 0 0.5rem;
}

.blog-prose a {
  color: var(--blog-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(163, 46, 34, 0.4);
  text-underline-offset: 3px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.blog-prose a:hover {
  color: var(--blog-accent-deep);
  text-decoration-color: currentColor;
}

.blog-prose strong { font-weight: 700; color: var(--blog-ink); }
.blog-prose em { font-style: italic; }

.blog-prose hr {
  border: 0;
  margin: 2.5rem auto;
  text-align: center;
}

.blog-prose hr::after {
  content: "✦ ✦ ✦";
  display: block;
  color: var(--blog-gold);
  font-size: 0.8rem;
  letter-spacing: 0.9em;
  padding-left: 0.9em; /* компенсация letter-spacing последнего знака */
}

.blog-prose ul,
.blog-prose ol {
  margin: 1.1rem 0 1.1rem 0.25rem;
  padding-left: 1.4rem;
}

.blog-prose ul { list-style: none; }

.blog-prose ul > li {
  position: relative;
}

.blog-prose ul > li::before {
  content: "—";
  position: absolute;
  left: -1.4rem;
  color: var(--blog-accent);
}

.blog-prose ol { list-style: decimal; }
.blog-prose ol > li::marker {
  color: var(--blog-accent);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.blog-prose li { margin: 0.45rem 0; }

.blog-prose blockquote {
  margin: 2rem 0;
  padding: 1rem 1.5rem;
  border-left: 3px solid var(--blog-accent);
  border-radius: 0 0.45rem 0.45rem 0;
  background: rgba(163, 46, 34, 0.05);
  font-style: italic;
  font-size: 1.22rem;
  line-height: 1.7;
  color: var(--blog-ink-soft);
}

.blog-prose blockquote p { margin: 0.5rem 0; }

.blog-prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.85em;
  background-color: var(--blog-paper-deep);
  color: var(--blog-accent-deep);
  padding: 0.15rem 0.4rem;
  border-radius: 0.3rem;
}

.blog-prose pre {
  margin: 1.75rem 0;
  padding: 1.1rem 1.25rem;
  background: #2a241d;
  color: #f1eadb;
  border-radius: 0.5rem;
  overflow-x: auto;
}

.blog-prose pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: 0.92em;
}

.blog-prose table {
  width: 100%;
  margin: 2rem 0;
  border-collapse: collapse;
  font-size: 0.98rem;
  font-variant-numeric: tabular-nums;
}

.blog-prose thead { background: transparent; }

.blog-prose th {
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blog-ink-soft);
  border-top: 2px solid var(--blog-ink);
  border-bottom: 1px solid var(--blog-hairline);
}

.blog-prose th,
.blog-prose td {
  padding: 0.7rem 0.9rem 0.7rem 0;
  text-align: left;
  vertical-align: top;
}

.blog-prose td { border-bottom: 1px solid var(--blog-hairline); }
.blog-prose tbody tr:last-child td { border-bottom: 2px solid var(--blog-ink); }

.blog-prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 2rem auto;
  border-radius: 0.25rem;
  box-shadow: 0 14px 40px rgba(34, 28, 22, 0.18);
}

/* Буквица в первом абзаце */
.blog-dropcap > p:first-of-type::first-letter {
  font-family: var(--blog-serif);
  float: left;
  font-size: 3.4em;
  line-height: 0.82;
  padding: 0.08em 0.12em 0 0;
  font-weight: 600;
  color: var(--blog-accent);
}

/* Концевой знак статьи */
.blog-endmark {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
  color: var(--blog-gold);
}

.blog-endmark::before,
.blog-endmark::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--blog-hairline);
}

/* Оглавление */
.blog-toc summary {
  cursor: pointer;
  list-style: none;
}

.blog-toc summary::-webkit-details-marker { display: none; }

.blog-toc summary .blog-toc__chevron {
  transition: transform 0.25s ease;
}

.blog-toc[open] summary .blog-toc__chevron {
  transform: rotate(90deg);
}

@media (max-width: 640px) {
  .blog-prose { font-size: 1.07rem; }
  .blog-dropcap > p:first-of-type::first-letter { font-size: 3em; }
}

@media (prefers-reduced-motion: reduce) {
  .blog-title-link,
  .blog-read-link,
  .blog-progress__bar {
    transition: none;
  }
}

/* Карточки примеров «испанский — русский» (см. ArticlesHelper#decorate_example_lists) */
.blog-prose ul.blog-examples {
  list-style: none;
  margin: 1.6rem 0;
  padding: 0.55rem 1.4rem 0.9rem;
  background: var(--blog-paper-deep);
  border-left: 3px solid var(--blog-gold);
  border-radius: 0 0.45rem 0.45rem 0;
}

.blog-prose ul.blog-examples::before {
  content: "ejemplos";
  display: block;
  padding: 0.35rem 0 0.15rem;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--blog-accent);
}

.blog-prose ul.blog-examples > li {
  margin: 0;
  padding: 0.6rem 0;
}

.blog-prose ul.blog-examples > li::before {
  content: none;
}

.blog-prose ul.blog-examples > li + li {
  border-top: 1px solid rgba(34, 28, 22, 0.09);
}

.blog-example-es {
  font-style: italic;
  font-weight: 500;
  color: var(--blog-ink);
}

.blog-example-sep {
  color: var(--blog-gold);
  margin: 0 0.55rem;
}

.blog-example-ru {
  color: var(--blog-ink-soft);
  font-size: 0.94em;
}
