/* /tools/ landing page styles. Layered on top of /style.css. */

:root {
  --tool-bg: #f8fafc;
  --tool-card: #ffffff;
  --tool-border: #e2e8f0;
  --tool-text: #0f172a;
  --tool-muted: #64748b;
  --tool-accent: #1e3a8a;
  --tool-accent-2: #0ea5e9;
  --tool-radius: 12px;
}

body { background: var(--tool-bg); color: var(--tool-text); }

main.tool-page,
main.tools-index {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  line-height: 1.6;
}

.breadcrumbs {
  font-size: 0.875rem;
  color: var(--tool-muted);
  margin-bottom: 1.5rem;
}
.breadcrumbs a { color: var(--tool-accent); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs [aria-current="page"] { color: var(--tool-text); }

/* ── Tool article ─────────────────────────────────────────────── */

.tool-hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #0ea5e9 100%);
  color: #fff;
  padding: 2.5rem 2rem;
  border-radius: var(--tool-radius);
  margin-bottom: 2rem;
}
.tool-hero h1 {
  font-size: clamp(1.75rem, 3.4vw, 2.25rem);
  margin: 0.5rem 0 1rem;
  line-height: 1.2;
}
.tool-category {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tool-lead {
  font-size: 1.05rem;
  opacity: 0.95;
  max-width: 720px;
  margin: 0 0 1.5rem;
}
.tool-cta { margin-top: 1rem; }
.btn-primary {
  display: inline-block;
  background: #fff;
  color: var(--tool-accent);
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: 0;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

/* Section blocks */
.tool-formulas,
.tool-howto,
.tool-faq,
.tool-related,
.tool-related-articles {
  background: var(--tool-card);
  border: 1px solid var(--tool-border);
  border-radius: var(--tool-radius);
  padding: 1.75rem 1.75rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}

.tool-formulas h2,
.tool-howto h2,
.tool-faq h2,
.tool-related h2,
.tool-related-articles h2,
.tool-cta-bottom h2 {
  margin: 0 0 1rem;
  font-size: 1.4rem;
  color: var(--tool-accent);
}

.tool-formula-table {
  width: 100%;
  border-collapse: collapse;
}
.tool-formula-table th,
.tool-formula-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--tool-border);
  text-align: left;
  vertical-align: top;
}
.tool-formula-table thead th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tool-muted);
  background: var(--tool-bg);
}
.tool-formula-table th[scope="row"] {
  font-weight: 600;
  width: 40%;
}
.tool-formula-table code {
  background: #f1f5f9;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.95em;
}

.tool-steps {
  margin: 0;
  padding-left: 1.25rem;
}
.tool-steps li { margin-bottom: 0.5rem; }

.tool-faq-item {
  border-bottom: 1px solid var(--tool-border);
  padding: 0.75rem 0;
}
.tool-faq-item:last-child { border-bottom: 0; }
.tool-faq-item summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--tool-text);
}
.tool-faq-item summary::after {
  content: "+";
  font-size: 1.5rem;
  color: var(--tool-accent);
  margin-left: 1rem;
  transition: transform 0.2s ease;
}
.tool-faq-item[open] summary::after { transform: rotate(45deg); }
.tool-faq-item p {
  color: var(--tool-muted);
  margin: 0.5rem 0 0;
}

/* Related grid */
.tool-aside-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}
.tool-related-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tool-related-list li { margin-bottom: 0.5rem; }
.tool-related-list a {
  color: var(--tool-accent);
  text-decoration: none;
  display: inline-block;
  padding: 0.4rem 0;
  border-bottom: 1px solid transparent;
}
.tool-related-list a:hover {
  border-bottom-color: var(--tool-accent);
}

/* CTA bottom */
.tool-cta-bottom {
  text-align: center;
  background: var(--tool-card);
  border: 1px solid var(--tool-border);
  border-radius: var(--tool-radius);
  padding: 2.5rem 1.5rem;
  margin-top: 1.5rem;
}
.tool-cta-bottom p {
  max-width: 600px;
  margin: 0 auto 1.5rem;
  color: var(--tool-muted);
}

/* ── Tools index page ─────────────────────────────────────────── */

.tools-index-hero {
  text-align: center;
  margin-bottom: 2.5rem;
}
.tools-index-hero h1 {
  font-size: clamp(1.75rem, 3.4vw, 2.5rem);
  margin: 0 0 0.5rem;
}
.tools-index-hero p {
  color: var(--tool-muted);
  max-width: 640px;
  margin: 0 auto;
}

.tools-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.tools-index-card {
  background: var(--tool-card);
  border: 1px solid var(--tool-border);
  border-radius: var(--tool-radius);
  padding: 1.5rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.tools-index-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(15,23,42,0.08);
  border-color: var(--tool-accent-2);
}
.tools-index-link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.tools-index-cat {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tool-accent);
  font-weight: 600;
}
.tools-index-card h3 {
  margin: 0.5rem 0;
  font-size: 1.1rem;
  line-height: 1.35;
}
.tools-index-card p {
  color: var(--tool-muted);
  margin: 0;
  font-size: 0.93rem;
}

/* Responsive */
@media (max-width: 640px) {
  .tool-hero { padding: 2rem 1.25rem; }
  .tool-formula-table th[scope="row"] { width: auto; }
}

/* ── Auto-injected related-content (works on blog + tool pages) ─── */
.rhce-related-wrap {
  max-width: 1100px;
  margin: 0 auto 2.5rem;
  padding: 0 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}
.rhce-related {
  background: var(--tool-card, #fff);
  border: 1px solid var(--tool-border, #e2e8f0);
  border-radius: var(--tool-radius, 12px);
  padding: 1.5rem;
}
.rhce-related h2 {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
  color: var(--tool-accent, #1e3a8a);
}
.rhce-related ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.rhce-related li { padding: 0.35rem 0; }
.rhce-related a {
  color: var(--tool-accent, #1e3a8a);
  text-decoration: none;
}
.rhce-related a:hover { text-decoration: underline; }

/* ── Auto-injected footer site map ──────────────────────────────── */
.rhce-footer-sitemap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto 2rem;
  padding: 2rem 1.25rem 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.rhce-footer-sitemap h5 {
  color: #fff;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.75rem;
  opacity: 0.9;
}
.rhce-footer-sitemap ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.rhce-footer-sitemap li { padding: 0.25rem 0; }
.rhce-footer-sitemap a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 0.9rem;
}
.rhce-footer-sitemap a:hover {
  color: #fff;
  text-decoration: underline;
}
