/* Main navbar, docs side navigation and footers.
 * Ported from datensen-web (public/global.css + public/nav.css). Loaded last,
 * after base.css and mm2.css; the "resets" below undo rules from mm2.css that
 * share class names with this markup (.navbar, .navbar-brand, .navbar-toggler,
 * .footer). */

:root {
  --height-navbar: 74px;
  --color-navbar-item: #fff;
  --color-text-body: #333;
  --color-neutral-100: #fefefe;
  --color-neutral-200: #ddd;
  --gradient-whitey: linear-gradient(10deg, #fff, #fff, #eee);
}

/* The fixed navbar is offset by the body padding alone; the legacy full-width
 * layout added its own 50px for the old header. */
body {
  margin-top: 0;
  padding-top: var(--height-navbar);
}
.im-layout-full-content {
  padding-top: 0;
}

/* ── Main navbar ─────────────────────────────────────────────────────────────
 * Markup and behaviour from datensen-web; look of the ideamerit.com header:
 * blue background with the nav-bg.svg pattern, uppercase items, a white line
 * under the selected item and a half-white line growing in on hover. */

#main-navigation {
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}
.navbar-brand {
  align-items: center;
  color: var(--color-navbar-item);
  display: flex;
  height: var(--height-navbar);
  left: 0;
  margin-right: 0;
  padding: 0 0 0 16px;
  position: fixed;
  text-decoration: none;
  top: 0;
  z-index: 1032;
}
.navbar-brand:hover,
.navbar-brand:focus {
  color: var(--color-navbar-item);
  text-decoration: none;
}
.navbar-brand-logo {
  margin-right: 10px;
}
.navbar-brand-logo,
.navbar-brand-name {
  display: inline-block;
}
.navbar-brand-logo svg {
  display: block;
}
.navbar-brand-name {
  font-size: 20px;
  font-weight: 400;
  line-height: 30px;
  text-transform: uppercase;
}
.navbar {
  background: url(/css/nav-bg.svg) center / cover, #0093bb;
  border: 0;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
  left: 0;
  padding: 0;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 1030;
}
.navbar,
.navbar-group {
  display: flex;
  height: var(--height-navbar);
}
.navbar-group {
  align-items: baseline;
  flex-basis: auto;
  flex-direction: row;
  justify-content: flex-end;
  list-style: none;
  margin: 0;
  padding: 0 16px 0 0;
}
.navbar-item {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin-left: 15px;
  margin-right: 15px;
}
.navbar-link:after {
  background: rgba(255, 255, 255, 0.5);
  content: " ";
  display: block;
  height: 2px;
  margin-left: auto;
  margin-right: auto;
  transition: width 0.3s;
  width: 0;
}
.navbar-link:hover:after {
  width: 100%;
}
.navbar-item.active .navbar-link:after {
  background: #fff;
  width: 100%;
}
.navbar a.navbar-link {
  align-content: center;
  color: var(--color-navbar-item);
  display: inline-block;
  font-size: 14px;
  font-weight: 400;
  height: 100%;
  line-height: 21px;
  padding: 3px 0 0;
  text-decoration: none;
  text-transform: uppercase;
}
.navbar-toggler {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--color-navbar-item);
  display: none;
  height: var(--height-navbar);
  left: 0;
  padding: 0;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1031;
}
.navbar-toggler svg {
  position: relative;
  top: 2px;
}
/* Narrow screens: the blue bar grows to hold the menu, as on ideamerit.com. */
@media screen and (max-width: 1180px) {
  .navbar {
    display: block;
    height: auto;
    min-height: var(--height-navbar);
  }
  #main-navigation {
    position: static;
  }
  .navbar-group {
    display: block;
    height: auto;
    padding: var(--height-navbar) 0 15px;
  }
  .navbar-collapsible {
    display: none;
  }
  .navbar-collapsible.open {
    display: block;
  }
  .navbar-item {
    height: auto;
    margin: 0;
  }
  .navbar-toggler {
    display: block;
  }
  .navbar-toggler-button {
    background-color: transparent;
    border: 0;
    bottom: 0;
    cursor: pointer;
    display: block;
    outline: none;
    position: absolute;
    right: 0;
    top: 0;
    width: 80px;
  }
  .navbar a.navbar-link {
    display: block;
    padding: 5px 16px;
  }
  .navbar a.navbar-link:hover {
    background: rgba(0, 0, 0, 0.12);
  }
  .navbar-toggler-icon-open {
    display: block;
  }
  .navbar-toggler-icon-close,
  .opened .navbar-toggler-icon-open {
    display: none;
  }
  .opened .navbar-toggler-icon-close {
    display: block;
  }
  .navbar-link:after,
  .navbar-link:hover:after,
  .navbar-item.active .navbar-link:after {
    display: none;
  }
}

/* ── Docs layout: fixed side navigation + content ───────────────────────── */

.grid {
  display: grid;
}
.side-nav {
  background: var(--color-neutral-100);
  border-right: 1px solid rgba(0, 0, 0, 0.05);
  color: var(--color-text-body);
  font-size: 14px;
  height: calc(100% - var(--height-navbar));
  max-width: 320px;
  overflow: auto;
  padding-bottom: 50px;
  position: fixed;
  top: var(--height-navbar);
  width: 320px;
}
.side-nav li {
  display: block;
  width: 100%;
}
.side-nav li a {
  display: flex;
}
.side-nav-grid {
  display: grid;
  grid-template-columns: 1fr;
  padding: 10px;
}
.side-header {
  background: linear-gradient(60deg, #00f, green, purple, #000);
  background-clip: border-box;
  -webkit-background-clip: text;
  color: transparent;
  letter-spacing: 0.8px;
  padding: 30px 0 30px 10px;
  text-transform: uppercase;
}
.post-content {
  margin-left: 320px;
}
@media screen and (max-width: 1180px) {
  .side-nav {
    height: auto;
    max-width: unset;
    padding-bottom: 5px;
    position: initial;
    width: auto;
  }
  .side-nav-grid {
    background: var(--gradient-whitey);
    border-bottom: 1px solid var(--color-neutral-200);
    grid-template-columns: 1fr 1fr;
    z-index: 1;
  }
  .post-content {
    margin-left: 0;
  }
}

/* ── Side navigation tree (NavList.astro + /nav.js) ─────────────────────── */

.site-nav {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font: inherit;
  padding: 10px 10px 30px 10px;
  text-align: left;
}
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav li {
  position: relative;
}
.site-nav a {
  color: inherit;
  padding: 0.25rem 0;
  text-decoration: none;
}
.site-nav a:hover,
.site-nav a:focus {
  color: black;
  text-decoration: none;
}
.site-nav li.has-children[aria-expanded="true"] > a > .icon-chevron {
  display: inline-block;
  transform: rotate(90deg);
}
/* Nested submenus collapse once /nav.js loads; without JS they stay open. */
.site-nav .has-children > ul {
  margin-left: 20px;
  padding-bottom: 0.25rem;
  padding-top: 0.25rem;
}
.site-nav.js-ready .has-children > ul {
  display: none;
}
.site-nav.js-ready .has-children.open > ul {
  display: block;
}
.site-nav .current:not(.has-children) > a {
  font-weight: bold;
}
.nav-select-wrapper {
  display: none;
}
.site-nav ul.nav-tree {
  display: block;
}
@media screen and (max-width: 1180px) {
  .site-nav ul.nav-tree {
    display: none;
  }
  .nav-select-wrapper {
    display: block;
    margin: 0.5rem 0;
  }
  .nav-select {
    appearance: auto;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    color: inherit;
    cursor: pointer;
    font: inherit;
    font-size: 0.95rem;
    padding: 0.5rem 0.75rem;
    width: 100%;
  }
  .nav-select:focus {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
  }
  .site-nav {
    border-bottom: unset;
    padding: 0;
  }
}
.icon-chevron,
.icon-text {
  background-position: center;
  background-repeat: no-repeat;
  background-size: 16px 16px;
  display: inline-block;
  flex-shrink: 0;
  height: 16px;
  position: relative;
  top: 1px;
  width: 16px;
}
.icon-chevron {
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6.5,11.5L10.5,8L6.5,4.5' stroke='%23999' fill='none' stroke-width='1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  margin-right: 3px;
}
.icon-text {
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2,3.5L14,3.5M2,5.5L9,5.5M10,5.5L14,5.5M2,7.5L13,7.5M2,9.5L10,9.5M2,11.5L12,11.5M2,13.5L10,13.5' stroke='%23b4b4b4' fill='none' stroke-width='1' stroke-linejoin='round'/%3E%3C/svg%3E");
  margin-right: 5px;
}

/* ── Footers (LinksBottom.astro + FooterSite.astro) ─────────────────────── */

footer.site-footer {
  background: #000;
  color: #fff6;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  width: 100%;
}
.flex {
  display: flex;
}
.spacer-md {
  padding-bottom: 20px;
  padding-top: 20px;
}
.section-default-level-3 {
  background: radial-gradient(ellipse 80% 60% at 15% 0%, rgba(59, 130, 246, 0.06), transparent 60%), radial-gradient(ellipse 70% 55% at 85% 100%, rgba(124, 58, 237, 0.05), transparent 60%), #f7f8fa;
  color: #333;
  padding: 80px 20px;
}
#footer-links {
  color: #6e7681;
  font-size: 14px;
  line-height: 1.5;
}
#footer-links.footer-links-light {
  color: #666;
}
#footer-links .footer-group {
  color: #6e7681;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  margin-top: 24px;
  text-transform: uppercase;
}
#footer-links a {
  color: #6e7681;
}
#footer-links a:hover {
  color: #0069d9;
}
.footer-social-link {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid hsla(0, 0%, 100%, 0.1);
  border-radius: 0.5rem;
  display: inline-block;
  margin: 0 10px 5px 0;
  padding: 8px;
}
#footer-links.footer-links-light .footer-social-link {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.18);
}
#footer-links.footer-links-light .footer-social-link:hover {
  background: rgba(0, 0, 0, 0.1);
}
#footer-links.footer-links-light .footer-social-image {
  filter: brightness(0) opacity(0.5);
}
#footer-links.footer-links-light .footer-social-link:hover .footer-social-image {
  filter: brightness(0) opacity(0.75);
}
.footer-social-image {
  background-position: 50%;
  background-repeat: no-repeat;
  background-size: 18px 18px;
  display: inline-block;
  height: 18px;
  vertical-align: middle;
  width: 18px;
}
.footer-social-gmail {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23dddddd' d='M24 4.5v15c0 .85-.65 1.5-1.5 1.5H21V7.387l-9 6.463-9-6.463V21H1.5C.649 21 0 20.35 0 19.5v-15c0-.425.162-.8.431-1.068C.7 3.16 1.076 3 1.5 3H2l10 7.25L22 3h.5c.425 0 .8.162 1.069.432.27.268.431.643.431 1.068z'/%3E%3C/svg%3E");
}
.footer {
  background: #000;
  color: #fff6;
  font-size: 11px;
  height: 40px;
  line-height: 40px;
  min-height: 0;
  padding: 0;
  position: static;
  text-align: center;
}
