/* ============================================================
   THE INDUSTRIAL SCRIBE — Insider Edition theme override
   Loaded AFTER each page's inline styles; wins by cascade order
   and specificity. Hand-drawn marker system per TIS Brand Bible.
   Palette: ink #111 · blue #2563eb · yellow #FBBF24 · pink #EC4899
            mint #10B981 · sky #38BDF8 · coral #FB923C
   ============================================================ */

:root {
  --ink: #111111;
  --blue: #2563eb;
  --yellow: #FBBF24;
  --pink: #EC4899;
  --mint: #10B981;
  --sky: #38BDF8;
  --coral: #FB923C;
}

html, body { overflow-x: hidden; }
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--ink);
  background: #fff;
}

/* wobbly hand-drawn borders */
.inline-sub, .product-cta-box, .stat-block, .phase-box, .takeaway-box,
.checklist-box, .data-point-box, .pillar-card, .stat-card, .format-card,
.formula-block, .related-card {
  border: 3px solid var(--ink) !important;
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px !important;
  background: #fff !important;
  box-shadow: none !important;
}

/* ---------- NAV ---------- */
nav {
  position: sticky; top: 0; background: #fff;
  border-bottom: 3px solid var(--ink);
  z-index: 100; padding: 0 5%;
}
.nav-inner {
  max-width: 1100px; margin: 0 auto; display: flex; align-items: center;
  justify-content: space-between; gap: 16px; flex-wrap: wrap;
  min-height: 64px; padding: 10px 0;
}
.logo {
  font-family: 'Permanent Marker', cursive; font-size: 1.25rem;
  color: var(--ink); text-decoration: none; white-space: nowrap; font-weight: 400;
}
.logo span { color: var(--blue); }
.nav-links { display: flex; gap: 20px; align-items: center; white-space: nowrap; }
.nav-links a {
  font-family: 'Patrick Hand', cursive; font-size: 1.05rem;
  color: var(--ink); text-decoration: none;
}
.nav-links a:hover { color: var(--blue); }
.nav-cta {
  background: var(--pink); color: #fff !important;
  padding: 7px 18px;
  border: 3px solid var(--ink);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  transition: transform .15s ease; display: inline-block;
}
.nav-cta:hover { transform: rotate(-1.5deg) scale(1.04); }

/* ---------- ARTICLE HEADER ---------- */
.article-category {
  font-family: 'Patrick Hand', cursive; font-size: 0.95rem;
  letter-spacing: 0.12em; color: var(--blue);
  border: 2.5px solid var(--blue);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  display: inline-block; padding: 2px 14px; transform: rotate(-1.5deg);
  text-transform: uppercase;
}
.article-headline {
  font-family: 'Permanent Marker', cursive; font-weight: 400;
  font-size: 2.3rem; line-height: 1.2; color: var(--ink);
  margin-top: 1rem;
}
.article-meta {
  font-family: 'Patrick Hand', cursive; font-size: 1rem; color: #555;
  border-bottom: 3px solid var(--ink);
}
.article-hero {
  width: 100%; height: 330px; object-fit: contain;
  margin: 0 0 2rem; display: block;
}
.article-image-placeholder { display: none; }

/* ---------- ARTICLE BODY ---------- */
.article-body p { font-size: 1.05rem; line-height: 1.8; }
.article-body h2 {
  font-family: 'Permanent Marker', cursive; font-weight: 400;
  font-size: 1.6rem; color: var(--ink);
  background: linear-gradient(transparent 60%, var(--yellow) 60%, var(--yellow) 95%, transparent 95%);
  display: inline-block; padding: 0 4px;
}
.article-body h3 {
  font-family: 'Patrick Hand', cursive; font-size: 1.3rem; color: var(--ink);
}
.article-body h4 { font-family: 'Patrick Hand', cursive; font-size: 1.15rem; }
.article-body a { color: var(--blue); }
.article-body table { font-size: 0.95rem; border: 3px solid var(--ink); }
.article-body th {
  background: var(--blue) !important; color: #fff;
  font-family: 'Patrick Hand', cursive; font-size: 1rem; letter-spacing: 0.03em;
}
.article-body td { border-bottom: 2px solid #ddd; }
.article-body tr:nth-child(even) td { background: #f6f9ff; }

/* boxes: accent left edges */
.inline-sub { border-left: 10px solid var(--pink) !important; padding: 1.2rem 1.4rem; }
.inline-sub p { font-family: 'Patrick Hand', cursive; font-size: 1.1rem; color: var(--ink); }
.inline-sub a {
  font-family: 'Patrick Hand', cursive; font-size: 1.05rem;
  background: var(--pink); color: #fff; border: 3px solid var(--ink);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  padding: 7px 18px; display: inline-block; transition: transform .15s ease;
}
.inline-sub a:hover { transform: rotate(-1.5deg) scale(1.04); }

.phase-box { border-left: 10px solid var(--sky) !important; }
.phase-label { font-family: 'Patrick Hand', cursive; color: var(--blue); }
.takeaway-box { border-left: 10px solid var(--mint) !important; }
.takeaway-box .num { color: var(--mint); font-family: 'Permanent Marker', cursive; }
.data-point-box { border-left: 10px solid var(--coral) !important; }
.checklist-box { border-left: 10px solid var(--yellow) !important; }
.checklist-box li::before { content: "☐ "; color: var(--blue); }
.pillar-card { border-left: 10px solid var(--sky) !important; }
.format-card { border-left: 10px solid var(--mint) !important; }
.use-when { color: var(--blue) !important; font-family: 'Patrick Hand', cursive; }

.stat-block {
  background: #fff !important; color: var(--ink) !important; padding: 1.5rem 2rem;
}
.stat-block .stat-num {
  font-family: 'Permanent Marker', cursive; font-weight: 400;
  color: var(--blue) !important; font-size: 2.4rem;
}
.stat-block .stat-label { font-family: 'Patrick Hand', cursive; color: #555 !important; font-size: 1rem; }
.stat-card .stat-num { font-family: 'Permanent Marker', cursive; font-weight: 400; color: var(--blue); }
.stat-card .stat-label { font-family: 'Patrick Hand', cursive; color: #555; }

.prompt-block {
  background: var(--ink) !important; color: #a7f3d0 !important;
  border: 3px dashed #555 !important; border-radius: 14px !important;
}
.prompt-label { font-family: 'Patrick Hand', cursive; color: var(--blue); }
.formula-block { border-left: 10px solid var(--blue) !important; }

.product-cta-box { border-left: 10px solid var(--pink) !important; }
.product-cta-text strong { font-family: 'Patrick Hand', cursive; font-size: 1.15rem; }
.product-cta-box a {
  font-family: 'Patrick Hand', cursive; background: var(--pink);
  border: 3px solid var(--ink);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
}
.download-btn {
  font-family: 'Patrick Hand', cursive; background: var(--blue);
  border: 3px solid var(--ink);
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
}

/* ---------- CNC ELEMENT STRIP (article divider) ---------- */
.cnc-strip {
  display: flex; justify-content: center; align-items: center;
  gap: 26px; margin: 3rem 0 0; flex-wrap: wrap;
}
.cnc-strip img { width: 84px; }
.cnc-strip img:nth-child(odd) { transform: rotate(-6deg); }
.cnc-strip img:nth-child(even) { transform: rotate(5deg); }
@media (max-width: 768px) { .cnc-strip img { width: 60px; } .cnc-strip { gap: 14px; } }

/* ---------- RELATED ---------- */
.related-section { border-top: 3px solid var(--ink); }
.related-section h3 {
  font-family: 'Permanent Marker', cursive; font-weight: 400;
  font-size: 1.2rem; color: var(--ink); letter-spacing: 0; text-transform: none;
}
.related-card { overflow: hidden; transition: transform .15s ease; }
.related-card:hover { transform: rotate(0.8deg) translateY(-3px); border-color: var(--ink); }
.related-img {
  background: repeating-linear-gradient(-45deg, #fff, #fff 10px, #f0f5ff 10px, #f0f5ff 20px);
  color: transparent; height: 40px;
  border-bottom: 3px solid var(--ink);
}
.related-cat { font-family: 'Patrick Hand', cursive; color: var(--blue); font-size: 0.85rem; }
.related-title { font-family: 'Patrick Hand', cursive; font-size: 1.05rem; font-weight: 400; color: var(--ink); }

/* ---------- FOOTER ---------- */
footer {
  background: #fff !important; color: var(--ink) !important;
  border-top: 3px solid var(--ink); text-align: center;
  padding: 28px 5% 40px; margin-top: 4rem;
  font-family: 'Patrick Hand', cursive; font-size: 1.05rem;
}
footer .handle { color: var(--blue); }
footer .quiet { color: #888; font-size: 0.9rem; margin-top: 6px; }

@media (max-width: 900px) {
  .nav-inner { flex-direction: column; gap: 8px; padding: 12px 0; }
  nav { position: static; }
  .nav-links { white-space: normal; flex-wrap: wrap; justify-content: center; gap: 8px 16px; }
}
@media (max-width: 768px) {
  .article-headline { font-size: 1.7rem; }
  .article-hero { height: 240px; }
}
