/* ============================================
   CONTENT BODY
   Shared look for every article and city page body
   (the HTML the content AI writes, "ac-*" classes).
   Loaded on city-page.ejs and resource-article.ejs via
   partialCSS; the wrapper div has class "content-body".
   utils/contentEnhancer.js prepares the HTML at render
   time (bold numbers, table labels, etc.).
   ============================================ */

.content-body {
  --cb-blue: var(--primary-blue, #2B7FBF);
  --cb-navy: var(--secondary-blue, #1E5A8E);
  --cb-ink: #1e293b;
  --cb-muted: #475569;
  --cb-line: #e2e8f0;
  --cb-tint: #f0f7ff;
  --cb-radius: 14px;

  font-size: 16.5px;
  line-height: 1.75;
  color: var(--cb-ink);
  overflow-wrap: break-word;
  min-width: 0;
}

.content-body > *:first-child,
.content-body article > *:first-child,
.content-body section > *:first-child { margin-top: 0; }

/* ============================================
   TYPOGRAPHY
   ============================================ */

.content-body h2,
.content-body .ac-heading {
  position: relative;
  font-size: 25px;
  line-height: 1.3;
  font-weight: 800;
  color: #0f172a;
  margin: 48px 0 18px;
  padding-bottom: 12px;
}

.content-body h2::after,
.content-body .ac-heading::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 48px;
  height: 3px;
  border-radius: 3px;
  background: var(--cb-blue);
}

.content-body h3,
.content-body .ac-subheading {
  font-size: 19px;
  line-height: 1.4;
  font-weight: 700;
  color: #0f172a;
  margin: 32px 0 10px;
}

.content-body p { margin: 0 0 18px; }

.content-body .ac-lead,
.content-body .ac-intro {
  font-size: 19px;
  line-height: 1.65;
  color: #334155;
}

.content-body .ac-tagline {
  font-size: 15px;
  font-style: italic;
  color: var(--cb-muted);
}

.content-body .ac-header:empty { display: none; }

/* Emphasis — prices, phone numbers, quantities are wrapped automatically */
.content-body strong,
.content-body b {
  font-weight: 700;
  color: #0f172a;
}

.content-body .ac-num {
  font-weight: 800;
  color: var(--cb-navy);
  white-space: nowrap;
}

.content-body em { font-style: italic; }

/* ============================================
   LINKS
   ============================================ */

.content-body a:not(.btn):not(.ac-button) {
  color: var(--cb-blue);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(43, 127, 191, 0.35);
  text-underline-offset: 3px;
  transition: color 0.15s, text-decoration-color 0.15s;
}

.content-body a:not(.btn):not(.ac-button):hover {
  color: var(--cb-navy);
  text-decoration-color: currentColor;
}

/* A link on its own line after a section ("Pool Service — Service details") */
.content-body section > a.ac-link,
.content-body section > p > a.ac-link:only-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--cb-tint);
  border: 1px solid #cfe3f5;
  font-size: 14.5px;
  text-decoration: none !important;
  line-height: 1.3;
}

.content-body section > a.ac-link::after,
.content-body section > p > a.ac-link:only-child::after {
  content: '→';
  transition: transform 0.15s;
}

.content-body section > a.ac-link:hover,
.content-body section > p > a.ac-link:only-child:hover {
  background: #e3f0fb;
  border-color: var(--cb-blue);
}

.content-body section > a.ac-link:hover::after,
.content-body section > p > a.ac-link:only-child:hover::after {
  transform: translateX(3px);
}

/* ============================================
   JUMP MENU (Pool Service · Pool Construction · …)
   ============================================ */

.content-body .ac-service-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 32px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--cb-line);
  border-radius: var(--cb-radius);
}

.content-body .ac-service-nav a {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--cb-line);
  color: var(--cb-navy) !important;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  line-height: 1.3;
}

.content-body .ac-service-nav a:hover {
  border-color: var(--cb-blue);
  background: var(--cb-tint);
}

/* ============================================
   SECTIONS
   ============================================ */

.content-body .ac-section { margin: 0 0 8px; scroll-margin-top: 110px; }

/* Each service gets its own card */
.content-body .ac-service {
  margin: 0 0 20px;
  padding: 26px 28px 24px;
  background: #fff;
  border: 1px solid var(--cb-line);
  border-radius: var(--cb-radius);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.content-body .ac-service > .ac-heading,
.content-body .ac-service > h2 {
  font-size: 21px;
  margin-top: 0;
}

/* ============================================
   LISTS
   ============================================ */

.content-body ul,
.content-body ol {
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.content-body li {
  position: relative;
  margin: 0 0 10px;
}

/* Bullets: blue check badge */
.content-body ul > li { padding-left: 32px; }

.content-body ul > li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.32em;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--cb-tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232B7FBF' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 12px no-repeat;
  border: 1px solid #cfe3f5;
}

/* Numbered steps: bold number in a blue circle */
.content-body ol { counter-reset: cb-step; }

.content-body ol > li {
  counter-increment: cb-step;
  padding-left: 42px;
  min-height: 28px;
}

.content-body ol > li::before {
  content: counter(cb-step);
  position: absolute;
  left: 0;
  top: 0.05em;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--cb-blue);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 28px;
  text-align: center;
}

/* ============================================
   CALLOUTS — tip, highlight, note, quote
   ============================================ */

.content-body .ac-tip,
.content-body .ac-highlight,
.content-body .ac-note {
  position: relative;
  margin: 24px 0;
  padding: 16px 18px 16px 54px;
  border-radius: 12px;
  font-size: 15.5px;
  line-height: 1.65;
}

.content-body .ac-tip::before,
.content-body .ac-highlight::before,
.content-body .ac-note::before {
  position: absolute;
  left: 16px;
  top: 16px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 24px;
  text-align: center;
}

.content-body .ac-tip {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #064e3b;
}
.content-body .ac-tip::before { content: '✓'; background: #059669; }

.content-body .ac-highlight {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #78350f;
}
.content-body .ac-highlight::before { content: '!'; background: #d97706; }

.content-body .ac-note {
  background: #f1f5f9;
  border: 1px solid var(--cb-line);
  color: var(--cb-muted);
}
.content-body .ac-note::before { content: 'i'; background: #64748b; font-style: italic; font-family: Georgia, serif; }

.content-body .ac-tip strong,
.content-body .ac-highlight strong { color: inherit; }

.content-body blockquote,
.content-body .ac-quote {
  position: relative;
  margin: 28px 0;
  padding: 18px 22px 18px 58px;
  background: var(--cb-tint);
  border-left: 4px solid var(--cb-blue);
  border-radius: 0 12px 12px 0;
  font-size: 18px;
  line-height: 1.6;
  font-style: italic;
  color: #1e3a5f;
}

.content-body blockquote::before,
.content-body .ac-quote::before {
  content: '\201C';
  position: absolute;
  left: 16px;
  top: 4px;
  font-family: Georgia, serif;
  font-size: 54px;
  line-height: 1;
  color: var(--cb-blue);
  opacity: 0.5;
}

/* ============================================
   TABLES (price tables)
   ============================================ */

.content-body .ac-pricing { margin: 40px 0 8px; }

.content-body .ac-table-wrap { margin: 0 0 18px; }

.content-body table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0 0 18px;
  background: #fff;
  border: 1px solid var(--cb-line);
  border-radius: var(--cb-radius);
  overflow: hidden;
  font-size: 15.5px;
  line-height: 1.45;
}

.content-body thead th {
  background: var(--cb-navy);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: left;
  padding: 14px 18px;
}

.content-body tbody th,
.content-body tbody td {
  padding: 15px 18px;
  border-top: 1px solid var(--cb-line);
  text-align: left;
  vertical-align: middle;
}

.content-body tbody tr:first-child th,
.content-body tbody tr:first-child td { border-top: none; }

.content-body tbody tr:nth-child(even) { background: #f8fafc; }

.content-body tbody th {
  font-weight: 800;
  color: #0f172a;
}

.content-body tbody td { color: #334155; }

/* ============================================
   FAQ
   ============================================ */

.content-body .ac-faq { margin-top: 40px; }

.content-body .ac-faq-item {
  margin: 0 0 12px;
  padding: 18px 22px;
  background: #fff;
  border: 1px solid var(--cb-line);
  border-left: 4px solid var(--cb-blue);
  border-radius: 12px;
}

.content-body .ac-question {
  margin: 0 0 6px;
  font-size: 17px;
  color: #0f172a;
}

.content-body .ac-answer {
  margin: 0;
  color: #334155;
}

/* ============================================
   CALL TO ACTION
   ============================================ */

.content-body .ac-cta {
  margin: 44px 0 8px;
  padding: 30px 28px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--cb-navy) 0%, var(--cb-blue) 100%);
  color: #fff;
  text-align: center;
  box-shadow: 0 10px 30px rgba(30, 90, 142, 0.25);
}

.content-body .ac-cta .ac-heading,
.content-body .ac-cta h2,
.content-body .ac-cta h3 {
  color: #fff;
  margin-top: 0;
  padding-bottom: 0;
}

.content-body .ac-cta .ac-heading::after,
.content-body .ac-cta h2::after { display: none; }

.content-body .ac-cta p,
.content-body .ac-cta .ac-text,
.content-body .ac-cta .ac-cta-text {
  color: rgba(255, 255, 255, 0.92);
  font-size: 17px;
  margin: 0 auto 20px;
  max-width: 560px;
}

.content-body .ac-cta strong,
.content-body .ac-cta .ac-num { color: #fff; }

.content-body .ac-cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 0;
}

/* Buttons placed straight in the banner (no wrapper) */
.content-body .ac-cta > a.ac-button { margin: 6px; }

/* Closing line, e.g. "Just a Splash Away!" */
.content-body .ac-cta > p:last-child:not(:first-child) {
  margin: 18px auto 0;
  font-size: 15px;
  font-style: italic;
  opacity: 0.85;
}

/* Buttons inside content (AI uses .ac-button, older pages use .btn) */
.content-body a.ac-button,
.content-body .ac-cta a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 22px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none !important;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.content-body a.ac-button,
.content-body .ac-cta a.btn-primary {
  background: #fff;
  color: var(--cb-navy) !important;
  border: 2px solid #fff;
}

.content-body .ac-cta a.ac-button + a.ac-button,
.content-body .ac-cta a.btn-secondary {
  background: transparent;
  color: #fff !important;
  border: 2px solid rgba(255, 255, 255, 0.7);
}

.content-body a.ac-button:hover,
.content-body .ac-cta a.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* A button outside a CTA banner */
.content-body a.ac-button:not(.ac-cta a.ac-button) {
  background: var(--cb-blue);
  color: #fff !important;
  border-color: var(--cb-blue);
}

/* ============================================
   MEDIA
   ============================================ */

.content-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 8px 0 16px;
}

.content-body figure { margin: 24px 0; }

.content-body figcaption {
  font-size: 14px;
  color: var(--cb-muted);
  text-align: center;
  margin-top: 6px;
}

.content-body hr {
  border: none;
  border-top: 1px solid var(--cb-line);
  margin: 36px 0;
}

/* ============================================
   PHONES
   ============================================ */

@media (max-width: 640px) {
  .content-body { font-size: 16px; line-height: 1.7; }

  .content-body h2,
  .content-body .ac-heading { font-size: 21px; margin-top: 36px; }

  .content-body h3,
  .content-body .ac-subheading { font-size: 17.5px; }

  .content-body .ac-lead,
  .content-body .ac-intro { font-size: 17px; }

  .content-body .ac-service { padding: 20px 18px 18px; border-radius: 12px; }

  .content-body .ac-service > .ac-heading,
  .content-body .ac-service > h2 { font-size: 19px; }

  /* Jump menu scrolls sideways instead of stacking four rows deep */
  .content-body .ac-service-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-left: -4px;
    margin-right: -4px;
  }
  .content-body .ac-service-nav::-webkit-scrollbar { display: none; }
  .content-body .ac-service-nav a { flex: 0 0 auto; }

  .content-body .ac-tip,
  .content-body .ac-highlight,
  .content-body .ac-note { padding: 14px 14px 14px 48px; font-size: 15px; }
  .content-body .ac-tip::before,
  .content-body .ac-highlight::before,
  .content-body .ac-note::before { left: 13px; top: 14px; }

  .content-body blockquote,
  .content-body .ac-quote { font-size: 16.5px; padding: 16px 16px 16px 48px; }

  .content-body .ac-faq-item { padding: 16px 16px; }

  .content-body .ac-cta { padding: 24px 18px; border-radius: 14px; }
  .content-body a.ac-button,
  .content-body .ac-cta a.btn { width: 100%; }

  /* Tables become one labelled card per row */
  .content-body table,
  .content-body tbody,
  .content-body tr,
  .content-body tbody th,
  .content-body tbody td { display: block; width: 100%; }

  .content-body table { border: none; background: transparent; border-radius: 0; overflow: visible; }
  .content-body thead { display: none; }

  .content-body tbody tr {
    margin: 0 0 12px;
    background: #fff !important;
    border: 1px solid var(--cb-line);
    border-radius: 12px;
    overflow: hidden;
  }

  .content-body tbody th {
    padding: 12px 16px;
    background: var(--cb-tint);
    border-top: none;
    color: var(--cb-navy);
    font-size: 16px;
  }

  /* Label on the left, the whole value ("From $100/month") together on the right */
  .content-body tbody td {
    padding: 11px 16px;
    border-top: 1px solid var(--cb-line);
    text-align: right;
  }

  .content-body tbody td[data-label]::before {
    content: attr(data-label);
    float: left;
    margin-right: 12px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--cb-muted);
  }

  .content-body tbody tr:first-child td { border-top: 1px solid var(--cb-line); }
}
