/* Frontend only. Read the live parent-theme/Elementor typography roles.
 * Important declarations deliberately replace page-specific and inline type
 * overrides; layout, colours and semantic emphasis remain component-owned.
 */
body:not(.wp-admin),
body:not(.wp-admin) :is(.woocommerce, .ehbo-product-grid, .ffehbo-account-modal, .ffehbo-account-dashboard, .ffehbo-courses, .ffehbo-account-certificates, .ffehbo-orders, .ffehbo-profile) {
  font-family: var(--cmsmasters-text-font-family) !important;
  font-size: var(--cmsmasters-text-font-size) !important;
  font-weight: var(--cmsmasters-text-font-weight) !important;
  font-style: var(--cmsmasters-text-font-style) !important;
  text-transform: var(--cmsmasters-text-text-transform) !important;
  text-decoration: var(--cmsmasters-text-text-decoration) !important;
  line-height: var(--cmsmasters-text-line-height) !important;
  letter-spacing: var(--cmsmasters-text-letter-spacing) !important;
  word-spacing: var(--cmsmasters-text-word-spacing) !important;
}

body:not(.wp-admin) p {
  font-family: var(--cmsmasters-text-font-family) !important;
  font-size: var(--cmsmasters-text-font-size) !important;
  font-weight: var(--cmsmasters-text-font-weight) !important;
  font-style: var(--cmsmasters-text-font-style) !important;
  text-transform: var(--cmsmasters-text-text-transform) !important;
  text-decoration: var(--cmsmasters-text-text-decoration) !important;
  line-height: var(--cmsmasters-text-line-height) !important;
  letter-spacing: var(--cmsmasters-text-letter-spacing) !important;
  word-spacing: var(--cmsmasters-text-word-spacing) !important;
}

body:not(.wp-admin) h1 {
  font-family: var(--cmsmasters-h1-font-family) !important;
  font-size: var(--cmsmasters-h1-font-size) !important;
  font-weight: var(--cmsmasters-h1-font-weight) !important;
  font-style: var(--cmsmasters-h1-font-style) !important;
  text-transform: var(--cmsmasters-h1-text-transform) !important;
  text-decoration: var(--cmsmasters-h1-text-decoration) !important;
  line-height: var(--cmsmasters-h1-line-height) !important;
  letter-spacing: var(--cmsmasters-h1-letter-spacing) !important;
  word-spacing: var(--cmsmasters-h1-word-spacing) !important;
}

body:not(.wp-admin) h2 {
  font-family: var(--cmsmasters-h2-font-family) !important;
  font-size: var(--cmsmasters-h2-font-size) !important;
  font-weight: var(--cmsmasters-h2-font-weight) !important;
  font-style: var(--cmsmasters-h2-font-style) !important;
  text-transform: var(--cmsmasters-h2-text-transform) !important;
  text-decoration: var(--cmsmasters-h2-text-decoration) !important;
  line-height: var(--cmsmasters-h2-line-height) !important;
  letter-spacing: var(--cmsmasters-h2-letter-spacing) !important;
  word-spacing: var(--cmsmasters-h2-word-spacing) !important;
}

body:not(.wp-admin) h3 {
  font-family: var(--cmsmasters-h3-font-family) !important;
  font-size: var(--cmsmasters-h3-font-size) !important;
  font-weight: var(--cmsmasters-h3-font-weight) !important;
  font-style: var(--cmsmasters-h3-font-style) !important;
  text-transform: var(--cmsmasters-h3-text-transform) !important;
  text-decoration: var(--cmsmasters-h3-text-decoration) !important;
  line-height: var(--cmsmasters-h3-line-height) !important;
  letter-spacing: var(--cmsmasters-h3-letter-spacing) !important;
  word-spacing: var(--cmsmasters-h3-word-spacing) !important;
}

body:not(.wp-admin) h4 {
  font-family: var(--cmsmasters-h4-font-family) !important;
  font-size: var(--cmsmasters-h4-font-size) !important;
  font-weight: var(--cmsmasters-h4-font-weight) !important;
  font-style: var(--cmsmasters-h4-font-style) !important;
  text-transform: var(--cmsmasters-h4-text-transform) !important;
  text-decoration: var(--cmsmasters-h4-text-decoration) !important;
  line-height: var(--cmsmasters-h4-line-height) !important;
  letter-spacing: var(--cmsmasters-h4-letter-spacing) !important;
  word-spacing: var(--cmsmasters-h4-word-spacing) !important;
}

body:not(.wp-admin) h5 {
  font-family: var(--cmsmasters-h5-font-family) !important;
  font-size: var(--cmsmasters-h5-font-size) !important;
  font-weight: var(--cmsmasters-h5-font-weight) !important;
  font-style: var(--cmsmasters-h5-font-style) !important;
  text-transform: var(--cmsmasters-h5-text-transform) !important;
  text-decoration: var(--cmsmasters-h5-text-decoration) !important;
  line-height: var(--cmsmasters-h5-line-height) !important;
  letter-spacing: var(--cmsmasters-h5-letter-spacing) !important;
  word-spacing: var(--cmsmasters-h5-word-spacing) !important;
}

body:not(.wp-admin) h6 {
  font-family: var(--cmsmasters-h6-font-family) !important;
  font-size: var(--cmsmasters-h6-font-size) !important;
  font-weight: var(--cmsmasters-h6-font-weight) !important;
  font-style: var(--cmsmasters-h6-font-style) !important;
  text-transform: var(--cmsmasters-h6-text-transform) !important;
  text-decoration: var(--cmsmasters-h6-text-decoration) !important;
  line-height: var(--cmsmasters-h6-line-height) !important;
  letter-spacing: var(--cmsmasters-h6-letter-spacing) !important;
  word-spacing: var(--cmsmasters-h6-word-spacing) !important;
}

/* Product heroes share the account hero's theme heading role. */
body:not(.wp-admin) .ffehbo-hero-title {
  font-family: var(--ffehbo-font-family-heading) !important;
  font-size: var(--ffehbo-font-size-hero-title) !important;
  font-weight: var(--ffehbo-font-weight-hero-title) !important;
  font-style: var(--cmsmasters-h2-font-style) !important;
  text-transform: var(--cmsmasters-h2-text-transform) !important;
  text-decoration: var(--cmsmasters-h2-text-decoration) !important;
  line-height: var(--ffehbo-line-height-heading) !important;
  letter-spacing: var(--cmsmasters-h2-letter-spacing) !important;
  word-spacing: var(--cmsmasters-h2-word-spacing) !important;
}

/* Support-card headings retain their semantic level while using the active
 * theme's compact h4 role, including its tablet/mobile settings. */
body:not(.wp-admin) :is(.ffehbo-compact-title, .ff-product-sidebar-card--categories h2) {
  font-family: var(--ffehbo-font-family-compact-title) !important;
  font-size: var(--ffehbo-font-size-compact-title) !important;
  font-weight: var(--ffehbo-font-weight-compact-title) !important;
  font-style: var(--cmsmasters-h4-font-style) !important;
  text-transform: var(--cmsmasters-h4-text-transform) !important;
  text-decoration: var(--cmsmasters-h4-text-decoration) !important;
  line-height: var(--ffehbo-line-height-compact-title) !important;
  letter-spacing: var(--cmsmasters-h4-letter-spacing) !important;
  word-spacing: var(--cmsmasters-h4-word-spacing) !important;
}

body:not(.wp-admin) :is(h1, h2, h3, h4, h5, h6) :is(strong, b, a, span) {
  font-family: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  font-style: inherit !important;
  line-height: inherit !important;
  letter-spacing: inherit !important;
}

body:not(.wp-admin) :is(button, input, select, textarea) {
  font-family: var(--cmsmasters-text-font-family);
}

/* Compact archive headings retain the heading family and colour. */
body:not(.wp-admin) .ffehbo-shop-archive ul.products li.product h2.woocommerce-loop-product__title {
  font-size: var(--ffehbo-font-size-card-price) !important;
  line-height: var(--ffehbo-line-height-compact) !important;
}

/* Fly Cart copy follows the same responsive body role as ordinary pages.
 * Target text only: icon glyphs, action buttons and pills keep their roles. */
body:not(.wp-admin) .woofc-area,
body:not(.wp-admin) .woofc-area :is(
  .woofc-area-heading,
  .woofc-item-title,
  .woofc-item-title a,
  .woofc-item-data,
  .woofc-item-data.ff-meta-fixed,
  .woofc-item.ffehbo-course-fly-cart-item .woofc-item-data.ffehbo-fly-cart-meta,
  .ffehbo-fly-cart-meta__row,
  .ffehbo-fly-cart-participants,
  .ffehbo-course-category,
  .woofc-subtotal,
  .woofc-total,
  .woofc-total .amount,
  .woofc-subtotal .amount,
  .woofc-empty,
  .woofc-suggested-heading,
  .woofc-suggested-product-title,
  .woofc-suggested-product-title a
) {
  font-family: var(--ffehbo-font-family) !important;
  font-size: var(--ffehbo-font-size-body) !important;
  line-height: var(--ffehbo-line-height-body) !important;
}

/* Product prices use the existing readable shop price role, including nested
 * WPC/WooCommerce amount markup that may carry its own smaller font size. */
body:not(.wp-admin) .woofc-area :is(.woofc-item-price, .woofc-suggested-product-price),
body:not(.wp-admin) .woofc-area :is(.woofc-item-price, .woofc-suggested-product-price) :is(.amount, bdi, ins, del) {
  font-size: var(--ffehbo-font-size-card-price) !important;
  line-height: var(--ffehbo-line-height-compact) !important;
}
