/* puml-for-markdown page. Built on ../cloud-media-shrinker/cms.css and ../assets/apps/app-page.css; this file adds the
   demo video, install line, live counts, diagram viewer and the two quick-start cards. */

/* Hero: on wide screens the copy sits above the README demo, so the demo shows near its real size. */
@media (min-width: 901px) {
  .puml-page .cms-a .c-hero { display: block; padding-bottom: 36px; }
  .puml-page .cms-a .c-hero h1 { max-width: 820px; font-size: clamp(40px, 4.2vw, 52px); }
  .puml-page .c-hero .lede { max-width: 680px; }
  .puml-page .p-hero-media { max-width: 940px; margin-top: 34px; }
}
.p-video { overflow: hidden; border: 1px solid #2b3330; border-radius: 10px; background: #0d1117; box-shadow: 0 22px 44px -24px rgba(17, 24, 16, .5), 0 2px 6px rgba(17, 24, 16, .08); }
.p-video video { display: block; width: 100%; height: auto; aspect-ratio: 920 / 636; }
.p-video-caption { display: flex; align-items: flex-start; justify-content: space-between; gap: 4px 16px; margin-top: 4px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.p-video-caption span { padding-top: 8px; }
.p-video-toggle { flex: 0 0 auto; min-height: 44px; padding: 0; border: 0; background: none; color: var(--green); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* A copyable install line under the buttons. */
.p-install { display: flex; max-width: 440px; margin-top: 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--tile); }
.app-page .p-install code { flex: 1 1 auto; min-width: 0; padding: 12px 14px; overflow-x: auto; border: 0; border-radius: 0; background: none; font: 14px/20px var(--mono); white-space: nowrap; }
.p-install code::before { content: "$ "; color: var(--muted); }
.p-install button { flex: 0 0 auto; min-width: 72px; min-height: 44px; padding: 0 16px; border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--green); font: 700 14px/1 Arial, Helvetica, sans-serif; cursor: pointer; }
.p-install button:hover { background: var(--box); }

/* Live counts from GitHub and npm, with the date they were last checked by hand. */
.p-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cms .p-stats a { display: flex; flex-direction: column; gap: 2px; padding: 18px 20px 6px 0; color: inherit; text-decoration: none; }
.cms .p-stats a + a { padding-left: 20px; border-left: 1px solid var(--soft-line); }
.p-stats b { font-size: 38px; line-height: 1.1; letter-spacing: -1.2px; font-variant-numeric: tabular-nums; }
.p-stats span { font-size: 15px; line-height: 1.35; color: var(--muted); }
.cms .p-stats a:hover b { color: var(--green); }
.p-stats-note { grid-column: 1 / -1; margin: 0; padding: 8px 0 14px; font-size: 13px; color: var(--muted); }

.c-steps code { font-size: 13px; overflow-wrap: break-word; }
/* The stats band and the steps share one rule, and the next section draws the one below the steps. */
.puml-page .p-stats { border-bottom: 0; }
.puml-page .c-steps { margin-top: 0; border-bottom: 0; }
.c-steps .p-code-line { display: block; width: fit-content; max-width: 100%; margin: 2px 0 8px; padding: 4px 8px; }

/* The diagram viewer: the Markdown comment, a trail of opened diagrams, and the diagram itself. */
.p-viewer { margin-top: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--tile); }
.p-viewer-source { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.p-viewer-source span { flex: 0 0 auto; font: 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--green); }
.app-page .p-viewer-source code { min-width: 0; padding: 0; border: 0; background: none; font-size: 13px; overflow-wrap: break-word; }
.p-viewer-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0 16px; padding: 0 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.p-viewer-bar button { min-height: 44px; padding: 0; border: 0; background: none; color: var(--green); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.p-viewer-bar button:disabled { color: var(--muted); font-weight: 400; text-decoration: none; cursor: default; }
.p-viewer-bar button[aria-pressed="true"] { text-decoration-thickness: 2px; }
.p-trail { display: flex; flex: 1 1 140px; flex-wrap: wrap; align-items: center; gap: 0 8px; min-width: 0; margin: 0; padding: 0; list-style: none; }
.p-trail li { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.p-trail li + li::before { content: "›"; color: var(--muted); }
.p-trail li[aria-current] { font-weight: 700; }
.p-viewer-tools { display: flex; align-items: center; gap: 16px; }
.p-viewer-tools a { display: inline-flex; align-items: center; min-height: 44px; }
.p-canvas { max-height: min(78vh, 760px); padding: 16px; overflow: auto; background: #fff; overscroll-behavior: contain; }
.p-canvas:focus-visible { outline: 3px solid var(--green); outline-offset: -3px; }
.p-canvas > svg, .p-fallback { display: block; margin: 0 auto; }
.p-fallback { width: fit-content; max-width: 100%; }
.p-fallback img { display: block; max-width: 100%; height: auto; }
.p-canvas svg a { cursor: pointer; }
.p-canvas svg a:hover > rect, .p-canvas svg a:focus > rect { stroke: #124b30 !important; stroke-width: 3px !important; }
.p-canvas svg a:focus { outline: none; }
.p-viewer-hint { margin: 0; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* Quick start: the command line and the GitHub Action side by side. */
.p-start { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: stretch; margin-top: 8px; }
.p-start ul { margin: 14px 0 8px; padding: 0 16px 0 34px; font-size: 15px; line-height: 1.55; }
.p-start li { margin-bottom: 6px; }
.p-start .app-code p a { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; }

/* Who it's for: the TagTracker points, with a title above and headings one level down. */
.p-who { margin-top: 36px; }
.p-who > .section-title { margin-bottom: 12px; font-size: 24px; }
.p-who .app-points { margin-top: 0; }
.app-points h3 { margin: 0 0 8px; font-size: 21px; line-height: 1.25; letter-spacing: -.3px; }

/* Three buttons in the closing box need their own row. */
.puml-page .c-cta { flex-direction: column; align-items: flex-start; }

@media (max-width: 1000px) {
  .p-start { grid-template-columns: 1fr; }
  .puml-page .c-cta { align-items: stretch; }
}
@media (max-width: 900px) {
  .cms-a .c-hero .p-install { order: 4; }
  .puml-page .cms-a .p-hero-media { max-width: none; }
}
@media (max-width: 620px) {
  .p-stats b { font-size: 28px; letter-spacing: -.8px; }
  .p-stats span { font-size: 13px; }
  .cms .p-stats a { padding: 14px 10px 4px 0; }
  .cms .p-stats a + a { padding-left: 10px; }
  .p-install { max-width: none; }
  .app-page .p-install code { padding: 12px 10px; font-size: 13px; }
  .p-canvas { padding: 10px; }
  .p-viewer-bar { gap: 0 12px; }
}
@media screen and (prefers-color-scheme: dark) {
  .p-video { box-shadow: none; border-color: var(--card-line); }
  .p-canvas svg a:hover > rect, .p-canvas svg a:focus > rect { stroke: #124b30 !important; }
}
