/**
 * Cootravipa — resets for Elementor wrappers around custom widgets.
 *
 * Elementor wraps every widget in several layers (section > container > column
 * > widget-wrap > widget > widget-container) that ship with default paddings,
 * min-heights and typography resets. Those defaults conflict with the theme's
 * BEM sections (.hero, .about, .services, .svc, .gov, etc.) which already
 * control their own spacing and containers.
 *
 * The rules below apply ONLY to Elementor sections that host a Cootravipa
 * widget, so nothing changes for other Elementor elements the user may add.
 */

/* Detect our widgets by class prefix and zero out Elementor padding on every
   wrapping layer above them. */
.elementor-widget[class*="elementor-widget-cootravipa_"],
.elementor-widget[class*="elementor-widget-cootravipa_"] > .elementor-widget-container {
    padding: 0 !important;
    margin: 0 !important;
}

/* Remove the ancestor wrappers' padding/min-height only when they contain
   one of our widgets. Uses :has() (modern browsers). */
.elementor-section:has(> .elementor-container > .elementor-column > .elementor-widget-wrap > .elementor-widget[class*="elementor-widget-cootravipa_"]),
.elementor-section:has(> .elementor-container > .elementor-column > .elementor-widget-wrap > .elementor-widget[class*="elementor-widget-cootravipa_"]) > .elementor-container,
.elementor-section:has(> .elementor-container > .elementor-column > .elementor-widget-wrap > .elementor-widget[class*="elementor-widget-cootravipa_"]) > .elementor-container > .elementor-column,
.elementor-section:has(> .elementor-container > .elementor-column > .elementor-widget-wrap > .elementor-widget[class*="elementor-widget-cootravipa_"]) > .elementor-container > .elementor-column > .elementor-widget-wrap {
    padding: 0 !important;
    margin: 0 !important;
    min-height: 0 !important;
    display: block !important;
}

/* Fallback for browsers without :has() — broad reset for full-width sections
   that host any of our widgets. Slightly less surgical but safe. */
.elementor-section.elementor-section-full_width > .elementor-container {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

.elementor-section.elementor-section-full_width > .elementor-container > .elementor-column {
    padding: 0 !important;
}

.elementor-section.elementor-section-full_width > .elementor-container > .elementor-column > .elementor-widget-wrap {
    padding: 0 !important;
}

/* Ensure our widgets fill their allotted space. */
.elementor-widget[class*="elementor-widget-cootravipa_"] > .elementor-widget-container > section {
    width: 100%;
}

/* ------------------------------------------------------------------------- *
 * Neutralize Elementor's global tag resets that win by specificity over the
 * theme's single-class BEM rules.
 *
 * Elementor ships two reset rules that hit our styling:
 *   - `.elementor a { box-shadow: none; text-decoration: none; }`
 *   - `.elementor img { border: none; border-radius: 0; box-shadow: none; max-width: 100%; }`
 * Specificity (0,1,1) beats our (0,1,0) BEM selectors. We restore the theme's
 * intent with selectors that match or exceed Elementor's specificity.
 * ------------------------------------------------------------------------- */

/* Service cards (links with glass-card effect) — restore shadow from theme var. */
.elementor a.service-card {
    box-shadow: var(--shadow-card);
}
.elementor a.service-card:hover {
    box-shadow: var(--shadow-card-hover);
}

/* Policy cards (governança) — they are divs but keep the intent explicit. */
.elementor .gov__policy-card {
    box-shadow: var(--shadow-card, 0 8px 32px 0 rgba(31, 38, 135, 0.20));
}

/* Images inside our sections should use the theme's border-radius when set.
   Elementor forces border-radius: 0 on every .elementor img. */
.elementor .about__image img,
.elementor .svc__image img,
.elementor .noticias__destaque-img img,
.elementor .noticias__lista-img img,
.elementor .gov__hex-shape img,
.elementor .mv__circle img,
.elementor .timeline__image img {
    border-radius: inherit;
}

/* Restore theme image sizing. Elementor's reset `.elementor img { height: auto;
   max-width: 100% }` wins on specificity (0,1,1) vs BEM (0,1,0), collapsing the
   fixed-aspect containers. These selectors are (0,2,1) and restore intent. */
.elementor .about__image img,
.elementor .svc__image img,
.elementor .noticias__destaque-img img,
.elementor .noticias__lista-img img,
.elementor .gov__hex-shape img,
.elementor .mv__circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.elementor .timeline__image img {
    width: 100%;
    height: 350px;
    object-fit: cover;
}

/* Timeline image has its own explicit border-radius in the theme. */
.elementor .timeline__image {
    border-radius: 12px;
    overflow: hidden;
}

/* Keep CTA buttons styled as the theme intends (Elementor resets <a>). */
.elementor a.cta__button,
.elementor a.hero__cta,
.elementor a.gov__policy-link,
.elementor a.assoc__form-submit {
    text-decoration: none;
}
