/* Компактная раскладка: имя, e-mail, город в одну строку (≥ 641px) */
@media (min-width:641px) {
  form#form_question {
    --ap-inline-gap: 12px;
  }

  form#form_question .ap-field-form_question-anonymous_name,
  form#form_question .ap-field-form_question-email,
  form#form_question .ap-field-form_question-description {
    display: inline-block;
    vertical-align: top;
    width: calc(33.333% - var(--ap-inline-gap));
    margin-right: var(--ap-inline-gap);
  }

  /* последний блок без правого отступа */
  form#form_question .ap-field-form_question-description {
    margin-right: 0;
  }

  /* внутренний враппер тянется на всю ширину блока */
  form#form_question .ap-field-form_question-anonymous_name .ap-field-group-w,
  form#form_question .ap-field-form_question-email .ap-field-group-w,
  form#form_question .ap-field-form_question-description .ap-field-group-w {
    width: 100%;
  }
}

/* На мобильных (< 640px) эти поля остаются столбцом */
@media (max-width:640px) {

  form#form_question .ap-field-form_question-anonymous_name,
  form#form_question .ap-field-form_question-email,
  form#form_question .ap-field-form_question-description {
    display: block;
    width: 100%;
    margin-right: 0;
  }
}

/* Fix horizontal overflow on small screens for AnsPress questions list */
@media (max-width: 420px) {

  /* Ensure blocks don't exceed viewport width */
  .ap-questions-item,
  .ap-questions-item .ap-cell,
  .ap-questions-item .comment-inner {
    max-width: 100%;
    width: 100%;
  }

  /* Break long words/URLs in titles */
  .ap-questions-title,
  .ap-questions-title .ap-questions-hyperlink {
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  /* Meta line should wrap instead of pushing width */
  .ap-display-question-meta .head-question {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Prevent fixed/min widths if set by plugin */
  .ap-questions-item,
  .ap-questions-item * {
    min-width: 0;
  }

  /* Links inside meta should wrap */
  .ap-display-question-meta a {
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
  }
}

/* Статьи (категория 4) – адаптив */
@media (max-width: 1024px) {
  .stati-wrapper .statiList {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

@media (max-width: 768px) {
  .stati-wrapper #page-title.page-title-block {
    padding-top: 20px;
    padding-bottom: 20px;
    margin-bottom: 50px !important;
  }

  .stati-wrapper .statiList {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .stati-wrapper .statiList__item {
    padding: 12px;
  }
}

@media (max-width: 420px) {
  .stati-wrapper .statiList__item .counter {
    font-size: .8rem;
    padding: .15rem .5rem;
  }
}

/* Sidebar вниз на узких экранах */
@media (max-width: 991px) {
  .stati-wrapper .panel.row.with-sidebar {
    flex-direction: column;
  }

  .stati-wrapper .sidebar {
    flex: 1 1 auto;
    max-width: 100%;
  }
}

/* Категории/архивы: адаптив карточек и пагинации */
@media (max-width: 768px) {
  .stati-wrapper .blog .item-post {
    padding: 12px;
  }

  .stati-wrapper .navigation.pagination .page-numbers {
    min-width: 34px;
    height: 34px;
  }

  .stati-wrapper .comment-form .col-md-4 {
    flex: 1 1 100%;
  }
}

/* Медиазапросы сгруппированы по брейкпоинтам */

/* ====== prefers-reduced-motion ====== */
@media (prefers-reduced-motion: reduce) {

  .reveal,
  .card,
  .pill,
  .btn,
  .lp-hero__media img {
    transition: none;
  }

  .reveal {
    filter: none;
  }
}

/* ====== ≤ 1024px ====== */
@media (max-width:1024px) {
  .lp-hero__wrap {
    grid-template-columns: 1fr
  }

  .lp-proof__top {
    grid-template-columns: 1fr
  }

  .lp-situ__grid {
    grid-template-columns: 1fr 1fr
  }

  .about-page .stats.stats--badges {
    grid-template-columns: 1fr 1fr
  }
}

/* ====== ≤ 992px (бургер/оверлей меню) ====== */
@media (max-width:992px) {
  .nav {
    position: relative
  }

  .brand,
  .nav-toggle {
    position: relative;
    z-index: 200
  }

  .nav-toggle {
    display: flex
  }

  .menu {
    position: relative
  }

  .menu__list {
    position: fixed;
    inset: 0;
    display: none;
    background: #fff;
    z-index: 100;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: .75rem;
    padding: 24px
  }

  .menu.is-open .menu__list {
    display: flex;
    background: white;
    height: 100vh
  }

  .menu__list>li>a {
    font-size: 1.125rem;
    padding: .75rem 1rem
  }

  .menu__icons {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    display: none;
    z-index: 101
  }

  .menu.is-open .menu__icons {
    display: flex
  }

  .menu .has-submenu>a {
    padding-right: 1.75rem
  }

  .menu .has-submenu>a::after {
    transition: .25s
  }

  .menu .has-submenu>a[aria-expanded="true"]::after {
    transform: rotate(180deg)
  }

  .menu .submenu {
    position: static;
    display: none;
    background: transparent;
    border: 0;
    padding: 0;
    box-shadow: none;
    min-width: unset;
    margin: .25rem 0 0
  }

  .menu .has-submenu.open>.submenu {
    display: block
  }
}

/* ====== ≤ 960px ====== */
@media (max-width:960px) {
  .grid--2 {
    grid-template-columns: 1fr
  }

  .grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }

  .hero__wrap {
    grid-template-columns: 1fr
  }

  .pill-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }

  .svc-how__grid {
    grid-template-columns: 1fr
  }

  .contact {
    grid-template-columns: 1fr
  }

  .about__wrap {
    grid-template-columns: 1fr
  }

  .steps__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }

  .about-page .hero__wrap {
    grid-template-columns: 1fr;
    padding: 40px 0
  }

  .about-page .hero__content {
    text-align: center
  }

  .about-page .hero__kpis {
    grid-template-columns: 1fr 1fr 1fr
  }

  .about-page .stats.stats--badges {
    grid-template-columns: 1fr
  }

  .about-page .steps--timeline .steps__grid::before {
    left: 20px
  }
}



/* ====== ≤ 640px (мобильные) ====== */
@media (max-width:640px) {

  .first_row {
    flex-wrap: wrap;
    margin-bottom: -20px;
  }

  form#ap-search-form {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  #anspress .pull-right {
    order: 2;
    display: flex;
    justify-content: center;
  }

  .copyr {
    float: unset;
    margin-top: 5px;
    text-align: center;
  }

  #ask_form .wp-editor-area {
    font-size: 18px !important;
  }

  #ask_form input,
  #ask_form select,
  #ask_form textarea,
  #ask_form label,
  #ask_form .ap-form-control {
    font-size: 18px !important;
  }

  form#commentform input {
    font-size: 18px;
    margin-bottom: 10px;
  }

  section.svc-how p {
    text-align: center;
  }

  .scenario-card__body {
    padding: .75rem .875rem .9rem
  }

  .grid.grid--2.bg-legal-corner-bl {
    flex-wrap: wrap
  }

  .flexi {
    text-align: center;
    display: flex;
    flex-direction: column;
    width: 100%
  }

  .lp-proof__top.add {
    margin-top: -20px
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem
  }

  .footer-grid>div:nth-child(1) {
    order: 2
  }

  .footer-grid>div:nth-child(2) {
    order: 3
  }

  .footer-grid>div:nth-child(3) {
    order: 1
  }

  .footer-grid>div {
    text-align: center
  }

  .u-right {
    text-align: center
  }

  .brand--center {
    margin: 0 auto
  }

  .cta-box {
    padding: 1.25rem 1.25rem
  }

  .feature-list li {
    padding: .75rem .875rem .75rem 2.5rem
  }

  .footer-grid .brand {
    display: flex;
    flex-direction: column
  }

  form.grid.grid--2>div:last-child {
    text-align: center
  }

  .menu__icons {
    bottom: -50%
  }

  .cent_but {
    text-align: center
  }

  .person-photo {
    margin: auto;
    width: 100%
  }

  section.lp-lawyer h3 {
    margin-top: -40px;
    margin-bottom: -20px
  }

  .scenarios-grid {
    grid-template-columns: 1fr
  }

  .lp-simple__media {
    max-width: 100%;
    padding: 0 20px
  }

  .container.about__wrap {
    display: flex;
    flex-direction: column-reverse
  }

  .row.row--center {
    display: flex;
    justify-content: center
  }

  .container.qual__grid {
    display: flex;
    flex-direction: column
  }

  .flex_yur {
    flex-direction: column;
    align-items: center
  }

  .flex_yur>div:last-child {
    margin-top: -50px
  }

  .lp-simple__content {
    padding: 0 20px
  }

  .lp-simple__content h2 {
    text-align: center
  }

  .container.lp-simple__wrap {
    padding: 0;
    grid-template-columns: 1fr;
  }

  .flex_yur p {
    margin: auto;
    margin-bottom: 15px;
    width: 100% !important
  }

  .flex_yur>div:last-child h2 {
    text-align: center
  }

  .container.lp-hero__wrap {
    gap: 2rem
  }

  .lp-hero__media {
    display: flex;
    justify-content: center
  }

  .lp-proof__top {
    gap: 2rem
  }

  .bg-legal-corner-tr {
    background-size: 320px 320px;
    background-position: right -80px top -80px
  }

  .bg-legal-corner-bl {
    background-size: 320px 320px;
    background-position: left -80px bottom -80px
  }

  .grid--3 {
    grid-template-columns: 1fr
  }

  .lp-situ__grid {
    grid-template-columns: 1fr
  }

  .steps__grid {
    grid-template-columns: 1fr
  }

  .about-page .hero__kpis {
    grid-template-columns: 1fr 1fr
  }
}

/* ====== ≤ 520px ====== */
@media (max-width:520px) {
  .pill-grid {
    grid-template-columns: 1fr
  }

  .about-page .hero__kpis {
    grid-template-columns: 1fr
  }
}

@media (max-width:480px) {

  #anspress #ap-filter-reset i {
    margin-right: 0px;
  }


  #anspress .ap-list-head .ap-filters {
    padding-left: 15px;
    margin-right: -8px;
    padding-right: 0px;
    display: flex;
    flex-direction: column;
  }

  #anspress #ap-filter-reset span {
    display: block;
    min-width: 160px;
    margin-left: -20px;
  }

  button.ap-btn.ap-search-btn {
    width: 100%;
  }

  .pull-right {
    width: 100%;
  }

  #anspress .ap-list-head .ap-btn-ask {
    width: 100% !important;
    display: block;
  }

}

/* ====== ≥ 720px (About timeline горизонтальный) ====== */
@media (min-width:720px) {
  .about-page .steps--timeline .steps__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 1.25rem;
    position: relative;
    padding: 0 0 20px;
    margin-top: 50px
  }

  .about-page .steps--timeline .steps__grid::before {
    content: "";
    position: absolute;
    left: 0;
    top: 56px;
    height: 2px;
    width: 100%;
    background: linear-gradient(90deg, #e5e7eb, #eef1f6)
  }

  .about-page .steps--timeline .step {
    padding: 70px 1rem 1.25rem;
    min-height: 190px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    position: relative;
    border-radius: 20px;
    box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .08)
  }

  .about-page .steps--timeline .step+.step {
    margin-top: 0
  }

  .about-page .steps--timeline .step__num {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translate(-50%, -50%);
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    border-radius: 50%;
    box-shadow: 0 8px 20px -6px rgba(235, 83, 83, .35);
    color: #fff;
    border: 4px solid #fff;
    z-index: 2
  }

  .about-page .steps--timeline .step::after {
    content: "";
    position: absolute;
    top: 56px;
    left: 100%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    z-index: 3
  }

  .about-page .steps--timeline .step:last-child::after {
    display: none
  }
}

/* ====== 600–719px (About timeline прокрутка) ====== */
@media (min-width:600px) and (max-width:719px) {
  .about-page .steps--timeline .steps__grid {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 60px 0 16px;
    scroll-snap-type: x mandatory
  }

  .about-page .steps--timeline .step {
    flex: 0 0 240px;
    scroll-snap-align: start;
    position: relative;
    padding: 70px 1rem 1.25rem;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center
  }

  .about-page .steps--timeline .steps__grid::before {
    content: "";
    position: absolute;
    left: 0;
    top: 56px;
    height: 2px;
    width: 100%;
    background: linear-gradient(90deg, #e5e7eb, #eef1f6)
  }

  .about-page .steps--timeline .step__num {
    position: absolute;
    left: 50%;
    top: 56px;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: 0 6px 16px -6px rgba(235, 83, 83, .35);
    z-index: 2
  }

  .about-page .steps--timeline .step::after {
    display: none
  }
}

/* ====== ≥ 960px ====== */
@media (min-width:960px) {
  .svc-hero .tabs[role="tablist"] {
    grid-template-columns: repeat(3, minmax(0, 1fr))
  }

  .lp-case [role="tablist"] {
    grid-template-columns: repeat(4, minmax(0, 1fr))
  }
}

/* ====== ≥ 1100px ====== */
@media (min-width:1100px) {
  .svc-hero .tabs[role="tablist"] {
    grid-template-columns: repeat(5, minmax(0, 1fr))
  }
}