/* ==========================================================================
   SWMC Theme · layout.css
   Top bar, header, main navigation, mega menu, mobile menu,
   search overlay, page banner, CTA strip, footer, back-to-top
   ========================================================================== */

/* ---------- Top bar ---------- */
.topbar {
  background: var(--swmc-navy-900);
  color: rgba(255, 255, 255, .78);
  font-size: .82rem;
  padding: .45rem 0;
}
.topbar a { color: rgba(255, 255, 255, .85); }
.topbar a:hover { color: #fff; }
.topbar-info { display: flex; gap: 1.4rem; }
.topbar-info li { display: flex; align-items: center; gap: .45rem; }
.topbar-info i { color: #7FD3D6; }
.topbar-emergency {
  display: inline-flex; align-items: center; gap: .4rem;
  background: var(--swmc-red); color: #fff !important;
  padding: .22rem .75rem; border-radius: 99px; font-weight: 600;
}
.topbar-emergency:hover { background: #A61F1F; }
.topbar-social { display: flex; gap: .2rem; }
.topbar-social a {
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: background .2s;
}
.topbar-social a:hover { background: rgba(255, 255, 255, .12); }

/* ---------- Header ---------- */
.site-header {
  background: #fff;
  padding: .9rem 0;
  position: relative;
  z-index: 1030;
}
.brand { display: flex; align-items: center; gap: .9rem; color: inherit; }
.brand:hover { color: inherit; }
.brand-logo { width: 72px; height: 72px; flex-shrink: 0; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name {
  font-family: var(--font-heading); font-weight: 700;
  color: var(--swmc-navy); font-size: 1.55rem; letter-spacing: -.01em;
}
.brand-sub { font-size: .85rem; color: var(--swmc-muted); margin-top: .25rem; }
.brand-meta { font-size: .78rem; color: var(--swmc-teal-700); font-weight: 600; margin-top: .15rem; }
.header-actions { display: flex; align-items: center; gap: .75rem; }
.header-contact { align-items: center; gap: .7rem; padding-right: 1rem; margin-right: .25rem; border-right: 1px solid var(--swmc-border); }
.header-contact-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--swmc-teal-50); color: var(--swmc-teal-700);
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.header-contact-label { display: block; font-size: .75rem; color: var(--swmc-muted); }
.header-contact-value { display: block; font-weight: 700; color: var(--swmc-navy); font-size: .95rem; }

@media (max-width: 1199.98px) {
  .site-header { position: sticky; top: 0; box-shadow: var(--shadow-sm); padding: .6rem 0; }
  .brand-logo { width: 54px; height: 54px; }
  .brand-name { font-size: 1.2rem; }
  .brand-meta { display: none; }
}
@media (max-width: 575.98px) {
  .brand-logo { width: 46px; height: 46px; }
  .brand { gap: .6rem; }
  .brand-name { font-size: 1rem; }
  .brand-sub { font-size: .72rem; }
  .header-actions { gap: .4rem; }
  .btn-icon { width: 40px; height: 40px; }
}

/* ---------- Main navigation (desktop ≥1200px) ---------- */
.main-nav {
  position: sticky; top: 0; z-index: 1020;
  background: var(--swmc-navy);
  transition: box-shadow .25s var(--ease);
}
.main-nav.is-stuck { box-shadow: 0 6px 20px rgba(16, 37, 74, .25); }
.main-nav-inner { position: relative; }
.nav-menu { display: flex; justify-content: space-between; margin: 0; padding: 0; list-style: none; }
.nav-item-top { position: static; }
.nav-item-top:not(.has-mega) { position: relative; }
.nav-top-link {
  display: flex; align-items: center; gap: .3rem;
  padding: 1.05rem .7rem;
  color: rgba(255, 255, 255, .92);
  font-weight: 600; font-size: .9rem; white-space: nowrap;
  background: none; border: 0;
  position: relative;
}
.nav-top-link::after {
  content: ""; position: absolute; left: .7rem; right: .7rem; bottom: .65rem; height: 2px;
  background: #7FD3D6; border-radius: 2px; transform: scaleX(0); transform-origin: left;
  transition: transform .25s var(--ease);
}
.nav-top-link:hover, .nav-top-link:focus-visible, .has-sub.is-open > .nav-top-link { color: #fff; }
.nav-top-link:hover::after, .nav-top-link.is-active::after, .has-sub.is-open > .nav-top-link::after { transform: scaleX(1); }
.nav-top-link.is-active { color: #fff; }
.nav-caret { font-size: .7rem; transition: transform .25s var(--ease); }
.has-sub.is-open > .nav-top-link .nav-caret { transform: rotate(180deg); }

@media (max-width: 1399.98px) {
  .nav-top-link { padding-inline: .48rem; font-size: .845rem; }
  .nav-top-link::after { left: .48rem; right: .48rem; }
  .nav-item-home { display: none; }   /* the logo already links home */
}

/* shared sub-panel behaviour */
.nav-sub {
  position: absolute; top: 100%;
  background: #fff;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-lg);
  border-top: 3px solid var(--swmc-teal);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .22s var(--ease), transform .22s var(--ease), visibility .22s;
  z-index: 1040;
}
.has-sub.is-open > .nav-sub { opacity: 1; visibility: visible; transform: translateY(0); }

/* dropdown */
.dropdown-panel { left: 0; min-width: 260px; padding: .6rem; margin: 0; }
.nav-item-top:nth-last-child(-n+3) .dropdown-panel { left: auto; right: 0; }
.dropdown-link {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .8rem; border-radius: var(--radius-sm);
  color: var(--swmc-ink); font-size: .9rem; font-weight: 500;
}
.dropdown-link i { color: var(--swmc-teal); }
.dropdown-link:hover, .dropdown-link:focus-visible { background: var(--swmc-teal-50); color: var(--swmc-navy); padding-left: 1rem; }
.dropdown-divider-line { height: 1px; background: var(--swmc-border); margin: .4rem .6rem; }

/* mega menu */
.mega-panel { left: .75rem; right: .75rem; padding: 1.75rem; }
.mega-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; }
.mega-grid.has-feature { grid-template-columns: 1fr 1fr 320px; }
.mega-heading {
  font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--swmc-muted); margin: 0 0 .6rem .6rem; min-height: 1.1em;
}
.mega-link {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .55rem .6rem; border-radius: var(--radius-sm); color: var(--swmc-ink);
}
.mega-link:hover, .mega-link:focus-visible { background: var(--swmc-surface); color: var(--swmc-navy); }
.mega-icon {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 8px;
  background: var(--swmc-teal-50); color: var(--swmc-teal-700);
  display: inline-flex; align-items: center; justify-content: center;
}
.mega-link-title { display: block; font-weight: 600; font-size: .9rem; line-height: 1.3; }
.mega-link-desc { display: block; font-size: .8rem; color: var(--swmc-muted); line-height: 1.4; margin-top: .15rem; }
.mega-feature {
  display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden;
  background: var(--swmc-navy); color: #fff;
}
.mega-feature img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.mega-feature-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .3rem; }
.mega-feature-title { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 600; }
.mega-feature-text { font-size: .85rem; color: rgba(255, 255, 255, .78); }
.mega-feature .link-arrow { color: #7FD3D6; margin-top: .3rem; }
.mega-feature:hover { color: #fff; }
.mega-footer { border-top: 1px solid var(--swmc-border); margin-top: 1.2rem; padding-top: 1rem; }

/* ---------- Mobile menu (offcanvas) ---------- */
.mobile-menu { --bs-offcanvas-width: 340px; }
.mobile-menu .offcanvas-header { border-bottom: 1px solid var(--swmc-border); }
.brand-sm .brand-logo { width: 44px; height: 44px; }
.brand-sm .brand-name { font-size: 1.2rem; }
.mobile-nav { margin: 0; }
.mobile-nav > li { border-bottom: 1px solid var(--swmc-border); }
.mobile-nav-link {
  display: flex; justify-content: space-between; align-items: center; width: 100%;
  padding: .85rem .25rem; background: none; border: 0; text-align: left;
  color: var(--swmc-ink); font-weight: 600; font-size: .98rem;
}
.mobile-nav-link.is-active { color: var(--swmc-teal-700); }
.mobile-nav-toggle i { transition: transform .25s; font-size: .8rem; }
.mobile-nav-toggle[aria-expanded="true"] i { transform: rotate(180deg); }
.mobile-subnav { padding: 0 0 .7rem .6rem; margin: 0; border-left: 2px solid var(--swmc-teal-50); }
.mobile-subnav a { display: block; padding: .4rem .75rem; color: var(--swmc-body); font-size: .92rem; }
.mobile-subnav a:hover { color: var(--swmc-teal-700); }
.mobile-menu-cta { display: grid; gap: .6rem; margin-top: 1.5rem; }

/* ---------- Search overlay ---------- */
.search-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(16, 37, 74, .96);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 18vh;
  opacity: 0; transition: opacity .25s var(--ease);
}
.search-overlay.is-open { opacity: 1; }
.search-overlay-inner { max-width: 760px; }
.search-overlay-form { display: flex; gap: .6rem; }
.search-overlay-form .form-control { font-size: 1.25rem; padding: 1rem 1.25rem; border: 0; }
.search-overlay-form .btn { padding-inline: 1.4rem; font-size: 1.2rem; }
.search-close {
  position: absolute; top: 1.5rem; right: 1.5rem;
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .3);
  background: transparent; color: #fff; font-size: 1.2rem;
}
.search-close:hover { background: rgba(255, 255, 255, .12); }
.search-suggestions { margin-top: 1.25rem; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; color: rgba(255, 255, 255, .6); font-size: .88rem; }
.search-suggestions a { color: #fff; border: 1px solid rgba(255, 255, 255, .25); padding: .25rem .75rem; border-radius: 99px; }
.search-suggestions a:hover { background: rgba(255, 255, 255, .12); color: #fff; }
body.search-open { overflow: hidden; }

/* ---------- Page banner ---------- */
.page-banner {
  position: relative; overflow: hidden;
  background: var(--swmc-gradient);
  color: #fff;
  padding: 3.5rem 0 3.25rem;
}
.page-banner::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .12) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(90deg, transparent 30%, #000 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000 100%);
}
.page-banner::after {
  content: ""; position: absolute; right: -80px; top: -80px; width: 340px; height: 340px; border-radius: 50%;
  border: 50px solid rgba(255, 255, 255, .06);
}
.page-banner .container-xl { position: relative; z-index: 1; }
.page-banner-title { color: #fff; font-size: clamp(1.8rem, 3.2vw, 2.6rem); margin: .6rem 0 0; max-width: 900px; }
.page-banner-lead { color: rgba(255, 255, 255, .85); margin: .6rem 0 0; max-width: 720px; font-size: 1.05rem; }
.page-banner .breadcrumb { margin: 0; font-size: .85rem; --bs-breadcrumb-divider-color: rgba(255, 255, 255, .55); --bs-breadcrumb-item-active-color: rgba(255, 255, 255, .85); }
.page-banner .breadcrumb a { color: #fff; }
.page-banner .breadcrumb a:hover { color: #9FE3E5; }
.page-banner .breadcrumb-item + .breadcrumb-item::before { content: "›"; }

/* ---------- CTA strip ---------- */
.cta-strip { padding: 0; margin-bottom: -64px; position: relative; z-index: 2; }
.cta-strip-inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1.5rem;
  background: var(--swmc-gradient); color: #fff;
  border-radius: var(--radius-lg); padding: 2.2rem 2.5rem;
  box-shadow: var(--shadow-lg);
}
.cta-title { color: #fff; font-size: clamp(1.3rem, 2.2vw, 1.75rem); margin: 0; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--swmc-navy-900);
  color: rgba(255, 255, 255, .72);
  padding-top: calc(64px + 4rem);
  font-size: .92rem;
}
.site-footer a { color: rgba(255, 255, 255, .78); }
.site-footer a:hover { color: #fff; }
.brand-footer .brand-logo { width: 64px; height: 64px; background: #fff; border-radius: 50%; padding: 4px; }
.brand-footer .brand-name { color: #fff; font-size: 1.25rem; }
.footer-about { margin: 1.1rem 0; }
.footer-heading { color: #fff; font-family: var(--font-body); font-size: .85rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 1.1rem; }
.footer-links li { margin-bottom: .55rem; }
.footer-links a { display: inline-block; transition: transform .2s var(--ease), color .2s; }
.footer-links a:hover { transform: translateX(4px); }
.footer-contact li { display: flex; gap: .6rem; margin-bottom: .75rem; line-height: 1.5; }
.footer-contact i { color: #7FD3D6; margin-top: .15rem; }
.footer-social { display: flex; gap: .5rem; margin: 0; }
.footer-social a {
  width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .08); color: #fff; transition: background .2s, transform .2s;
}
.footer-social a:hover { background: var(--swmc-teal); transform: translateY(-2px); }
.footer-social.is-dark a { background: var(--swmc-navy-50); color: var(--swmc-navy); }
.footer-social.is-dark a:hover { background: var(--swmc-navy); color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 3rem; padding: 1.2rem 0; font-size: .82rem; color: rgba(255, 255, 255, .55); }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1010;
  width: 46px; height: 46px; border-radius: 50%; border: 0;
  background: var(--swmc-teal); color: #fff; font-size: 1.15rem;
  box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: all .25s var(--ease);
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { background: var(--swmc-navy); }
