/* ==========================================================================
   docs-lulindingo.css
   Dark stylesheet for LuLinDingo feature-guide pages.
   ALL rules scoped under body.lld — cannot leak into the light main site.
   Pages load: variables.css → reset.css → this file (no base/layout/components).
   ========================================================================== */

/* --------------------------------------------------------------------------
   LuLinDingo design tokens
   Hex values mirror ../LuLinDingo/src/index.css
   -------------------------------------------------------------------------- */
body.lld {
  /* Backgrounds */
  --lld-bg: #1a2332;
  --lld-surface: #1f2f40;
  --lld-surface-raised: #253545;

  /* Borders */
  --lld-border: #2a3a4a;

  /* Text */
  --lld-text: #ffffff;
  --lld-text-secondary: #8899aa;

  /* Accents */
  --lld-green: #58cc02;
  --lld-blue: #1cb0f6;
  --lld-yellow: #ffc800;
  --lld-pink: #ff86d0;
  --lld-orange: #ff9600;
  --lld-grey: #8899aa;

  /* Typography */
  --lld-font: "Nunito", sans-serif;

  /* Radii */
  --lld-radius-sm: 8px;
  --lld-radius-md: 12px;
  --lld-radius-lg: 16px;

  /* Spacing */
  --lld-space-1: 4px;
  --lld-space-2: 8px;
  --lld-space-3: 16px;
  --lld-space-4: 24px;
  --lld-space-5: 32px;

  /* Shadows (dark-mode — heavier alpha) */
  --lld-shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.35);
  --lld-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
  --lld-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.55);

  /* Transitions */
  --lld-transition: 200ms ease;
}

/* --------------------------------------------------------------------------
   Base — body, typography
   -------------------------------------------------------------------------- */
body.lld {
  background-color: var(--lld-bg);
  color: var(--lld-text);
  font-family: var(--lld-font);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.lld *,
body.lld *::before,
body.lld *::after {
  box-sizing: border-box;
}

body.lld a {
  color: var(--lld-blue);
  text-decoration: none;
  transition:
    color var(--lld-transition),
    opacity var(--lld-transition);
}

body.lld a:hover {
  color: var(--lld-text);
  text-decoration: underline;
}

body.lld img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --------------------------------------------------------------------------
   Skip link
   -------------------------------------------------------------------------- */
body.lld .skip-link {
  position: absolute;
  top: -100%;
  left: var(--lld-space-3);
  background: var(--lld-blue);
  color: var(--lld-bg);
  padding: var(--lld-space-2) var(--lld-space-3);
  border-radius: var(--lld-radius-sm);
  font-weight: 700;
  font-size: 0.875rem;
  z-index: 9999;
  transition: top var(--lld-transition);
}

body.lld .skip-link:focus {
  top: var(--lld-space-2);
}

/* --------------------------------------------------------------------------
   Container utility
   -------------------------------------------------------------------------- */
body.lld .container {
  width: 100%;
  max-width: var(--container-max, 1200px);
  margin-inline: auto;
  padding-inline: clamp(1rem, 3vw, 2rem);
}

/* --------------------------------------------------------------------------
   Nav — restyle existing markup dark
   -------------------------------------------------------------------------- */
body.lld .nav {
  position: sticky;
  top: 0;
  z-index: var(--z-nav, 100);
  background-color: var(--lld-surface);
  border-bottom: 1px solid var(--lld-border);
  transition: box-shadow var(--lld-transition);
}

body.lld .nav.scrolled {
  box-shadow: var(--lld-shadow-md);
}

body.lld .nav__inner {
  display: flex;
  align-items: center;
  gap: var(--lld-space-3);
  height: 60px;
}

body.lld .nav__logo {
  font-family: var(--lld-font);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--lld-text);
  letter-spacing: -0.02em;
  text-decoration: none;
  flex-shrink: 0;
}

body.lld .nav__logo:hover {
  color: var(--lld-blue);
  text-decoration: none;
}

body.lld .nav__links {
  display: flex;
  align-items: center;
  gap: var(--lld-space-1);
  list-style: none;
  margin: 0;
  padding: 0;
  margin-inline-start: auto;
}

body.lld .nav__link {
  display: block;
  padding: var(--lld-space-2) var(--lld-space-3);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--lld-text-secondary);
  border-radius: var(--lld-radius-sm);
  text-decoration: none;
  transition:
    color var(--lld-transition),
    background var(--lld-transition);
}

body.lld .nav__link:hover {
  color: var(--lld-text);
  background: rgba(255, 255, 255, 0.07);
  text-decoration: none;
}

/* Mobile nav toggle button */
body.lld .nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 6px;
  margin-inline-start: auto;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--lld-radius-sm);
  transition: background var(--lld-transition);
}

body.lld .nav__toggle:hover {
  background: rgba(255, 255, 255, 0.07);
}

body.lld .nav__toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--lld-text);
  border-radius: 2px;
  transition:
    transform var(--lld-transition),
    opacity var(--lld-transition);
  transform-origin: center;
}

/* Active (open) hamburger → X */
body.lld .nav__toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
body.lld .nav__toggle.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
body.lld .nav__toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   Footer — restyle existing markup dark
   -------------------------------------------------------------------------- */
body.lld .footer {
  background-color: var(--lld-surface);
  border-top: 1px solid var(--lld-border);
  margin-top: var(--lld-space-5);
  padding-block: var(--lld-space-4);
}

body.lld .footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--lld-space-3);
}

body.lld .footer__brand {
  font-weight: 800;
  font-size: 1rem;
  color: var(--lld-text);
  text-decoration: none;
  margin-inline-end: auto;
}

body.lld .footer__brand:hover {
  color: var(--lld-blue);
  text-decoration: none;
}

body.lld .footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--lld-space-2) var(--lld-space-3);
}

body.lld .footer__link {
  font-size: 0.875rem;
  color: var(--lld-text-secondary);
  text-decoration: none;
  transition: color var(--lld-transition);
}

body.lld .footer__link:hover {
  color: var(--lld-text);
  text-decoration: none;
}

body.lld .footer__credit {
  width: 100%;
  font-size: 0.8125rem;
  color: var(--lld-text-secondary);
  margin: 0;
}

/* --------------------------------------------------------------------------
   Main content wrapper
   -------------------------------------------------------------------------- */
body.lld .lld-main {
  max-width: 820px;
  margin-inline: auto;
  padding-block: var(--lld-space-5);
  padding-inline: clamp(1rem, 3vw, 2rem);
}

/* --------------------------------------------------------------------------
   Hero — hub page
   -------------------------------------------------------------------------- */
body.lld .lld-hero {
  margin-bottom: var(--lld-space-5);
}

body.lld .lld-hero__title {
  font-size: clamp(2rem, 4vw + 1rem, 3rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--lld-text);
  margin: 0 0 var(--lld-space-3);
}

body.lld .lld-hero__intro {
  font-size: clamp(1rem, 1.5vw + 0.5rem, 1.1875rem);
  color: var(--lld-text-secondary);
  line-height: 1.7;
  max-width: 640px;
  margin: 0;
}

/* --------------------------------------------------------------------------
   Group — section grouping cards on the hub
   -------------------------------------------------------------------------- */
body.lld .lld-group {
  margin-bottom: var(--lld-space-5);
}

body.lld .lld-group__title {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--lld-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 var(--lld-space-3);
  padding-bottom: var(--lld-space-2);
  border-bottom: 1px solid var(--lld-border);
}

/* --------------------------------------------------------------------------
   Grid — responsive card grid
   -------------------------------------------------------------------------- */
body.lld .lld-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--lld-space-3);
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
body.lld .lld-card {
  display: flex;
  flex-direction: column;
  background: var(--lld-surface);
  border: 1px solid var(--lld-border);
  border-radius: var(--lld-radius-lg);
  padding: var(--lld-space-4);
  text-decoration: none;
  color: inherit;
  transition:
    transform var(--lld-transition),
    box-shadow var(--lld-transition),
    border-color var(--lld-transition);
  cursor: pointer;
}

body.lld .lld-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--lld-shadow-lg);
  text-decoration: none;
}

body.lld .lld-card__title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--lld-text);
  margin: 0 0 var(--lld-space-2);
  line-height: 1.3;
}

body.lld .lld-card__desc {
  font-size: 0.875rem;
  color: var(--lld-text-secondary);
  line-height: 1.6;
  margin: 0;
  flex-grow: 1;
}

/* Card accent modifiers — left border tint + hover glow */
body.lld .lld-card--green {
  border-left: 4px solid var(--lld-green);
}
body.lld .lld-card--green:hover {
  border-color: var(--lld-green);
  box-shadow: 0 8px 32px rgba(88, 204, 2, 0.2);
}

body.lld .lld-card--blue {
  border-left: 4px solid var(--lld-blue);
}
body.lld .lld-card--blue:hover {
  border-color: var(--lld-blue);
  box-shadow: 0 8px 32px rgba(28, 176, 246, 0.2);
}

body.lld .lld-card--yellow {
  border-left: 4px solid var(--lld-yellow);
}
body.lld .lld-card--yellow:hover {
  border-color: var(--lld-yellow);
  box-shadow: 0 8px 32px rgba(255, 200, 0, 0.2);
}

body.lld .lld-card--pink {
  border-left: 4px solid var(--lld-pink);
}
body.lld .lld-card--pink:hover {
  border-color: var(--lld-pink);
  box-shadow: 0 8px 32px rgba(255, 134, 208, 0.2);
}

body.lld .lld-card--orange {
  border-left: 4px solid var(--lld-orange);
}
body.lld .lld-card--orange:hover {
  border-color: var(--lld-orange);
  box-shadow: 0 8px 32px rgba(255, 150, 0, 0.2);
}

body.lld .lld-card--grey {
  border-left: 4px solid var(--lld-grey);
}
body.lld .lld-card--grey:hover {
  border-color: var(--lld-grey);
  box-shadow: 0 8px 32px rgba(136, 153, 170, 0.2);
}

/* --------------------------------------------------------------------------
   Breadcrumb
   -------------------------------------------------------------------------- */
body.lld .lld-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--lld-space-2);
  font-size: 0.8125rem;
  color: var(--lld-text-secondary);
  margin-bottom: var(--lld-space-4);
  list-style: none;
  padding: 0;
}

body.lld .lld-breadcrumb a {
  color: var(--lld-text-secondary);
  text-decoration: none;
  transition: color var(--lld-transition);
}

body.lld .lld-breadcrumb a:hover {
  color: var(--lld-blue);
  text-decoration: none;
}

/* Separator injected between items via + li::before */
body.lld .lld-breadcrumb li + li::before {
  content: "/";
  margin-inline-end: var(--lld-space-2);
  opacity: 0.4;
}

/* --------------------------------------------------------------------------
   Doc article — guide prose
   -------------------------------------------------------------------------- */
body.lld .lld-doc {
  color: var(--lld-text);
  font-size: 1rem;
  line-height: 1.75;
}

body.lld .lld-doc h1 {
  font-size: clamp(1.75rem, 3vw + 0.5rem, 2.5rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--lld-text);
  margin: 0 0 var(--lld-space-4);
}

body.lld .lld-doc h2,
body.lld .lld-doc__h2 {
  font-size: clamp(1.25rem, 2vw + 0.5rem, 1.625rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--lld-text);
  margin: var(--lld-space-5) 0 var(--lld-space-3);
  padding-bottom: var(--lld-space-2);
  border-bottom: 1px solid var(--lld-border);
}

body.lld .lld-doc h3 {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--lld-text);
  margin: var(--lld-space-4) 0 var(--lld-space-2);
}

body.lld .lld-doc p {
  margin: 0 0 var(--lld-space-3);
  max-width: 68ch;
}

body.lld .lld-doc ul,
body.lld .lld-doc ol {
  margin: 0 0 var(--lld-space-3);
  padding-inline-start: var(--lld-space-4);
}

body.lld .lld-doc li {
  margin-bottom: var(--lld-space-2);
}

body.lld .lld-doc li:last-child {
  margin-bottom: 0;
}

body.lld .lld-doc strong {
  font-weight: 700;
  color: var(--lld-text);
}

body.lld .lld-doc em {
  font-style: italic;
  color: var(--lld-text-secondary);
}

body.lld .lld-doc a {
  color: var(--lld-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--lld-transition);
}

body.lld .lld-doc a:hover {
  color: var(--lld-text);
}

body.lld .lld-doc code {
  font-family: var(--font-code, "JetBrains Mono", ui-monospace, monospace);
  font-size: 0.875em;
  background: var(--lld-surface-raised);
  color: var(--lld-blue);
  border: 1px solid var(--lld-border);
  border-radius: 4px;
  padding: 0.1em 0.4em;
}

body.lld .lld-doc pre {
  background: var(--lld-surface);
  border: 1px solid var(--lld-border);
  border-radius: var(--lld-radius-md);
  padding: var(--lld-space-3) var(--lld-space-4);
  overflow-x: auto;
  margin: 0 0 var(--lld-space-3);
}

body.lld .lld-doc pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
  color: var(--lld-text);
}

/* --------------------------------------------------------------------------
   Prev / Next pager
   -------------------------------------------------------------------------- */
body.lld .lld-pager {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: var(--lld-space-3);
  margin-top: var(--lld-space-5);
  padding-top: var(--lld-space-4);
  border-top: 1px solid var(--lld-border);
}

body.lld .lld-pager__prev,
body.lld .lld-pager__next {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--lld-space-3) var(--lld-space-4);
  background: var(--lld-surface);
  border: 1px solid var(--lld-border);
  border-radius: var(--lld-radius-md);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--lld-text);
  text-decoration: none;
  max-width: 48%;
  transition:
    background var(--lld-transition),
    border-color var(--lld-transition),
    transform var(--lld-transition);
}

body.lld .lld-pager__prev {
  align-items: flex-start;
}

body.lld .lld-pager__next {
  align-items: flex-end;
  margin-inline-start: auto;
}

body.lld .lld-pager__prev:hover,
body.lld .lld-pager__next:hover {
  background: var(--lld-surface-raised);
  border-color: var(--lld-blue);
  transform: translateY(-2px);
  text-decoration: none;
}

/* Disabled / absent pager end — empty placeholder keeps layout balanced */
body.lld .lld-pager__prev:empty,
body.lld .lld-pager__next:empty {
  visibility: hidden;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Back link
   -------------------------------------------------------------------------- */
body.lld .lld-back {
  display: inline-flex;
  align-items: center;
  gap: var(--lld-space-2);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--lld-text-secondary);
  text-decoration: none;
  margin-bottom: var(--lld-space-4);
  transition: color var(--lld-transition);
}

body.lld .lld-back:hover {
  color: var(--lld-blue);
  text-decoration: none;
}

body.lld .lld-back::before {
  content: "\2190"; /* ← */
}

/* --------------------------------------------------------------------------
   Responsive — mobile
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  body.lld .nav__toggle {
    display: flex;
  }

  body.lld .nav__links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--lld-surface);
    border-bottom: 1px solid var(--lld-border);
    padding: var(--lld-space-2) var(--lld-space-3);
    box-shadow: var(--lld-shadow-md);
    z-index: var(--z-nav, 100);
  }

  body.lld .nav__links.open {
    display: flex;
  }

  body.lld .nav__link {
    padding: var(--lld-space-3);
    border-radius: var(--lld-radius-sm);
  }

  body.lld .lld-pager {
    flex-direction: column;
  }

  body.lld .lld-pager__prev,
  body.lld .lld-pager__next {
    max-width: 100%;
    margin-inline-start: 0;
    align-items: flex-start;
  }

  body.lld .footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }

  body.lld .footer__brand {
    margin-inline-end: 0;
  }
}
