/* ==========================================================================
   ASTRA OVERRIDE
   ==========================================================================
   Astra's own chrome is removed in PHP (acevori_disable_astra_chrome), but its
   COMPONENT styles still load and still win in places, because the parent
   stylesheet is enqueued before ours and Astra styles bare element selectors
   like `button` and `input`.

   That is not theoretical. The testimonial carousel arrows rendered as empty
   circles for weeks because Astra gave every <button> `padding: 15px 27px`,
   which on a 48px control left a 2px content box and collapsed the icon to
   zero width. Our own rule declared 48px and no padding, and lost.

   This file neutralises the parent's element-level defaults so Acevori's
   design system is the only thing setting them. It is loaded last, after both
   Astra and acevori-global.

   Scope note: everything is confined to the front end. wp-admin, the block
   editor and the customizer never load this file.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. STRUCTURE
   Astra wraps content in #page / #content / .site-content with its own
   widths, padding and background. Ours are full-bleed sections that manage
   their own container, so the parent's boxes only fight us.
   -------------------------------------------------------------------------- */
body.acevori-page #page,
body.acevori-page #content,
body.acevori-page .site-content,
body.acevori-page .ast-container,
body.acevori-page .entry-content,
body.acevori-page .site-main {
  max-width: none;
  width: auto;
  margin: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border: 0;
}

/* Any header or footer that is not ours. Astra builds these from several
   different actions depending on which addons are active, so match broadly
   and exempt our own by class. */
body.acevori-page .site-header,
body.acevori-page .ast-above-header,
body.acevori-page .ast-below-header,
body.acevori-page .main-header-bar,
body.acevori-page .ast-mobile-header-wrap,
body.acevori-page #masthead,
body.acevori-page .site-footer,
body.acevori-page #colophon,
body.acevori-page .ast-small-footer,
body.acevori-page .footer-adv,
body.acevori-page .ast-sticky-header-wrap {
  display: none;
}

/* Sidebars and the post title bar Astra prints above content. */
body.acevori-page #secondary,
body.acevori-page .widget-area,
body.acevori-page .ast-single-post-title,
body.acevori-page .ast-archive-description,
body.acevori-page .ast-breadcrumbs-wrapper {
  display: none;
}

/* Astra reserves space for a sticky header even after we remove it. */
body.acevori-page {
  padding-top: 0;
  margin-top: 0;
}

/* --------------------------------------------------------------------------
   2. BUTTONS
   The important one. Astra styles bare `button`, `input[type=submit]` and
   `.wp-block-button__link` with its own padding, colour, radius and border.
   Every icon-only control in this theme is a <button>, so the parent's
   padding silently crushes them.

   Reset to nothing and let each component declare its own box.
   -------------------------------------------------------------------------- */
/* Two exclusions, both deliberate:
     #wpadminbar — WordPress's own toolbar, which must keep working for staff.
     .tutor-*    — Tutor LMS still runs alongside the new exam engine during
                   the migration; stripping its buttons would break the pages
                   students are using today. Drop this exclusion once Tutor is
                   deactivated. */
body.acevori-page button:not([class*="tutor-"]),
body.acevori-page input[type="button"]:not([class*="tutor-"]),
body.acevori-page input[type="submit"]:not([class*="tutor-"]),
body.acevori-page input[type="reset"]:not([class*="tutor-"]) {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: normal;
  text-transform: none;
  box-shadow: none;
  width: auto;
  min-width: 0;
}

/* Put the toolbar back exactly as WordPress ships it. */
body.acevori-page #wpadminbar button,
body.acevori-page #wpadminbar input {
  all: revert;
}

/* Our own button component then supplies everything, unimpeded. */
body.acevori-page .av-btn {
  padding: 14px 28px;
  border-radius: var(--av-radius-full);
  font-family: var(--av-font-heading);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.25;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   3. FORMS
   Astra sets its own heights, borders and focus rings on every field.
   -------------------------------------------------------------------------- */
body.acevori-page input[type="text"],
body.acevori-page input[type="email"],
body.acevori-page input[type="password"],
body.acevori-page input[type="search"],
body.acevori-page input[type="number"],
body.acevori-page input[type="tel"],
body.acevori-page input[type="url"],
body.acevori-page textarea,
body.acevori-page select {
  font-family: var(--av-font-body);
  color: var(--av-text);
  background: var(--av-bg-white);
  border: 1px solid var(--av-border);
  border-radius: var(--av-radius-md);
  box-shadow: none;
}

body.acevori-page input:focus,
body.acevori-page textarea:focus,
body.acevori-page select:focus {
  border-color: var(--av-secondary);
  box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.18);
  outline: none;
}

/* Astra hides native radios and checkboxes behind its own drawn controls,
   which conflicts with the ones we draw for exam options and flashcards. */
body.acevori-page input[type="radio"]:not([class*="tutor-"]),
body.acevori-page input[type="checkbox"]:not([class*="tutor-"]) {
  appearance: auto;
  -webkit-appearance: auto;
}

/* The exam runner draws its own option rows and hides the native control, so
   it opts back out of the reset above. */
body.acevori-page .av-q__option input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
}

/* --------------------------------------------------------------------------
   4. TYPOGRAPHY
   Astra applies its own family, weight and letter-spacing to headings, which
   is what rendered flashcard questions in unintended uppercase.
   -------------------------------------------------------------------------- */
body.acevori-page h1,
body.acevori-page h2,
body.acevori-page h3,
body.acevori-page h4,
body.acevori-page h5,
body.acevori-page h6 {
  font-family: var(--av-font-heading);
  color: var(--av-primary);
  text-transform: none;
  letter-spacing: -0.01em;
}

body.acevori-page a {
  color: var(--av-primary);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   5. ASTRA / ELEMENTOR LEFTOVERS
   Elements Astra or its addons inject that have no place in our layouts.
   -------------------------------------------------------------------------- */
body.acevori-page .ast-scroll-top,
body.acevori-page #ast-scroll-top,
body.acevori-page .ast-header-break-point .main-navigation,
body.acevori-page .ast-mobile-menu-trigger-minimal,
body.acevori-page .ast-button-wrap .menu-toggle,
body.acevori-page .entry-header,
body.acevori-page .entry-footer,
body.acevori-page .post-navigation,
body.acevori-page .ast-author-details,
body.acevori-page .ast-related-posts-wrapper,
body.acevori-page .ast-comment-formwrap {
  display: none;
}
