/* ============================================================================
   Mobile UX для jil-innovations.ru · версия 1.0.2
   1) ДИЗАЙН-СИСТЕМА (весь сайт): единая типографическая шкала и иерархия,
      дисциплина фирменных цветов, единый набор кнопок и форм.
   2) МОБИЛЬНАЯ ВЕРСИЯ (≤959px): шапка и меню, карточки новостей, документы,
      формы, панель быстрых действий.
   Откат: деактивация плагина «Мобильная версия сайта».
   ============================================================================ */

/* Панель быстрых действий и распорка: показываются только на мобильных */
.mux-bar { display: none; }
.mux-spacer { display: none; }

/* ============================================================================
   1) ДИЗАЙН-СИСТЕМА (весь сайт)
   ============================================================================ */

:root {
  --ds-accent: #4c629b;
  --ds-accent-dark: #3f558e;
  --ds-accent-soft: #eef1f8;
  --ds-ink: #1f2b47;
  --ds-text: #545f70;
  --ds-muted: #8b93a5;
  --ds-line: #e5e8f0;
  --ds-navy: #202d4c;
  --ds-bg-soft: #f5f6fa;
  --ds-radius: 12px;
  --ds-radius-card: 16px;
}

/* ---------- Типографика: единая шкала и иерархия ---------- */
body { font-weight: 400; }
#Content { color: var(--ds-text); }
#Content p, #Content li { font-size: 15.5px; line-height: 1.65; color: var(--ds-text); }
#Content h1 { font-size: 38px; font-weight: 600; line-height: 1.22; color: var(--ds-ink); }
#Content h2 { font-size: 28px; font-weight: 600; line-height: 1.3; color: var(--ds-ink); margin: 28px 0 12px; }
#Content h3 { font-size: 23px; font-weight: 600; line-height: 1.35; color: var(--ds-ink); margin: 22px 0 10px; }
#Content h4 { font-size: 19px; font-weight: 600; line-height: 1.4; color: var(--ds-ink); margin: 18px 0 8px; }
#Content h5 { font-size: 17.5px; font-weight: 600; line-height: 1.45; color: var(--ds-ink); }
#Content h6 { font-size: 16px; font-weight: 600; line-height: 1.5; color: var(--ds-ink); }
#Subheader .title { font-size: 38px !important; font-weight: 600 !important; line-height: 1.25; }

/* ---------- Цвета: ссылки и акценты ---------- */
#Content a { color: var(--ds-accent); }
#Content a:hover { color: var(--ds-accent-dark); }
::selection { background: var(--ds-accent-soft); color: var(--ds-ink); }
:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 2px; }

/* ---------- Кнопки: единый набор ---------- */
.button, .button_secondary, .action_button,
input[type="submit"], .wpcf7 input[type="submit"], .wpcf7 .wpcf7-submit {
  border-radius: var(--ds-radius) !important;
  font-size: 15.5px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  min-height: 46px;
  padding: 13px 26px !important;
  text-transform: none;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .12s ease, box-shadow .16s ease;
  box-sizing: border-box;
}
.button, .action_button,
input[type="submit"], .wpcf7 input[type="submit"], .wpcf7 .wpcf7-submit {
  background: var(--ds-accent) !important;
  color: #ffffff !important;
  border: 0 !important;
  box-shadow: 0 6px 16px rgba(76, 98, 155, 0.18);
}
.button:hover, .action_button:hover,
input[type="submit"]:hover, .wpcf7 input[type="submit"]:hover {
  background: var(--ds-accent-dark) !important;
  color: #ffffff !important;
}
.button:active, input[type="submit"]:active { transform: translateY(1px); }
.button_secondary { background: var(--ds-accent-soft) !important; color: var(--ds-accent) !important; border: 0 !important; }
.button_secondary:hover { background: var(--ds-accent) !important; color: #ffffff !important; }

/* Кнопка «Загрузить ещё» */
.pager_wrapper { text-align: center; }
.pager_wrapper .pager_load_more.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 2px solid var(--ds-accent) !important;
  background: #ffffff !important; color: var(--ds-accent) !important;
  box-shadow: none !important;
}
.pager_wrapper .pager_load_more.button .button_label { color: inherit; }
.pager_wrapper .pager_load_more.button:hover { background: var(--ds-accent) !important; color: #ffffff !important; }

/* ---------- Формы: единый вид ---------- */
.wpcf7 input[type="text"], .wpcf7 input[type="email"], .wpcf7 input[type="tel"],
.wpcf7 input[type="url"], .wpcf7 input[type="number"], .wpcf7 textarea, .wpcf7 select {
  width: 100%; min-height: 50px; padding: 12px 14px;
  border: 1px solid #d5d9e4; border-radius: var(--ds-radius);
  font-size: 16px; color: var(--ds-ink); background: #ffffff;
  box-sizing: border-box;
}
.wpcf7 textarea { min-height: 132px; }
.wpcf7 input:focus, .wpcf7 textarea:focus, .wpcf7 select:focus {
  border-color: var(--ds-accent); box-shadow: 0 0 0 3px rgba(76, 98, 155, 0.16); outline: none;
}
.wpcf7 input::placeholder, .wpcf7 textarea::placeholder { color: #94a1b0; }
.wpcf7 .wpcf7-response-output { border-radius: var(--ds-radius); }
.wpcf7 .wpcf7-not-valid-tip { font-size: 13.5px; color: #d0342c; }

/* ---------- Аккордеоны (документы, тарифы) ---------- */
.accordion .mfn-acc .question { background: #ffffff; border: 1px solid var(--ds-line); border-radius: 14px; margin-bottom: 10px; overflow: hidden; }
.accordion .mfn-acc .question .title { display: flex; align-items: center; padding: 15px 54px 15px 16px; font-size: 15.5px; font-weight: 600; line-height: 1.45; color: var(--ds-ink); }
.accordion .mfn-acc .question .title i.acc-icon-plus,
.accordion .mfn-acc .question .title i.acc-icon-minus {
  position: absolute !important;
  left: auto !important; right: 12px !important;
  top: 50% !important; transform: translateY(-50%);
  width: 30px !important; height: 30px !important;
  margin: 0; line-height: 30px; text-align: center;
  border-radius: 50%; background: var(--ds-accent-soft); color: var(--ds-accent); font-size: 14px;
}
.accordion .mfn-acc .answer { padding: 0 14px 16px; }

/* Документы: вместо встроенного окна предпросмотра — аккуратная кнопка открытия (единообразно на всех экранах) */
.ead-document { display: none !important; }
.mux-pdf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; min-width: 280px; max-width: 100%;
  margin: 2px 0 8px; padding: 0 22px;
  border-radius: 12px;
  background: var(--ds-accent-soft);
  color: var(--ds-accent) !important;
  font-size: 15.5px; font-weight: 600; text-decoration: none;
  box-sizing: border-box;
}
.mux-pdf-btn:active { transform: translateY(1px); }

/* PDF-вставки в постах (блок «Файл»): без пустого окна предпросмотра, аккуратная строка документа */
.wp-block-file__embed { display: none !important; }
.wp-block-file { margin: 14px 0 22px !important; }
.wp-block-file a:not(.wp-block-file__button) {
  display: block; margin-bottom: 10px;
  font-size: 15.5px !important; font-weight: 600 !important; line-height: 1.45;
  color: var(--ds-accent) !important; text-decoration: none !important;
}
.wp-block-file a:not(.wp-block-file__button):hover { text-decoration: underline !important; }
.wp-block-file__button {
  display: inline-flex !important; align-items: center; justify-content: center;
  margin: 0 !important; padding: 11px 22px !important;
  background: var(--ds-accent-soft) !important; color: var(--ds-accent) !important;
  border-radius: 12px !important; font-size: 15.5px !important; font-weight: 600 !important;
  text-decoration: none !important;
}

/* ---------- Новости: ссылки, даты, мета ---------- */
.blog_wrapper .post-item .post-links a.post-more { color: var(--ds-accent) !important; font-weight: 600; }
.blog_wrapper .post-item .post-links i { color: var(--ds-accent); }
.blog_wrapper .post-item h2 a, .blog_wrapper .post-item h5 a,
.blog_wrapper article.post h2 a, .blog_wrapper article.post h5 a { color: var(--ds-ink) !important; font-size: 17.5px; line-height: 1.4; }
.blog_wrapper .post-item h2 a:hover, .blog_wrapper .post-item h5 a:hover,
.blog_wrapper article.post h2 a:hover, .blog_wrapper article.post h5 a:hover { color: var(--ds-accent) !important; }
.blog_wrapper .post-item .image_wrapper > a,
.blog_wrapper article.post .image_wrapper > a { display: block; cursor: pointer; }
.blog_wrapper .post-item .date_label,
.blog_wrapper article.post .date_label { display: none !important; }
.blog_wrapper article.post .post-head { margin: 0 0 6px; }
.blog_wrapper article.post .post-head .post-meta { display: block; font-size: 13px; }
.blog_wrapper article.post .post-head .post-meta .date { color: var(--ds-muted); font-size: 13px; font-weight: 500; }
.blog_wrapper article.post .post-head .post-meta .date .icon-clock { margin-right: 4px; }
.blog_wrapper .post-item .image_links,
.blog_wrapper article.post .image_links { display: none !important; }
.blog_wrapper .post-item .post-footer,
.blog_wrapper article.post .post-footer { display: none !important; }
#Content .post-excerpt { color: var(--ds-text); font-size: 15px; line-height: 1.6; }

/* ---------- Подвал ---------- */
#Footer .footer_copy .copyright { font-size: 13.5px; line-height: 1.6; }

/* ============================================================================
   2) МОБИЛЬНАЯ ВЕРСИЯ (≤959px)
   ============================================================================ */

@media only screen and (max-width: 959px) {

  /* Полная ширина на мобильных: убираем боковые полосы boxed-вёрстки Betheme (≤767px: max-width: calc(100% - 67px)) */
  #Wrapper { max-width: 100% !important; width: 100% !important; margin-left: 0 !important; margin-right: 0 !important; box-shadow: none !important; }

  :root {
    --mux-accent: #4c629b;
    --mux-accent-dark: #3f558e;
    --mux-accent-soft: #eef1f8;
    --mux-ink: #1f2b47;
    --mux-text: #5a6478;
    --mux-muted: #8b93a5;
    --mux-line: #e5e8f0;
    --mux-navy: #202d4c;
    --mux-bg-soft: #f5f6fa;
    --mux-radius: 16px;
  }

  /* ---------- Типографика (мобильная шкала) ---------- */
  body { font-size: 16px; }
  #Content p { font-size: 15.5px; line-height: 1.65; }
  #Content h1 { font-size: 26px; line-height: 1.25; }
  #Content h2 { font-size: 22px; line-height: 1.3; }
  #Content h3 { font-size: 19.5px; line-height: 1.35; }
  #Content h4 { font-size: 17.5px; line-height: 1.4; }
  #Content h5 { font-size: 16.5px; line-height: 1.45; }

  /* ---------- Шапка (тёмно-синяя, фирменная) ---------- */
  #Top_bar { border-bottom: 1px solid rgba(255, 255, 255, 0.10); }
  #Top_bar.is-sticky { box-shadow: 0 4px 18px rgba(10, 18, 38, 0.25); }

  #Top_bar .top_bar_left {
    position: relative;
    min-height: 64px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    box-sizing: border-box;
  }
  #Top_bar .logo { width: auto !important; text-align: left !important; flex: 0 0 auto; }
  #Top_bar .logo #logo {
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    height: auto;
    line-height: 0;
  }
  #Top_bar #logo img.logo-mobile,
  #Top_bar #logo img.logo-mobile-sticky { max-height: 46px !important; width: auto !important; }

  #Top_bar .menu_wrapper {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: auto !important;
    display: flex;
    align-items: center;
    z-index: 5;
  }
  #Top_bar a.responsive-menu-toggle,
  #Top_bar a.responsive-menu-toggle.is-sticky {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    margin: 0 10px 0 0 !important;
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-size: 19px;
    line-height: 1;
    transform: none;
    transition: background 0.15s ease, transform 0.15s ease;
  }
  #Top_bar a.responsive-menu-toggle:active { background: rgba(255, 255, 255, 0.26); transform: scale(0.96); }

  /* ---------- Панель меню (выезжающая справа) ---------- */
  #Side_slide, #Side_slide.right { background: #ffffff !important; box-shadow: -10px 0 40px rgba(10, 18, 38, 0.20); }
  #Side_slide .close-wrapper { background: transparent; }
  #Side_slide .close-wrapper .close {
    width: 46px; height: 46px; display: flex; align-items: center; justify-content: center;
  }
  #Side_slide .close-wrapper .close i { color: var(--mux-ink); font-size: 22px; }

  #Side_slide .menu_wrapper { border-top: 1px solid var(--mux-line); }
  #Side_slide ul.menu > li > a {
    display: block;
    padding: 15px 20px !important;
    font-size: 16.5px;
    font-weight: 500;
    color: var(--mux-ink) !important;
    border-bottom: 1px solid var(--mux-line);
  }
  #Side_slide ul.menu > li.current-menu-item > a,
  #Side_slide ul.menu > li > a:hover { color: var(--mux-accent) !important; background: var(--mux-accent-soft); }
  #Side_slide ul.menu > li > ul.sub-menu > li > a {
    padding: 12px 20px 12px 34px !important;
    font-size: 15px;
    color: var(--mux-text) !important;
  }

  /* Блок контактов в панели меню */
  .mux-slide-contact { padding: 18px 20px 22px; }
  .mux-slide-contact .mux-sc-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    height: 50px; border-radius: 14px; margin-bottom: 10px;
    background: var(--mux-accent); color: #ffffff !important;
    font-size: 15px; font-weight: 600; text-decoration: none;
    word-break: break-all; text-align: center;
  }
  .mux-slide-contact .mux-sc-btn.ghost { background: var(--mux-accent-soft); color: var(--mux-accent) !important; }
  .mux-slide-contact .mux-sc-note { font-size: 13px; color: var(--mux-muted); text-align: center; margin: 0 0 14px; }
  .mux-slide-contact .mux-sc-addr { font-size: 14px; color: var(--mux-text); text-align: center; line-height: 1.5; margin-top: 8px; }

  /* ---------- Баннер страницы (Subheader) ---------- */
  #Subheader { padding: 30px 0 26px !important; }
  #Subheader .container { padding: 0 18px; }
  #Subheader .title { font-size: 26px !important; line-height: 1.25; text-shadow: 0 1px 14px rgba(10, 25, 40, 0.45); }

  /* ---------- Секции ---------- */
  .section { padding-top: 38px; padding-bottom: 38px; }

  /* ---------- Карточки новостей ---------- */
  .blog_wrapper .post-item, .blog_wrapper article.post {
    background: #ffffff;
    border: 1px solid var(--mux-line);
    border-radius: var(--mux-radius);
    padding: 16px 16px 12px;
    margin-bottom: 18px;
    box-shadow: 0 4px 16px rgba(10, 18, 38, 0.05);
  }
  .blog_wrapper .post-item .image_frame, .blog_wrapper article.post .image_frame { margin: 0 0 14px !important; border: 0 !important; background: none; }
  .blog_wrapper .post-item .image_frame img, .blog_wrapper article.post .image_frame img { border-radius: 12px; }
  .blog_wrapper .post-item .date_label, .blog_wrapper article.post .date_label { display: none !important; }
  .blog_wrapper article.post .post-head { margin: 0 0 6px; }
  .blog_wrapper .post-item h2, .blog_wrapper .post-item h5,
  .blog_wrapper .post-item h2 a, .blog_wrapper .post-item h5 a,
  .blog_wrapper article.post h2, .blog_wrapper article.post h5,
  .blog_wrapper article.post h2 a, .blog_wrapper article.post h5 a {
    font-size: 17.5px;
    line-height: 1.4;
    font-weight: 600;
    color: var(--mux-ink) !important;
  }
  .blog_wrapper .post-item .post-excerpt, .blog_wrapper article.post .post-excerpt { font-size: 15px; line-height: 1.6; color: var(--mux-text); margin-top: 8px; }
  .blog_wrapper .post-item .post-footer, .blog_wrapper article.post .post-footer {
    border-top: 1px solid var(--mux-line);
    margin-top: 14px;
    padding-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .blog_wrapper .post-item .button-love,
  .blog_wrapper .post-item .button-love .love-text { font-size: 13.5px; color: var(--mux-muted); }
  .blog_wrapper .post-item .post-links a.post-more { color: var(--mux-accent) !important; font-weight: 600; font-size: 15px; }
  .blog_wrapper .post-item .post-links i { color: var(--mux-accent); }

  .pager_wrapper { text-align: center; }
  .pager_wrapper .pager_load_more.button {
    width: 100%; max-width: 360px; height: 52px; margin: 4px auto 0;
  }
  .pager_wrapper .pager_load_more.button:active { transform: translateY(1px); }

  /* ---------- Аккордеоны: мобильные уточнения ---------- */
  /* На телефонах встроенный просмотрщик PDF обрезается в узком окне, поэтому
     показываем кнопку открытия (документ откроется в родном окне просмотра, ровно
     по экрану). Встроенный просмотр остаётся на десктопе. */
  .accordion .mfn-acc .answer .ead-document { display: none !important; }
  .accordion .mfn-acc .answer .ead-preview { padding-bottom: 0 !important; }

  /* Кнопка открытия PDF (мобильные браузеры часто не показывают встроенный просмотрщик) */
  .mux-pdf-btn {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; min-height: 48px; margin: 0 0 10px;
    border-radius: 12px;
    background: var(--mux-accent-soft);
    color: var(--mux-accent) !important;
    font-size: 15.5px; font-weight: 600; text-decoration: none;
    box-sizing: border-box;
  }
  .mux-pdf-btn:active { transform: translateY(1px); }

  /* ---------- Форма: мобильные уточнения ---------- */
  .wpcf7 input[type="submit"], .wpcf7 .wpcf7-submit {
    width: 100% !important;
    height: 52px !important;
    min-height: 52px !important;
    padding: 0 20px !important;
    border-radius: 12px !important;
    box-shadow: 0 6px 18px rgba(76, 98, 155, 0.28) !important;
  }
  .wpcf7 input[type="submit"]:active { transform: translateY(1px); }

  /* ---------- Подвал ---------- */
  #Footer .footer_copy { padding: 20px 12px !important; }
  #Footer .footer_copy .copyright { font-size: 13.5px; line-height: 1.6; }
  #back_to_top {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.12); color: #ffffff !important;
    margin-bottom: 10px;
  }

  /* ---------- Нижняя панель быстрых действий ---------- */
  .mux-bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 9990;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: #ffffff;
    border-top: 1px solid var(--mux-line);
    box-shadow: 0 -4px 14px rgba(10, 18, 38, 0.09);
    box-sizing: border-box;
  }
  .mux-bar-btn {
    display: flex; align-items: center; justify-content: center; gap: 9px;
    height: 50px; border-radius: 14px;
    font-size: 15.5px; font-weight: 600; letter-spacing: 0.01em;
    text-decoration: none;
  }
  .mux-bar-btn i { font-size: 16px; }
  .mux-bar-primary { background: var(--mux-accent); color: #ffffff !important; box-shadow: 0 6px 16px rgba(76, 98, 155, 0.30); }
  .mux-bar-secondary { background: var(--mux-accent-soft); color: var(--mux-accent) !important; }
  .mux-bar-btn:active { transform: translateY(1px); }

  .mux-spacer { display: block; height: 78px; }

  /* Нижняя панель не мешает открытому меню */
  body.side-slide-is-open .mux-bar { display: none !important; }

  /* ---------- Мелкие правки ---------- */
  img { height: auto; }
  .post-item .image_frame { max-width: 100%; }
}
