/* ============================================================================
   nav.css — Florida First Insurance mega-menu navigation
   Loaded by every page AFTER site.css / blog.css / inline <style>, so these
   rules win where they overlap with the older `nav ul` / `nav a` styles.
   Markup lives in includes/nav.html — edit there, then run scripts/build_nav.py
   ========================================================================== */

/* ---------- top bar layout ---------- */
.nav-wrap { position: relative; gap: 0.5rem; }
.nav-brand { flex-shrink: 0; }

.ff-nav { flex: 1 1 auto; min-width: 0; }
/* site.css sets `nav ul { display: flex }` for the old nav — reset it, then
   opt the top-level row back in. Without this the mega columns run sideways. */
.ff-nav ul { display: block; list-style: none; margin: 0; padding: 0; gap: 0; }
.ff-nav ul.ff-nav-list { display: flex; align-items: center; gap: 0.1rem; }
.ff-nav li { margin: 0; }
.ff-item { position: static; }

.ff-top {
  display: flex; align-items: center; gap: 0.34rem;
  padding: 0.5rem 0.78rem; border: none; background: none; cursor: pointer;
  border-radius: 6px; font-family: inherit; font-size: 0.875rem; font-weight: 500;
  color: rgba(255,255,255,0.85); white-space: nowrap; transition: all 0.18s;
}
.ff-top:hover, .ff-item.ff-open .ff-top { color: #fff; background: rgba(255,255,255,0.12); }
.ff-top:focus-visible { outline: 2px solid #f7b731; outline-offset: 2px; }
.ff-top.ff-current { color: #fff; background: rgba(255,255,255,0.1); box-shadow: inset 0 -2px 0 #f7b731; }
.ff-chev {
  width: 9px; height: 9px; opacity: 0.75;
  border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor;
  transform: rotate(45deg) translate(-1px,-1px); transition: transform 0.2s;
}
.ff-item.ff-open .ff-chev { transform: rotate(-135deg) translate(-2px,-2px); }

.nav-cta-desktop { flex-shrink: 0; }

/* ---------- mega panels ---------- */
.ff-mega {
  position: absolute; top: calc(100% + 1px); z-index: 1200;
  display: none; background: #fff;
  border: 1px solid #e2e8f0; border-top: 3px solid #c5952c;
  border-radius: 0 0 14px 14px; box-shadow: 0 24px 48px rgba(15,23,42,0.2);
  padding: 1.5rem; max-height: calc(100vh - 96px); overflow-y: auto;
}
.ff-item.ff-open .ff-mega { display: block; animation: ffDrop 0.16s ease-out; }
@keyframes ffDrop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* wide panels span the whole nav bar so they can never overflow the viewport */
.ff-mega-wide { left: 1.25rem; right: 1.25rem; }
.ff-mega-narrow { width: 280px; padding: 0.85rem; }
.ff-mega-right { right: 1.25rem; left: auto; }

.ff-cols { display: grid; gap: 1.5rem; }
.ff-c-personal { grid-template-columns: repeat(3, 1fr) 230px; }
.ff-c-5 { grid-template-columns: repeat(5, 1fr); }

.ff-mega .ff-h {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase;
  color: #c5952c; margin: 0 0 0.55rem; padding-bottom: 0.4rem; border-bottom: 1px solid #e2e8f0;
}
.ff-mega ul + .ff-h { margin-top: 1rem; }
.ff-mega li a {
  display: block; padding: 0.29rem 0.45rem; margin-left: -0.45rem;
  border-radius: 5px; font-size: 0.83rem; font-weight: 400; color: #334155;
  background: none; transition: all 0.13s;
}
.ff-mega li a:hover { background: #eef2f9; color: #2d3e6e; transform: translateX(2px); }
.ff-mega li a:focus-visible { outline: 2px solid #2d3e6e; outline-offset: -2px; }
.ff-mega-narrow li a { padding: 0.42rem 0.55rem; font-size: 0.85rem; }

.ff-promo {
  align-self: start; border-radius: 10px; padding: 1.15rem; color: #fff;
  background: linear-gradient(150deg, #1a2744, #2d3e6e);
}
.ff-promo strong { display: block; font-size: 0.95rem; margin-bottom: 0.35rem; }
.ff-promo p { font-size: 0.78rem; line-height: 1.5; color: rgba(255,255,255,0.72); margin-bottom: 0.85rem; }
.ff-promo .ff-promo-btn {
  display: block; text-align: center; border-radius: 7px; padding: 0.5rem;
  background: linear-gradient(135deg, #c5952c, #f7b731); color: #1a2744;
  font-weight: 700; font-size: 0.8rem; margin-bottom: 0.5rem;
}
.ff-promo .ff-promo-btn:hover { background: linear-gradient(135deg, #d4a43b, #f9c84a); color: #1a2744; }
.ff-promo .ff-promo-link { display: block; font-size: 0.76rem; color: rgba(255,255,255,0.8); }
.ff-promo .ff-promo-link:hover { color: #fff; text-decoration: underline; }

.ff-mega-foot {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
  margin-top: 1.25rem; padding-top: 0.9rem; border-top: 1px solid #e2e8f0;
}
.ff-mega-foot span { font-size: 0.78rem; color: #64748b; }
.ff-mega-foot a { font-size: 0.82rem; font-weight: 600; color: #2d3e6e; }
.ff-mega-foot a:hover { text-decoration: underline; }

/* ---------- mobile accordions (inside the existing .mobile-menu drawer) ---------- */
.ff-acc { border-top: 1px solid rgba(255,255,255,0.09); }
.ff-acc-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  background: none; border: none; cursor: pointer; text-align: left;
  color: #fff; font-family: inherit; font-size: 0.95rem; font-weight: 600;
  padding: 0.9rem 1rem;
}
.ff-acc-btn:focus-visible { outline: 2px solid #f7b731; outline-offset: -2px; }
.ff-pm { position: relative; width: 14px; height: 14px; flex-shrink: 0; transition: transform 0.2s; }
.ff-pm::before, .ff-pm::after {
  content: ""; position: absolute; background: #f7b731; border-radius: 2px;
}
.ff-pm::before { left: 0; top: 6px; width: 14px; height: 2px; }
.ff-pm::after { left: 6px; top: 0; width: 2px; height: 14px; }
.ff-acc.ff-acc-open .ff-pm { transform: rotate(45deg); }

.ff-acc-body { display: none; padding: 0.1rem 0 0.6rem; background: rgba(0,0,0,0.18); }
.ff-acc.ff-acc-open .ff-acc-body { display: block; }
.ff-acc-body .ff-acc-h {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.64rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase;
  color: #f7b731; padding: 0.65rem 1rem 0.25rem; margin: 0;
}
.mobile-menu .ff-acc-body a {
  display: block; padding: 0.45rem 1rem 0.45rem 1.4rem; border-radius: 0;
  font-size: 0.88rem; font-weight: 400; color: rgba(255,255,255,0.82);
}
.mobile-menu .ff-acc-body a:hover,
.mobile-menu .ff-acc-body a:active { background: rgba(255,255,255,0.08); color: #fff; }
.mobile-menu .ff-acc-body a.ff-acc-more {
  color: #f7b731; font-weight: 600; font-size: 0.83rem; padding-left: 1rem; padding-top: 0.6rem;
}
.mobile-menu .nav-cta {
  margin-top: 0;
  background: linear-gradient(135deg, #c5952c, #f7b731);
  color: #1a2744 !important;
}

/* ---------- breakpoints ---------- */
@media (max-width: 1024px) {
  /* must out-specify `.ff-nav ul.ff-nav-list { display: flex }` above */
  .ff-nav, .ff-nav ul.ff-nav-list { display: none; }
  .nav-cta.nav-cta-desktop { display: none; }
  .nav-wrap { justify-content: space-between; }
}
@media (min-width: 1025px) {
  .mobile-menu { display: none !important; }
}
/* narrower desktops: tighten the menu so five items + phone + CTA still fit */
@media (max-width: 1240px) and (min-width: 1025px) {
  .ff-top { padding: 0.5rem 0.55rem; font-size: 0.83rem; }
  .nav-phone { font-size: 0.82rem; }
  .ff-c-personal { grid-template-columns: repeat(3, 1fr) 200px; }
}
@media (prefers-reduced-motion: reduce) {
  .ff-item.ff-open .ff-mega { animation: none; }
  .ff-mega li a:hover { transform: none; }
}

/* ============================================================================
   FOOTER — markup lives in includes/footer.html
   Overrides the older `footer h4` / `footer ul a` rules in site.css & blog.css.
   ========================================================================== */
.ff-foot-grid {
  display: grid; grid-template-columns: 1.55fr 1fr 1fr 1fr 1fr; gap: 2.25rem;
  margin-bottom: 0;
}
.ff-foot-brand .ff-foot-logo { display: inline-block; margin-bottom: 0.9rem; }
.ff-foot-brand .ff-foot-logo img { height: 46px; width: auto; filter: brightness(0) invert(1); }
.ff-foot-brand p {
  font-size: 0.83rem; line-height: 1.65; color: rgba(255,255,255,0.6);
  margin: 0 0 1.1rem; max-width: 34ch;
}

.ff-nap { font-size: 0.83rem; line-height: 1.75; color: rgba(255,255,255,0.78); }
.ff-nap div { display: flex; gap: 0.55rem; align-items: flex-start; margin-bottom: 0.4rem; }
.ff-nap svg { flex-shrink: 0; margin-top: 0.35rem; opacity: 0.7; }
.ff-nap a { color: #fff; font-weight: 600; }
.ff-nap a:hover { color: #f7b731; }
.ff-lbl { color: rgba(255,255,255,0.5); font-size: 0.78rem; font-weight: 400; }
.ff-lbl a { font-weight: 600; }

.ff-social { display: flex; gap: 0.6rem; margin-top: 1.1rem; }
.ff-social a {
  width: 34px; height: 34px; border-radius: 8px; background: rgba(255,255,255,0.09);
  display: flex; align-items: center; justify-content: center; color: #fff; transition: all 0.2s;
}
.ff-social a:hover { background: #c5952c; color: #1a2744; transform: translateY(-2px); }
.ff-social svg { fill: currentColor; }

.ff-foot-grid h4 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase;
  color: #f7b731; margin: 0 0 0.85rem;
}
.ff-foot-grid h4 a { color: inherit; }
.ff-foot-grid h4 a:hover { text-decoration: underline; }
.ff-foot-col ul { list-style: none; margin: 0; padding: 0; }
.ff-foot-col li { margin: 0; }
.ff-foot-col li a {
  display: block; padding: 0.22rem 0; font-size: 0.83rem;
  color: rgba(255,255,255,0.68); transition: color 0.15s;
}
.ff-foot-col li a:hover { color: #fff; }
.ff-foot-col .ff-more {
  display: inline-block; margin-top: 0.6rem; font-size: 0.8rem; font-weight: 600; color: #f7b731;
}
.ff-foot-col .ff-more:hover { text-decoration: underline; }
.ff-foot-sub { margin-top: 1.1rem; }

.ff-foot-bottom {
  margin-top: 2.75rem; border-top: 1px solid rgba(255,255,255,0.12);
  padding: 1.25rem 0 1.5rem; display: flex; justify-content: space-between;
  align-items: center; gap: 1rem; flex-wrap: wrap;
  font-size: 0.79rem; color: rgba(255,255,255,0.5);
}
.ff-foot-bottom a { color: rgba(255,255,255,0.62); }
.ff-foot-bottom a:hover { color: #fff; }
.ff-legal { display: flex; gap: 0.35rem; flex-wrap: wrap; align-items: center; }
.ff-legal span { opacity: 0.35; }

@media (max-width: 1024px) {
  .ff-foot-grid { grid-template-columns: 1fr 1fr 1fr; gap: 1.75rem; }
  .ff-foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .ff-foot-grid { grid-template-columns: 1fr; gap: 0; }
  .ff-foot-brand { margin-bottom: 1.5rem; }
  .ff-foot-col { border-top: 1px solid rgba(255,255,255,0.1); }
  .ff-foot-col > h4 {
    margin: 0; padding: 0.95rem 0; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center;
  }
  .ff-foot-col > h4::after { content: "+"; font-size: 1.15rem; font-weight: 400; color: #f7b731; }
  .ff-foot-col.ff-foot-open > h4::after { content: "\2013"; }
  .ff-foot-col > ul,
  .ff-foot-col > .ff-more,
  .ff-foot-col > .ff-foot-sub { display: none; }
  .ff-foot-col.ff-foot-open > ul,
  .ff-foot-col.ff-foot-open > .ff-more,
  .ff-foot-col.ff-foot-open > .ff-foot-sub { display: block; padding-bottom: 0.85rem; }
  .ff-foot-col.ff-foot-open > .ff-foot-sub > h4 { padding-top: 0.5rem; }
  .ff-foot-bottom { flex-direction: column; align-items: flex-start; text-align: left; }
}
