Files
deepdrft/DeepDrftPublic.Client/Layout/DeepDrftMenu.razor.css
T
daniel-c-harvey c44117ccc5 fix(8.J): close ARCHIVE dropdown on child link click
Add dd-nav-item-collapsed CSS class toggled on child click to override the
:hover/:focus-within show rules. Cleared on mouseleave so hover-to-open
works normally on the next pass. Mirrors the existing CloseMobileMenu pattern.
2026-06-13 19:45:55 -04:00

286 lines
6.2 KiB
CSS

/* Frosted-glass top navigation.
Scoped to DeepDrftMenu.razor only — global styles live in deepdrft-styles.css.
The CSS variables consumed here (--deepdrft-navy etc.) are theme-aware and
defined globally; the dd-nav-dark modifier overrides the backdrop RGBA since
it must be hard-coded for the blur fallback. */
.dd-nav {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 100;
display: flex;
align-items: center;
justify-content: space-between;
gap: 2rem;
padding: 1.5rem 3rem;
border-bottom: 1px solid var(--deepdrft-border);
box-shadow: none;
-webkit-backdrop-filter: blur(18px);
backdrop-filter: blur(18px);
}
.dd-nav-light {
background: rgba(250, 250, 248, 0.88);
}
.dd-nav-dark {
background: rgba(13, 13, 18, 0.85);
}
/* Brand */
.dd-nav-brand {
font-family: var(--deepdrft-font-mono);
font-size: 0.75rem;
letter-spacing: 0.22em;
text-transform: uppercase;
color: var(--deepdrft-navy);
text-decoration: none;
white-space: nowrap;
}
.dd-nav-dark .dd-nav-brand {
color: var(--deepdrft-white);
}
/* Centred link list */
.dd-nav-links {
display: flex;
align-items: center;
gap: 2.5rem;
flex: 1;
justify-content: center;
list-style: none;
margin: 0;
padding: 0;
}
.dd-nav-link {
font-family: var(--deepdrft-font-mono);
font-size: 0.68rem;
letter-spacing: 0.18em;
text-transform: uppercase;
color: var(--deepdrft-muted);
text-decoration: none;
transition: color 0.25s ease;
}
.dd-nav-link:hover,
.dd-nav-link:focus-visible {
color: var(--deepdrft-navy);
}
.dd-nav-dark .dd-nav-link:hover,
.dd-nav-dark .dd-nav-link:focus-visible {
color: var(--deepdrft-white);
}
/* Dual-role parent node: anchor for the parent route, positioning context for the dropdown. */
.dd-nav-item-parent {
position: relative;
}
/* Hover-revealed child dropdown. Pure CSS — hidden by default, shown when the parent item is
hovered or contains keyboard focus. Sits directly beneath the parent link, frosted to match
the bar. */
.dd-nav-dropdown {
position: absolute;
top: 100%;
left: 50%;
transform: translateX(-50%) translateY(0.25rem);
display: flex;
flex-direction: column;
align-items: stretch;
gap: 0.75rem;
list-style: none;
margin: 0;
padding: 1rem 1.5rem;
min-width: 9rem;
background: rgba(250, 250, 248, 0.96);
border: 1px solid var(--deepdrft-border);
-webkit-backdrop-filter: blur(18px);
backdrop-filter: blur(18px);
opacity: 0;
visibility: hidden;
pointer-events: none;
transition: opacity 0.18s ease, visibility 0.18s ease;
z-index: 101;
}
.dd-nav-dark .dd-nav-dropdown {
background: rgba(13, 13, 18, 0.95);
}
.dd-nav-item-parent:hover .dd-nav-dropdown,
.dd-nav-item-parent:focus-within .dd-nav-dropdown {
opacity: 1;
visibility: visible;
pointer-events: auto;
}
/* Force-close the dropdown immediately after a child link is clicked (SPA navigation
keeps the DOM and :hover may remain true). Cleared on mouseleave so the next
hover cycle works normally. */
.dd-nav-item-parent.dd-nav-item-collapsed .dd-nav-dropdown {
opacity: 0 !important;
visibility: hidden !important;
pointer-events: none !important;
}
.dd-nav-dropdown-link {
white-space: nowrap;
}
/* Right-side cluster */
.dd-nav-actions {
display: flex;
align-items: center;
gap: 1rem;
}
/* Stream Now CTA — square pill, navy on warm white */
::deep .dd-nav-cta {
display: inline-block;
font-family: var(--deepdrft-font-mono);
font-size: 0.68rem;
letter-spacing: 0.18em;
text-transform: uppercase;
color: var(--deepdrft-white);
background: var(--deepdrft-navy);
padding: 0.6rem 1.4rem;
border: none;
border-radius: 0;
text-decoration: none;
cursor: pointer;
transition: background 0.25s ease;
}
::deep .dd-nav-cta:hover,
::deep .dd-nav-cta:focus-visible {
background: var(--deepdrft-green);
}
.dd-nav-dark ::deep .dd-nav-cta {
color: var(--deepdrft-white);
background: var(--deepdrft-primary);
}
.dd-nav-dark ::deep .dd-nav-cta:hover,
.dd-nav-dark ::deep .dd-nav-cta:focus-visible {
background: var(--deepdrft-senary);
}
/* Dark-mode toggle (gas lamp) */
.dd-nav-toggle {
width: 2rem;
height: 2rem;
padding: 0;
background: transparent;
border: none;
cursor: pointer;
color: var(--deepdrft-navy);
display: inline-flex;
align-items: center;
justify-content: center;
transition: color 0.25s ease;
}
.dd-nav-toggle:hover,
.dd-nav-toggle:focus-visible {
color: var(--deepdrft-green-accent);
}
.dd-nav-toggle::deep svg {
width: 1.25rem;
height: 1.25rem;
}
.dd-nav-dark .dd-nav-toggle {
color: var(--deepdrft-white);
}
.dd-nav-dark .dd-nav-toggle:hover,
.dd-nav-dark .dd-nav-toggle:focus-visible {
color: var(--deepdrft-tertiary);
}
/* Mobile hamburger */
.dd-nav-hamburger {
width: 2rem;
height: 2rem;
padding: 0;
background: transparent;
border: none;
cursor: pointer;
display: inline-flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 4px;
}
.dd-nav-hamburger span {
display: block;
width: 1.25rem;
height: 1.5px;
background: var(--deepdrft-navy);
}
.dd-nav-dark .dd-nav-hamburger span {
background: var(--deepdrft-white);
}
/* Mobile dropdown panel — absolute-positioned beneath the bar */
.dd-nav-links-mobile {
position: absolute;
top: 100%;
left: 0;
right: 0;
flex-direction: column;
align-items: stretch;
gap: 0;
padding: 0.75rem 1.5rem 1.25rem;
background: rgba(250, 250, 248, 0.96);
border-bottom: 1px solid var(--deepdrft-border);
-webkit-backdrop-filter: blur(18px);
backdrop-filter: blur(18px);
}
.dd-nav-dark .dd-nav-links-mobile {
background: rgba(13, 13, 18, 0.95);
}
.dd-nav-links-mobile li {
padding: 0.6rem 0;
}
/* Indented child rows under their parent link in the mobile drawer. */
.dd-nav-mobile-child {
padding-left: 1.25rem;
}
.dd-nav-links-mobile ::deep .dd-nav-cta {
margin-top: 0.5rem;
text-align: center;
}
/* Mobile padding — give the nav room to breathe without crowding */
@media (max-width: 599px) {
.dd-nav {
padding: 1rem 1.25rem;
}
}