/* ============================================================
   TIMB Reviews Widget — Public v1.0.0
   Все цвета и типографика — через CSS-переменные.
   Чтобы перекрасить под тему сайта, достаточно переопределить
   их на более сильном селекторе (например, на #tmbRevRoot).
   ============================================================ */

.tmbRev {
  /* Базовая палитра — тёплое дерево + угольный акцент.
     Подходит и для светлых, и для нейтральных лендингов. */
  --tmbRev-bg-from: #faf7f2;
  --tmbRev-bg-to: #f1ebde;
  --tmbRev-card-bg: #ffffff;
  --tmbRev-card-border: rgba(54, 36, 21, 0.08);
  --tmbRev-card-shadow: 0 4px 24px rgba(54, 36, 21, 0.06);
  --tmbRev-card-shadow-hover: 0 12px 40px rgba(54, 36, 21, 0.12);
  --tmbRev-ink-strong: #2a1a0e;
  --tmbRev-ink: #4a3527;
  --tmbRev-ink-soft: #8a7563;
  --tmbRev-accent: #b8762d;       /* медь / тёмная охра */
  --tmbRev-accent-soft: #e6c79a;
  --tmbRev-star-on: #d99840;
  --tmbRev-star-off: #d9d0c0;
  --tmbRev-divider: rgba(54, 36, 21, 0.08);
  --tmbRev-radius: 18px;
  --tmbRev-radius-sm: 10px;
  --tmbRev-font-display: 'Playfair Display', 'PT Serif', Georgia, serif;
  --tmbRev-font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PT Sans', 'Helvetica Neue', Arial, sans-serif;

  background: linear-gradient(180deg, var(--tmbRev-bg-from) 0%, var(--tmbRev-bg-to) 100%);
  padding: 80px 0;
  position: relative;
  font-family: var(--tmbRev-font-body);
  color: var(--tmbRev-ink);
  line-height: 1.55;
  overflow: hidden;
}

.tmbRev::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 0%, rgba(184, 118, 45, 0.06), transparent 40%),
    radial-gradient(circle at 80% 100%, rgba(184, 118, 45, 0.05), transparent 50%);
  pointer-events: none;
}

.tmbRev__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
}

/* ---------- HEAD ---------- */
.tmbRev__head {
  text-align: center;
  margin-bottom: 36px;
}

.tmbRev__title {
  font-family: var(--tmbRev-font-display);
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  font-weight: 700;
  color: var(--tmbRev-ink-strong);
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.tmbRev__sub {
  font-size: 1.05rem;
  color: var(--tmbRev-ink-soft);
  margin: 0;
}

/* ---------- STATS ---------- */
.tmbRev__stats {
  display: flex;
  justify-content: center;
  gap: clamp(24px, 5vw, 64px);
  margin-bottom: 44px;
  flex-wrap: wrap;
}

.tmbRev__stat {
  text-align: center;
  min-width: 110px;
}

.tmbRev__statVal {
  font-family: var(--tmbRev-font-display);
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 700;
  color: var(--tmbRev-ink-strong);
  line-height: 1;
  letter-spacing: -0.02em;
}

.tmbRev__statVal span {
  color: var(--tmbRev-star-on);
  margin-left: 4px;
}

.tmbRev__statLbl {
  font-size: 0.78rem;
  color: var(--tmbRev-ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 8px;
}

/* ---------- GRID ---------- */
.tmbRev__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

/* ---------- CARD ---------- */
.tmbRev__card {
  background: var(--tmbRev-card-bg);
  border: 1px solid var(--tmbRev-card-border);
  border-radius: var(--tmbRev-radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--tmbRev-card-shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}

.tmbRev__card::before {
  content: '';
  position: absolute;
  top: 18px;
  right: 18px;
  width: 28px;
  height: 22px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23e6c79a' d='M5 17a3 3 0 1 1 0-6 5 5 0 0 1 5-5v2a3 3 0 0 0-3 3 3 3 0 0 1 3 3 3 3 0 0 1-3 3zm9 0a3 3 0 1 1 0-6 5 5 0 0 1 5-5v2a3 3 0 0 0-3 3 3 3 0 0 1 3 3 3 3 0 0 1-3 3z'/></svg>");
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.7;
  pointer-events: none;
}

@media (hover: hover) {
  .tmbRev__card:hover {
    transform: translateY(-4px);
    box-shadow: var(--tmbRev-card-shadow-hover);
  }
}

.tmbRev__cardHead {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding-right: 36px; /* место под кавычку */
}

.tmbRev__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--tmbRev-accent) 0%, #6b3e16 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.tmbRev__meta {
  min-width: 0;
}

.tmbRev__author {
  font-weight: 600;
  color: var(--tmbRev-ink-strong);
  font-size: 0.98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tmbRev__date {
  font-size: 0.82rem;
  color: var(--tmbRev-ink-soft);
  margin-top: 2px;
}

.tmbRev__stars {
  display: flex;
  gap: 2px;
}

.tmbRev__star {
  width: 16px;
  height: 16px;
  fill: var(--tmbRev-star-off);
  flex-shrink: 0;
}

.tmbRev__star--on {
  fill: var(--tmbRev-star-on);
}

.tmbRev__text {
  margin: 0;
  font-size: 0.97rem;
  color: var(--tmbRev-ink);
  line-height: 1.6;
  /* Ограничиваем высоту, чтобы карточки не разъезжались */
  display: -webkit-box;
  -webkit-line-clamp: 8;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tmbRev__photos {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tmbRev__photo {
  width: 64px;
  height: 64px;
  border-radius: var(--tmbRev-radius-sm);
  overflow: hidden;
  border: 1px solid var(--tmbRev-card-border);
  padding: 0;
  background: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.tmbRev__photo:hover {
  transform: scale(1.05);
}

.tmbRev__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tmbRev__response {
  background: rgba(184, 118, 45, 0.06);
  border-left: 3px solid var(--tmbRev-accent);
  border-radius: 0 var(--tmbRev-radius-sm) var(--tmbRev-radius-sm) 0;
  padding: 12px 14px;
  margin-top: 4px;
}

.tmbRev__responseHead {
  font-size: 0.78rem;
  color: var(--tmbRev-accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  margin-bottom: 4px;
}

.tmbRev__responseText {
  margin: 0;
  font-size: 0.9rem;
  color: var(--tmbRev-ink);
  line-height: 1.5;
}

/* ---------- ACTIONS ---------- */
.tmbRev__actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  margin-top: 24px;
}

.tmbRev__more {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 14px 36px;
  background: var(--tmbRev-ink-strong);
  color: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  letter-spacing: 0.01em;
}

.tmbRev__more:hover {
  background: var(--tmbRev-accent);
}

.tmbRev__more:active {
  transform: scale(0.97);
}

.tmbRev__yaLink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--tmbRev-accent);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.tmbRev__yaLink:hover {
  border-bottom-color: var(--tmbRev-accent);
  color: var(--tmbRev-ink-strong);
}

.tmbRev__yaLink svg {
  flex-shrink: 0;
}

.tmbRev__foot {
  text-align: center;
  font-size: 0.78rem;
  color: var(--tmbRev-ink-soft);
  margin-top: 18px;
  font-style: italic;
}

/* ---------- EMPTY ---------- */
.tmbRev__empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--tmbRev-ink-soft);
}

.tmbRev__empty svg {
  margin: 0 auto 16px;
  opacity: 0.5;
}

.tmbRev__empty h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  color: var(--tmbRev-ink);
  font-weight: 600;
}

.tmbRev__empty p {
  margin: 0;
  font-size: 0.92rem;
}

/* ---------- LIGHTBOX ---------- */
.tmbRev__lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 10, 5, 0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  cursor: zoom-out;
}

.tmbRev__lightbox[hidden] {
  display: none;
}

.tmbRev__lightboxImg {
  max-width: 100%;
  max-height: 90vh;
  border-radius: var(--tmbRev-radius-sm);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  cursor: default;
}

.tmbRev__lightboxClose {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tmbRev__lightboxClose:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 600px) {
  .tmbRev {
    padding: 56px 0;
  }
  .tmbRev__grid {
    grid-template-columns: 1fr;
  }
  .tmbRev__card {
    padding: 20px;
  }
  .tmbRev__stats {
    gap: 18px;
  }
}

/* TIMB compact site override BEGIN */
#tmbRevRoot.tmbRev {
  --tmbRev-bg-from: #f7f8f6;
  --tmbRev-bg-to: #eef2eb;
  --tmbRev-card-bg: #ffffff;
  --tmbRev-card-border: rgba(51, 51, 51, 0.08);
  --tmbRev-card-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  --tmbRev-card-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.08);
  --tmbRev-ink-strong: #333333;
  --tmbRev-ink: #555555;
  --tmbRev-ink-soft: #777777;
  --tmbRev-accent: #5fa832;
  --tmbRev-accent-soft: #dbead1;
  --tmbRev-star-on: #c9953d;
  --tmbRev-radius: 10px;
  --tmbRev-radius-sm: 6px;
  --tmbRev-font-display: inherit;
  --tmbRev-font-body: inherit;
  padding: 42px 0 50px;
  background: linear-gradient(180deg, var(--tmbRev-bg-from) 0%, var(--tmbRev-bg-to) 100%);
}

#tmbRevRoot.tmbRev::before {
  display: none;
}

#tmbRevRoot .tmbRev__inner {
  max-width: 1180px;
}

#tmbRevRoot .tmbRev__head {
  margin-bottom: 24px;
}

#tmbRevRoot .tmbRev__title {
  font-family: inherit;
  font-size: 28px;
  line-height: 1.25;
  font-weight: 700;
  color: #333333;
  margin-bottom: 8px;
}

#tmbRevRoot .tmbRev__sub {
  font-size: 15px;
  line-height: 1.5;
  color: #777777;
}

#tmbRevRoot .tmbRev__stats {
  gap: 44px;
  margin-bottom: 24px;
}

#tmbRevRoot .tmbRev__stat {
  min-width: 96px;
}

#tmbRevRoot .tmbRev__statVal {
  font-family: inherit;
  font-size: 30px;
  line-height: 1.1;
  color: #333333;
}

#tmbRevRoot .tmbRev__statLbl {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: #777777;
}

#tmbRevRoot .tmbRev__grid {
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

#tmbRevRoot .tmbRev__card {
  border-radius: 10px;
  padding: 18px 20px;
  gap: 10px;
  box-shadow: var(--tmbRev-card-shadow);
}

#tmbRevRoot .tmbRev__card::before {
  top: 14px;
  right: 16px;
  opacity: 0.45;
}

#tmbRevRoot .tmbRev__cardHead {
  gap: 10px;
}

#tmbRevRoot .tmbRev__avatar {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #6eae3d 0%, #4e8f24 100%);
  font-size: 13px;
}

#tmbRevRoot .tmbRev__author {
  font-size: 14px;
}

#tmbRevRoot .tmbRev__date {
  font-size: 12px;
}

#tmbRevRoot .tmbRev__text {
  font-size: 14px;
  line-height: 1.55;
}

#tmbRevRoot .tmbRev__more {
  background: #5fa832;
  border-radius: 4px;
  padding: 12px 24px;
  font-size: 13px;
  box-shadow: none;
}

#tmbRevRoot .tmbRev__yaLink {
  color: #5fa832;
  font-size: 14px;
}

#tmbRevRoot .tmbRev__foot {
  font-size: 12px;
  color: #888888;
}

@media (max-width: 767px) {
  #tmbRevRoot.tmbRev {
    padding: 34px 0 88px;
  }

  #tmbRevRoot .tmbRev__inner {
    padding: 0 16px;
  }

  #tmbRevRoot .tmbRev__title {
    font-size: 24px;
  }

  #tmbRevRoot .tmbRev__stats {
    gap: 18px;
  }

  #tmbRevRoot .tmbRev__statVal {
    font-size: 26px;
  }

  #tmbRevRoot .tmbRev__grid {
    grid-template-columns: 1fr;
  }
}
/* TIMB compact site override END */
/* TIMB lower cards override BEGIN */
#tmbRevRoot.tmbRev { padding-top: 26px; padding-bottom: 30px; }
#tmbRevRoot .tmbRev__head { margin-bottom: 14px; }
#tmbRevRoot .tmbRev__title { font-size: 24px; margin-bottom: 5px; }
#tmbRevRoot .tmbRev__sub { font-size: 13px; }
#tmbRevRoot .tmbRev__stats { margin-bottom: 14px; gap: 32px; }
#tmbRevRoot .tmbRev__statVal { font-size: 25px; }
#tmbRevRoot .tmbRev__grid { gap: 10px; }
#tmbRevRoot .tmbRev__card { padding: 12px 16px; gap: 7px; }
#tmbRevRoot .tmbRev__avatar { width: 32px; height: 32px; font-size: 11px; }
#tmbRevRoot .tmbRev__author { font-size: 13px; }
#tmbRevRoot .tmbRev__date { font-size: 11px; }
#tmbRevRoot .tmbRev__star { width: 12px; height: 12px; }
#tmbRevRoot .tmbRev__text { font-size: 13px; line-height: 1.4; -webkit-line-clamp: 2; }
#tmbRevRoot .tmbRev__photo { width: 42px; height: 42px; }
#tmbRevRoot .tmbRev__photo:nth-child(n+5) { display: none; }
@media (max-width: 767px) {
  #tmbRevRoot.tmbRev { padding-top: 22px; padding-bottom: 78px; }
  #tmbRevRoot .tmbRev__title { font-size: 21px; }
  #tmbRevRoot .tmbRev__stats { gap: 12px; }
  #tmbRevRoot .tmbRev__statVal { font-size: 23px; }
  #tmbRevRoot .tmbRev__card { padding: 12px 14px; }
  #tmbRevRoot .tmbRev__photo { width: 40px; height: 40px; }
}
/* TIMB lower cards override END */
