/* The Torch diagram's caption panel and text version, and the feature block around it. The
   --tarch-* custom properties are declared in torch-architecture.css. */

/* caption panel ----------------------------------------------------------- */

.tarch__caption {
  min-height: 3.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--tarch-frame);
  border-left: 2px solid var(--tarch-accent-muted);
  border-radius: 2px;
  background: var(--ink-800);
  font-size: 0.95rem;
  line-height: 1.5;
}

.tarch__caption p {
  margin: 0;
}

.tarch__hint {
  color: var(--tarch-text-3);
  font-family: var(--tarch-font-mono);
  font-size: 0.85rem;
}

.tarch:not(.tarch--ready) .tarch__caption {
  display: none;
}

.tarch__cap-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  margin-bottom: 0.35rem;
}

.tarch__cap-title {
  font-family: var(--tarch-font-display);
  font-size: 1.25rem;
  font-weight: 450;
  color: var(--tarch-text);
}

.tarch__cap-tech {
  font-family: var(--tarch-font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--tarch-accent);
}

.tarch__cap-badge {
  padding: 0.05rem 0.5rem;
  border: 1px dashed var(--tarch-accent-muted);
  border-radius: 2px;
  font-family: var(--tarch-font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tarch-accent);
}

.tarch__cap-close {
  margin-left: auto;
  min-width: 2.75rem;
  min-height: 2.75rem;
  margin-block: -0.75rem;
  margin-right: -0.75rem;
  border: 0;
  background: transparent;
  color: var(--tarch-text-2);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.tarch__cap-close:hover { color: var(--tarch-text); }

.tarch__cap-close:focus-visible {
  outline: 2px solid var(--tarch-focus);
  outline-offset: -4px;
}

.tarch__cap-role {
  color: var(--tarch-text-2);
}

.tarch__cap-label {
  margin-top: 0.6rem !important;
  font-family: var(--tarch-font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tarch-text-3);
}

.tarch__cap-list {
  display: grid;
  gap: 0.15rem;
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
  color: var(--tarch-text-2);
}

.tarch__cap-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tarch__cap-swatch {
  flex: none;
  width: 1.25rem;
  height: 0;
  border-top: 2px solid var(--tarch-border-strong);
}

.tarch__cap-item--http .tarch__cap-swatch { border-top-color: var(--tarch-accent-strong); }
.tarch__cap-item--socket .tarch__cap-swatch { border-top-style: dashed; border-top-color: var(--tarch-accent); }
.tarch__cap-item--trust .tarch__cap-swatch { border-top-style: dotted; border-top-color: var(--tarch-text-2); }
.tarch__cap-item--planned .tarch__cap-swatch { border-top-style: dashed; border-top-color: var(--tarch-accent-muted); }

/* text fallback: visible without JS, screen-reader-only once enhanced ------ */

.tarch__fallback {
  margin: 0;
  padding: 1rem 1.25rem 1rem 2.5rem;
  border: 1px solid var(--tarch-frame);
  border-radius: 2px;
  background: var(--ink-800);
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.tarch__fallback-title {
  margin: 0;
  font-family: var(--tarch-font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tarch-text-3);
}

.tarch--ready .tarch__fallback,
.tarch--ready .tarch__fallback-title {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.tarch:not(.tarch--ready) .tarch__frame {
  display: none;
}

/* ======================================================================== */
/* The Torch feature block around the diagram (extends the site's .feature) */
/* ======================================================================== */

.torch-feature {
  /* minmax(0, 1fr): without it the SVG's min-width blows the grid track (and the page) wider than a phone */
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 1rem;
  justify-items: stretch;
  margin-top: 2.5rem;
}

.torch-feature > :not(.torch-feature__diagram) {
  max-width: 44rem;
}

.torch-feature__sub {
  color: var(--graphite-200);
  font-size: 1.05rem;
}

.torch-feature__diagram {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  min-width: 0;
}

.torch-feature__diagram > summary {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  padding: 0 1rem;
  border: 1px solid var(--ink-700);
  border-radius: 2px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper-100);
  cursor: pointer;
  list-style: none;
}

.torch-feature__diagram > summary::-webkit-details-marker {
  display: none;
}

.torch-feature__diagram > summary::before {
  content: "+";
  color: var(--copper-500);
  font-size: 1rem;
}

.torch-feature__diagram[open] > summary::before {
  content: "\2212";
}

.torch-feature__diagram > summary:hover {
  border-color: var(--copper-500);
}

.torch-feature__diagram > summary:focus-visible {
  outline: 2px solid var(--signal-500);
  outline-offset: 2px;
}

.torch-feature__points {
  display: grid;
  gap: 0.4rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

.torch-feature__points li {
  position: relative;
  padding-left: 1.25rem;
  color: var(--paper-100);
}

.torch-feature__points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 0.5rem;
  height: 2px;
  background: var(--copper-500);
}

.torch-feature .textlink {
  justify-self: start;
}
