/*
 * Arbressence — seasonal cedar clipping announcement
 * Add "arbressence-cedar-popup" to the main Elementor popup container
 * (Advanced > CSS Classes). Keep the heading and text as Elementor widgets.
 * Popup Settings: width 880px; Prevent Closing on Overlay = Yes.
 */

/* Popup window only when it contains our uniquely named container. */
.dialog-widget-content:has(.arbressence-cedar-popup) {
  background: transparent !important;
  border: 0 !important;
  border-radius: 20px !important;
  box-shadow: 0 28px 90px rgba(8, 28, 19, .30) !important;
  overflow: visible;
}

/* One class controls all styling inside the announcement. */
.arbressence-cedar-popup {
  --cedar-forest: #163b2a;
  --cedar-deep: #0d2a1d;
  --cedar-accent: #658443;
  --cedar-cream: #faf9f2;
  --cedar-body: #435047;

  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--cedar-cream) !important;
  border: 1px solid rgba(22, 59, 42, .12);
  border-radius: 20px;
  padding: clamp(28px, 4.5vw, 60px) !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.7);
}

/* Top stripe evokes cedar green, without leaf art or images. */
.arbressence-cedar-popup::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 7px;
  background: linear-gradient(90deg, #183e2b 0%, #456c3e 62%, #a1ad73 100%);
  z-index: 1;
}

/* Let native Elementor widgets control content, not widget background styling. */
.arbressence-cedar-popup .elementor-widget-heading .elementor-heading-title {
  color: var(--cedar-deep) !important;
  font-family: inherit;
  font-size: clamp(29px, 3.3vw, 43px) !important;
  font-weight: 750 !important;
  line-height: 1.16 !important;
  letter-spacing: -.035em;
  max-width: 690px;
  margin: 0;
}

.arbressence-cedar-popup .elementor-widget-text-editor,
.arbressence-cedar-popup .elementor-widget-text-editor p {
  color: var(--cedar-body);
  font-size: clamp(15px, 1.35vw, 17px);
  line-height: 1.7;
}

.arbressence-cedar-popup .elementor-widget-text-editor p {
  margin: 0 0 17px;
}

.arbressence-cedar-popup .elementor-widget-text-editor p:last-child {
  margin-bottom: 0;
}

.arbressence-cedar-popup .elementor-widget-text-editor strong,
.arbressence-cedar-popup .elementor-widget-text-editor b {
  color: var(--cedar-forest);
  font-weight: 750;
}

/* Slight spacing between Elementor content widgets. */
.arbressence-cedar-popup .elementor-widget-heading + .elementor-widget-text-editor {
  margin-top: 8px;
}

/* Emphasize the final thank-you line when all copy is in one Text Editor widget. */
.arbressence-cedar-popup .elementor-widget-text-editor p:last-child:not(:first-child) {
  color: var(--cedar-forest);
  font-weight: 650;
}

/* Elementor popup X lives OUTSIDE the main content container. */
.dialog-widget-content:has(.arbressence-cedar-popup) .dialog-close-button {
  top: 19px !important;
  right: 19px !important;
  width: 38px;
  height: 38px;
  display: flex !important;
  justify-content: center;
  align-items: center;
  background: #e9eddd;
  color: var(--cedar-forest, #163b2a) !important;
  border-radius: 50%;
  transition: background-color .2s ease, transform .2s ease;
  z-index: 10;
}
.dialog-widget-content:has(.arbressence-cedar-popup) .dialog-close-button:hover {
  background: #dce6cd;
  transform: rotate(90deg);
}
.dialog-widget-content:has(.arbressence-cedar-popup) .dialog-close-button svg,
.dialog-widget-content:has(.arbressence-cedar-popup) .dialog-close-button i {
  fill: currentColor;
  color: inherit;
  font-size: 17px;
}

@media (max-width: 767px) {
  .dialog-widget-content:has(.arbressence-cedar-popup) {
    border-radius: 14px !important;
    max-width: calc(100vw - 24px) !important;
  }
  .arbressence-cedar-popup {
    padding: 59px 23px 27px !important;
    border-radius: 14px;
  }
  .arbressence-cedar-popup .elementor-widget-heading .elementor-heading-title {
    font-size: clamp(26px, 7vw, 34px) !important;
    padding-right: 0;
  }
  .arbressence-cedar-popup .elementor-widget-text-editor,
  .arbressence-cedar-popup .elementor-widget-text-editor p {
    font-size: 15px;
    line-height: 1.6;
  }
  .dialog-widget-content:has(.arbressence-cedar-popup) .dialog-close-button {
    top: 15px !important;
    right: 15px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dialog-widget-content:has(.arbressence-cedar-popup) .dialog-close-button { transition: none; }
}
