/*
 * site-shell.css — стили header / footer / общая обвязка custom-страниц.
 * Подключается в build-templates/layouts/base.eta для всех custom pages.
 *
 * Использует токены из helpexcel-tokens.css.
 */

/* ── HEADER ─────────────────────────────────────────────────────────────── */
.hx-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--he-color-surface, #fff);
  border-bottom: 1px solid var(--he-color-border, #e2e8f8);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
}
.hx-header__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.hx-header__logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--he-color-text, #1d2233);
  font-family: var(--he-font-family, 'FuturaPT', sans-serif);
  font-weight: 600;
  font-size: 28px;
  letter-spacing: -0.01em;
}
.hx-header__logo svg {
  width: 42px;
  height: 42px;
  flex: none;
}
.hx-header__logo span {
  color: var(--he-color-accent, #5171f7);
  font-weight: 400;
}
.hx-header__nav {
  display: flex;
  gap: 8px;
  align-items: center;
}
.hx-header__link {
  text-decoration: none;
  color: var(--he-color-text-secondary, #363f55);
  font-size: 16px;
  font-weight: 400;
  padding: 10px 16px;
  border-radius: var(--he-radius-md, 10px);
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.hx-header__link:hover {
  background: var(--he-color-surface-2, #f2f4fb);
  color: var(--he-color-text, #1d2233);
}
.hx-header__link--cta {
  background: var(--he-color-button, #817af9);
  color: #fff !important;
  padding: 14px 30px;
  border-radius: var(--he-radius-pill, 999px);
  font-weight: 500;
  font-size: 16px;
}
.hx-header__link--cta:hover {
  background: var(--he-color-primary, #5873ec);
}
.hx-header__menu-btn {
  display: none;
  background: none;
  border: 0;
  padding: 8px;
  color: var(--he-color-text);
  cursor: pointer;
}

@media (max-width: 1200px) {
  .hx-header__link { padding: 8px 12px; font-size: 14px; }
  .hx-header__nav { gap: 2px; }
  .hx-header__inner { padding: 20px 28px; gap: 20px; }
}
@media (max-width: 960px) {
  .hx-header__nav { display: none; }
  .hx-header__menu-btn { display: inline-flex; }
}

/* ── PRE-FOOTER (опц.) ──────────────────────────────────────────────────── */
.hx-prefooter {
  padding: 64px 24px;
  background: linear-gradient(135deg, var(--he-color-primary-soft, #f7faff), var(--he-color-surface-2, #f2f4fb));
  text-align: center;
}

/* ── FOOTER ─────────────────────────────────────────────────────────────── */
.hx-footer {
  background: var(--he-color-text, #1d2233);
  color: rgba(255, 255, 255, 0.75);
  padding: 56px 24px 32px;
  margin-top: 80px;
}
.hx-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.hx-footer__brand h3 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 12px;
}
.hx-footer__brand h3 span { color: var(--he-color-accent-2, #646efb); font-weight: 400; }
.hx-footer__brand p {
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 20px;
  max-width: 280px;
  color: rgba(255, 255, 255, 0.65);
}
.hx-footer__social {
  display: flex;
  gap: 10px;
}
.hx-footer__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.hx-footer__social a:hover {
  background: var(--he-color-button, #817af9);
  color: #fff;
  transform: translateY(-2px);
}
.hx-footer__social svg {
  width: 18px;
  height: 18px;
}
.hx-footer__col h4 {
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 16px;
}
.hx-footer__col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.hx-footer__col li { margin-bottom: 10px; }
.hx-footer__col a {
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s ease;
}
.hx-footer__col a:hover { color: #fff; }
.hx-footer__copy {
  max-width: 1200px;
  margin: 40px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
}

@media (max-width: 1024px) {
  .hx-footer__inner { grid-template-columns: 1.4fr 1fr 1fr; }
  .hx-footer__col:last-child { grid-column: 2 / span 2; }
}
@media (max-width: 768px) {
  .hx-footer { padding: 48px 24px 24px; }
  .hx-footer__inner { grid-template-columns: 1fr; gap: 32px; }
  .hx-footer__col:last-child { grid-column: auto; }
}

/* ── A11Y: focus states ────────────────────────────────────────────────── */
.hx-header__link:focus-visible,
.hx-header__logo:focus-visible,
.hx-footer__col a:focus-visible,
.hx-footer__social a:focus-visible {
  outline: 2px solid var(--he-color-accent, #5171f7);
  outline-offset: 3px;
}

/* ── Related articles cards (long product page bottom) ───────────────────── */
.he-product-related {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 24px 0 16px;
}
.he-product-related__card {
  background: var(--he-color-surface, #fff);
  border: 1px solid var(--he-color-border, #e2e8f8);
  border-radius: var(--he-radius-lg, 16px);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.he-product-related__card:hover {
  border-color: var(--he-color-accent, #5171f7);
  transform: translateY(-2px);
}
.he-product-related__title {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--he-color-text, #1d2233);
}
.he-product-related__desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--he-color-text-secondary, #363f55);
  flex: 1;
}
.he-product-related__link {
  font-size: 14px;
  font-weight: 500;
  color: var(--he-color-accent, #5171f7);
  text-decoration: none;
}
.he-product-related__link:hover { text-decoration: underline; }
@media (max-width: 1024px) {
  .he-product-related { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .he-product-related { grid-template-columns: 1fr; }
}

/* ── Content block paragraphs / sub-headings ─────────────────────────────── */
.he-product-cb__para {
  margin: 0 0 16px;
  font-size: 17px;
  line-height: 1.65;
  color: var(--he-color-text-secondary, #363f55);
  max-width: 64ch;
}
.he-product-cb__sub {
  margin: 24px 0 12px;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--he-color-text, #1d2233);
  max-width: 64ch;
}

/* ── Product gallery (Как выглядит шаблон) — compact ─────────────────────── */
.he-product-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin: 24px auto 0;
  max-width: 1100px;
  padding: 0 24px;
}
@media (min-width: 640px)  { .he-product-gallery { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
@media (min-width: 1024px) { .he-product-gallery { grid-template-columns: repeat(4, 1fr); gap: 20px; } }

.he-product-gallery__item {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.he-product-gallery__frame {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--he-color-primary-soft, #f7faff), var(--he-color-surface-2, #f2f4fb));
  border: 1px solid var(--he-color-border, #e2e8f8);
  aspect-ratio: 4 / 3;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.he-product-gallery__frame:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(52, 55, 144, 0.10);
  border-color: var(--he-color-accent, #5171f7);
}
.he-product-gallery__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.he-product-gallery__num {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  background: rgba(29, 34, 51, 0.78);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  font-feature-settings: "tnum";
}
.he-product-gallery__caption {
  font-size: 13px;
  line-height: 1.4;
  color: var(--he-color-text-secondary, #363f55);
  text-align: center;
  font-weight: 400;
  margin: 0;
  padding: 0 8px;
}

/* ── Product video embed (RuTube/YouTube/Vimeo) ──────────────────────────── */
.he-product-video {
  margin: 32px auto 0;
  max-width: 920px;
  padding: 0 24px;
}
.he-product-video__frame {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--he-color-border, #e2e8f8);
  background: #000;
  aspect-ratio: 16 / 9;
  box-shadow: 0 8px 24px rgba(52, 55, 144, 0.08);
}
.he-product-video__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ── Gallery lightbox (CSS :target) ──────────────────────────────────────── */
.he-product-gallery__frame {
  cursor: zoom-in;
  display: block;
  text-decoration: none;
}
.he-product-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 30, 0.92);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
  cursor: zoom-out;
  text-decoration: none;
}
.he-product-lightbox:target {
  display: flex;
  animation: he-lb-in 0.2s ease;
}
.he-product-lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}
.he-product-lightbox::after {
  content: "✕";
  position: absolute;
  top: 24px;
  right: 32px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
}
@keyframes he-lb-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Long-text content blocks — beautified ──────────────────────────────── */

/* Section title — center aligned, light Tilda weight, accent underline */
.he-product-section__title,
.he-product-cb h2.he-product-section__title {
  font-family: var(--he-font-family, 'FuturaPT', sans-serif);
  font-weight: 300;
  font-size: clamp(22px, 3.6vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-align: center;
  color: var(--he-color-text, #1d2233);
  margin: 0 0 48px;
  position: relative;
  padding-bottom: 18px;
}
.he-product-section__title::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 56px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--he-color-button, #817af9), var(--he-color-accent, #5171f7));
}

/* Lead paragraph — большой intro */
.he-product-cb__para:first-of-type {
  font-size: clamp(17px, 1.4vw, 19px);
  line-height: 1.7;
  color: var(--he-color-text-secondary, #363f55);
  max-width: 760px;
  margin: 0 auto 18px;
  text-align: center;
}
.he-product-cb__para:first-of-type:first-letter {
  font-size: 1.3em;
  font-weight: 500;
  color: var(--he-color-text, #1d2233);
}

/* Subsequent paragraphs — narrow column для читаемости */
.he-product-cb__para {
  font-size: 17px;
  line-height: 1.7;
  color: var(--he-color-text-secondary, #363f55);
  max-width: 720px;
  margin: 0 auto 16px;
}

/* Sub-headings inside long-text — accent left border */
.he-product-cb__sub {
  font-size: 19px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--he-color-text, #1d2233);
  margin: 32px auto 14px;
  max-width: 720px;
  padding-left: 14px;
  border-left: 3px solid var(--he-color-accent, #5171f7);
}

/* Items grid — premium cards с hover-lift */
.he-product-cb__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}
.he-product-cb__item {
  background: var(--he-color-surface, #fff);
  border: 1px solid var(--he-color-border, #e2e8f8);
  border-radius: 14px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}
.he-product-cb__item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--he-color-button, #817af9);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.he-product-cb__item:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(52, 55, 144, 0.10);
  border-color: var(--he-color-accent, #5171f7);
}
.he-product-cb__item:hover::before { opacity: 1; }
.he-product-cb__title {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--he-color-text, #1d2233);
  margin: 0;
}
.he-product-cb__text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--he-color-text-secondary, #363f55);
  margin: 0;
}

/* Section spacing — air */
.he-product-cb {
  padding: 80px 24px;
}
.he-product-cb--long_text + .he-product-cb--long_text { padding-top: 0; }
@media (min-width: 1024px) {
  .he-product-cb { padding: 96px 32px; }
}

/* Alternating bg — visual rhythm */
.he-product-cb--long_text:nth-of-type(even) { background: var(--he-color-surface-alt, #f8f9fc); }
