/*
Theme Name: Tori Work
Description: Рабочая копия темы Tori для безопасных правок сайта Тори-Групп. Самодостаточная тема, не требует родительской темы.
Version: 4.0.0
Text Domain: tori-work
*/

/* ===== Главная: блок кейсов ===== */
.cases-home {
  background: #484541;
  border-radius: 40px;
  padding: 28px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.cases-home .widget-gallery {
  margin-left: 0;
  margin-right: 0;
}

.widget-gallery-item > a {
  margin: 0;
  padding: 11px;
  border-radius: 30px;
  text-decoration: none;
  display: block;
  color: #fff;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.widget-gallery-item > a:hover {
  background-color: var(--primary, #ff7a00);
  color: #fff;
}

.cases-home__all {
  align-self: flex-start;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ===== Архив /cases/ ===== */
.cases-archive {
  padding-bottom: 80px;
}

.cases-archive__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.cases-archive__card {
  margin: 0;
}

.cases-archive__link {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.cases-archive__image {
  aspect-ratio: 3 / 4;
  border-radius: 28px;
  background-size: cover;
  background-position: center;
  background-color: #484541;
}

.cases-archive__image--empty {
  background: linear-gradient(160deg, #5a5753, #2f2d2b);
}

.cases-archive__title {
  color: inherit;
}

.cases-archive__link:hover .cases-archive__title {
  color: var(--primary, #ff7a00);
}

/* ===== Single кейс ===== */
.cases-single {
  padding-bottom: 80px;
}

.cases-single__back {
  text-decoration: none;
  width: fit-content;
}

.cases-single__back:hover {
  color: var(--primary, #ff7a00);
}

.cases-single__cover {
  width: 100%;
  min-height: 420px;
  border-radius: 32px;
  background-size: cover;
  background-position: center;
  background-color: #484541;
}

.cases-single__meta {
  margin: 0;
  max-width: 820px;
}

.cases-single__meta-row {
  margin: 0;
}

.cases-single__meta-row dt,
.cases-single__meta-row dd {
  margin: 0;
}

.cases-single__meta-row dt {
  margin-bottom: 6px;
}

.cases-single__gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.cases-single__gallery-item {
  margin: 0;
  border-radius: 24px;
  overflow: hidden;
  background: #484541;
}

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

.cases-single__content {
  max-width: 820px;
  line-height: 1.45;
}

.cases-single__content p,
.cases-single__content li,
.cases-single__content dd {
  line-height: 1.45;
  margin: 0 0 0.85em;
}

.cases-single__content ul,
.cases-single__content ol {
  margin: 0 0 1em;
  padding-left: 1.25em;
}

.cases-single__content li + li {
  margin-top: 0.35em;
}

.cases-single__content h1,
.cases-single__content h2,
.cases-single__content h3,
.cases-single__content h4 {
  line-height: 1.25;
  margin: 1.25em 0 0.5em;
  font-weight: 700;
}

.cases-single__content h2:first-child,
.cases-single__content h3:first-child {
  margin-top: 0;
}

.cases-single__meta-row dd {
  line-height: 1.4;
}

.cases-single > h1 {
  line-height: 1.2;
}

.cases-archive .navigation.pagination {
  margin-top: 40px;
}

.cases-archive .navigation.pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cases-archive .navigation.pagination a,
.cases-archive .navigation.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.08);
}

.cases-archive .navigation.pagination .current {
  background: var(--primary, #ff7a00);
  color: #fff;
}

@media (max-width: 1000px) {
  .cases-home {
    border-radius: 28px;
    padding: 18px;
    gap: 18px;
  }

  .cases-archive__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  .cases-single__cover {
    min-height: 280px;
    border-radius: 24px;
  }

  .cases-single__gallery {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .cases-archive__grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Главная: блок клиентов ===== */
#about-us,
#reviews,
#cases,
#articles {
  scroll-margin-top: 120px;
}

.reviews-home {
  background: #484541;
  border-radius: 40px;
  padding: 28px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.reviews-home__track {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  overflow: auto;
  gap: 24px;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 16px;
  cursor: grab;
  user-select: none;
}

.reviews-home__track.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

.reviews-home__track img {
  -webkit-user-drag: none;
  pointer-events: none;
}

.reviews-home__track::-webkit-scrollbar {
  height: 12px;
}

.reviews-home__track::-webkit-scrollbar-track {
  background: #5b5b5b;
  border-radius: 30px;
}

.reviews-home__track::-webkit-scrollbar-thumb {
  background: var(--primary, #f17e01);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.reviews-home__all {
  align-self: flex-start;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

html.no-reviews .widget-header-desktop-menu li:has(a[href="/#reviews"]),
html.no-reviews .widget-header-mobile-menu a[href="/#reviews"] {
  display: none;
}

.reviews-card {
  flex: 0 0 380px;
  width: 380px;
  box-sizing: border-box;
  background: #2f2d2b;
  border-radius: 30px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.reviews-card__media {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #484541;
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reviews-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
}

.reviews-card__media--default img {
  width: 42%;
  height: auto;
  max-height: 70%;
  object-fit: contain;
  padding: 0;
}

.reviews-card__text {
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow: hidden;
  max-height: 5.6em;
}

.reviews-card__footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
}

.reviews-card__author {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.reviews-card__author p {
  margin: 0;
}

.reviews-card__role {
  color: rgba(255, 255, 255, 0.62);
}

.reviews-card__more {
  flex-shrink: 0;
  color: inherit;
  text-underline-offset: 3px;
}

.reviews-card__more:hover {
  color: var(--primary, #f17e01);
}

/* ===== Архив /reviews/ ===== */
.reviews-archive {
  padding-bottom: 80px;
}

.reviews-archive__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.reviews-archive__grid .reviews-card {
  flex: none;
  width: auto;
  min-width: 0;
  height: 100%;
}

.reviews-archive .navigation.pagination {
  margin-top: 40px;
}

.reviews-archive .navigation.pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.reviews-archive .navigation.pagination a,
.reviews-archive .navigation.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.08);
}

.reviews-archive .navigation.pagination .current {
  background: var(--primary, #ff7a00);
  color: #fff;
}

/* ===== Single клиент ===== */
.reviews-single {
  padding-bottom: 80px;
}

.reviews-single__back {
  text-decoration: none;
  width: fit-content;
}

.reviews-single__back:hover {
  color: var(--primary, #ff7a00);
}

.reviews-single__cover {
  width: 100%;
  min-height: 420px;
  border-radius: 32px;
  background-size: cover;
  background-position: center;
  background-color: #484541;
}

.reviews-single__cover--default {
  background-size: 220px;
  background-repeat: no-repeat;
  background-position: center;
}

.reviews-single__meta {
  margin: 0;
  max-width: 820px;
}

.reviews-single__meta-row {
  margin: 0;
}

.reviews-single__meta-row dt,
.reviews-single__meta-row dd {
  margin: 0;
}

.reviews-single__meta-row dt {
  margin-bottom: 6px;
}

.reviews-single__content {
  max-width: 820px;
  line-height: 1.45;
}

.reviews-single__content p,
.reviews-single__content li,
.reviews-single__content dd {
  line-height: 1.45;
  margin: 0 0 0.85em;
}

.reviews-single__content ul,
.reviews-single__content ol {
  margin: 0 0 1em;
  padding-left: 1.25em;
}

.reviews-single > h1 {
  line-height: 1.2;
}

@media (max-width: 1000px) {
  .reviews-home {
    border-radius: 28px;
    padding: 18px;
    gap: 18px;
  }

  .reviews-card {
    flex-basis: 300px;
    width: 300px;
    border-radius: 24px;
    padding: 18px;
  }

  .reviews-archive__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  .reviews-single__cover {
    min-height: 280px;
    border-radius: 24px;
  }
}

@media (max-width: 640px) {
  .reviews-archive__grid {
    grid-template-columns: 1fr;
  }

  .reviews-home__track {
    gap: 14px;
  }

  .reviews-card {
    flex-basis: 280px;
    width: 280px;
  }
}

/* ===== Главная: блок статей ===== */
.articles-home {
  background: #484541;
  border-radius: 40px;
  padding: 28px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.articles-home__track {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  overflow: auto;
  gap: 24px;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 16px;
  cursor: grab;
  user-select: none;
}

.articles-home__track.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

.articles-home__track img {
  -webkit-user-drag: none;
  pointer-events: none;
}

.articles-home__track::-webkit-scrollbar {
  height: 12px;
}

.articles-home__track::-webkit-scrollbar-track {
  background: #5b5b5b;
  border-radius: 30px;
}

.articles-home__track::-webkit-scrollbar-thumb {
  background: var(--primary, #f17e01);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.articles-home__all {
  align-self: flex-start;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

html.no-articles .widget-header-desktop-menu li:has(a[href="/#articles"]),
html.no-articles .widget-header-mobile-menu a[href="/#articles"] {
  display: none;
}

.articles-card {
  flex: 0 0 380px;
  width: 380px;
  box-sizing: border-box;
  background: #2f2d2b;
  border-radius: 30px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.articles-card__media {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #484541;
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.articles-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
}

.articles-card__title {
  margin: 0;
  line-height: 1.3;
}

.articles-card__text {
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow: hidden;
  max-height: 5.6em;
}

.articles-card__footer {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 16px;
  margin-top: auto;
}

.articles-card__more {
  flex-shrink: 0;
  color: inherit;
  text-underline-offset: 3px;
}

.articles-card__more:hover {
  color: var(--primary, #f17e01);
}

/* ===== Архив /articles/ ===== */
.articles-archive {
  padding-bottom: 80px;
}

.articles-archive__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.articles-archive__grid .articles-card {
  flex: none;
  width: auto;
  min-width: 0;
  height: 100%;
}

.articles-archive .navigation.pagination {
  margin-top: 40px;
}

.articles-archive .navigation.pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.articles-archive .navigation.pagination a,
.articles-archive .navigation.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.08);
}

.articles-archive .navigation.pagination .current {
  background: var(--primary, #ff7a00);
  color: #fff;
}

/* ===== Single статья ===== */
.articles-single {
  padding-bottom: 80px;
}

.articles-single__back {
  text-decoration: none;
  width: fit-content;
}

.articles-single__back:hover {
  color: var(--primary, #ff7a00);
}

.articles-single__date {
  margin: 0;
}

.articles-single__cover {
  width: 100%;
  min-height: 420px;
  border-radius: 32px;
  background-size: cover;
  background-position: center;
  background-color: #484541;
}

.articles-single__content {
  max-width: 820px;
  line-height: 1.45;
}

.articles-single__content p,
.articles-single__content li,
.articles-single__content dd {
  line-height: 1.45;
  margin: 0 0 0.85em;
}

.articles-single__content ul,
.articles-single__content ol {
  margin: 0 0 1em;
  padding-left: 1.25em;
}

.articles-single > h1 {
  line-height: 1.2;
}

@media (max-width: 1000px) {
  .articles-home {
    border-radius: 28px;
    padding: 18px;
    gap: 18px;
  }

  .articles-card {
    flex-basis: 300px;
    width: 300px;
    border-radius: 24px;
    padding: 18px;
  }

  .articles-archive__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  .articles-single__cover {
    min-height: 280px;
    border-radius: 24px;
  }
}

@media (max-width: 640px) {
  .articles-archive__grid {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }

  .articles-home__track {
    gap: 14px;
  }

  .articles-card {
    flex-basis: 280px;
    width: 280px;
  }
}

/* ===== Страница /prices/ ===== */
.prices-page {
  padding-bottom: 80px;
}

.prices-toc a:hover {
  color: var(--primary, #ff7a00);
}

.prices-service,
.prices-view,
widget-card-product[id^="price-"] {
  scroll-margin-top: 120px;
}

.prices-view__table {
  overflow-x: auto;
}

.prices-view__about {
  align-self: flex-start;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
}

.prices-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--primary, #f17e01);
  color: #fff;
  display: grid;
  place-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, background-color 0.2s ease;
}

.prices-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.prices-to-top:hover {
  color: #fff;
  background-color: #d96e00;
}

/* Карточки услуг: фото на весь контейнер + вуаль под белый текст (класс light) */
widget-card-service.card {
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

widget-card-service.light::before,
widget-card-service[type="light"]::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(
    180deg,
    rgba(28, 24, 22, 0.28) 0%,
    rgba(28, 24, 22, 0.5) 100%
  );
}

widget-card-service.light > *:not(.card-tool, .card-service-link),
widget-card-service[type="light"] > *:not(.card-tool, .card-service-link),
widget-card-service.dark > *:not(.card-tool, .card-service-link) {
  position: relative;
  z-index: 1;
}

widget-card-service.light .card-tool,
widget-card-service[type="light"] .card-tool,
widget-card-service.dark .card-tool {
  z-index: 2;
}

widget-card-service .card-service-link {
  z-index: 4;
}

/* Карточки dark: светлая вуаль, чтобы серый текст не тонул в бликах фото */
widget-card-service.dark::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 252, 248, 0.38) 0%,
    rgba(255, 252, 248, 0.68) 100%
  );
}

widget-card-service.dark .text-color-auto {
  color: #2a2a2a !important;
}

widget-card-service.dark .widget-card-service-button {
  background-color: var(--gray, #5b5b5b);
  color: #fff;
}

/* Страница услуги: фон только у шапки+hero, чуть заходит под «Виды» */
.service-hero {
  position: relative;
  z-index: 0;
  background-image: var(--service-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding-bottom: 160px;
  margin-bottom: -160px;
}

.service-hero.light {
  background-image:
    linear-gradient(90deg, rgba(22, 18, 16, 0.62) 0%, rgba(22, 18, 16, 0.32) 42%, rgba(22, 18, 16, 0.18) 100%),
    var(--service-bg);
}

.service-hero.dark {
  background-image:
    linear-gradient(90deg, rgba(255, 252, 248, 0.82) 0%, rgba(255, 252, 248, 0.48) 36%, rgba(255, 252, 248, 0.16) 68%, rgba(255, 252, 248, 0.08) 100%),
    var(--service-bg);
}

.service-hero.dark .text-color-auto {
  color: #2a2a2a !important;
}

.service-hero.dark .color-gray {
  color: #2a2a2a;
}

/*
 * Hero dark: ореол иконок/текста + вуаль снизу (2026-08-16).
 * Откат: удалить этот блок целиком — сработают правила выше.
 * Было: вуаль только слева направо; иконки .dark .img-color-invert { filter: invert(67%) }.
 */
.service-hero.dark {
  background-image:
    linear-gradient(180deg, transparent 42%, rgba(255, 252, 248, 0.5) 100%),
    linear-gradient(90deg, rgba(255, 252, 248, 0.82) 0%, rgba(255, 252, 248, 0.48) 36%, rgba(255, 252, 248, 0.16) 68%, rgba(255, 252, 248, 0.08) 100%),
    var(--service-bg);
}

.service-hero.dark .img-color-invert {
  filter:
    invert(1)
    drop-shadow(0 0 1px rgba(255, 252, 248, 0.95))
    drop-shadow(0 0 1px rgba(255, 252, 248, 0.75))
    drop-shadow(0 2px 2px rgba(255, 252, 248, 0.75));
    /* filter: invert(77%); */
}

.service-hero.dark .text-color-auto {
  text-shadow:
    0 0 6px rgba(255, 252, 248, 0.95),
    0 1px 12px rgba(255, 252, 248, 0.8);
}

.service-hero.dark .js-order-call,
.service-hero.dark .js-order-call * {
  text-shadow: none;
}

.service-page .section-radius {
  position: relative;
  z-index: 1;
}
