/* Safhaa Option C — Modern Card / Bento featured (homepage hero only) */
.safhaa-bento {
  --safhaa-charcoal: #334155;
  --safhaa-cyan: #0891B2;
  --safhaa-cyan-text: #0E7490;
  --safhaa-slate-200: #E2E8F0;
  --safhaa-slate-500: #64748B;
  --safhaa-radius: 16px;
  --safhaa-radius-inner: 12px;
  --safhaa-shadow: 0 4px 20px rgba(51, 65, 85, 0.08);
  direction: rtl;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px 12px 28px;
  box-sizing: border-box;
}

.safhaa-bento *,
.safhaa-bento *::before,
.safhaa-bento *::after {
  box-sizing: border-box;
}

.safhaa-bento__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: stretch;
}

/* Desktop ≥992px: lead RIGHT (~2/3), two LEFT (~1/3) stacked — Affan RTL tweak.
   In RTL grid, column 1 is the rightmost track. */
@media (min-width: 992px) {
  .safhaa-bento {
    padding: 12px 0 36px;
  }
  .safhaa-bento__grid {
    grid-template-columns: 2fr 1fr; /* lead (right in RTL) | secs (left) */
    gap: 20px;
    grid-template-areas: "lead secs";
  }
  .safhaa-bento__lead { grid-area: lead; min-width: 0; }
  .safhaa-bento__secs {
    grid-area: secs;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
  }
  .safhaa-bento__sec-item {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
  }
  .safhaa-bento__sec-item .safhaa-bento__card--sec {
    flex: 1;
    width: 100%;
  }
}

/* Card chrome */
.safhaa-bento__card {
  background: #fff;
  border: 1px solid var(--safhaa-slate-200);
  border-radius: var(--safhaa-radius);
  box-shadow: var(--safhaa-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.safhaa-bento__card:hover {
  box-shadow: 0 8px 28px rgba(51, 65, 85, 0.12);
}

.safhaa-bento__media {
  position: relative;
  display: block;
  text-decoration: none;
  overflow: hidden;
}
.safhaa-bento__card--lead .safhaa-bento__media {
  aspect-ratio: 16 / 9;
  margin: 12px 12px 0;
  border-radius: var(--safhaa-radius-inner);
}
.safhaa-bento__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}
.safhaa-bento__img--placeholder {
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  width: 100%;
  height: 100%;
  min-height: 120px;
}

/* Cyan category pill — sticker overlapping bottom-right of image (RTL visual start) */
.safhaa-bento__pill {
  position: absolute;
  bottom: 10px;
  right: 10px;
  left: auto;
  z-index: 2;
  background: var(--safhaa-cyan);
  color: #fff;
  font-family: "aammu", "MV Waheed", "Waheed", sans-serif;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 400;
  padding: 5px 12px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(8, 145, 178, 0.35);
  max-width: calc(100% - 20px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.safhaa-bento__body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
}

.safhaa-bento__title {
  margin: 0;
  font-family: "MV Waheed", "MVWaheed", "Waheed", "aammu", sans-serif;
  font-weight: 400;
  color: var(--safhaa-charcoal);
  line-height: 1.45;
}
.safhaa-bento__title a {
  color: inherit;
  text-decoration: none;
}
.safhaa-bento__title a:hover {
  color: var(--safhaa-cyan-text);
}

.safhaa-bento__card--lead .safhaa-bento__title {
  font-size: 26px;
  line-height: 1.5;
}
@media (min-width: 992px) {
  .safhaa-bento__card--lead .safhaa-bento__title {
    font-size: 40px;
    line-height: 1.45;
  }
}

.safhaa-bento__excerpt {
  margin: 0;
  font-family: "MV Faseyha", "MVFaseyha", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--safhaa-slate-500);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.safhaa-bento__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 8px;
}
.safhaa-bento__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.safhaa-bento__meta-text {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  min-width: 0;
  font-size: 13px;
  color: var(--safhaa-slate-500);
  font-family: "MV Faseyha", "MVFaseyha", Inter, system-ui, sans-serif;
}
.safhaa-bento__author {
  color: var(--safhaa-charcoal);
  font-weight: 400;
}
.safhaa-bento__time {
  color: var(--safhaa-slate-500);
}

/* Secondary cards: compact horizontal on desktop */
@media (min-width: 992px) {
  .safhaa-bento__card--sec {
    /* media first in DOM; row-reverse puts image on visual LEFT (Affan mock) */
    flex-direction: row-reverse;
    align-items: stretch;
  }
  .safhaa-bento__card--sec .safhaa-bento__media {
    flex: 0 0 42%;
    max-width: 42%;
    aspect-ratio: 1 / 1;
    margin: 10px;
    border-radius: var(--safhaa-radius-inner);
    align-self: stretch;
  }
  .safhaa-bento__card--sec .safhaa-bento__body {
    padding: 12px 12px 12px 4px;
    justify-content: center;
    min-width: 0;
  }
  .safhaa-bento__card--sec .safhaa-bento__title {
    font-size: 18px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .safhaa-bento__card--sec .safhaa-bento__pill {
    font-size: 12px;
    padding: 4px 10px;
    bottom: 8px;
    right: 8px;
  }
}

/* Mobile: lead full width, secondaries horizontal swipe carousel */
@media (max-width: 991px) {
  .safhaa-bento__secs {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 4px;
    padding-bottom: 6px;
    margin-inline: -4px;
    padding-inline: 4px;
  }
  .safhaa-bento__secs::-webkit-scrollbar {
    height: 4px;
  }
  .safhaa-bento__secs::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
  }
  .safhaa-bento__sec-item {
    flex: 0 0 min(78%, 300px);
    scroll-snap-align: start;
  }
  .safhaa-bento__card--sec .safhaa-bento__media {
    aspect-ratio: 16 / 10;
    margin: 10px 10px 0;
    border-radius: var(--safhaa-radius-inner);
  }
  .safhaa-bento__card--sec .safhaa-bento__title {
    font-size: 17px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .safhaa-bento__card--sec .safhaa-bento__body {
    padding: 10px 12px 12px;
  }
}

/* Hide legacy RT green featured chrome if any leftover markup still prints */
.elementor-element-262d6e61,
.elementor-element-881f2e4 {
  display: none !important;
}
