/* ── Fonts ──────────────────────────────────────────── */
@font-face {
  font-family: 'Lazurski';
  src: url('assets/fonts/lazurski_regular.otf') format('opentype'),
       url('assets/fonts/lazurski_regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Lazurski';
  src: url('assets/fonts/lazurski_bold.otf') format('opentype'),
       url('assets/fonts/lazurski_bold.ttf') format('truetype');
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}

/* ── Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ───────────────────────────────────────────── */
body {
  font-family: 'Lazurski', Georgia, serif;
  color: #fff;
  background: #23292b;
  line-height: 1.5;
  font-size: 18px;
}

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

/* ── Page wrapper (matches index.css) ───────────────── */
.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ── Navigation (matches index.css) ─────────────────── */
.nav-wrap {
  display: flex;
  justify-content: center;
  padding-top: 30px;
  margin-bottom: 20px;
}
.nav {
  position: relative;
  display: inline-flex;
  align-items: center;
  border: 1px solid #3f4c55;
  border-radius: 20px;
  overflow: hidden;
}
.nav-pill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: #1c2224;
  border-radius: 20px;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 0;
}
.nav-item {
  position: relative;
  z-index: 1;
  cursor: pointer;
  white-space: nowrap;
  padding: 0 30px;
  height: 50px;
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
}
.nav-item:hover { color: #00aeff; text-decoration: none; }
.nav-item.active { color: #fff; }

/* ── Content fade ───────────────────────────────────── */
.articles-content {
  animation: fadeIn 0.3s ease;
}
.articles-content.fade-out {
  opacity: 0;
  transition: opacity 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Articles grid ──────────────────────────────────── */
.articles-grid {
  display: flex;
  gap: 0;
  min-height: 100vh;
}

.articles-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding: 30px 30px 40px;
}

.articles-column:first-child {
  padding-left: 0;
}

.articles-column:last-child {
  padding-right: 0;
}

.articles-divider {
  width: 1px;
  background: #3f4c55;
  flex-shrink: 0;
  margin: 30px 0 0 0;
}

/* ── Article card ───────────────────────────────────── */
.article-card {
  display: block;
}

.article-link {
  display: block;
  text-decoration: none;
  color: #fff;
  transition: color 0.15s;
}

.article-link:hover {
  color: #00aeff;
  text-decoration: none;
}

.article-title {
  font-size: 20px;
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 8px;
}

.article-excerpt {
  font-size: 18px;
  line-height: 1.6;
}

.article-time {
  font-size: 14px;
  color: #666;
  display: block;
  margin-top: 8px;
}

/* ══════════════════════════════════════════════════════
   Single article page
   ══════════════════════════════════════════════════════ */

/* ── Layout ── */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 40px 80px;
}

/* ── Back link ── */
.back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none !important;
  font-size: 18px;
  margin-bottom: 40px;
  color: #fff;
  transition: opacity .15s;
}
.back:hover {
  opacity: 0.75;
  text-decoration: none !important;
}
.back-circle {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #D9D9D9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #23292b;
  line-height: 1;
}

/* ── Single article typography ── */
.article-page-title {
  font-size: 40px;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 20px;
}
.article-page-excerpt {
  font-size: 19px;
  color: #aaa;
  margin-bottom: 40px;
  line-height: 1.6;
}
.cover {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 48px;
  display: block;
}
.date {
  font-size: 13px;
  color: #666;
  margin-bottom: 10px;
}

/* ── Quill content ── */
.ql-snow.ql-toolbar { display: none; }
.ql-container.ql-snow {
  border: none !important;
  font-size: 20px !important;
  font-family: 'Lazurski', Georgia, serif !important;
}
.ql-editor {
  padding: 0 !important;
  color: #fff;
  font-family: 'Lazurski', Georgia, serif !important;
  font-size: 20px !important;
  white-space: normal !important;
}
.ql-editor p:empty { display: none; }
.ql-editor p {
  margin-bottom: 0.9em !important;
  line-height: 1.7;
}
.ql-editor h1 { font-size: 30px; margin: 1.6em 0 .6em; font-weight: 900; }
.ql-editor h2 { font-size: 24px; margin: 1.4em 0 .5em; font-weight: 900; }
.ql-editor h3 { font-size: 20px; margin: 2.4em 0 0.8em !important; font-weight: 900; }
.ql-editor img { max-width: 100%; border-radius: 8px; margin: 1em 0; }
.ql-editor iframe { width: 100%; aspect-ratio: 16/9; border-radius: 8px; margin: 1em 0; border: none; }
.ql-editor blockquote {
  border-left: 3px solid #00aeff;
  padding-left: 20px;
  color: #aaa;
  font-style: italic;
  margin: 1.4em 0;
}
.ql-editor pre { background: #1c2224; padding: 16px; border-radius: 8px; overflow-x: auto; }
.ql-editor ul, .ql-editor ol { padding-left: 24px; margin-bottom: 1.8em !important; }
.ql-editor p + ul, .ql-editor p + ol { margin-top: -0.9em !important; }
.ql-editor li { margin-bottom: .4em; line-height: 1.6; }
.ql-editor a { color: #00aeff; text-decoration: none !important; }
.ql-editor a:hover { text-decoration: underline !important; }
video { max-width: 100%; border-radius: 8px; margin: 1em 0; }

/* ── Like button ──────────────────────────────────── */
.like-btn {
  position: fixed;
  top: var(--like-top, 120px);
  left: calc(50% + 450px + 30px);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
  z-index: 100;
  transition: transform 0.15s;
}
.like-btn:hover { transform: scale(1.1); }
.like-btn.liked { pointer-events: none; }

.like-heart {
  width: 40px;
  height: 40px;
  fill: none;
  stroke: #00aeff;
  stroke-width: 1.5;
  transition: fill 0.2s, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.like-btn.liked .like-heart,
.like-btn.animating .like-heart {
  fill: #00aeff;
  stroke: #00aeff;
}
.like-btn.animating .like-heart {
  transform: scale(1.3);
}

.like-count {
  font-family: 'Lazurski', Georgia, serif;
  font-size: 14px;
  color: #00aeff;
  line-height: 1;
}


/* ── Article quote ───────────────────────────────────── */
.article-quote,
.ql-editor blockquote.article-quote {
  border-left: 1px solid #00aeff !important;
  padding-left: 14px !important;
  font-size: 20px !important;
  line-height: 1.7 !important;
  color: #fff !important;
  font-style: normal !important;
  margin-bottom: 40px !important;
}

/* ── Image caption ──────────────────────────────────── */
.ql-editor p.caption {
  text-align: center;
  font-size: 16px !important;
  color: #A7A6A6 !important;
  margin-top: -34px !important;
  margin-bottom: 1.8em !important;
  line-height: 1.5 !important;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 1100px) {
  .page { padding: 0 24px 80px; }
  .articles-column { padding: 30px 20px 40px; }
  .article-excerpt { font-size: 16px; }
  .article-title { font-size: 18px; }

  .like-btn {
    position: fixed;
    top: auto;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    flex-direction: row;
    gap: 8px;
  }
  .like-btn:hover { transform: translateX(-50%) scale(1.1); }
  .like-btn.animating .like-heart { transform: scale(1.3); }
}

@media (max-width: 768px) {
  .page { padding: 0 16px 60px; }

  .articles-grid {
    flex-direction: column;
    gap: 0;
    min-height: auto;
  }

  .articles-divider {
    display: none;
  }

  .articles-column {
    padding: 20px 0;
  }

  .article-excerpt { font-size: 16px; }
  .article-title { font-size: 17px; }

  /* Single article */
  .container { padding: 40px 20px 60px; }
  .article-page-title { font-size: 28px; }
  .article-page-excerpt { font-size: 17px; }
}

@media (max-width: 480px) {
  .page { padding: 0 12px 48px; }
  .article-excerpt { font-size: 15px; }
  .article-title { font-size: 16px; }

  /* Single article */
  .container { padding: 32px 16px 48px; }
  .article-page-title { font-size: 24px; }
}
/* ── Image gallery ───────────────────────────────────── */
.ql-editor .gallery {
  display: grid;
  gap: 4px;
  margin: 1em 0 0.9em !important;
}
.ql-editor .gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  margin: 0 !important;
  display: block;
}
/* 2 → 1×2 */
.ql-editor .gallery:has(img:last-child:nth-child(2)) {
  grid-template-columns: repeat(2, 1fr);
}
/* 3 → 1×3 */
.ql-editor .gallery:has(img:last-child:nth-child(3)) {
  grid-template-columns: repeat(3, 1fr);
}
/* 4 → 2×2 */
.ql-editor .gallery:has(img:last-child:nth-child(4)) {
  grid-template-columns: repeat(2, 1fr);
}
/* 5 → 3 сверху + 2 снизу */
.ql-editor .gallery:has(img:last-child:nth-child(5)) {
  grid-template-columns: repeat(6, 1fr);
}
.ql-editor .gallery:has(img:last-child:nth-child(5)) img:nth-child(-n+3) {
  grid-column: span 2;
}
.ql-editor .gallery:has(img:last-child:nth-child(5)) img:nth-child(n+4) {
  grid-column: span 3;
}
/* 6 → 2×3 */
.ql-editor .gallery:has(img:last-child:nth-child(6)) {
  grid-template-columns: repeat(3, 1fr);
}
/* 7 → 4 сверху + 3 снизу */
.ql-editor .gallery:has(img:last-child:nth-child(7)) {
  grid-template-columns: repeat(12, 1fr);
}
.ql-editor .gallery:has(img:last-child:nth-child(7)) img:nth-child(-n+4) {
  grid-column: span 3;
}
.ql-editor .gallery:has(img:last-child:nth-child(7)) img:nth-child(n+5) {
  grid-column: span 4;
}
/* 8 → 2×4 */
.ql-editor .gallery:has(img:last-child:nth-child(8)) {
  grid-template-columns: repeat(4, 1fr);
}
/* 9+ → 3 колонки */
.ql-editor .gallery:has(img:nth-child(9)) {
  grid-template-columns: repeat(3, 1fr);
}
/* Мобильная: всегда 2 колонки */
@media (max-width: 768px) {
  .ql-editor .gallery {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .ql-editor .gallery img {
    grid-column: span 1 !important;
  }
}