/* Background settings */
.bg-white {
  background-color: var(--foreground);
}
.bg-black {
  background-color: var(--background);
  a,
  button,
  li,
  p,
  span,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    color: var(--foreground) !important;
  }
}
.bg-dark-gray {
  background-color: var(--dark-gray);
  figcaption {
    color: var(--foreground) !important;
  }
  .contact-email.contact-email--dark {
    color: var(--foreground);
  }
  .contact-email.contact-email--dark .contact-email__icon svg {
    fill: var(--foreground);
  }
  .contact-email.contact-email--dark .contact-email__icon img {
    filter: brightness(0) invert(1);
  }
}
.bg-gray-light {
  background-color: var(--gray-light);
}
.bg-gray {
  background-color: var(--gray);
}

/* Layout Settings */
.section-layout {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: var(--section-gap, 0);
  margin-top: var(--section-mt, 0);
  margin-bottom: var(--section-mb, 7rem);
  padding-top: var(--section-pt, 0);
  padding-bottom: var(--section-pb, 0);
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* Background Image & Overlay */
.section-layout__bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.section-layout__bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

.section-layout__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6); /* Dark overlay for text readability */
  z-index: 1;
  opacity: 0.72;
}

/* Ensure content stays above background */
.section-layout > *:not(.section-layout__bg) {
  position: relative;
  z-index: 2;
}

.section-layout--align-left,
.section-layout--align-left * {
  text-align: left !important;
}
/* Override flex containers nested inside left-aligned sections */
.section-layout--align-left [class*="__content"],
.section-layout--align-left [class*="tagline-wrap"] {
  justify-content: flex-start !important;
  align-items: flex-start !important;
}

.section-layout--align-center,
.section-layout--align-center * {
  text-align: center !important;
  justify-content: center !important;
}
.section-layout--align-center [class*="__content"],
.section-layout--align-center [class*="tagline-wrap"] {
  justify-content: center !important;
  align-items: center !important;
}

.section-layout--align-right,
.section-layout--align-right * {
  text-align: right !important;
  justify-content: flex-end !important;
}
.section-layout--align-right [class*="__content"],
.section-layout--align-right [class*="tagline-wrap"] {
  justify-content: flex-end !important;
  align-items: flex-end !important;
}

/* Empty state styling only shown inside the Canvas Editor */
.section-layout__empty-state {
  display: none;
}
.in-canvas .section-layout__empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(0, 0, 0, 0.2);
  min-height: 80px;
  background-color: rgba(0, 0, 0, 0.02);
  color: rgba(0, 0, 0, 0.4);
}
.in-canvas .section-layout:not(:empty) .section-layout__empty-state {
  display: none;
}

.section-layout--align-left .section-intro.custom-container {
  justify-content: flex-start !important;
  align-items: flex-start !important;
}
.section-layout--align-left [class*="__actions"] {
  justify-content: flex-start !important;
}

.section-layout--align-right .section-intro.custom-container {
  justify-content: flex-end !important;
  align-items: flex-end !important;
}
.section-layout--align-right [class*="__actions"] {
  justify-content: flex-end !important;
}

.section-layout--align-center .section-intro.custom-container {
  justify-content: center !important;
  align-items: center !important;
}
.section-layout--align-center [class*="__actions "] {
  justify-content: center !important;
}
.text-background {
  color: var(--foreground) !important;
}
/* Higher specificity to override Tailwind's [&_figcaption]:block from text component */
.text-ck-editor figure figcaption,
.text-ck-editor figcaption,
.text-ck-editor blockquote,
.section-layout figcaption {
  display: flex !important;
  gap: 1.25rem;
  border-left: none !important;
  padding-left: 0 !important;
}

.text-ck-editor figure figcaption::before,
.text-ck-editor figcaption::before,
.text-ck-editor blockquote::before,
.section-layout figcaption::before {
  content: "";
  display: block;
  width: 2px;
  flex-shrink: 0;
  align-self: stretch;
  background: rgba(255, 255, 255, 0.2);
}
