/* ================================================================
   Агроионит — таблица стилей
   ================================================================ */

:root {
  --brand:        #2f7d4f;
  --brand-dark:   #1b5133;
  --brand-darker: #123522;
  --brand-soft:   #eaf4ec;
  --accent:       #8ec63f;

  --bg:        #ffffff;
  --surface:   #f5f8f4;
  --surface-2: #eef3ec;
  --text:      #17251d;
  --muted:     #5c6b62;
  --border:    #dfe7de;

  --radius:    14px;
  --radius-lg: 22px;
  --shadow:    0 1px 2px rgba(20,50,32,.05), 0 8px 24px rgba(20,50,32,.06);
  --shadow-lg: 0 2px 6px rgba(20,50,32,.06), 0 18px 48px rgba(20,50,32,.12);

  --container: 1180px;
  --header-h:  72px;

  --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 20px); }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .6em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 1.15rem + 1.5vw, 2.1rem); }
h3 { font-size: clamp(1.15rem, 1rem + .6vw, 1.4rem); }
p  { margin: 0 0 1.1em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 820px; }

.section { padding: clamp(48px, 6vw, 88px) 0; }
.section--tint { background: var(--surface); }
.section__head { max-width: 720px; margin-bottom: 36px; }
.section__head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section__head p { color: var(--muted); font-size: 1.05rem; margin: 0; }

.eyebrow {
  display: inline-block; margin-bottom: 12px;
  font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--brand);
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 24px; border-radius: 999px; border: 1.5px solid transparent;
  font-size: .98rem; font-weight: 600; cursor: pointer;
  transition: transform .15s ease, background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(47,125,79,.28); }
.btn--primary:hover { background: var(--brand-dark); color: #fff; }
.btn--ghost { border-color: rgba(255,255,255,.6); color: #fff; }
.btn--ghost:hover { background: rgba(255,255,255,.14); color: #fff; border-color: #fff; }
.btn--outline { border-color: var(--border); color: var(--text); background: #fff; }
.btn--outline:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- Шапка ---------- */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header__inner { display: flex; align-items: center; gap: 20px; min-height: var(--header-h); }

.logo { display: flex; align-items: center; gap: 12px; flex-shrink: 0; color: var(--text); }
.logo img { width: 42px; height: auto; }
.logo b { display: block; font-size: 1.16rem; letter-spacing: .02em; line-height: 1.1; }
.logo span { display: block; font-size: .7rem; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }

.nav { margin-left: auto; }
.nav > ul { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav li { position: relative; }
.nav a {
  display: block; padding: 10px 14px; border-radius: 10px;
  color: var(--text); font-size: .95rem; font-weight: 500; white-space: nowrap;
}
.nav a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.nav a.is-active { color: var(--brand); font-weight: 700; }
.nav .has-sub > a::after {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 8px;
  border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.nav .sub {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 260px;
  list-style: none; margin: 0; padding: 8px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.nav .has-sub:hover .sub, .nav .has-sub:focus-within .sub { opacity: 1; visibility: visible; transform: translateY(0); }
.nav .sub a { font-size: .92rem; padding: 9px 12px; white-space: normal; }

.header__cta { flex-shrink: 0; }
.header__cta .btn { padding: 10px 20px; font-size: .9rem; }

.burger {
  display: none; margin-left: auto; width: 44px; height: 44px;
  border: 1px solid var(--border); border-radius: 12px; background: #fff;
  cursor: pointer; padding: 0; position: relative;
}
.burger span, .burger::before, .burger::after {
  content: ""; position: absolute; left: 12px; right: 12px; height: 2px;
  background: var(--text); border-radius: 2px; transition: .22s ease;
}
.burger span  { top: 21px; }
.burger::before { top: 14px; }
.burger::after  { top: 28px; }
body.nav-open .burger span { opacity: 0; }
body.nav-open .burger::before { top: 21px; transform: rotate(45deg); }
body.nav-open .burger::after  { top: 21px; transform: rotate(-45deg); }

/* ---------- Герой ---------- */
.hero { position: relative; overflow: hidden; background: var(--brand-darker); }
.hero__slides { position: absolute; inset: 0; }
.hero__slide {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1.4s ease;
}
.hero__slide.is-on { opacity: 1; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, rgba(12,40,24,.92) 0%, rgba(12,40,24,.75) 45%, rgba(12,40,24,.35) 100%);
}
.hero__inner { position: relative; z-index: 2; padding: clamp(64px, 9vw, 128px) 0; max-width: 730px; color: #fff; }
.hero h1 { color: #fff; margin-bottom: .35em; }
.hero__tag {
  display: inline-block; margin-bottom: 20px; padding: 7px 16px; border-radius: 999px;
  background: rgba(142,198,63,.18); border: 1px solid rgba(142,198,63,.45);
  color: #cbe89a; font-size: .8rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
}
.hero__lead { font-size: clamp(1.02rem, .95rem + .4vw, 1.2rem); color: rgba(255,255,255,.88); max-width: 620px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.hero__dots { position: absolute; z-index: 3; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; gap: 9px; }
.hero__dots button {
  width: 9px; height: 9px; padding: 0; border-radius: 50%; cursor: pointer;
  border: none; background: rgba(255,255,255,.4); transition: .2s;
}
.hero__dots button.is-on { background: #fff; width: 26px; border-radius: 999px; }

/* ---------- Плитки быстрых ссылок ---------- */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: -46px; position: relative; z-index: 5; }
.quick__item {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 24px; box-shadow: var(--shadow); color: var(--text);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.quick__item:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: rgba(47,125,79,.35); color: var(--text); }
.quick__ico {
  width: 46px; height: 46px; border-radius: 13px; margin-bottom: 14px;
  display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-dark);
}
.quick__ico svg { width: 24px; height: 24px; }
.quick__item h3 { margin-bottom: 6px; font-size: 1.1rem; }
.quick__item p { margin: 0; font-size: .93rem; color: var(--muted); }

/* ---------- Сетки карточек ---------- */
.grid { display: grid; gap: 22px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.card {
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  color: var(--text); box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: rgba(47,125,79,.35); color: var(--text); }
.card__media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card__media img { transform: scale(1.05); }
.card__body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.card__body h3 { margin-bottom: 8px; }
.card__body p { margin: 0; color: var(--muted); font-size: .94rem; }
.card__more { margin-top: 16px; font-weight: 600; font-size: .92rem; color: var(--brand); }
.card__more::after { content: " \2192"; }

/* ---------- Показатели ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.stat {
  padding: 26px 22px; border-radius: var(--radius-lg);
  background: #fff; border: 1px solid var(--border);
}
.stat b { display: block; font-size: clamp(1.8rem, 1.3rem + 1.6vw, 2.5rem); color: var(--brand); line-height: 1.05; letter-spacing: -.02em; }
.stat span { display: block; margin-top: 8px; color: var(--muted); font-size: .93rem; }

/* ---------- Двухколоночный блок ---------- */
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(28px, 5vw, 60px); align-items: center; }
.split__media img { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; }
.split ul { padding-left: 0; list-style: none; margin: 0 0 1.4em; }
.split ul li { position: relative; padding-left: 30px; margin-bottom: 11px; }
.split ul li::before {
  content: ""; position: absolute; left: 0; top: .55em; width: 16px; height: 9px;
  border-left: 2.5px solid var(--brand); border-bottom: 2.5px solid var(--brand);
  transform: rotate(-45deg);
}

/* ---------- Услуги ---------- */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; list-style: none; padding: 0; margin: 0; }
.services li {
  display: flex; gap: 14px; align-items: flex-start;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; font-size: .96rem;
}
.services li::before {
  content: ""; flex: 0 0 auto; width: 10px; height: 10px; margin-top: .45em;
  border-radius: 3px; background: var(--accent);
}

/* ---------- Новость ---------- */
.news { display: flex; gap: 18px; align-items: flex-start; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; }
.news__date {
  flex: 0 0 auto; width: 66px; text-align: center; padding: 10px 0;
  background: var(--brand); color: #fff; border-radius: var(--radius);
}
.news__date b { display: block; font-size: 1.5rem; line-height: 1; }
.news__date span { font-size: .78rem; opacity: .9; }
.news p { margin: 0; }

/* ---------- Полоса призыва ---------- */
.cta {
  background: linear-gradient(120deg, var(--brand-dark), var(--brand));
  color: #fff; border-radius: var(--radius-lg); padding: clamp(32px, 5vw, 56px);
  display: flex; flex-wrap: wrap; gap: 26px; align-items: center; justify-content: space-between;
}
.cta h2 { color: #fff; margin-bottom: .3em; }
.cta p { margin: 0; color: rgba(255,255,255,.85); max-width: 560px; }
.cta .btn--primary { background: #fff; color: var(--brand-dark); box-shadow: none; }
.cta .btn--primary:hover { background: #f0f7f1; color: var(--brand-darker); }

/* ---------- Шапка внутренней страницы ---------- */
.pagehead { background: var(--brand-darker); color: #fff; position: relative; overflow: hidden; }
.pagehead__bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .32; }
.pagehead::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(12,40,24,.94), rgba(12,40,24,.62)); }
.pagehead__inner { position: relative; z-index: 2; padding: clamp(40px, 6vw, 76px) 0; }
.pagehead h1 { color: #fff; margin-bottom: .25em; max-width: 900px; }
.pagehead p { color: rgba(255,255,255,.82); margin: 0; max-width: 700px; }

.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .85rem; margin-bottom: 16px; color: rgba(255,255,255,.6); }
.crumbs a { color: rgba(255,255,255,.82); }
.crumbs a:hover { color: #fff; }
.crumbs span::before { content: "/"; margin-right: 8px; opacity: .5; }

/* ---------- Текст статьи ---------- */
.layout { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: clamp(30px, 5vw, 58px); align-items: start; }

.prose { font-size: 1.04rem; }
.prose h2 { margin-top: 1.8em; }
.prose h3 { margin-top: 1.5em; }
.prose img { border-radius: var(--radius-lg); box-shadow: var(--shadow); margin: 0 0 26px; }
.prose figure { margin: 0 0 28px; }
.prose figure.float { float: right; width: min(360px, 42%); margin: 4px 0 22px 30px; }
.prose ul { list-style: none; padding: 0; margin: 0 0 1.5em; }
.prose ul li { position: relative; padding-left: 28px; margin-bottom: 10px; }
.prose ul li::before {
  content: ""; position: absolute; left: 2px; top: .62em; width: 8px; height: 8px;
  border-radius: 50%; background: var(--accent);
}
.prose .listlead { font-weight: 700; color: var(--brand-dark); margin-bottom: .7em; }
.prose .lead { font-size: 1.14rem; color: #223a2c; }
.prose blockquote {
  margin: 0 0 1.5em; padding: 20px 24px; border-left: 4px solid var(--accent);
  background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; color: #2c4436;
}
.prose blockquote p:last-child { margin: 0; }

.sidebar { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 20px; }
.sidebar__box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; }
.sidebar__box h3 { font-size: 1.02rem; margin-bottom: 14px; }
.sidebar__box ul { list-style: none; margin: 0; padding: 0; }
.sidebar__box li + li { border-top: 1px solid var(--border); }
.sidebar__box li a { display: block; padding: 10px 0; font-size: .93rem; color: var(--text); }
.sidebar__box li a:hover, .sidebar__box li a.is-active { color: var(--brand); }
.sidebar__box li a.is-active { font-weight: 700; }

.pager { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; margin-top: 50px; padding-top: 26px; border-top: 1px solid var(--border); }
.pager a { max-width: 46%; font-weight: 600; }
.pager a small { display: block; font-weight: 500; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.pager .next { text-align: right; margin-left: auto; }

/* ---------- Контакты ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.contact-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow); }
.contact-card .quick__ico { margin-bottom: 16px; }
.contact-card h3 { font-size: 1.05rem; margin-bottom: 10px; }
.contact-card p, .contact-card a { margin: 0 0 6px; font-size: 1rem; display: block; }

.note { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius-lg); padding: clamp(28px,4vw,44px); text-align: center; }
.note h2 { margin-bottom: .4em; }
.note p { color: var(--muted); margin: 0 auto; max-width: 560px; }

/* ---------- Подвал ---------- */
.footer { background: var(--brand-darker); color: rgba(255,255,255,.75); padding: 56px 0 26px; }
.footer a { color: rgba(255,255,255,.75); }
.footer a:hover { color: #fff; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 34px; }
.footer h4 { color: #fff; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 16px; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 9px; font-size: .94rem; }
.footer .logo { color: #fff; margin-bottom: 16px; }
.footer .logo span { color: rgba(255,255,255,.55); }
.footer__about { font-size: .94rem; margin: 0; max-width: 320px; }
.footer__bottom {
  margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.14);
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; font-size: .85rem; color: rgba(255,255,255,.55);
}

/* ---------- Кнопка «наверх» ---------- */
.totop {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--brand); color: #fff; box-shadow: var(--shadow-lg);
  display: grid; place-items: center; opacity: 0; visibility: hidden;
  transition: opacity .25s, visibility .25s, transform .2s;
}
.totop.is-on { opacity: 1; visibility: visible; }
.totop:hover { transform: translateY(-3px); }
.totop svg { width: 20px; height: 20px; }

/* ---------- Адаптив ---------- */
@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .quick { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .services { grid-template-columns: repeat(2, 1fr); }
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .header__cta { display: none; }
  .burger { display: block; }
  .nav {
    position: fixed; inset: var(--header-h) 0 0; margin: 0; background: #fff;
    padding: 18px 20px 60px; overflow-y: auto;
    transform: translateX(100%); transition: transform .28s ease; visibility: hidden;
  }
  body.nav-open { overflow: hidden; }
  body.nav-open .nav { transform: translateX(0); visibility: visible; }
  .nav > ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav a { padding: 13px 12px; font-size: 1.02rem; border-radius: 10px; }
  .nav .has-sub > a::after { float: right; margin-top: 8px; }
  .nav .sub {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: none; border-left: 2px solid var(--border);
    border-radius: 0; margin: 2px 0 6px 14px; padding: 0 0 0 6px;
  }
  .nav .sub a { font-size: .95rem; padding: 10px 10px; }
  .split { grid-template-columns: 1fr; }
  .split__media { order: -1; }
  .prose figure.float { float: none; width: 100%; margin: 0 0 24px; }
}

@media (max-width: 680px) {
  body { font-size: 16px; }
  .grid--2, .grid--3, .grid--4, .quick, .stats, .services, .contact-grid, .footer__grid { grid-template-columns: 1fr; }
  .quick { margin-top: -28px; }
  .cta { text-align: center; justify-content: center; }
  .cta p { margin: 0 auto; }
  .pager a { max-width: 100%; }
  .logo span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
