/* ============ ПОДКЛЮЧЕНИЕ ШРИФТОВ ============ */
@font-face {
  font-family: 'LT Superior';
  src: url('fonts/LTSuperior-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'LT Superior';
  src: url('fonts/LTSuperior-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Balloon';
  src: url('fonts/BalloonXBdTL-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Zurich';
  src: url('fonts/ZurichWGL4BT-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ============ ОБНУЛЕНИЕ И ПЕРЕМЕННЫЕ ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green: #557D3E;
  --green-dark: #5a8540;
  --green-light: #e8efe0;
  --brown: #9C6A37;
  --brown-light: #f5efe6;
  --cream: #F8F4F1;
  --white: #ffffff;
  --text: #2c2c2c;
  --text-muted: #6b6b6b;
  --border: #e5e0d8;
  --danger: #b7472a;
  --danger-bg: #fdf3f0;
  --success: #4a7c59;
  --success-bg: #f0f7f2;
  --gold: #f5d97a;
  --cream-light: #f0ede4;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Zurich', Georgia, serif;
  background-color: var(--cream);
  color: var(--text);
  line-height: 1.7;
  font-weight: 400;
  font-size: 17px;
}

/* ============ ФОНОВЫЙ СЛОЙ СТРАНИЦЫ ============ */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--cream);
  background-image: url('images/page-bg.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  pointer-events: none;
}

/* ============ БАННЕР ============ */
.hero {
  position: relative;
  padding: 50px 20px 45px;
  text-align: center;
  background-color: var(--green-dark);
  background-image: url('images/hero-bg.jpg');
  background-size: cover;
  background-position: center 40%;
  background-repeat: no-repeat;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(63, 94, 44, 0.4) 0%,
    rgba(63, 94, 44, 0.3) 50%,
    rgba(63, 94, 44, 0.45) 100%
  );
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* H1 — золотисто-песочный */
.hero h1 {
  font-family: 'Balloon', Georgia, serif;
  font-size: clamp(3em, 6vw, 4.6em);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.1;
  margin-bottom: 10px;
  color: var(--gold);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6);
  animation: fadeUp 0.8s ease-out both;
}

/* Подзаголовок — светло-кремовый */
.hero p {
  font-family: 'Zurich', Georgia, serif;
  font-size: clamp(1.2em, 2.2vw, 1.4em);
  margin-bottom: 20px;
  color: var(--cream-light);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.6);
  animation: fadeUp 0.8s ease-out 0.15s both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============ ЦИТАТЫ УЧЁНЫХ ============ */
.hero-quotes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 20px 0 24px;
  text-align: left;
  animation: fadeUp 0.8s ease-out 0.25s both;
}

.quote-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.quote-portrait {
  flex-shrink: 0;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.7);
  background: #e8e5de;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.quote-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Текст цитаты — золотисто-песочный */
.quote-text {
  font-family: 'Balloon', Georgia, serif;
  font-size: 1.4em;
  line-height: 1.4;
  color: var(--gold);
  margin-bottom: 8px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7), 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Имя учёного — тоже золотисто-песочный, жирный */
.quote-author {
  font-family: 'LT Superior', Georgia, serif;
  font-size: 1.1em;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8), 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* Должность — светло-кремовый */
.quote-author span {
  font-weight: 400;
  color: var(--cream-light);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7), 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* ============ ПОИСК ============ */
.search-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
  animation: fadeUp 0.8s ease-out 0.4s both;
}

.icon-search {
  width: 58px;
  height: 58px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 560px;
}

#search {
  width: 100%;
  padding: 17px 56px 17px 28px;
  border: none;
  background: #fff;
  border-radius: 30px;
  font-size: 1.1em;
  font-family: 'LT Superior', Georgia, serif;
  color: var(--text);
  outline: none;
  transition: box-shadow 0.25s;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.15);
}

#search::placeholder { color: #999; font-size: 0.95em; }

#search:focus {
  box-shadow: 0 4px 24px rgba(85, 125, 62, 0.35), 0 0 0 3px var(--green-light);
}

.clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: none;
  background: #e8e5de;
  color: #555;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.clear-btn:hover { background: var(--green); color: #fff; }
.clear-btn.visible { display: flex; }

.results-count {
  margin-top: 10px;
  font-size: 0.95em;
  font-family: 'LT Superior', Georgia, serif;
  color: var(--cream-light);
  letter-spacing: 0.05em;
  min-height: 1.2em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

/* ============ ФИЛЬТРЫ ============ */
.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.filter-btn {
  padding: 10px 22px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  border-radius: 20px;
  cursor: pointer;
  font-size: 1em;
  font-family: 'LT Superior', Georgia, serif;
  transition: all 0.25s;
}

.filter-btn:hover {
  border-color: var(--green);
  color: var(--green);
}

.filter-btn.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  font-weight: 700;
}

/* ============ ОСНОВНОЙ КОНТЕНТ ============ */
main { max-width: 1200px; margin: 0 auto; padding: 40px 24px 60px; }

section { margin-bottom: 60px; }

section h2 {
  font-family: 'Balloon', Georgia, serif;
  color: var(--green-dark);
  font-size: clamp(1.8em, 3.5vw, 2.4em);
  font-weight: 400;
  margin-bottom: 24px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--green-light);
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
}

.icon-arrow {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}

section h2::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: var(--green);
}

/* ============ КУЛЬТУРЫ ============ */
.culture-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 18px;
}

.culture-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  text-align: center;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.culture-card:hover {
  transform: translateY(-5px);
  border-color: var(--green);
  box-shadow: 0 12px 30px rgba(85, 125, 62, 0.12);
}

.culture-card.active {
  border-color: var(--green);
  box-shadow: 0 0 0 2px var(--green-light), 0 12px 30px rgba(85, 125, 62, 0.15);
}

.culture-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.culture-card span {
  display: block;
  padding: 12px 8px;
  font-family: 'LT Superior', Georgia, serif;
  font-weight: 700;
  font-size: 1.05em;
  color: var(--green-dark);
}

/* ============ БОЛЕЗНИ ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 26px;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 0 20px 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--green);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.card h3 {
  font-family: 'LT Superior', Georgia, serif;
  color: var(--green-dark);
  font-size: 1.45em;
  font-weight: 700;
  margin: 18px 20px 8px;
  line-height: 1.25;
}

.crops {
  font-family: 'Zurich', Georgia, serif;
  font-size: 1em;
  color: var(--text-muted);
  margin: 0 20px 14px;
}

.crops strong { color: var(--brown); font-weight: 700; }

.symptoms {
  background: var(--danger-bg);
  border-left: 3px solid var(--danger);
  border-radius: 0 8px 8px 0;
  margin: 0 20px 12px;
  padding: 13px 15px;
  font-family: 'Zurich', Georgia, serif;
  font-size: 1.02em;
}

.symptoms strong {
  font-family: 'LT Superior', Georgia, serif;
  color: var(--danger);
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 0.95em;
  letter-spacing: 0.04em;
}

.symptoms ul { margin-left: 18px; }
.symptoms li { margin-bottom: 5px; color: #444; }

.treatment {
  background: var(--success-bg);
  border-left: 3px solid var(--success);
  border-radius: 0 8px 8px 0;
  margin: 0 20px;
  padding: 13px 15px;
  font-family: 'Zurich', Georgia, serif;
  font-size: 1.02em;
}

.treatment strong {
  font-family: 'LT Superior', Georgia, serif;
  color: var(--success);
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 0.95em;
  letter-spacing: 0.04em;
}

.treatment p { color: #444; }

.source {
  font-family: 'Zurich', Georgia, serif;
  font-size: 0.8em;
  color: #999;
  font-style: italic;
  margin: 14px 20px 0;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.empty-msg {
  text-align: center;
  font-size: 1.2em;
  color: var(--text-muted);
  padding: 40px 20px;
  font-style: italic;
  font-family: 'Zurich', Georgia, serif;
}

/* ============ АНИМАЦИЯ ПОЯВЛЕНИЯ ============ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============ ХОВЕР КАРТОЧЕК С REVEAL — ФИКС КОНФЛИКТА ============ */
.culture-card.reveal,
.card.reveal {
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s, opacity 0.6s ease-out;
}

.culture-card.reveal.visible:hover {
  transform: translateY(-5px);
}

.card.reveal.visible:hover {
  transform: translateY(-4px);
}

/* ============ ФУТЕР ============ */
footer {
  background: var(--green-dark);
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  padding: 35px 20px;
  font-family: 'Zurich', Georgia, serif;
  font-size: 1em;
}

footer p { margin: 5px 0; }
footer p:first-child {
  color: #fff;
  font-family: 'LT Superior', Georgia, serif;
  font-weight: 700;
}

/* ============ ПЛАНШЕТ ============ */
@media (max-width: 900px) {
  .hero-quotes {
    grid-template-columns: 1fr;
    gap: 18px;
    max-width: 620px;
    margin: 18px auto 22px;
  }
}

/* ============ МОБИЛЬНАЯ АДАПТАЦИЯ ============ */
@media (max-width: 700px) {
  body { font-size: 16px; }
  .hero { padding: 38px 14px 34px; background-position: center 30%; }
  .hero-inner { padding: 0 6px; }
  .hero h1 { font-size: 2.2em; margin-bottom: 8px; }
  .hero p { font-size: 1.05em; margin-bottom: 16px; line-height: 1.45; }
  .hero-quotes { gap: 14px; margin: 16px auto 20px; }
  .quote-item { gap: 12px; }
  .quote-portrait { width: 52px; height: 52px; }
  .quote-text { font-size: 1.15em; line-height: 1.4; margin-bottom: 5px; }
  .quote-author { font-size: 0.98em; }

  .search-block { gap: 10px; max-width: 100%; }
  .icon-search { width: 48px; height: 48px; }
  .search-wrap { max-width: 100%; }
  #search { padding: 14px 50px 14px 22px; font-size: 1em; }
  .clear-btn { width: 34px; height: 34px; font-size: 18px; }

  .filters { padding: 16px 12px; gap: 6px; }
  .filter-btn { padding: 9px 16px; font-size: 0.92em; }

  section h2 { font-size: 1.6em; gap: 10px; }
  .icon-arrow { width: 36px; height: 36px; }

  .culture-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .culture-card img { height: 105px; }
  .culture-card span { font-size: 1em; }

  .grid { grid-template-columns: 1fr; gap: 20px; }
  .card h3 { font-size: 1.3em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}