/*
Theme Name: ACTAVA
Theme URI: https://example.com/
Author: Timur
Author URI: https://example.com/
Description: Pixel-perfect перенос лендинга ACTAVA в тему WordPress.
Version: 1.0.0
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: actava
*/

/* ===== Base Styles ===== */
:root {
  --c-bg: #ffffff;
  --c-text: #0f0f0f;
  --c-muted: #6b7280;
  --c-dark: #0b0b0b;
  --c-gray: #f3f4f6;
  --c-accent: #4c62ff;
  --c-accent-600: #3a4deb;
  --c-hero-btn: #f4df4e;
  --c-ring: rgba(76, 98, 255, 0.35);
}

html,
body {
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', 'Inter', system-ui, -apple-system, sans-serif;
}

/* ===== Layout & Container ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .container {
    padding: 0 1.5rem;
  }
}

/* ===== Header & Admin Bar ===== */
:root {
  --header-h: 56px;
  --adminbar-h: 0px;
  --safe-top: env(safe-area-inset-top, 0px);
  --offset-top: calc(var(--header-h) + var(--adminbar-h) + var(--safe-top));
}

@media (min-width: 768px) {
  :root {
    --header-h: 64px;
  }
}

/* WP admin bar bump OFF — WP добавляет margin-top на html, гасим его */
html {
  margin-top: 0 !important;
}

@media (max-width: 782px) {
  html {
    margin-top: 0 !important;
  }
}

/* Шапка всегда прижата к верху + учитываем реальную высоту админ-бара */
#top {
  position: fixed;
  top: var(--adminbar-h) !important;
  left: 0;
  right: 0;
  background: #000;
  z-index: 50;
  padding-top: var(--safe-top);
}

/* Push document content down without a spacer div */
main {
  padding-top: var(--offset-top);
}

/* Safety: remove any stray margins at the very top */
.wp-site-blocks, .site, .site-content, .page, .content, .wrap {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

main > *:first-child {
  margin-top: 0 !important;
}

/* ===== Hero Section ===== */
#hero {
  min-height: calc(100svh - var(--offset-top)) !important;
}

.hero-text {
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.7);
}

.hero-sub {
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

/* Hero mobile fallback bg — если видео не автоплеится */
@media (max-width: 767.98px) {
  #hero {
    background-image: url("../images/BG.jpg");
    background-size: cover;
    background-position: center;
  }
}

/* ===== Utilities ===== */
.shadow-soft {
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.08);
}

.focus-ring:focus-visible {
  outline: 2px solid var(--c-ring);
  outline-offset: 2px;
}

.transition-all {
  transition: all 0.3s ease;
}

/* ===== Modals ===== */
.modal {
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

/* Video modal: centered sizes + dynamic aspect */
#video-modal .modal-content {
  width: min(92vw, 960px);
  max-height: 90dvh;
}

#video-modal.portrait .modal-content {
  width: min(92vw, 520px);
}

#video-aspect {
  aspect-ratio: 16 / 9;
  background: #000;
}

#video-player {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ===== Reviews Slider ===== */
#reviews {
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

#reviews-track article {
  user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
}

#reviews-track {
  cursor: grab;
  touch-action: pan-y;
}

#reviews-track.dragging {
  cursor: grabbing;
}

.slider-container {
  overflow: hidden;
}

.slider-track {
  transition: transform 0.5s ease;
}

/* ===== FAQ Accordion ===== */
.faq-item .faq-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.32s ease;
}

.faq-item.open .faq-panel {
  max-height: 480px;
}

.faq-btn .chev {
  transition: transform 0.25s ease;
}

.faq-item.open .chev {
  transform: rotate(180deg);
}

/* ===== Certificates Gallery ===== */
.cert-card {
  /* display: flex; flex-direction: column; */ /* Removed: now using CSS Grid */
  transform: translateY(0) scale(1);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.4s ease, background 0.3s ease, border-color 0.3s ease;
}

.cert-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.12);
}

.cert-card .shot {
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), filter 0.4s ease;
  will-change: transform;
  transform: translateZ(0) scale(1);
}

.cert-card:hover .shot {
  transform: translateY(-6px) scale(1.04);
}

.cert-gradient {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 96px;
  background: linear-gradient(to top, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
  pointer-events: none;
}

#certs-grid {
  align-items: stretch;
}

/* .cert-card .meta {
  margin-top: auto;
} */ /* Removed: now using CSS Grid */

.cert-card .title {
  min-height: 2.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#certs-grid .cert-card {
  align-self: stretch;
}

/* === Certificates: equal rows via pure CSS === */
#certs-grid{
  /* каждая строка грида одной высоты — по самому высокому элементу в строке */
  grid-auto-rows: 1fr;
  align-items: stretch;
}
#certs-grid .cert-card{
  height: 100%; /* растягиваем статью по высоте трека */
  display: grid; /* фиксируем внутреннюю раскладку */
  grid-template-rows: auto 1fr; /* [постер] + [meta] заполняет остаток */
}
#certs-grid .cert-card .meta{
  display: grid;
  grid-template-rows: auto auto; /* [title+button] + [pages] */
}
#certs-grid .cert-card .title{
  /* гарантируем одинаковую "полку" под 2 строки */
  min-height: calc(1.25rem * 2); /* 2 строки при line-height≈1.25 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Certificates: мини-галерея */
.cert-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Общая модалка фото: позволяем contain/cover через data-fit */
#photo-modal-img[data-fit="contain"] {
  object-fit: contain;
}

#photo-modal-img[data-fit="cover"] {
  object-fit: cover;
}

/* ===== Case Studies ===== */
.case-content {
  min-height: 128px;
}

@media (min-width: 768px) {
  .case-content {
    min-height: 140px;
  }
}

@media (min-width: 1024px) {
  .case-content {
    min-height: 152px;
  }
}

/* ===== Benefits Icons ===== */
.icon-badge {
  width: 3rem;
  height: 3rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #E7EEF7;
  border: 1px solid #DBE4F0;
}

.icon-badge svg {
  width: 1.5rem;
  height: 1.5rem;
  stroke: #1F4D84;
  fill: none;
  stroke-width: 2;
}

/* Последняя карточка в benefits — нейтральная инженерная гамма */
.benefits-callout {
  background-image: linear-gradient(to right, #EEF3FA, #FFFFFF);
  border: 1px solid #DCE7F5;
}

.benefits-callout .icon-badge {
  background: #E7EEF7;
  border-color: #DBE4F0;
}

/* ===== Anchor Scrolling ===== */
section[id] {
  scroll-margin-top: calc(var(--offset-top) + 8px);
}



/* ================= CF7 | ACTAVA ================= */
:root{
  --actv-field-h: 52px;
  --actv-radius: 12px;
  --actv-border: #e5e7eb;
  --actv-border-focus: #3b82f6;
  --actv-bg: #fff;
  --actv-placeholder: #9ca3af;
  --actv-label: #111827;
}

.wpcf7 form {
  display: grid;
  gap: 18px;
}

/* Лейблы */
.wpcf7 form label{
  display:block;
  font-weight:600;
  color:var(--actv-label);
  margin-bottom:6px;
}

/* Базовый инпут/селект/текстAREA */
.wpcf7 .actv-input,
.wpcf7 input[type="text"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="number"],
.wpcf7 select,
.wpcf7 textarea{
  width:100%;
  height:var(--actv-field-h);
  border:1px solid var(--actv-border);
  background:var(--actv-bg);
  border-radius:var(--actv-radius);
  padding:12px 16px;
  font-size:16px;
  line-height:1.35;
  color:#0f172a;
  transition:border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
  outline: none;
}
.wpcf7 textarea{
  min-height:120px;
  height:auto;
  resize:vertical;
  padding-top:12px;
}

/* placeholder */
.wpcf7 ::placeholder{ color:var(--actv-placeholder); opacity:1; }

/* focus */
.wpcf7 input:focus,
.wpcf7 select:focus,
.wpcf7 textarea:focus{
  border-color:var(--actv-border-focus);
  box-shadow:0 0 0 4px rgba(59,130,246,.15);
}

/* invalid */
.wpcf7 .wpcf7-not-valid{
  border-color:#ef4444 !important;
  box-shadow:0 0 0 4px rgba(239,68,68,.12);
}

/* ошибки/ответ */
.wpcf7 .wpcf7-not-valid-tip{
  color:#ef4444;
  font-size:12px;
  margin-top:6px;
}
.wpcf7 .wpcf7-response-output{
  margin-top:8px;
  border-radius:10px;
  border:1px solid #e5e7eb;
  background:#f9fafb;
  padding:10px 12px;
}

/* Селект со стрелкой */
.wpcf7 select,
.wpcf7 .actv-select{
  appearance:none;
  -webkit-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg width='16' height='16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23667' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 14px center;
  background-size:16px 16px;
  padding-right:44px;
}

/* Убираем спиннеры у number */
.wpcf7 input[type=number]::-webkit-outer-spin-button,
.wpcf7 input[type=number]::-webkit-inner-spin-button{ -webkit-appearance:none; appearance:none; margin:0; }
.wpcf7 input[type=number]{ -moz-appearance:textfield; appearance:textfield; }

/* Радио-группа */
.wpcf7 .wpcf7-radio{
  display:grid; gap:10px;
}
.wpcf7 .wpcf7-list-item{
  margin:0; /* убираем дефолтный отступ */
}
.wpcf7 .wpcf7-list-item label{
  display:inline-flex; align-items:center; gap:10px; font-weight:500;
}
.wpcf7 input[type="radio"]{
  width:18px; height:18px; accent-color:#3b82f6;
}

/* Кнопка */
.wpcf7 .actv-btn,
.wpcf7 input[type="submit"]{
  width:100%;
  height:56px;
  border-radius:14px;
  border:0;
  background:#4C62FF;
  color:#fff;
  font-weight:700;
  font-size:18px;
  cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center;
  box-shadow:0 10px 30px rgba(76,98,255,.25);
  transition:filter .15s ease, transform .04s ease;
}
.wpcf7 input[type="submit"]:hover{ filter:brightness(1.04); }
.wpcf7 input[type="submit"]:active{ transform:translateY(1px); }

/* Карточки с формами — выравнивание внутренних блоков */
.actava-calc-form .wpcf7-form,
.actava-lead-form .wpcf7-form{
  gap:20px;
}

/* Мелкая адаптация */
@media (min-width:768px){
  .actava-lead-form .wpcf7-form{ gap:22px; }
}

/* Бейджи во второй форме — как в макете */
.actava-badges{ 
  display:flex; 
  flex-wrap:wrap; 
  gap:.5rem; 
  margin:.5rem 0 1rem; 
}
.actava-badges span{
  font-size:.875rem; 
  background:#f3f4f6; 
  border:1px solid #e5e7eb;
  padding:.35rem .6rem; 
  border-radius:999px; 
  color:#111827;
}

/* Радио — ровные отступы */
.actv-radio label{ 
  display:flex; 
  align-items:center; 
  gap:.5rem; 
  margin:.35rem 0; 
  font-weight:500; 
}

/* === CF7 hotfix: tidy forms === */
/* Калькулятор: убрать смайлик у кнопки (если он вдруг остался в разметке) */
.actava-form--calc .actava-btn__icon{ display:none !important; }

/* WhatsApp floating action button */
.wa-fab{
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  width: 60px;
  height: 60px;
  border-radius: 9999px;
  background: #25D366;
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 14px 35px rgba(0,0,0,.22);
  z-index: 70;
  transition: transform .08s ease, filter .15s ease;
}
.wa-fab:hover{
  filter: brightness(.96);
}
.wa-fab:active{
  transform: translateY(1px);
}
@media (max-width: 480px){
  .wa-fab{
    width: 56px;
    height: 56px;
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }
}

/* Partners section styles */
#partners .partner-card {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#partners .partner-card img {
  transition: filter 0.3s ease, opacity 0.3s ease;
}