/**
 * Category content, tech table & product description styling
 * Uses CSS vars: --if-content-heading-font, --if-content-body-font, --if-content-color,
 * --if-content-heading-color, --if-content-h1-size … h6-size, --if-content-p-size,
 * --if-content-list-font, --if-content-list-color, --if-content-li-size,
 * --if-content-h1-line-height … h6-line-height,
 * --if-content-h1-margin-* … h6-margin-*, --if-content-p-margin-*, --if-content-list-margin-*,
 * --if-content-hr-*, --if-content-table-*
 * .if-category-content, .if-category-tech-table, .woocommerce-Tabs-panel--description
 *
 * @package HelloElementorChild_IronFort
 */

/* Shared scope for content blocks (vars applied via Customizer inline style) */
.if-category-content.if-category-seo-content,
.if-category-tech-table,
.woocommerce-Tabs-panel--description {
    --if-content-heading-font: 'ONDER', sans-serif;
    --if-content-body-font: 'Inter', sans-serif;
    --if-content-color: black;
    --if-content-heading-color: var(--if-content-color);
    /* ONDER draws about twice its nominal size, so heading sizes are halved:
       15/12/10/9 are the production Customizer values; h5/h6 had no Customizer
       value and fell back to 1.1rem = 17.6px ONDER — on «Мостик для кровли» the
       word «МЕТАЛЛОЧЕРЕПИЦЫ,» in an h5 was 531px and the page 529px wide at 375. */
    --if-content-h1-size: 15px;
    --if-content-h2-size: 12px;
    --if-content-h3-size: 10px;
    --if-content-h4-size: 9px;
    --if-content-h5-size: 8px;
    --if-content-h6-size: 8px;
    --if-content-h1-line-height: 1.25;
    --if-content-h2-line-height: 1.3;
    --if-content-h3-line-height: 1.35;
    --if-content-h4-line-height: 1.35;
    --if-content-h5-line-height: 1.4;
    --if-content-h6-line-height: 1.4;
    --if-content-p-size: 1rem;
    --if-content-list-font: inherit;
    --if-content-list-color: inherit;
    --if-content-li-size: 1rem;
    --if-content-p-margin-top: 0;
    --if-content-p-margin-bottom: 1em;
    --if-content-list-margin-top: 0;
    --if-content-list-margin-bottom: 1em;
    --if-content-h1-margin-top: 0;
    --if-content-h1-margin-bottom: 0.5em;
    --if-content-h2-margin-top: 0;
    --if-content-h2-margin-bottom: 0.5em;
    --if-content-h3-margin-top: 0;
    --if-content-h3-margin-bottom: 0.5em;
    --if-content-h4-margin-top: 0;
    --if-content-h4-margin-bottom: 0.5em;
    --if-content-h5-margin-top: 0;
    --if-content-h5-margin-bottom: 0.5em;
    --if-content-h6-margin-top: 0;
    --if-content-h6-margin-bottom: 0.5em;
    --if-content-hr-color: var(--if-content-color);
    --if-content-hr-margin-top: 1em;
    --if-content-hr-margin-bottom: 1em;
    --if-content-hr-border-width: 1px;
    --if-content-table-font: inherit;
    --if-content-table-font-size: 1rem;
    --if-content-table-color: var(--if-content-color);
    --if-content-table-border-color: currentColor;
    --if-content-table-cell-padding-top: 0.5em;
    --if-content-table-cell-padding-right: 0.75em;
    --if-content-table-cell-padding-bottom: 0.5em;
    --if-content-table-cell-padding-left: 0.75em;
    --if-content-table-margin-top: 1em;
    --if-content-table-margin-bottom: 1em;
    color: var(--if-content-color, #000);
}

/* ----- Headings ----- */
.if-category-content.if-category-seo-content h1,
.if-category-tech-table h1,
.woocommerce-Tabs-panel--description h1 {
    color: var(--if-content-heading-color, var(--if-content-color));
    font-family: var(--if-content-heading-font);
    font-size: var(--if-content-h1-size);
    line-height: var(--if-content-h1-line-height, 1.25);
    margin-top: var(--if-content-h1-margin-top);
    margin-bottom: var(--if-content-h1-margin-bottom);
    word-spacing: 7px;
}

.if-category-content.if-category-seo-content h2,
.if-category-tech-table h2,
.woocommerce-Tabs-panel--description h2 {
    color: var(--if-content-heading-color, var(--if-content-color));
    font-family: var(--if-content-heading-font);
    font-size: var(--if-content-h2-size);
    line-height: var(--if-content-h2-line-height, 1.3);
    margin-top: var(--if-content-h2-margin-top);
    margin-bottom: var(--if-content-h2-margin-bottom);
    word-spacing: 7px;
}

.if-category-content.if-category-seo-content h3,
.if-category-tech-table h3,
.woocommerce-Tabs-panel--description h3 {
    color: var(--if-content-heading-color, var(--if-content-color));
    font-family: var(--if-content-heading-font);
    font-size: var(--if-content-h3-size);
    line-height: var(--if-content-h3-line-height, 1.35);
    margin-top: var(--if-content-h3-margin-top);
    margin-bottom: var(--if-content-h3-margin-bottom);
    word-spacing: 7px;
}

.if-category-content.if-category-seo-content h4,
.if-category-tech-table h4,
.woocommerce-Tabs-panel--description h4 {
    color: var(--if-content-heading-color, var(--if-content-color));
    font-family: var(--if-content-heading-font);
    font-size: var(--if-content-h4-size);
    line-height: var(--if-content-h4-line-height, 1.35);
    margin-top: var(--if-content-h4-margin-top);
    margin-bottom: var(--if-content-h4-margin-bottom);
    word-spacing: 7px;
}

.if-category-content.if-category-seo-content h5,
.if-category-tech-table h5,
.woocommerce-Tabs-panel--description h5 {
    color: var(--if-content-heading-color, var(--if-content-color));
    font-family: var(--if-content-heading-font);
    font-size: var(--if-content-h5-size);
    line-height: var(--if-content-h5-line-height, 1.4);
    margin-top: var(--if-content-h5-margin-top);
    margin-bottom: var(--if-content-h5-margin-bottom);
    word-spacing: 7px;
}

.if-category-content.if-category-seo-content h6,
.if-category-tech-table h6,
.woocommerce-Tabs-panel--description h6 {
    color: var(--if-content-heading-color, var(--if-content-color));
    font-family: var(--if-content-heading-font);
    font-size: var(--if-content-h6-size);
    line-height: var(--if-content-h6-line-height, 1.4);
    margin-top: var(--if-content-h6-margin-top);
    margin-bottom: var(--if-content-h6-margin-bottom);
    word-spacing: 7px;
}

/* ----- Body & lists ----- */
.if-category-content.if-category-seo-content p,
.if-category-tech-table p,
.woocommerce-Tabs-panel--description p {
    color: inherit;
    font-family: var(--if-content-body-font);
    font-size: var(--if-content-p-size);
    margin-top: var(--if-content-p-margin-top);
    margin-bottom: var(--if-content-p-margin-bottom);
}

.if-category-content.if-category-seo-content li,
.if-category-tech-table li,
.woocommerce-Tabs-panel--description li {
    color: var(--if-content-list-color, var(--if-content-color));
    font-family: var(--if-content-list-font, var(--if-content-body-font));
    font-size: var(--if-content-li-size);
}

.if-category-content.if-category-seo-content a,
.if-category-tech-table a,
.woocommerce-Tabs-panel--description a {
    color: inherit;
    font-family: var(--if-content-body-font);
}

.if-category-content.if-category-seo-content ul,
.if-category-content.if-category-seo-content ol,
.if-category-tech-table ul,
.if-category-tech-table ol,
.woocommerce-Tabs-panel--description ul,
.woocommerce-Tabs-panel--description ol {
    font-family: var(--if-content-list-font, var(--if-content-body-font));
    color: var(--if-content-list-color, var(--if-content-color));
    font-size: var(--if-content-li-size);
    margin-top: var(--if-content-list-margin-top);
    margin-bottom: var(--if-content-list-margin-bottom);
}

.if-category-content.if-category-seo-content blockquote,
.if-category-tech-table blockquote,
.woocommerce-Tabs-panel--description blockquote {
    color: inherit;
    font-family: var(--if-content-body-font);
}

/* ----- HR ----- */
.if-category-content.if-category-seo-content hr,
.if-category-tech-table hr,
.woocommerce-Tabs-panel--description hr {
    border: 0;
    border-top: var(--if-content-hr-border-width) solid var(--if-content-hr-color);
    margin-top: var(--if-content-hr-margin-top);
    margin-bottom: var(--if-content-hr-margin-bottom);
}

/* ----- Tables ----- */
.if-category-content.if-category-seo-content table,
.if-category-tech-table table,
.woocommerce-Tabs-panel--description table {
    font-family: var(--if-content-table-font, var(--if-content-body-font));
    font-size: var(--if-content-table-font-size);
    color: var(--if-content-table-color, var(--if-content-color));
    margin-top: var(--if-content-table-margin-top);
    margin-bottom: var(--if-content-table-margin-bottom);
    border-collapse: collapse;
}

.if-category-content.if-category-seo-content th,
.if-category-content.if-category-seo-content td,
.if-category-tech-table th,
.if-category-tech-table td,
.woocommerce-Tabs-panel--description th,
.woocommerce-Tabs-panel--description td {
    color: var(--if-content-table-color, var(--if-content-color));
    font-family: var(--if-content-table-font, var(--if-content-body-font));
    font-size: var(--if-content-table-font-size);
    padding: var(--if-content-table-cell-padding-top) var(--if-content-table-cell-padding-right) var(--if-content-table-cell-padding-bottom) var(--if-content-table-cell-padding-left);
    border: 1px solid var(--if-content-table-border-color);
}

.if-category-content.if-category-seo-content > span,
.if-category-content.if-category-seo-content p > span,
.if-category-tech-table span,
.woocommerce-Tabs-panel--description span {
    color: inherit;
    font-family: var(--if-content-body-font);
}

/* ----- Headings on tablets and phones -----
   Same scale as the product description (dev/migrations/product-page-mobile.php):
   desktop h2 12 / h3 10 / h4 9px (Customizer), tablet 11 / 9.5 / 8.5, phone 10 / 9 / 8.
   At 375 the 12px h2 took 4 lines and a long word (СНЕГОЗАДЕРЖАТЕЛЕЙ, 331px at 10px)
   could push the page wider than the screen. min() keeps a smaller Customizer value
   if the owner sets one. Placed before the reset below on purpose: the reset is
   (0,3,1) and must keep winning for Elementor widgets inside the SEO text. */
.if-category-content.if-category-seo-content h1,
.if-category-content.if-category-seo-content h2,
.if-category-content.if-category-seo-content h3,
.if-category-content.if-category-seo-content h4,
.if-category-content.if-category-seo-content h5,
.if-category-content.if-category-seo-content h6,
.if-category-tech-table h1,
.if-category-tech-table h2,
.if-category-tech-table h3,
.if-category-tech-table h4,
.if-category-tech-table h5,
.if-category-tech-table h6,
.woocommerce-Tabs-panel--description h1,
.woocommerce-Tabs-panel--description h2,
.woocommerce-Tabs-panel--description h3,
.woocommerce-Tabs-panel--description h4,
.woocommerce-Tabs-panel--description h5,
.woocommerce-Tabs-panel--description h6 {
    overflow-wrap: break-word;
}

/* Tablet, 768–1024px */
@media (max-width: 1024px) {
    .if-category-content.if-category-seo-content h1,
    .if-category-tech-table h1,
    .woocommerce-Tabs-panel--description h1 {
        font-size: min(var(--if-content-h1-size), 13px);
        margin-top: min(var(--if-content-h1-margin-top), 32px);
    }

    .if-category-content.if-category-seo-content h2,
    .if-category-tech-table h2,
    .woocommerce-Tabs-panel--description h2 {
        font-size: min(var(--if-content-h2-size), 11px);
        margin-top: min(var(--if-content-h2-margin-top), 32px);
    }

    .if-category-content.if-category-seo-content h3,
    .if-category-tech-table h3,
    .woocommerce-Tabs-panel--description h3 {
        font-size: min(var(--if-content-h3-size), 9.5px);
        margin-top: min(var(--if-content-h3-margin-top), 24px);
    }

    .if-category-content.if-category-seo-content h4,
    .if-category-tech-table h4,
    .woocommerce-Tabs-panel--description h4 {
        font-size: min(var(--if-content-h4-size), 8.5px);
        margin-top: min(var(--if-content-h4-margin-top), 18px);
    }

    .if-category-content.if-category-seo-content h5,
    .if-category-tech-table h5,
    .woocommerce-Tabs-panel--description h5 {
        font-size: min(var(--if-content-h5-size), 8px);
    }

    .if-category-content.if-category-seo-content h6,
    .if-category-tech-table h6,
    .woocommerce-Tabs-panel--description h6 {
        font-size: min(var(--if-content-h6-size), 8px);
    }
}

/* Phone, up to 767px */
@media (max-width: 767px) {
    .if-category-content.if-category-seo-content h1,
    .if-category-content.if-category-seo-content h2,
    .if-category-content.if-category-seo-content h3,
    .if-category-content.if-category-seo-content h4,
    .if-category-content.if-category-seo-content h5,
    .if-category-content.if-category-seo-content h6,
    .if-category-tech-table h1,
    .if-category-tech-table h2,
    .if-category-tech-table h3,
    .if-category-tech-table h4,
    .if-category-tech-table h5,
    .if-category-tech-table h6,
    .woocommerce-Tabs-panel--description h1,
    .woocommerce-Tabs-panel--description h2,
    .woocommerce-Tabs-panel--description h3,
    .woocommerce-Tabs-panel--description h4,
    .woocommerce-Tabs-panel--description h5,
    .woocommerce-Tabs-panel--description h6 {
        line-height: 1.6;
    }

    .if-category-content.if-category-seo-content h1,
    .if-category-tech-table h1,
    .woocommerce-Tabs-panel--description h1 {
        font-size: min(var(--if-content-h1-size), 12px);
        margin-top: min(var(--if-content-h1-margin-top), 28px);
        margin-bottom: min(var(--if-content-h1-margin-bottom), 10px);
    }

    .if-category-content.if-category-seo-content h2,
    .if-category-tech-table h2,
    .woocommerce-Tabs-panel--description h2 {
        font-size: min(var(--if-content-h2-size), 10px);
        margin-top: min(var(--if-content-h2-margin-top), 24px);
        margin-bottom: min(var(--if-content-h2-margin-bottom), 8px);
    }

    .if-category-content.if-category-seo-content h3,
    .if-category-tech-table h3,
    .woocommerce-Tabs-panel--description h3 {
        font-size: min(var(--if-content-h3-size), 9px);
        margin-top: min(var(--if-content-h3-margin-top), 20px);
        margin-bottom: min(var(--if-content-h3-margin-bottom), 8px);
    }

    .if-category-content.if-category-seo-content h4,
    .if-category-tech-table h4,
    .woocommerce-Tabs-panel--description h4 {
        font-size: min(var(--if-content-h4-size), 8px);
        margin-top: min(var(--if-content-h4-margin-top), 16px);
        margin-bottom: min(var(--if-content-h4-margin-bottom), 6px);
    }

    .if-category-content.if-category-seo-content h5,
    .if-category-tech-table h5,
    .woocommerce-Tabs-panel--description h5 {
        font-size: min(var(--if-content-h5-size), 7.5px);
        margin-top: min(var(--if-content-h5-margin-top), 14px);
        margin-bottom: min(var(--if-content-h5-margin-bottom), 6px);
    }

    .if-category-content.if-category-seo-content h6,
    .if-category-tech-table h6,
    .woocommerce-Tabs-panel--description h6 {
        font-size: min(var(--if-content-h6-size), 7.5px);
        margin-top: min(var(--if-content-h6-margin-top), 14px);
        margin-bottom: min(var(--if-content-h6-margin-bottom), 6px);
    }
}

/* Narrowest phones (≤359px): the 10px h2 «…СНЕГОЗАДЕРЖАТЕЛЕЙ:» is 331px, the column 300 */
@media (max-width: 359px) {
    .if-category-content.if-category-seo-content h2,
    .if-category-tech-table h2,
    .woocommerce-Tabs-panel--description h2 {
        font-size: min(var(--if-content-h2-size), 9px);
    }
}

/* ----- Elementor template inside content block: reset our overrides ----- */
.if-category-content.if-category-seo-content .elementor-widget h1,
.if-category-content.if-category-seo-content .elementor-widget h2,
.if-category-content.if-category-seo-content .elementor-widget h3,
.if-category-content.if-category-seo-content .elementor-widget h4,
.if-category-content.if-category-seo-content .elementor-widget h5,
.if-category-content.if-category-seo-content .elementor-widget h6,
.if-category-content.if-category-seo-content .elementor-widget p,
.if-category-content.if-category-seo-content .elementor-widget span,
.if-category-content.if-category-seo-content .elementor-widget a,
.if-category-content.if-category-seo-content .elementor-widget li {
    color: revert;
    font-family: revert;
    font-size: revert;
    line-height: revert;
    word-spacing: revert;
    margin: revert;
}