/* ===== Guide Card ===== */
.guide-card {
  background: var(--color-surface);
  border: 2px solid #000;
  border-radius: 0;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.guide-card:hover { transform: translate(-2px,-2px); box-shadow: 4px 4px 0 #000; border-color: #000; text-decoration: none; }
.guide-card-category {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.guide-card-category.sysdesign { color: var(--cat-sysdesign); }
.guide-card-category.dsa { color: var(--cat-dsa); }
.guide-card h3 { font-size: 1rem; line-height: 1.4; }
.guide-card p { font-size: 0.875rem; color: var(--color-text-muted); margin: 0; flex: 1; }
.guide-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 0.75rem; border-top: 2px solid #000; }
.guide-card-meta { display: flex; gap: 0.6rem; align-items: center; }
.difficulty-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-beginner { background: #22c55e; }
.dot-intermediate { background: #eab308; }
.dot-advanced { background: #ef4444; }
.read-time { font-size: 0.78rem; color: var(--color-text-muted); }
.guide-card-arrow { color: #000; font-size: 1.1rem; }

/* ===== Callout Boxes ===== */
.callout {
  border-radius: 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-left: 4px solid;
  border-top: 1px solid #000;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
  display: flex;
  gap: 0.75rem;
}
.callout-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 0.1rem; }
.callout-body { flex: 1; }
.callout-body p:last-child { margin-bottom: 0; }
.callout-body strong { display: block; margin-bottom: 0.25rem; font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.05em; }
.callout.tip { background: #f0fdf4; border-color: #22c55e; color: #166534; }
.callout.note { background: #eff6ff; border-color: #3b82f6; color: #1e40af; }
.callout.warn { background: #fffbeb; border-color: #f59e0b; color: #92400e; }
.callout.danger { background: #fef2f2; border-color: #ef4444; color: #991b1b; }

/* ===== Code Blocks ===== */
.code-block {
  background: #0f172a;
  border-radius: 0;
  border: 2px solid #000;
  margin: 1.5rem 0;
  overflow: hidden;
}
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: rgba(255,255,255,0.05);
  border-bottom: 2px solid rgba(255,255,255,0.15);
}
.code-lang { font-size: 0.75rem; font-weight: 600; color: #64748b; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; }
.copy-btn {
  background: rgba(255,255,255,0.08);
  border: none;
  color: #94a3b8;
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: 0;
  cursor: pointer;
  font-family: 'Space Mono', monospace;
  transition: background var(--transition), color var(--transition);
}
.copy-btn:hover { background: rgba(255,255,255,0.15); color: #e2e8f0; }
.copy-btn.copied { color: #22c55e; }
.code-block pre {
  margin: 0;
  padding: 1.25rem;
  overflow-x: auto;
}
.code-block code {
  background: none !important;
  padding: 0 !important;
  border: none;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.65;
  color: #e2e8f0;
}

/* ===== Table ===== */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
thead th { background: #000; color: #e9e9e9; font-weight: 600; text-align: left; padding: 0.75rem 1rem; border-bottom: 2px solid #000; white-space: nowrap; }
tbody td { padding: 0.7rem 1rem; border-bottom: 1px solid #000; vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #f5f5f5; }

/* ===== SVG Diagram ===== */
.diagram-svg { margin: 1.75rem auto; max-width: 860px; }
.diagram-svg svg { display: block; width: 100%; height: auto; }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .code-block-header { flex-wrap: wrap; gap: 0.35rem; padding: 0.5rem 0.75rem; }
  .table-wrap { font-size: 0.8rem; }
}

/* ===== Scroll-to-top button ===== */
.scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 2px solid #000;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, box-shadow 0.1s, transform 0.1s;
  z-index: 100;
}
.scroll-top.visible { opacity: 1; pointer-events: auto; }
.scroll-top:hover { box-shadow: 3px 3px 0 #000; transform: translate(-1px, -1px); }

/* ===== Footer Newsletter ===== */
.footer-newsletter { margin-bottom: 1.5rem; }
.footer-newsletter-label { font-size: 0.8rem; color: var(--color-text-muted); margin: 0 0 0.5rem; }
.footer-newsletter-row { display: flex; gap: 0.5rem; max-width: 360px; margin: 0 auto; }
.footer-newsletter-row input {
  flex: 1;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
  border-radius: 0;
  color: var(--color-text);
  font-family: inherit;
}
.footer-newsletter-row button {
  background: var(--color-primary);
  color: #fff;
  border: 2px solid #000;
  padding: 0.45rem 1rem;
  font-size: 0.8rem;
  border-radius: 0;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.footer-newsletter-row button:hover { box-shadow: var(--shadow-sm); }
.footer-newsletter-row button:disabled { opacity: 0.6; cursor: not-allowed; box-shadow: none; }
.footer-newsletter-msg { font-size: 0.75rem; margin-top: 0.4rem; min-height: 1.2em; }
.footer-newsletter-msg.ok { color: #166534; }
.footer-newsletter-msg.err { color: #991b1b; }
