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

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

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

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

/* ── Featured post ───────────────────────────────────────────────────────── */
.qb-featured-post {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: 360px;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e0e0e0;
  box-shadow: 0 4px 24px rgba(22, 97, 100, 0.08);
  margin-bottom: 36px;
}

/* Thumbnail */
.qb-fp-thumb {
  position: relative;
  overflow: hidden;
  min-height: 280px;
  background: #166164;
}

.qb-fp-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 71, 73, 0.45) 0%, transparent 55%);
  pointer-events: none;
}

.qb-fp-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.qb-featured-post:hover .qb-fp-thumb img {
  transform: scale(1.04);
}

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

/* Featured badge */
.qb-fp-badge {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 2;
  padding: 4px 14px;
  border-radius: 20px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Body */
.qb-fp-body {
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
}

.qb-fp-category {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #166164;
  margin-bottom: 10px;
}

.qb-fp-title {
  font-size: 22px;
  font-weight: 700;
  color: #0f4749;
  line-height: 1.35;
  margin: 0 0 14px;
}

.qb-fp-desc {
  font-size: 14px;
  color: #555;
  line-height: 1.7;
  margin: 0 0 20px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.qb-fp-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.qb-fp-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #888;
}

.qb-fp-meta-item svg {
  width: 15px;
  height: 15px;
  stroke: #166164;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* Featured CTA */
.qb-btn-read {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 11px 24px;
  border-radius: 8px;
  background: #166164;
  color: #fff;
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, gap 0.2s;
}

.qb-btn-read:hover {
  background: #0f4749;
  color: #fff;
  gap: 12px;
}

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

/* ── Category tabs ───────────────────────────────────────────────────────── */
.qb-cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.qb-cat-tab {
  padding: 7px 18px;
  border: 1.5px solid #e0e0e0;
  border-radius: 20px;
  background: #fff;
  color: #555;
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.qb-cat-tab:hover {
  border-color: #166164;
  color: #166164;
}

.qb-cat-tab.active {
  border-color: #166164;
  background: #166164;
  color: #fff;
}

/* ── Posts grid ──────────────────────────────────────────────────────────── */
.qb-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ── Post card ───────────────────────────────────────────────────────────── */
.qb-post-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.25s, transform 0.25s;
}

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

/* Thumbnail */
.qb-post-thumb {
  position: relative;
  overflow: hidden;
  height: 190px;
  flex-shrink: 0;
  background: #166164;
}

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

.qb-post-card:hover .qb-post-thumb img {
  transform: scale(1.05);
}

.qb-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #166164 0%, #1d7a7e 100%);
}

/* Category chip */
.qb-cat-chip {
  position: absolute;
  bottom: 12px;
  left: 14px;
  padding: 3px 10px;
  border-radius: 12px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}

/* Card body */
.qb-post-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.qb-post-date {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #888;
  margin-bottom: 8px;
}

.qb-post-date svg {
  width: 13px;
  height: 13px;
  stroke: #166164;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.qb-post-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f4749;
  line-height: 1.45;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.qb-post-excerpt {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
  margin: 0 0 auto;
  padding-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.qb-post-footer {
  display: flex;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
  margin-top: auto;
}

.qb-btn-read-sm {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: #166164;
  transition: gap 0.2s;
}

.qb-post-card:hover .qb-btn-read-sm {
  gap: 8px;
}

.qb-btn-read-sm svg {
  width: 14px;
  height: 14px;
  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: 900px) {
  .qb-featured-post {
    grid-template-columns: 1fr;
  }
  .qb-fp-thumb {
    min-height: 240px;
  }
  .qb-posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 580px) {
  .qb-posts-grid {
    grid-template-columns: 1fr;
  }
  .qb-fp-body {
    padding: 24px 20px;
  }
  .qb-fp-title {
    font-size: 18px;
  }
}
