/* ==========================================================================
   04 · LAYOUT — grid widths, container spacing, structural breakpoints
   ========================================================================== */

/* --- Container spacing --------------------------------------------------- */

.edgtf-title-holder {
  padding-top: 0px !important;
}

.edgtf-content {
  margin-top: 0px !important;
}

.edgtf-container.first .edgtf-container-inner {
  padding-bottom: 0px !important;
}

.edgtf-container.second .edgtf-container-inner {
  padding-top: 0px !important;
}

/* --- Title area: out of table layout -------------------------------------
   The parent theme builds the title band as display:table with the inner
   container as a table-cell. During table layout every percentage is
   indefinite, so neither a width of min(cap, 100% - gutter) nor a padding
   of (100% - cap)/2 can resolve — the cell simply filled the viewport and
   the headline sat flush against the left edge while the content below
   kept its gutter.

   Flex removes the cause instead of working around it: the inner becomes
   an ordinary flex item, percentages resolve, and the general grid rule
   below applies to it like to any other container. Vertical centring, which
   is what the table was for, comes from align-items.
   ------------------------------------------------------------------------ */

.edgtf-title-holder {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Flex column: the strip centres the container, but the container's content
   sat at the top. display:block came from the flex-item blockification that
   the old table layout needed — flex serves both purposes. */

.edgtf-title-holder .edgtf-container-inner {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

/* --- Grid ----------------------------------------------------------------
   The parent theme (modules.min.css) pins these to 1300px with steps at
   1200 / 1000 / 800. One rule replaces the whole ladder:

     min(cap, 100% - gutter)

   Above the cap the container is fixed at --sm-grid. Below it, it goes
   fluid with a constant gutter. No media queries, no breakpoint to keep in
   sync — the cap lives in 02-tokens.css as --sm-grid.
   ------------------------------------------------------------------------ */

.edgtf-container-inner,
.edgtf-grid,
.edgtf-grid-section .edgtf-section-inner,
.edgtf-slider .carousel-inner .edgtf-slider-content-outer {
  width: min(var(--sm-grid), calc(100% - var(--sm-gutter))) !important;
}

/* --- Two-column split ---------------------------------------------------- */

/* --- Two-column split ------------------------------------------------------
   The theme stacks the columns at 768. That is too late: between 1024 and
   768 the sidebar is squeezed to about 220px, where the event cards break
   words mid-syllable and every title runs over four lines. Stacking at 1024
   gives the sidebar the full width instead.
   ------------------------------------------------------------------------ */

.edgtf-two-columns-75-25 {
  width: auto !important;
}

@media only screen and (max-width: 1024px) {
  .edgtf-two-columns-75-25 .edgtf-column1,
  .edgtf-two-columns-75-25 .edgtf-column2 {
    width: 100% !important;
    float: none !important;
  }
  /* The margin reset lives in 07-content.css, next to the rule that sets it
     — a short selector here loses to those :not() chains. */
  .edgtf-two-columns-75-25 .edgtf-column2 {
    margin-top: var(--sm-gap) !important;
  }
}

@media only screen and (max-width: 768px) {
  .edgtf-two-columns-75-25 .edgtf-column2 {
    margin-top: calc(var(--sm-gap) / 2) !important;
  }
}

/* --- Content padding -------------------------------------------------------
   The theme puts 65px above and below the content, a value from its own
   options that has nothing to do with our scale. On listing pages the last
   post added its own 48 on top, so the bottom gap was 113 while the top was
   65 — different on every page.

   Both now run on --sm-gap, halved below 768 like everything else.
   ------------------------------------------------------------------------ */

.edgtf-content .edgtf-content-inner > .edgtf-container > .edgtf-container-inner,
.edgtf-content .edgtf-content-inner > .edgtf-full-width > .edgtf-full-width-inner {
  padding: var(--sm-gap) 0 !important;
}

.edgtf-blog-holder article:last-child {
  margin-bottom: 0 !important;
}

@media only screen and (max-width: 768px) {
  .edgtf-content .edgtf-content-inner > .edgtf-container > .edgtf-container-inner,
  .edgtf-content .edgtf-content-inner > .edgtf-full-width > .edgtf-full-width-inner {
    padding: calc(var(--sm-gap) / 2) 0 !important;
  }
}

/* --- Breadcrumbs off ----------------------------------------------------- */

.edgtf-breadcrumbs-holder {
  display: none !important;
}

@media only screen and (max-width: 768px) {
  .edgtf-title.edgtf-standard-type.edgtf-content-left-alignment .edgtf-breadcrumbs-holder .edgtf-breadcrumbs {
    display: none !important;
  }
}

/* --- Page builder resets ------------------------------------------------- */

.last_toggle_el_margin,
.wpb_button,
.wpb_content_element,
.wpb_row,
ul.wpb_thumbnails-fluid > li {
  margin-bottom: inherit !important;
}

/* --- WooCommerce cart ---------------------------------------------------- */

@media only screen and (max-width: 667px) {
  .woocommerce-cart .shop_table th h4 {
    hyphens: auto;
  }
}

/* Historic note: an inner shadow on .edgtf-title-holder .edgtf-container was
   trialled and disabled —
   box-shadow: inset 0 16px 16px rgb(18 28 38 / 60%), inset 0 -16px 16px rgb(18 28 38 / 40%); */
