html {
  scroll-behavior: smooth;
}

/* ===== Strength Tool Page – Stable Layout ===== */
body.page-template-template-strength-tool-php {
  background: #ffffff;
  color: #111827;
}

/* Header */
.tool-header {
  padding: 12px 24px;
  border-bottom: 1px solid #e5e7eb;
}

/* Brand logo (header) */
.tool-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.tool-brand img {
  height: 72px;
  width: auto;
  display: block;
}

@media (max-width: 768px) {
  .tool-brand img {
    height: 56px;
  }
}

.tool-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tool-header a {
  font-size: 14px;
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}

/* Main wrapper – tighter top spacing */
.tool-main {
  padding: 8px 16px 24px;
}

.tool-container {
  max-width: 1320px;
  margin: 0 auto;
}

/* Text blocks ABOVE and BELOW calculator */
.tool-text {
  max-width: 880px;
  margin: 0 0 20px;
  padding: 0 16px;
  font-size: 16px;
  line-height: 1.6;
  color: #111827;
  text-align: left;
}

@media (max-width: 768px) {
  /* Tighten spacing for all Gutenberg blocks inside tool text */
  .tool-text > * {
    margin-top: 0 !important;
    margin-bottom: 8px !important;
  }

  .tool-text {
    margin-bottom: 12px;
    padding: 0 12px;
  }
}

.tool-text h1 {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 16px;
}

.tool-text h2 {
  font-size: 22px;
  font-weight: 600;
  margin: 28px 0 12px;
}

.tool-text p {
  margin: 0 0 10px;
}

/* Hero text (page-controlled) */
.tool-hero h2 {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 12px;
  color: #0f172a;
}

.tool-hero p {
  font-size: 16px;
  color: #374151;
  margin: 0 0 8px;
}

/* FORCE left alignment for any Gutenberg-centered blocks inside tool text */
.tool-text,
.tool-text * {
  text-align: left !important;
}

/* Gutenberg may write inline alignment styles with or without a space */
.tool-text [style*='text-align:center'],
.tool-text [style*='text-align: center'],
.tool-text [style*='text-align:center;'],
.tool-text [style*='text-align: center;'] {
  text-align: left !important;
}

/* Gutenberg alignment utility classes */
.tool-text .has-text-align-center,
.tool-text .aligncenter {
  text-align: left !important;
}

/* Calculator – DO NOT NARROW */
.tool-calculator {
  max-width: 1320px;
  margin: 6px auto 24px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 16px;
}

#strength-tool-calculator {
  scroll-margin-top: 90px;
}

/* Footer */
.tool-footer {
  border-top: 1px solid #e5e7eb;
  padding: 16px 16px 24px;
  margin-top: 32px;
  background: #f9fafb;
}

.tool-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  font-size: 13px;
  color: #374151;
}

.tool-footer-inner p {
  margin: 0 0 6px;
}

/* FORCE LEFT ALIGNMENT FOR GUTENBERG BLOCKS INSIDE TOOL TEXT */
.tool-text * {
  text-align: left !important;
}

.tool-text .has-text-align-center,
.tool-text [style*='text-align:center'] {
  text-align: left !important;
}

/* ---- Neutralize Gutenberg center alignment inside tool text ---- */
/* Gutenberg centers by margins, not just text-align */
.tool-text .aligncenter,
.tool-text .has-text-align-center,
.tool-text .wp-block-group.aligncenter,
.tool-text .wp-block-paragraph.aligncenter,
.tool-text .wp-block-heading.aligncenter {
  margin-left: 0 !important;
  margin-right: 0 !important;
  max-width: none !important;
}

/* Ensure inner blocks don't inherit centered widths */
.tool-text > * {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.tool-text-below {
  --wp--style--block-gap: 8px;
}

.sticky-calculator-btn {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 999px;
  background: #111827;
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.sticky-calculator-btn.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

@media (max-width: 768px) {
  .sticky-calculator-btn {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
  }
}
