/* Template docs page — additional styles.
   Complements styles.css; reuses patterns from plugins.css. */

/* ---- Architecture flow (reused from plugins) ---- */
.arch-flow {
  display: flex; align-items: flex-start; justify-content: center;
  gap: 24px; flex-wrap: wrap; margin-bottom: 48px;
}
.arch-step {
  flex: 1; min-width: 220px; max-width: 280px;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 28px;
}
.arch-num {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--blue-soft); color: var(--blue);
  font-weight: 700; font-size: 15px;
  display: grid; place-items: center; margin-bottom: 14px;
}
.arch-step h3 { font-size: 17px; margin-bottom: 8px; }
.arch-step p { font-size: 14px; color: var(--body); }
.arch-arrow {
  color: var(--muted); font-size: 24px; padding-top: 48px;
  flex-shrink: 0;
}

/* ---- Path box ---- */
.path-box {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px 28px;
  max-width: 640px; margin: 0 auto;
}
.path-box h4 { font-size: 14px; color: var(--muted); margin: 0 0 14px; text-transform: uppercase; letter-spacing: 0.06em; }
.path-row {
  display: flex; align-items: center; gap: 12px;
  margin: 8px 0; font-size: 14px;
}
.path-os {
  display: inline-block; width: 64px; font-weight: 600;
  color: var(--ink); font-size: 13px;
}

/* ---- Quickstart grid ---- */
.qs-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
  max-width: 820px; margin: 0 auto;
}
.qs-step {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 28px;
}
.qs-label {
  display: flex; align-items: center; gap: 12px;
  font-weight: 700; font-size: 17px; color: var(--ink);
  margin-bottom: 12px;
}
.qs-num {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--blue); color: #fff;
  font-size: 14px; font-weight: 700;
  display: grid; place-items: center; flex-shrink: 0;
}
.qs-steps-list {
  margin: 0; padding-left: 20px; font-size: 14.5px;
  color: var(--body); line-height: 1.8;
}
.qs-steps-list strong { color: var(--ink); }
.qs-steps-list kbd {
  display: inline-block; padding: 1px 5px;
  background: var(--bg-elevated); border: 1px solid var(--line);
  border-radius: 4px; font-family: var(--mono); font-size: 12px;
  color: var(--ink);
}

/* ---- Code blocks ---- */
.code-block {
  background: var(--bg-elevated); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
  overflow-x: auto; margin: 0;
}
.code-block code {
  font-family: var(--mono); font-size: 13px; line-height: 1.6;
  color: var(--ink); background: none; padding: 0;
  white-space: pre; display: block;
}

/* ---- Reference table ---- */
.ref-table-wrap { overflow-x: auto; }
.ref-table {
  width: 100%; border-collapse: collapse; font-size: 14px;
}
.ref-table th {
  text-align: left; padding: 12px 16px;
  color: var(--muted); font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.06em; border-bottom: 2px solid var(--line);
}
.ref-table td {
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  color: var(--body); vertical-align: top;
}
.ref-table td:first-child { color: var(--ink); font-weight: 600; white-space: nowrap; }
.ref-table tbody tr:hover { background: var(--bg-card); }

/* ---- API groups (reused for manifest sections) ---- */
.api-group { margin-bottom: 48px; }
.api-group-title {
  display: flex; align-items: center; gap: 12px;
  font-size: 20px; margin-bottom: 16px;
}
.api-badge {
  display: inline-block; padding: 4px 10px;
  background: var(--blue-soft); color: var(--blue);
  font-size: 12px; font-weight: 700; border-radius: 6px;
  text-transform: uppercase; letter-spacing: 0.04em;
}

/* ---- Example walkthrough ---- */
.example-steps {
  max-width: 720px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 24px;
}
.ex-step {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 24px;
}
.ex-label {
  font-size: 13px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--blue); margin-bottom: 14px;
}
.ex-list {
  margin: 0; padding-left: 20px; font-size: 14.5px;
  color: var(--body); line-height: 1.8;
}
.ex-list strong { color: var(--ink); }

/* ---- Template gallery ---- */
.tpl-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.tpl-card {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 24px;
  transition: border-color 0.15s;
}
.tpl-card:hover { border-color: var(--blue); }
.tpl-swatch {
  width: 100%; height: 6px; border-radius: 3px;
  background: var(--tpl-accent, var(--blue));
  margin-bottom: 16px;
}
.tpl-card h3 { font-size: 16px; margin-bottom: 6px; }
.tpl-card p { font-size: 13.5px; margin-bottom: 10px; }
.tpl-meta {
  font-size: 12px; color: var(--muted);
  font-family: var(--mono);
}

/* ---- Cover style gallery ---- */
.cover-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 24px;
}
.cover-demo { text-align: center; }
.cover-demo h3 {
  font-size: 16px; margin-top: 14px; margin-bottom: 4px;
  font-family: var(--mono);
}
.cover-demo p { font-size: 13.5px; }

.cover-preview {
  width: 100%; aspect-ratio: 8.5 / 11;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); position: relative;
  overflow: hidden; display: flex; flex-direction: column;
}
.cp-bar {
  width: 100%; height: 14px; background: var(--blue);
}
.cp-sidebar-bar {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 12px; background: var(--blue);
}
.cp-content {
  flex: 1; display: flex; flex-direction: column;
  padding: 16px; gap: 4px;
}
.cp-title-sm {
  font-size: 11px; font-weight: 700; color: #1a1d22;
}
.cp-sub-sm {
  font-size: 9px; color: #4b5159;
}
.cp-rule {
  width: 40px; height: 3px; background: var(--blue);
  border-radius: 2px; margin: 4px 0;
}
.cp-foot-sm {
  font-size: 8px; color: #6b7280;
  position: absolute; bottom: 10px; left: 16px;
}
.cover-preview--centered .cp-content {
  align-items: center; justify-content: center;
}
.cover-preview--centered .cp-rule { margin: 6px auto; }

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .arch-flow { flex-direction: column; align-items: center; }
  .arch-arrow { transform: rotate(90deg); padding: 0; }
  .arch-step { max-width: 100%; }
  .qs-grid { grid-template-columns: 1fr; gap: 20px; }
  .tpl-gallery { grid-template-columns: 1fr 1fr; }
  .cover-gallery { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .tpl-gallery { grid-template-columns: 1fr; }
  .cover-gallery { grid-template-columns: 1fr; }
}
