/*
 * PidoGame typography contract.
 * This file is intentionally loaded last among the shared theme modules so
 * component templates use one readable scale instead of page-level patches.
 */

:root {
    --pido-font-family: IRANSansX, IRANSans, Tahoma, Arial, sans-serif;
    --pido-font-size-xs: .8125rem;   /* 13px */
    --pido-font-size-sm: .875rem;    /* 14px */
    --pido-font-size-md: 1rem;       /* 16px */
    --pido-font-size-lg: 1.125rem;   /* 18px */
    --pido-font-size-xl: 1.25rem;    /* 20px */
    --pido-font-size-2xl: clamp(1.4rem, 1.15rem + .8vw, 1.75rem);
    --pido-font-size-3xl: clamp(1.65rem, 1.3rem + 1.25vw, 2.15rem);
    --pido-line-height-tight: 1.5;
    --pido-line-height-heading: 1.6;
    --pido-line-height-body: 1.9;
    --pido-font-weight-regular: 400;
    --pido-font-weight-medium: 500;
    --pido-font-weight-semibold: 600;
    --pido-font-weight-bold: 700;
    --pido-font-weight-extrabold: 800;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body.pido-theme {
    font-family: var(--pido-font-family);
    font-size: var(--pido-font-size-md);
    font-weight: var(--pido-font-weight-regular);
    line-height: var(--pido-line-height-body);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.pido-theme :where(button, input, select, textarea, optgroup) {
    font-family: inherit;
    font-size: var(--pido-font-size-md);
    line-height: 1.65;
}

body.pido-theme :where(p, li, dd, blockquote) {
    line-height: var(--pido-line-height-body);
}

body.pido-theme :where(
    .pido-rich-content,
    .entry-content,
    .post-content,
    .page-content,
    .term-description,
    .page-description,
    .woocommerce-Tabs-panel,
    .product-description
) :where(h1, .h1) {
    font-size: var(--pido-font-size-3xl);
    font-weight: var(--pido-font-weight-extrabold);
    line-height: var(--pido-line-height-heading);
}

body.pido-theme :where(
    .pido-rich-content,
    .entry-content,
    .post-content,
    .page-content,
    .term-description,
    .page-description,
    .woocommerce-Tabs-panel,
    .product-description
) :where(h2, .h2) {
    font-size: var(--pido-font-size-2xl);
    font-weight: var(--pido-font-weight-bold);
    line-height: var(--pido-line-height-heading);
}

body.pido-theme :where(
    .pido-rich-content,
    .entry-content,
    .post-content,
    .page-content,
    .term-description,
    .page-description,
    .woocommerce-Tabs-panel,
    .product-description
) :where(h3, .h3) {
    font-size: var(--pido-font-size-xl);
    font-weight: var(--pido-font-weight-bold);
    line-height: var(--pido-line-height-heading);
}

body.pido-theme :where(
    .pido-rich-content,
    .entry-content,
    .post-content,
    .page-content,
    .term-description,
    .page-description,
    .woocommerce-Tabs-panel,
    .product-description
) :where(h4, .h4) {
    font-size: var(--pido-font-size-lg);
    font-weight: var(--pido-font-weight-bold);
    line-height: var(--pido-line-height-heading);
}

body.pido-theme :where(
    .pido-rich-content,
    .entry-content,
    .post-content,
    .page-content,
    .term-description,
    .page-description,
    .woocommerce-Tabs-panel,
    .product-description
) :where(h5, .h5, h6, .h6) {
    font-size: var(--pido-font-size-md);
    font-weight: var(--pido-font-weight-bold);
    line-height: var(--pido-line-height-heading);
}

/* Bootstrap/Metronic utility aliases used throughout legacy templates. */
body.pido-theme :where(.fs-7):not(i):not(svg),
body.pido-theme :where(.text-xs, .small-text) {
    font-size: var(--pido-font-size-sm) !important;
}

body.pido-theme :where(.fs-8):not(i):not(svg) {
    font-size: var(--pido-font-size-xs) !important;
}

body.pido-theme :where(small, .small, .form-text, .woocommerce small) {
    font-size: var(--pido-font-size-sm);
    line-height: 1.75;
}

body.pido-theme :where(label, legend, dt, th) {
    line-height: 1.7;
}

body.pido-theme :where(.btn, .button, button, input[type="submit"], input[type="button"]) {
    font-size: .9375rem;
    font-weight: var(--pido-font-weight-bold);
    line-height: 1.55;
}

body.pido-theme :where(
    .entry-content,
    .post-content,
    .page-content,
    .term-description,
    .page-description,
    .woocommerce-product-details__short-description,
    .woocommerce-Tabs-panel,
    .product-description,
    .single-post-content,
    .pido-rich-content
) {
    font-size: var(--pido-font-size-md);
    line-height: 2;
}

body.pido-theme :where(
    .pido-product-card__subtitle,
    .pido-post-meta,
    .pido-post-byline,
    .woocommerce-breadcrumb,
    .pido-breadcrumb,
    .pido-field-help,
    .pido-commerce-card__description
) {
    font-size: var(--pido-font-size-sm);
}

/* English product subtitles must not inherit IRANSansX ss02, which converts
   Latin digits to Persian glyphs. */
body.pido-theme .pido-latin-text {
    direction: ltr;
    unicode-bidi: plaintext;
    -moz-font-feature-settings: normal;
    -webkit-font-feature-settings: normal;
    font-feature-settings: normal;
    font-variant-numeric: lining-nums proportional-nums;
    letter-spacing: 0;
}

body.pido-theme :where(
    .pido-game-subtitle,
    .pido-gift-subtitle,
    .pido-item-product-subtitle,
    .pido-item-desktop-subtitle
) {
    color: var(--pido-text-muted);
    font-size: .9375rem;
    font-weight: var(--pido-font-weight-medium);
    line-height: 1.7;
}

body.pido-theme .pido-product-card__subtitle {
    font-size: var(--pido-font-size-sm);
    font-weight: var(--pido-font-weight-medium);
    line-height: 1.65;
}

body.pido-theme :where(
    .pido-game-title,
    .pido-gift-product-title,
    .pido-item-product-title,
    .pido-item-desktop-title
) {
    font-size: clamp(1.25rem, 1.08rem + .55vw, 1.55rem);
    font-weight: var(--pido-font-weight-bold);
    line-height: var(--pido-line-height-heading);
}

body.pido-theme :where(
    .pido-game-title,
    .pido-gift-product-title:not(.pido-gift-desktop-title),
    .pido-item-product-title
) {
    color: color-mix(in srgb, var(--pido-text) 86%, var(--pido-text-muted) 14%) !important;
}

body.pido-theme :where(.pido-gift-desktop-title, .pido-item-desktop-title) {
    color: #fff !important;
}

@media (max-width: 575.98px) {
    body.pido-theme {
        line-height: 1.85;
    }

    body.pido-theme :where(
        .pido-rich-content,
        .entry-content,
        .post-content,
        .page-content,
        .term-description,
        .page-description,
        .woocommerce-Tabs-panel,
        .product-description
    ) :where(h1, .h1) {
        font-size: clamp(1.35rem, 1.15rem + 1.2vw, 1.6rem);
    }

    body.pido-theme :where(
        .pido-rich-content,
        .entry-content,
        .post-content,
        .page-content,
        .term-description,
        .page-description,
        .woocommerce-Tabs-panel,
        .product-description
    ) :where(h2, .h2) {
        font-size: clamp(1.2rem, 1.08rem + .8vw, 1.4rem);
    }

    body.pido-theme :where(
        .pido-game-title,
        .pido-gift-product-title,
        .pido-item-product-title,
        .pido-item-desktop-title
    ) {
        font-size: clamp(1.2rem, 1.08rem + .72vw, 1.4rem);
    }
}
