/**
 * Copyright © Caravel. All rights reserved.
 *
 * Page Builder rows that hold the Black Cassol widgets: Row (full-bleed, CSS classes "bf-row bf-row--<widget>") >
 * Text ("bf-row__widget") > the widget inserted with "Insert Widget". The widgets draw their own sections edge to
 * edge, so the spacing the Page Builder defaults (padding 10px) and Hyvä (p-2.5 mb-2.5 on the row child) give a row
 * is dropped; a row created without the classes is matched by the widget it holds.
 */

#html-body [data-content-type="row"].bf-row,
#html-body [data-content-type="row"]:has(.bf-anchor, .bf-calc, .bf-ac, .bf-flash, .bf-wanted-root, .bf-vip),
#html-body [data-content-type="row"].bf-row > div,
#html-body [data-content-type="row"]:has(.bf-anchor, .bf-calc, .bf-ac, .bf-flash, .bf-wanted-root, .bf-vip) > div,
#html-body [data-content-type="row"].bf-row [data-content-type="text"],
#html-body [data-content-type="row"]:has(.bf-anchor, .bf-calc, .bf-ac, .bf-flash, .bf-wanted-root, .bf-vip) [data-content-type="text"] {
    margin: 0;
    padding: 0;
}

/* The editor wraps the widget in a <p>; the browser closes it before the widget's <section>, leaving empty ones. */
#html-body [data-content-type="row"].bf-row [data-content-type="text"] > p,
#html-body [data-content-type="row"]:has(.bf-anchor, .bf-calc, .bf-ac, .bf-flash, .bf-wanted-root, .bf-vip) [data-content-type="text"] > p {
    margin: 0;
}

#html-body [data-content-type="row"].bf-row [data-content-type="text"] > p:empty,
#html-body [data-content-type="row"]:has(.bf-anchor, .bf-calc, .bf-ac, .bf-flash, .bf-wanted-root, .bf-vip) [data-content-type="text"] > p:empty {
    display: none;
}

/*
 * Theme rules that reach into a Text or a home row, with an id in the selector, so they beat the widget classes:
 * - Caravel_Pagebuilder typography.css: "#html-body [data-content-type="text"] p, li" (margin, line-height 1.6). The
 *   widgets write their paragraphs as <div> to stay out of it; the drawer list keeps its <li>, reset here.
 * - the home row rule ".cms-index-index .columns .main [data-content-type="row"] h2" (font-weight 700): the widget
 *   titles keep the weight of their own stylesheet.
 */
#html-body [data-content-type="text"] .bf-drawer__store {
    margin: 0;
    line-height: inherit;
}

#html-body [data-content-type="row"] .bf-anchor__name {
    font-weight: 800;
}

#html-body [data-content-type="row"] :is(.bf-calc__title, .bf-ac__title, .bf-flash__title, .bf-wanted__title, .bf-vip__title) {
    font-weight: 900;
}
