/* Blog styles — match the landing's Forest Green / Montserrat language. */

/* ---- Header on light backgrounds ----
   The landing header is built for the dark hero overlay (white text).
   On blog pages we have a white page, so we recolor the header to dark
   text + a soft frosted background, while keeping the Hi-Client identity. */
body.blog-page { color: #0f172a; background: #ffffff; }

body.blog-page .header {
  margin-top: 0;
  padding: 10px 0;
  /* Sleek dark theme on blog — easier on the eyes than the bright green
     gradient when reading long articles. */
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 2px 8px -4px rgba(0, 0, 0, 0.4);
  position: sticky;
  top: 0;
  z-index: 50;
}

body.blog-page .header__wrapper { align-items: center; }

/* Pull the logo glyph up so the stack reads tighter inside the slim header. */
body.blog-page .header .logo__wrapper { gap: 2px; }
body.blog-page .header .logo img { transform: translateY(-2px); }
body.blog-page .header .text__logo { font-size: 16px; line-height: 1; }

body.blog-page .menu {
  padding-bottom: 0;
  border-bottom: none;
}

/* All text/icons inside the green header become white. */
body.blog-page .menu__link { color: #ffffff; }
body.blog-page .menu__link:hover { opacity: 0.78; color: #ffffff; }

body.blog-page .text__logo { color: #ffffff; }

/* Phone + account icons turn white on the dark header. The clip-hand logo
   keeps its native green gradient — it reads as the brand mark on black. */
body.blog-page .header .phone__wrapper img,
body.blog-page .header .account__wrapper img {
  filter: brightness(0) invert(1);
}
body.blog-page .header .logo img { filter: none; }

body.blog-page .phone__link {
  color: #ffffff;
  font-weight: 600;
}
body.blog-page .text-opacity {
  color: rgba(255, 255, 255, 0.72);
  font-weight: 500;
}
body.blog-page .account__link {
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
}
body.blog-page .phone__wrapper:hover .phone__link,
body.blog-page .phone__wrapper:hover .text-opacity { color: #ecfdf5; }
body.blog-page .account__wrapper:hover .account__link {
  color: #ecfdf5;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.7);
  text-underline-offset: 3px;
}

/* The first <main> on blog pages should not collide with the sticky header. */
body.blog-page .blog-main { padding-top: 56px; }

/* Footer keeps its original white-on-green look — undo the body's dark text
   color so labels like "Hi Client" / "Информация:" / phone don't go black. */
body.blog-page .footer,
body.blog-page .footer .footer__logo-text,
body.blog-page .footer .footer__list-title,
body.blog-page .footer .footer__phone-link,
body.blog-page .footer .footer__email-link { color: #ffffff; }

/* ---- Legal docs typography ---- */
.docs-article {
  max-width: 820px;
  margin: 0 auto;
  /* horizontal padding ≥ 16px so the body text never touches the edge on mobile */
  padding: 32px 20px 64px;
}
.docs-content {
  font-size: 16px;
  line-height: 1.7;
  color: #1e293b;
}
.docs-content h1 {
  font-family: Montserrat, sans-serif;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 800;
  line-height: 1.25;
  color: #0f172a;
  margin: 0 0 12px;
  letter-spacing: -0.2px;
}
.docs-content .docs-lead {
  font-size: 17px;
  color: #475569;
  margin: 0 0 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e2e8f0;
}
.docs-content h2 {
  font-family: Montserrat, sans-serif;
  font-size: clamp(17px, 2.2vw, 19px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #0f172a;
  margin: 36px 0 14px;
  line-height: 1.3;
}
.docs-content h3 {
  font-family: Montserrat, sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin: 24px 0 10px;
}
.docs-content p { margin: 0 0 14px; }
.docs-content p strong { color: #0f172a; }
.docs-content ul, .docs-content ol { padding-left: 24px; margin: 0 0 14px; }
.docs-content li { margin-bottom: 6px; }
.docs-content a {
  color: #15803d;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.docs-content a:hover { color: #047857; }

/* ---- Article CTA: same primary button as the landing ---- */
.blog-article__cta {
  margin: 48px auto 0;
  padding: 32px 28px;
  background: linear-gradient(135deg, rgba(2,188,77,0.06) 0%, rgba(241,245,249,0.6) 100%);
  border: 1px solid rgba(2, 188, 77, 0.2);
  border-radius: 16px;
  text-align: center;
}
.blog-article__cta-title {
  font-family: Montserrat, sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 8px;
  line-height: 1.3;
}
.blog-article__cta-lead {
  color: #475569;
  margin: 0 0 22px;
  font-size: 15px;
}
.blog-article__cta .btn__primary {
  display: inline-flex;
  padding: 14px 36px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 10px;
  color: #ffffff;
}

.blog-main {
  background: #ffffff;
  color: #0f172a;
  padding: 80px 0 100px;
  min-height: 60vh;
}

.blog-main--article {
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 280px);
}

.blog-hero {
  text-align: center;
  margin-bottom: 56px;
}

.blog-hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 13px;
  font-weight: 700;
  color: #16a34a;
  margin-bottom: 12px;
}

.blog-hero__title {
  font-family: Montserrat, sans-serif;
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 800;
  line-height: 1.2;
  color: #0f172a;
  margin-bottom: 16px;
}

.blog-hero__lead {
  font-size: 17px;
  line-height: 1.6;
  color: #475569;
  max-width: 720px;
  margin: 0 auto;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

.blog-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px -16px rgba(15, 23, 42, 0.18);
  border-color: rgba(2, 188, 77, 0.4);
}

.blog-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.blog-card__cover {
  aspect-ratio: 16 / 9;
  background: #f1f5f9;
  overflow: hidden;
}

.blog-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.blog-card:hover .blog-card__cover img {
  transform: scale(1.04);
}

.blog-card__cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #16a34a 0%, #047857 100%);
  color: rgba(255, 255, 255, 0.85);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 1px;
}

.blog-card__body {
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
}

.blog-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.blog-card__tag {
  font-size: 12px;
  font-weight: 600;
  color: #15803d;
  background: rgba(2, 188, 77, 0.08);
  padding: 3px 10px;
  border-radius: 999px;
}

.blog-card__title {
  font-family: Montserrat, sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: #0f172a;
  margin: 4px 0 0;
}

.blog-card__excerpt {
  font-size: 15px;
  line-height: 1.55;
  color: #64748b;
  flex: 1;
}

.blog-card__meta {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: #94a3b8;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
}

.blog-empty {
  text-align: center;
  padding: 60px 24px;
  color: #64748b;
  background: #f8fafc;
  border-radius: 16px;
}

.blog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-top: 56px;
  font-size: 15px;
}

.blog-pagination__link {
  color: #15803d;
  font-weight: 600;
  text-decoration: none;
}
.blog-pagination__link:hover { text-decoration: underline; }
.blog-pagination__current { color: #64748b; }

/* ---- Category chips (news) ---- */

.blog-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 28px;
}

.blog-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #0f172a;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
.blog-category:hover { background: #e0fbe9; color: #166534; }
.blog-category--active { background: #02BC4D; color: #ffffff; }
.blog-category--active .blog-category__count { color: rgba(255, 255, 255, 0.85); }
.blog-category__count { font-size: 12px; color: #64748b; font-weight: 600; }

/* ---- Article ---- */

.blog-article {
  max-width: 760px;
  margin: 0 auto;
}

.blog-article__back {
  margin-bottom: 16px;
}
.blog-article__back a {
  color: #15803d;
  font-weight: 600;
  text-decoration: none;
}
.blog-article__back a:hover { text-decoration: underline; }

.blog-article__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.blog-article__tag {
  font-size: 13px;
  font-weight: 600;
  color: #15803d;
  background: rgba(2, 188, 77, 0.08);
  padding: 4px 12px;
  border-radius: 999px;
  text-decoration: none;
}
.blog-article__tag:hover { background: rgba(2, 188, 77, 0.16); }

.blog-article__title {
  font-family: Montserrat, sans-serif;
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 800;
  line-height: 1.2;
  color: #0f172a;
  margin: 0 0 16px;
}

.blog-article__meta {
  display: flex;
  gap: 16px;
  font-size: 14px;
  color: #64748b;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid #e2e8f0;
}

.blog-article__author { font-weight: 600; color: #475569; }

.blog-article__cover {
  margin: 0 0 36px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 32px -12px rgba(15, 23, 42, 0.18);
}
.blog-article__cover img {
  width: 100%;
  height: auto;
  display: block;
}

.blog-article__content { font-size: 17px; line-height: 1.75; color: #1e293b; }
.blog-article__content > * + * { margin-top: 18px; }
.blog-article__content h2 {
  font-family: Montserrat, sans-serif;
  font-size: 28px;
  font-weight: 800;
  margin: 40px 0 16px;
  line-height: 1.25;
  color: #0f172a;
}
.blog-article__content h3 {
  font-family: Montserrat, sans-serif;
  font-size: 22px;
  font-weight: 700;
  margin: 32px 0 12px;
  line-height: 1.3;
  color: #0f172a;
}
.blog-article__content p { margin: 0 0 18px; }
.blog-article__content ul,
.blog-article__content ol { padding-left: 24px; margin: 0 0 18px; }
.blog-article__content li { margin-bottom: 8px; }
.blog-article__content a {
  color: #15803d;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.blog-article__content a:hover { color: #047857; }
.blog-article__content blockquote {
  margin: 24px 0;
  padding: 16px 24px;
  border-left: 4px solid #16a34a;
  background: #f0fdf4;
  border-radius: 8px;
  color: #475569;
  font-style: italic;
}
.blog-article__content code {
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.92em;
  color: #b91c1c;
}
.blog-article__content pre {
  background: #0f172a;
  color: #f1f5f9;
  padding: 16px 20px;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
}
.blog-article__content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}
.blog-article__content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 8px 0;
  display: block;
}

.blog-article__footer {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid #e2e8f0;
  text-align: center;
}

@media (max-width: 600px) {
  .blog-main { padding: 56px 0 72px; }
  .blog-grid { gap: 20px; }
  .blog-article__title { font-size: 28px; }
  .blog-article__content { font-size: 16px; }
}
