/* ============================================
   Simpliguides — shared stylesheet
   Inherits Simplicalcs design language
   ============================================ */

:root {
  --bg:           #ffffff;
  --bg-card:      #f8f8f8;
  --text:         #1a1a1a;
  --text-muted:   #6b6b6b;
  --border:       #e0e0e0;
  --accent:       #2563eb;
  --accent-hover: #1d4ed8;
  --success:      #16a34a;
  --warning:      #d97706;
  --step-num:     #2563eb;
  --copy-bg:      #f1f5f9;
  --copy-border:  #cbd5e1;
  --radius:       6px;
  --max-width:    680px;
}

[data-theme="dark"] {
  --bg:           #111111;
  --bg-card:      #1e1e1e;
  --text:         #e8e8e8;
  --text-muted:   #9a9a9a;
  --border:       #2e2e2e;
  --accent:       #3b82f6;
  --accent-hover: #60a5fa;
  --copy-bg:      #1a2232;
  --copy-border:  #2e3f58;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  padding: 0 1rem;
}

/* ---- Header ---- */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

.logo a {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}

.logo a:hover { color: var(--accent); }

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
}

/* ---- Main content ---- */
main {
  max-width: var(--max-width);
  margin: 0 auto 3rem;
}

/* ---- Guide meta (above title) ---- */
.guide-category {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.guide-category a {
  color: var(--text-muted);
  text-decoration: none;
}

.guide-category a:hover { color: var(--accent); }

h1 {
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.guide-intro {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.5rem;
}

/* ---- What you'll need ---- */
.prereqs {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.prereqs p { color: var(--text-muted); }
.prereqs strong { color: var(--text); }

/* ---- Steps ---- */
.steps { margin-bottom: 2rem; }

.step {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.75rem;
  align-items: flex-start;
}

.step-number {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.step-body h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.step-body p {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.step-body p:last-child { margin-bottom: 0; }

/* ---- Copy block ---- */
.copy-block {
  background: var(--copy-bg);
  border: 1px solid var(--copy-border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin: 0.5rem 0;
  font-family: 'Menlo', 'Courier New', monospace;
  font-size: 0.875rem;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  word-break: break-all;
}

.copy-block code { flex: 1; }

.copy-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--copy-border);
  border-radius: var(--radius);
  padding: 3px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--text-muted);
  white-space: nowrap;
}

.copy-btn:hover { background: var(--border); color: var(--text); }
.copy-btn.copied { color: var(--success); border-color: var(--success); }

/* ---- Note / tip callout ---- */
.note {
  border-left: 3px solid var(--accent);
  padding: 0.6rem 1rem;
  background: var(--bg-card);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0.75rem 0;
}

/* ---- Section headings ---- */
.section-heading {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 2rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

/* ---- Variations & Troubleshooting ---- */
.variation, .trouble-item {
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}

.variation strong, .trouble-item strong {
  display: block;
  margin-bottom: 0.25rem;
}

/* ---- Ad slot ---- */
.ad-slot {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 2.5rem 0;
}

/* ---- Footer ---- */
footer {
  max-width: var(--max-width);
  margin: 0 auto 2rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

footer a { color: var(--text-muted); text-decoration: none; }
footer a:hover { color: var(--accent); }

/* ---- Home page cards ---- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s;
}

.category-card:hover { border-color: var(--accent); }

.category-card .icon { font-size: 1.5rem; margin-bottom: 0.5rem; }
.category-card h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.25rem; }
.category-card p { font-size: 0.8rem; color: var(--text-muted); }

/* ---- Responsive ---- */
@media (max-width: 480px) {
  h1 { font-size: 1.35rem; }
  .step { gap: 0.75rem; }
}
