/* SkinRender — Header & Navigation styles */

/* ── Header base ───────────────────────── */
#site-header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(4,7,15,.85);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid rgba(255,255,255,.06);
  isolation: isolate;
}

.hdr-inner {
  max-width: 1360px; margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex; align-items: center; gap: 1rem;
}

/* ── Logo ──────────────────────────────── */
.hdr-logo {
  display: flex; align-items: center; gap: .55rem;
  font-family: var(--f-display, sans-serif);
  font-size: 1.05rem; font-weight: 700;
  color: var(--tx0, #f0f4ff);
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity .15s;
}
.hdr-logo:hover { opacity: .8; }
.hdr-logo span { letter-spacing: -.02em; }

/* ── Desktop nav ───────────────────────── */
.hdr-nav {
  display: flex; align-items: center; gap: .1rem;
  margin: 0 auto;
}

.nav-item {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .42rem .82rem;
  border-radius: 9px;
  color: var(--tx1, #7b91b0);
  font-size: .875rem; font-weight: 500;
  text-decoration: none;
  background: none; border: none;
  font-family: inherit; cursor: pointer;
  transition: color .14s, background .14s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.nav-item:hover, .nav-drop.open .nav-drop-btn {
  color: var(--tx0, #f0f4ff);
  background: rgba(255,255,255,.06);
  opacity: 1;
}

.dd-chevron {
  transition: transform .2s ease;
  flex-shrink: 0;
}
.nav-drop.open .dd-chevron { transform: rotate(180deg); }

/* ── Dropdown panel ────────────────────── */
.nav-drop { position: relative; }

.nav-sub {
  position: absolute; top: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(-6px);
  width: 280px;
  background: rgba(7,13,26,.96);
  border: 1px solid rgba(139,92,246,.25);
  border-radius: 16px;
  padding: .4rem;
  box-shadow: 0 24px 64px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, visibility 0s .18s;
  z-index: 50;
}
.nav-sub::before {
  content: ''; position: absolute;
  bottom: 100%; left: 50%; transform: translateX(-50%);
  width: 100%; height: 12px;
}
.nav-drop.open .nav-sub {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  transition: opacity .18s ease, transform .18s ease, visibility 0s 0s;
}

.nav-sub-item {
  display: flex; align-items: center; gap: .7rem;
  padding: .6rem .75rem;
  border-radius: 10px;
  text-decoration: none;
  transition: background .12s;
  -webkit-tap-highlight-color: transparent;
}
.nav-sub-item:hover { background: rgba(99,102,241,.12); opacity: 1; }

.ns-icon { font-size: 1.3rem; flex-shrink: 0; width: 28px; text-align: center; }

.nav-sub-item strong {
  display: block; color: var(--tx0, #f0f4ff);
  font-size: .86rem; font-weight: 600; line-height: 1.3;
}
.nav-sub-item em {
  display: block; color: var(--tx2, #3d5070);
  font-size: .76rem; font-style: normal; line-height: 1.3;
  margin-top: .08rem;
}

/* ── Header CTA ────────────────────────── */
.hdr-actions { display: flex; align-items: center; gap: .75rem; flex-shrink: 0; }

.hdr-cta {
  padding: .44rem 1rem;
  background: linear-gradient(135deg, var(--indigo, #6366f1), var(--violet, #8b5cf6));
  color: #fff; border-radius: 9px;
  font-size: .84rem; font-weight: 600;
  text-decoration: none; white-space: nowrap;
  box-shadow: 0 2px 12px rgba(99,102,241,.3);
  transition: all .14s ease;
}
.hdr-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(139,92,246,.4);
  opacity: 1;
}

/* ── Mobile button ─────────────────────── */
.mob-btn {
  display: none;
  flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  width: 40px; height: 40px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 9px; cursor: pointer; padding: 0;
  transition: border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.mob-btn span {
  display: block; width: 16px; height: 1.5px;
  background: var(--tx1, #7b91b0); border-radius: 2px;
  transition: transform .22s ease, opacity .15s, background .15s;
}
.mob-btn.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); background: var(--indigo,#6366f1); }
.mob-btn.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.mob-btn.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); background: var(--indigo,#6366f1); }

/* ── Mobile drawer ─────────────────────── */
.mob-drawer {
  display: none; flex-direction: column;
  background: rgba(4,7,15,.97);
  border-top: 1px solid rgba(255,255,255,.05);
  max-height: calc(100svh - 64px);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: .5rem 0 1rem;
}
.mob-drawer.open { display: flex; }

.mob-link {
  display: block; padding: .85rem 1.25rem;
  color: var(--tx1, #7b91b0); font-size: .95rem; font-weight: 500;
  text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.04);
  transition: color .12s, background .12s;
}
.mob-link:hover { color: var(--tx0,#f0f4ff); background: rgba(255,255,255,.04); }

.mob-group { border-bottom: 1px solid rgba(255,255,255,.04); }
.mob-group-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1.25rem;
  background: none; border: none; color: var(--tx1,#7b91b0);
  font-size: .95rem; font-weight: 500; font-family: inherit;
  cursor: pointer; text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.mob-group-btn::after { content: '▾'; font-size: .7rem; transition: transform .2s; }
.mob-group-btn.open::after { transform: rotate(180deg); }
.mob-group-btn.open { color: var(--indigo,#6366f1); }

.mob-group-list { display: none; background: rgba(0,0,0,.3); padding: .25rem 0; }
.mob-group-list.open { display: block; }
.mob-group-list a {
  display: flex; align-items: center; gap: .5rem;
  padding: .72rem 1.25rem .72rem 2rem;
  color: var(--tx1,#7b91b0); font-size: .9rem; font-weight: 500;
  text-decoration: none; min-height: 44px;
  transition: color .12s, background .12s;
  -webkit-tap-highlight-color: transparent;
}
.mob-group-list a:hover { color: var(--tx0,#f0f4ff); background: rgba(99,102,241,.1); }

.mob-cta {
  margin: .75rem 1rem 0;
  padding: .85rem; text-align: center;
  background: linear-gradient(135deg, var(--indigo,#6366f1), var(--violet,#8b5cf6));
  color: #fff; border-radius: 12px;
  font-weight: 600; font-size: .95rem;
  text-decoration: none;
}

/* ── Breakpoints ───────────────────────── */
@media (max-width: 900px) {
  .hdr-nav { display: none; }
  .hdr-cta { display: none; }
  .mob-btn { display: flex; }
}
@media (max-width: 480px) {
  .hdr-inner { padding: 0 1rem; height: 58px; }
  .mob-drawer { max-height: calc(100svh - 58px); }
}

/* ── Mega-menu — 2-column wide dropdown ─────────────────────── */
.nav-sub-wide {
  width: 540px;
  left: 0 !important;
  transform: translateY(-6px) !important;
}
.nav-drop.open .nav-sub-wide {
  transform: translateY(0) !important;
}
/* For the second dropdown (Tools), align right to avoid overflow */
#dd-tools .nav-sub-wide {
  left: auto !important;
  right: 0 !important;
  transform: translateY(-6px) !important;
}
#dd-tools.open .nav-sub-wide {
  transform: translateY(0) !important;
}

/* Section headers inside dropdown */
.nav-sub-section {
  font-size: .62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--gold, #f0c040);
  padding: .5rem .75rem .2rem;
  opacity: .75;
}

/* 2-column grid for items */
.nav-sub-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .05rem .1rem;
  padding: 0 .25rem .1rem;
}

/* Divider between sections */
.nav-sub-divider {
  height: 1px;
  background: rgba(255,255,255,.05);
  margin: .35rem .6rem;
}

/* Compact item style inside mega-menu cols */
.nav-sub-cols .nav-sub-item {
  padding: .38rem .55rem;
  gap: .55rem;
}
.nav-sub-cols .ns-icon {
  font-size: 1.05rem;
  width: 22px;
}
.nav-sub-cols .nav-sub-item strong {
  font-size: .8rem;
  line-height: 1.2;
}
.nav-sub-cols .nav-sub-item em {
  font-size: .68rem;
  line-height: 1.2;
}

/* Keep dropdown within viewport */
@media (max-width: 1200px) {
  .nav-sub-wide { width: 480px; }
}
@media (max-width: 1050px) {
  .nav-sub-wide {
    width: 320px;
  }
  .nav-sub-cols {
    grid-template-columns: 1fr;
  }
}
