/* ==========================================================================
   CBC Home Discover Section — cbc-home-discover.css
   Plugin: CBC Home Discover Section | Version: 1.0.0
   ========================================================================== */

/* ── Custom properties ─────────────────────────────────────────────────── */
:root {
  --cbc-discover-bg:           #f9fafb;
  --cbc-discover-heading-color:#052d4a;
  --cbc-discover-desc-color:   #5b6770;
  --cbc-discover-icon-size:    160px;
  --cbc-discover-padding-v:    80px;
  --cbc-discover-gap:          20px;
  --cbc-discover-radius:       12px;
  --cbc-discover-transition:   transform 0.25s ease, box-shadow 0.25s ease;
}

/* ── Section wrapper ───────────────────────────────────────────────────── */
.cbc-discover-section {
  background-color: var(--cbc-discover-bg);
  padding: var(--cbc-discover-padding-v) 24px;
  width: 100%;
  box-sizing: border-box;
}

/* ── Centered container ────────────────────────────────────────────────── */
.cbc-discover-container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* ── Section heading ───────────────────────────────────────────────────── */
.cbc-discover-heading {
  text-align: center;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
  color: var(--cbc-discover-heading-color);
  margin: 0 0 56px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

/* ── 5-column grid ─────────────────────────────────────────────────────── */
.cbc-discover-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--cbc-discover-gap);
  align-items: start;
}

/* ── Individual item card ──────────────────────────────────────────────── */
.cbc-discover-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 36px 24px 40px;
  border-radius: var(--cbc-discover-radius);
  background-color: #ffffff;
  box-shadow: 0 1px 4px rgba(5, 45, 74, 0.06);
  transition: var(--cbc-discover-transition);
  cursor: default;
}

/* ── Hover state ───────────────────────────────────────────────────────── */
.cbc-discover-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(5, 45, 74, 0.10);
}

/* ── Icon wrapper ──────────────────────────────────────────────────────── */
.cbc-discover-icon-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
  height: var(--cbc-discover-icon-size);
  width: var(--cbc-discover-icon-size);
}

/* ── Icon image ────────────────────────────────────────────────────────── */
.cbc-discover-icon {
  max-width: var(--cbc-discover-icon-size);
  max-height: var(--cbc-discover-icon-size);
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
}

/* ── Text wrapper (contains title + description) ───────────────────────── */
.cbc-discover-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

/* ── Item title ────────────────────────────────────────────────────────── */
.cbc-discover-title {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 12px;
  /* max two lines via display-box clamping */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* color is set inline per item */
}

/* ── Item description ──────────────────────────────────────────────────── */
.cbc-discover-description {
  font-size: 0.875rem;   /* 14px */
  line-height: 1.6;
  color: var(--cbc-discover-desc-color);
  margin: 0;
  max-width: 200px;
}

/* ── Responsive: tablet (≤ 900px) → 2 columns ─────────────────────────── */
@media (max-width: 900px) {
  .cbc-discover-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Responsive: mobile (≤ 480px) → 1 column ──────────────────────────── */
@media (max-width: 480px) {
  .cbc-discover-section {
    padding: 40px 12px;
  }

  .cbc-discover-heading {
    margin-bottom: 24px;
    font-size: 1.5rem;
  }

  .cbc-discover-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* Horizontal card layout on mobile: icon left, text right */
  .cbc-discover-item {
    flex-direction: row;
    align-items: center;
    text-align: left;
    padding: 16px 20px;
    gap: 16px;
  }

  .cbc-discover-icon-wrap {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    margin-bottom: 0;
  }

  .cbc-discover-icon {
    max-width: 72px;
    max-height: 72px;
  }

  .cbc-discover-title {
    font-size: 1rem;
    margin-bottom: 4px;
    -webkit-line-clamp: unset;
    overflow: visible;
  }

  .cbc-discover-description {
    font-size: 0.8125rem;
    max-width: 100%;
    margin: 0;
  }

  /* Text block fills remaining space */
  .cbc-discover-text {
    flex: 1;
    min-width: 0;
  }
}

/* ── Accessibility: reduced motion ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .cbc-discover-item {
    transition: none;
  }
  .cbc-discover-item:hover {
    transform: none;
  }
}