/* ==========================================================
   JCHD Footer Pack for Gantry 5
   Shared styles for six independent footer particles.
   Theme-aware via the existing --site-* variables.
   ========================================================== */

.jchd-footer {
  --jf-accent: var(--site-primary, #376fe6);
  --jf-accent-hover: var(--site-primary-hover, #5b83f0);
  --jf-text: var(--site-text, #25272d);
  --jf-muted: var(--site-muted, #666c77);
  --jf-heading: var(--site-heading, #1f2228);
  --jf-border: var(--site-border, rgba(31,34,40,.14));
  --jf-surface: var(--site-surface, #fff);
  --jf-surface-alt: var(--site-surface-alt, #f4f5f7);
  color: var(--jf-text);
  min-width: 0;
  height: 100%;
  font-size: 14px;
  line-height: 1.58;
}

/* Footer follows the active site theme. The former version forced a dark
   footer in both modes, which made headings and links unreadable in light mode. */
#g-footer {
  background: var(--site-surface, #f8fafc);
  color: var(--site-text, #25272d);
  border-top: 1px solid var(--site-border, rgba(31,34,40,.12));
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}

#g-footer .jchd-footer {
  --jf-text: var(--site-text, #25272d);
  --jf-muted: var(--site-muted, #667085);
  --jf-heading: var(--site-heading, #1f2228);
  --jf-border: var(--site-border, rgba(31,34,40,.14));
  --jf-surface: var(--site-surface, #ffffff);
  --jf-surface-alt: var(--site-surface-alt, #f1f4f8);
}

html[data-theme="dark"] #g-footer,
body.dark-mode #g-footer,
body.theme-dark #g-footer {
  background: var(--site-footer-bg, #111319);
  color: rgba(255,255,255,.92);
  border-top-color: rgba(255,255,255,.10);
}

html[data-theme="dark"] #g-footer .jchd-footer,
body.dark-mode #g-footer .jchd-footer,
body.theme-dark #g-footer .jchd-footer,
.jchd-footer-region--dark .jchd-footer {
  --jf-text: rgba(255,255,255,.92);
  --jf-muted: rgba(255,255,255,.66);
  --jf-heading: #ffffff;
  --jf-border: rgba(255,255,255,.13);
  --jf-surface: #171a21;
  --jf-surface-alt: rgba(255,255,255,.055);
}

html[data-theme="light"] #g-footer,
body.theme-light #g-footer {
  background: var(--site-surface, #f8fafc);
  color: var(--site-text, #25272d);
  border-top-color: var(--site-border, rgba(31,34,40,.12));
}

.jchd-footer__title {
  position: relative;
  margin: 0 0 14px;
  padding: 0 0 10px;
  color: var(--jf-heading);
  font-size: 15px;
  line-height: 1.3;
  font-weight: 750;
  letter-spacing: .01em;
}

.jchd-footer__title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 34px;
  height: 2px;
  border-radius: 99px;
  background: var(--jf-accent);
}

.jchd-footer--divider {
  position: relative;
  padding-left: clamp(16px, 2vw, 28px);
}

.jchd-footer--divider::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--jf-border);
}

.jchd-footer__description {
  max-width: 30rem;
  margin-top: 14px;
  color: var(--jf-muted);
  font-size: 13px;
}

.jchd-footer__brand-link {
  display: inline-flex;
  align-items: center;
  color: var(--jf-heading);
  text-decoration: none;
}

.jchd-footer__logo {
  display: block;
  width: auto;
  max-width: var(--jchd-footer-logo-width, 190px);
  max-height: 56px;
  object-fit: contain;
}

#g-footer .jchd-footer__logo { filter: none; opacity: 1; }
html[data-theme="dark"] #g-footer .jchd-footer__logo,
body.dark-mode #g-footer .jchd-footer__logo,
body.theme-dark #g-footer .jchd-footer__logo,
.jchd-footer-region--dark .jchd-footer__logo { filter: brightness(0) invert(1); opacity: .96; }

.jchd-footer__site-name {
  color: var(--jf-heading);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.jchd-footer__socials {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 17px;
}

.jchd-footer--align-center .jchd-footer__socials { justify-content: center; }
.jchd-footer--align-right .jchd-footer__socials { justify-content: flex-end; }
.jchd-footer--align-center { text-align: center; }
.jchd-footer--align-right { text-align: right; }

.jchd-footer__social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--jf-border);
  border-radius: 50%;
  background: var(--jf-surface-alt);
  color: var(--jf-text);
  text-decoration: none;
  transition: color .18s ease, border-color .18s ease, background-color .18s ease, transform .18s ease;
}

.jchd-footer__social:hover,
.jchd-footer__social:focus-visible {
  color: #fff;
  border-color: var(--jf-accent);
  background: var(--jf-accent);
  transform: translateY(-2px);
  outline: none;
}


.jchd-footer__links,
.jchd-footer__contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.jchd-footer__link-item + .jchd-footer__link-item { margin-top: 4px; }

.jchd-footer__link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  color: var(--jf-muted);
  text-decoration: none;
  transition: color .16s ease, transform .16s ease;
}

.jchd-footer__link:hover,
.jchd-footer__link:focus-visible {
  color: var(--jf-accent-hover);
  transform: translateX(3px);
  outline: none;
}

.jchd-footer__link i { width: 1em; color: var(--jf-accent); text-align: center; }

.jchd-footer__contact-list { display: grid; gap: 9px; }
.jchd-footer__contact-row { display: grid; grid-template-columns: 20px minmax(0,1fr); gap: 9px; align-items: start; }
.jchd-footer__contact-row dt { margin: 0; color: var(--jf-muted); text-align: center; }
.jchd-footer__contact-row dd { margin: 0; min-width: 0; color: var(--jf-muted); overflow-wrap: anywhere; }
.jchd-footer__contact-row a { color: inherit; text-decoration: none; }
.jchd-footer__contact-row a:hover { color: var(--jf-accent-hover); }
.jchd-footer__meta-separator { margin: 0 6px; opacity: .65; }

.jchd-footer__map-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: var(--jchd-map-ratio, 16 / 9);
  border: 1px solid var(--jf-border);
  border-radius: 13px;
  background: var(--jf-surface-alt);
  box-shadow: 0 10px 28px rgba(0,0,0,.12);
}

.jchd-footer__map-frame > a,
.jchd-footer__map-frame iframe,
.jchd-footer__map-frame img {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.jchd-footer__map-frame img { object-fit: cover; transition: transform .28s ease; }
.jchd-footer__map-frame a:hover img { transform: scale(1.025); }
.jchd-footer__map-placeholder { display:flex; flex-direction:column; gap:8px; align-items:center; justify-content:center; width:100%; height:100%; padding:18px; color:var(--jf-muted); text-align:center; }
.jchd-footer__map-placeholder i { color:var(--jf-accent); font-size:24px; }
.jchd-footer__map-caption { margin-top: 9px; color: var(--jf-muted); font-size: 12px; }

/* Accessibility helper, independent of Bootstrap version. */
.jchd-footer .sr-only { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; border:0!important; }

@media (max-width: 1024px) {
  .jchd-footer--divider { padding-left: 18px; }
  .jchd-footer { font-size: 13.5px; }
}

@media (max-width: 767px) {
  .jchd-footer { padding: 4px 0; }
  .jchd-footer--divider { padding-left: 0; padding-top: 18px; }
  .jchd-footer--divider::before { left:0; right:0; top:0; bottom:auto; width:auto; height:1px; }
  .jchd-footer__title { margin-bottom: 10px; }
  .jchd-footer__link { min-height: 34px; }
  .jchd-footer__social { width: 40px; height: 40px; }
  .jchd-footer__map-frame { max-height: 240px; }
}

@media (prefers-reduced-motion: reduce) {
  .jchd-footer *, .jchd-footer *::before, .jchd-footer *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ==========================================================
   v3 – definitive light/dark theme mapping
   The site switches theme on <html data-theme="light|dark">.
   Use explicit footer tokens so inherited site variables cannot leave a
   dark section background combined with light-theme text colors.
   ========================================================== */

html[data-theme="light"] body #g-footer,
html:not([data-theme="dark"]) body #g-footer {
  background-color: #f8fafc !important;
  background-image: none !important;
  color: #25272d !important;
  border-top-color: rgba(31, 34, 40, .12) !important;
}

html[data-theme="light"] body #g-footer > .g-container,
html[data-theme="light"] body #g-footer .g-container,
html:not([data-theme="dark"]) body #g-footer > .g-container,
html:not([data-theme="dark"]) body #g-footer .g-container {
  background: transparent !important;
}

html[data-theme="light"] body #g-footer .jchd-footer,
html:not([data-theme="dark"]) body #g-footer .jchd-footer {
  --jf-accent: #376fe6;
  --jf-accent-hover: #275bc7;
  --jf-text: #25272d;
  --jf-muted: #667085;
  --jf-heading: #171a21;
  --jf-border: rgba(31, 34, 40, .14);
  --jf-surface: #ffffff;
  --jf-surface-alt: #f1f4f8;
  color: var(--jf-text) !important;
}

html[data-theme="light"] body #g-footer .jchd-footer__title,
html[data-theme="light"] body #g-footer .jchd-footer__site-name,
html:not([data-theme="dark"]) body #g-footer .jchd-footer__title,
html:not([data-theme="dark"]) body #g-footer .jchd-footer__site-name {
  color: #171a21 !important;
}

html[data-theme="light"] body #g-footer .jchd-footer__description,
html[data-theme="light"] body #g-footer .jchd-footer__link,
html[data-theme="light"] body #g-footer .jchd-footer__contact-row dt,
html[data-theme="light"] body #g-footer .jchd-footer__contact-row dd,
html[data-theme="light"] body #g-footer .jchd-footer__map-caption,
html[data-theme="light"] body #g-footer .jchd-footer__map-placeholder,
html:not([data-theme="dark"]) body #g-footer .jchd-footer__description,
html:not([data-theme="dark"]) body #g-footer .jchd-footer__link,
html:not([data-theme="dark"]) body #g-footer .jchd-footer__contact-row dt,
html:not([data-theme="dark"]) body #g-footer .jchd-footer__contact-row dd,
html:not([data-theme="dark"]) body #g-footer .jchd-footer__map-caption,
html:not([data-theme="dark"]) body #g-footer .jchd-footer__map-placeholder {
  color: #667085 !important;
}

html[data-theme="light"] body #g-footer .jchd-footer__contact-row a,
html:not([data-theme="dark"]) body #g-footer .jchd-footer__contact-row a {
  color: #25272d !important;
}

html[data-theme="light"] body #g-footer .jchd-footer__social,
html:not([data-theme="dark"]) body #g-footer .jchd-footer__social {
  color: #344054 !important;
  background: #ffffff !important;
  border-color: rgba(31, 34, 40, .16) !important;
}

html[data-theme="light"] body #g-footer .jchd-footer__social:hover,
html[data-theme="light"] body #g-footer .jchd-footer__social:focus-visible,
html:not([data-theme="dark"]) body #g-footer .jchd-footer__social:hover,
html:not([data-theme="dark"]) body #g-footer .jchd-footer__social:focus-visible {
  color: #ffffff !important;
  background: #376fe6 !important;
  border-color: #376fe6 !important;
}

html[data-theme="light"] body #g-footer .jchd-footer__map-frame,
html:not([data-theme="dark"]) body #g-footer .jchd-footer__map-frame {
  background: #ffffff !important;
  border-color: rgba(31, 34, 40, .14) !important;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .08) !important;
}

html[data-theme="dark"] body #g-footer {
  background-color: #111319 !important;
  background-image: none !important;
  color: rgba(255, 255, 255, .92) !important;
  border-top-color: rgba(255, 255, 255, .10) !important;
}

html[data-theme="dark"] body #g-footer > .g-container,
html[data-theme="dark"] body #g-footer .g-container {
  background: transparent !important;
}

html[data-theme="dark"] body #g-footer .jchd-footer {
  --jf-accent: #376fe6;
  --jf-accent-hover: #6d91f2;
  --jf-text: rgba(255, 255, 255, .92);
  --jf-muted: rgba(255, 255, 255, .66);
  --jf-heading: #ffffff;
  --jf-border: rgba(255, 255, 255, .13);
  --jf-surface: #171a21;
  --jf-surface-alt: rgba(255, 255, 255, .055);
  color: var(--jf-text) !important;
}

/* ==========================================================
   v3.2 – Gantry wrapper reset for the real theme switcher
   The site uses html[data-theme="light|dark"]. Gantry's footer
   wrappers and particle instances can carry their own dark surface,
   therefore every wrapper in the footer chain is reset explicitly.
   ========================================================== */

html[data-theme="light"] body #g-footer,
html[data-theme="light"] body #g-footer > .g-container,
html[data-theme="light"] body #g-footer .g-container,
html[data-theme="light"] body #g-footer .g-grid,
html[data-theme="light"] body #g-footer .g-block,
html[data-theme="light"] body #g-footer .g-content,
html[data-theme="light"] body #g-footer .g-particle,
html[data-theme="light"] body #g-footer [class*="jchd-footer"] {
  background-color: transparent !important;
  background-image: none !important;
}

html[data-theme="light"] body #g-footer {
  background-color: #f8fafc !important;
  color: #25272d !important;
  border-top: 1px solid rgba(31, 34, 40, .12) !important;
}

html[data-theme="light"] body #g-footer .jchd-footer {
  --jf-accent: #376fe6;
  --jf-accent-hover: #275bc7;
  --jf-text: #25272d;
  --jf-muted: #667085;
  --jf-heading: #171a21;
  --jf-border: rgba(31, 34, 40, .14);
  --jf-surface: #ffffff;
  --jf-surface-alt: #eef2f7;
  color: #25272d !important;
}

html[data-theme="light"] body #g-footer .jchd-footer__site-name,
html[data-theme="light"] body #g-footer .jchd-footer__title,
html[data-theme="light"] body #g-footer .jchd-footer__brand-link {
  color: #171a21 !important;
}

html[data-theme="light"] body #g-footer .jchd-footer__description,
html[data-theme="light"] body #g-footer .jchd-footer__link,
html[data-theme="light"] body #g-footer .jchd-footer__contact-row dt,
html[data-theme="light"] body #g-footer .jchd-footer__contact-row dd,
html[data-theme="light"] body #g-footer .jchd-footer__map-caption,
html[data-theme="light"] body #g-footer .jchd-footer__map-placeholder {
  color: #667085 !important;
}

html[data-theme="light"] body #g-footer .jchd-footer__link:hover,
html[data-theme="light"] body #g-footer .jchd-footer__link:focus-visible,
html[data-theme="light"] body #g-footer .jchd-footer__contact-row a:hover,
html[data-theme="light"] body #g-footer .jchd-footer__contact-row a:focus-visible {
  color: #376fe6 !important;
}

html[data-theme="light"] body #g-footer .jchd-footer--divider::before {
  background: rgba(31, 34, 40, .14) !important;
}

html[data-theme="light"] body #g-footer .jchd-footer__social {
  color: #344054 !important;
  background: #eef2f7 !important;
  border-color: rgba(31, 34, 40, .16) !important;
  box-shadow: none !important;
}

html[data-theme="light"] body #g-footer .jchd-footer__social:hover,
html[data-theme="light"] body #g-footer .jchd-footer__social:focus-visible {
  color: #ffffff !important;
  background: #376fe6 !important;
  border-color: #376fe6 !important;
}

html[data-theme="light"] body #g-footer .jchd-footer__map-frame {
  background: #ffffff !important;
  border-color: rgba(31, 34, 40, .14) !important;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .08) !important;
}

html[data-theme="dark"] body #g-footer,
html[data-theme="dark"] body #g-footer > .g-container,
html[data-theme="dark"] body #g-footer .g-container,
html[data-theme="dark"] body #g-footer .g-grid,
html[data-theme="dark"] body #g-footer .g-block,
html[data-theme="dark"] body #g-footer .g-content,
html[data-theme="dark"] body #g-footer .g-particle,
html[data-theme="dark"] body #g-footer [class*="jchd-footer"] {
  background-image: none !important;
}

html[data-theme="dark"] body #g-footer {
  background-color: #111319 !important;
}

html[data-theme="dark"] body #g-footer > .g-container,
html[data-theme="dark"] body #g-footer .g-container,
html[data-theme="dark"] body #g-footer .g-grid,
html[data-theme="dark"] body #g-footer .g-block,
html[data-theme="dark"] body #g-footer .g-content,
html[data-theme="dark"] body #g-footer .g-particle,
html[data-theme="dark"] body #g-footer [class*="jchd-footer"] {
  background-color: transparent !important;
}

/* ==========================================================
   v3.3 – light theme contrast fix
   Gantry/template link and icon rules use higher specificity and
   can keep white text from the dark theme. Force readable light
   colours on the actual footer elements and all nested icon nodes.
   ========================================================== */
html[data-theme="light"] body #g-footer .jchd-footer__links,
html[data-theme="light"] body #g-footer .jchd-footer__link-item,
html[data-theme="light"] body #g-footer .jchd-footer__link,
html[data-theme="light"] body #g-footer .jchd-footer__link > *,
html[data-theme="light"] body #g-footer .jchd-footer__contact-list,
html[data-theme="light"] body #g-footer .jchd-footer__contact-row,
html[data-theme="light"] body #g-footer .jchd-footer__contact-row dt,
html[data-theme="light"] body #g-footer .jchd-footer__contact-row dd,
html[data-theme="light"] body #g-footer .jchd-footer__contact-row a,
html[data-theme="light"] body #g-footer .jchd-footer__contact-row a > *,
html[data-theme="light"] body #g-footer .jchd-footer__map-placeholder,
html[data-theme="light"] body #g-footer .jchd-footer__map-placeholder > *,
html[data-theme="light"] body #g-footer .jchd-footer__map-caption {
  color: #344054 !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

html[data-theme="light"] body #g-footer .jchd-footer__link {
  color: #25272d !important;
}

html[data-theme="light"] body #g-footer .jchd-footer__link:hover,
html[data-theme="light"] body #g-footer .jchd-footer__link:focus-visible,
html[data-theme="light"] body #g-footer .jchd-footer__contact-row a:hover,
html[data-theme="light"] body #g-footer .jchd-footer__contact-row a:focus-visible {
  color: #376fe6 !important;
}

html[data-theme="light"] body #g-footer .jchd-footer__social {
  color: #344054 !important;
  background-color: #f1f4f8 !important;
  border-color: rgba(31, 34, 40, .18) !important;
  opacity: 1 !important;
}

html[data-theme="light"] body #g-footer .jchd-footer__social i,
html[data-theme="light"] body #g-footer .jchd-footer__social svg,
html[data-theme="light"] body #g-footer .jchd-footer__social svg *,
html[data-theme="light"] body #g-footer .jchd-footer__contact-row i,
html[data-theme="light"] body #g-footer .jchd-footer__contact-row svg,
html[data-theme="light"] body #g-footer .jchd-footer__contact-row svg *,
html[data-theme="light"] body #g-footer .jchd-footer__map-placeholder i,
html[data-theme="light"] body #g-footer .jchd-footer__map-placeholder svg,
html[data-theme="light"] body #g-footer .jchd-footer__map-placeholder svg * {
  color: currentColor !important;
  fill: currentColor !important;
  stroke: currentColor !important;
  opacity: 1 !important;
}

html[data-theme="light"] body #g-footer .jchd-footer__social:hover,
html[data-theme="light"] body #g-footer .jchd-footer__social:focus-visible {
  color: #ffffff !important;
  background-color: #376fe6 !important;
  border-color: #376fe6 !important;
}

html[data-theme="light"] body #g-footer .jchd-footer__map-frame {
  color: #344054 !important;
  background-color: #ffffff !important;
}
