/* ── COMMON: Variables, reset, nav, footer ── */
:root {
  --yellow: #FFDB00;
  --blue: #0058A3;
  --dark-blue: #003E74;
  --white: #FFFFFF;
  --off-white: #F7F6F1;
  --light-gray: #ECEAE3;
  --dark: #111111;
  --mid: #5A5A5A;
  --serif: 'Playfair Display', Georgia, serif;
  --sans: 'Barlow', sans-serif;
  /* shared page width + padding so home/blogs/single-blog all align */
  --max-w-page: 1440px;
  --page-pad-x: clamp(20px, 3vw, 48px);
  /* height of top-bar + nav on index (SPA); updated by JS */
  --mbs-chrome-h: 140px;
}

/* Shared content-width — header, footer, blogs, and home sections all use this. */
.site-inner,
.page-container {
  width: 100%;
  max-width: var(--max-w-page);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--page-pad-x);
  padding-right: var(--page-pad-x);
  box-sizing: border-box;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--sans); background: var(--white); color: var(--dark); overflow-x: hidden; }

/* ── TOP BAR ── */
.top-bar {
  background: var(--dark-blue);
  color: var(--yellow);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 9px 0;
}
.top-bar .site-inner {
  text-align: center;
  padding-top: 0;
  padding-bottom: 0;
}

/* ── NAV (site header only — not blog sidebar / breadcrumb blocks) ── */
#site-chrome > nav,
body > nav:first-of-type {
  position: sticky;
  top: 0;
  z-index: 300;
  background: var(--yellow);
  box-shadow: 0 2px 16px rgba(0,0,0,0.1);
  overflow: visible;
}

.nav-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.nav-logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  color: inherit;
}

.nav-logo svg { height: 62px; width: auto; }
.footer-logo svg { height: 68px; width: auto; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-search {
  display: flex;
  align-items: center;
  background: rgba(0,62,116,0.1);
  border-radius: 24px;
  padding: 7px 16px;
  gap: 8px;
  /* desktop: expands smoothly when clicked/focused */
  transition: width 0.32s cubic-bezier(0.4, 0, 0.2, 1), background 0.22s, box-shadow 0.25s, border-color 0.22s;
  width: 220px;
  border: 1px solid transparent;
}

/* When the input gains focus, the bar grows wider, lightens, and lifts. */
.nav-search:focus-within {
  background: var(--white);
  border-color: rgba(0, 62, 116, 0.2);
  box-shadow: 0 6px 22px rgba(0, 62, 116, 0.16);
  width: min(560px, 56vw);
}

.nav-search input {
  border: none;
  background: transparent !important;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--dark-blue);
  width: 100%;
  outline: none;
  min-width: 0;
}

.nav-search input:focus,
.nav-search input:hover,
.nav-search input:active {
  background: transparent !important;
}

.nav-search input:-webkit-autofill,
.nav-search input:-webkit-autofill:hover,
.nav-search input:-webkit-autofill:focus,
.nav-search input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px rgba(0,62,116,0.1) inset !important;
  box-shadow: 0 0 0 30px rgba(0,62,116,0.1) inset !important;
  -webkit-text-fill-color: var(--dark-blue);
  transition: background-color 5000s ease-in-out 0s;
}

.nav-search input::placeholder { color: rgba(0,62,116,0.5); }
.nav-search svg { width: 16px; height: 16px; stroke: var(--dark-blue); fill: none; stroke-width: 2; flex-shrink: 0; }

.nav-search-wrap { position: relative; min-width: 0; }
/* On mobile (when .nav-search would normally be hidden), .nav-search-expanded
   floats the search as a full-width bar under the nav. Desktop uses :focus-within instead. */
.nav-search.nav-search-expanded {
  position: fixed;
  left: 16px;
  right: 16px;
  top: 80px;
  z-index: 300;
  max-width: 720px;
  margin: 0 auto;
  background: white;
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.18);
}
.nav-search-expanded input { width: 100% !important; min-width: 0; font-size: 15px !important; }
.nav-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  max-height: 320px;
  overflow-y: auto;
  display: none;
  z-index: 400;
}
.nav-suggestions.open { display: block; }
.nav-suggestions button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border: none;
  background: none;
  font-family: var(--sans);
  font-size: 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--light-gray);
}
.nav-suggestions button:hover { background: var(--off-white); }
.nav-suggestions .sug-type { font-size: 10px; text-transform: uppercase; color: var(--mid); letter-spacing: 0.05em; }

.nav-cta {
  background: var(--dark-blue);
  color: var(--yellow);
  padding: 9px 22px;
  border: none;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.2s;
  text-decoration: none;
  display: inline-block;
}

.nav-cta:hover { background: var(--blue); }

/* ── CATEGORIES NAV BAR ── */
.cat-nav {
  background: var(--white);
  border-bottom: 2px solid var(--light-gray);
  position: sticky;
  top: 70px;
  z-index: 299;
  overflow: visible;
}

.cat-nav-inner {
  display: flex;
  align-items: stretch;
  overflow: visible;
  scrollbar-width: none;
}

.cat-nav-inner::-webkit-scrollbar { display: none; }

.cat-nav-all-posts {
  margin-left: auto;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px 10px 18px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--dark-blue);
  text-decoration: none;
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid rgba(0, 62, 116, 0.16);
  background: linear-gradient(
    162deg,
    rgba(255, 219, 0, 0.42) 0%,
    rgba(255, 232, 120, 0.22) 38%,
    rgba(255, 255, 255, 0.97) 100%
  );
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 6px 18px rgba(0, 62, 116, 0.08);
  position: relative;
  transition: color 0.2s, border-color 0.2s, box-shadow 0.22s, transform 0.18s;
}

.cat-nav-all-posts::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 34px;
  background: linear-gradient(
    180deg,
    rgba(0, 62, 116, 0) 0%,
    rgba(0, 62, 116, 0.18) 50%,
    rgba(0, 62, 116, 0) 100%
  );
  pointer-events: none;
}

.cat-nav-all-posts__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  flex-shrink: 0;
  transition: color 0.2s, transform 0.2s;
}

.cat-nav-all-posts__text {
  position: relative;
  top: 0.5px;
}

.cat-nav-all-posts:hover {
  color: var(--blue);
  border-color: rgba(0, 88, 163, 0.38);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 10px 28px rgba(0, 62, 116, 0.14);
  transform: translateY(-1px);
  text-decoration: none;
}

.cat-nav-all-posts:hover .cat-nav-all-posts__icon {
  color: var(--dark-blue);
  transform: scale(1.05);
}

.cat-nav-all-posts:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.cat-nav-all-posts:active {
  transform: translateY(0);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75) inset,
    0 3px 10px rgba(0, 62, 116, 0.1);
}

.cat-nav-item {
  position: relative;
  flex-shrink: 0;
  overflow: visible;
}

.cat-nav-btn {
  background: none;
  border: none;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--dark);
  padding: 16px 20px;
  cursor: pointer;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.cat-nav-btn:hover,
.cat-nav-item.active .cat-nav-btn {
  color: var(--blue);
  border-bottom-color: var(--yellow);
}

.cat-nav-btn .chevron { font-size: 10px; transition: transform 0.2s; }
.cat-nav-item:hover .chevron,
.cat-nav-item.active .chevron { transform: rotate(180deg); }

/* Dropdown visibility is controlled by JS (inline style). .active for chevron state. */

.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 1px solid var(--light-gray);
  border-top: 3px solid var(--yellow);
  min-width: 200px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12);
  z-index: 10050;
  border-radius: 0 0 4px 4px;
}

/* Portaled menu (fixed to viewport) — always above iframe + breadcrumbs */
#mbs-dropdown-portal {
  position: relative;
  z-index: 2147483000;
  pointer-events: none;
}
.dropdown.mbs-nav-dropdown {
  pointer-events: auto;
  z-index: 2147483000 !important;
  box-shadow: 0 16px 48px rgba(0, 62, 116, 0.18);
}

/* SPA: blog pages load in iframe directly under site chrome (document flow — avoids clipping) */
#app-frame {
  display: none;
  width: 100%;
  border: none;
  background: var(--off-white);
  vertical-align: top;
}
#app-frame.is-visible {
  display: block;
  height: calc(100vh - var(--mbs-chrome-h));
  height: calc(100dvh - var(--mbs-chrome-h));
  min-height: 480px;
}

/* Inside iframe: parent already shows header — hide duplicate nav */
html.mbs-embedded .top-bar,
html.mbs-embedded nav {
  display: none !important;
}
html.mbs-embedded body {
  padding-top: 0 !important;
}

.dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  text-decoration: none;
  font-size: 13px;
  color: var(--dark);
  font-weight: 400;
  transition: background 0.15s, color 0.15s;
  border-bottom: 1px solid var(--light-gray);
}

.dropdown a:last-child { border-bottom: none; }
.dropdown a:hover { background: var(--off-white); color: var(--blue); }
.dropdown a .icon { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }
.dropdown a .nav-cat-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--mid);
  background: var(--off-white);
  border-radius: 999px;
  padding: 2px 8px;
  min-width: 1.4em;
  text-align: center;
}

/* ── FOOTER ── */
footer {
  background: var(--dark);
  color: white;
  padding: 64px 0 32px;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-brand p {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  line-height: 1.7;
  font-weight: 300;
  margin-bottom: 24px;
}

.socials { display: flex; gap: 10px; }

.socials a {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 16px;
  transition: background 0.2s;
}

.socials a:hover { background: var(--yellow); }

.footer-col h5 {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--yellow);
  margin-bottom: 20px;
}

.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 9px; }

.footer-col ul li a {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  font-weight: 300;
  transition: color 0.2s;
}

.footer-col ul li a:hover { color: white; }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-bottom p { font-size: 12px; color: rgba(255,255,255,0.3); }

.footer-bottom-links { display: flex; gap: 22px; }

.footer-bottom-links a {
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-bottom-links a:hover { color: rgba(255,255,255,0.7); }

/* ── BUTTONS (shared) ── */
.btn-primary {
  background: var(--dark-blue);
  color: var(--yellow);
  padding: 14px 32px;
  border: none;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
  display: inline-block;
  border-radius: 2px;
}

.btn-primary:hover { background: var(--blue); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--dark-blue);
  padding: 13px 32px;
  border: 2px solid var(--dark-blue);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-block;
  border-radius: 2px;
}

.btn-outline:hover { background: var(--dark-blue); color: var(--yellow); }

/* ── MOBILE HAMBURGER ── */
.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 26px;
  color: var(--dark-blue);
  cursor: pointer;
  padding: 8px;
  align-items: center;
  justify-content: center;
}

/* ── RESPONSIVE: common (nav, footer, cat-nav) ── */
@media (max-width: 1024px) {
  .nav-main { height: 64px; }
  .nav-logo svg { height: 52px; }
  .nav-right { gap: 20px; }
  .nav-search { width: 180px; }
  .nav-search:focus-within { width: min(420px, 50vw); }
  .cat-nav-btn { padding: 14px 16px; font-size: 12px; }
  footer { padding: 48px 0 24px; }
  .footer-top { grid-template-columns: 1fr 1fr 1fr; gap: 32px; margin-bottom: 40px; padding-bottom: 40px; }
  .footer-bottom { flex-wrap: wrap; gap: 16px; justify-content: center; text-align: center; }
  .footer-bottom-links { flex-wrap: wrap; justify-content: center; }
}

@media (max-width: 900px) {
  .nav-search,
  .nav-cta { display: none; }
  .hamburger { display: flex; }
  .nav-main { height: 60px; }
  .nav-logo svg { height: 48px; }
  .cat-nav { top: 60px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cat-nav-btn { padding: 12px 14px; font-size: 11.5px; }
  .cat-nav-all-posts {
    padding: 9px 16px 9px 14px;
    gap: 8px;
    font-size: 11px;
    letter-spacing: 0.09em;
  }
  .cat-nav-all-posts::before { left: -16px; height: 30px; }
  .cat-nav-all-posts__icon svg { width: 18px; height: 18px; }
  footer { padding: 40px 0 20px; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 28px; margin-bottom: 32px; padding-bottom: 32px; }
  .footer-brand p { font-size: 12px; margin-bottom: 16px; }
  .footer-col h5 { margin-bottom: 14px; font-size: 10px; }
}

@media (max-width: 600px) {
  .nav-main { height: 56px; }
  .nav-logo svg { height: 44px; }
  .cat-nav { top: 56px; }
  .cat-nav-btn { padding: 12px 12px; font-size: 11px; }
  .cat-nav-all-posts {
    padding: 8px 14px 8px 11px;
    font-size: 10.5px;
    letter-spacing: 0.07em;
  }
  .cat-nav-all-posts::before { left: -12px; height: 26px; opacity: 0.85; }
  footer { padding: 32px 0 16px; }
  .footer-top { grid-template-columns: 1fr; gap: 24px; text-align: center; }
  .footer-brand p { text-align: center; }
  .socials { justify-content: center; }
  .footer-col ul li a { font-size: 12px; }
  .footer-bottom p,
  .footer-bottom-links a { font-size: 11px; }
}

@media (max-width: 480px) {
  .top-bar { font-size: 10px; padding: 8px 0; }
  .nav-main { height: 52px; }
  .nav-logo svg { height: 40px; }
}
