/*
 * INSTYTUT MOCY — PUBLIC TYPE SYSTEM v1.6.36
 * Roles, not arbitrary heading tags, determine typography.
 * Two families: Georgia 400 (editorial / display), Montserrat (UI and prose).
 * Used on public pages only. NEVER enqueue for PWA / account / checkout / lessons.
 * Intentional exceptions: oversized homepage/landing hero, compact specialist
 * profile headings handled by the specialist-profile plugin, and UI h2 titles.
 *
 * Scale (desktop): 50 / 36 / 30 / 20 / 18 / 16 / 14 / 12 px.
 * Weights: 400 / 500 / 600 / 700. Preserve Montserrat 400 body copy.
 */
body.im-theme:not(.im-application-shell) {
  --im-type-display: Georgia, "Times New Roman", serif;
  --im-type-interface: "Montserrat", Arial, sans-serif;
  --im-type-page: 50px;
  --im-type-section: 36px;
  --im-type-subsection: 30px;
  --im-type-heading: 20px;
  --im-type-card: 18px;
  --im-type-body: 16px;
  --im-type-lead: 18px;
  --im-type-secondary: 14px;
  --im-type-label: 12px;
}

/* Editorial headings: do not resize creative homepage or bespoke landing hero.
 * Do not touch embedded bookings, pricing application, e-commerce controls, or
 * special-purpose course/profile layouts. Profile plugin owns its headings. */
body.im-theme:not(.im-application-shell):not(.im-specialist-profile):not(.im-learnpress-profile)
#main-content :is(h1,h2):not(:where(.im-pwa-app *,[data-imx-app] *,.im-booking-widget *,#im-pricing *,.im-specialists-directory .im-specialist-card *)),
body.im-theme:not(.im-application-shell):not(.im-specialist-profile) .im-sol :is(h1,h2) {
  font-family: var(--im-type-display) !important;
  font-weight: 400 !important;
  font-synthesis: none;
  text-transform: none;
  letter-spacing: -.025em;
  text-wrap: balance;
}
/* Functional h3–h6 names never turn into display serif; profile uses its
 * own H3 reviews SECTION exception and is deliberately excluded here. */
body.im-theme:not(.im-application-shell):not(.im-specialist-profile):not(.im-learnpress-profile)
#main-content :is(h3,h4,h5,h6):not(:where(.im-pwa-app *,[data-imx-app] *,.im-booking-widget *,#im-pricing *)),
body.im-theme:not(.im-application-shell) .im-sol :is(h3,h4,h5,h6) {
  font-family: var(--im-type-interface) !important;
  font-weight: 600 !important;
  text-transform: none;
  letter-spacing: -.012em;
  line-height: 1.32;
}

/* Default fourth-to-sixth-level headings follow a restrained UI scale.
 * Component-specific rules may choose a different size when justified. */
body.im-theme:not(.im-application-shell):not(.im-specialist-profile):not(.im-learnpress-profile)
#main-content h4:not(:where(.im-pwa-app *,[data-imx-app] *,.im-booking-widget *,#im-pricing *)) {
  font-size: var(--im-type-card);
}
body.im-theme:not(.im-application-shell):not(.im-specialist-profile):not(.im-learnpress-profile)
#main-content h5:not(:where(.im-pwa-app *,[data-imx-app] *,.im-booking-widget *,#im-pricing *)) {
  font-size: var(--im-type-body);
}
body.im-theme:not(.im-application-shell):not(.im-specialist-profile):not(.im-learnpress-profile)
#main-content h6:not(:where(.im-pwa-app *,[data-imx-app] *,.im-booking-widget *,#im-pricing *)) {
  font-size: var(--im-type-secondary);
}

/* Standard site-archive and Elementor page heading (Programy/Sklep, etc.).
 * Deliberate strong specificity: Eduma/Thim Elementor Kit inject their sizes
 * separately (historically 72.54 and 60.8 px). */
body.im-theme:not(.im-application-shell):is(.post-type-archive-lp_course,.post-type-archive-product,.page-id-16,.page-id-544)
#main-content :is(.thim-ekit-page-title h1.page-title,.elementor-widget-heading h1.elementor-heading-title,.sc_heading h1.title),
body.im-theme:not(.im-application-shell) .top_site_main .page-title-wrapper h1.page-title {
  font-family: var(--im-type-display) !important;
  font-size: var(--im-type-page) !important;
  font-weight: 400 !important;
  line-height: 1.14 !important;
  letter-spacing: -.025em !important;
  text-transform: none !important;
  text-wrap: balance;
}

/* Elementor HTML content: O nas is split into two widgets that share rules.
 * The strongly scoped selectors correct embedded widget CSS without removing
 * individual decorative colors, section layout or the existing film element. */
body.im-theme.page-id-541 #main-content .im-about-page :is(h1.ima-title,h1.ima-title span,h1.ima-title strong,h1.ima-title em) {
  font-family: var(--im-type-display) !important;
  font-size: var(--im-type-page) !important;
  font-weight: 400 !important;
  letter-spacing: -.025em !important;
  line-height: 1.14 !important;
}
body.im-theme.page-id-541 #main-content .im-about-page :is(h2.ima-heading,h2.ima-heading--small,.ima-film-bridge h2,.ima-cta h2,.ima-people-intro h2) {
  font-family: var(--im-type-display) !important;
  font-size: var(--im-type-section) !important;
  font-weight: 400 !important;
  letter-spacing: -.02em !important;
  line-height: 1.2 !important;
}
body.im-theme.page-id-541 #main-content .im-about-page :is(.ima-card-title,.ima-role-card h3) {
  font-family: var(--im-type-interface) !important;
  font-size: var(--im-type-heading) !important;
  font-weight: 600 !important;
  line-height: 1.32 !important;
  letter-spacing: -.012em !important;
}

/* About: quiet, generous editorial paragraphs underneath serif section titles.
 * Hero lead is a purposeful larger exception, not a third body font size. */
body.im-theme.page-id-541 #main-content .im-about-page :is(.ima-copy,.ima-section-lead,.ima-people-intro > p) {
  font-size: var(--im-type-body);
  font-weight: 400;
  line-height: 1.7;
}

/* Specialist landing: a deliberate display hero (60px), but section headings
 * at 40px instead of 48px. This restores a meaningful size gap vs the hero. */
body.im-theme:not(.im-application-shell) #main-content .im-join3--benefits :is(.im-join4-section-head > h2,.im-join3-final-box > h2) {
  font-family: var(--im-type-display) !important;
  font-size: clamp(30px, 3.05vw, 40px) !important;
  font-weight: 400 !important;
  line-height: 1.2 !important;
  letter-spacing: -.022em !important;
}
body.im-theme:not(.im-application-shell) #main-content .im-join3--benefits .im-join4-card > h3 {
  font-family: var(--im-type-interface) !important;
  font-size: var(--im-type-heading);
  font-weight: 600 !important;
  line-height: 1.32;
}

/* Directory: clear paragraph, predictable section hierarchy and compact cards.
 * Keep the pre-existing semantic split after the first intro sentence. */
body.im-theme:not(.im-application-shell) .im-sdir-intro__lead {
  font-family: var(--im-type-interface);
  font-size: var(--im-type-lead);
  font-weight: 400;
  line-height: 1.65;
  overflow-wrap: normal;
  word-break: normal;
}
body.im-theme:not(.im-application-shell) .im-sdir-intro__facts li {
  font-size: var(--im-type-secondary);
  font-weight: 600;
}
body.im-theme:not(.im-application-shell) .im-sdir-section > h2,
body.im-theme:not(.im-application-shell) .im-sdir-section .im-sdir-section__head h2 {
  font-family: var(--im-type-display) !important;
  font-size: var(--im-type-section);
  font-weight: 400 !important;
  line-height: 1.2;
  letter-spacing: -.02em;
}
body.im-theme:not(.im-application-shell) .im-sdir-section p {
  font-size: var(--im-type-body);
  line-height: 1.65;
}
body.im-theme:not(.im-application-shell) .im-sdir-section h3 {
  font-family: var(--im-type-interface) !important;
  font-size: var(--im-type-card);
  font-weight: 600 !important;
  line-height: 1.32;
}
/* A small 'Need help?' card is UI, even though it uses an h2 element. */
body.im-theme:not(.im-application-shell):not(.im-specialist-profile):not(.im-learnpress-profile) #main-content .im-sdir-help__copy h2 {
  font-family: var(--im-type-interface) !important;
  font-size: var(--im-type-card);
  font-weight: 600 !important;
  line-height: 1.32;
}
body.im-theme:not(.im-application-shell) .im-specialists-directory .im-specialist-card h3,
body.im-theme:not(.im-application-shell) .im-specialists-directory .im-specialist-card h3 a {
  font-family: var(--im-type-interface) !important;
  font-size: var(--im-type-card);
  font-weight: 600 !important;
  line-height: 1.32;
  letter-spacing: -.012em;
}

/* Solutions are narrative marketing pages, not generic SaaS settings. */
body.im-theme:not(.im-application-shell) .im-sol :is(.im-sol__hero h1,.im-sol__hub-intro h1) {
  font-family: var(--im-type-display) !important;
  font-size: var(--im-type-page);
  font-weight: 400 !important;
  line-height: 1.14;
  letter-spacing: -.025em;
}
body.im-theme:not(.im-application-shell) .im-sol :is(.im-sol__section > h2,.im-sol__hub-section-head h2,.im-community-section__intro h2) {
  font-size: var(--im-type-section);
  font-weight: 400 !important;
  line-height: 1.2;
  letter-spacing: -.02em;
}
body.im-theme:not(.im-application-shell) .im-sol :is(.im-sol__card h3,.im-sol__feature h3,.im-sol__steps h3,.im-community-section__item h3) {
  font-family: var(--im-type-interface) !important;
  font-size: var(--im-type-heading);
  font-weight: 600 !important;
  line-height: 1.32;
}
body.im-theme:not(.im-application-shell) .im-sol .im-sol__cta h2 {
  font-size: var(--im-type-subsection);
  font-weight: 400 !important;
  line-height: 1.2;
}
body.im-theme:not(.im-application-shell) .im-sol .im-sol__lead {
  font-size: var(--im-type-lead);
  line-height: 1.65;
}
body.im-theme:not(.im-application-shell) .im-sol :is(.im-sol__eyebrow,.im-sol__feature-number) {
  font-family: var(--im-type-interface);
  font-size: var(--im-type-label);
  font-weight: 700;
}

/* Card identity is UI even if Thim/Woo/LP emit an h2. A product/course name
 * must not inherit the page-title font or size. */
body.im-theme:not(.im-application-shell) #main-content :is(
  .course-item .course-title, .course-item .course-title a,
  .course-item h2, .course-item h2 a,
  .learn-press-courses .course-title, .learn-press-courses .course-title a,
  .thim-course-grid .course-title, .thim-course-grid .course-title a,
  .woocommerce ul.products li.product .woocommerce-loop-product__title,
  .woocommerce ul.products li.product .woocommerce-loop-product__title a,
  .woocommerce .thim-ekit-single-product__related .thim-ekits-product__related__item.product h2
) {
  font-family: var(--im-type-interface) !important;
  font-size: var(--im-type-card) !important;
  font-weight: 600 !important;
  letter-spacing: -.012em;
  line-height: 1.35;
}
body.im-theme:not(.im-application-shell) #main-content :is(.im-post-card__title,.im-post-card__title a) {
  font-family: var(--im-type-interface) !important;
  font-size: var(--im-type-heading);
  font-weight: 600 !important;
  line-height: 1.32;
}
body.im-theme:not(.im-application-shell) :is(.im-post-card__excerpt,.im-single__content) {
  font-family: var(--im-type-interface);
  font-size: var(--im-type-body);
  font-weight: 400;
  line-height: 1.7;
}
body.im-theme:not(.im-application-shell) :is(.im-post-card__meta,.im-single__meta) {
  font-size: var(--im-type-label);
  font-weight: 500;
}

/* The specialist profile plugin owns the design, but its public service labels
 * used intermediate 650 weight. Normalize only actual offering labels; never
 * touch identity, section titles, ratings or private profile editor. */
body.im-theme.im-specialist-profile:not(.im-application-shell) .lp-single-instructor .im-profile-offer-area :is(.im-public-services__group-title,.im-public-services__name) {
  font-family: var(--im-type-interface) !important;
  font-weight: 600 !important;
}

/* Marketing footer CTA: editorial, but smaller than a full page heading. */
body.im-theme:not(.im-application-shell) .im-footer-cta__copy > h2 {
  font-family: var(--im-type-display) !important;
  font-size: 42px;
  font-weight: 400 !important;
  line-height: 1.17;
  letter-spacing: -.025em;
}

/* Navigation, actions and footer: fewer arbitrary font sizes and weights. */
body.im-theme:not(.im-application-shell) #masthead.im-site-header :is(.im-premium-nav__link,.im-header-app-cta,.im-header__cta) {
  font-family: var(--im-type-interface);
  font-size: var(--im-type-secondary);
  font-weight: 600;
}
body.im-theme:not(.im-application-shell) .im-header-topbar :is(.im-header-topbar__message,.im-utility-menu a) {
  font-family: var(--im-type-interface);
  font-size: var(--im-type-label);
  font-weight: 600;
}
body.im-theme:not(.im-application-shell) .im-site-footer :is(.im-footer-widget__title,.im-footer__column h2) {
  font-family: var(--im-type-interface) !important;
  font-size: var(--im-type-label);
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: .055em;
}
body.im-theme:not(.im-application-shell) .im-site-footer :is(.im-footer-menu a,.im-footer-widget a,.im-footer__brand > p) {
  font-family: var(--im-type-interface);
  font-size: var(--im-type-secondary);
  font-weight: 400;
  line-height: 1.65;
}

@media (max-width: 991px) {
  body.im-theme:not(.im-application-shell) {
    --im-type-page: 42px;
    --im-type-section: 32px;
    --im-type-subsection: 28px;
  }
}
@media (max-width: 620px) {
  body.im-theme:not(.im-application-shell) {
    --im-type-page: clamp(34px, 8.8vw, 40px);
    --im-type-section: clamp(28px, 7.2vw, 32px);
    --im-type-subsection: 26px;
    --im-type-heading: 19px;
    --im-type-card: 17px;
    --im-type-lead: 16px;
  }
  body.im-theme:not(.im-application-shell) .im-footer-cta__copy > h2 {
    font-size: 32px;
  }
}
