:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --surface-soft: #f2f7f4;
  --text: #1f2933;
  --muted: #637381;
  --heading: #14213d;
  --green: #1f6f43;
  --green-soft: #e8f3ec;
  --border: #e5e7eb;
  --shadow: 0 18px 48px rgba(20, 33, 61, 0.08);
  --radius: 22px;
  --container: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.container { width: min(var(--container), calc(100% - 36px)); margin: 0 auto; }
.skip-link { position: absolute; left: -999px; top: 12px; background: var(--heading); color: #fff; padding: 10px 14px; border-radius: 12px; z-index: 99; }
.skip-link:focus { left: 12px; }

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(250, 250, 247, 0.88); backdrop-filter: blur(14px); border-bottom: 1px solid rgba(229, 231, 235, 0.8); }
.header-inner { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: var(--heading); }
.logo { height: 48px; width: auto; }
.brand-fallback { display: none; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a { padding: 10px 14px; border-radius: 999px; color: var(--muted); font-weight: 650; font-size: .94rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--green-soft); color: var(--green); }
.nav-toggle { display: none; width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--heading); margin: 4px auto; }

.hero-section { padding: 74px 0 54px; background: radial-gradient(circle at 15% 10%, rgba(31,111,67,.12), transparent 32%), linear-gradient(180deg, #fff, var(--bg)); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(320px, .72fr); gap: 34px; align-items: center; }
.category-pill { display: inline-flex; width: max-content; align-items: center; padding: 7px 12px; border-radius: 999px; color: var(--green); background: var(--green-soft); font-weight: 800; font-size: .84rem; }
h1, h2 { color: var(--heading); line-height: 1.14; letter-spacing: -0.035em; }
h1 { font-size: clamp(2.2rem, 5vw, 4.25rem); margin: 16px 0 18px; }
.hero-copy p { font-size: clamp(1.02rem, 2vw, 1.2rem); max-width: 680px; color: var(--muted); margin: 0; }
.hero-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero-stats span { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 10px 14px; box-shadow: 0 8px 22px rgba(20,33,61,.05); }
.hero-stats strong { color: var(--green); }
.hero-panel { padding: 28px; border-radius: var(--radius); background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow); }
.hero-panel h2 { margin: 0 0 18px; font-size: 1.45rem; }
.problem-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.problem-tags a { padding: 10px 13px; border-radius: 999px; background: var(--surface-soft); border: 1px solid rgba(31,111,67,.14); color: var(--text); font-weight: 700; font-size: .9rem; }
.problem-tags a:hover { background: var(--green); color: #fff; }

.featured-section, .article-index-section, .consult-section { padding: 52px 0; }
.section-head { margin-bottom: 22px; }
.section-head > span { display: block; color: var(--green); font-weight: 850; font-size: .86rem; margin-bottom: 6px; }
.section-head h2 { margin: 0; font-size: clamp(1.55rem, 3vw, 2.35rem); }
.row-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }

.featured-card { display: grid; grid-template-columns: minmax(0, .9fr) minmax(320px, 1fr); gap: 0; overflow: hidden; background: #fff; border: 1px solid var(--border); border-radius: 28px; box-shadow: var(--shadow); }
.featured-image { min-height: 310px; background: var(--surface-soft); }
.featured-image img { width: 100%; height: 100%; object-fit: cover; }
.featured-body { padding: clamp(24px, 4vw, 42px); display: flex; flex-direction: column; justify-content: center; }
.article-category { display: inline-flex; width: max-content; padding: 6px 10px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-weight: 800; font-size: .78rem; }
.featured-body h2, .article-card h2 { margin: 12px 0 10px; }
.featured-body h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
.featured-body p, .article-card p { margin: 0; color: var(--muted); }
.card-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; color: var(--muted); font-size: .88rem; }
.card-meta span { padding: 5px 9px; border-radius: 999px; background: #f7f8f8; }
.primary-link, .read-more { display: inline-flex; width: max-content; margin-top: 22px; color: var(--green); font-weight: 850; }
.primary-link:hover, .read-more:hover { text-decoration: underline; }

.filter-wrap { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.filter-btn { border: 1px solid var(--border); background: #fff; color: var(--muted); padding: 9px 12px; border-radius: 999px; font-weight: 750; cursor: pointer; white-space: nowrap; }
.filter-btn.active, .filter-btn:hover { background: var(--green); color: #fff; border-color: var(--green); }
.article-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.article-card {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 18px;
  align-items: stretch;
  padding: 16px;
  background: #fff;
  border: 1px solid rgba(20, 33, 61, 0.08);
  border-radius: 24px;
  box-shadow: 0 12px 32px rgba(20,33,61,.06);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.article-card:hover {
  transform: translateY(-3px);
  border-color: rgba(31,111,67,.22);
  box-shadow: var(--shadow);
}

.article-card.is-hidden {
  display: none;
}

.article-thumb {
  display: block;
  width: 168px;
  height: 132px;
  border-radius: 16px;
  background: var(--surface-soft);
  overflow: hidden;
}

.article-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .24s ease;
}

.article-card:hover .article-thumb img {
  transform: scale(1.035);
}

.article-card-body {
  min-width: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.article-card-title,
.article-card h2 {
  margin: 8px 0 8px;
  font-size: clamp(1.05rem, 1.7vw, 1.22rem);
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.article-card-title a,
.article-card h2 a {
  color: var(--heading);
  text-decoration: none;
}

.article-card-title a:hover,
.article-card h2 a:hover {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.article-summary,
.article-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: .94rem;
  line-height: 1.58;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card .card-meta {
  margin-top: auto;
  gap: 8px 10px;
  font-size: .82rem;
}

.article-card .read-more {
  margin-top: 12px;
  font-size: .92rem;
}

.consult-box { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 34px; border-radius: 28px; background: linear-gradient(135deg, var(--green-soft), #fff); border: 1px solid rgba(31,111,67,.16); box-shadow: var(--shadow); }
.consult-box h2 { font-size: clamp(1.45rem, 3vw, 2.2rem); margin: 10px 0; }
.consult-box p { margin: 0; color: var(--muted); max-width: 640px; }
.consult-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.consult-link { display: inline-flex; align-items: center; justify-content: center; padding: 12px 16px; border-radius: 999px; font-weight: 850; color: #fff; min-width: 120px; }
.consult-link.telegram { background: #2788c8; }
.consult-link.whatsapp { background: #1f9d55; }

.empty-state { padding: 34px; border-radius: 24px; background: #fff; border: 1px solid var(--border); }
.empty-state code { background: #f4f4f5; border-radius: 8px; padding: 2px 6px; }
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; background: #fff; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: .92rem; }
.footer-inner p { margin: 0; }
.footer-inner a { color: var(--green); font-weight: 750; }

@media (max-width: 900px) {
  .hero-grid, .featured-card { grid-template-columns: 1fr; }
  .article-grid { grid-template-columns: 1fr; }
  .article-card { grid-template-columns: 156px 1fr; }
  .article-thumb { width: 156px; height: 124px; }
  .row-head { align-items: flex-start; flex-direction: column; }
  .consult-box { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 720px) {
  .header-inner { min-height: 66px; }
  .nav-toggle { display: block; }
  .site-nav { position: absolute; top: 66px; left: 18px; right: 18px; display: none; flex-direction: column; align-items: stretch; padding: 10px; background: #fff; border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); }
  .site-nav.is-open { display: flex; }
  .site-nav a { border-radius: 12px; }
  .hero-section { padding: 48px 0 36px; }
  .hero-panel, .consult-box { padding: 22px; }
  .article-card {
    grid-template-columns: 112px 1fr;
    gap: 13px;
    padding: 13px;
    border-radius: 18px;
  }
  .article-thumb {
    width: 112px;
    height: 96px;
    border-radius: 13px;
  }
  .article-category {
    font-size: .72rem;
    padding: 4px 8px;
    margin-bottom: 0;
  }
  .article-card-title,
  .article-card h2 {
    font-size: .98rem;
    line-height: 1.32;
    margin: 6px 0;
  }
  .article-summary,
  .article-card p {
    font-size: .84rem;
    line-height: 1.45;
    -webkit-line-clamp: 2;
    margin-bottom: 8px;
  }
  .article-card .card-meta {
    font-size: .74rem;
    gap: 5px 8px;
  }
  .article-card .read-more {
    margin-top: 8px;
    font-size: .84rem;
  }
  .featured-image { min-height: 220px; }
  .footer-inner { flex-direction: column; }
}


/* Pagination for automatic article index */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 34px;
}

.page-link,
.page-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: .9rem;
}

.page-link {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--muted);
  box-shadow: 0 8px 20px rgba(20,33,61,.04);
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}

.page-link:hover,
.page-link.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  transform: translateY(-1px);
}

.page-link-wide {
  padding-inline: 18px;
}

.page-dots {
  color: var(--muted);
  min-width: auto;
  padding-inline: 4px;
}

@media (max-width: 560px) {
  .pagination {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }

  .page-link,
  .page-dots {
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    font-size: .84rem;
    flex: 0 0 auto;
  }
}
