/* Placeholder images: show a styled box when image file is missing */
img[src*="placeholder"],
img.placeholder {
  display: block;
  width: 100%;
  max-width: 800px;
  height: 300px;
  margin: 16px auto;
  background: rgba(128, 128, 128, 0.1);
  border: 2px dashed rgba(128, 128, 128, 0.3);
  border-radius: 8px;
  object-fit: contain;
}

/* Hide broken image icon */
img.placeholder[src$=".png"],
img.placeholder[src$=".webp"] {
  color: transparent;
  font-size: 0;
  position: relative;
}

img.placeholder[src$=".png"]::after,
img.placeholder[src$=".webp"]::after {
  content: attr(alt);
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  color: rgba(128, 128, 128, 0.5);
  font-size: 14px;
  font-style: italic;
}

/* Pro badge on nav entries for Pro-only features — small superscript "exponent". */
.ncs-pro-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 4px;
  font-size: 0.5em;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--md-primary-fg-color);
  border-radius: 4px;
  vertical-align: super;
  white-space: nowrap;
}

/* Header source — show two repo entries (Community + Pro) side by side. */
.ncs-source {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 0.7rem;
  line-height: 1.2;
}

.ncs-source__entry {
  display: inline-flex;
}

.ncs-source__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--md-primary-bg-color);
  opacity: 0.92;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.ncs-source__link:hover,
.ncs-source__link:focus-visible {
  opacity: 1;
}

.ncs-source__icon {
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ncs-source__icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.ncs-source__label {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.ncs-source__name {
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.ncs-source__edition {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  font-size: 0.55rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.18);
  vertical-align: middle;
}

.ncs-source__stats {
  display: inline-flex;
  gap: 10px;
  font-size: 0.6rem;
  opacity: 0.8;
  white-space: nowrap;
}

.ncs-source__stats:empty::before {
  /* Reserve a slim row so the header doesn't jump when stats arrive. */
  content: "";
  display: inline-block;
  height: 0.85em;
}

.ncs-source__stat {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.ncs-source__stat-icon {
  width: 0.85em;
  height: 0.85em;
  fill: currentColor;
}

.ncs-source__divider {
  width: 1px;
  height: 1.8rem;
  background: var(--md-primary-bg-color);
  opacity: 0.25;
}

@media screen and (max-width: 60em) {
  /* Header gets tight on phones — drop the edition tag, stats, divider */
  .ncs-source {
    gap: 10px;
  }
  .ncs-source__edition,
  .ncs-source__stats,
  .ncs-source__divider {
    display: none;
  }
}
