/* Минимальная типографика и раскладка — база без тем и декора.
   Цель: чистый читаемый лэаут на системных шрифтах. Дизайн прикрутим позже. */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: #1a1a1a;
  background: #fff;
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5em; font-weight: 600; }
h1 { font-size: 2rem; margin-top: 2rem; }
h2 { font-size: 1.4rem; margin-top: 2.5rem; }
h3 { font-size: 1.1rem; margin-top: 1.25rem; }

p { margin: 0 0 1em; }
.lead { font-size: 1.1rem; color: #555; }

a { color: #0060df; text-decoration: underline; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

ul, ol { padding-left: 1.25em; margin: 0 0 1em; }
li { margin-bottom: 0.5em; }

/* CTA (базовая кнопка-ссылка) */
.cta-group { display: flex; flex-wrap: wrap; gap: 10px; margin: 1rem 0 2rem; }
.cta {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid #1a1a1a;
  border-radius: 6px;
  text-decoration: none;
  color: #1a1a1a;
  font-weight: 500;
}
.cta:hover { background: #1a1a1a; color: #fff; }

/* CTA компактный: "Попробовать:" + чипы мессенджеров */
.cta-compact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 1rem 0 2rem;
}
.cta-compact-label { font-weight: 500; color: #333; }
.cta-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border: 1px solid #d8d8d8;
  border-radius: 10px;
  text-decoration: none;
  color: #1a1a1a;
  font-weight: 500;
  font-size: 1.05rem;
  transition: border-color 0.15s, background 0.15s;
}
.cta-chip:hover { border-color: #1a1a1a; background: #fafafa; text-decoration: none; }
.cta-chip-tg { color: #229ED9; }
.cta-chip-tg:hover { background: #eaf6fd; }
.cta-chip img, .cta-chip svg { display: block; }

@media (max-width: 640px) {
  .cta-compact { gap: 8px; }
  .cta-compact-label { flex-basis: 100%; }
  .cta-chip { flex: 1 1 0; justify-content: center; min-width: 0; }
}

/* Списки без маркеров (для карточек разделов/шаблонов) */
.plain-list { list-style: none; padding: 0; }
.plain-list > li { margin-bottom: 1.25em; }
.plain-list h3 { margin: 0 0 0.25em; }
.plain-list p { margin: 0; color: #555; }

/* Карточка-бейдж шаблона: оупенер сверху, заголовок и метрика снизу */
.plain-list:has(.tpl-card) {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 0 0 1.5rem;
}
.plain-list:has(.tpl-card) > li { margin: 0; }
@media (max-width: 720px) { .plain-list:has(.tpl-card) { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .plain-list:has(.tpl-card) { grid-template-columns: 1fr; } }
.tpl-card-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border: 1px solid #eee;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  transition: border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}
.tpl-card-link:hover {
  border-color: #ddd;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  text-decoration: none;
}
.tpl-card-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #f2f2f2;
  overflow: hidden;
}
.tpl-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tpl-card-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
  font-size: 1.8rem;
  background: repeating-linear-gradient(135deg, #f2f2f2 0 8px, #ececec 8px 16px);
}
.tpl-card-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tpl-card-title {
  font-size: 1rem;
  margin: 0;
  line-height: 1.3;
  color: #1a1a1a;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: 2.6em; /* резерв под 2 строки, чтобы низ карточки не прыгал */
}
/* Блок категории в каталоге */
.cat-block { margin-top: 2.5rem; }
.cat-block-title a { color: inherit; text-decoration: none; }
.cat-block-title a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.cat-block-desc { color: #555; margin: -0.25em 0 1em; }
.cat-block-more { margin: 0 0 1rem; }
.cat-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid #d8d8d8;
  border-radius: 8px;
  text-decoration: none;
  color: #1a1a1a;
  font-weight: 500;
  font-size: 0.95rem;
  transition: border-color 0.15s, background 0.15s;
}
.cat-more:hover { border-color: #1a1a1a; background: #fafafa; text-decoration: none; }

/* Default-template promo banner */
.default-banner {
  margin: 1.5rem 0 2.5rem;
  padding: 2.5rem 1.75rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #2a2f4a 0%, #4a3a6a 60%, #6a3a4a 100%);
  background-size: cover;
  background-position: center;
  color: #fff;
}
.default-banner-image { color: #fff; }
.default-banner-inner { max-width: 640px; }
.default-banner-title {
  margin: 0 0 0.5rem;
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.15;
}
.default-banner-desc {
  margin: 0 0 1.1rem;
  font-size: 1.05rem;
  opacity: 0.92;
  line-height: 1.4;
}
.default-banner-meta { margin: 0 0 1.2rem; font-size: 0.95rem; }
.default-banner-link {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.default-banner-link:hover { opacity: 0.85; }
.default-banner .cta-compact { color: #1a1a1a; }
.default-banner .cta-compact-label { color: #fff; }
.default-banner .cta-chip {
  background: #fff;
  border-color: #fff;
  color: #1a1a1a;
}
.default-banner .cta-chip-tg { color: #229ED9; }
.default-banner .cta-chip:hover { background: #f4f4f4; border-color: #f4f4f4; }
.default-banner-title a {
  color: inherit;
  text-decoration: none;
}
.default-banner-title a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

@media (max-width: 640px) {
  .default-banner { padding: 1.75rem 1.25rem; }
  .default-banner-title { font-size: 1.4rem; }
}

/* Breadcrumbs */
.breadcrumbs { font-size: 0.9rem; color: #888; margin: 1.5rem 0 0.5rem; }
.breadcrumbs a { color: #888; }
.breadcrumbs-sep { margin: 0 0.4em; color: #ccc; }

/* FAQ */
.faq details { border-bottom: 1px solid #eee; padding: 0.75em 0; }
.faq summary { font-weight: 500; cursor: pointer; }
.faq-answer { margin-top: 0.5em; color: #444; }

/* Site header (global nav) */
.site-header {
  border-bottom: 1px solid #eee;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #1a1a1a;
  font-weight: 600;
}
.brand:hover { text-decoration: none; }
.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f4c471, #e88a5a);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1;
}
.brand-name { font-size: 1.05rem; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.site-nav a {
  color: #333;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.98rem;
}
.site-nav a:hover { color: #0060df; }
.site-nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #f3f3f3;
  color: #229ED9;
}
.site-nav-icon:hover { background: #e8f3fb; }
.site-nav-icon[data-platform="max"] { color: #1a1a1a; background: #f3f3f3; }
.site-nav-icon img { display: block; }

@media (max-width: 640px) {
  .site-header-inner { flex-wrap: wrap; gap: 10px; }
  .site-nav { gap: 12px; font-size: 0.9rem; }
  .brand-name { display: none; }
}

/* Template hero (single page) */
.tpl-title { margin-top: 1.25rem; }
.tpl-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  margin: 1rem 0 2rem;
}
.tpl-hero-text-only {
  grid-template-columns: 1fr;
}
.tpl-hero-h2 { font-size: 1.5rem; margin-top: 0; }
.tpl-hero .cta-group { margin-bottom: 0; }
.tpl-hero-media img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  background: #f2f2f2;
}
.tpl-hero-placeholder {
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  background: repeating-linear-gradient(135deg, #f2f2f2 0 12px, #ececec 12px 24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #888;
  gap: 6px;
}
.tpl-hero-placeholder span { font-size: 2rem; }
.tpl-hero-placeholder small { font-size: 0.85rem; }

@media (max-width: 640px) {
  .tpl-hero { grid-template-columns: 1fr; gap: 16px; }
}

/* About block: marketing text + specs */
.tpl-about {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
  gap: 32px;
  margin: 2rem 0 2.5rem;
  align-items: start;
}
.tpl-about-text p:first-child { margin-top: 0; }
.tpl-about-specs {
  border-left: 1px solid #eee;
  padding-left: 20px;
  font-size: 0.95rem;
}
.tpl-about-specs ul { list-style: none; padding: 0; margin: 0; }
.tpl-about-specs li { margin: 0 0 0.6em; color: #444; }

@media (max-width: 640px) {
  .tpl-about { grid-template-columns: 1fr; gap: 16px; }
  .tpl-about-specs { border-left: 0; padding-left: 0; border-top: 1px solid #eee; padding-top: 14px; }
}

/* Horizontal strip of example images */
.tpl-examples { margin: 0 0 2.5rem; }
.tpl-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 0 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.tpl-strip-item {
  flex: 0 0 auto;
  width: 180px;
  margin: 0;
  scroll-snap-align: start;
}
.tpl-strip-item img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  background: #f2f2f2;
}
.tpl-strip-item figcaption {
  font-size: 0.85rem;
  color: #666;
  margin-top: 6px;
  line-height: 1.3;
}

/* Footer */
footer { margin-top: 4rem; padding: 2rem 0; border-top: 1px solid #eee; color: #888; font-size: 0.9rem; }

/* Noindex visual marker (dev only) */
body.is-noindex::before {
  content: "noindex";
  display: block;
  background: #fff4d6;
  color: #7a5a00;
  padding: 4px 10px;
  font-size: 0.8rem;
  text-align: center;
}
