/* ============================================================
   home-mobile.css — мобильная версия главной.
   Десктопная страница, уменьшенная под телефон.
   Услуги, направления, статьи — ПО 2 в ряд (аккуратно выровнены).
   Дипломы и сертификаты — по 3 (компактные). Фото hero сверху.
   Грузится после home.css. Десктоп (>767px) не затрагивается.
   ============================================================ */

@media (max-width: 767px) {

:root { --container-px: 14px; }

.section { padding: 32px 0; }
.section-header { margin-bottom: 20px; }
.section-header h2 { font-size: 1.45rem; }
.section-lead, .section-header .section-lead { font-size: 14px; margin-top: 8px; }

/* ============================================================
   HERO — фото сверху, затем текст и кнопки
   ============================================================ */
.hero { padding: 22px 0 30px; }
.hero-grid { display: flex; flex-direction: column; gap: 18px; }
.hero-visual { order: -1; max-width: 100%; margin: 0; aspect-ratio: auto; }
.hero-visual img { width: 100%; height: 290px; object-fit: cover; object-position: center 18%; border-radius: 20px; }
.hero-visual::before { opacity: 0; }
.hero-title,
.hero-title.hero-title-alt { font-size: 1.5rem !important; line-height: 1.18; margin-bottom: 12px; }
.hero-lead { font-size: 14.5px; line-height: 1.5; margin-bottom: 16px; }
.hero-actions { gap: 10px; margin-bottom: 20px; }
.hero-meta { gap: 8px; padding-top: 16px; }
.hero-meta li { padding-right: 8px; font-size: 11px; line-height: 1.3; }
.hero-meta li strong,
.hero-meta li strong[style] { font-size: 20px !important; }
.hero-meta li:last-child strong { font-size: 11.5px !important; }

/* ============================================================
   СЕТКИ
   ============================================================ */
.services-grid   { grid-template-columns: repeat(2, 1fr) !important; gap: 12px; align-items: stretch; }
.directions-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px; max-width: none; margin: 0; }
.articles-grid   { grid-template-columns: repeat(2, 1fr) !important; gap: 12px; }
.edu-grid        { grid-template-columns: repeat(3, 1fr) !important; gap: 8px; }
.certs-grid      { grid-template-columns: repeat(3, 1fr) !important; gap: 7px; }

/* ---- Карточка услуги: 2 в ряд, аккуратно выровнено ----
   Приёмы выравнивания:
   • h3 фиксированной высоты (2 строки) → подзаголовки/цены на одном уровне
   • подзаголовок ("С письменным заключением"/"Без заключения") мин-высота
   • у карточек без подзаголовка — компенсирующий отступ до цены
   • список растягивается (flex-grow из home.css) → кнопки прижаты к низу */
.service-card { padding: 16px 14px; border-radius: 16px; }
.service-card-featured { padding-top: 24px; transform: none; }
.service-card-icon { width: 44px; height: 44px; margin-bottom: 12px; border-radius: 10px; }
.service-card-icon svg { width: 24px; height: 24px; }
.service-card h3 {
    font-size: 15px !important;
    min-height: 2.5em;                 /* ~2 строки → выравнивание по вертикали */
    margin-bottom: 4px;
    line-height: 1.25;
    display: flex; align-items: flex-start;
}
.service-card > p[style] {             /* подзаголовок под h3 */
    font-size: 11.5px !important;
    min-height: 1.3em;
    margin-bottom: 8px !important;
    color: #4a6080 !important;
}
.service-card h3 + .service-price-row {/* карточки без подзаголовка — тот же отступ */
    margin-top: calc(1.3em + 8px) !important;
}
.service-price-row { padding: 8px 10px; margin: 0 0 12px; border-radius: 8px; }
.service-price-amount { font-size: 18px !important; }
.service-price-unit { font-size: 11px !important; }
.service-list { gap: 8px; margin-bottom: 14px; }
.service-list li { font-size: 12.5px; padding-left: 20px; line-height: 1.4; }
.service-list li::before { width: 15px; height: 15px; background-size: 10px; top: 4px; }
.service-card-tag { font-size: 10px; padding: 4px 10px; top: -10px; }
.svc-toggle-btn { font-size: 11px; margin: 4px 0 8px; }
.service-card .btn { min-height: 44px; padding: 10px 12px; font-size: 13px; border-radius: 10px; }

/* ---- Направления (2 в ряд) ---- */
.direction-card-img { aspect-ratio: 4/3; }
.direction-card-body { padding: 14px; }
.direction-card-body h3 { font-size: 15px; margin-bottom: 6px; line-height: 1.25; }
.direction-card-link { font-size: 12.5px; gap: 4px; }

/* ---- Статьи (2 в ряд) ---- */
.article-card-body { padding: 14px; }
.article-card h3 { font-size: 15px; line-height: 1.28; }
.article-card p { font-size: 12.5px; -webkit-line-clamp: 3; margin-bottom: 12px; }
.article-card-link { font-size: 12.5px; }

/* ---- Дипломы (3 в ряд, компактно) ---- */
.edu-grid { margin-top: 20px; }
.edu-card { padding: 12px 10px; border-radius: 13px; gap: 4px; }
.edu-card-icon { width: 34px; height: 34px; margin-bottom: 5px; }
.edu-card-icon svg { width: 19px; height: 19px; }
.edu-card-year { font-size: 10px; }
.edu-card-degree { font-size: 9px; }
.edu-card-title { font-size: 11.5px; line-height: 1.28; }
.edu-card-org { font-size: 10.5px; line-height: 1.3; }
.edu-pdf-badge { font-size: 8px; padding: 2px 5px; top: 8px; right: 8px; }

/* ---- Сертификаты (3 в ряд) ---- */
.certs-wrap { margin-top: 28px !important; }
.certs-title { font-size: 16px; margin-bottom: 12px; }
.cert-item { padding: 10px 9px 12px; border-radius: 10px; gap: 3px; }
.cert-year { font-size: 9px; }
.cert-name { font-size: 10.5px; line-height: 1.28; }
.cert-org { font-size: 9.5px; line-height: 1.25; }
.cert-doc-badge { font-size: 7.5px; padding: 2px 4px; }

/* ============================================================
   Блоки в одну колонку (текст+фото, шаги, форма) — уменьшены
   ============================================================ */
.about-grid { gap: 22px; }
.about-img img { max-height: 340px; object-fit: cover; }
.about-accred-badge {
    position: static; transform: none; margin: 12px auto 0;
    white-space: normal; text-align: center; justify-content: center;
    border-radius: 12px; font-size: 12px; line-height: 1.3;
}
.about-content h2 { font-size: 1.45rem; margin-bottom: 12px; }
.about-lead { font-size: 14.5px; }
.about-text { font-size: 13.5px; }

.workplace-banner { padding: 16px; }

.steps { gap: 10px; }
.steps-item { padding: 16px; }
.steps-item h3 { font-size: 15px; }
.steps-item p, .steps-list li { font-size: 12.5px; }

.contacts-grid { gap: 24px; }
.contacts-info h2 { font-size: 1.45rem; }
.contacts-form-wrap .card { padding: 16px 14px; }

}

/* Узкие телефоны — 2 колонки услуг сохраняем, чуть мельче */
@media (max-width: 360px) {
    :root { --container-px: 12px; }
    .services-grid, .directions-grid, .articles-grid { gap: 10px; }
    .service-card { padding: 14px 11px; }
    .service-card h3 { font-size: 14px !important; }
    .service-list li { font-size: 12px; }
}
