/*
 * NetWise brand theme for the internal wiki.
 *
 * Design principle: brand the shell, not the documentation. This file
 * only styles shell chrome (header, tabs, footer) and the navy
 * masthead/homepage hero that hooks/nw_theme.py builds around each
 * article's own existing title and intro prose. Below the masthead,
 * article presentation is stock Material for MkDocs — do not add
 * article-body styling here without a clear, documented reason (the one
 * exception is the dark-mode code-block palette, which exists solely to
 * keep syntax-highlighted code WCAG AA compliant; see that section).
 *
 * Colours are the authoritative NetWise brand values (navy #154882,
 * orange #EA8C28) from NetWise-UK/brand-identity-.
 */

:root {
  --netwise-navy: #154882;
  --netwise-navy-dark: #0f3763;
  --netwise-navy-darker: #0a2748;
  --netwise-navy-ink: #0b2038;
  --netwise-orange: #ea8c28;
  --netwise-code-bg: #0f2a4d;
  --netwise-code-fg: #e7edf6;
}

/* ---------------------------------------------------------------------- */
/* Shell palette — drives the header/tabs and Material's own native       */
/* accent usage (search highlight, link/hover accents, etc). Restrained:  */
/* article typography, spacing and component styling below the masthead  */
/* stay stock Material.                                                   */
/* ---------------------------------------------------------------------- */

[data-md-color-scheme="default"],
[data-md-color-scheme="slate"] {
  --md-primary-fg-color: var(--netwise-navy);
  --md-primary-fg-color--light: #2e5f9c;
  --md-primary-fg-color--dark: var(--netwise-navy-darker);
  --md-primary-bg-color: #ffffff;
  --md-primary-bg-color--light: #ffffff;

  --md-accent-fg-color: var(--netwise-orange);
  --md-accent-fg-color--transparent: rgba(234, 140, 40, 0.1);
  --md-accent-bg-color: #ffffff;
  --md-accent-bg-color--light: #ffffff;
}

/* ---------------------------------------------------------------------- */
/* Header — logo-led shell branding, quiet utility controls              */
/* ---------------------------------------------------------------------- */

.md-header {
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

.md-header__inner {
  padding: 0.5rem 0.4rem;
}

.md-header__title {
  display: none;
}

.md-header__button.md-logo {
  margin: 0.1rem;
  padding: 0.1rem;
}

.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  height: 1.5rem;
}

/* A quiet, static tagline stands in for the site-name text we hid above,
   without duplicating the wordmark already inside the logo image. */
.md-header__inner::after {
  content: "INTERNAL WIKI";
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  margin: 0 auto 0 0.6rem;
  align-self: center;
  white-space: nowrap;
}

.md-header__option,
.md-header .md-search,
[data-md-component="palette"],
.md-header__source {
  opacity: 0.82;
  transform: scale(0.94);
}

.md-header__option:hover,
.md-header .md-search:hover,
.md-header__source:hover {
  opacity: 1;
}

.md-search__form {
  background-color: rgba(255, 255, 255, 0.14);
}

.md-search__input {
  font-size: 0.78rem;
}

.md-search__input::placeholder {
  color: rgba(255, 255, 255, 0.65);
}

.md-tabs {
  background-color: var(--netwise-navy-dark);
}

.md-tabs__link {
  font-size: 0.72rem;
  opacity: 0.75;
}

.md-tabs__link--active {
  font-weight: 600;
  opacity: 1;
}

/* Permalink pilcrows: hidden until the heading is hovered or focused —
   never shown just because a heading happens to be the URL's #target.
   Kept from the accessibility/polish pass; harmless to stock Material
   headings and avoids a visually "stuck" pilcrow. */
.md-typeset .headerlink {
  opacity: 0;
}

.md-typeset h1:hover .headerlink,
.md-typeset h2:hover .headerlink,
.md-typeset h3:hover .headerlink,
.md-typeset h4:hover .headerlink,
.md-typeset .headerlink:hover,
.md-typeset .headerlink:focus {
  opacity: 1;
}

/* ---------------------------------------------------------------------- */
/* Article masthead — the navy shell every article gets, built by        */
/* hooks/nw_theme.py from that article's own H1 and intro prose. Nothing  */
/* below this point in the file styles article body content.             */
/* ---------------------------------------------------------------------- */

.nw-masthead {
  position: relative;
  z-index: 2;
  background: linear-gradient(160deg, var(--netwise-navy) 0%, var(--netwise-navy-ink) 100%);
  color: rgba(255, 255, 255, 0.92);
  margin: -1.2rem calc(-50vw + 50%) 1.6rem;
  padding: 2.1rem calc(50vw - 50% + 1.2rem) 1.9rem;
}

@media screen and (min-width: 76.25em) {
  .nw-masthead {
    padding-left: max(1.6rem, calc((100vw - 61rem) / 2 + 1.6rem));
    padding-right: max(1.6rem, calc((100vw - 61rem) / 2 + 1.6rem));
  }
}

.nw-masthead .nw-eyebrow {
  color: var(--netwise-orange);
}

.nw-masthead .nw-eyebrow::before {
  background-color: var(--netwise-orange);
}

.nw-masthead h1 {
  color: #ffffff;
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.15;
  margin: 0.5rem 0 0.7rem;
  letter-spacing: -0.01em;
}

.nw-masthead h1 .headerlink {
  display: none;
}

.nw-masthead p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.82rem;
  max-width: 46rem;
  margin: 0.4rem 0;
}

.nw-masthead strong {
  color: #ffffff;
}

.nw-masthead code {
  background-color: rgba(255, 255, 255, 0.14);
  color: #ffe6bf;
}

.nw-masthead a {
  color: #cfe1f7;
  text-decoration-color: rgba(207, 225, 247, 0.5);
}

.nw-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  margin: 0;
}

.nw-eyebrow::before {
  content: "";
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  background-color: var(--netwise-orange);
}

/* ---------------------------------------------------------------------- */
/* Home page — a landing page, not an ordinary article                   */
/* ---------------------------------------------------------------------- */

.nw-home-hero {
  position: relative;
  z-index: 2;
  background: linear-gradient(160deg, var(--netwise-navy) 0%, var(--netwise-navy-ink) 100%);
  color: rgba(255, 255, 255, 0.92);
  margin: -1.2rem calc(-50vw + 50%) 2rem;
  padding: 3rem calc(50vw - 50% + 1.2rem) 2.6rem;
}

@media screen and (min-width: 76.25em) {
  .nw-home-hero {
    padding-left: max(1.6rem, calc((100vw - 61rem) / 2 + 1.6rem));
    padding-right: max(1.6rem, calc((100vw - 61rem) / 2 + 1.6rem));
  }
}

.nw-home-hero .nw-eyebrow {
  color: var(--netwise-orange);
}

.nw-home-hero .nw-eyebrow::before {
  background-color: var(--netwise-orange);
}

.nw-home-hero h1 {
  color: #ffffff;
  font-weight: 700;
  font-size: 2.5rem;
  margin: 0.6rem 0 0.9rem;
}

.nw-home-hero h1 .headerlink {
  display: none;
}

.nw-home-hero p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.95rem;
  max-width: 42rem;
  margin: 0;
}

.nw-home-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media screen and (max-width: 76.24em) {
  .nw-home-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 44.9375em) {
  .nw-home-grid {
    grid-template-columns: 1fr;
  }
}

.nw-home-card {
  background-color: var(--md-default-bg-color);
  border: 1px solid rgba(10, 39, 72, 0.1);
  border-left: 3px solid var(--netwise-navy);
  border-radius: 4px;
  padding: 1rem 1.15rem 1.15rem;
}

[data-md-color-scheme="slate"] .nw-home-card {
  border-color: rgba(255, 255, 255, 0.1);
  border-left-color: var(--netwise-orange);
}

.nw-home-card:not(:has(a)) {
  border-left-color: rgba(10, 39, 72, 0.25);
  opacity: 0.72;
}

.nw-home-card h2 {
  margin-top: 0;
}

.nw-home-card h2 .headerlink {
  display: none;
}

.nw-home-card ul {
  list-style: none;
  padding-left: 0;
}

.nw-home-card li a::after {
  content: " →";
}

/* ---------------------------------------------------------------------- */
/* Code blocks — accessibility exception to "stock Material below the    */
/* masthead". Material's own syntax-token colours are tuned for its own  */
/* stock per-scheme code background; in light mode that pairing is       */
/* untouched here and stays fully stock. In dark mode we keep a navy     */
/* block background (an "appropriate dark" block, not decorative extra   */
/* styling) together with a token palette verified at ~6.7-12.2:1        */
/* against it — Material's own dark-mode defaults were never designed    */
/* for this background and would fall as low as ~1.3:1 on it. Scoped to  */
/* .highlight only, so inline code in prose stays fully stock in both    */
/* modes.                                                                 */
/* ---------------------------------------------------------------------- */

[data-md-color-scheme="slate"] .md-typeset .highlight {
  --md-code-bg-color: var(--netwise-code-bg);
  --md-code-fg-color: var(--netwise-code-fg);
  --md-code-hl-comment-color: #9fb3cc;
  --md-code-hl-operator-color: #c9d6e8;
  --md-code-hl-punctuation-color: #c9d6e8;
  --md-code-hl-generic-color: #c9d6e8;
  --md-code-hl-variable-color: #c9d6e8;
  --md-code-hl-string-color: #7fd7a4;
  --md-code-hl-special-color: #ff9ecf;
  --md-code-hl-number-color: #ff9d7a;
  --md-code-hl-keyword-color: #82b4f2;
  --md-code-hl-name-color: var(--netwise-code-fg);
  --md-code-hl-constant-color: #c3b1ff;
  --md-code-hl-function-color: #f2b866;
}

/* ---------------------------------------------------------------------- */
/* Footer — quiet navy, consistent with the header (shell bookends)      */
/* ---------------------------------------------------------------------- */

.md-footer-meta {
  background-color: var(--netwise-navy-darker);
}

.md-footer {
  background-color: var(--netwise-navy-dark);
}
