/* Panel and SectionHead (scripts/lib/components/panel.mjs), from docs/brand/components.css.
   The pixel border is the whole frame: a 1px black edge and a 1px stone line inside it. */

.wfg-panel { min-width: 0; border: 1px solid var(--edge); box-shadow: var(--shadow-inner); background: var(--panel); padding: 12px 14px; }
.wfg-panel.is-flush { padding: 0; }
.wfg-panel-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .25rem 1rem;
  flex-wrap: wrap;
  margin: -12px -14px 10px;
  padding: 6px 14px;
  background: var(--bar-fill);
  border-bottom: 1px solid var(--edge);
  font: var(--heading-weight) 1.25rem/1.25 var(--font-heading);
  letter-spacing: 0;
  color: var(--ink);
}
.wfg-panel.is-flush > .wfg-panel-title { margin: 0; }
.wfg-panel-title small { font: 400 .78rem/1 var(--font-ui); color: var(--ink-3); }
.wfg-panel-title small a { display: inline-flex; align-items: center; min-height: 1.75rem; margin-block: -.5rem; color: var(--ink-2); text-decoration-color: var(--line-control); }
.wfg-panel-title small a:hover { color: var(--accent-text); }

/* Lead and TL;DR frames (ops/design/tldr-accent-2026-09-30.md). The page's opening answer
   box borrows the page accent: a 2px top edge, the stone line inside leaning toward the
   accent, and a wash across the title bar that fades out by its middle. Flat, no glow. */
.wfg-panel[data-lead] {
  border-top: 2px solid var(--accent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 12%, var(--edge-inner));
}
.wfg-panel[data-lead] > .wfg-panel-title {
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) var(--mix-wash), var(--bg-3)), var(--bg-3) 70%);
  border-bottom-color: color-mix(in srgb, var(--accent) 30%, var(--edge));
}
/* TL;DR: no title bar. The tag sits on the top edge like the title plate on a game frame,
   any meta note on a dark plate at the right of the same edge, and the frame's padding
   clears them, so the answer starts about one bar higher. A faint wash of the accent under
   the edge fades out within the first lines. Sizes in rem so the plate and the padding grow
   together under text zoom. Dense rows: components/facts.css. */
.wfg-panel[data-tldr] {
  position: relative;
  padding: 1rem 12px 10px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--panel)), var(--panel) 4.5rem);
}
.wfg-panel[data-tldr] > .wfg-panel-title {
  position: absolute;
  top: calc(-.65rem - 1px);
  left: 10px;
  right: 10px;
  align-items: center;
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  font-size: 1rem;
  line-height: 1;
}
.wfg-panel[data-tldr] > .wfg-panel-title small { padding: .2rem .4rem; background: var(--bg); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, var(--edge)); font-size: .72rem; }
.wfg-tldr-tag {
  display: inline-block;
  padding: .2rem .4rem .1rem;
  border-radius: var(--r-ctl);
  background: var(--accent-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), inset 0 -1px 0 rgba(0, 0, 0, .3), 0 0 0 1px var(--edge);
  font: 400 1rem/1 var(--font-display);
  letter-spacing: .08em;
  color: var(--on-accent);
  text-decoration: none;
  cursor: help;
}
@media (max-width: 40rem) {
  .wfg-panel[data-tldr] { margin-top: .5rem; padding-inline: 10px; }
  .wfg-panel[data-tldr] > .wfg-panel-title { left: 8px; right: 8px; }
}

.wfg-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 24px; align-items: end; margin-bottom: var(--s-5); }
.wfg-head > :not(.wfg-head-link) { grid-column: 1; }
.wfg-kicker { margin: 0 0 6px; font: 400 .8rem/1.3 var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); }
.wfg-head :is(h2, h3) { max-width: 24ch; margin: 0; font: var(--heading-weight) clamp(1.4rem, 2.6vw, 1.75rem)/1.2 var(--font-heading); letter-spacing: 0; text-wrap: balance; color: var(--ink); }
.wfg-head .wfg-dek { max-width: 64ch; margin: 6px 0 0; color: var(--ink-2); }
.wfg-head-link { grid-column: 2; grid-row: 1 / span 3; align-self: end; display: inline-flex; align-items: center; gap: 6px; min-height: 1.75rem; font: 400 .92rem/1.3 var(--font-ui); text-decoration: none; white-space: nowrap; color: var(--accent-text); }
.wfg-head-link svg { width: 1em; height: 1em; transition: transform var(--t); }
@media (hover: hover) and (pointer: fine) {
  .wfg-head-link:hover svg { transform: translateX(3px); }
}
@media (max-width: 40rem) {
  .wfg-head { grid-template-columns: minmax(0, 1fr); }
  .wfg-head-link { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .wfg-head-link svg { transition: none; }
}
