/* The NSW middays premium article: chart panels, the summary box, the Varial X links and the
   blurred unlock block. Chart colours are read from the --nsw-* tokens by nsw-middays.js. */
.nsw-article {
  --nsw-ink: var(--varial-gray-800, #374151);
  --nsw-muted: var(--varial-gray-500, #6b7280);
  --nsw-line: var(--varial-gray-200, #e5e7eb);
  --nsw-panel: #fff;
  --nsw-soft: var(--varial-gray-50, #f9fafb);
  --nsw-accent: var(--varial-primary, #2563eb);
  --nsw-series-1: #0d9488;
  --nsw-series-2: #7c3aed;
  --nsw-series-3: #d97706;
  --nsw-series-4: #2563eb;
  --nsw-series-hist: #c4b5fd;
}

.nsw-article__tag {
  border: 1px solid var(--nsw-line);
  border-radius: 999px;
  padding: 0 .55rem;
}

.nsw-article__tag--x {
  border-color: var(--varial-brand-violet, #a76cfb);
  color: var(--varial-brand-violet-deep, #7614d0);
  font-weight: 600;
}

.nsw-article__tag--energy {
  border-color: var(--varial-brand-teal, #09ab86);
  color: var(--varial-brand-teal-deep, #0f745b);
  font-weight: 600;
}

/* The docs shell zeroes section h2 margins; this keeps a gap before the first paragraph. */
.nsw-article .nsw-article__h2 {
  max-width: 72rem;
  margin: 0 0 .85rem;
  font-size: 1.35rem;
  font-weight: 700;
  text-wrap: balance;
}

.nsw-article__tldr {
  max-width: 72rem;
  margin: 0 0 2rem;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  background: var(--nsw-soft);
  border: 1px solid var(--nsw-line);
}

.nsw-article__tldr-title {
  margin: 0 0 .75rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.nsw-article__tldr-list {
  display: grid;
  grid-template-columns: 11rem 1fr;
  gap: .6rem 1.25rem;
  margin: 0;
  font-size: .95rem;
  line-height: 1.55;
}

.nsw-article__tldr-list dt {
  font-weight: 600;
  color: var(--nsw-ink);
}

.nsw-article__tldr-list dd {
  margin: 0;
  color: var(--varial-gray-700, #4b5563);
}

@media (max-width: 640px) {
  .nsw-article__tldr-list {
    grid-template-columns: 1fr;
    gap: .15rem;
  }

  .nsw-article__tldr-list dd {
    margin-bottom: .6rem;
  }
}

.nsw-article .nsw-article__figure {
  max-width: 72rem;
  margin: 1.25rem 0 1.75rem;
  padding: 1rem;
  border: 1px solid var(--nsw-line);
  border-radius: 10px;
  background: var(--nsw-panel);
}

.nsw-article__figure h3 {
  margin: 0 0 .4rem;
  font-size: .9rem;
  font-weight: 600;
  color: var(--nsw-ink);
}

/* The Albury network schematic. */
.nsw-net { display: block; width: 100%; height: auto; max-height: 420px; font-family: Inter, system-ui, sans-serif; }
.nsw-net__line { stroke: var(--varial-gray-400, #9ca3af); stroke-width: 3; }
.nsw-net__line--limit { stroke: var(--nsw-series-3); stroke-width: 6; }
.nsw-net__line--trip { stroke: var(--nsw-muted); stroke-dasharray: 8 6; }
.nsw-net__flow { stroke: var(--nsw-ink); stroke-width: 1.5; }
.nsw-net__arrowhead { fill: var(--nsw-ink); }
.nsw-net__border { stroke: var(--nsw-line); stroke-width: 1.5; stroke-dasharray: 3 5; }
.nsw-net__node { fill: #fff; stroke: var(--nsw-ink); stroke-width: 2; }
.nsw-net__solar { fill: #d99a06; }
.nsw-net__battery--in { fill: var(--nsw-series-2); }
.nsw-net__battery--out { fill: #fff; stroke: var(--nsw-series-2); stroke-width: 2; }
.nsw-net__label, .nsw-net__key text { fill: var(--nsw-ink); font-size: 13px; }
.nsw-net__region { fill: var(--nsw-muted); font-size: 12px; font-weight: 600; }
.nsw-net__note { font-size: 12.5px; font-weight: 600; }
.nsw-net__note--limit { fill: var(--nsw-series-3); }
.nsw-net__note--trip { fill: var(--nsw-muted); }

/* Inline links from the prose to Varial X pages, in the Varial X brand colour. */
.nsw-article .nsw-article__xlink {
  color: var(--varial-brand-violet-deep, #7614d0);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--varial-brand-violet-light, #ba93fb);
  text-underline-offset: 2px;
}

.nsw-article .nsw-article__xlink:hover { text-decoration-color: currentColor; }

.nsw-article .nsw-article__xlink--energy {
  color: var(--varial-brand-teal-deep, #0f745b);
  text-decoration-color: var(--varial-brand-teal-light, #1fcaa0);
}

.nsw-article__sources {
  max-width: 72rem;
  margin: 0 0 1rem;
  color: var(--nsw-muted);
  font-size: .78rem;
  line-height: 1.5;
}

.nsw-article__figure figcaption {
  margin-top: .5rem;
  color: var(--nsw-muted);
  font-size: .78rem;
  line-height: 1.5;
}

.nsw-article__plot { width: 100%; height: 280px; min-width: 0; }
.nsw-article__plot--tall { height: 340px; }
.nsw-article__plot--short { height: 220px; }

.nsw-article__pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 720px) {
  .nsw-article__pair { grid-template-columns: 1fr; }
}

.nsw-article__seg {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin: 0 0 .5rem;
}

.nsw-article__seg button {
  border: 1px solid var(--nsw-line);
  border-radius: 999px;
  background: transparent;
  color: var(--nsw-muted);
  font-size: .75rem;
  font-weight: 600;
  padding: .2rem .75rem;
  cursor: pointer;
}

.nsw-article__seg button[aria-pressed="true"] {
  border-color: var(--nsw-accent);
  background: var(--nsw-accent);
  color: #fff;
}

.nsw-article__seg button:focus-visible { outline: 2px solid var(--nsw-accent); outline-offset: 2px; }

.nsw-article__list {
  margin: 0 0 .8rem;
  padding-left: 1.2rem;
  color: var(--varial-gray-700, #4b5563);
  font-size: .95rem;
  line-height: 1.6;
}

.nsw-article__views {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  max-width: 72rem;
}

.nsw-article__views a {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: .9rem;
  border: 1px solid var(--nsw-line);
  border-radius: 10px;
  background: var(--nsw-panel);
  color: var(--nsw-ink);
  text-decoration: none;
}

@media (max-width: 900px) { .nsw-article__views { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .nsw-article__views { grid-template-columns: 1fr; } }

.nsw-article__views a:hover { border-color: var(--nsw-accent); }
.nsw-article__views strong { color: var(--nsw-accent); font-size: .95rem; }
.nsw-article__views span { color: var(--nsw-muted); font-size: .82rem; line-height: 1.45; }

.nsw-article__views .nsw-article__soon {
  align-self: flex-start;
  border-radius: 999px;
  background: var(--nsw-series-1);
  color: #fff;
  font-size: .7rem;
  font-weight: 600;
  padding: 0 .5rem;
}

/* The unlock block: placeholder shapes blurred behind a card. No real content sits here. */
.nsw-unlock {
  position: relative;
  max-width: 72rem;
  min-height: 26rem;
}

.nsw-unlock__blur {
  display: flex;
  flex-direction: column;
  gap: .8rem;
  filter: blur(6px);
  opacity: .7;
  user-select: none;
  pointer-events: none;
}

.nsw-unlock__line {
  display: block;
  height: .8rem;
  border-radius: 4px;
  background: var(--varial-gray-300, #d1d5db);
}

.nsw-unlock__line--head { width: 55%; height: 1.3rem; }
.nsw-unlock__line--short { width: 70%; }

.nsw-unlock__chart {
  display: flex;
  align-items: flex-end;
  gap: 4%;
  height: 11rem;
  padding: 1rem;
  border-radius: 10px;
  background: var(--nsw-soft);
}

.nsw-unlock__chart i {
  flex: 1;
  border-radius: 4px 4px 0 0;
  background: var(--nsw-series-1);
}

.nsw-unlock__chart i:nth-child(1) { height: 30%; }
.nsw-unlock__chart i:nth-child(2) { height: 45%; }
.nsw-unlock__chart i:nth-child(3) { height: 38%; }
.nsw-unlock__chart i:nth-child(4) { height: 60%; }
.nsw-unlock__chart i:nth-child(5) { height: 52%; }
.nsw-unlock__chart i:nth-child(6) { height: 75%; }
.nsw-unlock__chart i:nth-child(7) { height: 68%; }
.nsw-unlock__chart i:nth-child(8) { height: 90%; }

.nsw-unlock__card {
  position: absolute;
  inset: 2.5rem 0 auto;
  margin: 0 auto;
  max-width: 34rem;
  padding: 1.5rem;
  border: 1px solid var(--nsw-line);
  border-radius: 12px;
  background: var(--nsw-panel);
  box-shadow: 0 12px 32px rgba(15, 23, 42, .12);
}

.nsw-unlock__card h2 { margin: 0 0 .6rem; font-size: 1.2rem; font-weight: 700; }
.nsw-unlock__card p { color: var(--varial-gray-700, #4b5563); font-size: .92rem; line-height: 1.55; }

.nsw-unlock__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin: 1rem 0 1.1rem;
}

/* The unlock box's own buttons: one filled, one outlined, the same size. Scoped under the
   article so the docs page's link colour doesn't override the button text. */
.nsw-article.docs-feature .nsw-unlock a.nsw-unlock__btn {
  display: inline-flex;
  align-items: center;
  padding: .6rem 1.1rem;
  border: 1px solid var(--varial-brand-teal-deep, #0f745b);
  border-radius: 8px;
  background: var(--varial-brand-teal-deep, #0f745b);
  color: #fff;
  font-size: .92rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease;
}

.nsw-article.docs-feature .nsw-unlock a.nsw-unlock__btn:hover { background: var(--varial-brand-teal, #09ab86); border-color: var(--varial-brand-teal, #09ab86); }
.nsw-article.docs-feature .nsw-unlock a.nsw-unlock__btn:focus-visible { outline: 2px solid var(--varial-brand-teal, #09ab86); outline-offset: 2px; }

.nsw-article.docs-feature .nsw-unlock a.nsw-unlock__btn--ghost {
  background: #fff;
  color: var(--varial-brand-teal-deep, #0f745b);
  border-color: var(--nsw-line);
}

.nsw-article.docs-feature .nsw-unlock a.nsw-unlock__btn--ghost:hover { background: var(--nsw-soft); border-color: var(--varial-brand-teal-deep, #0f745b); }

.nsw-unlock__foot {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1.5rem;
  padding-top: .9rem;
  border-top: 1px solid var(--nsw-line);
  color: var(--nsw-muted);
  font-size: .85rem;
}

.nsw-unlock__foot a {
  color: var(--varial-brand-teal-deep, #0f745b);
  font-weight: 600;
  text-decoration: none;
}

.nsw-unlock__foot a:hover { text-decoration: underline; }

@media (max-width: 600px) {
  .nsw-unlock { min-height: 0; }
  .nsw-unlock__blur { display: none; }
  .nsw-unlock__card { position: static; }
}
