/*
 * Elementor landing pages (#460, paid stream): undo the site's own base styles.
 *
 * Every page of the site loads src/styles/global.css: Tailwind's preflight
 * (which zeroes margins, list bullets, heading sizes and form controls, and
 * makes images block-level) and the site's own base type. The live Elementor
 * pages were built on the browser's defaults plus the Rhodos theme, so on these
 * pages each of those resets is rolled back to the browser default with
 * `revert`.
 *
 * Every selector is wrapped in :where(), so it has no specificity, and this file
 * loads before the theme and Elementor stylesheets: any rule of theirs still
 * wins, and only what Tailwind alone was setting goes back to the browser's
 * value. Only the properties preflight and the base layer set are reverted, one
 * by one. `all: revert` would also throw away HTML and SVG presentation
 * attributes (an iframe's width, a path's d), which are not in the browser's
 * own stylesheet.
 *
 * It applies only where the body carries the theme's class, which only
 * ElementorPage.astro sets, so no other page is touched.
 * landing-compat-scoped.css is the same rules for div.sb-wp.
 */

:where(html:has(> body.wp-theme-rhodos)) {
  line-height: revert;
  -webkit-text-size-adjust: revert;
  tab-size: revert;
  font-family: revert;
  font-feature-settings: revert;
  font-variation-settings: revert;
  -webkit-tap-highlight-color: revert;
  color: revert;
  scroll-behavior: revert;
}

:where(body.wp-theme-rhodos) {
  margin: revert;
  font-size: revert;
  font-weight: revert;
  line-height: revert;
}

:where(body.wp-theme-rhodos, body.wp-theme-rhodos *, body.wp-theme-rhodos ::before, body.wp-theme-rhodos ::after) {
  box-sizing: revert;
}

/* Borders: the browser's are "none, medium"; preflight's are "0 solid", which
   differ as soon as a stylesheet sets only a width or only a style. Elements
   whose border can come from an HTML attribute are left out. */
:where(body.wp-theme-rhodos *:not(iframe, img, table, tbody, thead, tfoot, tr, td, th, hr, frame, frameset, object, embed, svg, svg *)),
:where(body.wp-theme-rhodos ::before, body.wp-theme-rhodos ::after) {
  border-style: revert;
  border-width: revert;
}

/* Elements the browser gives margins or padding. */
:where(body.wp-theme-rhodos) :where(p, h1, h2, h3, h4, h5, h6, ul, ol, menu, dir, dl, dd, blockquote, figure, pre, fieldset, legend, details, summary, address) {
  margin: revert;
  padding: revert;
}

:where(body.wp-theme-rhodos) :where(hr) {
  height: revert;
  color: revert;
  margin: revert;
  border-style: revert;
  border-width: revert;
  border-color: revert;
}

:where(body.wp-theme-rhodos) :where(h1, h2, h3, h4, h5, h6) {
  font-size: revert;
  font-weight: revert;
  line-height: revert;
  color: revert;
  letter-spacing: revert;
}

:where(body.wp-theme-rhodos) :where(a, a:hover) {
  color: revert;
  text-decoration: revert;
}

:where(body.wp-theme-rhodos) :where(ul, ol, menu) {
  list-style: revert;
}

:where(body.wp-theme-rhodos) :where(small) {
  font-size: revert;
}

:where(body.wp-theme-rhodos) :where(sub, sup) {
  font-size: revert;
  line-height: revert;
  position: revert;
  vertical-align: revert;
  top: revert;
  bottom: revert;
}

:where(body.wp-theme-rhodos) :where(code, kbd, samp, pre) {
  font-family: revert;
  font-size: revert;
  font-feature-settings: revert;
  font-variation-settings: revert;
}

:where(body.wp-theme-rhodos) :where(abbr[title]) {
  text-decoration: revert;
}

:where(body.wp-theme-rhodos) :where(table) {
  text-indent: revert;
  border-collapse: revert;
}

:where(body.wp-theme-rhodos) :where(summary) {
  display: revert;
}

:where(body.wp-theme-rhodos) :where(img, svg, video, canvas, audio, iframe, embed, object) {
  display: revert;
  vertical-align: revert;
}

/* Form controls have no presentation attributes, so they can go back wholesale. */
:where(body.wp-theme-rhodos) :where(button, input, select, optgroup, option, textarea),
:where(body.wp-theme-rhodos) :where(input, textarea)::placeholder {
  all: revert;
}

/*
 * Font Awesome 7 (in global.css) gives every .fa/.fas icon a fixed 1.25em width
 * by default. Elementor's Font Awesome 5 sets no width, so the live icons are as
 * wide as their glyph. Its own variable turns that off.
 */
body.wp-theme-rhodos {
  --fa-width: auto;
}
