/* Footer — Theme Builder global footer chrome. */

/* ── Footer menu — stacks to a centered column ≤980px ──
   `.pa-open-mobile-menu` (mobile-menu.css) keeps the list visible in place of
   Divi's hamburger; this stacks the ul itself.

   Both declarations need `!important` — Divi sets `align-items: stretch` on
   `.et_pb_menu .et_pb_menu__menu > nav > ul` (0,2,2), which outranks this
   selector. Drop the `!important` and the centering silently stops. */
@media (max-width: 980px) {
  .et-l--footer .et-menu {
    flex-direction: column !important;
    align-items: center !important;
  }
}


/* ── Footer nav — item spacing comes from .rw-nav (css/global/utilities.css) ── */

/* ≤980px — logo above the stacked links, 36px rows (Figma mobile footer) */
@media (max-width: 980px) {
  .rw-footer-nav .et_pb_menu__wrap { justify-content: center; }
  .rw-footer-nav .et-menu { row-gap: 1rem; }
}

/* 981–1439px — logo + six links no longer fit one line: logo above the links (matches the header hamburger range) */
@media (min-width: 981px) and (max-width: 1439px) {
  .rw-footer-nav .et_pb_menu_inner_container { flex-direction: column; align-items: flex-start; row-gap: 1.5rem; }
}

/* ── Location cards — equal widths that never squeeze their lines ──
   Each card shares the row equally but never narrows below its own longest
   line (title, address and hours lines as authored), so nothing breaks
   mid-line. When three no longer fit, the last card wraps to its own line
   (wrap + row gap are set on the cards group in the builder). Divi has no
   native min-width / flex-basis, hence this rule. ≥981 only: below that the
   builder stacks the cards in a column. */
@media (min-width: 981px) {
  .rw-footer-cards > .et_pb_group {
    flex: 1 1 0 !important;
    min-width: max-content;
    max-width: calc(50% - 1.125rem);  /* half the row minus half the 2.25rem column gap (set on the cards group), so a wrapped card stays card-sized */
  }
}

/* Mobile-only rules (.rw-footer-rule dividers + the line under the nav) are hidden on
   desktop/tablet-wide/widescreen with Divi's "Disable on" setting, not CSS. */

/* ── Contact numbers — Figma sets the footer info at 0 tracking ── */
.et-l--footer .site-phone { letter-spacing: 0; }

/* ── Footer menu submenu — centred under its parent ≤980px ──
   Accordion mechanics live in mobile-menu.css. The parent row is a 3-column
   grid: equal side columns keep the label on the column's centre line, the
   chevron sits in the right column beside it (the glyph's own side bearing
   gives ~.375rem), and the submenu spans the row
   below. Negative block margin keeps the 44px tap target from adding height
   to the 20px row. Sub-items one size down (Figma has no submenu state). */
@media (max-width: 980px) {
  .rw-footer-nav .et-menu > li.menu-item-has-children {
    display: grid;
    grid-template-columns: minmax(44px, 1fr) auto minmax(44px, 1fr);
    align-items: center;
  }
  .rw-footer-nav .et-menu > li.menu-item-has-children > a { grid-column: 2; grid-row: 1; }
  .rw-footer-nav .et-menu > li.menu-item-has-children > .mobile-toggle {
    grid-column: 3;
    grid-row: 1;
    margin-block: -12px;
    justify-content: flex-start;  /* glyph beside the label; the rest of the 44px target extends right */
  }
  .rw-footer-nav .et-menu > li.menu-item-has-children > .sub-menu {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-top: .75rem !important;  /* beats the !important reset in mobile-menu.css */
    text-align: center;
  }
  .rw-footer-nav .et-menu li li + li { margin-top: .5rem; }
  /* Extra class step outranks the module's `.et_pb_menu_N_tb_footer.et_pb_menu ul li a` size. */
  .rw-footer-nav .et-menu > li > .sub-menu li a { font-size: .875rem; }
}
