/*
 * PidoGame typography contract.
 * Loaded last among shared theme modules so readable text uses one semantic
 * scale while the legacy rem-based layout grid remains unchanged.
 */

:root {
    --pido-font-family: IRANSansX, IRANSans, Tahoma, Arial, sans-serif;
    --pido-font-size-xs: 13px;
    --pido-font-size-sm: 14px;
    --pido-font-size-md: 16px;
    --pido-font-size-lg: 1.125rem;
    --pido-font-size-xl: clamp(1.25rem, 1.2rem + .2vw, 1.35rem);
    --pido-font-size-2xl: clamp(1.3rem, 1.18rem + .45vw, 1.55rem);
    --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;
    --pido-content-font-family: var(--pido-font-family);
    --pido-content-font-size: 16px;
    --pido-content-font-weight: var(--pido-font-weight-regular);
    --pido-content-line-height: 2;
}

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) !important;
    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):not(.pido-account-experience *) {
    font-family: inherit;
    font-size: var(--pido-font-size-md);
    line-height: 1.65;
}

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

/* Pido Account & Rewards owns component typography inside its plugin wrapper.
   Theme typography selectors below must not directly match descendants there. */
/* One semantic contract for posts, pages, product descriptions and taxonomy copy. */
body.pido-theme :is(
    .pido-rich-content,
    .entry-content,
    .post-content,
    .page-content,
    .single-post-content,
    .term-description,
    .page-description,
    .pido-taxonomy-description,
    .woocommerce-Tabs-panel,
    .product-description
) {
    font-family: var(--pido-content-font-family) !important;
    font-size: var(--pido-content-font-size) !important;
    font-weight: var(--pido-content-font-weight) !important;
    line-height: var(--pido-content-line-height);
}

body.pido-theme :is(
    .pido-rich-content,
    .entry-content,
    .post-content,
    .page-content,
    .single-post-content,
    .term-description,
    .page-description,
    .pido-taxonomy-description,
    .woocommerce-Tabs-panel,
    .product-description
) :where(p, ul, ol, li, dl, dt, dd, blockquote, figure, figcaption, table, thead, tbody, tfoot, tr, td):not(.pido-account-experience *) {
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: var(--pido-font-weight-regular) !important;
    line-height: inherit;
}

body.pido-theme :is(
    .pido-rich-content,
    .entry-content,
    .post-content,
    .page-content,
    .single-post-content,
    .term-description,
    .page-description,
    .pido-taxonomy-description,
    .woocommerce-Tabs-panel,
    .product-description
) :where(p, li, dd, td, blockquote, figcaption):not(.pido-account-experience *) :where(a, span, em, mark):not(.pido-account-experience *) {
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
}

body.pido-theme :is(
    .pido-rich-content,
    .entry-content,
    .post-content,
    .page-content,
    .single-post-content,
    .term-description,
    .page-description,
    .pido-taxonomy-description,
    .woocommerce-Tabs-panel,
    .product-description
) :where(strong, b):not(.pido-account-experience *) {
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: var(--pido-font-weight-bold) !important;
}

body.pido-theme :is(
    .pido-rich-content,
    .entry-content,
    .post-content,
    .page-content,
    .single-post-content,
    .term-description,
    .page-description,
    .pido-taxonomy-description,
    .woocommerce-Tabs-panel,
    .product-description
) :where(th):not(.pido-account-experience *) {
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: var(--pido-font-weight-bold) !important;
    line-height: inherit;
}

body.pido-theme :is(
    .pido-rich-content,
    .entry-content,
    .post-content,
    .page-content,
    .single-post-content,
    .term-description,
    .page-description,
    .pido-taxonomy-description,
    .woocommerce-Tabs-panel,
    .product-description
) :where(caption):not(.pido-account-experience *) {
    font-family: inherit !important;
    font-size: var(--pido-font-size-sm) !important;
    font-weight: var(--pido-font-weight-semibold) !important;
    line-height: 1.75;
}

body.pido-theme :is(
    .pido-rich-content,
    .entry-content,
    .post-content,
    .page-content,
    .single-post-content,
    .term-description,
    .page-description,
    .pido-taxonomy-description,
    .woocommerce-Tabs-panel,
    .product-description
) :where(h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6):not(.pido-account-experience *) {
    font-family: inherit !important;
    line-height: var(--pido-line-height-heading);
}

body.pido-theme :is(
    .pido-rich-content,
    .entry-content,
    .post-content,
    .page-content,
    .single-post-content,
    .term-description,
    .page-description,
    .pido-taxonomy-description,
    .woocommerce-Tabs-panel,
    .product-description
) :where(h1, .h1):not(.pido-account-experience *) {
    font-size: var(--pido-font-size-3xl);
    font-weight: var(--pido-font-weight-extrabold) !important;
}

body.pido-theme :is(
    .pido-rich-content,
    .entry-content,
    .post-content,
    .page-content,
    .single-post-content,
    .term-description,
    .page-description,
    .pido-taxonomy-description,
    .woocommerce-Tabs-panel,
    .product-description
) :where(h2, .h2):not(.pido-account-experience *) {
    font-size: var(--pido-font-size-2xl);
    font-weight: var(--pido-font-weight-bold) !important;
}

body.pido-theme :is(
    .pido-rich-content,
    .entry-content,
    .post-content,
    .page-content,
    .single-post-content,
    .term-description,
    .page-description,
    .pido-taxonomy-description,
    .woocommerce-Tabs-panel,
    .product-description
) :where(h3, .h3):not(.pido-account-experience *) {
    font-size: var(--pido-font-size-xl);
    font-weight: var(--pido-font-weight-bold) !important;
}

body.pido-theme :is(
    .pido-rich-content,
    .entry-content,
    .post-content,
    .page-content,
    .single-post-content,
    .term-description,
    .page-description,
    .pido-taxonomy-description,
    .woocommerce-Tabs-panel,
    .product-description
) :where(h4, .h4):not(.pido-account-experience *) {
    font-size: var(--pido-font-size-lg);
    font-weight: var(--pido-font-weight-bold) !important;
}

body.pido-theme :is(
    .pido-rich-content,
    .entry-content,
    .post-content,
    .page-content,
    .single-post-content,
    .term-description,
    .page-description,
    .pido-taxonomy-description,
    .woocommerce-Tabs-panel,
    .product-description
) :where(h5, .h5, h6, .h6):not(.pido-account-experience *) {
    font-size: var(--pido-font-size-md);
    font-weight: var(--pido-font-weight-bold) !important;
}

body.pido-theme :is(
    .pido-rich-content,
    .entry-content,
    .post-content,
    .page-content,
    .single-post-content,
    .term-description,
    .page-description,
    .pido-taxonomy-description,
    .woocommerce-Tabs-panel,
    .product-description
) :where(h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6):not(.pido-account-experience *) :where(a, span, em, strong, b):not(.pido-account-experience *) {
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
}

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

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

body.pido-theme :where(small, .small, .form-text, .woocommerce small):not(.pido-account-experience *) {
    font-size: var(--pido-font-size-xs);
    line-height: 1.75;
}

body.pido-theme :where(label, legend, dt, th):not(.pido-account-experience *) {
    font-size: var(--pido-font-size-sm);
    line-height: 1.7;
}

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

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 (min-width: 992px) {
    body.pido-theme .pido-gift-responsive-title {
        color: #fff !important;
    }
}

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

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

    body.pido-theme :is(
        .pido-rich-content,
        .entry-content,
        .post-content,
        .page-content,
        .single-post-content,
        .term-description,
        .page-description,
        .pido-taxonomy-description,
        .woocommerce-Tabs-panel,
        .product-description
    ) :where(h2, .h2):not(.pido-account-experience *) {
        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);
    }
}


/* Readability refinements for shared components. */
/* Shared shell, search, archive and footer copy. */
body.pido-theme :is(
    .pido-search-overlay__subtitle,
    .pido-footer__description,
    .pido-footer__description p,
    .pido-live-search__title,
    .pido-shop-filters__field input,
    .pido-shop-filters__select select,
    .pido-blog-card__excerpt
) {
    font-size: 14px;
}

body.pido-theme :is(
    .pido-footer__copyright,
    .pido-footer-menu a,
    .pido-search-suggestions__label,
    .pido-live-search__status,
    .pido-shop-ordering > label,
    .pido-shop-ordering select,
    .pido-shop-result-count,
    .pido-breadcrumb,
    .woocommerce-breadcrumb
) {
    font-size: 13px;
}

/* Product cards: typography only; dimensions and markup remain unchanged. */
body.pido-theme .pido-product-card__title {
    font-size: 15px;
}

body.pido-theme .pido-product-card__subtitle {
    font-size: 14px;
}

body.pido-theme :is(
    .pido-product-card__specs dt,
    .pido-product-card__tag,
    .pido-product-card__stock,
    .pido-product-card__sale,
    .pido-product-card__price .pido-price-regular
) {
    font-size: 13px;
}

body.pido-theme .pido-product-card__price .pido-price-current {
    font-size: 16px;
}

/* Single product purchase information. */
body.pido-theme :is(
    .pido-game-subtitle,
    .pido-gift-subtitle,
    .pido-item-product-subtitle,
    .pido-item-desktop-subtitle,
    .pido-gallery-trailer-label,
    .pido-purchase-price-regular,
    .pido-game-product .pido-purchase-field > label,
    .pido-product-page--game .pido-steam-account-switch__label,
    .pido-product-page--game .pido-steam-account-fields__header strong
) {
    font-size: 14px;
}

body.pido-theme :is(
    .pido-purchase-discount-badge,
    .pido-product-page--game .pido-steam-account-switch__fee,
    .pido-product-page--game .pido-steam-account-fields__notice,
    .pido-product-page--game .pido-steam-account-reset
) {
    font-size: 13px;
}

/* Cart: preserve the cards and controls; enlarge only readable copy. */
body.pido-theme :is(
    .pido-cart-page__eyebrow,
    .pido-cart-page__count,
    .pido-cart-card__count,
    .pido-cart-service-option__price,
    .pido-cart-service-fields__label,
    .pido-cart-trust-list
) {
    font-size: 13px;
}

body.pido-theme :is(
    .pido-cart-item__meta,
    .pido-cart-card__header p,
    .pido-cart-summary-card__header span,
    .pido-cart-service-option__content strong,
    .pido-cart-coupon button,
    .pido-cart-update,
    .pido-cart-continue,
    .pido-cart-notices .woocommerce-error,
    .pido-cart-notices .woocommerce-message,
    .pido-cart-notices .woocommerce-info,
    .pido-cart-empty > p,
    .pido-cart-qty-control__value,
    .pido-cart-custom-fields__row,
    .woocommerce .pido-cart-totals-table th,
    .woocommerce .pido-cart-totals-table td
) {
    font-size: 14px;
}

body.pido-theme :is(
    .pido-cart-item__name,
    .pido-cart-item__unit-price strong,
    .pido-cart-item__subtotal strong
) {
    font-size: 15px;
}

body.pido-theme .pido-cart-checkout-button {
    font-size: 15px;
}

/* Checkout: amounts, labels and payment copy are transactional content. */
body.pido-theme :is(
    .pido-checkout-page__cart-link,
    .pido-checkout-card__header p,
    .pido-checkout-card label,
    .pido-checkout-card .control-label,
    .pido-checkout-checkbox-heading,
    .pido-checkout-product__heading,
    .pido-checkout-product__price,
    .pido-checkout-total-row,
    .pido-checkout-total-row strong,
    .pido-checkout-total-row td,
    .pido-payment-method__title,
    .pido-checkout-result__details dd,
    .pido-checkout-context .woocommerce ul.order_details li strong
) {
    font-size: 14px;
}

body.pido-theme .pido-checkout-total-row--grand {
    font-size: 16px;
}

body.pido-theme :is(
    .pido-checkout-integrations:not(:empty),
    .pido-wallet-partial-label,
    .pido-checkout-payment :where([class*="wallet"], [id*="wallet"], [class*="point"], [id*="point"], [class*="score"], [id*="score"], [class*="credit"], [id*="credit"]),
    .pido-checkout-payment :where([class*="wallet"], [id*="wallet"], [class*="point"], [id*="point"], [class*="score"], [id*="score"]) label
) {
    font-size: 13px !important;
}

body.pido-theme .pido-checkout-integrations :where(label, .woocommerce-form__label) {
    font-size: 14px !important;
}

body.pido-theme :is(.pido-checkout-submit, .woocommerce-checkout #place_order) {
    font-size: 15px !important;
}

/* Account, order details and calculator. */
body.pido-theme :is(
    .pido-edit-account-form :where(.field label, .avatar-upload-wrapper label),
    .pido-notice,
    .woocommerce-order-details .wc-item-meta li,
    .woocommerce-table__product-name .wc-item-meta li,
    .pido-calculator-field label
):not(.pido-account-experience *) {
    font-size: 14px;
}

body.pido-theme :is(
    .custom-status,
    .order-status-badge,
    .custom-view-btn,
    .custom-view-btn:visited,
    .elementor .custom-view-btn,
    .elementor .custom-view-btn:visited
):not(.pido-account-experience *) {
    font-size: 13px;
}

body.pido-theme .pido-edit-account-form :where(.field input, input[type="file"]):not(.pido-account-experience *) {
    font-size: 16px;
}

body.pido-theme .pido-edit-account-form button[type="submit"]:not(.pido-account-experience *) {
    font-size: 14px;
}

/* Editorial metadata and tables. */
body.pido-theme :is(
    .pido-post-tags__label,
    .pido-post-meta__item,
    .pido-post-meta__links a,
    .pido-post-byline__comments
) {
    font-size: 13px;
}

body.pido-theme :is(
    .pido-related-post__body h3,
    .pido-sidebar-post strong
) {
    font-size: 14px;
}

/* Site announcement and the smallest header reward label. */
body.pido-theme .pido-site-announcement__text {
    font-size: 14px;
}

body.pido-theme .pido-site-announcement__action {
    font-size: 13px;
}

/* Product-card title tone: scoped to Builder widgets and product archives. */
body.pido-theme :is(.pido-builder-products, .pido-product-archive-main) .pido-product-card__title,
body.pido-theme :is(.pido-builder-products, .pido-product-archive-main) .pido-product-card__title a {
    color: color-mix(in srgb, var(--pido-text) 78%, var(--pido-text-muted) 22%) !important;
}

/* Shared single-product summary typography for game, gift-card and item pages. */
body.pido-theme :is(
    .pido-product-short-description,
    .woocommerce-product-details__short-description
) {
    font-family: var(--pido-font-family) !important;
    font-size: 15px !important;
    font-weight: var(--pido-font-weight-regular) !important;
    line-height: 1.9;
}

body.pido-theme :is(
    .pido-product-short-description,
    .woocommerce-product-details__short-description
) :where(p, ul, ol, li, span, a, em) {
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: inherit;
}

body.pido-theme :is(
    .pido-product-short-description,
    .woocommerce-product-details__short-description
) :where(strong, b):not(.pido-account-experience *) {
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: var(--pido-font-weight-bold) !important;
}

body.pido-theme :is(.pido-product-meta-row, .pido-product-meta-group) {
    font-family: var(--pido-font-family) !important;
    font-size: 14px;
    line-height: 1.75;
}

body.pido-theme .pido-product-meta-label {
    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: var(--pido-font-weight-medium) !important;
    line-height: inherit;
}

body.pido-theme .pido-product-meta-value {
    font-family: inherit !important;
    font-size: 14px !important;
    font-weight: var(--pido-font-weight-medium) !important;
    line-height: inherit;
}

body.pido-theme .pido-product-meta-badge {
    font-weight: var(--pido-font-weight-semibold) !important;
}

/* Standalone legacy content tables use the same semantic contract. */
body.pido-theme table.pido-content-table {
    font-family: var(--pido-content-font-family) !important;
    font-size: var(--pido-content-font-size) !important;
    font-weight: var(--pido-font-weight-regular) !important;
    line-height: var(--pido-content-line-height);
}

body.pido-theme table.pido-content-table td {
    font-size: inherit !important;
    font-weight: var(--pido-font-weight-regular) !important;
}

body.pido-theme table.pido-content-table th {
    font-size: inherit !important;
    font-weight: var(--pido-font-weight-bold) !important;
}

body.pido-theme table.pido-content-table caption {
    font-size: var(--pido-font-size-sm) !important;
    font-weight: var(--pido-font-weight-semibold) !important;
}


/* 1.9.32 — transactional card headings stay compact inside rich content. */
body.pido-theme :is(
    .pido-cart-card__header h2,
    .pido-cart-summary-card__header h2,
    .pido-checkout-card__header h2
):not(.pido-account-experience *) {
    font-size: 1.075rem;
    line-height: 1.62;
}

@media (max-width: 479.98px) {
    body.pido-theme :is(
        .pido-cart-card__header h2,
        .pido-cart-summary-card__header h2,
        .pido-checkout-card__header h2
    ):not(.pido-account-experience *) {
        font-size: 1.025rem;
    }
}
