/* Dangercorn shared site layer. Loaded after each page's own CSS.
   Owns: the unified nav, keyboard focus, reduced motion, and the "More" menu. */

:root { --dc-gold: #c9a84c; --dc-gold-lt: #e0c36a; --dc-bg: #13110F; --dc-card: #1A1714; --dc-border: #2E2820; --dc-cream: #F1E9D8; --dc-muted: #A79F8E; }

/* Skip link, first thing a keyboard user hits */
.dc-skip { position: absolute; left: -9999px; top: 0; z-index: 2000; background: var(--dc-gold); color: var(--dc-bg); padding: .6rem 1rem; font-weight: 600; text-decoration: none; border-radius: 0 0 6px 0; }
.dc-skip:focus { left: 0; }

/* Nav: stop the wrap, tighten the rhythm */
#nav, #mainNav, nav.top, nav.nav { gap: 1.25rem; }
.nav-links { gap: 1.6rem !important; flex-wrap: nowrap; }
.nav-links > li { position: relative; white-space: nowrap; }
.nav-links a, .nav-more > button { white-space: nowrap; }
.nav-links a.active { color: var(--dc-gold); }
.nav-links a.active::after { width: 100%; }

/* "More" menu */
.nav-more > button {
  background: none; border: 0; cursor: pointer; font: inherit; color: var(--muted, var(--dc-muted));
  font-size: .85rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase;
  padding: 0; display: inline-flex; align-items: center; gap: .35rem; transition: color .25s;
}
.nav-more > button::after { content: ""; width: 5px; height: 5px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.nav-more > button:hover, .nav-more.open > button { color: var(--gold, var(--dc-gold)); }
.nav-more.open > button::after { transform: rotate(225deg) translateY(-2px); }
.nav-menu {
  display: none; position: absolute; top: calc(100% + 14px); right: -1rem; min-width: 190px;
  background: var(--bg-card, var(--dc-card)); border: 1px solid var(--border, var(--dc-border));
  border-radius: 10px; padding: .5rem; list-style: none; box-shadow: 0 18px 40px rgba(0,0,0,.45); z-index: 1100;
}
.nav-more.open > .nav-menu { display: block; }
.nav-menu li { display: block; }
.nav-menu a { display: block; padding: .6rem .8rem; border-radius: 6px; font-size: .8rem; }
.nav-menu a::after { display: none; }
.nav-menu a:hover, .nav-menu a:focus-visible { background: rgba(201,168,76,.1); }

/* Collapse to the hamburger earlier than 768, the old breakpoint clipped the links */
@media (max-width: 900px) {
  .nav-links { display: none !important; }
  .nav-hamburger { display: flex !important; }
  .nav-links.open {
    display: flex !important; flex-direction: column; position: fixed; inset: 0; z-index: 999;
    background: rgba(19,17,15,.98); backdrop-filter: blur(20px);
    justify-content: center; align-items: center; gap: 1.1rem !important; overflow-y: auto; padding: 5rem 1.5rem 3rem;
  }
  .nav-links.open a, .nav-links.open .nav-more > button { font-size: 1.15rem; color: var(--cream, var(--dc-cream)); }
  .nav-links.open .nav-cta { font-size: .9rem; color: var(--bg, var(--dc-bg)); }
  /* flatten the More menu inside the mobile sheet */
  .nav-links.open .nav-more > button { display: none; }
  .nav-links.open .nav-menu { display: flex !important; flex-direction: column; align-items: center; position: static; background: none; border: 0; box-shadow: none; padding: 0; gap: 1.1rem; min-width: 0; }
  .nav-links.open .nav-menu a { padding: 0; font-size: 1.15rem; }
  .nav-links.open .nav-menu a:hover { background: none; }
}

/* Visible keyboard focus everywhere */
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--dc-gold-lt); outline-offset: 3px; border-radius: 3px;
}

/* Content must never depend on a scroll observer to be readable */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal, .fade-in, [class*="reveal"] { opacity: 1 !important; transform: none !important; }
}
html:not(.dc-js) .reveal, html:not(.dc-js) .fade-in, html:not(.dc-js) [class*="reveal"] { opacity: 1 !important; transform: none !important; }

/* Make long words and URLs wrap instead of forcing sideways scroll on phones */
body { overflow-wrap: break-word; }
img, svg, video { max-width: 100%; }

/* Standalone top bar for pages that have no nav of their own (legal, chronicles, audit intake) */
.dc-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; flex-wrap: wrap; padding: .85rem clamp(1rem, 4vw, 2.5rem); background: rgba(19,17,15,.92); border-bottom: 1px solid var(--dc-border); position: sticky; top: 0; z-index: 900; backdrop-filter: blur(14px); }
.dc-bar-logo { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; font-family: 'DM Serif Display', Georgia, serif; font-size: 1.1rem; color: var(--dc-gold); }
.dc-bar-logo i { width: 30px; height: 30px; border-radius: 7px; background: linear-gradient(135deg, var(--dc-gold), #6b4fa0); display: inline-flex; align-items: center; justify-content: center; }
.dc-bar-links { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.4rem; }
.dc-bar-links a { color: var(--dc-muted); text-decoration: none; font-family: 'DM Sans', system-ui, sans-serif; font-size: .82rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
.dc-bar-links a:hover { color: var(--dc-gold); text-decoration: none; }
.dc-bar-links a.dc-cta { background: var(--dc-gold); color: var(--dc-bg); padding: .5rem 1.1rem; border-radius: 4px; font-weight: 600; }
.dc-bar-links a.dc-cta:hover { background: var(--dc-gold-lt); color: var(--dc-bg); }

/* A blurred nav becomes the containing block for position:fixed children, which shrank the
   full-screen mobile menu to the height of the bar and pushed the links off screen. */
#nav:has(.nav-links.open), #mainNav:has(.nav-links.open), nav:has(> .nav-links.open) {
  -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
}

/* Scroll reveals: opacity only and quick, so nothing sits blank while a visitor jumps to an anchor */
.reveal, .fade-in { transform: none !important; transition: opacity .35s ease !important; }
.reveal-delay-1, .reveal-delay-2, .reveal-delay-3, .reveal-delay-4 { transition-delay: 0s !important; }

/* Keep the logo on one line so the bar stays one row tall */
.nav-logo-text { white-space: nowrap; }
@media (max-width: 1100px) and (min-width: 901px) { .nav-links { gap: 1.15rem !important; } .nav-links a, .nav-more > button { font-size: .78rem; } }
