/* === RESET / BASE === */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
}

button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}



.entry-content ul {
  list-style: disc;
  padding-left: 1.25em;
}

.entry-content ol {
  list-style: decimal;
  padding-left: 1.25em;
}

.entry-content li {
  margin-bottom: 0.4em;
}








body {
  font-family: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  color: #222;
  background: #fff;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 500;
}




















:root{
  --container: 1200px;
  --gap: 16px;
  --brand-blue: #3B74DD;
    --brand-blue2: #3364BE;
  --text: #111;
  --muted: rgba(17,17,17,.55);
  --border: rgba(17,17,17,.12);
  --bg: #fff;
}

.container{
  width: min(var(--container), calc(100%));
  margin: 0 auto;
}


@media (max-width: 1200px){
.container{
  padding-left: 20px;
  padding-right: 20px;
}
}


.site-header{
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.site-header__inner{
  height: 64px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--gap);
}

/* Brand */
.brand{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  min-width: max-content;
}

.brand__logo{
  display: block;
  width: 34px;
  height: 34px;
}

.brand__title{
  font-size: 24px;
  font-weight: 400;
  letter-spacing: .2px;
}

/* Search */
.header-search{
  display: flex;
  align-items: center;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.header-search__label{
  flex: 1;
}

.header-search__input{
  width: 100%;
  height: 44px;
  border: 0;
  outline: 0;
  padding: 0 14px;
  font-size: 15px;
  color: var(--text);
}

.header-search__input::placeholder{
  color: var(--muted);
}

.header-search__btn{
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}

/* Blog button */
.header-blog-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--brand-blue);
  color: #fff;
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
}

.header-blog-btn:hover {
  background: var(--brand-blue2);
}

/* Mobile */
@media (max-width: 768px){
  .site-header__inner{
    grid-template-columns: auto 1fr;
  }

  .brand__title{
    display: none; /* hide Biowiki */
  }

  .header-blog-btn{
    display: none; /* hide Blog */
  }

  .header-search{
    max-width: none;
    margin: 0;
  }
}

/* a11y helper */
.screen-reader-text{
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}


















.home-intro{
  padding: 36px 0 28px;
}

.home-intro__title{
  margin: 0 0 18px;
  font-size: clamp(26px, 3.2vw, 32px);
  line-height: 1.12;
  font-weight: 500;
  letter-spacing: -0.02em;
  max-width: 500px;
}

.home-intro__grid{
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 20px;
  align-items: start;
}

.home-intro__text{
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(17,17,17,.85);
}

.home-intro__note{
  background: #F8F8F8;
  border-radius: 16px;
  padding: 18px 18px;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(17,17,17,.75);
}

/* Mobile: one column */
@media (max-width: 768px){
  .home-intro{
    padding: 22px 0 18px;
  }

  .home-intro__grid{
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .home-intro__note{
    padding: 16px;
  }
}


















.catalog{
  padding: 28px 0 8px;
}

.catalog__title{
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* chips */
.catalog-tags{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.chip{
  border: 0;
  background: #F2F2F2;
  color: rgba(17,17,17,.9);
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}

.chip:hover{
  filter: brightness(0.98);
}

.chip.is-active{
  background: #E9EEF9;
  color: #1E4FB6;
}

/* filters */
.catalog-filters{
  display: flex;
  flex-wrap: wrap;
  gap: 18px 26px;
  align-items: center;
  padding-bottom: 10px;
}

.filter{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
}

.filter__label{
  font-size: 14px;
  color: rgba(17,17,17,.9);
}

.filter__select{
  font-size: 14px;
  color: #3B74DD;
  border: 0;
  background: transparent;
  padding: 2px 18px 2px 2px; /* место под стрелку */
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='%233B74DD' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
  background-size: 14px 14px;
}

.filter__select:focus{
  outline: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* mobile */
@media (max-width: 768px){
  .catalog{
    padding: 20px 0 6px;
  }

  /* теги как на скрине: плотнее, в 2 “полосы” */
  .catalog-tags{
    gap: 10px 10px;
    margin-bottom: 16px;
  }

  /* фильтры в две колонки */
  .catalog-filters{
    grid-template-columns: 1fr 1fr;
    gap: 14px 18px;
    align-items: start;
  }

  .filter{
    min-height: auto;
  }

  .filter__label{
    white-space: nowrap;
  }
}


.dropdown{
  position: relative;
}

.dropdown__toggle{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #3B74DD;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 2px 0;
}

.dropdown__arrow{
  width: 10px;
  height: 10px;
  display: inline-block;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%233B74DD' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") center/contain no-repeat;
  transition: transform .15s ease;
}

.dropdown.is-open .dropdown__arrow{
  transform: rotate(180deg);
}

.dropdown__menu{
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 160px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 10px;
  padding: 6px 0;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  list-style: none;
  margin: 0;
  display: none;
  z-index: 20;
}

.dropdown.is-open .dropdown__menu{
  display: block;
}

.dropdown__menu li{
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.dropdown__menu li:hover{
  background: #F2F6FF;
  color: #1E4FB6;
}












/* когда меню не помещается — прижимаем к правому краю дропдауна */
.dropdown.is-right .dropdown__menu{
  left: auto;
  right: 0;
}





@media (max-width: 400px){
  .dropdown.is-open .dropdown__menu{
    position: fixed;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%);
    width: min(92vw, 320px);
    max-width: 92vw;
    z-index: 9999;
  }
}












.catalog-cards{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

/* tablet */
@media (max-width: 1024px){
  .catalog-cards{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* mobile */
@media (max-width: 768px){
  .catalog-cards{
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

.substance-card{
  background: #F6F6F6;
  border-radius: 22px;
  overflow: hidden;
}

.substance-card__link{
  display: block;
  padding: 22px 22px 18px;
  color: inherit;
  text-decoration: none;
}



.substance-card__head{
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.substance-card__icon{
  width: 54px;
  height: 54px;
  border-radius: 10px;
 /* background: #5873E6;  временно, пока не будет иконок */
  flex: 0 0 auto;
}

.substance-card__title{
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.substance-card__desc{
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(17,17,17,.85);
  max-width: 60ch;
}

.substance-card__meta{
  margin: 0 0 14px;
}

.kv{
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 6px 0;
}

.kv dt{
  margin: 0;
  font-size: 14px;
  color: rgba(17,17,17,.55);
}

.kv dd{
  margin: 0;
  font-size: 14px;
  color: rgba(17,17,17,.75);
}

/* цветные статусы */
.tag{
  font-weight: 400;
}

.tag--good{ color: #1E7A2F; }
.tag--mid{  color: #9A6B00; }
.tag--low{  color: #2E5BD3; }
.tag--bad{  color: #C62828; }

.substance-card__more{
  display: inline-block;
  margin-top: 2px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.substance-card__link:hover .substance-card__more{
    color: #3B74DD;
}

/* mobile typography tweaks */
@media (max-width: 768px){
  .substance-card__link{ padding: 18px 18px 16px; }
  .substance-card__title{ font-size: 18px; }
  .kv dt, .kv dd{ font-size: 15px; }
  .substance-card__more{ font-size: 17px; }
}



.substances-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:16px;
}
@media (max-width: 980px){
  .substances-grid{ grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px){
  .substances-grid{ grid-template-columns: 1fr; }
}

.sub-card{
  display:flex;
  gap:14px;
  padding:14px;
  border:1px solid #eee;
  border-radius:16px;
  text-decoration:none;
  color:inherit;
  background:#fff;
}
.sub-card__img{
  width:54px;
  height:54px;
  border-radius:12px;
  overflow:hidden;
  flex:0 0 auto;
  background:#f0f4ff; /* тот самый "синий квадратик" если нет картинки */
}
.sub-card__img img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.sub-card__title{ margin:0 0 6px; font-size:16px; line-height:1.2; }
.sub-card__desc{ margin:0; opacity:.8; font-size:13px; line-height:1.35; }
.sub-card__tags{ margin-top:10px; display:flex; gap:8px; flex-wrap:wrap; }
.tag{
  font-size:14px;
  border-radius:999px;
}
.sub-card__meta{ margin:10px 0 0; display:grid; gap:6px; }
.sub-card__row{ display:grid; grid-template-columns: 140px 1fr; gap:10px; }
.sub-card__row dt{ opacity:.7; }
.sub-card__row dd{ margin:0; font-weight:600; }

.sub-card__btn{
  display:inline-flex;
  margin-top:12px;
  padding:10px 14px;
  border-radius:12px;
  background:#111;
  color:#fff;
  text-decoration:none;
  font-weight:600;
}


.catalog-cards{
  align-items: stretch;
}

.substance-card{
  height: 100%;
}

.substance-card__link{
  display: flex;
  flex-direction: column;
  height: 100%;
}

.substance-card__more{
  margin-top: auto;
}




































.substance{ padding: 28px 0 56px; }
.substance__title{
  margin: 0 0 18px;
  font-size: 32px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  max-width: 800px;
}

.substance__grid{
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
}

.substance__image{
  border-radius: 14px;
  overflow: hidden;
  background: #E6E6E6;
  aspect-ratio: 1 / 1;
}
.substance__image img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.substance__image-ph{ width:100%; height:100%; background:#E6E6E6; }

.substance__chips{ display:flex; gap:10px; flex-wrap:wrap; margin: 14px 0 14px; }

.substance__meta{ margin: 0; }

.substance__lead{
  margin: 0 0 18px;
  max-width: 70ch;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(17,17,17,.85);
}

.substance__content{
  font-size: 14px;
  line-height: 1.6;
}

.substance__aside{
  padding: 18px;
  border-radius: 18px;
  background: #F6F6F6;
}
.substance__aside-title{
  font-weight: 500;
  font-size: 18px;
  line-height: 1.2;
}

/* responsive */
@media (max-width: 1024px){
  .substance__grid{
    grid-template-columns: 320px minmax(0,1fr);
  }
  .substance__col--right{ grid-column: 1 / -1; }
}

@media (max-width: 768px){
  .substance__title{ font-size: 28px; }

  .substance__grid{
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* порядок: col1 -> col2 -> col3 (как ты просил) */
  .substance__col--left{ order: 1; }
  .substance__col--main{ order: 2; }
  .substance__col--right{ order: 3; }
}









.similar{
  padding: 34px 0 56px;
}
.similar__title{
  margin: 0 0 18px;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
}


















.home-two{
  padding: 40px 0 56px;
}

.home-two__grid{
  display: grid;
  grid-template-columns: 1.25fr 1fr; /* слева шире, справа блог */
  gap: 64px;
  align-items: start;
}

.home-two__title{
  margin: 0 0 18px;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

/* Popular list: 2 колонки */
.popular-list{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 40px;
}

.popular-item{
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  padding: 6px 0;
}

.popular-item__icon{
  width: 44px;
  height: 44px;
  border-radius: 8px;
  overflow: hidden;
  flex: 0 0 auto;
}

.popular-item__icon img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.popular-item__name{
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.popular-item:hover .popular-item__name{
  color: #3B74DD;
}

/* Blog mini cards */
.blog-mini{
  display: grid;
  gap: 18px;
}

.blog-mini__item{
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  text-decoration: none;
  color: inherit;
}

.blog-mini__img{
  border-radius: 12px;
  overflow: hidden;
  background: #E6E6E6;
  aspect-ratio: 4 / 3;
  display: block;
}

.blog-mini__img img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blog-mini__title{
  display: block;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-top: 2px;
}

.blog-mini__desc{
  display: block;
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(17,17,17,.75);
}

.blog-mini__item:hover .blog-mini__title{
  color: #3B74DD;
}

.blog-mini__more{
  display: inline-block;
  margin-top: 18px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
  color: inherit;
}

.blog-mini__more:hover{
  color: #3B74DD;
}

/* Tablet */
@media (max-width: 1024px){
  .home-two__grid{
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .popular-list{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile */
@media (max-width: 768px){
  .home-two{
    padding: 28px 0 40px;
  }
  .home-two__title{
    font-size: 20px;
  }

  .blog-mini__title{
font-size: 14px;
}

.blog-mini__img {
max-width: 100px;
}
.blog-mini__item {
    grid-template-columns: 100px minmax(0, 1fr);
}

.blog-mini__desc{
font-size: 12px;
}

}


@media (max-width: 370px){

  .popular-list{
    grid-template-columns: 1fr;
    gap: 14px;
  }


}





























.post-page{ padding: 28px 0 56px; }

.post-page__grid{
  display: grid;
  grid-template-columns: minmax(0, 1fr) 520px;
  gap: 64px;
  align-items: start;
}

.post-page__title{
  margin: 0 0 18px;
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.post-page__hero{
  border-radius: 14px;
  overflow: hidden;
  background: #E6E6E6;
  aspect-ratio: 16 / 9;
}

.post-page__hero img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-page__lead{
  margin: 18px 0 0;
  max-width: 75ch;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(17,17,17,.85);
}

.post-page__content{
  margin-top: 22px;
  font-size: 14px;
  line-height: 1.65;
}

.post-page__aside-title{
  margin: 0 0 18px;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

/* mobile */
@media (max-width: 1024px){
  .post-page__grid{ grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 768px){
  .post-page__title{ font-size: 28px; }
}





















.blog-page{ padding: 28px 0 56px; 

min-height: calc(100vh - 200px);
}

.blog-page__title{
  margin: 0 0 18px;
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

/* grid 2 cols */
.blog-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 40px;
}

/* используем те же стили карточки blog-mini__item, но картинку сделаем компактнее */
.blog-grid .blog-mini__item{
  grid-template-columns: 240px minmax(0, 1fr);
}
.blog-grid .blog-mini__img{
  aspect-ratio: 16 / 9;
}

@media (max-width: 1024px){
  .blog-grid{
    grid-template-columns: 1fr;
    gap: 18px;
  }

}

@media (max-width: 768px){
  .blog-page__title{ font-size: 28px; }
.blog-grid .blog-mini__item {
grid-template-columns: 100px minmax(0, 1fr);
}

.filter {
    margin-left: 0!important;

}

}

/* pagination */
.pager{ margin-top: 26px; }
.pager ul{
  list-style: none;
  display: flex;
  gap: 10px;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
}
.pager a, .pager span{
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  background: #F6F6F6;
}
.pager .current{
  background: #111;
  color: #fff;
}












.header-search__input::-webkit-search-cancel-button,
.header-search__input::-webkit-search-decoration{
  -webkit-appearance: none;
  appearance: none;
  display: none;
}




.search-page{ padding: 28px 0 56px; }
.search-page__title{
  margin: 0 0 18px;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
@media (max-width: 768px){
  .search-page__title{ font-size: 24px; }
}















/* ===== Live Search Dropdown ===== */

/* важно: у формы должно быть position:relative не обязательно, так как дроп fixed,
   но пусть будет — пригодится */
.header-search { position: relative; }

/* Дропдаун: fixed, чтобы не резался overflow у хедера/контейнеров */
.header-search__drop{
  position: fixed;
  left: 0;
  top: 0;
  width: 320px;

  background: #fff;
  border: 1px solid #eee;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.08);

  z-index: 999999;

  max-height: 460px;
  overflow-y: auto;

  display: none; /* JS переключает */
}

.header-search__drop[hidden]{
  display: none !important;
}

.bh-drop__item{
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px;

  text-decoration: none;
  color: inherit;
}

.bh-drop__item:hover{
  background: #f6f6f6;
}

.bh-drop__img{
  width: 54px;
  height: 54px;
  border-radius: 12px;
  overflow: hidden;
  background: #e6e6e6;
}

.bh-drop__img img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}

.bh-drop__title{
  display:block;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.15;
}

.bh-drop__desc{
  display:block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(17,17,17,.72);
}

.bh-drop__empty{
  padding: 14px;
  opacity: .75;
}












/* ===== Stacks section ===== */
.home-stacks{
  padding: 56px 0;
}

.home-stacks__title{
  margin: 0 0 24px;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

/* grid */
.stacks-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 16px;
}

/* tablet */
@media (max-width: 1024px){
  .stacks-grid{
    grid-template-columns: repeat(2, 1fr);
  }
}

/* mobile */
@media (max-width: 640px){
  .stacks-grid{
    grid-template-columns: 1fr;
  }
}

/* card */
.stack-card{
  background: #f6f6f6;
  border-radius: 18px;
  padding: 18px 20px;
}

.stack-card__title{
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 500;
}

.stack-card__desc{
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(17,17,17,.7);
}

/* button */
.stacks-more{
  margin-top: 24px;
  padding: 12px 20px;
  font-size: 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #ddd;
  cursor: pointer;
}

.stacks-more:hover{
  border-color: #111;
}


















/* ===== Stacks grid (home) ===== */
.home-stacks{ padding: 56px 0; }
.home-stacks__title{ margin: 0 0 24px; font-size: 28px; font-weight: 500; letter-spacing: -0.02em; }

.stacks-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:16px;
}
@media (max-width: 1024px){ .stacks-grid{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px){ .stacks-grid{ grid-template-columns: 1fr; } }

.stack-card{
  display:block;
  padding:18px 20px;
  background:#f6f6f6;
  border-radius:18px;
  text-decoration:none;
  color:inherit;
}
.stack-card__title{ margin:0 0 8px; font-size:16px; font-weight:500; }
.stack-card__desc{ margin:0; font-size:14px; line-height:1.45; color:rgba(17,17,17,.7); }

.stacks-more{
  display:inline-flex;
  margin-top: 24px;
  padding: 12px 20px;
  font-size: 14px;
  border-radius: 12px;
  background:#fff;
  border:1px solid #ddd;
  text-decoration:none;
  color:inherit;
}
.stacks-more:hover{ border-color:#111; }

/* ===== Single stack page ===== */
.stack-page{ padding: 28px 0 64px; }
.stack-page__grid{
  display:grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 48px;
}
@media (max-width: 1024px){
  .stack-page__grid{ grid-template-columns: 1fr; gap: 28px; }
}

.stack-page__title{
  margin:0 0 10px;
  font-size: 32px;
  line-height: 1.05;
  letter-spacing:-0.03em;
  font-weight:500;
}
@media (max-width: 768px){
  .stack-page__title{ font-size: 30px; }
}

.stack-page__lead{
  margin:0 0 22px;
  color: rgba(17,17,17,.75);
  line-height: 1.5;
}

.stack-page__content{ line-height: 1.65; }

.stack-page__aside-title{
  margin: 6px 0 16px;
  font-size: 20px;
  font-weight: 500;
}





.stack-aside-list{ display:grid; gap:14px; }
.stack-aside-card{
  display:block;
  padding:18px 20px;
  background:#f6f6f6;
  border-radius:18px;
  text-decoration:none;
  color:inherit;
}
.stack-aside-card__title{ margin:0 0 8px; font-size:16px; font-weight:500; }
.stack-aside-card__desc{ margin:0; font-size:13px; line-height:1.45; color:rgba(17,17,17,.7); }

/* optional: substances list inside stack */
.stack-page__items{ margin-top: 28px; }
.stack-page__h2{ margin:0 0 12px; font-size: 18px; font-weight: 500; }

.stack-items{ display:flex; flex-wrap:wrap; gap:10px; }
.stack-item{
  display:inline-flex;
  padding:8px 12px;
  border-radius:999px;
  background:#f6f6f6;
  text-decoration:none;
  color:inherit;
  font-size:14px;
}
.stack-item:hover{ background:#eee; }













/* ===== substances inside stack page ===== */
.stack-substances{ margin-top: 42px; }
.stack-substances__title{
  margin:0 0 18px;
  font-size: 22px;
  font-weight: 500;
}

.stack-substance{
  padding-top: 28px;
  border-top: 1px solid #eee;
  margin-top: 28px;
}
.stack-substance__head{ margin: 0 0 16px; }
.stack-substance__name{
  margin:0 0 8px;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.stack-substance__name a{
  display: inline-block; /* или block */
  line-height: 1;
}
.stack-substance__name a:hover{ text-decoration: underline; text-underline-offset: 4px; }

.stack-substance__lead{
  margin:0;
  color: rgba(17,17,17,.75);
  line-height: 1.5;
  max-width: 80ch;
}

.stack-substance__grid{
  display:grid;
  grid-template-columns: 360px minmax(0,1fr);
  gap: 34px;
  align-items: start;
}

@media (max-width: 1024px){
  .stack-substance__grid{ grid-template-columns: 1fr; gap: 18px; }
}

.stack-substance__image{
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 18px;
  overflow: hidden;
  background: #e6e6e6;
}
.stack-substance__image img{ width:100%; height:100%; object-fit: cover; display:block; }

.stack-substance__image-ph{ width:100%; height:100%; background:#dcdcdc; }

.stack-substance__chips{ margin-top: 12px; display:flex; gap:8px; flex-wrap:wrap; }

.stack-substance__meta{ margin: 14px 0 0; }

.stack-substance__btn{
  display:inline-flex;
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #111;
  color: #fff;
  text-decoration:none;
  font-weight: 600;
  font-size: 14px;
}

.stack-substance__content{
  line-height: 1.65;
}
















.share-popup{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.share-popup__inner{
  background: #fff;
  padding: 24px;
  padding-right: 50px;
    padding-top: 50px;
  border-radius: 16px;
  width: 370px;
  position: relative;
}

.share-popup__close{
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 20px;
  background: none;
  border: 0;
  cursor: pointer;
}

.share-popup__field{
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.share-popup__field input{
  flex: 1;
}

.share-popup__links{
  display: grid;
  gap: 8px;
}
.share-popup[hidden]{ display: none !important; }

.share-popup__links{
  display: flex;
  gap: 12px;
}

.share-ico{
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #F8F8F8;
  text-decoration: none;
}

.share-ico img{
  width: 22px;
  height: 22px;
  display: block;
}























.site-footer{
  padding: 48px 0;
  background: #F4F4F4;

}

.footer__grid{
  display: grid;
  grid-template-columns: 360px 1fr 168px;
  gap: 48px;
  align-items: start;
}

.footer__brand{
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.footer__logo img{
  display: block;
  height: 28px;
  width: auto;
}

.footer__year{
  font-size: 14px;
  opacity: .75;
}

.footer__center{
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.footer__nav{
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
}

.footer__nav a{
  color: inherit;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.25;
}

.footer__nav a:hover{
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer__contact{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  line-height: 1.25;
}

.footer__contact-label{
  opacity: .75;
}

.footer__email{
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer__dev{
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
}

.footer__dev-label{
  font-size: 14px;
  opacity: .75;
}

.footer__dev-logo img{
  display: block;
  height: 20px;
  width: auto;
}

/* ===== Mobile ===== */
@media (max-width: 820px){
  .site-footer{ padding: 36px 0; }

  .footer__grid{
    grid-template-columns: 1fr;
    gap: 22px;
  }

  /* на мобилке: логотип слева, год справа */
  .footer__brand{
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }

  .footer__nav{
    flex-direction: column;
    gap: 14px;
  }

  .footer__dev{
    margin-top: 10px;
  }

  .footer__dev-logo img{
    height: 18px; /* чуть крупнее как на скрине */
  }
}














.page-text{
  padding: 40px 0 72px;
}

.page-text__title{
  margin: 0 0 18px;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.page-text__content{
  max-width: 860px;
  font-size: 16px;
  line-height: 1.7;
}

.page-text__content p{
  margin: 0 0 14px;
}

.page-text__content h2{
  margin: 28px 0 10px;
  font-size: 22px;
  line-height: 1.2;
}

.page-text__content ul,
.page-text__content ol{
  margin: 0 0 14px 18px;
}

@media (max-width: 820px){
  .page-text{ padding: 28px 0 56px; }
  .page-text__title{ font-size: 26px; }
}













.cookiebar[hidden]{ display: none !important; }



.cookiebar{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  border-top: 1px solid rgba(0,0,0,.06);
  background: #fff;
}


.cookiebar__inner{
  padding: 14px 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.cookiebar__text{
  font-size: 14px;
  line-height: 1.35;
  opacity: .9;
}

.cookiebar__link{
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.cookiebar__btn{
  margin-left: auto;
  border: 0;
  cursor: pointer;
  padding: 0 24px;
  height: 40px;
  border-radius: 8px;
  background: #3B74DD;
  color: #fff;
  font-size: 14px;
  line-height: 1;
}

.cookiebar__btn:active{ transform: translateY(1px); }

@media (max-width: 820px){
  .cookiebar__inner{
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .cookiebar__btn{
    margin-left: 0;
    width: 100%;
  }
}













h2.wp-block-heading:not(:first-of-type) {
  padding-top: 40px;
}


h2{
  line-height: 1.2!important;
}








.tag--good {color: #00b45a !important; }
.tag--bad  {color:#e63c3c !important; }


.bh-badge.is-good{color: #00b45a !important;  }
.bh-badge.is-bad{color:#e63c3c !important; }



/* Низкий (если где-то ещё остался tag--low) — тоже красный */
.tag--low{
  color:#e63c3c !important;
}













/* Формулы: аккуратные индексы внутри code */
code.formula{
  white-space: nowrap;
}

code.formula sub,
code.formula sup{
  font-size: 0.75em;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

code.formula sub{ bottom: -0.25em; }
code.formula sup{ top: -0.45em; }




























.buy{ margin-top: 32px; }
.buy__title{ margin: 0 0 16px; }

.buy-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

  .buy-grid2{ grid-template-columns: repeat(2, minmax(0, 1fr)); }


@media (max-width: 1024px){
  .buy-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px){
  .buy-grid{ grid-template-columns: 1fr; }
}

.buy-card{
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 14px;
  padding: 14px;
  border-radius: 16px;
  background: #F6F6F6;
  text-decoration: none;
  color: inherit;
}

.buy-card__img{
  width: 86px;
  height: 86px;
  border-radius: 12px;
  overflow: hidden;
  background: #f2f3f5;
}

.buy-card__img img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.buy-card__ph{
  width: 100%;
  height: 100%;
  background: #e9ebef;
}

.buy-card__name{
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 6px;
  font-size: 14px;
}

.buy-card__price{
  font-weight: 600;
  margin: 0 0 8px;
    font-size: 16px;
}

.buy-card__shop{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  opacity: .75;
  font-size: 14px;
}

.buy-card__shop-logo{
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: cover;
  display: block;
}




@media (max-width: 768px){
  .stack-page__title { font-size: 24px; }

  .stack-substance__main { font-size: 14px; }
.stack-page__content{ font-size: 14px; }
.stack-substance__name { font-size: 24px; }

.substance-card__more{ font-size: 14px; }
}
