/* ===== Нотатки — вариант B «Картки» ===== */
:root {
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-soft: #eff4ff;
  --bg: #f4f5f7;
  --text: #111827;
  --muted: #6b7280;
  --body: #4b5563;
  --border: #e5e7eb;
  --radius: 16px;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--text); }
a:hover { color: var(--accent-dark); text-decoration: none; }
.container { max-width: 1200px; }

/* --- Шапка --- */
.site-header { background: #fff; border-bottom: 1px solid var(--border); }
.site-header .navbar { padding: 14px 0; }
.brand { display: flex; align-items: center; font-weight: 800; font-size: 22px; color: var(--text); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; margin-right: 10px;
  background: var(--accent); color: #fff; font-size: 18px;
  display: inline-flex; align-items: center; justify-content: center;
}
.site-header .nav-link { font-weight: 500; color: var(--text); padding: 10px 14px !important; border-radius: 10px; }
.site-header .nav-link:hover { color: var(--accent-dark); }
.site-header .nav-item.active .nav-link { background: var(--accent-soft); color: var(--accent-dark); }
.search-box { background: var(--bg); border-radius: 10px; padding: 0 14px; height: 44px; display: flex; align-items: center; }
.search-box i { color: var(--muted); margin-right: 8px; }
.search-box input { border: 0; background: transparent; outline: none; width: 200px; color: var(--text); }

/* --- Загальне --- */
.badge-rubric {
  display: inline-block; background: var(--accent-soft); color: var(--accent-dark);
  font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px;
}
.rubric-text { font-size: 13px; font-weight: 600; color: var(--accent-dark); }
.meta { font-size: 14px; color: var(--muted); }
.section-title { font-size: 28px; font-weight: 800; letter-spacing: -.5px; margin: 0; }
.img-cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.btn-accent { background: var(--accent); color: #fff; font-weight: 600; border-radius: 12px; height: 46px; padding: 0 22px; display: inline-flex; align-items: center; }
.btn-accent:hover { background: var(--accent-dark); color: #fff; }

/* --- Слайдер --- */
.hero { background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 1px 3px rgba(17,24,39,.06); }
/* Фото слайдера: фіксована висота, фото цілком, фон — розмита копія */
.hero-img {
  position: relative; display: flex; align-items: center; justify-content: center;
  height: 440px; overflow: hidden; background: #e9ebef;
}
.hero-img::before {
  content: ""; position: absolute; inset: -40px;
  background: var(--hero-bg) center / cover no-repeat;
  filter: blur(30px); opacity: .55;
}
.hero-img img { position: relative; display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; }

.hero-body { padding: 40px; height: 440px; display: flex; flex-direction: column; }
.hero-body h2 { font-size: 34px; line-height: 1.2; font-weight: 800; letter-spacing: -.5px; margin: 16px 0; }
.hero-body p { font-size: 17px; line-height: 1.6; color: var(--body); }
.hero { position: relative; }
.hero-controls { display: flex; align-items: center; justify-content: space-between; padding: 0 40px 36px; }
.hero-arrow:first-child { margin-left: 0; }
/* «Читати статтю» — посилання праворуч, у кольорі тексту */
.hero-link { margin-left: auto; font-weight: 600; font-size: 16px; color: var(--text); white-space: nowrap; }
.hero-link i { margin-left: 6px; transition: transform .2s; }
.hero-link:hover { color: var(--text); text-decoration: underline; }
.hero-link:hover i { transform: translateX(4px); }
@media (min-width: 992px) {
  .hero-body { padding-bottom: 120px; }   /* місце під кнопки */
  .hero-controls-wrap { position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; pointer-events: none; }
  .hero-controls { pointer-events: auto; }
}
.hero-arrow {
  width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border);
  background: #fff; color: var(--text); margin-left: 8px;
}
.hero-arrow:hover { border-color: var(--accent); color: var(--accent); }
.hero .carousel-item { transition: opacity .5s ease; }

/* --- Картки статей --- */
.post-card { background: #fff; border: 0; border-radius: var(--radius); overflow: hidden; height: 100%; }
.post-card .post-img { display: block; position: relative; height: 180px; }
.post-card .card-body { display: flex; flex-direction: column; padding: 18px 20px 22px; }
.post-card .card-title { font-size: 18px; line-height: 1.35; font-weight: 700; margin: 8px 0; }
.post-card .card-text { font-size: 15px; line-height: 1.55; color: var(--body); }
.post-card .meta { margin-top: auto; padding-top: 6px; font-size: 13px; }
.post-card .badge-on-img {
  position: absolute; top: 12px; left: 12px; background: #fff; color: var(--accent-dark);
  font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px;
}
.posts-latest .post-img { height: 150px; }

/* --- Рубрики-кнопки --- */
.rubric-btn {
  display: inline-flex; align-items: center; height: 44px; padding: 0 16px; margin: 0 10px 10px 0;
  border-radius: 12px; border: 1px solid var(--border); background: #fff;
  font-weight: 600; font-size: 15px; color: var(--text);
}
.rubric-btn .count {
  margin-left: 8px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--bg); color: var(--body); font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
}
.rubric-btn:hover { border-color: var(--accent); color: var(--accent-dark); }
.rubric-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.rubric-btn.active .count { background: rgba(255,255,255,.25); color: #fff; }

/* --- Хлібні крихти --- */
.breadcrumb { background: transparent; padding: 0; margin-bottom: 8px; font-size: 14px; }
.breadcrumb a, .breadcrumb-item.active { color: var(--muted); }

/* --- Стаття --- */
.article-title { font-size: 48px; line-height: 1.12; font-weight: 800; letter-spacing: -1.2px; margin: 4px 0 18px; }
.author-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: #dbe4ff; color: var(--accent-dark);
  font-weight: 700; display: inline-flex; align-items: center; justify-content: center; margin-right: 12px;
}
/* Головне фото: без обрізки, у власних пропорціях; поля — розмита копія фото */
.article-hero {
  position: relative; margin-top: 28px; border-radius: 20px; overflow: hidden;
  display: flex; justify-content: center; background: #e9ebef;
}
.article-hero::before {
  content: ""; position: absolute; inset: -40px;
  background: var(--hero-bg) center / cover no-repeat;
  filter: blur(30px); opacity: .55;
}
.article-hero img { position: relative; display: block; max-width: 100%; max-height: 720px; width: auto; height: auto; }
.article-body { background: #fff; border-radius: 20px; padding: 44px; font-size: 18px; line-height: 1.75; color: #374151; }
.article-body .lead-text { font-size: 20px; color: var(--text); }
.article-body h2 { font-size: 26px; line-height: 1.3; font-weight: 800; color: var(--text); margin: 32px 0 12px; scroll-margin-top: 20px; }
.article-body p { margin-bottom: 20px; }
.article-note { background: var(--accent-soft); border-radius: 14px; padding: 20px 24px; margin: 28px 0; color: #1e3a8a; font-weight: 500; }
.tags { border-top: 1px solid var(--border); padding-top: 20px; margin-top: 28px; }
.tag { display: inline-block; font-size: 14px; padding: 8px 14px; border-radius: 999px; background: var(--bg); margin: 0 8px 8px 0; }
.side-box { background: #fff; border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.side-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 12px; }
.toc a { display: block; font-size: 15px; margin-bottom: 10px; }
.popular-item { display: flex; align-items: center; margin-bottom: 16px; font-size: 14px; font-weight: 600; line-height: 1.4; }
.popular-item img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex: 0 0 64px; margin-right: 12px; }

/* --- Підвал --- */
.site-footer { background: #fff; border-top: 1px solid var(--border); margin-top: 64px; padding: 28px 0; font-size: 14px; color: var(--muted); }
.site-footer a { color: var(--muted); margin-left: 20px; }
.site-footer a:hover { color: var(--accent-dark); }

/* --- Адаптив --- */
@media (max-width: 991.98px) {
  .search-box { margin-top: 12px; }
  .search-box input { width: 100%; }
  .hero-img { height: 300px; }
  .hero-body { height: auto; }
  .hero-body { padding: 28px; }
  .hero-controls { padding: 0 28px 24px; }
}
@media (max-width: 575.98px) {
  .hero-body h2 { font-size: 26px; }
  .article-title { font-size: 32px; }
  .article-hero img { max-height: 70vh; }
  .article-body { padding: 24px; font-size: 17px; }
}

/* ===== Список статей ===== */
.page-title { font-size: 40px; font-weight: 800; letter-spacing: -1px; margin: 0 0 24px; }
.post-card .meta i { color: #9ca3af; }
.blog-pagination .page-link {
  min-width: 44px; height: 44px; margin: 0 4px; border-radius: 12px !important;
  border: 1px solid var(--border); color: var(--text); font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.blog-pagination .page-link:hover { border-color: var(--accent); color: var(--accent-dark); background: #fff; }
.blog-pagination .page-item.active .page-link { background: var(--accent); border-color: var(--accent); color: #fff; }
.blog-pagination .page-item.disabled .page-link { opacity: .45; }

/* ===== Сторінка статті ===== */
.article-anchor { position: relative; top: -20px; }
.article-body h3 { font-size: 22px; font-weight: 700; color: var(--text); margin: 28px 0 10px; }
.article-body h4, .article-body h5 { font-size: 19px; font-weight: 700; color: var(--text); margin: 24px 0 8px; }
.article-body ul, .article-body ol { padding-left: 22px; margin-bottom: 20px; }
.article-body li { margin-bottom: 6px; }
.article-body a { color: var(--accent-dark); text-decoration: underline; }
.article-body .table { font-size: 16px; margin-bottom: 24px; }
.article-body .table th { background: var(--bg); }
.article-adv { background: #fff7e6; color: #7c4a03; }
.article-figure { margin: 28px 0; }
.article-figure img { width: 100%; border-radius: 14px; display: block; }
.article-figure img + img { margin-top: 12px; }
.article-figure figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }
.toc a.active { color: var(--accent-dark); font-weight: 600; }
@media (min-width: 992px) { .toc { position: sticky; top: 20px; } }

/* Шапка статті: заголовок + інфо в один рядок */
.article-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; }
.article-head .article-title { margin: 0; flex: 0 1 auto; }
.article-info { display: flex; flex-wrap: wrap; gap: 6px 18px; white-space: nowrap; margin-left: auto; }

/* Низ статті: рубрика зліва, автор справа */
.article-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
  border-top: 1px solid var(--border); margin-top: 28px; padding-top: 20px; font-size: 16px;
}
.article-rubric { color: var(--muted); }
.article-rubric a { color: var(--accent-dark); font-weight: 600; text-decoration: none; }
.article-rubric a:hover { text-decoration: underline; }
.article-author { margin-left: auto; display: flex; align-items: center; font-weight: 600; color: var(--text); }

/* Роздільники між пунктами меню в шапці */
@media (min-width: 992px) {
  .site-header .navbar-nav .nav-item { display: flex; align-items: center; }
  .site-header .navbar-nav .nav-item + .nav-item::before {
    content: ""; width: 1px; height: 18px; background: var(--border); margin: 0 6px;
  }
}
