/* ============================================================
   MicroHub — Shared components
   Navbar sizing · Floating WhatsApp button · Newsletter section
   Loaded on every page AFTER the page stylesheet.
   ============================================================ */

:root {
  --nav-h: 90px;
  --mh-primary: #0877c9;
  --mh-primary-dark: #05589a;
  --mh-dark: #0b1220;
}

/* ---------- 1. NAVBAR (taller, roomier, sticky) ---------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  width: 100%;
}
.navbar-container {
  height: 90px;
  padding-top: 0;
  padding-bottom: 0;
  gap: 28px;
}
.navbar .logo { display: flex; align-items: center; }
.navbar .logo-text { font-size: 27px; letter-spacing: -1.2px; }
.navbar .logo-img { height: 100px !important; }
.navbar .logo,
.navbar .logo-text { transition: transform .35s cubic-bezier(.22,1,.36,1), opacity .3s ease; }
.navbar .logo:hover .logo-text,
.navbar .logo:hover .logo-img { transform: translateY(-1px) scale(1.04); }

.navbar .nav-menu { gap: 40px; }
.navbar .nav-menu > a,
.navbar .nav-item > a {
  position: relative;
  font-size: 15px;
  padding: 12px 0;
  display: inline-flex;
  align-items: center;
  transition: color .3s ease;
}
.navbar .nav-menu > a::after,
.navbar .nav-item > a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 4px;
  height: 2px; width: 100%;
  background: var(--mh-primary);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .35s cubic-bezier(.22,1,.36,1);
}
.navbar .nav-menu > a:hover::after,
.navbar .nav-item:hover > a::after,
.navbar .nav-menu > a.active::after,
.navbar .nav-item > a.active::after { transform: scaleX(1); transform-origin: left; }
.navbar .nav-menu > a.active,
.navbar .nav-item > a.active { color: var(--mh-primary); }
.navbar .dropdown-menu a.active { color: var(--mh-primary); font-weight: 700; }

.navbar .nav-actions { gap: 18px; }
.navbar .nav-actions .primary-btn.small,
.navbar .nav-actions .secondary-btn.small {
  padding: 15px 26px;
  font-size: 13px;
  border-radius: 10px;
}
.navbar .dropdown-menu { top: calc(100% - 8px); }

/* keep page content clear of the taller bar */
body { --nav-h: 90px; }

@media (max-width: 1180px) {
  .navbar .nav-menu { gap: 26px; }
  .navbar .nav-menu > a, .navbar .nav-item > a { font-size: 14px; }
}
@media (max-width: 980px) {
  .navbar-container { height: 78px; }
  .navbar .logo-text { font-size: 23px; }
}

/* ---------- 2. FLOATING WHATSAPP BUTTON ---------- */
.mh-whatsapp {
  position: fixed;
  right: 30px;
  bottom: 30px;
  z-index: 4000;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #35d367, #1faf52);
  box-shadow: 0 10px 28px rgba(37,211,102,.45), 0 0 0 0 rgba(37,211,102,.45);
  animation: mh-wa-pulse 2.8s infinite;
  transition: transform .3s cubic-bezier(.22,1,.36,1), box-shadow .3s ease;
}
.mh-whatsapp svg { width: 30px; height: 30px; fill: #fff; }
.mh-whatsapp:hover {
  transform: scale(1.1);
  box-shadow: 0 16px 38px rgba(37,211,102,.6);
}
@keyframes mh-wa-pulse {
  0%   { box-shadow: 0 10px 28px rgba(37,211,102,.45), 0 0 0 0 rgba(37,211,102,.45); }
  70%  { box-shadow: 0 10px 28px rgba(37,211,102,.45), 0 0 0 18px rgba(37,211,102,0); }
  100% { box-shadow: 0 10px 28px rgba(37,211,102,.45), 0 0 0 0 rgba(37,211,102,0); }
}
@media (max-width: 600px) {
  .mh-whatsapp { right: 18px; bottom: 18px; width: 54px; height: 54px; }
  .mh-whatsapp svg { width: 27px; height: 27px; }
}

/* ---------- 3. NEWSLETTER SECTION (below the footer) ---------- */
.mh-newsletter {
  width: 100%;
  padding: 60px clamp(18px, 5vw, 60px);
  background: var(--mh-dark);
  font-family: 'Inter', system-ui, sans-serif;
}
.mh-newsletter-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(38px, 5vw, 60px);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255,255,255,.09), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(18px);
  box-shadow: 0 30px 70px rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .8s cubic-bezier(.22,1,.36,1), transform .8s cubic-bezier(.22,1,.36,1);
}
.mh-newsletter-inner.is-visible { opacity: 1; transform: translateY(0); }

.mh-newsletter-copy { flex: 1 1 380px; min-width: 280px; }
.mh-newsletter-copy h2 {
  font-size: clamp(26px, 3.2vw, 40px);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.15;
  color: #fff;
  margin: 0 0 12px;
}
.mh-newsletter-copy p {
  font-size: 16px;
  line-height: 1.65;
  color: rgba(255,255,255,.72);
  margin: 0;
  max-width: 520px;
}
.mh-newsletter-form {
  flex: 0 1 520px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.mh-newsletter-form input[type="email"] {
  flex: 1 1 260px;
  min-width: 0;
  height: 58px;
  padding: 0 20px;
  font-family: inherit;
  font-size: 15px;
  color: #fff;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px;
  outline: none;
  transition: border-color .3s ease, background .3s ease, box-shadow .3s ease;
}
.mh-newsletter-form input[type="email"]::placeholder { color: rgba(255,255,255,.5); }
.mh-newsletter-form input[type="email"]:focus {
  border-color: #48a9f8;
  background: rgba(255,255,255,.11);
  box-shadow: 0 0 0 4px rgba(72,169,248,.18);
}
.mh-newsletter-form button {
  height: 58px;
  padding: 0 34px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .5px;
  color: #fff;
  background: var(--mh-primary);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .35s cubic-bezier(.22,1,.36,1), box-shadow .35s ease, background .3s ease;
}
.mh-newsletter-form button:hover {
  background: var(--mh-primary-dark);
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 16px 34px rgba(8,119,201,.55), 0 0 24px rgba(72,169,248,.45);
}
.mh-newsletter-form button:active { transform: translateY(-1px) scale(1.01); }
.mh-newsletter-note {
  flex: 1 1 100%;
  font-size: 13px;
  color: #6ee7a0;
  margin: 0;
  min-height: 0;
}

@media (max-width: 1024px) {
  .mh-newsletter-inner { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 32px; }
  .mh-newsletter-copy { flex: 0 0 auto; width: 100%; }
  .mh-newsletter-form { width: 100%; flex: 0 0 auto; }
}
@media (max-width: 640px) {
  .mh-newsletter { padding: 44px 16px; }
  .mh-newsletter-inner { align-items: center; text-align: center; border-radius: 24px; }
  .mh-newsletter-copy p { margin: 0 auto; }
  .mh-newsletter-form { flex-direction: column; }
  .mh-newsletter-form input[type="email"],
  .mh-newsletter-form button { width: 100%; flex: 1 1 auto; }
}

/* ---------- 4. Simple shared inner-page shell (about / insights / contact / legal) ---------- */
.mh-page { padding: calc(var(--nav-h) + 70px) clamp(18px, 5vw, 40px) 90px; max-width: 1100px; margin: 0 auto; }
.mh-page .mh-eyebrow { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; letter-spacing: 2px; color: var(--mh-primary); }
.mh-page h1 { font-size: clamp(32px, 5vw, 54px); font-weight: 800; letter-spacing: -1.5px; line-height: 1.1; margin: 14px 0 18px; }
.mh-page h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; letter-spacing: -.8px; margin: 46px 0 14px; }
.mh-page p { font-size: 16px; line-height: 1.75; color: #5a6472; max-width: 780px; }
.mh-page ul { margin: 14px 0; padding-left: 20px; color: #5a6472; line-height: 1.9; }
.mh-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; margin-top: 30px; }
.mh-card { padding: 26px; border: 1px solid #e8eaee; border-radius: 18px; background: #fff; box-shadow: 0 10px 30px rgba(15,25,45,.05); transition: transform .35s cubic-bezier(.22,1,.36,1), box-shadow .35s ease; }
.mh-card:hover { transform: translateY(-6px); box-shadow: 0 22px 46px rgba(15,25,45,.1); }
.mh-card h3 { font-size: 18px; font-weight: 700; margin: 0 0 8px; }
.mh-card p { font-size: 14.5px; margin: 0; }

/* ============================================================
   AUDIT PASS — navbar/footer consistency, mobile menu fallback,
   legal (privacy / terms) pages. Uses the existing components,
   only adds the missing behaviour styling.
   ============================================================ */

/* --- sticky navbar shadow state (set by js/include.js) --- */
header.navbar.is-stuck { background: rgba(255,255,255,0.97); box-shadow: 0 10px 30px rgba(15,23,42,0.08); border-bottom-color: #ececec; }

/* --- mobile menu fallback for pages without the JS drawer --- */
@media (max-width: 1120px) {
  header.navbar .nav-menu.open {
    display: flex; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    padding: 14px 18px 22px; background: #fff;
    border-top: 1px solid #ececec; box-shadow: 0 24px 40px rgba(15,23,42,0.10);
    max-height: calc(100vh - var(--nav-h, 72px)); overflow-y: auto;
  }
  header.navbar .nav-menu.open > a,
  header.navbar .nav-menu.open .nav-item > a { display: block; padding: 12px 10px; border-radius: 10px; font-size: 15px; }
  header.navbar .nav-menu.open .nav-item { position: static; }
  header.navbar .nav-menu.open .dropdown-menu {
    position: static; width: auto; opacity: 1; visibility: visible; transform: none;
    display: none; border: 0; box-shadow: none; padding: 0 0 8px 12px;
  }
  header.navbar .nav-menu.open .nav-item.dropdown.open .dropdown-menu { display: block; }
}

/* --- active navigation state (set by shared/microhub-shared.js) --- */
header.navbar a.active { color: var(--primary, #1668dc); }
header.navbar .nav-menu > a.active,
header.navbar .nav-item > a.active { position: relative; }
header.navbar .nav-menu > a.active::after,
header.navbar .nav-item > a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px;
  border-radius: 2px; background: var(--primary, #1668dc);
}

/* --- footer polish (same design, fixes icons + wrapping) --- */
footer .social-icons { display: flex; gap: 10px; margin-top: 16px; }
footer .social-icons a {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(255,255,255,0.10); color: #fff; font-size: 15px;
  transition: transform .25s ease, background .25s ease;
}
footer .social-icons a:hover { transform: translateY(-3px); background: var(--primary, #1668dc); }
footer .footer-brand .logo-img { max-width: 180px; height: auto; border-radius: 8px; }
footer .footer-bottom { flex-wrap: wrap; row-gap: 8px; }

/* ============================================================
   LEGAL PAGES (privacy.html / terms.html)
   ============================================================ */
.mh-legal { padding-top: calc(var(--nav-h, 72px) + 0px); }
.mh-legal-hero {
  position: relative; overflow: hidden; padding: 72px 0 88px;
  background:
    radial-gradient(900px 420px at 10% 0%, rgba(37,99,235,.16), transparent 60%),
    radial-gradient(700px 380px at 90% 10%, rgba(6,182,212,.14), transparent 62%),
    linear-gradient(180deg, #EEF4FF 0%, #F8FAFC 100%);
}
.mh-legal-hero-inner { max-width: 1180px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 28px); }
.mh-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #64748B; margin-bottom: 18px; }
.mh-breadcrumb a { color: #64748B; }
.mh-breadcrumb a:hover { color: var(--primary, #1668dc); }
.mh-breadcrumb span[aria-current] { color: var(--primary, #1668dc); }
.mh-legal-hero h1 { font-size: clamp(30px, 4.6vw, 50px); line-height: 1.1; margin: 10px 0 14px; letter-spacing: -0.02em; }
.mh-legal-hero p { color: #475569; font-size: clamp(15px, 1.8vw, 17px); line-height: 1.75; max-width: 760px; margin: 0; }
.mh-legal-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.mh-legal-meta span {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: #fff; border: 1px solid rgba(15,23,42,.08); font-size: 12.5px; font-weight: 700; color: #334155;
}

.mh-legal-body { max-width: 1180px; margin: 0 auto; padding: clamp(40px, 6vw, 72px) clamp(18px, 4vw, 28px) clamp(56px, 8vw, 96px); }
.mh-legal-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
.mh-legal-toc { position: sticky; top: calc(var(--nav-h, 72px) + 20px); background: #fff; border: 1px solid rgba(15,23,42,.08); border-radius: 20px; padding: 22px; box-shadow: 0 18px 40px -28px rgba(15,23,42,.35); }
.mh-legal-toc strong { display: block; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--primary, #1668dc); margin-bottom: 12px; }
.mh-legal-toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; counter-reset: toc; }
.mh-legal-toc a { display: block; padding: 8px 10px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: #475569; }
.mh-legal-toc a:hover { background: rgba(37,99,235,.07); color: var(--primary, #1668dc); }

.mh-legal-highlights { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 34px; }
.mh-legal-highlight { background: #fff; border: 1px solid rgba(15,23,42,.08); border-radius: 18px; padding: 22px; box-shadow: 0 16px 36px -30px rgba(15,23,42,.5); }
.mh-legal-highlight i { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: rgba(37,99,235,.10); color: var(--primary, #1668dc); margin-bottom: 12px; }
.mh-legal-highlight h3 { font-size: 15.5px; margin: 0 0 6px; }
.mh-legal-highlight p { margin: 0; font-size: 13.5px; line-height: 1.65; color: #64748B; }

.mh-legal-card { background: #fff; border: 1px solid rgba(15,23,42,.08); border-radius: 22px; padding: clamp(22px, 3vw, 34px); margin-bottom: 18px; box-shadow: 0 20px 44px -34px rgba(15,23,42,.5); scroll-margin-top: calc(var(--nav-h, 72px) + 24px); }
.mh-legal-card > h2 { display: flex; align-items: center; gap: 12px; font-size: clamp(19px, 2.3vw, 24px); margin: 0 0 14px; letter-spacing: -0.01em; }
.mh-legal-card > h2 em { font-style: normal; display: grid; place-items: center; min-width: 34px; height: 34px; border-radius: 11px; font-size: 14px; font-weight: 800; background: linear-gradient(135deg, #2563EB, #06B6D4); color: #fff; }
.mh-legal-card p { color: #475569; font-size: 15.5px; line-height: 1.8; margin: 0 0 12px; }
.mh-legal-card ul { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 10px; }
.mh-legal-card ul li { position: relative; padding-left: 30px; color: #475569; font-size: 15px; line-height: 1.7; }
.mh-legal-card ul li::before {
  content: "\f00c"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 10px;
  position: absolute; left: 0; top: 3px; width: 20px; height: 20px; border-radius: 6px;
  display: grid; place-items: center; background: rgba(37,99,235,.10); color: var(--primary, #1668dc);
}
.mh-legal-cta {
  margin-top: 26px; border-radius: 22px; padding: clamp(24px, 3.4vw, 38px);
  background: linear-gradient(120deg, #0F172A, #1E3A8A 60%, #0E7490); color: #fff;
  display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between;
}
.mh-legal-cta h2 { margin: 0 0 6px; font-size: clamp(19px, 2.4vw, 26px); }
.mh-legal-cta p { margin: 0; color: rgba(255,255,255,.82); font-size: 14.5px; }
.mh-legal-cta .mh-legal-cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.mh-legal-cta a { display: inline-flex; align-items: center; gap: 8px; padding: 13px 22px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.mh-legal-cta a.is-solid { background: #fff; color: #0F172A; }
.mh-legal-cta a.is-ghost { border: 1px solid rgba(255,255,255,.42); color: #fff; }

@media (max-width: 980px) {
  .mh-legal-grid { grid-template-columns: 1fr; }
  .mh-legal-toc { position: static; }
}
