/**
 * BGSI Advisory global shell
 * Based on approved Work Revision 3 design direction.
 * Homepage-specific rules belong in the controlled homepage implementation,
 * not in this file.
 */

:root {
  --bgsi-ink: #0b1c35;
  --bgsi-blue: #173e77;
  --bgsi-bright: #2f80c9;
  --bgsi-cream: #f3f0e9;
  --bgsi-line: #cad4dc;
  --bgsi-off-white: #f9f9f7;
  --bgsi-white: #ffffff;
  --bgsi-brand-red: #e22227; /* logo / restrained accent only */
  --bgsi-shell-pad: clamp(24px, 5vw, 82px);
  --bgsi-content-pad: clamp(24px, 8vw, 128px);
}

html { scroll-behavior: smooth; }
body { background: var(--bgsi-off-white); color: var(--bgsi-ink); }

/* Accessible focus treatment from approved handoff. */
a:focus-visible,
button:focus-visible,
.wp-element-button:focus-visible {
  outline: 3px solid var(--bgsi-bright);
  outline-offset: 3px;
}

/* ----- Global BGSI header ----- */
.bgsi-site-header {
  min-height: 82px;
  border-bottom: 1px solid #d7dde1;
  background: var(--bgsi-white);
  padding: 0 var(--bgsi-shell-pad);
}

.bgsi-site-header .wp-block-site-logo img {
  width: auto;
  max-height: 54px;
  object-fit: contain;
}

.bgsi-primary-nav {
  font-size: 14px;
  font-weight: 600;
}

.bgsi-primary-nav .wp-block-navigation-item__content {
  text-decoration: none;
}

.bgsi-primary-nav .wp-block-navigation-item__content:hover {
  color: var(--bgsi-bright);
}

/* ----- Global BGSI footer ----- */
.bgsi-site-footer {
  background: #071528;
  color: var(--bgsi-white);
  padding: 56px var(--bgsi-content-pad) 32px;
}

.bgsi-site-footer a {
  color: #b9c6d5;
  text-decoration: none;
}

.bgsi-site-footer a:hover { color: var(--bgsi-white); }

.bgsi-site-footer .wp-block-site-logo img {
  width: auto;
  max-height: 52px;
  object-fit: contain;
}

.bgsi-footer-description {
  color: #bac6d4;
  font-size: 13px;
  line-height: 1.8;
}

.bgsi-footer-heading {
  color: var(--bgsi-white);
  font: 700 12px/1.4 "DM Sans", Arial, sans-serif;
  margin-bottom: 14px;
}

.bgsi-footer-links {
  font-size: 12px;
  line-height: 1.8;
}

.bgsi-footer-other-brands a {
  color: #8ea5bb;
  font-size: 11px;
}

.bgsi-footer-legal {
  border-top: 1px solid #46556a;
  margin-top: 44px;
  padding-top: 25px;
  color: #9cabbc;
  font-size: 10px;
}

.bgsi-footer-legal a { text-decoration: underline; }

@media (max-width: 900px) {
  .bgsi-site-header { min-height: 72px; padding-inline: 20px; }
  .bgsi-site-footer { padding: 48px 24px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}


/* ----- Preserved BGSI Insight Article template ----- */
.bgsi-insight-hero {
  background: var(--bgsi-white);
}

.bgsi-insight-hero > .wp-block-group:first-child {
  font-size: 14px;
}

.bgsi-insight-hero .wp-block-post-title {
  margin-top: 10px;
}

.bgsi-insight-hero .wp-block-post-featured-image img {
  display: block;
  width: 100%;
  height: auto;
}

.bgsi-insight-content {
  background: var(--bgsi-white);
}

.bgsi-insight-content > * {
  max-width: 760px;
  margin-inline: auto;
}

@media (max-width: 781px) {
  .bgsi-insight-hero .wp-block-columns {
    gap: 22px;
  }

  .bgsi-insight-hero .wp-block-post-title {
    font-size: clamp(2rem, 8vw, 2.875rem) !important;
  }
}

/* ==========================================================================\n   v0.9.3 — header/footer refinements\n   ========================================================================== */

.bgsi-footer-description {
  position: relative;
  padding-top: 18px;
  max-width: 330px;
  color: #d8e0e8;
  font-size: 13px;
  line-height: 1.75;
}

.bgsi-footer-description::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 34px;
  height: 2px;
  background: #d2b36f;
}

.bgsi-footer-description .bgsi-footer-emphasis {
  color: #e2c987;
  font-weight: 700;
}

.bgsi-copyright {
  margin: 0;
  color: inherit;
  font: inherit;
}

@media (max-width: 900px) {
  .bgsi-footer-description {
    max-width: none;
  }
}


/* ==========================================================================
   v0.9.9 — global shell mobile/zoom geometry correction
   ========================================================================== */
.bgsi-site-footer {
  box-sizing: border-box;
  width: 100dvw;
  max-width: none !important;
  margin-left: calc(50% - 50dvw) !important;
  margin-right: calc(50% - 50dvw) !important;
}

@supports not (width: 100dvw) {
  .bgsi-site-footer {
    width: 100vw;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
  }
}

@media (max-width: 900px) {
  .bgsi-site-footer {
    padding-left: max(24px, env(safe-area-inset-left));
    padding-right: max(24px, env(safe-area-inset-right));
    padding-bottom: max(28px, calc(20px + env(safe-area-inset-bottom)));
  }
}


/* ==========================================================================
   v0.9.10 — footer viewport correction
   ========================================================================== */

.bgsi-site-footer {
  position: relative;
  width: auto !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box;
  isolation: isolate;
}

.bgsi-site-footer::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  background: #07182d;
  pointer-events: none;
}

@media (max-width: 900px) {
  .bgsi-site-footer {
    padding-left: max(24px, env(safe-area-inset-left)) !important;
    padding-right: max(24px, env(safe-area-inset-right)) !important;
    padding-bottom: max(28px, calc(20px + env(safe-area-inset-bottom))) !important;
  }
}
