@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700&display=swap');

/* ── Wrapper ─────────────────────────────────────────────────────────────── */
.qb-cards-wrapper {
  font-family: 'Cairo', sans-serif;
  color: #4a4a4a;
  box-sizing: border-box;
}

.qb-cards-wrapper *,
.qb-cards-wrapper *::before,
.qb-cards-wrapper *::after {
  box-sizing: inherit;
}

.qb-cards-wrapper a,
.qb-cards-wrapper a * {
  text-decoration: none;
}

/* ── Section header ──────────────────────────────────────────────────────── */
.qb-cards-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
}

.qb-cards-header-text {
  flex: 1;
}

.qb-section-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #166164;
  margin-bottom: 8px;
}

.qb-section-h2 {
  font-size: 30px;
  font-weight: 700;
  color: #0f4749;
  margin: 0 0 10px;
  line-height: 1.25;
}

.qb-section-body {
  font-size: 15px;
  color: #4a4a4a;
  max-width: 440px;
  margin: 0;
  line-height: 1.65;
}

/* ── Ghost button ────────────────────────────────────────────────────────── */
.qb-btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 10px 22px;
  border: 1.5px solid #166164;
  border-radius: 8px;
  color: #166164;
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}

.qb-btn-ghost:hover {
  background: #166164;
  color: #fff;
}

/* ── Grid ────────────────────────────────────────────────────────────────── */
.qb-knowledge-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 24px;
  margin-bottom: 44px;
  align-items: start;
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.qb-knowledge-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.25s, transform 0.25s;
}

.qb-knowledge-card:hover {
  box-shadow: 0 8px 32px rgba(22, 97, 100, 0.13);
  transform: translateY(-3px);
}

/* ── Image ───────────────────────────────────────────────────────────────── */
.qb-k-img {
  flex-shrink: 0;
}

.qb-k-img-box {
  width: 100%;
  height: 220px;
  overflow: hidden;
  position: relative;
  background: #166164;
}

.qb-knowledge-card.qb-featured .qb-k-img-box {
  height: 260px;
}

.qb-k-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.qb-knowledge-card:hover .qb-k-img-box img {
  transform: scale(1.04);
}

.qb-k-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #166164 0%, #1d7a7e 100%);
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
}

.qb-k-img-placeholder svg {
  width: 40px;
  height: 40px;
  stroke: rgba(255, 255, 255, 0.55);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Card body ───────────────────────────────────────────────────────────── */
.qb-k-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Tag */
.qb-k-tag {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 20px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 12px;
  align-self: flex-start;
}

/* Title */
.qb-k-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f4749;
  line-height: 1.45;
  margin-bottom: 10px;
}

.qb-knowledge-card.qb-featured .qb-k-title {
  font-size: 18px;
}

/* Excerpt */
.qb-k-excerpt {
  font-size: 14px;
  color: #4a4a4a;
  line-height: 1.65;
  margin: 0 0 auto;
  padding-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.qb-knowledge-card.qb-featured .qb-k-excerpt {
  -webkit-line-clamp: 5;
}

/* ── Card footer ─────────────────────────────────────────────────────────── */
.qb-k-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid #e8e8e8;
  margin-top: auto;
  gap: 8px;
}

.qb-k-date {
  font-size: 13px;
  color: #888;
}

.qb-k-readmore {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: #166164;
  text-decoration: none;
  transition: gap 0.2s;
  white-space: nowrap;
}

.qb-k-readmore:hover {
  gap: 8px;
  color: #0f4749;
}

.qb-k-readmore svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── CTA ─────────────────────────────────────────────────────────────────── */
.qb-cards-cta {
  text-align: center;
  margin-top: 8px;
}

.qb-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  background: #85724d;
  color: #fff;
  border-radius: 8px;
  font-family: 'Cairo', sans-serif;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, gap 0.2s;
}

.qb-btn-primary:hover {
  background: #70603f;
  color: #fff;
  gap: 12px;
}

.qb-btn-primary svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.qb-no-results {
  color: #888;
  font-size: 15px;
  grid-column: 1 / -1;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .qb-knowledge-grid {
    grid-template-columns: 1fr 1fr;
  }
  .qb-knowledge-card.qb-featured {
    grid-column: 1 / -1;
  }
}

@media (max-width: 580px) {
  .qb-knowledge-grid {
    grid-template-columns: 1fr;
  }
  .qb-cards-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .qb-section-h2 {
    font-size: 24px;
  }
}
