/**
 * Wiring Diagrams — scoped to .wd-page only.
 * Dark navy / gold chrome; light drawing surface for technical readability.
 */

.wd-page {
  --wd-gold: #e9ad22;
  --wd-bright: #ffd266;
  --wd-navy: #0a1426;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(233, 173, 34, .12), transparent 42%),
    linear-gradient(180deg, #07060c 0%, var(--wd-navy) 28%, #050403 100%);
  color: #f5ebd5;
}

.wd-page a { color: inherit; }

.wd-eyebrow {
  margin: 0 0 12px;
  color: var(--wd-gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.wd-crumb {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 18px max(22px, 6vw) 0;
  color: #8d8168;
  font-size: 12px;
}

.wd-crumb a { color: var(--wd-gold); font-weight: 700; }

.wd-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(36px, 6vw, 84px) max(22px, 6vw) clamp(28px, 5vw, 56px);
}

.wd-hero-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 18% 20%, rgba(18, 48, 92, .35), transparent 28%),
    radial-gradient(ellipse at 82% 10%, rgba(233, 173, 34, .12), transparent 26%);
}

.wd-circuit {
  position: absolute;
  inset: auto 0 6% 0;
  width: 100%;
  height: auto;
  color: rgba(233, 173, 34, .22);
  pointer-events: none;
}

.wd-circuit path { stroke: currentColor; stroke-width: 1; }
.wd-circuit circle { fill: currentColor; }

.wd-hero-copy { position: relative; z-index: 1; max-width: 46rem; }

.wd-page h1 {
  margin: 0 0 16px;
  font-size: clamp(2.1rem, 5.4vw, 4rem);
  line-height: .98;
  letter-spacing: -.03em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fff6d2 0%, #ffd266 32%, #e9ad22 58%, #c88914 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.wd-hero p {
  margin: 0;
  max-width: 42em;
  color: #c2b8a6;
  font-size: 16px;
  line-height: 1.7;
}

.wd-board,
.wd-help {
  width: min(1480px, calc(100% - 40px));
  margin: 0 auto 28px;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid rgba(233, 173, 34, .22);
  border-radius: 18px;
  background: rgba(10, 8, 6, .55);
}

.wd-library {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.wd-library.is-compact {
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
}

.wd-search {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
}

.wd-search span {
  color: var(--wd-gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.wd-search input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(233, 173, 34, .28);
  border-radius: 12px;
  background: rgba(7, 6, 12, .9);
  color: #fff1c9;
  font: inherit;
}

.wd-search input::placeholder { color: #8d8168; }

.wd-product-list {
  display: grid;
  gap: 12px;
}

.wd-product-card {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(233, 173, 34, .22);
  border-radius: 14px;
  background: rgba(7, 6, 12, .9);
  color: #fff1c9;
  text-align: left;
  cursor: pointer;
}

.wd-product-card.is-active {
  border-color: var(--wd-gold);
  background: rgba(233, 173, 34, .12);
  box-shadow: inset 0 0 0 1px rgba(233, 173, 34, .35);
}

.wd-product-media {
  display: grid;
  place-items: center;
  overflow: hidden;
  box-sizing: border-box;
  width: 128px;
  height: 80px;
  padding: 8px;
  border-radius: 10px;
  background: #fffdf8;
}

.wd-product-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.wd-product-media.is-dip-switch-photo {
  padding: 6px;
}

.wd-product-media.is-dip-switch-photo img {
  object-fit: contain;
  object-position: center;
  transform: scale(1.22);
  transform-origin: center;
}

.wd-product-placeholder {
  padding: 8px;
  color: #8d8168;
  font-size: 11px;
  text-align: center;
}

.wd-product-copy {
  display: grid;
  align-content: start;
  gap: 4px;
}

.wd-product-copy strong {
  font-size: 14px;
  font-weight: 750;
  line-height: 1.3;
}

.wd-product-copy small {
  color: var(--wd-gold);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.wd-product-copy em {
  color: #c2b8a6;
  font-size: 12px;
  font-style: normal;
}

.wd-product-action {
  margin-top: 4px;
  color: var(--wd-bright);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.wd-product-card:focus-visible,
.wd-search input:focus-visible,
.wd-preview-hit:focus-visible,
.wd-page .wd-btn-gold:focus-visible,
.wd-page .wd-btn-line:focus-visible,
.wd-help a:focus-visible,
.wd-zoom-toolbar button:focus-visible,
.wd-zoom-close:focus-visible {
  outline: 2px solid var(--wd-bright);
  outline-offset: 3px;
}

.wd-model-label {
  margin: 0 0 10px;
  color: var(--wd-gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.wd-model-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.wd-model-none {
  margin: 0;
  color: #c2b8a6;
  line-height: 1.5;
}

.wd-empty,
.wd-result {
  margin: 0;
  padding: 22px;
  border: 1px solid rgba(233, 173, 34, .22);
  border-radius: 16px;
  background: rgba(7, 6, 12, .72);
}

.wd-empty h2,
.wd-result h2 {
  margin: 0 0 10px;
  color: #fff1c9;
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  line-height: 1.2;
  letter-spacing: -.02em;
}

.wd-empty p,
.wd-note {
  margin: 0;
  color: #c2b8a6;
  line-height: 1.55;
}

.wd-model {
  margin: 0 0 16px;
  color: var(--wd-gold);
  font-weight: 700;
}

.wd-preview {
  overflow: hidden;
  min-height: 280px;
  border: 1px solid rgba(233, 173, 34, .2);
  border-radius: 14px;
  background: #fffdf8;
}

.wd-preview.is-status {
  background: rgba(7, 6, 12, .9);
}

.wd-preview-status {
  display: grid;
  place-items: center;
  min-height: 280px;
  margin: 0;
  padding: 24px;
  color: #fff1c9;
  font-size: 18px;
  font-weight: 750;
  text-align: center;
}

.wd-preview img,
.wd-preview iframe,
.wd-preview-hit {
  display: block;
  width: 100%;
  min-height: 320px;
  border: 0;
  background: #fffdf8;
}

.wd-preview img {
  height: auto;
  max-height: min(82vh, 980px);
  object-fit: contain;
  object-position: center;
}

.wd-preview.is-image {
  display: grid;
  place-items: center;
  padding: 12px;
}

.wd-preview iframe { height: min(70vh, 640px); }
.wd-preview-hit { padding: 0; cursor: zoom-in; background: transparent; }

.wd-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 12px;
}

.wd-page .wd-btn-gold,
.wd-page .wd-btn-line,
.wd-page .wd-help a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
  text-decoration: none;
  cursor: pointer;
}

.wd-page .wd-btn-gold,
.wd-page .wd-help a {
  background: var(--wd-gold);
  color: #211404;
}

.wd-page .wd-btn-gold:hover,
.wd-page .wd-btn-gold:focus-visible,
.wd-page .wd-btn-gold:active,
.wd-page .wd-help a:hover,
.wd-page .wd-help a:focus-visible,
.wd-page .wd-help a:active {
  background: var(--wd-bright);
  color: #211404;
}

.wd-page .wd-btn-line {
  border: 1px solid rgba(233, 173, 34, .55);
  background: transparent;
  color: #ffd266;
}

.wd-page .wd-btn-line:hover,
.wd-page .wd-btn-line:focus-visible,
.wd-page .wd-btn-line:active {
  background: rgba(233, 173, 34, .12);
  color: #fff1c9;
}

.wd-help {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.wd-help h2 { margin: 0 0 8px; color: #fff1c9; }
.wd-help p { margin: 0; color: #c2b8a6; }

.wd-zoom {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(5, 11, 20, .88);
}

.wd-zoom-dialog {
  position: relative;
  width: min(1600px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 16px;
  border-radius: 16px;
  background: #fffdf8;
}

.wd-zoom-dialog img {
  display: block;
  height: auto;
  max-width: none;
}

.wd-zoom-toolbar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 8px;
}

.wd-zoom-toolbar button,
.wd-zoom-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: #0b1f3a;
  color: #e9ad22;
  font-size: 22px;
  cursor: pointer;
}

.wd-zoom-toolbar span {
  min-width: 3.5em;
  color: #0b1f3a;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

@media (max-width: 1100px) {
  .wd-library,
  .wd-library.is-compact { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .wd-hero,
  .wd-crumb { padding-left: 18px; padding-right: 18px; }
  .wd-board,
  .wd-help { width: calc(100% - 36px); padding: 16px; }
  .wd-library,
  .wd-library.is-compact { grid-template-columns: 1fr; }
  .wd-product-card { grid-template-columns: 112px minmax(0, 1fr); }
  .wd-product-media { width: 112px; height: 72px; padding: 6px; }
  .wd-preview img,
  .wd-preview iframe,
  .wd-preview-hit,
  .wd-preview-status { min-height: 220px; }
  .wd-actions,
  .wd-help { flex-direction: column; align-items: stretch; }
  .wd-page .wd-btn-gold,
  .wd-page .wd-btn-line,
  .wd-page .wd-help a { width: 100%; }
}

