.specteh-topic-articles {
  padding: 32px 0 40px;
  background: #f5f7fb;
}

.specteh-topic-articles__inner {
  width: 100%;
  max-width: var(--specteh-layout-max, 1342px);
  margin: 0 auto;
  padding: 0 var(--specteh-layout-gutter, 16px);
}

.specteh-topic-articles__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.specteh-topic-articles__title {
  margin: 0;
  color: #101828;
  font-family: Manrope, "Segoe UI", sans-serif;
  font-size: clamp(1.5rem, 2vw, 1.875rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.specteh-topic-articles__nav {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.specteh-topic-articles__grid,
.specteh-topic-articles__slider {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.specteh-topic-articles__card {
  min-width: 0;
  height: auto;
}

.specteh-topic-articles__link {
  display: flex;
  flex-direction: column;
  height: auto;
  overflow: hidden;
  border: 1px solid #e4e7ec;
  border-radius: 14px;
  background: #fff;
  color: inherit;
  text-decoration: none !important;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.specteh-topic-articles__link:hover {
  border-color: rgba(255, 131, 17, 0.35);
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.08);
  transform: translateY(-2px);
}

.specteh-topic-articles__media {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  max-height: 200px;
  overflow: hidden;
  background: #eef2f6;
}

.specteh-topic-articles__media img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center center !important;
}

.specteh-topic-articles__media--empty::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 131, 17, 0.12) 0%, rgba(255, 188, 17, 0.08) 100%),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.45) 0, rgba(255, 255, 255, 0.45) 12px, transparent 12px, transparent 24px);
}

.specteh-topic-articles__media--empty::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36px;
  height: 36px;
  transform: translate(-50%, -50%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff8311' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6M16 13H8M16 17H8M10 9H8'/%3E%3C/svg%3E") center/contain no-repeat;
}

.specteh-topic-articles__card-title {
  margin: 0;
  padding: 12px 14px 14px;
  min-height: calc(1.35em * 2 + 28px);
  color: #101828;
  font-family: Manrope, "Segoe UI", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  box-sizing: border-box;
}

.specteh-topic-articles__link:hover .specteh-topic-articles__card-title {
  color: #c45f00;
}

/* Без Owl (JCH вырезает template.js) — сетка, не столбец на всю ширину */
.specteh-topic-articles__slider.owl-carousel:not(.owl-loaded) {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.specteh-topic-articles__slider.owl-carousel.owl-loaded {
  display: block;
}

.specteh-topic-articles__slider.owl-carousel .owl-stage-outer {
  overflow: hidden;
}

.specteh-topic-articles__slider.owl-carousel .owl-item {
  display: flex;
  align-items: stretch;
  height: auto !important;
}

.specteh-topic-articles__slider.owl-carousel .owl-stage {
  display: flex;
  align-items: stretch;
}

.specteh-topic-articles__slider.owl-carousel .specteh-topic-articles__card {
  width: 100%;
  height: auto;
}

.specteh-topic-articles__slider.owl-carousel .specteh-topic-articles__link {
  height: 100%;
}

.specteh-topic-articles__nav .owl-prev,
.specteh-topic-articles__nav .owl-next {
  position: static !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  transform: none !important;
  margin: 0;
}

.specteh-topic-articles__nav .owl-prev:before,
.specteh-topic-articles__nav .owl-next:before {
  width: 36px;
  height: 36px;
  line-height: 36px;
  font-size: 16px;
  color: #475467;
  border-color: #d0d5dd;
}

.specteh-topic-articles__nav .owl-prev:hover:before,
.specteh-topic-articles__nav .owl-next:hover:before {
  color: #ff8311;
  border-color: rgba(255, 131, 17, 0.45);
}

/* Только одна пара стрелок (template.js + specteh-topic-articles.js иначе дублируют) */
.specteh-topic-articles__nav .owl-prev ~ .owl-prev,
.specteh-topic-articles__nav .owl-next ~ .owl-next {
  display: none !important;
}

.specteh-topic-articles__slider > .owl-nav {
  display: none !important;
}

.specteh-topic-articles__nav .owl-prev span,
.specteh-topic-articles__nav .owl-next span {
  display: none !important;
}

body:has(.specteh-product-page) #bottom .moduletable:has(.specteh-topic-articles) {
  display: block !important;
  margin: 0;
  padding: 0;
  background: transparent !important;
}

body:has(.specteh-product-page) .specteh-topic-articles {
  background: transparent;
}

#bottom .moduletable:has(.specteh-topic-articles) {
  display: block !important;
  margin: 0;
  padding: 0;
  background: transparent;
}

@media (max-width: 991px) {
  .specteh-topic-articles__grid,
  .specteh-topic-articles__slider.owl-carousel:not(.owl-loaded) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .specteh-topic-articles__media {
    max-height: 180px;
  }

  /* Мобилка: без стрелок карусели (свайп пальцем) */
  .specteh-topic-articles__nav,
  .specteh-topic-articles__nav .owl-prev,
  .specteh-topic-articles__nav .owl-next,
  .specteh-topic-articles .owl-nav,
  .specteh-topic-articles .owl-prev,
  .specteh-topic-articles .owl-next {
    display: none !important;
  }
}

@media (max-width: 639px) {
  .specteh-topic-articles {
    padding: 24px 0 32px;
  }

  .specteh-topic-articles__grid,
  .specteh-topic-articles__slider.owl-carousel:not(.owl-loaded) {
    grid-template-columns: 1fr;
  }

  .specteh-topic-articles__media {
    max-height: 200px;
  }
}
