/* ═══════════════════════════════════════════════════
   tool-page.css — shared chrome for every official-tools/*.html page
   ═══════════════════════════════════════════════════
   Injected into each tool page by generate-tool-pages.js (see the
   TP-HEAD marker in each file). Styles ONLY the shared parts added by
   that generator — header/nav, ad slots, the SEO/FAQ section, related
   tools, footer — never the tool's own UI, which keeps its inline CSS.
   Every tool defines the same :root palette (--bg/--card/--border/--text/
   --muted/--cyan), so this file just reuses those tokens. Fallback
   values are given for the few tools that lack one. */

.tp-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: 0 0 0.9rem; margin: -0.3rem 0 1.4rem;
  border-bottom: 1px solid var(--border, #232b45);
}
.tp-logo {
  font-family: 'Space Grotesk', -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em;
  color: var(--text, #e8ecf7); text-decoration: none;
}
.tp-logo span { color: var(--cyan, #00d4ff); }
.tp-nav { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.tp-nav a {
  color: var(--muted, #6b7a99); text-decoration: none; font-size: 0.8rem;
  padding: 0.35rem 0.7rem; border-radius: 6px; border: 1px solid transparent;
}
.tp-nav a:hover { color: var(--cyan, #00d4ff); border-color: var(--border, #232b45); }
.tp-nav a.tp-nav-primary { border-color: var(--border, #232b45); color: var(--text, #e8ecf7); }

/* Ad slots — house ads until ads-config.js gets a real publisher id */
.tp-ad { margin: 1.2rem 0; min-height: 0; }
.tp-ad:empty { display: none; }
.tp-ad-top { margin-top: 0; }
.tp-house-ad {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.7rem 1rem; border: 1px dashed var(--border, #232b45);
  border-radius: 10px; background: var(--card, #131829);
  color: var(--text, #e8ecf7); text-decoration: none; font-size: 0.82rem;
}
.tp-house-ad:hover { border-color: var(--cyan, #00d4ff); }
.tp-house-ad .tp-house-tag {
  font-size: 0.62rem; letter-spacing: 0.12em; font-weight: 700;
  color: var(--cyan, #00d4ff); border: 1px solid var(--cyan, #00d4ff);
  border-radius: 4px; padding: 0.1rem 0.4rem; flex-shrink: 0;
}
.tp-house-ad .tp-house-emoji { font-size: 1.3rem; flex-shrink: 0; }
.tp-house-ad small { display: block; color: var(--muted, #6b7a99); margin-top: 0.15rem; }
.tp-rail { display: none; }
@media (min-width: 1400px) {
  body:not(.tp-embedded) .tp-rail {
    display: block; position: fixed; right: 1rem; top: 5rem; width: 160px;
  }
  body:not(.tp-embedded) .tp-rail .tp-house-ad { flex-direction: column; text-align: center; align-items: center; }
}

/* SEO / help section under the tool */
.tp-seo {
  margin-top: 2.5rem; padding-top: 1.5rem;
  border-top: 1px solid var(--border, #232b45);
  max-width: 780px; color: var(--text, #e8ecf7);
}
.tp-seo h2 { font-size: 1.05rem; margin: 1.6rem 0 0.5rem; }
.tp-seo h2:first-child { margin-top: 0; }
.tp-seo p, .tp-seo li { color: var(--muted, #6b7a99); font-size: 0.86rem; line-height: 1.7; }
.tp-seo p { margin: 0 0 0.7rem; }
.tp-seo ol, .tp-seo ul { padding-left: 1.3rem; margin: 0 0 0.7rem; }
.tp-seo li { margin-bottom: 0.25rem; }
.tp-seo strong { color: var(--text, #e8ecf7); font-weight: 600; }
.tp-seo a { color: var(--cyan, #00d4ff); }
.tp-faq details {
  border: 1px solid var(--border, #232b45); border-radius: 8px;
  padding: 0.55rem 0.9rem; margin-bottom: 0.5rem; background: var(--card, #131829);
}
.tp-faq summary { cursor: pointer; font-size: 0.88rem; font-weight: 600; color: var(--text, #e8ecf7); }
.tp-faq details p { margin: 0.6rem 0 0.2rem; }

/* Related tools grid */
.tp-related { margin-top: 2rem; }
.tp-related h2 { font-size: 1.05rem; margin: 0 0 0.8rem; color: var(--text, #e8ecf7); }
.tp-related-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.6rem;
}
.tp-related-grid a {
  display: flex; gap: 0.6rem; align-items: flex-start;
  padding: 0.7rem 0.8rem; border: 1px solid var(--border, #232b45); border-radius: 10px;
  background: var(--card, #131829); text-decoration: none; color: var(--text, #e8ecf7);
}
.tp-related-grid a:hover { border-color: var(--cyan, #00d4ff); }
.tp-related-grid .tp-rel-emoji { font-size: 1.25rem; line-height: 1; flex-shrink: 0; }
.tp-related-grid .tp-rel-name { font-size: 0.84rem; font-weight: 600; display: block; }
.tp-related-grid .tp-rel-desc { font-size: 0.72rem; color: var(--muted, #6b7a99); display: block; margin-top: 0.15rem; line-height: 1.45; }

.tp-footer-links { margin-top: 1rem; font-size: 0.72rem; color: var(--muted, #6b7a99); text-align: center; }
.tp-footer-links a { color: var(--muted, #6b7a99); }

/* Inside the DevForge app (iframe viewer): the app already has its own
   topbar, ads and back button — hide the duplicates. */
body.tp-embedded .tp-header,
body.tp-embedded .tp-ad,
body.tp-embedded .tp-rail,
body.tp-embedded .tp-footer-links { display: none !important; }
