/**
 * Blog single-post styles. Enqueued from inc/scripts.php on single posts only,
 * with an explicit version (bump it when this file changes).
 */

/* ---------------------------------------------------------------------------
   Article summary  (rendered by inc/tldr.php, above the first paragraph)

   Inverted panel: near-black with the brand green, dropped into a #fafafa article.
   The inversion is the point — it borrows the site's own dark/green identity so the
   summary reads as a deliberate part of the design rather than a generic tinted
   callout box, and it separates itself from the article without a border.

   Disclosure is a native <details>. The caret sits at the far right on its own
   baseline rule, so the closed state reads as one typographic line rather than a
   bulleted heading.
   --------------------------------------------------------------------------- */
.start-tldr {
  --tldr-green: var(--link-color, #00d986);
  /* Panel-scoped, deliberately NOT the global --text. That token is #fff on :root today,
     with `--text: #1b1820` sitting commented out directly above it, so it has been flipped
     before. The foreground has to stay coupled to --tldr-bg here, or a future flip turns
     the summary into near-black text on a near-black panel. */
  --tldr-bg: #111014;
  --tldr-fg: #fff;

  margin: 0 0 2.75rem;
  padding: 1.5rem 1.75rem;
  background: var(--tldr-bg);
  border-radius: 5px;
  color: var(--tldr-fg);
}

.start-tldr__toggle {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  cursor: pointer;
  list-style: none;
}

/* Suppress the native disclosure triangle across engines; the caret is drawn below. */
.start-tldr__toggle::marker,
.start-tldr__toggle::-webkit-details-marker {
  display: none;
  content: "";
}

/* Explicit order: ::before precedes the element's content in flex layout, so without
   this the hairline pushes the label to the right. Wanted: label, rule, caret. */
.start-tldr__label {
  order: 1;
  flex: none;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tldr-green);
}

/* Hairline that fills the gap between label and caret — the line is what makes this
   read as editorial rather than as a card heading. */
.start-tldr__toggle::before {
  content: "";
  order: 2;
  flex: 1 1 auto;
  height: 1px;
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-0.25rem);
}

.start-tldr__toggle::after {
  content: "";
  order: 3;
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 1.5px solid var(--tldr-green);
  border-bottom: 1.5px solid var(--tldr-green);
  transform: translateY(-0.25rem) rotate(45deg);
  transition: transform 0.25s ease;
}

.start-tldr[open] .start-tldr__toggle::after {
  transform: translateY(0.0625rem) rotate(225deg);
}

.start-tldr__toggle:hover .start-tldr__label {
  color: var(--tldr-fg);
}

.start-tldr__toggle:focus-visible {
  outline: 2px solid var(--tldr-green);
  outline-offset: 0.5rem;
  border-radius: 2px;
}

/* Body copy set larger and looser than the article text: this is a lead-in, so it
   should feel like a pull quote rather than a footnote. */
.start-tldr__body {
  margin-top: 1.125rem;
  color: rgba(255, 255, 255, 0.82);
}

.start-tldr__body > p {
  margin: 0 0 0.875rem;
  font-size: 1.0625rem;
  line-height: 1.7;
}

.start-tldr__body > p:last-child {
  margin-bottom: 0;
}

.start-tldr__body a {
  color: var(--tldr-green);
  text-underline-offset: 0.2em;
}

@media (max-width: 575px) {
  .start-tldr {
    padding: 1.25rem 1.25rem;
  }
  .start-tldr__body > p {
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .start-tldr__toggle::after {
    transition: none;
  }
}
