/* Мелкие правила, которые проще написать руками (Tailwind-утилиты не нужны) */
.nav-link-active { color: var(--color-brand-600); font-weight: 600; }

/* === Тёмная тема (страница /blog, стиль imperiya_motors_landing.html) === */
/* Активная навигация на тёмном фоне */
.theme-dark .nav-link-active { color: var(--color-gold-light); font-weight: 600; }

/* Градиентный золотой текст (как в лендинге) */
.gold-text {
  background: linear-gradient(120deg, #9f7b36, #f2dda5 48%, #b78d43);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Медленная пульсация изображения (Блок 2 главной, style: imperiya_motors_landing) */
@keyframes slow-pulse {
  from { transform: scale(1); }
  to { transform: scale(1.045); }
}
.pulse-slow {
  animation: slow-pulse 6s ease-in-out infinite alternate;
}

@media (prefers-reduced-motion: reduce) {
  .pulse-slow { animation: none; }
}

/* Тонкая сетка на фоне hero-секции */
.grid-bg {
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 42px 42px;
  -webkit-mask-image: linear-gradient(to bottom, black, transparent 80%);
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}

/* === Блок «Слева информация справа Анимация» (главная, info-animation) === */
/* Пульсирующая точка бейджа */
@keyframes ia-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(201, 164, 92, .6); }
  70%  { box-shadow: 0 0 0 10px rgba(201, 164, 92, 0); }
  100% { box-shadow: 0 0 12px #c9a45c; }
}
.ia-badge-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #c9a45c;
  box-shadow: 0 0 12px #c9a45c;
  animation: ia-pulse 2s ease-out infinite;
}

/* Плавающие свечения фона */
@keyframes ia-float1 { 50% { transform: translate(70px, 50px) scale(1.15); } }
@keyframes ia-float2 { 50% { transform: translate(-70px, -50px) scale(1.1); } }
.ia-glow-1 { animation: ia-float1 15s ease-in-out infinite; }
.ia-glow-2 { animation: ia-float2 19s ease-in-out infinite; }

/* Пробегающие «световые полоски» */
@keyframes ia-streak {
  0%   { transform: translateX(0); opacity: 0; }
  12%  { opacity: .9; }
  88%  { opacity: .9; }
  100% { transform: translateX(145vw); opacity: 0; }
}
.ia-streak {
  position: absolute; left: -20%;
  height: 1px; width: 190px;
  background: linear-gradient(90deg, transparent, rgba(234, 211, 154, .7), transparent);
  opacity: 0;
  animation: ia-streak 6.5s linear infinite;
}

/* Изображение справа: въезд слева + «дыхание» */
@keyframes ia-drivein { from { transform: translateX(-85%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes ia-idle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.ia-drivein {
  animation: ia-drivein 1.5s cubic-bezier(.16, .9, .28, 1) .15s both;
}
.ia-idle {
  filter: drop-shadow(0 26px 34px rgba(0, 0, 0, .65));
  animation: ia-idle 3.4s ease-in-out 1.9s infinite;
}

@media (prefers-reduced-motion: reduce) {
  .ia-badge-dot, .ia-glow-1, .ia-glow-2, .ia-streak, .ia-drivein, .ia-idle {
    animation: none;
  }
}


/* === Модалка прайса (страница /services, style: preview2.html) === */
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalUp { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-overlay { animation: modalFade .25s ease-out both; }
.modal-panel { animation: modalUp .3s cubic-bezier(.16, 1, .3, 1) both; }
.modal-overlay.closing { animation: modalFade .2s ease-in both reverse; }
.modal-panel.closing { animation: modalUp .2s ease-in both reverse; }
@media (prefers-reduced-motion: reduce) {
  .modal-overlay, .modal-panel { animation-duration: .01s; }
}

/* Кастомный скроллбар списка цен */
.price-scroll {
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 164, 92, .55) rgba(255, 255, 255, .05);
}
.price-scroll::-webkit-scrollbar { width: 8px; }
.price-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, .04);
  border-radius: 999px;
  margin: 6px 0;
}
.price-scroll::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(201, 164, 92, .85), rgba(201, 164, 92, .45));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background .2s;
}
.price-scroll::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #f2dda5, #c9a45c);
  background-clip: padding-box;
  border: 2px solid transparent;
}

/* Пунктирный «лидер» между названием работы и ценой */
.price-row .leader {
  flex: 1;
  margin: 0 12px;
  border-bottom: 1px dotted rgba(255, 255, 255, .18);
  transform: translateY(-5px);
}

/* ============================================================
   imp-prav.ru (задача clone-imp-prav, TZ 10/11/12)
   ============================================================ */

/* Syne — крупный гротеск для H1 hero (как в оригинале) */
.font-syne { font-family: "Syne", var(--font-sans); }

/* Бейдж секций: тёмная плашка, золотая рамка, иконки-«кандалы» по бокам */
.ipr-badge {
  display: inline-flex; align-items: center; gap: .65rem;
  padding: .5rem 1.1rem;
  border: 1px solid rgba(201, 162, 99, .45);
  border-radius: 6px;
  background: rgba(255, 255, 255, .03);
  color: var(--color-ipr-gold-soft);
  font-size: .8rem; letter-spacing: .08em;
}
.ipr-badge img { width: 14px; height: 14px; opacity: .8; }

/* Золотая кнопка imp-prav */
.ipr-btn-gold {
  display: inline-block;
  padding: .95rem 2.2rem;
  border-radius: 4px;
  background: var(--color-ipr-gold);
  color: #fff;
  font-weight: 600; font-size: .95rem;
  transition: background .25s, transform .25s;
}
.ipr-btn-gold:hover { background: var(--color-ipr-gold-soft); transform: translateY(-1px); }

/* ipr-services: появление картинки (wow.js в оригинале) + горизонтальный параллакс.
   Кropping-обёртки нет: картинка — прозрачный PNG, сдвиг на 80px вправо не оголяет краёв. */
.ipr-px-reveal {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition: opacity .9s ease .12s, transform .9s ease .12s;
  will-change: transform, opacity;
}
.ipr-px-reveal.is-in {
  opacity: 1;
  /* transform дальше управляет параллакс (translate3d по X) */
  transition: opacity .9s ease .12s;
}

/* Заголовок страницы (внутренние страницы): фон + хлебные крошки */
.ipr-page-title {
  position: relative;
  padding: 6.5rem 0 4rem;
  background-color: var(--color-ipr-bg-deep);
  background-size: cover; background-position: center;
}
.ipr-page-title::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(16, 27, 29, .55), rgba(21, 37, 39, .82));
}
.ipr-page-title > * { position: relative; z-index: 1; }

/* Бегущие строки (ipr-marquee): две наклонённые пересекающиеся полосы.
   Оригинал imp-prav.ru (pxl_text_slip): золотая #C89D66 rotate(-5deg), absolute
   top:-60px, белая Lora 68px/123px, иконка 82px (margin 0 60px — равный отступ
   от текста с обеих сторон); синяя #091C36 rotate(3deg), текст/иконки #DBB079.
   Контент дублируется ×4, анимация translateX(0 → -50%) — бесшовный
   бесконечный цикл: золотая едет влево, синяя — вправо (reverse).
   Полосы шире вьюпорта на 50/40px (отрицательные боковые margin). */
@keyframes ipr-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.ipr-marquee { position: relative; height: 123px; }
.ipr-marquee-band {
  display: flex; align-items: center;
  overflow: hidden; white-space: nowrap;
}
.ipr-marquee-band--gold {
  position: absolute; top: -60px; bottom: 60px; left: 0; right: 0;
  margin: 0 -50px; z-index: 9;
  background-color: #c89d66;
  transform: rotate(-5deg);
}
.ipr-marquee-band--navy {
  position: relative;
  z-index: 9; /* в оригинале обе полосы z-9: синяя (позже в DOM) перекрывает золотую */
  margin: 0 -40px;
  background-color: #091c36;
  transform: rotate(3deg);
}
.ipr-marquee-inner {
  display: flex; align-items: center;
  flex: 0 0 auto; /* не сжиматься до ширины полосы — иначе иконки наезжают на текст */
  height: 100%;
  will-change: transform;
}
.ipr-marquee-band--gold .ipr-marquee-inner { animation: ipr-marquee 45s linear infinite; }
.ipr-marquee-band--navy .ipr-marquee-inner { animation: ipr-marquee 55s linear infinite reverse; }
.ipr-marquee-item {
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; /* контент не сжимать: равный отступ 60px от иконки с обеих сторон */
  font-family: var(--font-serif); font-weight: 400;
  font-size: 68px; line-height: 123px;
  white-space: nowrap;
}
.ipr-marquee-band--gold .ipr-marquee-item { color: #ffffff; }
.ipr-marquee-band--navy .ipr-marquee-item { color: #dbb079; }
.ipr-marquee-icon { width: 82px; height: auto; margin: 0 60px; }
@media (max-width: 1024px) {
  .ipr-marquee { height: 90px; }
  .ipr-marquee-band--gold { top: -58px; bottom: 58px; transform: rotate(-9deg); }
  .ipr-marquee-band--navy { transform: rotate(6deg); }
  .ipr-marquee-item { font-size: 48px; line-height: 90px; }
  .ipr-marquee-icon { width: 65px; }
}
@media (prefers-reduced-motion: reduce) {
  .ipr-marquee-inner { animation: none; }
}

/* Вращающиеся кольца с точкой в hero (оригинал imp-prav.ru: .pxl-circle .circle.spin_on).
   Два кольца (белое/золотое) у левого края нижней фото-панели, точка бежит по окружности. */
@keyframes ipr-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.ipr-spin {
  position: absolute;
  border: 2px solid;
  border-radius: 50%;
  pointer-events: none;
  animation: ipr-spin 5s linear infinite;
  will-change: transform;
}
.ipr-spin::after {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  border-radius: 50%;
}
.ipr-spin--white {
  width: 306px; height: 306px;
  left: -114px; top: -175px;
  border-color: rgba(255, 255, 255, .9);
}
.ipr-spin--white::after { background: #fff; }
.ipr-spin--gold {
  width: 354px; height: 354px;
  left: -100px; top: -199px;
  border-color: #c89d66;
}
.ipr-spin--gold::after { background: #c89d66; }
@media (prefers-reduced-motion: reduce) {
  .ipr-spin { animation: none; }
}

/* Чек-лист блока ipr-services */
.ipr-check { display: flex; align-items: flex-start; gap: .6rem; }
.ipr-check::before {
  content: "✔";
  color: var(--color-ipr-gold);
  font-size: .95rem; line-height: 1.7;
}

/* Карточка новости (ipr-news / лента /blog) */
.ipr-news-card {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: #fff;
  color: #1c2b2d;
  transition: border-color .3s, transform .3s;
}
.ipr-news-card:hover { border-color: rgba(201, 162, 99, .55); transform: translateY(-3px); }
.ipr-news-card .card-img { aspect-ratio: 4 / 5; width: 100%; object-fit: cover; }
.ipr-news-card .card-more {
  display: inline-flex; align-items: center; gap: .55rem;
  color: #1c2b2d; font-weight: 700; font-size: .85rem; letter-spacing: .06em;
}
.ipr-news-card .card-more .arr {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--color-ipr-gold); color: #fff;
  transition: transform .25s;
}
.ipr-news-card:hover .card-more .arr { transform: translateX(4px); }
.ipr-news-card .card-img-ph {
  aspect-ratio: 4 / 5; width: 100%;
  display: flex; align-items: center; justify-content: center;
  background: #e9e4da; color: rgba(28, 43, 45, .3); font-size: 2.25rem;
}
/* Варианты отображения записей /news (settings.news_layout):
   grid — 3 в ряд (по умолчанию), stack — 1 в ряд (картинка сверху),
   list — 1 в ряд (картинка слева, текст справа) */
#news-grid.nl-stack, #news-grid.nl-list { display: flex; flex-direction: column; }
.ipr-news-card.nl-stack .card-img,
.ipr-news-card.nl-stack .card-img-ph { aspect-ratio: 21 / 9; }
.ipr-news-card.nl-list { display: flex; flex-direction: column; }
.ipr-news-card.nl-list .card-img,
.ipr-news-card.nl-list .card-img-ph { aspect-ratio: 4 / 3; }
@media (min-width: 640px) {
  .ipr-news-card.nl-list { flex-direction: row; }
  .ipr-news-card.nl-list .card-img,
  .ipr-news-card.nl-list .card-img-ph { width: 18rem; flex: 0 0 18rem; }
}

/* Accordion FAQ (страница /faqs) — карточки на тёмном фоне с золотыми акцентами */
#faq-list, #service-accordion { display: flex; flex-direction: column; gap: .9rem; }
.ipr-faq-item {
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015) 45%), var(--color-ipr-bg-deep, #101b1d);
  overflow: hidden;
  transition: border-color .25s, background .25s;
}
.ipr-faq-item:hover { border-color: rgba(201, 162, 99, .35); }
.ipr-faq-item.open {
  border-color: rgba(201, 162, 99, .5);
  background: linear-gradient(160deg, rgba(201, 162, 99, .09), rgba(255, 255, 255, .02) 55%), var(--color-ipr-bg-deep, #101b1d);
}
.ipr-faq-q {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1.15rem 1.4rem; text-align: left;
  color: #fff; font-family: var(--font-serif); font-size: 1.15rem; line-height: 1.4;
  background: none; border: 0; cursor: pointer;
}
.ipr-faq-q .faq-ico {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid rgba(201, 162, 99, .5);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--color-ipr-gold); font-size: 1.1rem; line-height: 1;
  transition: transform .25s, background .25s;
}
.ipr-faq-item.open .faq-ico { transform: rotate(45deg); background: rgba(201, 162, 99, .15); }
/* Плавное раскрытие как на imp-prav.ru (jQuery slideToggle 400): grid 0fr→1fr.
   Три уровня: .ipr-faq-a — grid-контейнер (0fr/1fr), .ipr-faq-a-in — клип
   (overflow:hidden, min-height:0, БЕЗ padding/margin — иначе трек не схлопнется
   до 0: мин. размер трека = padding+margin), .ipr-faq-a-box — вся визуальная
   «коробка» (padding/фон/margin), при закрытии целиком срезается клипом. */
.ipr-faq-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .4s ease;
}
.ipr-faq-a-in {
  min-height: 0;
  overflow: hidden;
}
.ipr-faq-a-box {
  margin: 0 1.4rem 1.2rem; padding: 1.05rem 1.2rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, .035);
  color: #c8d4d4; line-height: 1.75;
}
.ipr-faq-item.open .ipr-faq-a { grid-template-rows: 1fr; }
.ipr-faq-a p { margin: 0 0 .8rem; }
.ipr-faq-a p:last-child, .ipr-faq-a ul:last-child { margin-bottom: 0; }
.ipr-faq-a ul { margin: 0 0 .8rem; padding-left: 1.2rem; list-style: disc; }

/* Статуэтка (Справедливость) в шапке /services — как в оригинале imp-prav.ru
   (div.pxl-item--image.s_img, logo-svg-pagetitle.svg). В оригинале тёмный контур
   на светлом фоне; у нас тёмный hero — контур инвертируем,
   чтобы водяной знак читался на тёмном фоне. */
.ipr-statue-img { filter: invert(1); }

/* Текст статьи (страница /news/:slug) — карточка в стиле сайта (как FAQ) */
.ipr-article-card {
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .015) 45%), var(--color-ipr-bg-deep, #101b1d);
  padding: 1.6rem 1.4rem;
}
@media (min-width: 640px) {
  .ipr-article-card { padding: 2.2rem 2.4rem; }
}
.ipr-article { color: #c8d4d4; font-size: 1rem; line-height: 1.8; }
.ipr-article p { margin: 0 0 1.1rem; }
.ipr-article b, .ipr-article strong { color: #fff; }
.ipr-article ul, .ipr-article ol { margin: 0 0 1.1rem; padding-left: 1.4rem; }
.ipr-article ul { list-style: disc; }
.ipr-article ol { list-style: decimal; }
.ipr-article li { margin: 0 0 .5rem; }
.ipr-article img { max-width: 100%; border-radius: 10px; }

/* Прелоадер (все публичные страницы) — та же анимация, что в оригинале imp-prav.ru
   (тема lawna, .pxl-loader.style-2): тёмный fullscreen-слой, круг в центре,
   вращающаяся градиентная дуга, логотип посередине. Стили — здесь,
   логика (создание/скрытие) — js/common.js (initPreloader).
   Дуга — золотая (акцент сайта #c9a263), вместо белой из оригинала. */
#ipr-preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #101b1d;
  transition: opacity .5s ease, visibility .5s ease;
}
#ipr-preloader.is-loaded { opacity: 0; visibility: hidden; }
/* Круг 300px (в оригинале 120px): наш логотип широкий (2499x504, ~5:1) и
   в 120px не помещается. Маска/линия/transform-origin масштабированы
   пропорционально (оригинал: 120px круг, маска 30px, origin 60px). */
#ipr-preloader .loader-circle {
  width: 300px;
  height: 300px;
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  margin: auto;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
  border-radius: 100%;
  direction: ltr;
}
#ipr-preloader .loader-line-mask {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 75px;
  height: 300px;
  margin-left: -150px;
  margin-top: -150px;
  overflow: hidden;
  transform-origin: 150px 150px;
  animation: ipr-preloader-spin 1.2s infinite linear;
}
#ipr-preloader .loader-line-mask .loader-line {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background-image: linear-gradient(to bottom, rgba(201, 162, 99, .9), rgba(201, 162, 99, 0));
  position: relative;
}
#ipr-preloader .loader-line-mask .loader-line:before {
  content: '';
  position: absolute;
  top: 1px; left: 1px; right: 1px; bottom: 1px;
  background-color: #101b1d;
  z-index: 99;
  border-radius: inherit;
}
#ipr-preloader .loader-logo {
  position: absolute;
  top: 50%;
  transform: translate(0, -50%);
  left: 0;
  right: 0;
  /* flex, а не text-align: center — Tailwind preflight делает img display:block,
     из-за чего text-align логотип не центрировал (в оригинальной теме нет Tailwind). */
  display: flex;
  align-items: center;
  justify-content: center;
}
#ipr-preloader .loader-logo img {
  height: 48px;
  width: auto;
  opacity: .87;
}
@keyframes ipr-preloader-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
