/* Page styles for templates.html and install.html. Base type and the nav come from docs.css. */

:root {
  --pg-ink: #1d1d1f;
  --pg-muted: #6e6e73;
  --pg-hair: rgba(0, 0, 0, .08);
  --pg-ground: #f5f5f7;
  --pg-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
}

body.page {
  color: var(--pg-ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  margin: 0 auto;
  padding: 120px 16px 72px;
}
.wrap.wide { max-width: 920px; }
.wrap.read { max-width: 920px; }

.skip {
  position: absolute;
  left: 16px;
  top: -40px;
}
.skip:focus { top: 16px; }

h1 {
  margin: 0;
  font: 700 44px/1.08 -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
  letter-spacing: -.03em;
}
.lead {
  margin: 14px 0 0;
  font-size: 19px;
  line-height: 1.5;
  color: var(--pg-muted);
}
.meta {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--pg-muted);
}
.meta a, .read a { color: var(--pg-ink); text-decoration-color: var(--pg-hair); text-underline-offset: 3px; }

code, pre {
  font-family: var(--pg-mono);
}
code {
  font-size: .9em;
  background: var(--pg-ground);
  border-radius: 5px;
  padding: .1em .35em;
  word-break: break-word;
}

/* ---- Templates ---- */

.tpl-list {
  margin-top: 48px;
  border-top: 1px solid var(--pg-hair);
}
.tpl {
  border-bottom: 1px solid var(--pg-hair);
}
.tpl > summary {
  list-style: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 20px 0;
  cursor: pointer;
}
.tpl > summary::-webkit-details-marker { display: none; }
.tpl > summary:focus-visible { outline: 2px solid var(--pg-ink); outline-offset: 4px; border-radius: 6px; }

.tpl-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.tpl-name {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.tpl-watch {
  font-size: 15px;
  line-height: 1.45;
  color: var(--pg-muted);
}

/* A macOS menu bar strip with one item in it. */
.bar {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 4px;
  border-radius: 7px;
  background: #e8e8ed;
  box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .12);
  flex: none;
}
.bar-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  color: var(--pg-ink);
  font: 500 13px/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bar-item svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bar-name { font-weight: 600; }

.tpl-body {
  max-width: 70ch;
  padding: 0 0 24px;
}
.tpl-note {
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--pg-muted);
}

details.file > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--pg-hair);
  text-underline-offset: 3px;
}
details.file > summary::-webkit-details-marker { display: none; }
details.file > summary::before {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .2s ease;
  margin-right: 2px;
}
details.file[open] > summary::before { transform: rotate(45deg); }
details.file[open] > summary { margin-bottom: 12px; }

.file-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 14px;
  background: var(--pg-ground);
  border-radius: 12px 12px 0 0;
  font-family: var(--pg-mono);
  font-size: 13px;
  color: var(--pg-muted);
}
.file pre {
  margin: 0;
  padding: 14px 16px 16px;
  background: var(--pg-ground);
  border-radius: 0 0 12px 12px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre;
  color: var(--pg-ink);
  tab-size: 2;
}
.file pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

/* ---- Buttons ---- */

.copy {
  flex: none;
  min-width: 74px;
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--pg-ink);
  color: #fff;
  font: 500 13px/1.2 -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
.copy:hover { background: #000; }
.copy:focus-visible { outline: 2px solid var(--pg-ink); outline-offset: 3px; }
.copy.done { background: #e4f5e9; color: #1b7a33; }

/* ---- Install ---- */

.read section { margin-top: 56px; }
/* Prose, lists and code stay at a 70ch measure; tables get the full width. */
.read > .intro > *,
.read > section > *:not(.tbl-wrap) { max-width: 70ch; }
.read h2 {
  margin: 0 0 14px;
  font: 600 24px/1.2 -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  letter-spacing: -.02em;
}
.read h3 {
  margin: 28px 0 8px;
  font: 600 17px/1.3 -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
}
.read p, .read li {
  font-size: 17px;
  line-height: 1.6;
  color: var(--pg-ink);
}
.read p { margin: 0 0 14px; }
.read ul, .read ol { margin: 0 0 14px; padding-left: 22px; }
.read li { margin-bottom: 6px; }
.read li::marker { color: var(--pg-muted); }

.cmd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 14px;
  padding: 14px 14px 14px 18px;
  background: var(--pg-ground);
  border-radius: 14px;
  overflow-x: auto;
}
.cmd code {
  background: none;
  padding: 0;
  font-size: 15px;
  word-break: normal;
  white-space: normal;   /* long commands wrap at spaces, so the Copy button stays in view */
}
.cmd .copy { flex: none; }

pre.code {
  margin: 14px 0 18px;
  padding: 16px 18px;
  background: #1c1d22;   /* dark, like the docs and the landing's anatomy */
  border-radius: 14px;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.6;
  white-space: pre;
  color: #e5e5ea;
}
pre.code code {
  background: none;
  padding: 0;
  font-size: inherit;
}

.tbl-wrap {
  margin: 16px 0 20px;
  overflow-x: auto;
}
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.5;
}
.tbl th, .tbl td {
  padding: 11px 16px 11px 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--pg-hair);
}
.tbl th {
  font-size: 13px;
  font-weight: 500;
  color: var(--pg-muted);
}
.tbl td code { white-space: nowrap; }
.tbl td:nth-child(3) code { white-space: normal; }

/* ---- Footer ---- */


/* ---- Phone ---- */

@media (max-width: 640px) {
  .wrap { padding-top: 104px; }
  h1 { font-size: 36px; }
  .lead { font-size: 17px; }
  .tpl > summary {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  .tpl > summary .bar { justify-self: start; }
  .cmd { flex-direction: column; align-items: stretch; gap: 12px; }
  .cmd .copy { align-self: flex-end; }
  .cmd code { white-space: normal; font-size: 14px; overflow-wrap: anywhere; }
  /* On a phone the nav keeps Docs, Changelog and Get Spotter. */
  body.page .nav a[href="https://github.com/samarthpatel24/Spotter"] { display: none; }
  /* Tables become labelled blocks instead of scrolling sideways. */
  .tbl-wrap { overflow: visible; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { padding: 14px 0; border-bottom: 1px solid var(--pg-hair); }
  .tbl td { border: 0; padding: 3px 0; }
  .tbl td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    font-size: 12px;
    color: var(--pg-muted);
  }
  .tbl td code { white-space: normal; }
}
