/*! HTML5 Boilerplate v9.0.1 | MIT License | https://html5boilerplate.com/ */

/* main.css 3.0.0 | MIT License | https://github.com/h5bp/main.css#readme */
/*
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

html {
  color: #222;
  font-size: 1em;
  line-height: 1.4;
}

/*
 * Remove text-shadow in selection highlight:
 * https://twitter.com/miketaylr/status/12228805301
 *
 * Customize the background color to match your design.
 */

::-moz-selection {
  background: #b3d4fc;
  text-shadow: none;
}

::selection {
  background: #b3d4fc;
  text-shadow: none;
}

/*
 * A better looking default horizontal rule
 */

hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid #ccc;
  margin: 1em 0;
  padding: 0;
}

/*
 * Remove the gap between audio, canvas, iframes,
 * images, videos and the bottom of their containers:
 * https://github.com/h5bp/html5-boilerplate/issues/440
 */

audio,
canvas,
iframe,
img,
svg,
video {
  vertical-align: middle;
}

/*
 * Remove default fieldset styles.
 */

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
  resize: vertical;
}

/* ==========================================================================
   Author's custom styles
   ========================================================================== */

/* ==========================================================================
   Helper classes
   ========================================================================== */

/*
 * Hide visually and from screen readers
 */

.hidden,
[hidden] {
  display: none !important;
}

/*
 * Hide only visually, but have it available for screen readers:
 * https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
 *
 * 1. For long content, line feeds are not interpreted as spaces and small width
 *    causes content to wrap 1 word per line:
 *    https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
 */

.visually-hidden {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
  /* 1 */
}

/*
 * Extends the .visually-hidden class to allow the element
 * to be focusable when navigated to via the keyboard:
 * https://www.drupal.org/node/897638
 */

.visually-hidden.focusable:active,
.visually-hidden.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  white-space: inherit;
  width: auto;
}

/*
 * Hide visually and from screen readers, but maintain layout
 */

.invisible {
  visibility: hidden;
}

/*
 * Clearfix: contain floats
 *
 * The use of `table` rather than `block` is only necessary if using
 * `::before` to contain the top-margins of child elements.
 */

.clearfix::before,
.clearfix::after {
  content: "";
  display: table;
}

.clearfix::after {
  clear: both;
}

/* ==========================================================================
   EXAMPLE Media Queries for Responsive Design.
   These examples override the primary ('mobile first') styles.
   Modify as content requires.
   ========================================================================== */

@media only screen and (min-width: 35em) {
  /* Style adjustments for viewports that meet the condition */
}

@media print,
  (-webkit-min-device-pixel-ratio: 1.25),
  (min-resolution: 1.25dppx),
  (min-resolution: 120dpi) {
  /* Style adjustments for high resolution devices */
}

/* ==========================================================================
   Print styles.
   Inlined to avoid the additional HTTP request:
   https://www.phpied.com/delay-loading-your-print-css/
   ========================================================================== */

@media print {
  *,
  *::before,
  *::after {
    background: #fff !important;
    color: #000 !important;
    /* Black prints faster */
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  abbr[title]::after {
    content: " (" attr(title) ")";
  }

  /*
   * Don't show links that are fragment identifiers,
   * or use the `javascript:` pseudo protocol
   */
  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  pre {
    white-space: pre-wrap !important;
  }

  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}

/* --- ПЕРЕМЕННЫЕ --- */
:root {
  --primary-green: #2E5C38;
  --secondary-green: #1F4027;
  --light-bg: #F4F7F5;
  --text-dark: #333333;
  --text-light: #666666;
  --white: #ffffff;
  --header-height: 70px; /* Фиксированная высота шапки */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Roboto', sans-serif;
  color: var(--text-dark);
  line-height: 1.6;
  background-color: var(--white);
  padding-top: var(--header-height); /* Компенсация фиксированной шапки */
}

h1, h2, h3 { font-family: 'Merriweather', serif; color: var(--primary-green); margin-bottom: 20px; }
a { text-decoration: none; color: inherit; transition: 0.3s; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- КНОПКИ --- */
.btn {
  display: inline-block;
  padding: 10px 25px;
  background-color: var(--primary-green);
  color: var(--white);
  border-radius: 4px;
  font-weight: 500;
  text-transform: uppercase;
  font-size: 14px;
  border: 2px solid var(--primary-green);
  text-align: center;
}
.btn:hover { background-color: var(--secondary-green); border-color: var(--secondary-green); }
.btn-outline { background: transparent; color: var(--primary-green); }
.btn-outline:hover { background: var(--primary-green); color: var(--white); }

/* --- ШАПКА (ОБНОВЛЕННАЯ) --- */
header {
  background-color: var(--white);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  position: fixed; /* Фиксируем шапку */
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  font-family: 'Merriweather', serif;
  color: var(--primary-green);
  white-space: nowrap; /* Логотип в одну строку */
  z-index: 1001;
}

/* Навигация для десктопа */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 25px;
}

.nav-menu ul {
  list-style: none;
  display: flex;
  gap: 25px;
  align-items: center;
}

.nav-menu a {
  font-size: 13px; /* Чуть меньше шрифт, чтобы вместить длинные названия */
  text-transform: uppercase;
  font-weight: 500;
  color: var(--text-dark);
  max-width: 200px; /* Ограничение ширины для очень длинных пунктов на десктопе */
  text-align: center;
  display: block;
}

.nav-menu a:hover { color: var(--primary-green); }

/* Гамбургер (иконка) */
.hamburger {
  display: none;
  cursor: pointer;
  z-index: 1001;
}

.bar {
  display: block;
  width: 25px;
  height: 3px;
  margin: 5px auto;
  transition: all 0.3s ease-in-out;
  background-color: var(--text-dark);
}

/* --- МОБИЛЬНАЯ ВЕРСИЯ (МЕДИА-ЗАПРОС) --- */
@media (max-width: 992px) {
  /* Скрываем меню и кнопку "Поддержать" в мобильной версии по умолчанию */
  .hamburger {
    display: block;
  }

  .nav-menu {
    position: fixed;
    left: -100%;
    top: 0;
    flex-direction: column;
    background-color: var(--white);
    width: 100%;
    height: 100vh; /* Меню на весь экран */
    padding-top: 80px; /* Отступ сверху, чтобы не наезжать на лого */
    transition: 0.3s;
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
    overflow-y: auto; /* Прокрутка внутри меню, если много пунктов */
    justify-content: flex-start;
    gap: 0;
  }

  .nav-menu.active {
    left: 0; /* Выезжает слева */
  }

  .nav-menu ul {
    flex-direction: column;
    width: 100%;
    gap: 0;
  }

  .nav-menu ul li {
    width: 100%;
    border-bottom: 1px solid #eee;
  }

  .nav-menu a {
    display: block;
    padding: 20px;
    font-size: 16px; /* Крупнее для пальца */
    max-width: 100%; /* Разрешаем длинные тексты */
    text-align: left; /* Длинные названия лучше читать слева */
    line-height: 1.4;
  }

  /* Кнопка "Поддержать" внутри мобильного меню */
  .nav-menu .btn {
    margin: 20px;
    width: calc(100% - 40px);
    display: block;
  }

  /* Анимация гамбургера */
  .hamburger.active .bar:nth-child(2) { opacity: 0; }
  .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

/* --- ГЛАВНЫЙ ЭКРАН --- */
.hero {
  background: linear-gradient(rgba(46, 92, 56, 0.9), rgba(46, 92, 56, 0.8)), url('/img/hero.jpg');
  background-size: cover;
  background-position: center;
  color: var(--white);
  padding: 80px 0;
  text-align: center;
  /* Высота экрана минус шапка, чтобы смотрелось красиво */
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
}

.hero-content { width: 100%; }
.hero h1 { color: var(--white); font-size: 36px; line-height: 1.3; }
.hero p { font-size: 18px; max-width: 700px; margin: 0 auto 40px; opacity: 0.9; }

.hero .btn {
  background-color: var(--white);
  color: var(--primary-green);
  border-color: var(--white);
}

/* --- ОСТАЛЬНЫЕ СТИЛИ (БЕЗ ИЗМЕНЕНИЙ) --- */
section { padding: 60px 0; }
.section-title { text-align: center; margin-bottom: 40px; }
.section-title h2 { font-size: 28px; position: relative; display: inline-block; }
.section-title h2::after { content: ''; display: block; width: 60px; height: 3px; background-color: var(--primary-green); margin: 15px auto 0; }

.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.about-image { background-color: #ddd; height: 300px; border-radius: 4px; background-image: url('/img/about-image.jpg'); background-size: cover; background-position: center; }

.bg-light { background-color: var(--light-bg); }
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.service-card { background: var(--white); padding: 30px; border-top: 4px solid var(--primary-green); box-shadow: 0 4px 6px rgba(0,0,0,0.05); }

.stats-container { display: flex; justify-content: space-around; flex-wrap: wrap; text-align: center; }
.stat-item { margin: 20px; width: 150px; }
.stat-number { font-size: 42px; font-weight: 700; color: var(--primary-green); font-family: 'Merriweather', serif; }

footer { background-color: var(--secondary-green); color: var(--white); padding: 50px 0 20px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; margin-bottom: 30px; }
.footer-col h4 { margin-bottom: 15px; color: #bdcfc1; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; text-align: center; font-size: 12px; color: rgba(255,255,255,0.5); }

/* --- ДОП. АДАПТИВНОСТЬ --- */
@media (max-width: 768px) {
  .about-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 28px; }
}

