/* Отзывы Авито на главной: третья плитка блока «Видео и отзывы».
   Разметка — html/drlaunch/home-articles.html, поведение — js/dl-otzyvy.js.
   Высота 362 px на всех ширинах, как у прежнего виджета: блок не прыгает.
   Селекторы .content-tile.dl-otz сильнее .content-tile--review из styles.css и mobile.css. */

.content-tile.dl-otz {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 362px;
  min-height: 362px;
  max-height: 362px;
  padding: 0;
  overflow: hidden;
  background: #fff;
  container-type: inline-size;
}

.dl-otz__head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  padding: 14px 16px 12px;
  border-bottom: 1px solid #efede8;
}

.dl-otz__logo {
  display: block;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.dl-otz__rating {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.dl-otz__line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.dl-otz__score {
  font: 700 24px/1 var(--font-logo, "Onest", "Manrope", system-ui, sans-serif);
  letter-spacing: -0.01em;
  color: #1a1917;
}

.dl-otz__stars {
  display: inline-flex;
  gap: 2px;
  color: var(--color-star, #ef9f27);
}

.dl-otz__stars svg {
  display: block;
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.dl-otz__count {
  margin: 0;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.3;
  color: #676767;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dl-otz__body {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

.dl-otz__fallback {
  margin: auto 0;
  padding: 16px;
  font-size: 15px;
  line-height: 22px;
  color: #1a1917;
}

.dl-otz__track {
  display: flex;
  gap: 16px;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
  scrollbar-width: none;
  outline: none;
}

.dl-otz__track::-webkit-scrollbar {
  display: none;
}

.dl-otz__track:focus-visible {
  box-shadow: inset 0 0 0 2px #335eea;
}

.dl-otz__slide {
  box-sizing: border-box;
  display: flex;
  flex: 0 0 100%;
  flex-direction: column;
  justify-content: flex-start;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 18px 16px 12px;
  overflow: hidden;
  scroll-snap-align: start;
}

.dl-otz__text {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  color: #1a1917;
  overflow-wrap: anywhere;
}

/* Страховка: одобренные отзывы короче 200 символов и влезают целиком (проверяется),
   но если длинный всё же попадёт — обрезается текст, а подпись с именем остаётся видна */
.dl-otz__text p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 7;
  line-clamp: 7;
}

.dl-otz__who {
  flex: 0 0 auto;
  margin: 0;
  font-size: 13px;
  line-height: 18px;
  color: #676767;
}

.dl-otz__foot {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 4px;
  min-height: 52px;
  padding: 4px 12px 4px 4px;
  border-top: 1px solid #efede8;
}

.dl-otz__nav {
  display: flex;
  align-items: center;
}

.dl-otz__nav[hidden] {
  display: none;
}

.dl-otz__btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #1a1917;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.dl-otz__btn svg {
  display: block;
  width: 20px;
  height: 20px;
}

@media (hover: hover) {
  .dl-otz__btn:hover:not([aria-disabled="true"]) {
    background: #f5f4f0;
  }
}

.dl-otz__btn:focus-visible {
  outline: 2px solid #335eea;
  outline-offset: -2px;
}

.dl-otz__btn[aria-disabled="true"] {
  color: #c9c6c0;
  cursor: default;
}

.dl-otz__pos {
  min-width: 58px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: #676767;
  text-align: center;
  white-space: nowrap;
}

.dl-otz__all {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-left: auto;
  padding: 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: #1a1917;
  text-decoration: none;
  white-space: nowrap;
}

.dl-otz__all:hover {
  color: #005496;
}

.dl-otz__all:focus-visible {
  outline: 2px solid #335eea;
  outline-offset: 2px;
  border-radius: 4px;
}

.dl-otz__sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Плитка на всю строку (планшет 1024): два отзыва рядом */
@container (min-width: 600px) {
  .dl-otz__slide {
    flex-basis: calc(50% - 8px);
  }
}

/* Узкие телефоны 280–330: мельче текст, «Все отзывы» без «на Авито» (для читалки остаётся) */
@container (max-width: 330px) {
  .dl-otz__head {
    padding: 12px 14px 10px;
  }

  .dl-otz__slide {
    padding: 14px 14px 10px;
  }

  .dl-otz__text {
    font-size: 14px;
    line-height: 20px;
  }

  .dl-otz__text p {
    -webkit-line-clamp: 9;
    line-clamp: 9;
  }

  .dl-otz__all-tail {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dl-otz__track {
    scroll-behavior: auto;
  }

  .dl-otz__btn {
    transition: none;
  }
}
