/* ============================================================================
   SMGovPH Core — site layout
   ----------------------------------------------------------------------------
   Styles the widget areas so they match the prototype at
   http://localhost:8091/government-executive.html

   Each part is tied to the parent class on its Divi section, so one part can
   never style another. Add these classes in Divi > section > Advanced > CSS Class:

     .site-content        the white page body (side navigation + content)
                          (.site-main-content is accepted too)
     .site-main-footer    the blue footer with the link columns
     .site-footer-bottom  the copyright bar under the footer

   CONTENTS
     1.  Tokens
     2.  Section navigation — inside .site-content
     3.  The plugin's own widget — .side-nav
     4.  Footer columns — inside .site-main-footer
     4A. Footer brand block (seal + name)
     4B. Footer contact list (address, email, phone, hours)
     4C. Footer decor (turtlecomb pattern + hawksbill turtle)
     5.  Footer bottom bar — inside .site-footer-bottom
     6.  Tablet and phone (Divi breakpoints: 979px / 767px)

   Nothing here applies outside those three parents.
   ========================================================================= */


/* ---------------------------------------------------------------------------
   1. Tokens
   ------------------------------------------------------------------------ */
.site-content,
.site-main-content,
.site-main-footer,
.site-footer-bottom,
.side-nav,
.mgs-sidenav {
  --mgs-font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mgs-blue: #2B328C;          /* brand blue */
  --mgs-red: #DB1718;           /* focus ring */
  --mgs-sky: #CEE5F2;           /* accent on blue */
  --mgs-text: #4B5565;          /* link text on white */
  --mgs-muted: #667085;         /* section label on white */
  --mgs-faint: #98A2B3;         /* group label */
  --mgs-hover: #F5F6F8;         /* link hover on white */
  --mgs-on-blue: rgba(255, 255, 255, 0.85);
  --mgs-on-blue-dim: rgba(255, 255, 255, 0.6);
}


/* ---------------------------------------------------------------------------
   2. Section navigation — inside .site-main-content

   Any WordPress Navigation Menu widget in a Divi Sidebar module here becomes
   the "In this section" list: a small grey heading, pill links, indented
   sub-items and a solid blue pill for the current page. Whatever menu is
   chosen, the layout is the same.

   The parent is .site-main-content. Until that class is on the section, the Divi
   Sidebar module (.et_pb_widget_area_left) is matched as well; :where() keeps the
   weight low, so the footer rules in part 4 always win inside the footer.

   To leave one sidebar alone, add the class  mgs-no-sidenav  to the module.
   ------------------------------------------------------------------------ */

/* 2.1 Heading (the widget title) */
:where(.site-content, .site-main-content, .et_pb_widget_area_left):not(.mgs-no-sidenav) .widget_nav_menu .widgettitle,
:where(.site-content, .site-main-content, .et_pb_widget_area_left):not(.mgs-no-sidenav) .widget_nav_menu .widget-title,
:where(.site-content, .site-main-content, .et_pb_widget_area_left):not(.mgs-no-sidenav) .widget_nav_menu > h4,
.mgs-sidenav .widgettitle {
  display: block;
  margin: 0 0 12px;
  padding: 0;
  font-family: var(--mgs-font);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--mgs-muted);
}

/* 2.2 The list */
:where(.site-content, .site-main-content, .et_pb_widget_area_left):not(.mgs-no-sidenav) .widget_nav_menu ul.menu,
.mgs-sidenav ul.menu {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0 !important;
  border: 0;
  list-style: none !important;
}
:where(.site-content, .site-main-content, .et_pb_widget_area_left):not(.mgs-no-sidenav) .widget_nav_menu li,
.mgs-sidenav li {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 2.3 Links */
:where(.site-content, .site-main-content, .et_pb_widget_area_left):not(.mgs-no-sidenav) .widget_nav_menu li a,
.mgs-sidenav li a {
  display: block;
  padding: 9px 14px;
  border: 0;
  border-radius: 10px;
  font-family: var(--mgs-font);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--mgs-text);
  text-decoration: none;
  transition: background-color 0.18s ease, color 0.18s ease;
}
:where(.site-content, .site-main-content, .et_pb_widget_area_left):not(.mgs-no-sidenav) .widget_nav_menu li a:hover,
.mgs-sidenav li a:hover {
  background: var(--mgs-hover);
  color: var(--mgs-blue);
}
:where(.site-content, .site-main-content, .et_pb_widget_area_left):not(.mgs-no-sidenav) .widget_nav_menu li a:focus-visible,
.mgs-sidenav li a:focus-visible {
  outline: 3px solid var(--mgs-red);
  outline-offset: 2px;
}

/* 2.4 Current page */
:where(.site-content, .site-main-content, .et_pb_widget_area_left):not(.mgs-no-sidenav) .widget_nav_menu .current-menu-item > a,
:where(.site-content, .site-main-content, .et_pb_widget_area_left):not(.mgs-no-sidenav) .widget_nav_menu .current_page_item > a,
.mgs-sidenav .current-menu-item > a {
  background: var(--mgs-blue);
  color: #fff;
  font-weight: 700;
}

/* The item the current page sits under ("Legislative" while reading "Municipal Councilors").
   Only the page you are on gets the blue pill; the one above it is marked more quietly, so the two never compete. */
:where(.site-content, .site-main-content, .et_pb_widget_area_left):not(.mgs-no-sidenav) .widget_nav_menu .current-menu-ancestor:not(.current-menu-item):not(.current_page_item) > a,
.mgs-sidenav .current-menu-ancestor:not(.current-menu-item) > a {
  color: var(--mgs-blue);
  font-weight: 700;
}
:where(.site-content, .site-main-content, .et_pb_widget_area_left):not(.mgs-no-sidenav) .widget_nav_menu .current-menu-item > a:hover,
.mgs-sidenav .current-menu-item > a:hover {
  background: var(--mgs-blue);
  color: #fff;
}

/* 2.5 Sub-menus keep the menu's own nesting */
:where(.site-content, .site-main-content, .et_pb_widget_area_left):not(.mgs-no-sidenav) .widget_nav_menu ul.sub-menu,
.mgs-sidenav ul.sub-menu {
  display: grid;
  gap: 2px;
  margin: 2px 0;
  padding: 0 !important;
  list-style: none !important;
}
:where(.site-content, .site-main-content, .et_pb_widget_area_left):not(.mgs-no-sidenav) .widget_nav_menu .sub-menu > li > a,
.mgs-sidenav .sub-menu > li > a {
  padding-left: 28px;
  font-size: 0.875rem;
}
:where(.site-content, .site-main-content, .et_pb_widget_area_left):not(.mgs-no-sidenav) .widget_nav_menu .sub-menu .sub-menu > li > a,
.mgs-sidenav .sub-menu .sub-menu > li > a {
  padding-left: 42px;
}


/* ---------------------------------------------------------------------------
   3. The plugin's own widget — .side-nav
   (Section navigation (Magsaysay): builds the list from the menu by itself.)
   ------------------------------------------------------------------------ */
.side-nav {
  position: sticky;
  top: 80px;
  font-family: var(--mgs-font);
}
.side-nav__title {
  display: block;
  margin: 0 0 12px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mgs-muted);
}
.side-nav ul { display: grid; gap: 2px; margin: 0; padding: 0; border: 0; list-style: none; }
.side-nav li { margin: 0; padding: 0; list-style: none; }
.side-nav li a {
  display: block;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--mgs-text);
  text-decoration: none;
  transition: background-color 0.18s ease, color 0.18s ease;
}
.side-nav li a:hover { background: var(--mgs-hover); color: var(--mgs-blue); }
.side-nav li a:focus-visible { outline: 3px solid var(--mgs-red); outline-offset: 2px; }
.side-nav li a[aria-current="page"],
.side-nav li a.is-current { background: var(--mgs-blue); color: #fff; font-weight: 700; }

/* A menu item used only as a heading (its link is "#") */
.side-nav__group {
  display: block;
  padding: 14px 14px 4px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mgs-faint);
}
.side-nav li.side-nav__child > a { padding-left: 28px; font-size: 0.875rem; }
.side-nav li.side-nav__child--2 > a { padding-left: 42px; }
.side-nav li.side-nav__child .side-nav__group { padding-left: 28px; }

/* Collapsed panel control (shown on tablet and phone only) */
.side-nav summary { list-style: none; }
.side-nav summary::-webkit-details-marker { display: none; }
.side-nav__summary-btn { display: none; }
.side-nav .icon {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.mgs-note { font-size: 0.875rem; color: var(--mgs-text); }


/* ---------------------------------------------------------------------------
   4. Footer columns — inside .site-main-footer

   Plain white link lists under an uppercase heading, as in the prototype.
   These rules deliberately undo the side-navigation look: no pills, no indent,
   no highlight for the current page.
   ------------------------------------------------------------------------ */

/* 4.1 Column heading */
.site-main-footer .widgettitle,
.site-main-footer .widget-title,
.site-main-footer .et_pb_widget > h4 {
  margin: 0 0 16px;
  padding: 0;
  font-family: var(--mgs-font);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
  color: #fff;
}

.site-main-footer .et_pb_column .et_pb_widget {
  width: 100%;
}



.site-main-footer .et_pb_widget_area_left,
.site-footer-bottom .et_pb_widget_area_left {
    border-right: 0px solid rgba(0, 0, 0, .1);
    padding-right: 0px;
}

 .site-main-footer .et_pb_widget.et_flex_column {
    gap: 0px;
}

.site-footer-bottom .et_pb_widget.et_flex_column {
    row-gap: unset;
}

/* 4.2 The list */
.site-main-footer .widget_nav_menu ul.menu,
.site-main-footer .widget_nav_menu ul.sub-menu {
  display: block;
  margin: 0;
  padding: 0 !important;
  border: 0;
  list-style: none !important;
}
.site-main-footer .widget_nav_menu li {
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-main-footer .widget_nav_menu li + li { margin-top: 12px; }
.site-main-footer .site-footer-bottom .widget_nav_menu li + li { margin-top: 0px; }
.site-main-footer .widget_nav_menu ul.sub-menu { margin-top: 12px; }

/* 4.3 Links: plain, white, underline on hover */
.site-main-footer .widget_nav_menu li a,
.site-main-footer .et_pb_widget li a {
  display: inline;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  font-family: var(--mgs-font);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--mgs-on-blue);
  text-decoration: none;
  transition: color 0.18s ease;
}
.site-main-footer .widget_nav_menu li a:hover,
.site-main-footer .et_pb_widget li a:hover {
  background: none;
  color: var(--mgs-sky);
  text-decoration: underline;
}
.site-main-footer .widget_nav_menu li a:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* 4.4 No current-page highlight in the footer, and no sub-menu indent */
.site-main-footer .widget_nav_menu .current-menu-item > a,
.site-main-footer .widget_nav_menu .current_page_item > a,
.site-main-footer .widget_nav_menu .current-menu-ancestor > a,
.site-main-footer .widget_nav_menu .sub-menu > li > a,
.site-main-footer .widget_nav_menu .sub-menu .sub-menu > li > a {
  padding-left: 0;
  font-size: 0.875rem;
  font-weight: 400;
  background: none;
  color: var(--mgs-on-blue);
}


/* ---------------------------------------------------------------------------
   4A. Footer brand block — inside .site-main-footer

   HTML (paste into a Divi Code module in the footer):
     <a class="brand" href="/">
       <img class="brand__seal" src="…/seal-112.png" alt="" width="56" height="56">
       <span class="brand__text">
         <span class="brand__kicker">Republic of the Philippines</span>
         <span class="brand__name">Municipality of Magsaysay</span>
         <span class="brand__sub">Misamis Oriental</span>
       </span>
     </a>

   The seal beside a three-line name: small grey kicker, large white name,
   sky-blue province. Scoped to the footer so it never touches the header's
   own .brand (that one lives under .site-header).
   ------------------------------------------------------------------------ */
.site-main-footer .brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}
.site-main-footer .brand:hover { text-decoration: none; }
.site-main-footer .brand__seal {
  display: block;
  width: 56px;
  height: 56px;
  max-width: none;
  flex: none;
}
.site-main-footer .brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.site-main-footer .brand__kicker {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mgs-on-blue-dim);
}
.site-main-footer .brand__name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: #fff;
}
.site-main-footer .brand__sub {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--mgs-sky);
}


/* ---------------------------------------------------------------------------
   4B. Footer contact list — inside .site-main-footer

   HTML (paste into a Divi Code module in the footer):
     <div class="footer-contact">
       <div><svg class="icon" aria-hidden="true"><use href="#i-pin"></use></svg><span>Address…</span></div>
       <div><svg class="icon" aria-hidden="true"><use href="#i-mail"></use></svg><a href="mailto:…">email</a></div>
       <div><svg class="icon" aria-hidden="true"><use href="#i-phone"></use></svg><span>Phone</span></div>
       <div><svg class="icon" aria-hidden="true"><use href="#i-clock"></use></svg><span>Office hours</span></div>
     </div>

   One row per fact: a sky-blue icon, then the text. The icons come from the
   plugin's own sprite (pin, mail, phone and clock), which is on every page
   because the header outputs it.
   ------------------------------------------------------------------------ */
.site-main-footer .footer-contact {
  display: grid;
  gap: 12px;
  margin-top: 24px;
  font-family: var(--mgs-font);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--mgs-on-blue);
}
.site-main-footer .footer-contact > div {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.site-main-footer .footer-contact .icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  margin-top: 2px;
  fill: none;
  stroke: var(--mgs-sky);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.site-main-footer .footer-contact > div > span { color: inherit; }   /* direct text only: the "To verify" tag keeps its own colors */
.site-main-footer .footer-contact a {
  color: var(--mgs-on-blue);
  text-decoration: none;
  transition: color 0.18s ease;
}
.site-main-footer .footer-contact a:hover {
  color: var(--mgs-sky);
  text-decoration: underline;
}
.site-main-footer .footer-contact a:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
  border-radius: 2px;
}

/* 4B.1 "To verify" tag and placeholder text (marks details the LGU still has to confirm) */
.site-main-footer .verify {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 7px;
  border: 1px dashed #E9A23B;
  border-radius: 999px;
  background: #FEF1DC;
  color: #7A4B00;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
  white-space: nowrap;
}
.site-main-footer .placeholder {
  padding: 0 4px;
  border-bottom: 1px dashed #E9A23B;
  border-radius: 2px;
  background: #FEF1DC;
  color: #7A4B00;
}

/* ---------------------------------------------------------------------------
   4C. Footer decor — inside .site-main-footer

   The two quiet shell motifs from the prototype, drawn behind the footer content:
     - the turtlecomb (shell-plate) pattern in the bottom-left corner, fading out toward the centre
     - a large, faint line-art hawksbill turtle swimming out of the bottom-right corner

   Both are generated here (no images to upload) and never receive clicks.
   The footer's own content is lifted above them, so text and links stay sharp.
   To remove either one, delete its rule: 4C.2 is the pattern, 4C.3 is the turtle.
   ------------------------------------------------------------------------ */

/* 4C.1 The section becomes the positioning frame; decor is clipped to it */
.site-main-footer {
  --mgs-scute: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='45' viewBox='0 0 26 45'%3E%3Cg fill='none' stroke='%23fff' stroke-linejoin='round'%3E%3Cpath stroke-opacity='.22' d='M13 0 26 7.5v15L13 30 0 22.5v-15zM13 30v15'/%3E%3Cpath stroke-opacity='.12' d='M13 7.5l6.5 3.75v7.5L13 22.5l-6.5-3.75v-7.5zM0 30l6.5 3.75v7.5L0 45M26 30l-6.5 3.75v7.5L26 45'/%3E%3C/g%3E%3C/svg%3E");
  --mgs-turtle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 230'%3E%3Cg fill='none' stroke='%23fff' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M56 88C36 60 14 46 0 50c2 20 24 46 47 60M44 70C32 60 18 54 8 54M50 82C36 72 20 66 6 64'/%3E %3Cpath d='M144 88c20-28 42-42 56-38-2 20-24 46-47 60M156 70c12-10 26-16 36-16M150 82c14-10 30-16 44-18'/%3E %3Cpath d='M66 180c-12 12-16 28-12 38 10-6 18-18 20-26'/%3E %3Cpath d='M134 180c12 12 16 28 12 38-10-6-18-18-20-26'/%3E %3Cpath d='M90 63c-3-9-4-19-1-29 3-10 8-20 11-24 3 4 8 14 11 24 3 10 2 20-1 29M100 24v26M92 40l8-4 8 4M91 52l9-4 9 4'/%3E %3Cpath d='M100 62c28 0 50 18 54 50 4 34-8 64-28 84l-8 6-6-4-6 8-6-4-6 4-6-8-6 4-8-6c-20-20-32-50-28-84 4-32 26-50 54-50Z'/%3E %3Cpath d='M100 72c23 0 41 15 44 41 3 29-7 54-24 71l-20 10-20-10c-17-17-27-42-24-71 3-26 21-41 44-41Z'/%3E %3Cpath d='M93 72 85 82l7 12-8 12 7 12-7 12 7 12-6 12 7 12-4 12 7 8M107 72l8 10-7 12 8 12-7 12 7 12-7 12 6 12-7 12 4 12-7 8M92 94h16M91 118h18M91 142h18M92 166h16'/%3E %3Cpath d='M85 82 58 86M84 106 47 112M84 130 49 142M85 154 60 170M88 176 76 190M115 82l27 4M116 106l37 6M116 130l35 12M115 154l25 16M112 176l12 14'/%3E %3Cpath d='M72 96q6 6 12 6M66 122q8 6 18 4M70 148q7 6 15 4M128 96q-6 6-12 6M134 122q-8 6-18 4M130 148q-7 6-15 4'/%3E%3C/g%3E%3C/svg%3E");
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.site-main-footer > * {
  position: relative;
  z-index: 1;                     /* content above the decor */
}

/* 4C.2 Turtlecomb pattern: bottom-left, up to 420px wide, fading toward the centre */
.site-main-footer::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(420px, 45%);
  pointer-events: none;
  background: var(--mgs-scute) 0 0 / 30px 52px repeat;
  -webkit-mask-image: radial-gradient(ellipse 100% 75% at 0% 100%, #000 0%, rgba(0, 0, 0, 0.5) 45%, transparent 100%);
          mask-image: radial-gradient(ellipse 100% 75% at 0% 100%, #000 0%, rgba(0, 0, 0, 0.5) 45%, transparent 100%);
}

/* 4C.3 Hawksbill turtle: bottom-right, partly off the edge, tilted, at 6% strength */
.site-main-footer::after {
  content: "";
  position: absolute;
  z-index: 0;
  right: -48px;
  bottom: -96px;
  width: 380px;
  height: 437px;                  /* keeps the turtle's 200:230 proportions */
  pointer-events: none;
  background: var(--mgs-turtle) center / contain no-repeat;
  opacity: 0.06;
  transform: rotate(-32deg);
}

/* 4C.4 Phones: a smaller turtle so it never crowds the columns */
@media (max-width: 767px) {
  .site-main-footer::after {
    right: -40px;
    bottom: -60px;
    width: 260px;
    height: 299px;
  }
}

/* ---------------------------------------------------------------------------
   5. Footer bottom bar — inside .site-footer-bottom

   The copyright line on the left and the government links on the right,
   side by side on one row.
   ------------------------------------------------------------------------ */
.site-footer-bottom {
  font-family: var(--mgs-font);
  font-size: 0.75rem;
  color: var(--mgs-on-blue-dim);
}
.site-footer-bottom p { margin: 0; color: var(--mgs-on-blue-dim); font-size: 0.75rem; }

/* 5.1 Links run across in one line, not stacked */
.site-footer-bottom .widget_nav_menu ul.menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin: 0;
  padding: 0 !important;
  list-style: none !important;
  justify-content: flex-end;
}
.site-footer-bottom .widget_nav_menu li {
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-footer-bottom .widget_nav_menu li a {
  display: inline;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--mgs-on-blue-dim);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.18s ease;
}
.site-footer-bottom .widget_nav_menu li a:hover {
  background: none;
  color: #fff;
  text-decoration: underline;
}
.site-footer-bottom .widget_nav_menu li a:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}
/* The bottom bar has no widget heading */
.site-footer-bottom .widgettitle,
.site-footer-bottom .widget-title { display: none; }


/* ---------------------------------------------------------------------------
   6. Tablet and phone (Divi breakpoints)
   ------------------------------------------------------------------------ */
@media (max-width: 979px) {
  /* The plugin's widget becomes a collapsible "In this section" panel */
  .side-nav {
    position: static;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    background: #fff;
  }
  .side-nav__summary-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    font-weight: 700;
    color: var(--mgs-blue);
    cursor: pointer;
  }
  .side-nav__summary-btn .chev { transition: transform 0.18s ease; }
  .side-nav[open] .side-nav__summary-btn .chev { transform: rotate(180deg); }
  .side-nav__title { display: none; }
  .side-nav ul { padding: 0 8px 12px !important; }
}

@media (max-width: 767px) {
  @media (max-width: 767px) {
  .site-main-footer .et_pb_column .et_pb_widget,
   .site-footer-bottom .et_pb_column .et_pb_widget {
      margin-bottom: 0;
  }
  .site-footer-bottom .widget_nav_menu ul.menu {
      justify-content: flex-start;
  }
}

  /* Footer columns sit closer together */
  .site-main-footer .widget_nav_menu li + li { margin-top: 2px; }
  .site-footer-bottom .widget_nav_menu ul.menu { gap: 14px; }

  /* Footer brand block (4A): smaller seal and name, no kicker line */
  .site-main-footer .brand__seal { width: 46px; height: 46px; }
  .site-main-footer .brand__name { font-size: 1rem; }
  .site-main-footer .brand__kicker { display: none; }
}

/* 2.6 The side menu stays in view while the page scrolls (desktop), just below the sticky menu bar,
   like the prototype's .side-nav. Plain CSS sticky: Divi's own "Sticky" setting on the sidebar column
   skips tall columns and misplaces short ones, so it is turned off on these pages. */
@media (min-width: 981px) {
  .site-main-content .et_pb_column:has(> .et_pb_widget_area) { align-self: stretch; }
  .site-main-content .et_pb_widget_area:not(.mgs-no-sidenav) { position: sticky; top: 90px; }
}

/* 2.7 Below 980px the side menu folds into an "In this section" button (assets/sidenav.js builds it),
   so the page's own content starts near the top of the screen, as in the prototype. */
.mgs-sidenav-fold__btn { display: none; }
.mgs-sidenav-fold > ul.menu { margin: 0; }
@media (max-width: 979px) {
  .site-main-content .widget_nav_menu .widgettitle,
  .site-main-content .widget_nav_menu .widget-title { display: none; }
  .mgs-sidenav-fold { border: 1px solid #E5E7EB; border-radius: 12px; background: #fff; }
  .mgs-sidenav-fold > ul.menu { padding: 0 8px 12px !important; }
  .mgs-sidenav-fold__btn {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    min-height: 52px; padding: 0 16px; list-style: none; cursor: pointer;
    font-family: var(--mgs-font); font-size: 1rem; font-weight: 700; color: var(--mgs-blue);
  }
  .mgs-sidenav-fold__btn::-webkit-details-marker { display: none; }
  .mgs-sidenav-fold__btn svg { flex: none; width: 18px; height: 18px; transition: transform .18s ease; }
  .mgs-sidenav-fold[open] > .mgs-sidenav-fold__btn svg { transform: rotate(180deg); }
  .mgs-sidenav-fold__btn:focus-visible { outline: 3px solid var(--mgs-red); outline-offset: 2px; border-radius: 12px; }
  /* the folded menu sits 24px above the page content, as in the prototype */
  .site-main-content .widget_nav_menu { margin-bottom: 0 !important; }
  .site-main-content .et_pb_widget_area { row-gap: 0 !important; }   /* Divi lays the widget area out as a flex column; its clearing element would add a gap */
  .site-main-content .et_pb_row:has(.et_pb_widget_area) { row-gap: 24px !important; }
}
@media (prefers-reduced-motion: reduce) { .mgs-sidenav-fold__btn svg { transition: none; } }

/* 4.9 Footer links on Theme Builder pages (e.g. the Departments directory, an office page)
   Divi adds ".et-db #et-boc .et-l a { color: link color }" there; its ID selector outweighed the white footer links above,
   so they turned navy on the navy footer. Same colors, stronger selectors. */
.et-db #et-boc .et-l .site-main-footer .widget_nav_menu li a,
.et-db #et-boc .et-l .site-main-footer .et_pb_widget li a,
.et-db #et-boc .et-l .site-main-footer .footer-contact a { color: var(--mgs-on-blue); }
.et-db #et-boc .et-l .site-main-footer .widget_nav_menu li a:hover,
.et-db #et-boc .et-l .site-main-footer .et_pb_widget li a:hover,
.et-db #et-boc .et-l .site-main-footer .footer-contact a:hover { color: var(--mgs-sky); }
