/* Тексты со строчной буквы: заголовки и кнопки */
h1.title::first-letter,
h1 > .title:first-child::first-letter,
.title-container > .title:first-child::first-letter,
.title-reviews::first-letter,
.news-section-1 h1::first-letter,
.news-item-first--screen h1::first-letter,
.projects-item h1::first-letter,
.projects-item-1 .bottom h2::first-letter,
.projects-item-2 h2::first-letter,
.error h2::first-letter,
button p::first-letter,
#next-button::first-letter,
#back-button::first-letter {
  text-transform: uppercase;
}

/* Текст редактора на страницах услуг */
.service-editor-content {
  position: relative;
  margin: 100px 0;
}

.service-editor-content__body {
  font-family: 'Manrope';
  font-size: 20px;
  line-height: 1.5;
  overflow-wrap: break-word;
}

.service-editor-content__body > * + * {
  margin-top: 20px;
}

.service-editor-content__body > h2,
.service-editor-content__body > h3,
.service-editor-content__body > h4 {
  margin-top: 40px;
  font-weight: 700;
  line-height: 1.2;
}

.service-editor-content__body > :first-child {
  margin-top: 0;
}

.service-editor-content__body h2 { font-size: 42px; }
.service-editor-content__body h3 { font-size: 30px; }
.service-editor-content__body h4 { font-size: 24px; }

.service-editor-content__body ul,
.service-editor-content__body ol {
  margin-left: 0;
  padding-left: 30px;
}

.service-editor-content__body ul li { list-style: disc; }
.service-editor-content__body ol li { list-style: decimal; }
.service-editor-content__body li + li { margin-top: 8px; }

.service-editor-content__body a {
  color: var(--main-color);
  text-decoration: underline;
}

.service-editor-content__body table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.service-editor-content__body td,
.service-editor-content__body th {
  padding: 10px 14px;
  border: 1px solid var(--grey);
}

/* Другие статьи / Другие новости */
.related-publications {
  position: relative;
  margin: 100px 0;
}

.related-publications h2 {
  margin-bottom: 40px;
  font-family: 'Manrope';
  font-size: 42px;
  font-weight: 700;
  line-height: 1.1;
}

.related-publications__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
}

.related-publications__card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: 30px;
  background-color: var(--white);
  color: var(--black);
  font-family: 'Manrope';
}

.related-publications__image {
  display: block;
  height: 220px;
  overflow: hidden;
}

.related-publications__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-publications__date {
  padding: 20px 24px 0;
  font-size: 16px;
  color: rgba(0, 0, 0, .7);
}

.related-publications__title {
  padding: 10px 24px 24px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: break-word;
}

@media (max-width: 1260px) {
  .service-editor-content .container,
  .related-publications .container {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (max-width: 900px) {
  .related-publications__list {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .service-editor-content,
  .related-publications {
    margin: 60px 0;
  }

  .service-editor-content__body { font-size: 16px; }
  .service-editor-content__body h2,
  .related-publications h2 { font-size: 28px; }
  .service-editor-content__body h3 { font-size: 22px; }
  .service-editor-content__body h4 { font-size: 18px; }
  .related-publications__title { font-size: 18px; }
}

/* Анимация при наведении. Трансформации кнопкам не задаём: часть из них позиционирована через transform. */
.wpcf7-submit,
.main-section-9 button[type="submit"],
.form .content-block button,
#next-button,
#back-button,
.call,
.video-button,
.tab-button,
.show-more,
.close-content,
.tags-design .tag,
.carousel-button {
  transition: filter .3s ease, box-shadow .3s ease, opacity .3s ease, background-color .3s ease, color .3s ease;
}

.links-ways a,
.footer a,
.card-services,
.card-services .top,
.card-services .bottom,
.related-publications__card,
.related-publications__title,
.news-card .read-all,
.news-card h3 {
  transition: color .3s ease, background-color .3s ease, box-shadow .3s ease, opacity .3s ease;
}

.related-publications__image img {
  transition: transform .5s ease;
}

@media (hover: hover) {
  .wpcf7-submit:hover,
  .main-section-9 button[type="submit"]:hover,
  .form .content-block button:hover,
  #next-button:hover {
    filter: brightness(1.15);
    box-shadow: 0 8px 20px rgba(51, 60, 255, .35);
  }

  .call:hover,
  .tab-button:hover,
  .show-more:hover,
  .tags-design .tag:hover,
  .pagination button:not(:disabled):not(.active):hover {
    box-shadow: 0 6px 16px rgba(51, 60, 255, .25);
  }

  .video-button:hover,
  .close-content:hover,
  .carousel-button:hover,
  #back-button:not(:disabled):hover {
    filter: brightness(1.1);
    opacity: .8;
  }

  .slider-btn:hover {
    background-color: rgba(51, 60, 255, .5) !important;
  }

  .links-ways a:not(.active):hover {
    color: var(--main-color);
  }

  .footer a:hover {
    opacity: .7;
  }

  .card-services:hover .top,
  .card-services:hover .bottom,
  .related-publications__card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, .1);
  }

  .news-card:hover h3,
  .related-publications__card:hover .related-publications__title {
    color: var(--main-color);
  }

  .news-section-catalog .news-card:hover .read-all,
  .projects-item-3 .news-card:hover .read-all {
    background-color: rgba(51, 60, 255, .85);
  }

  .related-publications__card:hover img {
    transform: scale(1.05);
  }
}

a:focus-visible,
button:focus-visible,
input[type="submit"]:focus-visible {
  outline: 2px solid var(--main-color);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .related-publications__card:hover img {
    transform: none;
  }
}
