/*
  Базовая тема SilverSmoke*RU.

  Цели этой версии:
  - аккуратный премиальный тёмный интерфейс,
  - единые отступы и карточки,
  - нормальная адаптивная шапка без «разъезда» по экрану,
  - совместимость с текущими шаблонами CRM / блога / котят.
*/

:root {
  --bg: #07090c;
  --bg2: #0c1016;
  --card: #0d1219;
  --card2: #0b0f15;
  --text: #e8edf5;
  --muted: #a8b3c5;
  --line: rgba(255, 255, 255, 0.08);
  --line2: rgba(255, 255, 255, 0.14);
  --accent: #d7dbe3;
  --accent2: #9fb3d9;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 0% -5%, rgba(159, 179, 217, 0.16), transparent 58%),
    radial-gradient(900px 520px at 100% 10%, rgba(215, 219, 227, 0.12), transparent 56%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.16;
  background:
    radial-gradient(900px 500px at 72% 14%, rgba(255, 255, 255, 0.18), transparent 60%),
    url("../img/brand/smoke-overlay.webp");
  background-size: cover;
  background-position: center;
  mix-blend-mode: screen;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/*
  Медиа-элементы не должны вылезать за пределы карточек и richtext-блоков
  на смартфонах. Для видео/iframe оставляем только ограничение по ширине,
  а для изображений дополнительно фиксируем auto-height, чтобы они не
  растягивались по высоте при адаптивном уменьшении.
*/
picture,
video,
canvas,
svg,
iframe {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-main {
  padding-top: 18px;
  padding-bottom: 56px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  padding: 12px 0;
  background: rgba(7, 9, 12, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-shell {
  position: relative;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 0 1 320px;
}

.brand__mark {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.34);
  object-fit: cover;
}

.brand__copy {
  min-width: 0;
}

.brand__title {
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.brand__subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav__links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  flex-wrap: wrap;
}

.nav__links a {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted);
  transition: 0.18s ease;
}

.nav__links a:hover,
.nav__links a.active {
  color: var(--text);
  border-color: var(--line2);
  background: rgba(255, 255, 255, 0.05);
}

.nav__tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex: 0 1 240px;
}

.lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.lang a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--muted);
}

.lang a.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.header-admin-link {
  white-space: nowrap;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero__bg,
.hero__overlay {
  position: absolute;
  inset: 0;
}

.hero__bg {
  background-image: url("../img/brand/hero-1920.webp");
  background-size: cover;
  background-position: center;
  transform: scale(1.03);
  filter: saturate(0.88) contrast(1.04);
}

.hero__overlay {
  background:
    linear-gradient(90deg, rgba(7, 9, 12, 0.94) 0%, rgba(7, 9, 12, 0.78) 46%, rgba(7, 9, 12, 0.3) 100%),
    linear-gradient(180deg, rgba(7, 9, 12, 0.24) 0%, rgba(7, 9, 12, 0.92) 100%);
}

.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 380px);
  gap: 28px;
  align-items: center;
  padding: 84px 0 72px;
}

.hero__content {
  max-width: 760px;
}

.eyebrow,
.card__eyebrow {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent2);
}

.hero h1 {
  margin: 12px 0 0;
  max-width: 100%;
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 6vw, 74px);
  line-height: 0.95;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hero__lead {
  margin-top: 18px;
  font-size: 17px;
  line-height: 1.78;
  color: var(--muted);
  max-width: 760px;
}

.hero__lead p {
  margin: 0;
}

.hero__lead .richtext p,
.hero__lead p + p {
  margin-top: 12px;
}

.hero__cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.hero-panel {
  display: flex;
  justify-content: flex-end;
}

.hero-panel__card {
  width: 100%;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line2);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  box-shadow: var(--shadow);
}

.hero-panel__title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent2);
}

.hero-panel__list {
  margin: 16px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
  transition: 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.1);
}

.btn--ghost,
.btn.secondary {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
  box-shadow: none;
}

.btn--ghost:hover,
.btn.secondary:hover {
  color: var(--text);
  border-color: var(--line2);
  background: rgba(255, 255, 255, 0.04);
}

/* ---------- Sections ---------- */
.section {
  padding: 26px 0;
}

.section--compact {
  padding-top: 24px;
}

.section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section__title {
  margin: 0;
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.feature-grid,
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.feature-card,
.card {
  grid-column: span 12;
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.025));
  box-shadow: var(--shadow);
}

.feature-card p,
.card p,
.p {
  margin: 0;
  color: var(--muted);
  line-height: 1.72;
}

.card {
  transition: 0.18s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--line2);
}

.card h3 {
  margin: 8px 0 10px;
  font-size: 18px;
  line-height: 1.35;
  color: var(--text);
}

/*
  Защита от длинных строк, URL и служебных фрагментов текста, которые
  особенно часто ломают карточки и заголовки на телефонах.
*/
.hero__content,
.hero-panel,
.hero-panel__card,
.card,
.feature-card,
.brand,
.brand__copy,
.nav__links,
.nav__tools,
.section__head {
  min-width: 0;
}

.hero__lead,
.brand__title,
.brand__subtitle,
.section__title,
.card h3,
.card p,
.feature-card p,
.p,
.richtext p,
.richtext li,
.richtext h2,
.richtext h3 {
  overflow-wrap: anywhere;
  word-break: normal;
}

/* Адаптивные карточки для списков новостей и помётов. */
.listing-card {
  grid-column: span 12;
}

.richtext img,
.richtext picture img,
.richtext figure img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto !important;
  border-radius: calc(var(--radius) - 8px);
  object-fit: contain;
}

.richtext figure {
  margin: 18px 0;
  max-width: 100%;
  overflow: hidden;
}

.richtext figure img,
.richtext p img {
  margin-left: auto;
  margin-right: auto;
}

.richtext table {
  display: block;
  width: 100%;
  overflow-x: auto;
}


/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 22px 0 28px;
  color: var(--muted);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer__brand {
  font-size: 14px;
}

.footer__brand strong {
  color: var(--text);
}

.footer__meta,
.footer__contacts {
  font-size: 13px;
}

.footer__contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

/* ---------- Wagtail richtext ---------- */
.richtext {
  color: var(--text);
}

.richtext p {
  color: var(--muted);
  line-height: 1.75;
}

.richtext a {
  color: var(--accent2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.richtext h2,
.richtext h3,
.h1,
.h2 {
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.h1 {
  margin: 0 0 12px;
}

.h2 {
  margin: 0 0 8px;
}

/* ---------- CRM / legacy compatibility ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

/* ---------- Responsive ---------- */
@media (min-width: 720px) {
  .listing-card {
    grid-column: span 6;
  }
}

@media (min-width: 900px) {
  .feature-card {
    grid-column: span 4;
  }

  .cards-grid .card {
    grid-column: span 4;
  }
}

@media (max-width: 980px) {
  .nav {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .brand,
  .nav__links,
  .nav__tools {
    flex: 1 1 100%;
  }

  .nav__links {
    justify-content: flex-start;
  }

  .nav__tools {
    justify-content: space-between;
  }

  .hero__inner {
    grid-template-columns: 1fr;
    padding: 68px 0 58px;
  }

  .hero-panel {
    justify-content: stretch;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 24px, 1180px);
  }

  .site-main {
    padding-top: 14px;
    padding-bottom: 40px;
  }

  .site-header {
    padding: 10px 0;
  }

  .nav {
    gap: 12px;
    min-height: auto;
  }

  .brand {
    gap: 10px;
  }

  .brand__mark {
    width: 44px;
    height: 44px;
  }

  .brand__title {
    font-size: 15px;
    line-height: 1.1;
  }

  .brand__subtitle {
    white-space: normal;
    font-size: 12px;
  }

  .nav__links {
    gap: 6px;
  }

  .nav__links a {
    padding: 8px 12px;
    font-size: 14px;
  }

  .lang {
    width: 100%;
    justify-content: center;
  }

  .lang a {
    flex: 1 1 0;
  }

  .hero__inner {
    padding: 56px 0 44px;
    gap: 18px;
  }

  .hero h1 {
    font-size: clamp(30px, 10vw, 42px);
    line-height: 1;
  }

  .hero__lead {
    font-size: 15px;
    line-height: 1.65;
  }

  .hero__cta {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  .section {
    padding: 20px 0;
  }

  .section__head {
    align-items: flex-start;
  }

  .section__title {
    font-size: 16px;
    line-height: 1.3;
  }

  .feature-card,
  .card,
  .hero-panel__card {
    padding: 18px;
  }
}


@media (max-width: 640px) {
  .site-header {
    position: relative;
  }

  .nav__links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  .nav__links a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    text-align: center;
    white-space: normal;
  }

  .nav__tools {
    width: 100%;
  }

  .hero {
    overflow: hidden;
  }

  .hero__content {
    max-width: 100%;
  }

  .eyebrow {
    font-size: 11px;
    letter-spacing: 0.12em;
  }

  .hero h1 {
    font-size: clamp(24px, 8.8vw, 34px);
    line-height: 1.02;
    letter-spacing: 0.02em;
  }

  .hero__lead,
  .richtext p,
  .p {
    font-size: 14px;
    line-height: 1.6;
  }

  .card,
  .feature-card,
  .hero-panel__card {
    overflow: hidden;
  }

  .richtext figure,
  .richtext .image,
  .richtext .rich-text-image {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .richtext img,
  .richtext figure img,
  .richtext picture img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 70svh;
    object-fit: contain;
  }
}

@media (max-width: 420px) {
  .container {
    width: min(100% - 20px, 1180px);
  }

  .brand__title {
    font-size: 14px;
    letter-spacing: 0.04em;
  }

  .brand__subtitle {
    font-size: 11px;
  }

  .hero__inner {
    padding: 42px 0 34px;
  }

  .hero h1 {
    font-size: clamp(22px, 8vw, 30px);
  }

  .hero__lead,
  .richtext p,
  .p {
    font-size: 13px;
    line-height: 1.55;
  }

  .section__title,
  .h1,
  .h2 {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}
