/* Header drop-down menus for "Test" and "Learning Hub" (built by js/nav-dropdown.js).
   Desktop: opens when the cursor is on the item. Phone: the item opens/closes on tap, inside the mobile menu. */

.nav-item { display: flex; align-items: center; }
.nav-item > .nav-link { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; }
.nav-item .nav-caret { width: 10px; height: 10px; flex: none; transition: transform .25s ease; }
.nav-item.is-open > .nav-link { color: var(--color-text-main, #051747); }
.nav-item.is-open > .nav-link::after { width: 100%; }
.nav-item.is-open .nav-caret { transform: rotate(180deg); }

/* The panel hangs under the whole header pill (the pill is the positioned ancestor) */
.nav-dropdown {
    position: absolute; top: 100%; left: 0; right: 0;
    padding-top: 12px;                       /* invisible bridge so the cursor can travel from the item to the panel */
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
    z-index: 1001;
}
.nav-item.is-open > .nav-dropdown { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }

.nav-dropdown-card {
    background: #fff; border: 1px solid rgba(231, 233, 240, .9); border-radius: 22px;
    box-shadow: 0 24px 50px -16px rgba(5, 23, 71, .28);
    padding: 1.4rem 1.5rem 1.1rem;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.4rem;
    text-align: left;
}
.nav-col h4 {
    margin: 0 0 .55rem; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: #535F80; font-weight: 700;
    font-family: 'DM Sans', 'Inter', sans-serif !important; display: flex; align-items: center; gap: .45rem;
}
.nav-col h4 a { color: inherit; text-decoration: none; }
.nav-col h4 a:hover { color: #081F62; }
.nav-col ul { list-style: none; margin: 0; padding: 0; }
.nav-col li a, .nav-col li span {
    display: block; padding: .42rem .6rem; margin: 0 -.6rem; border-radius: 10px;
    font-family: 'DM Sans', 'Inter', sans-serif; font-size: .92rem; font-weight: 500; line-height: 1.35;
    color: #051747; text-decoration: none;
}
.nav-col li a:hover { background: #eef2ff; color: #081F62; }
.nav-col li span.is-locked { color: #8a93ab; cursor: default; }
.nav-col li a.is-today { font-weight: 700; color: #081F62; }
.nav-col li a.is-all { color: #2563eb; font-weight: 600; }
.nav-col li.is-title a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nav-dropdown-foot { grid-column: 1 / -1; border-top: 1px solid #eef0f6; padding-top: .8rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .88rem; }
.nav-dropdown-foot a { color: #2563eb; font-weight: 600; text-decoration: none; font-family: 'DM Sans', 'Inter', sans-serif; }
.nav-dropdown-foot a:hover { text-decoration: underline; }
.nav-dropdown-foot span { color: #535F80; font-family: 'DM Sans', 'Inter', sans-serif; }

/* Learning Hub: small list under the item (not the full-width panel) */
.nav-item-compact { position: relative; }
.nav-item-compact > .nav-dropdown { left: 50%; right: auto; width: 230px; transform: translate(-50%, -6px); }
.nav-item-compact.is-open > .nav-dropdown { transform: translateX(-50%); }
.nav-dropdown-card.is-compact { display: block; padding: .55rem; border-radius: 18px; }
.is-compact .nav-col li a { display: flex; align-items: center; gap: .6rem; margin: 0; padding: .65rem .85rem; font-weight: 600; font-size: .95rem; }
.is-compact .nav-col li a .nav-ico { display: inline-block; flex: none; width: 1.3rem; margin: 0; padding: 0; text-align: center; }

/* Test list: skill headings with their options indented underneath */
.is-compact .nav-col h4 { margin: 0; padding: .55rem .85rem .2rem; }
.is-compact .nav-col + .nav-col { border-top: 1px solid #eef0f6; margin-top: .25rem; }
.is-compact .nav-sub li a, .is-compact .nav-sub li span { padding: .38rem .85rem .38rem 2.6rem; margin: 0; font-weight: 500; font-size: .9rem; }

/* ---- hover effects ---- */
/* Learning Hub list rows: soft highlight + a small slide */
.is-compact .nav-col li a { transition: background .2s ease, color .2s ease, padding-left .2s ease; }
.is-compact .nav-col li a .nav-ico { transition: transform .25s cubic-bezier(.34, 1.56, .64, 1); }
.is-compact .nav-col li a:hover { padding-left: 1.15rem; }
.is-compact .nav-col li a:hover .nav-ico { transform: scale(1.25) rotate(-8deg); }

/* Test list: the skill row lights up and its options slide open underneath */
.nav-col-skill > h4 { cursor: pointer; border-radius: 12px; margin: .1rem 0; width: 100%; box-sizing: border-box;
    transition: background .22s ease, color .22s ease, padding-left .22s ease; }
.nav-col-skill > h4::after { content: "\203A"; margin-left: auto; font-size: 1.15rem; line-height: 1; color: #9aa3bd;
    transition: transform .28s ease, color .22s ease; }
.nav-col-skill > h4 .nav-ico { display: inline-block; transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }
.nav-col-skill:hover > h4, .nav-col-skill:focus-within > h4, .nav-col-skill.is-expanded > h4 { background: #eef2ff; color: #081F62; padding-left: 1.1rem; }
.nav-col-skill:hover > h4::after, .nav-col-skill:focus-within > h4::after, .nav-col-skill.is-expanded > h4::after { transform: rotate(90deg); color: #2563eb; }
.nav-col-skill:hover > h4 .nav-ico, .nav-col-skill:focus-within > h4 .nav-ico, .nav-col-skill.is-expanded > h4 .nav-ico { transform: scale(1.3) rotate(-10deg); }

.nav-col-skill > .nav-sub { max-height: 0; opacity: 0; overflow: hidden; transition: max-height .35s ease, opacity .25s ease; }
.nav-col-skill:hover > .nav-sub, .nav-col-skill:focus-within > .nav-sub, .nav-col-skill.is-expanded > .nav-sub { max-height: 140px; opacity: 1; }
.nav-sub li { opacity: 0; transform: translateX(-12px); transition: opacity .28s ease, transform .28s cubic-bezier(.22, 1, .36, 1); }
.nav-col-skill:hover .nav-sub li, .nav-col-skill:focus-within .nav-sub li, .nav-col-skill.is-expanded .nav-sub li { opacity: 1; transform: none; }
.nav-col-skill:hover .nav-sub li:nth-child(2), .nav-col-skill:focus-within .nav-sub li:nth-child(2), .nav-col-skill.is-expanded .nav-sub li:nth-child(2) { transition-delay: .07s; }
.nav-sub li a, .nav-sub li span { transition: background .2s ease, color .2s ease, padding-left .2s ease; }
.nav-sub li a:hover { background: #eef2ff; color: #2563eb; padding-left: 3.1rem; }
.nav-sub li a::before { content: "\2192"; display: inline-block; width: 0; margin-left: -1.1rem; opacity: 0; color: #2563eb; transition: opacity .2s ease, margin .2s ease, width .2s ease; }
.nav-sub li a:hover::before { width: 1.1rem; margin-left: 0; opacity: 1; }

/* Phone / tablet: the menu is the stacked mobile menu, so the panel opens inline */
@media (max-width: 768px) {
    .navbar .nav-links.active { max-height: calc(100vh - 90px); max-height: calc(100dvh - 90px); overflow-y: auto; overscroll-behavior: contain; }
    .nav-item { display: block; }
    .nav-col-skill > .nav-sub { max-height: none; opacity: 1; }
    .nav-sub li { opacity: 1; transform: none; }
    .nav-col-skill > h4::after { display: none; }
    .nav-item-compact { position: static; }
    .nav-item-compact > .nav-dropdown, .nav-item-compact.is-open > .nav-dropdown { left: auto; width: auto; transform: none; }
    .nav-dropdown-card.is-compact { padding: .3rem 0 0; }
    .is-compact .nav-col li a { padding: .6rem .2rem; }
    .nav-item > .nav-link { display: flex; justify-content: space-between; width: 100%; }
    .nav-dropdown { position: static; padding-top: 0; transform: none; display: none; opacity: 1; visibility: visible; transition: none; }
    .nav-item.is-open > .nav-dropdown { display: block; }
    .nav-dropdown-card { grid-template-columns: 1fr; gap: 1rem; box-shadow: none; border: 0; border-radius: 0; padding: .8rem 0 .2rem; background: transparent; }
    .nav-dropdown-foot { grid-column: auto; }
}
@media (min-width: 769px) and (max-width: 980px) {
    .nav-dropdown-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .nav-dropdown, .nav-item .nav-caret { transition: none; } }
/* ---- footer "Quick Links": Test / Learning Hub open underneath the link ---- */
.footer-dd-item > a { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; }
.footer-dd-item .nav-caret { width: 10px; height: 10px; flex: none; transition: transform .25s ease; }
.footer-dd-item.is-open > a .nav-caret { transform: rotate(180deg); }
.footer-dd { max-height: 0; opacity: 0; overflow: hidden; transition: max-height .4s ease, opacity .25s ease; }
.footer-dd-item.is-open > .footer-dd { max-height: 560px; opacity: 1; }
.footer-dd .nav-dropdown-card.is-compact { border: 0; box-shadow: none; background: transparent; border-radius: 0; padding: .35rem 0 .2rem .4rem; }
.footer-dd .nav-col h4 { color: #535F80; }
@media (prefers-reduced-motion: reduce) { .footer-dd, .footer-dd-item .nav-caret { transition: none; } }

