/* =========================
   GRAMMAR LIBRARY
   ========================= */

body.grammar-library {
  background: #f7f2ea;
}

body.grammar-library .site-grid {
  background: #f7f2ea;
}

body.grammar-library .container-component {
  width: min(1180px, calc(100% - 40px));
  max-width: 1180px;
  margin-inline: auto;
  padding-top: 42px;
  padding-bottom: 70px;
}

/* Убираем технические сообщения Joomla */
body.grammar-library .alert-info,
body.grammar-library .cat-children > h3 {
  display: none;
}

/* Сетка карточек */
body.grammar-library .cat-children {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

/* Карточка */
body.grammar-library .com-content-category-blog__child {
  position: relative;
  min-height: 185px;
  padding: 28px;
  background: #ffffff;
  border: 1px solid #d9dde6;
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(32, 48, 92, 0.08);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

body.grammar-library .com-content-category-blog__child:hover {
  transform: translateY(-4px);
  border-color: #a94935;
  box-shadow: 0 14px 32px rgba(32, 48, 92, 0.14);
}

/* Маленький знак вверху карточки */
body.grammar-library .com-content-category-blog__child::before {
  display: flex;
  width: 46px;
  height: 46px;
  margin-bottom: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f2e6df;
  color: #963f2e;
  font-size: 17px;
  font-weight: 700;
}

body.grammar-library .com-content-category-blog__child:nth-of-type(1)::before {
  content: "T";
}

body.grammar-library .com-content-category-blog__child:nth-of-type(2)::before {
  content: "V";
}

body.grammar-library .com-content-category-blog__child:nth-of-type(3)::before {
  content: "IF";
}

body.grammar-library .com-content-category-blog__child:nth-of-type(4)::before {
  content: "a";
}

body.grammar-library .com-content-category-blog__child:nth-of-type(5)::before {
  content: "A";
}

body.grammar-library .com-content-category-blog__child:nth-of-type(6)::before {
  content: "in";
}

body.grammar-library .com-content-category-blog__child:nth-of-type(7)::before {
  content: "↔";
}

/* Заголовки карточек */
body.grammar-library .com-content-category-blog__child .item-title {
  margin: 0;
  line-height: 1.25;
}

body.grammar-library .com-content-category-blog__child .item-title a {
  color: #29386f;
  font-size: 1.28rem;
  font-weight: 700;
  text-decoration: none;
}

body.grammar-library .com-content-category-blog__child .item-title a::after {
  content: "Explore topics →";
  display: block;
  margin-top: 18px;
  color: #963f2e;
  font-size: 0.88rem;
  font-weight: 600;
}

/* Планшет */
@media (max-width: 900px) {
  body.grammar-library .cat-children {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Телефон */
@media (max-width: 620px) {
  body.grammar-library .container-component {
    width: min(100% - 28px, 1180px);
    padding-top: 26px;
  }

  body.grammar-library .cat-children {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  body.grammar-library .com-content-category-blog__child {
    min-height: 160px;
    padding: 24px;
  }
}
/* Заголовок страницы Grammar */
body.grammar-library .grammar-hero {
  width: min(1060px, calc(100% - 40px));
  margin: 34px auto 8px;
}

body.grammar-library .grammar-hero h1 {
  margin: 0;
  color: #18294f;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.1;
}

body.grammar-library .grammar-hero p {
  margin: 12px 0 28px;
  color: #626878;
  font-size: 1.08rem;
}

body.grammar-library .grammar-accent-line {
  position: relative;
  height: 3px;
  background: #a94935;
  border-radius: 3px;
}

@media (max-width: 620px) {
  body.grammar-library .grammar-hero {
    width: calc(100% - 28px);
    margin-top: 24px;
  }
}
body.grammar-library .grammar-accent-line {
  position: relative;
}

body.grammar-library .grammar-unicorn {
  position: absolute;
  right: 0;
  bottom: -37px;
  width: 115px;
  height: auto;
  z-index: 2;
  pointer-events: none;
  transform: translateX(42%);
}

@media (max-width: 620px) {
  body.grammar-library .grammar-unicorn {
    width: 82px;
    bottom: -10px;
    transform: translateX(32%);
  }
}