/* The navbar's Industries menu (base.html): a dropdown of the sector pages on desktop, opened by
   hover, focus or click (nav-industries.js), and a fold-out list in the phone menu. */
.nav-industries {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-industries__toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    cursor: pointer;
}

.nav-industries__toggle svg {
    width: 0.75rem;
    height: 0.75rem;
    transition: transform 0.25s ease;
}

.nav-industries__panel {
    position: absolute;
    top: calc(100% + 1.1rem);
    left: 50%;
    z-index: 60;
    width: 30rem;
    padding: 0.6rem;
    white-space: normal;
    border-radius: 1.1rem;
    background: #FFFFFF;
    box-shadow: 0 0 0 1px var(--kd-line), 0 30px 60px -25px rgba(15, 23, 42, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 6px);
    transition: opacity 0.2s ease, transform 0.25s ease, visibility 0.2s;
}

/* Keeps the menu open while the pointer crosses the gap between the link and the panel. */
.nav-industries__panel::before {
    content: "";
    position: absolute;
    inset: -1.2rem 0 100%;
}

.nav-industries:hover .nav-industries__panel,
.nav-industries:focus-within .nav-industries__panel,
.nav-industries.is-open .nav-industries__panel {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.nav-industries.is-closed .nav-industries__panel {
    opacity: 0;
    visibility: hidden;
}

.nav-industries:hover .nav-industries__toggle svg,
.nav-industries.is-open .nav-industries__toggle svg {
    transform: rotate(180deg);
}

.nav-industries__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-industries__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem;
    border-radius: 0.8rem;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.nav-industries__item:hover,
.nav-industries__item:focus-visible {
    background: var(--kd-brand-soft);
    outline: none;
}

.nav-industries__icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.7rem;
    background: var(--kd-brand-soft);
    color: var(--kd-brand);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-industries__item:hover .nav-industries__icon,
.nav-industries__item:focus-visible .nav-industries__icon {
    background: var(--kd-brand);
    color: #FFFFFF;
}

.nav-industries__icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.nav-industries__name {
    color: var(--kd-ink);
    font-size: 0.9rem;
    font-weight: 700;
}

.nav-industries__all {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    padding: 0.85rem 0.75rem 0.35rem;
    border-top: 1px solid var(--kd-line);
    color: var(--kd-brand);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
}

.nav-industries__all span {
    transition: transform 0.25s ease;
}

.nav-industries__all:hover span {
    transform: translateX(4px);
}

/* ---------- Phone menu ---------- */
.mnav-industries summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    list-style: none;
    cursor: pointer;
}

.mnav-industries summary::-webkit-details-marker {
    display: none;
}

.mnav-industries summary::after {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.25s ease;
}

.mnav-industries[open] summary::after {
    transform: rotate(225deg) translateY(-2px);
}

.mnav-industries ul {
    display: grid;
    gap: 0.9rem;
    margin: 1rem 0 0;
    padding: 0 0 0 1rem;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    list-style: none;
}

.mnav-industries a {
    color: rgba(255, 255, 255, 0.75);
    font-size: 1rem;
    text-decoration: none;
}

.mnav-industries a:hover {
    color: #FFFFFF;
}

@media (prefers-reduced-motion: reduce) {
    .nav-industries__panel,
    .nav-industries__toggle svg {
        transition: none;
    }
}
