﻿/* DBIM footer (section 5.6). Background is the key colour of the selected group (--dbim-key, see dbim-header.css).
   Layout follows the reference footer: centred link rows, social icons, lineage, copyright, statistics, credit. */

#footer .dbim-footer {
  background: var(--dbim-key, #162f6a);
  color: #fff;
  font-family: "Noto Sans", "Noto Sans Devanagari", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  padding: 24px 0 16px;
  text-align: center;
}
#footer .dbim-footer__wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; box-sizing: border-box; }

/* Links: override the legacy "#footer a" rules */
#footer .dbim-footer a { color: #fff; line-height: 1.5; text-decoration: underline; background: none; }
#footer .dbim-footer a:hover { text-decoration-thickness: 2px; }
#footer .dbim-footer a:focus-visible, #footer .dbim-footer summary:focus-visible {
  outline: 2px solid #fff; outline-offset: 3px; border-radius: 2px;
}
#footer .dbim-footer ul { list-style: none; margin: 0; padding: 0; }
#footer .dbim-footer li { margin: 0; padding: 0; float: none; width: auto; border: 0; background: none; }
#footer .dbim-footer p { margin: 0 0 8px; color: #fff; font-size: 14px; text-align: center; }

/* Link rows with thin separators */
#footer .dbim-footer__links > ul { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 0; margin-bottom: 8px; }
#footer .dbim-footer__links > ul > li { display: flex; align-items: center; padding: 0 12px; position: relative; }
#footer .dbim-footer__links > ul > li + li::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 1px; height: 16px; margin-top: -8px; background: rgba(255, 255, 255, .6);
}
#footer .dbim-footer__links a { padding: 8px 0; display: inline-block; }

/* Important links (native disclosure, no JavaScript needed) */
#footer .dbim-footer__imp { position: relative; }
#footer .dbim-footer__imp summary { cursor: pointer; text-decoration: underline; padding: 8px 0; list-style: none; display: inline-block; }
#footer .dbim-footer__imp summary::-webkit-details-marker { display: none; }
#footer .dbim-footer__imp summary::after { content: " \25BE"; text-decoration: none; display: inline-block; }
#footer .dbim-footer__imp[open] summary::after { content: " \25B4"; }
#footer .dbim-footer__imp-list {
  position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%); z-index: 20; min-width: 240px; text-align: left;
  padding: 8px 12px; background: var(--dbim-key, #162f6a); border: 1px solid #fff; border-radius: 6px; box-shadow: 0 4px 16px rgba(0, 0, 0, .35);
}
#footer .dbim-footer__imp-list li a { display: block; padding: 6px 0; }

/* Social icons */
#footer .dbim-footer__social { display: flex; justify-content: center; gap: 10px; margin: 8px 0 20px; }
#footer .dbim-footer__social-link {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; box-sizing: border-box;
  border: 2px solid #fff; border-radius: 50%; text-decoration: none !important;
}
#footer .dbim-footer__social-link:hover { background: #fff; color: var(--dbim-key, #162f6a); }
#footer .dbim-footer__social-link:hover svg { color: var(--dbim-key, #162f6a); }

/* Meta */
#footer .dbim-footer__meta, #footer .dbim-footer__credit { border-top: 1px solid rgba(255, 255, 255, .45); padding-top: 16px; }
#footer .dbim-footer__credit { margin-top: 12px; }
#footer .dbim-footer__lineage { font-weight: 600; }
#footer .dbim-footer__stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 0; }
#footer .dbim-footer__stats span + span { border-left: 1px solid rgba(255, 255, 255, .6); margin-left: 12px; padding-left: 12px; }
#footer .dbim-footer__tools { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
#footer .dbim-footer__tools .googleLangWrapper { float: none; width: auto; margin: 0; padding: 0; }
#footer .dbim-footer__tools .googleLangWrapper .clearfix { display: flex; align-items: center; gap: 8px; }
#footer .dbim-footer__tools .googleImg, #footer .dbim-footer__tools .googleLang { float: none; margin: 0; }
#footer .dbim-footer__cert { display: inline-block; background: #fff; padding: 4px; border-radius: 4px; }
#footer .dbim-footer__cert img { display: block; width: 40px; height: auto; }

@media (max-width: 767px) {
  #footer .dbim-footer__links > ul > li { padding: 0 10px; }
  #footer .dbim-footer__stats span + span { border-left: 0; margin-left: 0; padding-left: 0; }
  #footer .dbim-footer__imp-list { left: 0; transform: none; min-width: min(280px, calc(100vw - 48px)); }
}

/* Footer link hover / focus: an underline that draws in from the left (no background box).
   Overrides the legacy "#footer a:hover" rule, which turned the text the key colour (invisible on the footer). */
#footer .dbim-footer a:not(.dbim-footer__social-link):not(.dbim-footer__cert),
#footer .dbim-footer__imp summary {
  text-decoration: none !important;
  color: #fff !important;
  background-color: transparent !important;
  background-image: linear-gradient(#fff, #fff);
  background-repeat: no-repeat;
  background-position: left bottom;
  background-origin: content-box;
  background-size: 0 2px;
  transition: background-size .3s ease;
}
#footer .dbim-footer a:not(.dbim-footer__social-link):not(.dbim-footer__cert):hover,
#footer .dbim-footer a:not(.dbim-footer__social-link):not(.dbim-footer__cert):focus-visible,
#footer .dbim-footer__imp summary:hover,
#footer .dbim-footer__imp summary:focus-visible,
#footer .dbim-footer__imp[open] summary {
  background-size: 100% 2px;
}
#footer .dbim-footer__imp-list li a { display: inline-block; }
/* Links inside running text keep a permanent underline so they do not rely on hover. */
#footer .dbim-footer__credit a { text-decoration: underline !important; background-image: none; }
/* Social icons: white disc with a key-colour icon on hover / focus. */
#footer .dbim-footer a.dbim-footer__social-link:hover,
#footer .dbim-footer a.dbim-footer__social-link:focus-visible { background-color: #fff !important; color: var(--dbim-key, #162f6a) !important; }
#footer .dbim-footer a.dbim-footer__social-link:hover svg,
#footer .dbim-footer a.dbim-footer__social-link:focus-visible svg { color: var(--dbim-key, #162f6a) !important; }
#footer .dbim-footer__social-link { transition: background-color .25s ease, color .25s ease; }
@media (prefers-reduced-motion: reduce) {
  #footer .dbim-footer a, #footer .dbim-footer__imp summary, #footer .dbim-footer__social-link { transition: none !important; }
}

/* Small screens: "Important links" opens as a bottom sheet so it can never run off the screen edge. */
@media (max-width: 767px) {
  #footer .dbim-footer__imp { position: static; }
  #footer .dbim-footer__imp-list {
    position: fixed; left: 12px; right: 12px; bottom: 12px; top: auto; transform: none; min-width: 0; max-height: 60vh; overflow-y: auto; z-index: 10060;
  }
}

/* Social icons use the supplied DBIM SVG files unchanged: key-colour glyph on a white disc (the glyph would vanish on the key-colour footer). */
#footer .dbim-footer a.dbim-footer__social-link { background-color: #fff !important; border: 2px solid #fff; width: 44px; height: 44px; }
#footer .dbim-footer__social-link img { display: block; width: 24px; height: 24px; }
#footer .dbim-footer a.dbim-footer__social-link:hover,
#footer .dbim-footer a.dbim-footer__social-link:focus-visible { background-color: #d2dfff !important; box-shadow: 0 0 0 3px rgba(255, 255, 255, .55); }
#footer .dbim-footer a.dbim-footer__social-link:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
#footer .dbim-footer__social { flex-wrap: wrap; }
