:root {
    --amma-font-ui: "Onest", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    --amma-type-body: clamp(15px, 1.02vw, 17px);
    --amma-type-small: 14px;
    --amma-type-meta: 13px;
    --amma-type-title-xl: clamp(34px, 4vw, 48px);
    --amma-type-title-lg: clamp(28px, 2.75vw, 38px);
    --amma-type-title-md: clamp(21px, 1.75vw, 25px);
    --amma-type-title-sm: clamp(18px, 1.35vw, 21px);
}

body.amma-med-theme,
body.amma-med-theme input,
body.amma-med-theme textarea,
body.amma-med-theme select,
body.amma-med-theme button {
    font-family: var(--amma-font-ui);
}

body.amma-med-theme {
    color: var(--amma-text);
}

body.amma-med-theme :where(
    p,
    li,
    dd,
    dt,
    label,
    input,
    textarea,
    select,
    button,
    .amma-entry-content,
    .amma-section-text,
    .amma-page-top__lead,
    .amma-home-hero__lead,
    .amma-home-section__text,
    .amma-services-hero__lead,
    .amma-archive-services-hero__lead,
    .amma-archive-doctors-hero__lead,
    .smed-cat-hero__lead,
    .smed-spec-hero__lead,
    .amma-company-richtext,
    .amma-legal-richtext,
    .amma-search-result__excerpt,
    .amma-doc-card__excerpt
) {
    font-size: var(--amma-type-body);
    line-height: 1.72;
    color: var(--amma-text);
}

body.amma-med-theme :where(
    .amma-page-top__lead p,
    .amma-home-hero__lead p,
    .amma-section-text p,
    .amma-entry-content p,
    .amma-company-richtext p,
    .amma-legal-richtext p,
    .smed-cat-hero__lead p,
    .smed-spec-hero__lead p
) {
    margin-top: 0;
    margin-bottom: 14px;
}

body.amma-med-theme :where(
    .amma-page-top__title,
    .amma-home-hero__title,
    .amma-services-hero__title,
    .amma-archive-services-hero__title,
    .amma-archive-doctors-hero__title,
    .smed-cat-hero__title,
    .smed-spec-hero__title,
    .amma-specialists-profile__title
) {
    font-size: var(--amma-type-title-xl);
    line-height: 1.04;
    letter-spacing: -0.035em;
    color: var(--amma-title);
}

body.amma-med-theme :where(
    .amma-section-title,
    .amma-home-section__title,
    .amma-price-section__head h2,
    .amma-search-drawer__title,
    .amma-mobile-drawer__title,
    .amma-patient-guide-side h2
) {
    font-size: var(--amma-type-title-lg);
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--amma-title);
}

body.amma-med-theme :where(
    h3,
    .amma-company-doc-card__title,
    .amma-home-service-card__title,
    .amma-home-doctor-card__name,
    .amma-home-directions__title,
    .amma-submenu-card__title,
    .amma-company-link-card__title,
    .amma-authority-card__title,
    .amma-doc-card__title,
    .amma-contact-card h3,
    .amma-helper-card h3,
    .amma-info-box h3,
    .smed-cat-service__title,
    .smed-spec-doctor-card__name,
    .amma-patient-guide-card h3,
    .amma-service-guide-card h3
) {
    font-size: var(--amma-type-title-md);
    line-height: 1.16;
    letter-spacing: -0.025em;
    color: var(--amma-title);
}

body.amma-med-theme :where(
    .amma-header__tagline,
    .amma-header__worktime,
    .amma-home-hero__contactline,
    .amma-home-direction__count,
    .amma-company-summary-card p,
    .amma-services-stat span,
    .amma-patient-guide-note,
    .amma-service-guide-card__note,
    .amma-patient-guide-side__contacts a,
    .amma-patient-guide-stat span,
    .amma-service-guide-card__list li,
    .amma-patient-guide-list li
) {
    font-size: var(--amma-type-small);
    line-height: 1.58;
}

body.amma-med-theme :where(
    .amma-kicker,
    .amma-chip,
    .amma-filter-pill,
    .amma-home-service-card__chip,
    .amma-company-pill,
    .amma-site-footer__chips a,
    .amma-home-directions__count,
    .amma-company-doc-card__type,
    .amma-submenu-card__meta
) {
    font-size: var(--amma-type-meta);
    line-height: 1.2;
    font-weight: 700;
}

body.amma-med-theme :where(
    .amma-btn,
    .wp-element-button,
    button,
    input[type="submit"],
    input[type="button"]
) {
    font-size: 16px;
    line-height: 1.12;
    font-weight: 700;
}

body.amma-med-theme .amma-info-list li,
body.amma-med-theme .amma-entry-content ul li,
body.amma-med-theme .amma-entry-content ol li {
    margin-bottom: 10px;
}

body.amma-med-theme .amma-entry-content :where(h2, h3, h4) {
    color: var(--amma-title);
    margin-top: 0;
    margin-bottom: 14px;
}

body.amma-med-theme .amma-entry-content h2 {
    font-size: var(--amma-type-title-lg);
    line-height: 1.1;
}

body.amma-med-theme .amma-entry-content h3,
body.amma-med-theme .amma-entry-content h4 {
    font-size: var(--amma-type-title-md);
    line-height: 1.16;
}

body.amma-med-theme :where(
    .amma-home-hero__lead,
    .amma-section-text,
    .amma-entry-content,
    .smed-cat-hero__lead,
    .smed-spec-hero__lead,
    .amma-company-richtext,
    .amma-legal-richtext
) {
    max-width: 72ch;
}

body.amma-med-theme :where(
    input::placeholder,
    textarea::placeholder
) {
    color: var(--amma-muted);
    opacity: .85;
}

@media (max-width: 1024px) {
    :root {
        --amma-type-title-xl: clamp(30px, 5.6vw, 40px);
        --amma-type-title-lg: clamp(24px, 4.4vw, 32px);
        --amma-type-title-md: clamp(20px, 3vw, 24px);
    }
}

@media (max-width: 767px) {
    :root {
        --amma-type-body: 15px;
        --amma-type-small: 13px;
        --amma-type-title-xl: clamp(28px, 8.4vw, 36px);
        --amma-type-title-lg: clamp(24px, 7vw, 30px);
        --amma-type-title-md: clamp(19px, 5.6vw, 22px);
    }

    body.amma-med-theme :where(
        .amma-page-top__lead,
        .amma-home-hero__lead,
        .amma-section-text,
        .amma-entry-content,
        .smed-cat-hero__lead,
        .smed-spec-hero__lead,
        .amma-company-richtext,
        .amma-legal-richtext
    ) {
        max-width: none;
    }
}
