@font-face {
    font-family: "Weber Serif";
    src: url("/academy/include/fonts/weber-serif-light.woff2") format("woff2"),
         url("/academy/include/fonts/weber-serif-light.woff") format("woff");
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Weber Serif";
    src: url("/academy/include/fonts/weber-serif-regular.woff2") format("woff2"),
         url("/academy/include/fonts/weber-serif-regular.woff") format("woff");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Weber Serif";
    src: url("/academy/include/fonts/weber-serif-bold.woff2") format("woff2"),
         url("/academy/include/fonts/weber-serif-bold.woff") format("woff");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --academy-font-family: "Weber Serif", Georgia, serif;
}

body#main {
    font-family: var(--academy-font-family);
    --ui-font-family-primary: var(--academy-font-family);
    --ui-font-family-secondary: var(--academy-font-family);
    --ui-font-family-open-sans: var(--academy-font-family);
    --ui-font-family-helvetica: var(--academy-font-family);
    --ui-font-family-system: var(--academy-font-family);
}

body#main :where(
    h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6,
    button, input, select, textarea, optgroup, code, kbd, pre, samp,
    .dd-mobile-home, .dd-cookie-notice, .dd-schedule-months,
    .fancybox-title, .popup-window, .tooltip, .popover, ymaps, .YMaps-b-balloon-content,
    .blog-post-title, .blog-post-group-selector-text, .blog-small-button-text,
    .main-profile-form-password-annotation, [class*="sale-order-"]
),
body#main input::file-selector-button {
    font-family: var(--academy-font-family);
}

body#main #academy-class-catalog,
body#main #header :is(
    .dd-header-slogan, .dd-header-phone .phone > a, .dd-header-callback, .dd-header-search input,
    .dd-header-account .personal-link .title, .dd-header-cart .basket-link .count
),
body#main #mobilemenu :is(
    .dd-mobile-menu, .dd-mobile-menu .menu ul > li > a, .dd-mobile-menu .dropdown .menu_title,
    .dd-mobile-menu__account .counters .count, .dd-mobile-menu__booking,
    .dd-mobile-menu__phone strong, .dd-mobile-menu__phone small, .dd-mobile-menu__location > a
),
body#main #order_form_div input[type="submit"],
body#main ul.menu .child a,
body#main .blog-post-edit-micro #blog-post-group-selector {
    font-family: var(--academy-font-family);
}

/* Aspro and checkout set important font rules for every element in these components. */
body#main #basket-root,
body#main #basket-root *,
body#main #content #bx-soa-order-form,
body#main #content #bx-soa-order-form *,
body#main .sale_order_full_table .sale-paysystem-wrapper *,
body#main :is(.basket-coupon-alert, .basket-coupon-block-field-description,
    .basket-coupon-block-total-price-current, .basket-item-info-name, .basket-item-info-name-link) {
    font-family: var(--academy-font-family) !important;
}

/* Legacy Bitrix markup uses these font glyphs as icons and a currency symbol. */
body#main :is(#basket-root, #content #bx-soa-order-form, .sale_order_full_table .sale-paysystem-wrapper) .symbol_ruble {
    font-family: rubleBitrix, var(--academy-font-family) !important;
}

body#main :is(#basket-root, #content #bx-soa-order-form, .sale_order_full_table .sale-paysystem-wrapper) .glyphicon {
    font-family: "Glyphicons Halflings" !important;
}

/* The tour is a separate document and loads additional component styles on demand.
   Zero specificity lets the vendor's important icon-font rules take precedence. */
:where(body.showcase, body.showcase *),
:where(body.showcase *)::before,
:where(body.showcase *)::after {
    font-family: var(--academy-font-family) !important;
}
