/* Make unclickable headings look like section labels */
.site-footer__navigation .site-footer__menu a.no-link {
  pointer-events: auto;
  cursor: default;
  color: inherit;
  text-decoration: none;
}
.site-footer__navigation .site-footer__menu a.no-link:hover { text-decoration: none; }

.site-footer .container,
.site-footer .container-fluid,
#colophon .container,
#colophon .container-fluid {
  padding-left: calc(15px + clamp(0.5rem, 1.5vw, 24px)) !important;
  padding-right: calc(15px + clamp(0.75rem, 2.5vw, 40px)) !important;
}

@media (min-width: 992px) {
  .site-footer .container,
  .site-footer .container-fluid,
  #colophon .container,
  #colophon .container-fluid {
    padding-left: calc(15px + clamp(0.5rem, 1.25vw, 20px)) !important; 
    padding-right: calc(15px + clamp(0.5rem, 2vw, 24px)) !important;
  }

  .site-footer__divider {
    width: auto !important;
    margin-left: calc(15px + clamp(0.5rem, 1.25vw, 20px)) !important;
    margin-right: calc(15px + clamp(0.5rem, 2vw, 24px)) !important;
  }
}

@media (min-width: 992px) and (max-width: 1017px) {
  .site-footer .container,
  .site-footer .container-fluid,
  #colophon .container,
  #colophon .container-fluid {
    padding-left: 19px !important;
    padding-right: 21px !important; 
  }

  .site-footer__divider {
    width: auto !important;
    margin-left: 19px !important;
    margin-right: 21px !important;
  }
}

@media (min-width: 1595px) and (max-width: 1670px) {
  .site-footer .container,
  .site-footer .container-fluid,
  #colophon .container,
  #colophon .container-fluid {
    padding-left: 27px !important; 
    padding-right: 33px !important;
  }

  .site-footer__divider {
    width: auto !important;
    margin-left: 27px !important;
    margin-right: 33px !important;
  }
}

/* Layout: logo + nav become a two-column grid on desktop */
.site-footer__inner {
  display: grid;
  grid-template-columns: 1fr; 
  grid-template-areas: 
    "branding"
    "nav";
  row-gap: 24px;
  align-items: start;
}
/* Tablet: logo left, nav right */
@media (min-width: 576px) and (max-width: 991.98px) {
  .site-footer__inner {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "branding nav";
    column-gap: 40px;
    row-gap: 20px;
  }
}
/* Desktop: logo left, nav right */
@media (min-width: 992px) {
  .site-footer__inner {
    grid-template-columns: minmax(260px, 360px) 1fr;
    grid-template-areas: "branding nav";
    column-gap: 72px;
  }
}
@media (min-width: 1200px) {
  .site-footer__inner {
    grid-template-columns: 360px 1fr;
  }
}

.site-footer__branding { grid-area: branding; }
.site-footer__navigation { grid-area: nav; }

/* New JS-generated columns wrapper */
.footer-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  column-gap: 40px;
  row-gap: 12px;
}
@media (min-width: 576px) and (max-width: 991.98px) {
  .footer-columns { grid-template-columns: repeat(2, minmax(180px, 1fr)); column-gap: 56px; }
}
@media (min-width: 992px) {
  .footer-columns { grid-template-columns: repeat(3, minmax(200px, 1fr)); column-gap: 72px; }
}
.footer-col { display: block; }
.footer-col > li { list-style: none; margin: 0 0 8px 0; padding: 0; }
.footer-col > li > a { display: inline-block; line-height: 1.5; }

.footer-col__heading > a,
.footer-col > li > a.no-link {
  text-transform: none;
  letter-spacing: normal;
  font-weight: inherit;
  color: inherit;
}

/* Consistent hover treatment for all footer links (including About) */
.footer-columns a {
  transition: color 200ms ease-out, opacity 200ms ease-out;
}
.footer-columns a:hover,
.footer-columns a:focus,
.footer-columns a:active,
.footer-columns a:visited:hover {
  color: #0283BD !important; /* NESI blue */
  opacity: 1 !important;    
  text-decoration: none !important;
  outline: none !important;
  background: transparent !important;
}

/* Force headings to appear exactly like normal links */
.footer-columns .footer-col__heading > a,
.footer-columns a.no-link {
  color: inherit !important;
  opacity: 1 !important;
  font-weight: inherit !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}

/* Ensure footer menu uses a clean grid instead of flex from base theme */
.site-footer .site-footer__navigation .site-footer__menu {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  grid-auto-flow: row;
  grid-auto-rows: min-content;
  row-gap: 12px;
  column-gap: 56px;
  margin: 0 !important;
  padding: 0;
  list-style: none;
}
@media (min-width: 768px) {
  .site-footer .site-footer__navigation .site-footer__menu {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    row-gap: 12px;
    column-gap: 72px;
  }
}

.site-footer .site-footer__navigation .site-footer__menu li.menu-item {
  width: auto !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 0 8px 0 !important;
  flex: initial !important;
}

.site-footer .site-footer__navigation .site-footer__menu a {
  display: inline-block;
  margin: 0;
  line-height: 1.5;
}

/* Footer logo sizing: responsive and larger on tablets as requested */
.site-footer__brand-logo {
  display: block;
  height: auto;
  max-width: 100%;
}

@media (max-width: 575.98px) {
  .site-footer__brand-logo { width: 240px; }
}
@media (min-width: 576px) and (max-width: 991.98px) {
  .site-footer__brand-logo {
    width: 340px; 
  }
}
@media (min-width: 992px) {
  .site-footer__brand-logo {
    width: 420px;
  }
}

/* Bottom row: copyright and terms responsive alignment */
.site-footer__bottom {
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 12px;
  align-items: center;
}
@media (min-width: 768px) {
  .site-footer__bottom {
    grid-template-columns: 1fr auto;
  }
}

/* Subtle divider spacing alignment with design */
.site-footer__divider {
  border-bottom: 1px solid rgba(0,0,0,0.08);
  margin: 28px 0;
}
/* Strong overrides against base theme's #footer-navigation ul flex rules */
.site-footer #footer-navigation { width: 100%; }
.site-footer #footer-navigation ul {
  /* Hide the original flat list when JS enhancement runs */
  display: none !important;
}
@supports not (display: grid) {
  /* Fallback — keep previous responsive grid directly on UL if JS fails */
  .site-footer #footer-navigation ul {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(140px, 1fr));
    grid-auto-rows: min-content;
    row-gap: 8px;
    column-gap: 40px;
  }
}
@media (min-width: 992px) {
  .site-footer #footer-navigation ul {
    grid-template-columns: repeat(3, minmax(200px, 1fr)); 
    column-gap: 72px;
  }
}
.site-footer #footer-navigation ul li.menu-item {
  width: auto !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 0 4px 0 !important;
  flex: initial !important;
}
.site-footer #footer-navigation a { 
  display: block; 
  line-height: 1.4; 
  white-space: normal; 
  overflow: visible; 
  text-overflow: initial;
}
