/* Brew Guide — основные стили. Токены и структура — см. PROJECT.md. */

:root {
  --brew-bg: #FBF3E7;
  --brew-bg-alt: #F6E9D8;
  --brew-accent: #C1622D;
  --brew-accent-hover: #A34E22;
  --brew-ink: #2E1D13;
  --brew-ink-soft: #4A3527;
  --brew-text: #5C4030;
  --brew-text-strong: #3D2B1F;
  --brew-muted: #8B6449;
  --brew-border: #EEE0CC;
  --brew-border-soft: #E9D6BC;
  --brew-tag-bg: #F1E1CB;
  --brew-tag-text: #8A4B22;
  --brew-footer-text: #C9AE8E;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--brew-bg);
  font-family: 'Nunito', sans-serif;
  color: var(--brew-ink);
  text-wrap: pretty;
}

a { color: var(--brew-accent); }
a:hover { color: var(--brew-accent-hover); }
img { max-width: 100%; display: block; }
input[type=range] { accent-color: var(--brew-accent); }

.site-wrap { min-height: 100vh; display: flex; flex-direction: column; }

/* ------------------------------------------------------------------
 * Шапка
 * ------------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 243, 231, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--brew-border-soft);
}
.site-header__inner {
  position: relative;
  max-width: 1280px; margin: 0 auto; padding: 0 32px; height: 76px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.site-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.site-logo__text { font-family: 'Lora', serif; font-size: 21px; font-weight: 700; color: var(--brew-ink); }

.site-nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.nav-link {
  padding: 10px 14px; border-radius: 999px; font-size: 15px; font-weight: 600;
  color: var(--brew-ink-soft); text-decoration: none; cursor: pointer; display: inline-block;
}
.nav-link:hover { background: var(--brew-tag-bg); }
.nav-link--accent {
  padding: 10px 16px; font-weight: 700; color: #FFFFFF; background: var(--brew-accent);
  margin-left: 6px;
}
.nav-link--accent:hover { background: var(--brew-accent-hover); }

.nav-item { position: relative; }
.nav-dropdown {
  position: absolute; top: 100%; left: 0; background: #FFFFFF;
  border: 1px solid var(--brew-border-soft); border-radius: 16px; padding: 8px; min-width: 220px;
  box-shadow: 0 12px 32px rgba(46, 29, 19, .14);
  display: none; flex-direction: column; gap: 1px; z-index: 60;
}
.nav-item--dropdown:hover .nav-dropdown,
.nav-item--dropdown.is-open .nav-dropdown { display: flex; }
.nav-dropdown a { padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--brew-ink); font-size: 14px; }
.nav-dropdown a:hover { background: var(--brew-bg); }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--brew-ink); display: block; }

/* ------------------------------------------------------------------
 * Кнопки, бейджи
 * ------------------------------------------------------------------ */
.btn {
  display: inline-block; padding: 15px 28px; border-radius: 999px; text-decoration: none;
  font-weight: 700; font-size: 16px;
}
.btn--dark { background: var(--brew-ink); color: var(--brew-bg); }
.btn--dark:hover { background: var(--brew-ink-soft); }
.btn--outline { background: transparent; border: 2px solid var(--brew-ink); color: var(--brew-ink); }
.btn--outline:hover { background: var(--brew-tag-bg); }

.badge {
  display: inline-block; padding: 7px 16px; border-radius: 999px;
  background: var(--brew-tag-bg); color: var(--brew-tag-text); font-size: 14px; font-weight: 700;
  margin-bottom: 22px;
}
.tag {
  font-size: 12.5px; font-weight: 700; color: var(--brew-accent);
  text-transform: uppercase; letter-spacing: .04em; display: inline-block;
}
.tag--soon {
  background: var(--brew-tag-bg); color: var(--brew-tag-text); font-size: 12px;
  padding: 4px 10px; border-radius: 999px; text-transform: none; letter-spacing: normal; font-weight: 700;
}

/* ------------------------------------------------------------------
 * Плейсхолдер вместо фото (в макете реальных фото не было)
 * ------------------------------------------------------------------ */
.thumb, .thumb--placeholder { width: 100%; height: 100%; }
.thumb__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb--placeholder {
  background: var(--brew-tag-bg); display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 8px; color: var(--brew-tag-text); text-align: center; padding: 16px;
}
.thumb__icon { font-size: 40px; }
.thumb__label { font-size: 14px; font-weight: 600; max-width: 85%; }

/* ------------------------------------------------------------------
 * Секции — общая обвязка
 * ------------------------------------------------------------------ */
.section { padding: 64px 32px; }
.section--alt { background: var(--brew-bg-alt); }
.section--hero-narrow { padding: 56px 32px 8px; text-align: center; }
.section__inner { max-width: 1280px; margin: 0 auto; }
.section__inner--narrow { max-width: 1080px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 32px; flex-wrap: wrap; gap: 12px; }
.section__head--center { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section__title { font-family: 'Lora', serif; font-size: 34px; font-weight: 700; margin: 0 0 12px; color: var(--brew-ink); }
.section__lead { font-size: 17px; color: var(--brew-text); margin: 0; }
.section__more { color: var(--brew-accent); font-weight: 700; text-decoration: none; font-size: 15px; }

.page-title { font-family: 'Lora', serif; font-size: 38px; font-weight: 700; margin: 16px 0 12px; color: var(--brew-ink); }
.page-lead { font-size: 17px; line-height: 1.6; color: var(--brew-text); margin: 0 0 8px; }
.back-link { color: var(--brew-muted); text-decoration: none; font-size: 14.5px; font-weight: 700; }
.back-link:hover { color: var(--brew-accent); }

/* ------------------------------------------------------------------
 * Hero (главная)
 * ------------------------------------------------------------------ */
.hero {
  max-width: 1280px; margin: 0 auto; padding: 72px 32px 40px;
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center;
}
.hero__title { font-family: 'Lora', serif; font-size: 52px; line-height: 1.12; font-weight: 700; margin: 0 0 22px; color: var(--brew-ink); }
.hero__lead { font-size: 19px; line-height: 1.6; color: var(--brew-text); margin: 0 0 32px; max-width: 520px; }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero__media { width: 100%; height: 420px; border-radius: 28px; overflow: hidden; min-width: 0; }

/* ------------------------------------------------------------------
 * Карточки уровня («Выбери свой уровень»)
 * ------------------------------------------------------------------ */
.level-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.level-card { background: #FFFFFF; border-radius: 24px; padding: 30px; border: 1px solid var(--brew-border); }
.level-card__icon {
  width: 52px; height: 52px; border-radius: 16px; background: var(--brew-tag-bg);
  display: flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 18px;
}
.level-card__title { font-family: 'Lora', serif; font-size: 21px; font-weight: 700; margin: 0 0 8px; color: var(--brew-ink); }
.level-card__text { font-size: 15px; color: var(--brew-text); margin: 0 0 18px; line-height: 1.5; }
.level-card__links { display: flex; flex-direction: column; gap: 10px; }
.level-card__links a {
  text-decoration: none; color: var(--brew-ink); font-size: 14.5px; font-weight: 600;
  padding: 10px 0; border-top: 1px solid var(--brew-tag-bg);
}
.level-card__links a:hover { color: var(--brew-accent); }

/* ------------------------------------------------------------------
 * Калькуляторы — тизер и карточки
 * ------------------------------------------------------------------ */
.calc-teaser { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.calc-card {
  text-decoration: none; display: block; background: #FFFFFF; border-radius: 24px;
  padding: 32px; border: 1px solid var(--brew-border); color: inherit;
}
.calc-card--soon { opacity: .7; }
.calc-card__icon {
  width: 52px; height: 52px; border-radius: 16px; background: var(--brew-tag-bg);
  display: flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 18px;
}
.calc-card__title { font-family: 'Lora', serif; font-size: 22px; font-weight: 700; margin: 0 0 10px; color: var(--brew-ink); }
.calc-card__head-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.calc-card__head-row .calc-card__title { margin: 0; }
.calc-card__text { font-size: 15px; color: var(--brew-text); margin: 0 0 18px; line-height: 1.5; }
.calc-card__link { color: var(--brew-accent); font-weight: 700; font-size: 15px; }

/* ------------------------------------------------------------------
 * Статьи — карточки и сетка
 * ------------------------------------------------------------------ */
.articles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.article-card {
  text-decoration: none; color: inherit; background: #FFFFFF; border-radius: 20px; overflow: hidden;
  border: 1px solid var(--brew-border); display: flex; flex-direction: column; min-width: 0;
}
.article-card:hover { box-shadow: 0 8px 24px rgba(46, 29, 19, .08); }
.article-card .thumb, .article-card .thumb--placeholder { height: 180px; }
.article-card__body { padding: 20px; }
.article-card__title { font-family: 'Lora', serif; font-size: 18px; font-weight: 700; margin: 8px 0 8px; color: var(--brew-ink); line-height: 1.3; }
.article-card__excerpt { font-size: 14px; color: var(--brew-text); margin: 0 0 12px; line-height: 1.5; }
.article-card__meta { font-size: 13px; color: var(--brew-muted); }

.pagination { margin-top: 40px; text-align: center; }
.pagination a, .pagination span {
  display: inline-block; padding: 8px 14px; margin: 0 4px; border-radius: 999px;
  text-decoration: none; color: var(--brew-ink); border: 1px solid var(--brew-border);
}

/* ------------------------------------------------------------------
 * Об авторе
 * ------------------------------------------------------------------ */
.about-author { display: grid; grid-template-columns: .8fr 1.2fr; gap: 56px; align-items: center; }
.about-author__media { width: 100%; height: 340px; border-radius: 28px; overflow: hidden; min-width: 0; }
.about-author__name { font-size: 20px; font-weight: 800; margin: 0 0 10px; color: var(--brew-ink); }
.about-author__bio { font-size: 16px; line-height: 1.6; color: var(--brew-text); margin: 0 0 20px; max-width: 560px; }
.about-author__badges { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.about-author__badge {
  padding: 8px 16px; border-radius: 999px; background: #FFFFFF; border: 1px solid var(--brew-border);
  font-size: 14px; font-weight: 700; color: var(--brew-ink-soft);
}
.about-author__socials { display: flex; gap: 16px; }
.about-author__socials a { color: var(--brew-ink); font-weight: 700; text-decoration: none; }
.about-author__socials a:hover { color: var(--brew-accent); }
.about-author__body > .section__more { display: inline-block; margin-top: 22px; }

/* ------------------------------------------------------------------
 * Калькулятор напитков — интерактив
 * ------------------------------------------------------------------ */
.calculator { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; align-items: start; }
.calc-panel { background: #FFFFFF; border-radius: 24px; padding: 32px; border: 1px solid var(--brew-border); }
.calc-panel__label {
  font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  color: var(--brew-muted); margin: 0 0 14px;
}
.calc-methods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 28px; }
.calc-method-btn {
  padding: 12px 14px; border-radius: 14px; font-size: 14.5px; font-weight: 700; cursor: pointer;
  text-align: center; border: 2px solid var(--brew-border); background: var(--brew-bg-alt);
  color: var(--brew-ink-soft); transition: background .15s;
}
.calc-method-btn.is-active { background: var(--brew-ink); color: var(--brew-bg); border-color: var(--brew-ink); }
.calc-strength { display: flex; gap: 10px; margin-bottom: 28px; }
.calc-strength-btn {
  flex: 1; padding: 12px 14px; border-radius: 14px; font-size: 14.5px; font-weight: 700; cursor: pointer;
  text-align: center; border: 2px solid var(--brew-border); background: var(--brew-bg-alt); color: var(--brew-ink-soft);
}
.calc-strength-btn.is-active { background: var(--brew-accent); color: #FFFFFF; border-color: var(--brew-accent); }
.calc-volume { display: flex; align-items: center; gap: 16px; }
.calc-volume input[type=range] { flex: 1; }
.calc-volume__value { font-family: 'Lora', serif; font-size: 20px; font-weight: 700; color: var(--brew-ink); min-width: 80px; text-align: right; }

.calc-result { background: var(--brew-ink); border-radius: 24px; padding: 32px; color: var(--brew-bg); position: sticky; top: 96px; }
.calc-result__label { font-size: 13px; font-weight: 700; color: var(--brew-footer-text); text-transform: uppercase; letter-spacing: .05em; }
.calc-result__values { margin: 20px 0; display: flex; flex-direction: column; gap: 16px; }
.calc-result__num { font-family: 'Lora', serif; font-size: 40px; font-weight: 700; }
.calc-result__unit { font-size: 14px; color: var(--brew-footer-text); }
.calc-result__ratio { padding: 14px 16px; background: rgba(255, 255, 255, .08); border-radius: 14px; font-size: 14px; font-weight: 700; margin-bottom: 18px; }
.calc-result__tip { font-size: 14.5px; line-height: 1.6; color: #E4CBAA; margin: 0; }

/* ------------------------------------------------------------------
 * Статья (single.php)
 * ------------------------------------------------------------------ */
.article { max-width: 760px; margin: 0 auto; padding: 56px 32px 96px; width: 100%; }
.article .badge { margin-bottom: 18px; }
.article__title { font-family: 'Lora', serif; font-size: 40px; font-weight: 700; line-height: 1.15; margin: 0 0 18px; color: var(--brew-ink); }
.article__meta { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; font-size: 14.5px; color: var(--brew-muted); }
.article__hero { width: 100%; height: 380px; border-radius: 24px; overflow: hidden; margin-bottom: 36px; }
.article__hero-img { width: 100%; height: 100%; object-fit: cover; }

.article__content .lead { font-size: 18px; line-height: 1.75; color: var(--brew-text-strong); margin: 0 0 24px; }
.article__content p { font-size: 17px; line-height: 1.75; color: var(--brew-text-strong); margin: 0 0 20px; }
.article__content h2 { font-family: 'Lora', serif; font-size: 24px; font-weight: 700; margin: 36px 0 16px; color: var(--brew-ink); }
.article__content ul { font-size: 16.5px; line-height: 1.8; color: var(--brew-text-strong); padding-left: 22px; margin: 0 0 32px; }
.article__content .steps { display: flex; flex-direction: column; gap: 22px; margin-bottom: 32px; }
.article__content .step { display: flex; gap: 16px; }
.article__content .step__num {
  width: 32px; height: 32px; border-radius: 999px; background: var(--brew-ink); color: var(--brew-bg);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.article__content .step h3 { font-size: 17px; font-weight: 700; margin: 0 0 6px; color: var(--brew-ink); }
.article__content .step p { font-size: 16px; line-height: 1.7; color: var(--brew-text); margin: 0; }
.article__content blockquote.tip {
  background: var(--brew-bg-alt); border-radius: 20px; padding: 24px; margin: 0 0 32px; border-left: none;
}
.article__content blockquote.tip p { font-size: 15.5px; line-height: 1.65; color: var(--brew-text); margin: 0; }
.article__content blockquote.tip strong { color: var(--brew-tag-text); }

/* ------------------------------------------------------------------
 * Простые страницы (легальные, контакты)
 * ------------------------------------------------------------------ */
.page-simple { max-width: 760px; margin: 0 auto; padding: 56px 32px 96px; }
.page-simple__title { font-family: 'Lora', serif; font-size: 34px; font-weight: 700; color: var(--brew-ink); margin: 0 0 24px; }
.page-simple__content p { font-size: 16.5px; line-height: 1.75; color: var(--brew-text); margin: 0 0 20px; }

/* ------------------------------------------------------------------
 * Футер
 * ------------------------------------------------------------------ */
.site-footer { background: var(--brew-ink); color: #F3E6D5; padding: 64px 32px 32px; margin-top: auto; }
.site-footer__cols { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
.footer-col--brand { max-width: 280px; }
.footer-logo { font-family: 'Lora', serif; font-size: 20px; font-weight: 700; color: var(--brew-bg); }
.footer-tagline { font-size: 14.5px; line-height: 1.6; color: var(--brew-footer-text); margin: 12px 0 0; }
.footer-col__title { font-size: 14px; font-weight: 700; color: var(--brew-bg); margin: 0 0 16px; text-transform: uppercase; letter-spacing: .04em; }
.footer-col a { display: block; color: var(--brew-footer-text); text-decoration: none; font-size: 14.5px; margin-bottom: 10px; }
.footer-col a:hover { color: #FFFFFF; }
.site-footer__bottom {
  max-width: 1280px; margin: 32px auto 0; padding-top: 24px; border-top: 1px solid var(--brew-ink-soft);
  font-size: 13.5px; color: var(--brew-muted);
}

/* ------------------------------------------------------------------
 * Адаптив
 * ------------------------------------------------------------------ */
@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0; background: var(--brew-bg);
    border-bottom: 1px solid var(--brew-border-soft); flex-direction: column; align-items: stretch;
    padding: 12px; display: none; gap: 4px;
  }
  .site-nav.is-open { display: flex; }
  .nav-item--dropdown:hover .nav-dropdown { display: none; }
  .nav-item--dropdown.is-open .nav-dropdown {
    display: flex; position: static; box-shadow: none; border: none; padding-left: 12px; margin-top: 2px;
  }
}

@media (max-width: 960px) {
  .hero, .about-author, .calculator { grid-template-columns: 1fr; }
  .level-cards, .articles-grid { grid-template-columns: repeat(2, 1fr); }
  .calc-teaser { grid-template-columns: 1fr; }
  .site-footer__cols { grid-template-columns: 1fr 1fr; }
  .calc-result { position: static; }
}

@media (max-width: 640px) {
  .level-cards, .articles-grid, .calc-methods { grid-template-columns: 1fr; }
  .site-footer__cols { grid-template-columns: 1fr; }
  .hero__title { font-size: 36px; }
  .section__title { font-size: 26px; }
  .article__title { font-size: 30px; }
}
