/* ==========================================================
   CBC Info Cards — by Garrett B.
   ========================================================== */

/* ---- Container ---- */
.cbc-info-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 300px;
  border-radius: 16px;
  cursor: default;
  -webkit-font-smoothing: antialiased;
}

/* ---- Face (background + tint + text stacked) ---- */
.cbc-info-card__face {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: inherit;
  background: linear-gradient(145deg, #1a1a2e, #16213e); /* fallback; overridden by Elementor */
  box-sizing: border-box;
}

/* ---- Color tint: sits between background image and text ---- */
.cbc-info-card__tint {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  border-radius: inherit;
  /* background-color and opacity set by Elementor controls */
}

/* ---- Face content: icon, title, subtitle (above tint) ---- */
.cbc-info-card__face-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 32px;
  width: 100%;
  box-sizing: border-box;
}

.cbc-info-card__icon {
  margin-bottom: 18px;
  line-height: 1;
}

.cbc-info-card__icon i,
.cbc-info-card__icon svg {
  font-size: 36px;
  color: #f0c040;
  display: block;
  transition:
    transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.25s ease;
}

.cbc-info-card__title {
  margin: 0 0 10px;
  font-size: 1.45rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  letter-spacing: -0.01em;
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}

.cbc-info-card__subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.55;
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}

/* ---- Hover overlay ---- */
.cbc-info-card__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: stretch; /* stretch so overlay-inner fills full height for vertical alignment */
  background: rgba(10, 10, 30, 0.94);
  border-radius: inherit;
  box-sizing: border-box;
  overflow: hidden; /* clip scrollable content to card bounds */

  /* hidden state */
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
  transition:
    opacity 0.32s ease,
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.cbc-info-card__overlay-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* left-aligned by default; overridden by Elementor control */
  justify-content: center;  /* vertical position; overridden by Elementor vertical-align control */
  text-align: left;
  gap: 20px;
  width: 100%;
  flex: 1 1 auto;  /* fill remaining height after close button row */
  overflow-y: auto; /* scroll when content exceeds card height */
  padding: 32px;
  box-sizing: border-box;
  /* custom scrollbar — subtle */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.25) transparent;
}

.cbc-info-card__overlay-inner::-webkit-scrollbar {
  width: 4px;
}

.cbc-info-card__overlay-inner::-webkit-scrollbar-track {
  background: transparent;
}

.cbc-info-card__overlay-inner::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.25);
  border-radius: 2px;
}

.cbc-info-card__desc {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.85);
}

/* ---- Buttons row ---- */
.cbc-info-card__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start; /* left-aligned by default; overridden by Elementor control */
  width: 100%; /* required for justify-content alignment to work */
}

/* Base button */
.cbc-btn {
  display: inline-block;
  padding: 10px 22px;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: 6px;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 0.22s ease,
    color 0.22s ease,
    border-color 0.22s ease;
  white-space: nowrap;
}

/* Primary */
.cbc-btn--primary {
  background-color: #f0c040;
  border-color: #f0c040;
  color: #1a1a2e;
}

/* Secondary / outline */
.cbc-btn--secondary {
  background-color: transparent;
  border-color: #f0c040;
  color: #f0c040;
}

/* ---- Close button (mobile / tablet only) ---- */
.cbc-info-card__close {
  display: none; /* hidden on desktop; shown via media query below */
  flex-shrink: 0;
  align-self: flex-end;
  margin: 10px 10px 0 0;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.7);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: color 0.18s ease, background-color 0.18s ease;
  z-index: 10;
}

.cbc-info-card__close:hover,
.cbc-info-card__close:focus {
  color: #ffffff;
}

@media (max-width: 1024px) {
  .cbc-info-card__close {
    display: flex;
  }
}

/* ---- Mobile / tablet button ---- */
/* Hidden on desktop; shown on tablet (≤1024px) and mobile (≤767px) */
.cbc-info-card__mobile-btn {
  display: none;
  margin-top: 16px; /* default; overridden by Elementor margin-top control */
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

@media (max-width: 1024px) {
  .cbc-info-card__mobile-btn {
    display: inline-block;
  }
}

/* ---- Hover states ---- */
/* Desktop: CSS hover reveals the overlay */
@media (min-width: 1025px) {
  .cbc-info-card:hover .cbc-info-card__overlay {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
  }

  .cbc-info-card:hover .cbc-info-card__title,
  .cbc-info-card:hover .cbc-info-card__subtitle,
  .cbc-info-card:hover .cbc-info-card__mobile-btn {
    opacity: 0;
    transform: translateY(-6px);
  }

  .cbc-info-card:hover .cbc-info-card__icon i,
  .cbc-info-card:hover .cbc-info-card__icon svg {
    opacity: 0;
    transform: scale(0.85);
  }
}

/* ---- JS-driven open state (mobile click) ---- */
/* Mirrors the CSS :hover rules but triggered by .cbc-is-open class */
.cbc-is-open .cbc-info-card__overlay {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.cbc-is-open .cbc-info-card__title,
.cbc-is-open .cbc-info-card__subtitle,
.cbc-is-open .cbc-info-card__mobile-btn {
  opacity: 0;
  transform: translateY(-6px);
}

.cbc-is-open .cbc-info-card__icon i,
.cbc-is-open .cbc-info-card__icon svg {
  opacity: 0;
  transform: scale(0.85);
}

/* ---- Accessibility: respect reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .cbc-info-card__overlay,
  .cbc-info-card__title,
  .cbc-info-card__subtitle,
  .cbc-info-card__mobile-btn,
  .cbc-info-card__icon i,
  .cbc-info-card__icon svg,
  .cbc-btn {
    transition: none;
  }


}
