/* Агрокалендарь — базовые стили.
   Без внешних зависимостей и шрифтов: сайт должен открываться мгновенно
   и на слабом мобильном интернете в дачном посёлке. */

:root {
  --green-900: #14361a;
  --green-700: #1f5c2a;
  --green-600: #2a7a37;
  --green-500: #3d9c4a;
  --green-100: #e8f4ea;
  --green-50: #f3faf4;
  --earth: #7a5c34;
  --amber-600: #b4761a;
  --amber-100: #fdf3e0;
  --red-600: #b8332c;
  --red-100: #fdeceb;
  --ink: #1b2119;
  --ink-soft: #4a5448;
  --muted: #77806f;
  --line: #dfe6dc;
  --surface: #ffffff;
  --bg: #f7faf6;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 54, 26, .06), 0 6px 18px rgba(20, 54, 26, .05);
  --maxw: 1120px;
}

* { box-sizing: border-box; }

/* ---------- Мой огород ---------- */

.field { display: block; margin-bottom: 18px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

select, input[type="search"] {
  width: 100%;
  max-width: 420px;
  padding: 10px 12px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: inherit;
  font: inherit;
}

.garden-crops {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.garden-crop {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 6px;
  background: var(--surface-2);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.garden-crop:has(input:checked) { outline: 2px solid var(--accent); }
.garden-crop input { accent-color: var(--accent); margin: 0; }

.garden-status { font-size: 13px; color: var(--muted); min-height: 18px; }
.garden-status.is-ok { color: var(--good, #4ea672); }
.garden-status.is-error { color: var(--bad, #d95f4a); }

.garden-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.garden-card {
  padding: 14px 16px;
  border-radius: 9px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--surface);
}
.garden-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.garden-card-name { font-weight: 600; font-size: 16px; }
.garden-card-facts { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.garden-card-task { font-size: 14px; margin: 0; line-height: 1.5; }

@media (max-width: 560px) {
  .garden-grid { grid-template-columns: 1fr; }
}

/* Карточки задают display: flex, а это перебивает служебное правило браузера
   [hidden] { display: none } — авторские стили всегда сильнее пользовательских.
   Без этой строки фильтр по регионам и культурам молча не работает. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.62 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; color: var(--green-900); margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.25rem, 1.05rem + .8vw, 1.6rem); margin-top: 0; }
h3 { font-size: 1.1rem; }

p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
li { margin-bottom: .35em; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

.skip {
  position: absolute; left: -9999px;
  background: var(--green-700); color: #fff; padding: 10px 16px; z-index: 10;
}
.skip:focus { left: 8px; top: 8px; }

/* ---------- Шапка ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 10px; color: inherit; }
.brand:hover { text-decoration: none; }
.brand-mark { font-size: 1.6rem; line-height: 1; }
.brand-text { display: flex; flex-direction: column; }
.brand-text strong { color: var(--green-900); font-size: 1.12rem; }
.brand-text small { color: var(--muted); font-size: .78rem; }

.main-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.main-nav a { color: var(--ink-soft); font-weight: 500; font-size: .95rem; }
.main-nav a:hover { color: var(--green-700); }

/* ---------- Хлебные крошки ---------- */

.crumbs { margin: 14px auto 0; }
.crumbs ol {
  list-style: none; display: flex; flex-wrap: wrap; gap: 6px;
  padding: 0; margin: 0; font-size: .84rem; color: var(--muted);
}
.crumbs li.sep { color: var(--line); }
.crumbs a { color: var(--muted); }

main { padding: 22px 16px 56px; }
main > section { margin-bottom: 34px; }

/* ---------- Главная ---------- */

.hero {
  background: linear-gradient(160deg, var(--green-50), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 22px;
  box-shadow: var(--shadow);
}
.lead { font-size: 1.06rem; color: var(--ink-soft); max-width: 74ch; }
.hero-meta { color: var(--muted); font-size: .86rem; margin: 0; }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li {
  position: relative; padding-left: 44px; margin-bottom: 14px;
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--green-100); color: var(--green-700);
  font-weight: 700; display: grid; place-items: center; font-size: .9rem;
}

.cta {
  background: var(--green-100);
  border-radius: var(--radius);
  padding: 22px;
}

/* ---------- Поля и кнопки ---------- */

.filter-input {
  width: 100%; max-width: 460px;
  padding: 11px 14px; font-size: 1rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  margin-bottom: 18px;
}
.filter-input:focus { outline: 2px solid var(--green-500); outline-offset: 1px; border-color: var(--green-500); }

.button {
  display: inline-block; padding: 10px 18px;
  border-radius: var(--radius-sm); background: var(--surface);
  border: 1px solid var(--line); color: var(--green-700); font-weight: 600;
}
.button:hover { text-decoration: none; border-color: var(--green-500); }
.button.primary { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.button.primary:hover { background: var(--green-700); }

/* ---------- Сетки карточек ---------- */

.region-grid, .crop-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  margin-bottom: 16px;
}

.region-card, .crop-card {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 14px;
  color: inherit; transition: border-color .12s, transform .12s;
}
.region-card:hover, .crop-card:hover {
  text-decoration: none; border-color: var(--green-500); transform: translateY(-1px);
}
.region-name, .crop-name { font-weight: 600; color: var(--green-900); }
.region-city, .crop-extra { font-size: .84rem; color: var(--muted); }
.region-extra, .crop-level { font-size: .78rem; color: var(--green-600); margin-top: 4px; }

.crop-card.level-possible { border-left: 3px solid var(--amber-600); }
.crop-card.level-excellent { border-left: 3px solid var(--green-500); }

/* ---------- Статусные карточки ---------- */

.status-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin-bottom: 16px;
}
.status-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 13px 15px;
  display: flex; flex-direction: column; gap: 3px;
}
.status-label { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.status-value { font-size: 1.28rem; color: var(--green-900); }
.status-hint { font-size: .82rem; color: var(--muted); }

/* ---------- Уведомления ---------- */

.alert {
  border-radius: var(--radius-sm); padding: 12px 15px; margin-bottom: 18px;
  border: 1px solid; font-size: .95rem;
}
.alert-warn { background: var(--amber-100); border-color: #f0d9a8; color: #6b4a10; }
.alert-info { background: var(--green-50); border-color: #cbe4cf; color: var(--green-900); }

/* ---------- Списки работ ---------- */

.task-list { list-style: none; padding: 0; }
.task-list li {
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--green-500);
  border-radius: var(--radius-sm); padding: 11px 14px; margin-bottom: 8px;
}
.task-list li.task-weather { border-left-color: var(--amber-600); background: #fffdf8; }

.pest-list { list-style: none; padding: 0; }
.pest-list li {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 15px; margin-bottom: 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.pest-high { border-left: 3px solid var(--red-600); }
.pest-mid { border-left: 3px solid var(--amber-600); }
.pest-low { border-left: 3px solid var(--green-500); }
.pest-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pest-days { font-size: .85rem; color: var(--muted); }
.pest-action { font-size: .92rem; color: var(--ink-soft); }

/* ---------- Таблицы ---------- */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 12px; }

.data-table {
  width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: .92rem; min-width: 480px;
}
.data-table th, .data-table td {
  padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.data-table thead th {
  background: var(--green-50); color: var(--green-900);
  font-size: .82rem; text-transform: uppercase; letter-spacing: .03em;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #fbfdfb; }
.row-done { color: var(--muted); }

.t-cold { color: #1f6fa8; font-weight: 600; }
.t-warm { color: var(--green-700); font-weight: 600; }
.t-hot { color: var(--red-600); font-weight: 600; }

/* ---------- Метки ---------- */

.pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: .76rem; font-weight: 600; white-space: nowrap;
}
.pill.good { background: var(--green-100); color: var(--green-700); }
.pill.warn { background: var(--amber-100); color: var(--amber-600); }
.pill.bad { background: var(--red-100); color: var(--red-600); }
.pill.muted { background: #eef1ed; color: var(--muted); }

.progress {
  height: 8px; background: #e6ece4; border-radius: 999px; overflow: hidden;
  margin: 6px 0 12px;
}
.progress span { display: block; height: 100%; background: var(--green-500); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.chip {
  display: inline-block; padding: 6px 12px; font-size: .88rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; color: var(--green-700);
}
.chip:hover { text-decoration: none; border-color: var(--green-500); background: var(--green-50); }

.muted { color: var(--muted); }

/* ---------- FAQ ---------- */

.faq {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 15px; margin-bottom: 8px;
}
.faq summary { cursor: pointer; font-weight: 600; color: var(--green-900); }
.faq p { margin: 10px 0 0; color: var(--ink-soft); }

/* ---------- Подвал ---------- */

.site-footer {
  background: var(--green-900); color: #cfe0d2;
  margin-top: 40px; padding: 30px 0 22px; font-size: .9rem;
}
.site-footer a { color: #a9d3b0; }
.site-footer strong { color: #fff; display: block; margin-bottom: 6px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.footer-grid {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  margin-bottom: 20px;
}
.footer-meta {
  border-top: 1px solid rgba(255, 255, 255, .14);
  padding-top: 14px; margin: 0; color: #9db8a3; font-size: .84rem;
}

/* ---------- Мобильные ---------- */

@media (max-width: 640px) {
  .header-inner { gap: 10px; }
  .brand-text small { display: none; }
  .main-nav { gap: 14px; font-size: .9rem; }
  main { padding: 16px 14px 40px; }
  .hero { padding: 20px 16px; }
  .data-table { font-size: .86rem; }
  .data-table th, .data-table td { padding: 8px 9px; }
}
