/*------------------------------------*
    #CORE-BLOCK-STYLES (Frontend Portal)
 *------------------------------------*/
/* 
 * Contains minimal necessary styles for core WordPress blocks 
 * used within FCA Pages when viewed in the Fluent Community portal.
 * Added here to avoid loading the full wp-block-library stylesheet,
 * which could conflict with the portal's main theme.
 */

/* Columns Block */
.wp-block-columns {
  display: flex;
  margin-bottom: 1.75em; /* Adjust or use variable if needed */
  box-sizing: border-box;
  flex-wrap: wrap; 
  align-items: normal; 
}

/* Columns Block - Flex Child Fix */
/* See: https://github.com/WordPress/gutenberg/pull/34544 */
.wp-block-columns > .wp-block-column {
	margin-left: 0;
	margin-right: 0;
}

.wp-block-columns:not(.is-not-stacked-on-mobile) {
    /* Default gap, relies on WP inline style or theme.json usually */
    /* Add fallback - adjust value as needed */
    gap: 2em; 
}

.wp-block-columns.are-vertically-aligned-top {
  align-items: flex-start;
}

.wp-block-columns.are-vertically-aligned-center {
  align-items: center;
}

.wp-block-columns.are-vertically-aligned-bottom {
  align-items: flex-end;
}

.wp-block-column {
  flex-grow: 1;
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  box-sizing: border-box;
}

/* Let inline styles handle explicit width */
.wp-block-column[style*="flex-basis"] {
  flex-grow: 0;
}

/* Stacking on mobile */
@media (max-width: 781px) {
  .wp-block-columns:not(.is-not-stacked-on-mobile) {
    flex-direction: column;
    flex-wrap: nowrap; /* Prevent wrapping when stacking */
  }

  .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column {
    flex-basis: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  /* Add vertical margin when stacked */
   .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column:not(:last-child) {
        margin-bottom: 1em; /* Adjust spacing */
   }
}

@media (min-width: 782px) {
    /* Ensure columns have horizontal gap when not stacked */
    /* This is often handled by inline --wp--style--block-gap, but provide fallback */
    .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column:not(:first-child) {
        /* A simple margin fallback if gap isn't working */
        /* margin-left: 2em; */ 
        /* Rely on gap property first */
    }
}

/* Reset margins for direct children within columns */
.wp-block-column > * {
    margin-top: 0;
    margin-bottom: 0;
}

/* Add spacing between blocks within a column */
.wp-block-column > * + * {
     margin-top: 1.5em; /* Adjust as needed */
}

/* Core Block Style Overrides for FCA Pages */

/* Ensure core columns respect container width */
.fca-page-body .wp-block-columns {
    max-width: 100%;
}

/* Apply Fluent Community text color to core headings within FCA Pages */
.fca-page-body h1,
.fca-page-body h2,
.fca-page-body h3,
.fca-page-body h4,
.fca-page-body h5,
.fca-page-body h6 {
    color: var(--fcom-primary-text, inherit); /* Use FC variable or fallback */
    /* You might need !important if theme styles are too specific,
       but try without it first. */
    /* Example: color: var(--fcom-primary-text, #111) !important; */
}

/* Add any other core block overrides needed below */ 