/* ==========================================================================
   CBC Home Content Blocks — content-blocks.css
   Plugin: CBC Home Content Blocks | Version: 1.0.0
   ========================================================================== */

/* ── Custom properties ─────────────────────────────────────────────────── */
:root {
  --cbc-cb-navy:          #052d4a;
  --cbc-cb-red:           #ee3238;
  --cbc-cb-text:          #1a2b3c;
  --cbc-cb-muted:         #5b6770;
  --cbc-cb-bg:            #ffffff;
  --cbc-cb-bg-alt:        #f7f9fb;
  --cbc-cb-image-bg:      #f2f4f6;
  --cbc-cb-border:        #e4e9ee;
  --cbc-cb-bullet-dot:    #03a9e7;
  --cbc-cb-max-width:     1160px;
  --cbc-cb-row-gap:       80px;
  --cbc-cb-col-gap:       64px;
  --cbc-cb-radius:        10px;
  --cbc-cb-btn-radius:    5px;
  --cbc-cb-transition:    all 0.22s ease;
}

/* ── Section wrapper ───────────────────────────────────────────────────── */
.cbc-content-blocks-wrapper {
  max-width: var(--cbc-cb-max-width);
  margin: 0 auto;
  padding: 72px 24px 80px;
  box-sizing: border-box;
}

/* ── Row base ──────────────────────────────────────────────────────────── */
.cbc-cb-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--cbc-cb-col-gap);
  align-items: center;
  margin-bottom: var(--cbc-cb-row-gap);
}

.cbc-cb-row:last-child {
  margin-bottom: 0;
}

/* Alternating row backgrounds */
.cbc-cb-row--text-left:nth-child(odd) {
  background: none;
}

/* ── Divider between rows ──────────────────────────────────────────────── */
.cbc-cb-row + .cbc-cb-row {
  padding-top: var(--cbc-cb-row-gap);
  border-top: 1px solid var(--cbc-cb-border);
}

/* ── Text column ───────────────────────────────────────────────────────── */
.cbc-cb-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

/* ── Title ─────────────────────────────────────────────────────────────── */
.cbc-cb-title {
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 700;
  color: var(--cbc-cb-navy);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}

.cbc-cb-title--cta {
  color: var(--cbc-cb-navy);
}

/* ── Paragraph ─────────────────────────────────────────────────────────── */
.cbc-cb-para {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--cbc-cb-muted);
  margin: 0 0 24px;
  max-width: 520px;
}

/* ── Bullet list ───────────────────────────────────────────────────────── */
.cbc-cb-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cbc-cb-bullets li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--cbc-cb-text);
}

/* Custom bullet dot via ::before */
.cbc-cb-bullets li::before {
  content: '';
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--cbc-cb-bullet-dot);
  margin-top: 7px;
}

/* ── CTA Button ────────────────────────────────────────────────────────── */
.cbc-cb-btn {
  display: inline-block;
  padding: 13px 28px;
  background-color: var(--cbc-cb-navy);
  color: #ffffff;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--cbc-cb-btn-radius);
  letter-spacing: 0.01em;
  transition: var(--cbc-cb-transition);
  border: 2px solid transparent;
  white-space: nowrap;
}

.cbc-cb-btn:hover,
.cbc-cb-btn:focus-visible {
  background-color: #041f34;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(5, 45, 74, 0.18);
  color: #ffffff;
  text-decoration: none;
}

/* Final CTA button — red accent */
.cbc-cb-btn--cta {
  background-color: var(--cbc-cb-red);
}

.cbc-cb-btn--cta:hover,
.cbc-cb-btn--cta:focus-visible {
  background-color: #c9292e;
  box-shadow: 0 6px 18px rgba(238, 50, 56, 0.22);
}

/* ── Image container ───────────────────────────────────────────────────── */
.cbc-content-image {
  border-radius: var(--cbc-cb-radius);
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: var(--cbc-cb-image-bg);
  box-shadow: 0 2px 12px rgba(5, 45, 74, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cbc-content-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* ── Final CTA block overrides ─────────────────────────────────────────── */
.cbc-cb-row--cta {
  background: linear-gradient(135deg, #f0f6fb 0%, #e8f2f8 100%);
  border-radius: 14px;
  padding: 56px 60px;
  border: 1px solid #d4e6f1;
  border-top: 1px solid #d4e6f1 !important; /* override divider */
}

.cbc-cb-row--cta .cbc-cb-para {
  max-width: 480px;
}

/* ── Responsive: tablet (≤ 860px) ─────────────────────────────────────── */
@media (max-width: 860px) {
  :root {
    --cbc-cb-row-gap: 56px;
    --cbc-cb-col-gap: 40px;
  }

  .cbc-content-blocks-wrapper {
    padding: 56px 20px 64px;
  }

  .cbc-cb-row--cta {
    padding: 40px 36px;
  }
}

/* ── Responsive: mobile (≤ 600px) ─────────────────────────────────────── */
@media (max-width: 600px) {
  :root {
    --cbc-cb-row-gap: 44px;
  }

  .cbc-content-blocks-wrapper {
    padding: 40px 16px 48px;
  }

  /* All rows stack: text on top, image below */
  .cbc-cb-row,
  .cbc-cb-row--image-left,
  .cbc-cb-row--text-left {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  /* Always move image after text on mobile regardless of source order */
  .cbc-cb-row--image-left .cbc-content-image {
    order: 2;
  }

  .cbc-cb-row--image-left .cbc-cb-text {
    order: 1;
  }

  .cbc-content-image {
    min-height: 220px;
    aspect-ratio: 3 / 2;
  }

  .cbc-cb-title {
    font-size: 1.25rem;
  }

  .cbc-cb-para {
    max-width: 100%;
    font-size: 0.9375rem;
  }

  .cbc-cb-btn {
    width: 100%;
    text-align: center;
  }

  .cbc-cb-row--cta {
    padding: 32px 24px;
    border-radius: 10px;
  }

  .cbc-cb-row--cta .cbc-cb-para {
    max-width: 100%;
  }
}

/* ── Accessibility: reduced motion ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .cbc-cb-btn {
    transition: none;
  }
  .cbc-cb-btn:hover {
    transform: none;
  }
}