/* ==========================================================================
   FIRST McKINNEY — MEGA MENU
   --------------------------------------------------------------------------
   Load AFTER style.css and responsive.css:

     wp_enqueue_style( 'fmck-mega-menu',
       get_template_directory_uri() . '/assets/css/mega-menu.css',
       array( 'fmck-style', 'fmck-responsive' ), '1.0.0' );

   The look is the site's own, not a new one. The bar keeps the navy
   (#054766) and the white 700/18px Raleway links it already has; the panel
   is the same cream (#F8F2E6), the same 10px radius and the same #d6c5a4
   hairline the existing dropdown uses, just the full width of the page. The
   hover is the site's left-to-right sweep.

   WHAT IS DELIBERATELY NOT HERE, per the client:
     · no left intro column
     · no panel footer bar
     · no stats, quotes or schedules
   A panel is links, and one picture on the right. That is the whole thing.
   ========================================================================== */

/* The tokens live on :root, not on .fmm-header. The scrim and the mobile
   overlay are siblings of the header, not children of it — scoped to the
   header, every var() in those two blocks resolved to nothing and the
   overlay opened fully transparent. */
:root{
  --fmm-navy:#054766;
  --fmm-navy-deep:#092031;
  --fmm-cream:#F8F2E6;
  --fmm-rule:#d6c5a4;
  --fmm-orange:#EA9822;
  --fmm-teal:#378F9D;
  --fmm-rust:#b04825;
  --fmm-ink:#0e2a3a;
  --fmm-muted:#5d6f7a;
  --fmm-font:"Raleway",sans-serif;
  --fmm-t:.32s;
  --fmm-ease:cubic-bezier(.22,.61,.36,1);
}

/* ==========================================================================
   THE BAR
   This does not touch the header's background or its fixed/sticky
   behaviour — those are the theme's. It lays the row out, and it owns its
   own stacking.

   WHY THE HEADER IS POSITIONED HERE. On mckinney.missionaltest.com the theme
   sets .navigation.header{position:fixed;z-index:10000000} and the header
   makes its own stacking context. On lyonsdemoz.co.in/firstmckinney it does
   NOT — the header computes to position:static, z-index:auto. A static
   parent creates no stacking context, so the panel (z-index 5 inside it)
   painted UNDERNEATH the fixed scrim. The pointer then landed on the scrim
   instead of the panel, the panel's mouseenter never fired, the close timer
   ran, the scrim went with it, the pointer fell back onto the nav item and
   it opened again — the flicker.

   So the menu no longer borrows the theme's stacking. It declares its own,
   at a lower specificity than .navigation.header, so a theme that does set
   position:fixed still wins and nothing visual changes there.
   ========================================================================== */
.fmm-header{position:relative;z-index:9999999}
.fmm-header .fmm-nav{padding:0;position:relative}
.fmm-header .fmm-nav > .container{
  display:flex;align-items:center;gap:clamp(12px,1.6vw,28px);
  padding-top:10px;padding-bottom:10px}

.fmm-header .navbar-brand{flex:0 0 auto;margin:0;padding:0;max-width:250px}
.fmm-header .navbar-brand img{display:block;max-width:100%;height:auto}

.fmm-links{display:flex;align-items:center;gap:clamp(4px,1vw,16px);
  margin-left:auto;flex-wrap:nowrap}
.fmm-item{position:relative;display:flex;align-items:center}
/* An invisible bridge from the bottom of the link down to the panel. The row
   has 10px of padding under it and the link box ends above that, so moving
   the pointer straight down left the item for ~14px of nothing before
   reaching the panel. The close timer covered a quick move but not a slow
   one. This closes the gap outright. */
.fmm-item::before{content:"";position:absolute;left:0;right:0;top:100%;
  height:26px;pointer-events:auto}

.fmm-top{
  display:inline-block;padding:8px 2px;
  font-family:var(--fmm-font);font-size:18px;font-weight:700;line-height:1.2;
  color:#fff;text-decoration:none;white-space:nowrap;
  position:relative}
/* the underline the site already uses on an active item */
.fmm-top::after{content:"";position:absolute;left:0;right:0;bottom:2px;height:2px;
  background:var(--fmm-orange);transform:scaleX(0);transform-origin:left center;
  transition:transform var(--fmm-t) var(--fmm-ease)}
.fmm-top:hover,.fmm-top:focus-visible{color:#fff}
.fmm-top:hover::after,.fmm-top:focus-visible::after,
.fmm-top.is-current::after,
.fmm-item.mm-on .fmm-top::after{transform:scaleX(1)}
.fmm-top:focus-visible{outline:2px solid var(--fmm-orange);outline-offset:3px;border-radius:3px}

.fmm-caret{
  display:inline-flex;align-items:center;justify-content:center;
  width:22px;height:30px;padding:0;margin-left:2px;
  border:0;background:transparent;color:#fff;font-size:11px;line-height:1;
  cursor:pointer;
  transition:transform var(--fmm-t) var(--fmm-ease),color var(--fmm-t) var(--fmm-ease)}
.fmm-caret:focus-visible{outline:2px solid var(--fmm-orange);outline-offset:2px;border-radius:5px}
.fmm-item.mm-on .fmm-caret{transform:rotate(180deg);color:var(--fmm-orange)}

.fmm-actions{flex:0 0 auto;display:flex;align-items:center;gap:10px}
/* the burger never shows on desktop — the client asked for all parents inline */
.fmm-burger{display:none}

/* ==========================================================================
   THE PANEL
   Full-bleed cream sheet under the bar. It is a child of .fmm-nav, which the
   fixed header already positions, so top:100% puts it right under the row
   with no gap for the pointer to fall through.
   ========================================================================== */
/* ==========================================================================
   THE PLAIN DROPDOWN
   Everything that is not Ministries or Next Steps. A short vertical list
   under the item — same cream sheet and same motion as the mega panel, so it
   reads as the same system, but sized to its contents and anchored to the
   item rather than spanning the header.
   ========================================================================== */
.fmm-drop {
    position: absolute;
    top: 100%;
    left: -14px;
    min-width: 242px;
    max-width: 330px;
    margin-top: 10px;
    /* padding: 10px; */
    background: var(--fmm-cream);
    /* border: 1px solid rgba(214,197,164,.8); */
    border-radius: 8px;
    box-shadow: 0 22px 48px rgba(0,0,0,.22);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity .24s var(--fmm-ease),transform .24s var(--fmm-ease);
    z-index: 6;
}
.fmm-drop.is-on{opacity:1;transform:none;pointer-events:auto}
.fmm-drop__in{display:flex;flex-direction:column;gap:1px}

/* An item near the right edge of the bar would otherwise push the sheet off
   screen, so the last two open leftwards from their right edge. */
.fmm-links .fmm-item:nth-last-child(-n+2) .fmm-drop{left:auto;right:-14px}

.fmm-drop__l{
  position:relative;
	z-index:1;
	overflow:hidden;
  display:block;
	padding:10px 13px;
	border-radius:0px;
	border-bottom: 1px solid #0b466624;
  font-family:var(--fmm-font);
	font-size:16px;
	font-weight:600;
	line-height:1.35;
  color:var(--fmm-ink);
	text-decoration:none;
  transition:color var(--fmm-t) var(--fmm-ease)
}
.fmm-drop__in  .fmm-drop__l:last-child{
	border-bottom: none !important;
}
/* the site's left-to-right sweep, same as the mega panel's rows */
.fmm-drop__l::after{content:"";position:absolute;inset:0 auto 0 0;width:0;
  background:var(--fmm-navy);border-radius:0px;z-index:-1;
  transition:width .34s var(--fmm-ease)}
.fmm-drop__l:hover::after,.fmm-drop__l:focus-visible::after{width:100%}
.fmm-drop__l:hover,.fmm-drop__l:focus-visible{color:#fff}
.fmm-drop__l:focus-visible{outline:2px solid var(--fmm-orange);outline-offset:-2px}

/* a child that has children of its own keeps its name as a small heading */
.fmm-drop__h{
  display:block;margin:8px 0 4px;padding:0 0 7px 13px;
  border-bottom:2px solid var(--fmm-orange);
  font-family:var(--fmm-font);font-weight:800;font-size:11.5px;
  letter-spacing:.11em;text-transform:uppercase;color:var(--fmm-navy);
  text-decoration:none;transition:color var(--fmm-t) var(--fmm-ease)}
.fmm-drop__in > .fmm-drop__h:first-child{margin-top:2px}
a.fmm-drop__h:hover,a.fmm-drop__h:focus-visible{color:var(--fmm-rust)}
a.fmm-drop__h:focus-visible{outline:2px solid var(--fmm-orange);outline-offset:2px}
.fmm-drop__l--sub{padding-left:24px;font-weight:500;font-size:14.5px}

@media (prefers-reduced-motion:reduce){
  .fmm-drop,.fmm-drop__l::after{transition:none}
}

.fmm-panel{
  position:absolute;left:0;right:0;top:100%;
  background:var(--fmm-cream);
  border-top:1px solid rgba(214,197,164,.8);
  border-radius:0 0 14px 14px;
  box-shadow:0 26px 60px rgba(0,0,0,.22);
  opacity:0;transform:translateY(-10px);pointer-events:none;
  transition:opacity .26s var(--fmm-ease),transform .26s var(--fmm-ease);
  z-index:5}
.fmm-panel.is-on{opacity:1;transform:none;pointer-events:auto}

.fmm-panel__in{
  display:grid;grid-template-columns:minmax(0,1fr);
  gap:clamp(24px,3vw,52px);align-items:stretch;
  padding:clamp(26px,2.6vw,40px) 0 clamp(28px,2.8vw,44px)}
/* THE LINKS GET THE ROOM. The picture is a supporting note on the right,
   not half the panel — it is capped at 300px and the link columns take
   everything else. */
.fmm-panel.has-pic .fmm-panel__in{grid-template-columns:minmax(0,1fr) minmax(232px,300px)}
/* a top-level page with a picture but no children — a small centred card,
   not a half-empty sheet */
.fmm-panel.no-links .fmm-panel__in{grid-template-columns:minmax(0,440px);justify-content:center}
.fmm-panel.no-links{border-radius:0 0 14px 14px}

/* ---------- the link columns ---------- */
/* The columns are capped rather than set to 1fr. Stretched to fill, a column
   holding one short link runs 400px wide and the slack lands between the
   columns, so they float apart. Capped, they sit together and the slack
   collects in one clean gap before the picture. */
.fmm-cols{display:grid;gap:clamp(14px,1.6vw,30px);justify-content:start;
  grid-template-columns:repeat(var(--fmm-n,1),minmax(200px,310px));width:100%;
  align-items:start}
/* a column holds one or more blocks, stacked */
.fmm-colgroup{min-width:0;display:flex;flex-direction:column;gap:clamp(16px,1.8vw,26px)}
.fmm-block{min-width:0;display:flex;flex-direction:column;gap:2px}
/* the heading of a titled block — and it is a link to that page when the
   menu gives it one, because "Adults" and "Care" are real pages */
.fmm-block__h {
    display: block;
    margin: 0 0 8px;
    padding: 0 0 8px 14px;
    border-bottom: 2px solid var(--fmm-orange);
    font-family: var(--fmm-font);
    font-weight: 800;
    font-size: 16px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--fmm-navy);
    text-decoration: none;
    transition: color var(--fmm-t) var(--fmm-ease);
}
a.fmm-block__h:hover,a.fmm-block__h:focus-visible{color:var(--fmm-rust)}
a.fmm-block__h:focus-visible{outline:2px solid var(--fmm-orange);outline-offset:2px}
/* A BLANK HEADING ON AN UNTITLED FIRST BLOCK.
   Printed only when some other block in the same panel has a real heading.
   Without it that column starts a heading's height higher than its
   neighbours and the top of the panel reads ragged. Same element, same
   styling, so the two heights match exactly — the rule below only has to
   hold the line open and hide the orange underline. */
.fmm-block__h--ghost{
  border-bottom-color:transparent;
  pointer-events:none}
.fmm-block__h--ghost::before{content:"\00a0"}

.fmm-col{min-width:0;display:flex;flex-direction:column;gap:2px}

.fmm-l{
  display:flex;align-items:flex-start;gap:11px;
  padding:9px 14px;border-radius:10px;text-decoration:none;
  position:relative;z-index:1;overflow:hidden;
  transition:color var(--fmm-t) var(--fmm-ease)}
/* the site's own left-to-right sweep, in navy on this cream sheet */
.fmm-l::after{content:"";position:absolute;inset:0 auto 0 0;width:0;
  background:var(--fmm-navy);border-radius:10px;z-index:-1;
  transition:width .4s ease-in-out}
.fmm-l:hover::after,.fmm-l:focus-visible::after{width:100%}
.fmm-l:focus-visible{outline:2px solid var(--fmm-orange);outline-offset:2px}

.fmm-l__ico{
  flex:0 0 auto;display:grid;place-items:center;width:32px;height:32px;
  border-radius:9px;background:rgba(5,71,102,.07);
  color:var(--fmm-teal);font-size:14px;
  transition:background var(--fmm-t) var(--fmm-ease),color var(--fmm-t) var(--fmm-ease)}
.fmm-l:hover .fmm-l__ico,.fmm-l:focus-visible .fmm-l__ico{
  background:rgba(255,255,255,.14);color:var(--fmm-orange)}

.fmm-l__c{min-width:0;display:block;padding-top:1px}
.fmm-l__t{
  display:block;font-family:var(--fmm-font);font-weight:700;font-size:16px;
  line-height:1.3;color: var(--fmk-navy-deep);
  transition:color var(--fmm-t) var(--fmm-ease)}
.fmm-l__d{
  display:block;margin-top:1px;font-size:14px;line-height:1.45;
  color: var(--fmk-body-soft);
  transition:color var(--fmm-t) var(--fmm-ease)}
.fmm-l:hover .fmm-l__t,.fmm-l:focus-visible .fmm-l__t{color:#fff}
.fmm-l:hover .fmm-l__d,.fmm-l:focus-visible .fmm-l__d{color:rgba(248,242,230,.82)}
/* without an icon the row still lines up with its neighbours */
.fmm-l--noIcon{padding-left:16px}

/* ---------- the one picture on the right ---------- */
.fmm-pic{
  position:relative;display:block;overflow:hidden;border-radius:14px;
  text-decoration:none;background:rgba(5,71,102,.06);
  box-shadow:0 16px 36px rgba(9,32,49,.16)}
/* The picture takes its height from the links beside it, so a panel with
   two rows is short and one with six is tall. Left on a fixed 4:3 it set the
   panel height on its own and a short menu opened a sheet two-thirds empty.
   A picture with nothing beside it (.no-links) keeps the 4:3. */
.fmm-pic{min-height:224px;max-height:420px;align-self:start}
/* It stretches to match the links, but stops at 420px — on a tall panel like
   Ministries an unbounded 272px-wide picture becomes a 700px portrait sliver. */
.fmm-panel.has-pic .fmm-panel__in > .fmm-pic{height:100%}
/* The image is taken out of flow so it cannot push the panel taller than the
   links beside it — with height:100% in normal flow a tall source photo sets
   the row height itself and the sheet opens half empty. */
.fmm-pic img{position:absolute;inset:0;display:block;width:100%;height:100%;
  object-fit:cover;transition:transform .6s var(--fmm-ease)}
.fmm-panel.no-links .fmm-pic{min-height:0;aspect-ratio:4 / 3}
a.fmm-pic:hover img,a.fmm-pic:focus-visible img{transform:scale(1.04)}
.fmm-pic__scrim{position:absolute;inset:0;
  background:linear-gradient(180deg,rgba(9,32,49,0) 38%,rgba(9,32,49,.78) 100%)}
.fmm-pic__cap{
  position:absolute;left:18px;right:18px;bottom:16px;
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  font-family:var(--fmm-font);font-weight:700;font-size:17px;line-height:1.3;
  color:#fff;text-shadow:0 2px 10px rgba(0,0,0,.4)}
.fmm-pic__cap i{
  flex:0 0 auto;display:grid;place-items:center;width:34px;height:34px;
  border-radius:50%;background:var(--fmm-orange);color:#fff;font-size:13px;
  transition:transform var(--fmm-t) var(--fmm-ease)}
a.fmm-pic:hover .fmm-pic__cap i,
a.fmm-pic:focus-visible .fmm-pic__cap i{transform:translateX(4px)}
a.fmm-pic:focus-visible{outline:3px solid var(--fmm-orange);outline-offset:3px}

/* ---------- the scrim behind an open panel ---------- */
/* Below .fmm-header (9999999) on purpose — above it, the scrim swallows the
   pointer on its way into the panel and the menu flickers open and shut. */
.fmm-scrim{
  position:fixed;inset:0;background:rgba(9,32,49,.4);
  opacity:0;transition:opacity .26s var(--fmm-ease);
  z-index:9999990}
.fmm-scrim.is-on{opacity:1}

/* ==========================================================================
   MOBILE OVERLAY — below 1200px only
   ========================================================================== */
.fmm-overlay{
  position:fixed;inset:0;background:var(--fmm-navy-deep);
  overflow-y:auto;-webkit-overflow-scrolling:touch;
  opacity:0;transform:translateY(-12px);
  transition:opacity .3s var(--fmm-ease),transform .3s var(--fmm-ease);
  z-index:10000000;padding:92px 0 48px}
.fmm-overlay.is-on{opacity:1;transform:none}
body.fmm-locked{overflow:hidden}

.fmm-overlay__in{width:min(640px,calc(100% - 40px));margin:0 auto}

.fmm-ov__sec{
  width:100%;display:flex;align-items:center;justify-content:space-between;gap:14px;
  padding:17px 4px;background:none;border:0;
  border-bottom:1px solid rgba(248,242,230,.16);
  font-family:var(--fmm-font);font-weight:700;font-size:20px;
  color:#fff;text-align:left;text-decoration:none;cursor:pointer}
.fmm-ov__sec i{color:var(--fmm-orange);font-size:14px;
  transition:transform var(--fmm-t) var(--fmm-ease)}
.fmm-ov__group > .fmm-ov__sec[aria-expanded="true"] .fmm-ov__chev{transform:rotate(180deg)}
.fmm-ov__sec:focus-visible{outline:2px solid var(--fmm-orange);outline-offset:-2px}

.fmm-ov__body{padding:6px 0 14px 4px;display:flex;flex-direction:column}
.fmm-ov__l{
  padding:11px 12px;border-radius:9px;text-decoration:none;
  font-family:var(--fmm-font);font-weight:600;font-size:16.5px;
  color:rgba(248,242,230,.86);
  transition:background var(--fmm-t) var(--fmm-ease),color var(--fmm-t) var(--fmm-ease)}
.fmm-ov__l:hover,.fmm-ov__l:focus-visible{color:#fff}
.fmm-ov__hub{color:var(--fmm-orange);font-weight:800}
.fmm-ov__colh{
  margin:14px 0 4px;padding:0 12px;
  font-family:var(--fmm-font);font-weight:800;font-size:12px;
  letter-spacing:.11em;text-transform:uppercase;color:rgba(248,242,230,.55)}
.fmm-ov__cta{margin-top:26px;display:flex}
.fmm-ov__cta .greenfill{width:100%;text-align:center;padding:14px 18px;font-size:17px}

/* ==========================================================================
   BREAKPOINTS
   Eight parent links plus a 250px logo plus the button need about 1200px of
   row. Above that they all sit inline with no hamburger, which is what the
   client asked for. Below it they cannot, so the burger and the overlay take
   over — there is no version of this that fits on a phone.
   ========================================================================== */
@media (max-width:1499.98px){
  .fmm-top{font-size:16.5px}
  .fmm-header .navbar-brand{max-width:214px}
  .fmm-panel.has-pic:not(.no-links) .fmm-panel__in{grid-template-columns:minmax(0,1fr) minmax(220px,272px)}
}

/* The row has to carry a logo, eight parent links and the CTA with no
   hamburger, so between 1200 and 1400 everything steps down together rather
   than the last link sliding under the button. Measured at 1200, 1280 and
   1366: the links clear the button at every one. */
@media (max-width:1399.98px){
  .fmm-header .fmm-nav > .container{gap:clamp(8px,1vw,16px)}
  .fmm-links{gap:2px}
  .fmm-top{font-size:15.5px;padding:8px 1px}
  .fmm-caret{width:19px}
  .fmm-header .navbar-brand{max-width:190px}
  .fmm-header .greenfill{padding:8px 13px;font-size:15px;white-space:nowrap}
  .fmm-panel.has-pic:not(.no-links) .fmm-panel__in{grid-template-columns:minmax(0,1fr) minmax(206px,248px)}
}

@media (max-width:1279.98px){
  .fmm-top{font-size:14.5px}
  .fmm-caret{width:17px;font-size:10px}
  .fmm-header .navbar-brand{max-width:172px}
  .fmm-header .greenfill{padding:7px 11px;font-size:14px}
}

@media (max-width:1199.98px){
  .fmm-links{display:none}
  .fmm-panel,
  .fmm-drop{display:none}
  .fmm-burger{
    display:inline-flex;align-items:center;justify-content:center;
    width:46px;height:46px;padding:0;border:0;border-radius:12px;
    background:rgba(255,255,255,.1);color:#fff;cursor:pointer;
    transition:background var(--fmm-t) var(--fmm-ease)}
  .fmm-burger:hover,.fmm-burger:focus-visible{background:rgba(255,255,255,.18)}
  .fmm-burger:focus-visible{outline:2px solid var(--fmm-orange);outline-offset:2px}
  .fmm-burger > span{display:block;width:21px;height:15px;position:relative}
  .fmm-burger > span > span{
    position:absolute;left:0;width:100%;height:2.4px;border-radius:2px;background:#fff;
    transition:transform .3s var(--fmm-ease),opacity .2s linear,top .3s var(--fmm-ease)}
  .fmm-burger > span > span:nth-child(1){top:0}
  .fmm-burger > span > span:nth-child(2){top:6.3px}
  .fmm-burger > span > span:nth-child(3){top:12.6px}
  .fmm-burger.mm-on > span > span:nth-child(1){top:6.3px;transform:rotate(45deg)}
  .fmm-burger.mm-on > span > span:nth-child(2){opacity:0}
  .fmm-burger.mm-on > span > span:nth-child(3){top:6.3px;transform:rotate(-45deg)}
  .fmm-header .fmm-nav > .container{justify-content:space-between}
  .fmm-actions{margin-left:auto}

  /* While the overlay is open the real header is pinned ABOVE it, so the logo
     stays put and the burger — now an X — is still the thing you tap to close.
     responsive.css makes the header static at this width, which would
     otherwise bury the burger under the overlay with no way back out. */
  body.fmm-locked .fmm-header{
    position:fixed !important;top:0;left:0;width:100%;
    background:var(--fmm-navy);z-index:10000001}
	.fmm-ov__l {
    padding: 10px 0px;
    border-radius: 0px;
    text-decoration: none;
    font-family: var(--fmm-font);
    font-weight: 600;
    font-size: 16px;
    color: rgba(248,242,230,.86);
    transition: background var(--fmm-t) var(--fmm-ease),color var(--fmm-t) var(--fmm-ease);
    border-bottom: 1px solid rgba(248, 242, 230, .16);
}
	.fmm-ov__colh {
    margin: 14px 0 4px;
    padding: 0 0px;
    font-family: var(--fmm-font);
    font-weight: 800;
    font-size: 14px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #ea9822;
}
}

@media (max-width:575.98px){
  .fmm-header .navbar-brand{max-width:168px}
  .fmm-actions .sidebarsection{display:none !important}  /* the CTA repeats inside the overlay */
  .fmm-overlay{padding-top:84px}
  .fmm-ov__sec{font-size:18px;padding:15px 4px}
}

/* ==========================================================================
   MOTION PREFERENCES
   ========================================================================== */
@media (prefers-reduced-motion:reduce){
  .fmm-panel,.fmm-scrim,.fmm-overlay,.fmm-l::after,.fmm-pic img,
  .fmm-caret,.fmm-top::after,.fmm-pic__cap i,.fmm-burger > span > span{
    transition:none !important}
}

/* ==========================================================================
   PRINT
   ========================================================================== */
@media print{
  .fmm-panel,.fmm-scrim,.fmm-overlay,.fmm-burger,.fmm-caret{display:none !important}
}
