/* BBounds portfolio case study blocks (Elementor shortcodes) */

.bb-portfolio {
  max-width: 1200px;
  margin: 0 auto 32px;
  font-family: inherit;
}

.bb-portfolio-heading {
  font-size: 1.125rem;
  font-weight: 600;
  color: #3d3d3d;
  margin: 0 0 20px;
}

.bb-portfolio-metrics {
  display: grid;
  gap: 16px;
  margin-bottom: 32px;
}

.bb-portfolio-metrics--cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.bb-portfolio-metrics--cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.bb-portfolio-metrics--cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

.portfolio-metric-card {
  background: #f5f1e9;
  border-radius: 12px;
  padding: 24px 28px;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.portfolio-metric-card--inline {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

.portfolio-metric-card .metric-label {
  font-size: 14px;
  color: #5c5c5c;
  margin-bottom: 8px;
}

.portfolio-metric-card .metric-value {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: #111;
  line-height: 1.2;
}

.portfolio-metric-card--inline strong {
  font-size: 1.125rem;
}

/* Phased rollout */
.bb-portfolio-rollout .rollout-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  align-items: start;
  padding: 16px 0;
  border-bottom: 1px solid #eee;
}

.bb-portfolio-rollout .rollout-row:last-child {
  border-bottom: none;
}

.rollout-phase-label span {
  display: block;
  font-size: 13px;
  color: #777;
  margin-top: 4px;
}

.rollout-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.phase-pill {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  background: #f0f0f0;
  color: #333;
}

.phase-pill--green {
  background: #e8f5e9;
  color: #2e7d32;
}

.phase-pill--blue {
  background: #e3f2fd;
  color: #1565c0;
}

.phase-pill--purple {
  background: #f3e5f5;
  color: #7b1fa2;
}

/* Spend vs revenue */
.spend-bars {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.spend-bar-meta {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #555;
  margin-bottom: 8px;
}

.spend-bar-track {
  height: 12px;
  background: #f0ebe3;
  border-radius: 999px;
  overflow: hidden;
}

.spend-bar-fill {
  height: 100%;
  border-radius: 999px;
}

.spend-bar-fill--spend {
  background: #c4b8a8;
}

.spend-bar-fill--revenue {
  background: #2e9b6d;
}

/* Growth timeline */
.growth-timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-top: 16px;
  position: relative;
}

.growth-timeline-item {
  text-align: left;
}

.milestone-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #ccc;
  margin-bottom: 12px;
  background: #fff;
}

.milestone-dot--purple {
  border-color: #9c6bb8;
}

.milestone-dot--green,
.milestone-dot--green-fill {
  border-color: #2e9b6d;
}

.milestone-dot--green-fill {
  background: #2e9b6d;
}

.milestone-body .milestone-label {
  font-size: 12px;
  color: #888;
}

.milestone-body strong {
  display: block;
  margin: 4px 0;
  font-size: 15px;
}

.milestone-body p {
  font-size: 13px;
  color: #666;
  margin: 0;
  line-height: 1.45;
}

@media (max-width: 767px) {
  .bb-portfolio-metrics--cols-2,
  .bb-portfolio-metrics--cols-3,
  .bb-portfolio-metrics--cols-4 {
    grid-template-columns: 1fr;
  }

  .bb-portfolio-rollout .rollout-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .growth-timeline {
    grid-template-columns: 1fr;
  }
}

/* —— Story layout: Hook → Infographic → Full case —— */

.bb-case-story {
  max-width: 1200px;
  margin: 0 auto 48px;
  padding: 0 10px;
}

.bb-case-hook p {
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  line-height: 1.45;
  font-weight: 500;
  color: #111;
  margin: 0 0 16px;
}

.bb-case-meta-line {
  font-size: 14px;
  color: #6b6b6b;
  margin: 0 0 28px;
}

.bb-infographic-card {
  background: #f7f7f7;
  border-radius: 16px;
  padding: 28px 32px 32px;
  margin-bottom: 28px;
  border: 1px solid #ebebeb;
}

.bb-infographic-card .bb-infographic-header,
.bb-infographic-card .bb-infographic-metric,
.bb-infographic-card .bb-acquisition-block {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.bb-infographic-card.bb-is-visible .bb-infographic-header {
  opacity: 1;
  transform: none;
  transition-delay: 0s;
}

.bb-infographic-card.bb-is-visible .bb-infographic-metric:nth-child(1) {
  opacity: 1;
  transform: none;
  transition-delay: 0.08s;
}

.bb-infographic-card.bb-is-visible .bb-infographic-metric:nth-child(2) {
  opacity: 1;
  transform: none;
  transition-delay: 0.16s;
}

.bb-infographic-card.bb-is-visible .bb-infographic-metric:nth-child(3) {
  opacity: 1;
  transform: none;
  transition-delay: 0.24s;
}

.bb-infographic-card.bb-is-visible .bb-acquisition-block {
  opacity: 1;
  transform: none;
  transition-delay: 0.32s;
}

.bb-infographic-metric-value.bb-metric-reveal {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.bb-infographic-metric-value.bb-metric-reveal.bb-revealed {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .bb-infographic-card .bb-infographic-header,
  .bb-infographic-card .bb-infographic-metric,
  .bb-infographic-card .bb-acquisition-block {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .bb-acquisition-fill {
    transition: none;
  }
}

.bb-infographic-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.bb-infographic-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.bb-case-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  background: #e8f0fe;
  color: #1a56db;
  font-size: 14px;
  font-weight: 700;
}

.bb-infographic-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
  color: #111;
}

.bb-case-location {
  font-size: 14px;
  color: #888;
}

.bb-infographic-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.bb-infographic-metric {
  background: #fff;
  border-radius: 12px;
  padding: 22px 20px;
  border: 1px solid #eee;
}

.bb-infographic-metric-value {
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 700;
  color: #111;
  line-height: 1.2;
  margin-bottom: 8px;
}

.bb-infographic-metric-label {
  font-size: 13px;
  color: #666;
  line-height: 1.35;
}

.bb-acquisition-block {
  background: #fff;
  border-radius: 12px;
  padding: 20px 22px;
  border: 1px solid #eee;
}

.bb-acquisition-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.bb-acquisition-label {
  font-size: 14px;
  font-weight: 600;
  color: #1a56db;
}

.bb-acquisition-percent {
  font-size: 14px;
  font-weight: 700;
  color: #1a56db;
}

.bb-acquisition-track {
  height: 8px;
  background: #e8f0fe;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}

.bb-acquisition-fill {
  width: 0;
  height: 100%;
  background: #1a56db;
  border-radius: 999px;
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.bb-acquisition-caption {
  font-size: 13px;
  color: #777;
  margin: 0;
}

.bb-full-case {
  border-top: 1px solid #e5e5e5;
  padding-top: 8px;
}

.bb-full-case-toggle {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 0;
  font-weight: 600;
  color: #111;
  text-align: center;
}

.bb-full-case-label {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.bb-full-case-toggle::-webkit-details-marker {
  display: none;
}

.bb-full-case-icon::after {
  content: "▼";
  font-size: 14px;
  color: #666;
  transition: transform 0.2s ease;
}

.bb-full-case[open] .bb-full-case-icon::after {
  transform: rotate(180deg);
}

.bb-full-case-body {
  padding-bottom: 32px;
}

.bb-full-case-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 16px;
  color: #111;
}

.bb-case-intro,
.bb-case-prose {
  font-size: 16px;
  line-height: 1.65;
  color: #444;
  margin-bottom: 28px;
}

.bb-case-section {
  margin-bottom: 32px;
}

.bb-case-section-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 14px;
  color: #111;
}

.bb-delivered-list,
.bb-results-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.bb-delivered-list li,
.bb-results-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 12px;
  font-size: 16px;
  line-height: 1.55;
  color: #444;
}

.bb-delivered-list li::before,
.bb-results-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #1a56db;
  font-weight: 700;
}

.bb-case-review {
  margin-top: 8px;
}

.bb-review-card {
  margin: 0;
  padding: 28px 32px;
  background: #f5f1e9;
  border-radius: 12px;
  border: none;
}

.bb-review-quote {
  font-size: 1.05rem;
  line-height: 1.6;
  color: #222;
  margin: 0 0 16px;
  font-style: italic;
}

.bb-review-quote::before {
  content: "\201C";
  font-size: 1.5em;
  line-height: 0;
  vertical-align: -0.15em;
  margin-right: 2px;
}

.bb-review-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 14px;
}

.bb-review-author {
  font-style: normal;
  font-weight: 700;
  color: #111;
}

.bb-review-role::before {
  content: "— ";
  color: #888;
}

.bb-review-role {
  color: #666;
}

/* Gallery grid (bottom of story layout) */
.bb-full-case:not([open]) .bb-full-case-body {
  display: none;
}

.bb-case-gallery {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid #e8e8e8;
}

.bb-case-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.bb-case-gallery-item {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 9 / 16;
  background: #111;
}

.bb-case-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 767px) {
  .bb-infographic-metrics {
    grid-template-columns: 1fr;
  }

  .bb-infographic-card {
    padding: 20px 18px;
  }

  .bb-review-card {
    padding: 22px 20px;
  }

  .bb-case-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .bb-case-gallery-grid {
    grid-template-columns: 1fr;
  }
}
