/* Gran Fondo Jasper 2027 — legacy Elementor Section layout repair.
   Version 1.0 | 2026-11-02
   Applies only to sections tagged gfj-root, leaving the rest of WordPress alone.
   The source template mistakenly applied display:grid to Elementor's SECTION
   instead of its internal .elementor-container, squeezing all card layouts.
*/

/* 1. Restore the default section wrapper behaviour. */
.gfj-root .elementor-inner-section.gfj-grid,
.gfj-root .elementor-inner-section.gfj-grid2,
.gfj-root .elementor-inner-section.gfj-feature-grid,
.gfj-root .elementor-inner-section.gfj-footer-grid,
.gfj-root .elementor-inner-section.gfj-photo-grid,
.gfj-root .elementor-inner-section.gfj-buttonrow {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* 2. Put the grids on the container that actually HOLDS the Elementor columns. */
.gfj-root .elementor-inner-section.gfj-grid > .elementor-container,
.gfj-root .elementor-inner-section.gfj-grid2 > .elementor-container,
.gfj-root .elementor-inner-section.gfj-feature-grid > .elementor-container,
.gfj-root .elementor-inner-section.gfj-footer-grid > .elementor-container,
.gfj-root .elementor-inner-section.gfj-photo-grid > .elementor-container {
  display: grid !important;
  gap: 20px !important;
  align-items: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
.gfj-root .elementor-inner-section.gfj-grid > .elementor-container,
.gfj-root .elementor-inner-section.gfj-photo-grid > .elementor-container {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
.gfj-root .elementor-inner-section.gfj-grid2 > .elementor-container,
.gfj-root .elementor-inner-section.gfj-feature-grid > .elementor-container {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
.gfj-root .elementor-inner-section.gfj-footer-grid > .elementor-container {
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) !important;
}

/* 3. Elementor column widths can no longer override our grid tracks. */
.gfj-root .elementor-inner-section.gfj-grid > .elementor-container > .elementor-column,
.gfj-root .elementor-inner-section.gfj-grid2 > .elementor-container > .elementor-column,
.gfj-root .elementor-inner-section.gfj-feature-grid > .elementor-container > .elementor-column,
.gfj-root .elementor-inner-section.gfj-footer-grid > .elementor-container > .elementor-column,
.gfj-root .elementor-inner-section.gfj-photo-grid > .elementor-container > .elementor-column {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  flex: none !important;
  align-self: stretch !important;
}
.gfj-root .elementor-inner-section.gfj-grid .elementor-widget-wrap,
.gfj-root .elementor-inner-section.gfj-grid2 .elementor-widget-wrap,
.gfj-root .elementor-inner-section.gfj-feature-grid .elementor-widget-wrap,
.gfj-root .elementor-inner-section.gfj-footer-grid .elementor-widget-wrap,
.gfj-root .elementor-inner-section.gfj-photo-grid .elementor-widget-wrap {
  min-width: 0 !important;
  width: 100% !important;
}

/* 4. Flexible button rows. */
.gfj-root .elementor-inner-section.gfj-buttonrow > .elementor-container {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 14px !important;
  width: 100% !important;
  max-width: 100% !important;
}
.gfj-root .elementor-inner-section.gfj-buttonrow > .elementor-container > .elementor-column {
  width: auto !important;
  flex: 0 0 auto !important;
}

/* 5. Prevent breaking words inside large card titles. */
.gfj-root .elementor-widget-heading.gfj-card-title .elementor-heading-title {
  font-family: 'Barlow Condensed', Impact, 'Arial Narrow', sans-serif !important;
  font-size: clamp(26px, 2.9vw, 40px) !important;
  line-height: 1.05 !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
  hyphens: none !important;
}

/* 6. Tablet and mobile stacking. */
@media (max-width: 990px) {
  .gfj-root .elementor-inner-section.gfj-grid > .elementor-container,
  .gfj-root .elementor-inner-section.gfj-photo-grid > .elementor-container {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .gfj-root .elementor-inner-section.gfj-feature-grid > .elementor-container,
  .gfj-root .elementor-inner-section.gfj-grid2 > .elementor-container {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .gfj-root .elementor-inner-section.gfj-footer-grid > .elementor-container {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 700px) {
  .gfj-root .elementor-inner-section.gfj-grid > .elementor-container,
  .gfj-root .elementor-inner-section.gfj-grid2 > .elementor-container,
  .gfj-root .elementor-inner-section.gfj-feature-grid > .elementor-container,
  .gfj-root .elementor-inner-section.gfj-footer-grid > .elementor-container,
  .gfj-root .elementor-inner-section.gfj-photo-grid > .elementor-container {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 16px !important;
  }
  .gfj-root .elementor-widget-heading.gfj-card-title .elementor-heading-title {
    font-size: 32px !important;
  }
}
