/* ---------- CES footer: "Links" block (block 3) + footer menu (block 4) ---------- */
:root {
  --ces-foot-bg: #101c16;
  --ces-foot-bg-2: #16281f;
  --ces-foot-text: #d6e3d9;
  --ces-foot-head: #b9cf7a;
  --ces-foot-line: rgba(255, 255, 255, .14);
}

/* footer wrapper (works when the blocks are placed in the Footer region) */
#footer {
  background: var(--ces-foot-bg);
  color: var(--ces-foot-text);
  border-top: 4px solid var(--ces-leaf, #7a8f3a);
  margin-top: 30px;
}
#footer .region-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 22px 32px;
}
#footer .region-footer > .block { flex: 1 1 100%; margin: 0; }
#footer a { color: var(--ces-foot-text); text-decoration: none; }
#footer a:hover,
#footer a:focus { color: #fff; text-decoration: underline; }

/* If the blocks are still in the Content region, give them the same look */
#block-ces-theme-framework-block-3,
#block-ces-theme-framework-block-4 {
  background: var(--ces-foot-bg);
  color: var(--ces-foot-text);
  padding: 18px 20px;
  margin: 18px 0 0;
  border-radius: 6px;
}
#block-ces-theme-framework-block-3 a,
#block-ces-theme-framework-block-4 a { color: var(--ces-foot-text); text-decoration: none; }
#block-ces-theme-framework-block-3 a:hover,
#block-ces-theme-framework-block-4 a:hover,
#block-ces-theme-framework-block-3 a:focus,
#block-ces-theme-framework-block-4 a:focus { color: #fff; text-decoration: underline; }

/* ---- "Links" block ---- */
#block-ces-theme-framework-block-3 .block-title {
  margin: 0 0 12px;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ces-foot-head);
}
#block-ces-theme-framework-block-3 .links ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
#block-ces-theme-framework-block-3 .links li {
  margin: 0;
  list-style: none;
}
/* neutralise the old inline absolute positioning (Forms / Herbarium items) */
#block-ces-theme-framework-block-3 .links li[style] {
  position: static !important;
  margin: 0 !important;
  width: auto !important;
}
/* text links become pills */
#block-ces-theme-framework-block-3 .links li a:not(:empty) {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid var(--ces-foot-line);
  border-radius: 999px;
  line-height: 1.3;
  transition: background .2s, border-color .2s;
}
#block-ces-theme-framework-block-3 .links li a:not(:empty):hover,
#block-ces-theme-framework-block-3 .links li a:not(:empty):focus {
  background: var(--ces-menu-bg-hover, #2f7a5a);
  border-color: transparent;
  text-decoration: none;
}
/* icon-only links (iisc, ant, flora, ecology, journals): keep them visible */
#block-ces-theme-framework-block-3 .links li a:empty {
  display: inline-block;
  min-width: 48px;
  min-height: 48px;
}
#block-ces-theme-framework-block-3 .links li img {
  display: block;
  max-height: 60px;
  width: auto;
}

/* ---- Footer menu (block 4) ---- */
#block-ces-theme-framework-block-4 br { display: none; } /* "Climate Change<br>& Conservation" */
#block-ces-theme-framework-block-4 ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
#block-ces-theme-framework-block-4 > div > ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 22px 28px;
}
#block-ces-theme-framework-block-4 li {
  margin: 0;
  list-style: none;
}
/* top-level items act as column headings */
#block-ces-theme-framework-block-4 > div > ul > li > a {
  display: block;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--ces-leaf, #7a8f3a);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ces-foot-head);
}
#block-ces-theme-framework-block-4 > div > ul > li > a:hover { color: #fff; text-decoration: none; }
#block-ces-theme-framework-block-4 li li a {
  display: block;
  padding: 3px 0;
  font-size: .92rem;
  line-height: 1.35;
}
#block-ces-theme-framework-block-4 li li a::before {
  content: "›";
  margin-right: 6px;
  color: var(--ces-foot-head);
}

/* search / account menu / powered-by inside the footer */
#footer .block-search-form-block,
#footer #block-ces-theme-account-menu,
#footer .block-system-powered-by-block { flex: 1 1 auto; }
#footer .region-footer {
  align-items: center;
}
#footer .block-system-powered-by-block {
  margin-left: auto;
  font-size: .8rem;
  opacity: .8;
}
#footer #block-ces-theme-account-menu ul { display: flex; gap: 14px; margin: 0; padding: 0; list-style: none; }
#footer .search-block-form form { display: flex; gap: 8px; }
#footer .search-block-form input[type="search"] {
  padding: 6px 10px;
  border: 1px solid var(--ces-foot-line);
  border-radius: 4px;
  background: var(--ces-foot-bg-2);
  color: #fff;
}
#footer .search-block-form input[type="submit"] {
  padding: 6px 14px;
  border: 0;
  border-radius: 4px;
  background: var(--ces-menu-bg-hover, #2f7a5a);
  color: #fff;
  cursor: pointer;
}

@media (max-width: 640px) {
  #block-ces-theme-framework-block-4 > div > ul { grid-template-columns: 1fr 1fr; }
  #footer .block-system-powered-by-block { margin-left: 0; }
}

/* ---- Copyright bar (replaces "Powered by Drupal") ---- */
.block-system-powered-by-block,
#footer .block-system-powered-by-block { display: none !important; }
.footer-copyright {
  background: var(--ces-foot-bg, #101c16);
  color: var(--ces-foot-text, #d6e3d9);
  border-top: 1px solid var(--ces-foot-line, rgba(255,255,255,.14));
  padding: 14px 20px;
  text-align: center;
  font-size: .88rem;
  letter-spacing: .02em;
}
#footer { padding: 0; }
