/*
 * Alehsan Media Home V4
 * Compact editorial layout, consistent hover lift, responsive carousels.
 * Scoped to .home-v3 so all other public pages remain untouched.
 */
.home-v3 {
  --home-primary: var(--bs-primary, #0082de);
  --home-primary-rgb: var(--bs-primary-rgb, 0, 130, 222);
  --home-text: #17202a;
  --home-muted: #68717c;
  --home-border: rgba(23, 32, 42, 0.11);
  --home-soft: #f5f8fb;
  --home-card: #fff;
  --home-radius: 15px;
  --home-shadow: 0 10px 24px rgba(20, 34, 50, 0.07);
  --home-shadow-hover: 0 18px 38px rgba(20, 34, 50, 0.14);
  color: var(--home-text);
  overflow: hidden;
}

.home-v3 a { text-decoration: none; }
.home-v3 img { display: block; max-width: 100%; }
.home-v3 .slider-section { margin-bottom: 0 !important; }

.home-section {
  padding: 42px 0;
}

.home-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.home-section-head--center {
  justify-content: center;
  text-align: center;
}

.home-section-head--center > div { max-width: 660px; }
.home-section-head--compact { margin-bottom: 16px; }

.home-section-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--home-primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.home-section-head h2 {
  margin: 0;
  color: var(--home-text);
  font-size: clamp(27px, 2.5vw, 38px);
  line-height: 1.08;
  font-weight: 800;
}

.home-section-head p {
  margin: 7px 0 0;
  color: var(--home-muted);
  font-size: 14px;
}

.home-view-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 8px 13px;
  border: 1px solid var(--home-border);
  border-radius: 999px;
  color: var(--home-text);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  transition: transform .2s ease, box-shadow .2s ease, color .2s ease, background .2s ease, border-color .2s ease;
}

.home-view-all:hover {
  color: #fff;
  border-color: var(--home-primary);
  background: var(--home-primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(var(--home-primary-rgb), .22);
}

.home-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  color: var(--home-muted);
  font-size: 11px;
}

.home-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.home-date { color: var(--home-muted); font-size: 11px; }
.home-topic { display: inline-block; color: var(--home-primary); font-size: 11px; font-weight: 800; }

.home-content-badge {
  position: absolute;
  inset: 11px auto auto 11px;
  z-index: 2;
  padding: 5px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--home-primary);
  font-size: 10px;
  font-weight: 800;
}

/* Shared popup / lift interaction */
.home-lead-card,
.home-feature-card,
.home-news-row,
.home-compact-card,
.home-stat-card,
.home-sufi-card,
.home-video-card,
.home-popular-card,
.home-poetry-card,
.home-playlist-card,
.home-author-card,
.home-language-card {
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.home-lead-card:hover,
.home-feature-card:hover,
.home-news-row:hover,
.home-compact-card:hover,
.home-stat-card:hover,
.home-sufi-card:hover,
.home-video-card:hover,
.home-popular-card:hover,
.home-poetry-card:hover,
.home-playlist-card:hover,
.home-author-card:hover,
.home-language-card:hover {
  transform: translateY(-5px);
  border-color: rgba(var(--home-primary-rgb), .33);
  box-shadow: var(--home-shadow-hover);
}

.home-lead-media img,
.home-feature-media img,
.home-news-row-media img,
.home-compact-media img,
.home-sufi-media img,
.home-video-media img,
.home-popular-media img,
.home-poetry-media img,
.home-playlist-media img,
.home-author-photo img {
  transition: transform .35s ease;
}

.home-lead-card:hover img,
.home-feature-card:hover img,
.home-news-row:hover img,
.home-compact-card:hover img,
.home-sufi-card:hover img,
.home-video-card:hover img,
.home-popular-card:hover img,
.home-poetry-card:hover img,
.home-playlist-card:hover img,
.home-author-card:hover img {
  transform: scale(1.035);
}

/* News */
.home-news-section { background: var(--home-soft); }
.home-lead-card,
.home-feature-card {
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--home-border);
  border-radius: var(--home-radius);
  background: #fff;
  box-shadow: var(--home-shadow);
}

.home-lead-media,
.home-feature-media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 7.6;
  overflow: hidden;
  background: #eaf0f5;
}

.home-lead-media img,
.home-feature-media img { width: 100%; height: 100%; object-fit: cover; }
.home-lead-body,
.home-feature-body { padding: 18px 20px; }

.home-lead-body h3,
.home-feature-body h3 {
  margin: 9px 0 6px;
  color: var(--home-text);
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.34;
  font-weight: 800;
}

.home-lead-body p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--home-muted);
  font-size: 13px;
  line-height: 1.6;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.home-news-list { display: grid; gap: 10px; height: 100%; }
.home-news-row {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  min-height: 96px;
  padding: 8px;
  border: 1px solid var(--home-border);
  border-radius: 13px;
  background: #fff;
}
.home-news-row-media { overflow: hidden; border-radius: 9px; background: #eaf0f5; }
.home-news-row-media img { width: 100%; height: 100%; min-height: 78px; object-fit: cover; }
.home-news-row-body { align-self: center; }
.home-news-row-body h3 {
  margin: 5px 0 0;
  color: var(--home-text);
  font-size: 14px;
  line-height: 1.42;
  font-weight: 800;
}

/* Explore: eight compact items on one desktop row */
.home-explore-section { padding: 30px 0 34px; background: #fff; }
.home-explore-section .home-section-head { margin-bottom: 16px; }
.home-explore-section .home-section-head h2 { font-size: clamp(25px, 2.2vw, 34px); }
.home-explore-section .home-section-head p { display: none; }
.home-stat-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 9px;
}

.home-stat-card {
  min-width: 0;
  min-height: 102px;
  padding: 12px 11px;
  border: 1px solid var(--home-border);
  border-radius: 13px;
  background: #fff;
  color: var(--home-text);
  box-shadow: 0 5px 14px rgba(20, 34, 50, .04);
}
.home-stat-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 9px;
  border-radius: 9px;
  color: var(--home-primary);
  background: rgba(var(--home-primary-rgb), .09);
  font-size: 12px;
}
.home-stat-card strong { display: block; color: var(--home-text); font-size: 22px; line-height: 1; font-weight: 900; }
.home-stat-card > span:last-child {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: var(--home-muted);
  font-size: 10px;
  line-height: 1.25;
  font-weight: 800;
  text-overflow: ellipsis;
}

/* Ads */
.home-ad-section { padding: 8px 0 22px; background: #fff; }
.home-ad-card {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--home-border);
  border-radius: 12px;
  background: #f8fafc;
}
.home-ad-card picture,
.home-ad-card img { width: 100%; }
.home-ad-card img { object-fit: contain; }
.home-ad-section--horizontal .home-ad-card { max-height: 160px; }
.home-ad-section--horizontal .home-ad-card picture,
.home-ad-section--horizontal .home-ad-card img { height: 100%; max-height: 160px; }
.home-ad-label {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 2;
  padding: 3px 6px;
  border-radius: 4px;
  color: rgba(255,255,255,.94);
  background: rgba(0,0,0,.58);
  font-size: 8px;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.home-vertical-ad-wrap {
  width: 100%;
  max-width: 280px;
  margin-left: auto;
}
.home-ad-card--vertical {
  width: 100%;
  max-height: 390px;
  aspect-ratio: 3 / 4;
}
.home-ad-card--vertical picture,
.home-ad-card--vertical img { width: 100%; height: 100%; }
.home-ad-card--vertical img { object-fit: contain; }

/* Latest Articles */
.home-articles-section { background: #fff; }
.home-feature-card h3 { font-size: clamp(20px, 1.8vw, 27px); }
.home-compact-grid { display: grid; gap: 10px; }
.home-compact-card {
  display: grid;
  grid-template-columns: 125px 1fr;
  gap: 12px;
  min-height: 108px;
  padding: 8px;
  border: 1px solid var(--home-border);
  border-radius: 13px;
  background: #fff;
}
.home-compact-media { overflow: hidden; border-radius: 9px; background: #edf1f5; }
.home-compact-media img { width: 100%; height: 100%; object-fit: cover; }
.home-compact-body { align-self: center; }
.home-compact-body h3 { margin: 5px 0; color: var(--home-text); font-size: 15px; line-height: 1.42; font-weight: 800; }

/* Sufiya + Video Articles */
.home-discover-section { background: var(--home-soft); }
.home-sufi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.home-sufi-card,
.home-video-card {
  overflow: hidden;
  border: 1px solid var(--home-border);
  border-radius: 13px;
  background: #fff;
}
.home-sufi-media,
.home-video-media { position: relative; display: block; aspect-ratio: 16 / 9.3; overflow: hidden; background: #eaf0f5; }
.home-sufi-media img,
.home-video-media img { width: 100%; height: 100%; object-fit: cover; }
.home-sufi-body,
.home-video-body { padding: 11px 12px; }
.home-sufi-body h3,
.home-video-body h3 { margin: 5px 0; color: var(--home-text); font-size: 14px; line-height: 1.42; font-weight: 800; }
.home-sufi-body small { color: var(--home-muted); font-size: 10px; }
.home-play-button {
  position: absolute;
  inset: 50% auto auto 50%;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  color: #fff;
  background: rgba(0,0,0,.68);
  box-shadow: 0 0 0 4px rgba(255,255,255,.22);
}
.home-video-placeholder { display: grid; place-items: center; height: 100%; color: var(--home-primary); font-size: 28px; }


/* Most popular + deliberately smaller ad */
.home-popular-section { background: #fff; }
.home-popular-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.home-popular-card {
  display: grid;
  grid-template-columns: 105px 1fr;
  gap: 11px;
  padding: 8px;
  border: 1px solid var(--home-border);
  border-radius: 13px;
  background: #fff;
}
.home-popular-media { overflow: hidden; border-radius: 9px; background: #edf1f5; }
.home-popular-media img { width: 100%; height: 100%; min-height: 88px; object-fit: cover; }
.home-popular-body { align-self: center; }
.home-popular-body h3 { margin: 5px 0 0; color: var(--home-text); font-size: 14px; line-height: 1.42; font-weight: 800; }

/* Poetry */
.home-poetry-section { background: var(--home-soft); }
.home-poetry-card {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--home-border);
  border-radius: 13px;
  background: #fff;
}
.home-poetry-media { display: block; aspect-ratio: 4 / 2.75; overflow: hidden; background: #edf1f5; }
.home-poetry-media img { width: 100%; height: 100%; object-fit: cover; }
.home-poetry-body { padding: 12px 13px; }
.home-poetry-body h3 { margin: 5px 0 7px; color: var(--home-text); font-size: 15px; line-height: 1.45; font-weight: 800; }
.home-poetry-body small { color: var(--home-muted); font-size: 11px; }

/* Books */
.home-books-section { background: #fff; }
.home-book-card { padding: 7px; text-align: center; border-radius: 13px; transition: transform .22s ease, box-shadow .22s ease; }
.home-book-card:hover { transform: translateY(-5px); box-shadow: var(--home-shadow-hover); }
.home-book-cover {
  display: block;
  width: min(100%, 180px);
  margin: 0 auto 11px;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 7px;
  background: #edf1f5;
  box-shadow: 0 10px 22px rgba(23, 32, 42, .12);
}
.home-book-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.home-book-card:hover .home-book-cover img { transform: scale(1.025); }
.home-book-body h3 { margin: 0 0 4px; color: var(--home-text); font-size: 14px; line-height: 1.4; font-weight: 800; }
.home-book-body small { color: var(--home-muted); font-size: 11px; }

/* Languages - compact, no unnecessary empty height */
.home-language-section {
  padding: 34px 0 !important;
  min-height: 0 !important;
  background: linear-gradient(135deg, rgba(var(--home-primary-rgb), .97), #123f68);
}
.home-language-section .home-section-head { margin-bottom: 15px; }
.home-language-section .home-section-kicker,
.home-language-section .home-section-head h2,
.home-language-section .home-section-head p { color: #fff; }
.home-language-section .home-section-kicker { opacity: .78; }
.home-language-section .home-section-head p { display: none; }
.home-language-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.home-language-card {
  min-height: 112px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 13px;
  color: #fff;
  background: rgba(255,255,255,.10);
  backdrop-filter: blur(4px);
}
.home-language-card:hover { color: #fff; background: rgba(255,255,255,.17); }
.home-language-name { display: block; min-height: 28px; font-size: 20px; font-weight: 800; }
.home-language-card strong { display: inline-block; margin-top: 10px; margin-right: 6px; font-size: 23px; line-height: 1; }
.home-language-card > span:last-child { display: inline-block; margin-top: 8px; font-size: 10px; opacity: .84; }

/* Playlists */
.home-playlists-section { padding-top: 38px; padding-bottom: 38px; background: var(--home-soft); }
.home-playlist-card { overflow: hidden; border: 1px solid var(--home-border); border-radius: 13px; background: #fff; }
.home-playlist-media { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #edf1f5; }
.home-playlist-media img { width: 100%; height: 100%; object-fit: cover; }
.home-playlist-body { padding: 10px; }
.home-playlist-body h3 { margin: 0; color: var(--home-text); font-size: 13px; line-height: 1.4; font-weight: 800; }

/* Weekly rotating contributors */
.home-authors-section { padding-top: 38px; padding-bottom: 42px; background: #fff; }
.home-author-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--home-border);
  border-radius: 13px;
  background: #fff;
}
.home-author-photo { flex: 0 0 60px; width: 60px; height: 60px; overflow: hidden; border-radius: 50%; background: #edf1f5; }
.home-author-photo img { width: 100%; height: 100%; object-fit: cover; }
.home-author-body { min-width: 0; }
.home-author-body h3 { margin: 0 0 4px; color: var(--home-text); font-size: 14px; line-height: 1.35; font-weight: 800; }
.home-author-body span { color: var(--home-muted); font-size: 10px; line-height: 1.35; }

/* RTL typography without changing card geometry */
.home-v3 .urdu,
.home-v3 .arabic { direction: rtl; text-align: right; }
.home-v3 .english,
.home-v3 .hindi { direction: ltr; }
.home-v3 .urdu .home-meta,
.home-v3 .arabic .home-meta { justify-content: flex-start; }

@media (max-width: 1199.98px) {
  .home-section { padding: 38px 0; }
  .home-stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .home-stat-card { min-height: 94px; }
  .home-vertical-ad-wrap { max-width: 250px; margin: 0 auto; }
  .home-ad-card--vertical { max-height: 330px; }
}

@media (max-width: 991.98px) {
  .home-section { padding: 34px 0; }
  .home-section-head { align-items: flex-start; margin-bottom: 17px; }
  .home-news-list { margin-top: 3px; }
  .home-popular-grid { grid-template-columns: 1fr 1fr; }
  .home-language-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-vertical-ad-wrap { max-width: 520px; }
  .home-ad-card--vertical { max-height: 260px; aspect-ratio: 16 / 6; }
}

@media (max-width: 767.98px) {
  .home-section { padding: 30px 0; }
  .home-section-head { display: block; margin-bottom: 15px; }
  .home-section-head h2 { font-size: 26px; }
  .home-view-all { margin-top: 10px; }
  .home-lead-body, .home-feature-body { padding: 15px; }
  .home-lead-body h3, .home-feature-body h3 { font-size: 20px; }
  .home-news-row { grid-template-columns: 100px 1fr; min-height: 88px; }
  .home-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .home-stat-card { min-height: 86px; padding: 10px; }
  .home-stat-icon { width: 27px; height: 27px; margin-bottom: 7px; }
  .home-stat-card strong { font-size: 20px; }
  .home-compact-card { grid-template-columns: 108px 1fr; }
  .home-sufi-grid { grid-template-columns: 1fr 1fr; }
  .home-popular-grid { grid-template-columns: 1fr; }
  .home-language-card { min-height: 100px; }
}

@media (max-width: 575.98px) {
  .home-section { padding: 27px 0; }
  .home-section-kicker { font-size: 10px; }
  .home-news-row { grid-template-columns: 88px 1fr; gap: 9px; }
  .home-news-row-body h3 { font-size: 13px; }
  .home-compact-card { grid-template-columns: 90px 1fr; gap: 9px; min-height: 94px; }
  .home-compact-body h3 { font-size: 13px; }
  .home-sufi-grid { grid-template-columns: 1fr; }
  .home-popular-card { grid-template-columns: 86px 1fr; gap: 9px; }
  .home-popular-body h3 { font-size: 12px; }
  .home-book-body h3 { font-size: 13px; }
  .home-language-grid { gap: 8px; }
  .home-language-card { min-height: 92px; padding: 12px; }
  .home-language-name { font-size: 18px; }
  .home-language-card strong { font-size: 21px; }
  .home-playlist-body h3 { font-size: 12px; }
  .home-author-card { padding: 10px; }
  .home-author-photo { flex-basis: 54px; width: 54px; height: 54px; }
}

/* ========================================================================
 * Alehsan Media Home V4 refinements
 * Reliable native rails (no Slick dependency), tighter editorial spacing,
 * consistent family styling across Home sections.
 * ====================================================================== */

/* Give the slider dots and first editorial section clean breathing room. */
.home-v3 .slider-section {
  margin-bottom: 30px !important;
}

/* Overall Home spacing: tighter than V3, still airy enough for a news portal. */
.home-v3 .home-section {
  padding-top: 34px;
  padding-bottom: 34px;
}
.home-v3 .home-section-head { margin-bottom: 16px; }
.home-v3 .home-section-head--compact { margin-bottom: 14px; }
.home-v3 .home-news-section { padding-top: 28px; }

/* One visual family: same border/radius/shadow language across editorial cards. */
.home-v3 .home-lead-card,
.home-v3 .home-feature-card,
.home-v3 .home-news-row,
.home-v3 .home-compact-card,
.home-v3 .home-stat-card,
.home-v3 .home-sufi-card,
.home-v3 .home-video-card,
.home-v3 .home-popular-card,
.home-v3 .home-poetry-card,
.home-v3 .home-playlist-card,
.home-v3 .home-author-card,
.home-v3 .home-language-card,
.home-v3 .home-book-card {
  border-radius: 14px;
}

/* ------------------------------------------------------------------------
 * Native horizontal rail system
 * Works with mouse, touch, trackpad and arrow controls. No plugin required.
 * --------------------------------------------------------------------- */
.home-v3 .home-rail-shell {
  position: relative;
  min-width: 0;
}

.home-v3 .home-rail {
  display: flex;
  gap: 12px;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 14px;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}
.home-v3 .home-rail::-webkit-scrollbar { display: none; }
.home-v3 .home-rail-item {
  flex: 0 0 auto;
  min-width: 0;
  scroll-snap-align: start;
}

.home-v3 .home-rail-arrow {
  position: absolute;
  top: 50%;
  z-index: 8;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  transform: translateY(-50%);
  border: 1px solid rgba(23,32,42,.13);
  border-radius: 50%;
  color: var(--home-text);
  background: rgba(255,255,255,.97);
  box-shadow: 0 8px 20px rgba(20,34,50,.14);
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, color .2s ease, opacity .2s ease;
}
.home-v3 .home-rail-arrow:hover {
  color: #fff;
  background: var(--home-primary);
  transform: translateY(-50%) scale(1.06);
}
.home-v3 .home-rail-arrow:disabled {
  opacity: .28;
  cursor: default;
  pointer-events: none;
}
.home-v3 .home-rail-arrow--prev { left: -14px; }
.home-v3 .home-rail-arrow--next { right: -14px; }

/* Video Articles: two cards in the desktop half-column, three when section stacks. */
.home-v3 .home-video-rail-item {
  width: calc((100% - 12px) / 2);
}
.home-v3 .home-video-card { height: 100%; }
.home-v3 .home-video-media { aspect-ratio: 16 / 9; }
.home-v3 .home-video-body { min-height: 92px; }
.home-v3 .home-video-body h3 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* Books: always one horizontal line. The rail, not a wrapping grid, handles responsiveness. */
.home-v3 .home-book-rail-item {
  width: calc((100% - 48px) / 5);
}
.home-v3 .home-book-card {
  height: 100%;
  padding: 8px;
  border: 1px solid transparent;
  background: #fff;
}
.home-v3 .home-book-cover {
  width: min(100%, 168px);
  margin-bottom: 9px;
}
.home-v3 .home-book-body h3 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* Playlists: 5 full desktop, 3 medium, 2 small. */
.home-v3 .home-playlist-rail-item {
  width: calc((100% - 48px) / 5);
}
.home-v3 .home-playlist-card { height: 100%; }
.home-v3 .home-playlist-body h3 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* Sufiya & Poetry stay as a consistent two-card family on responsive screens. */
.home-v3 .home-sufi-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.home-v3 .home-sufi-card,
.home-v3 .home-poetry-card { height: 100%; }

/* Most Popular: content gets priority; vertical ad becomes a true sidebar unit. */
.home-v3 .home-vertical-ad-wrap {
  max-width: 190px;
  margin: 0 auto;
}
.home-v3 .home-ad-card--vertical {
  max-height: 285px;
  aspect-ratio: 3 / 4;
}
.home-v3 .home-ad-card--vertical img { object-fit: contain; }

/* Small refinements to make repeated card blocks feel related, not isolated. */
.home-v3 .home-sufi-body,
.home-v3 .home-video-body,
.home-v3 .home-poetry-body,
.home-v3 .home-playlist-body { padding: 10px 11px; }
.home-v3 .home-sufi-body h3,
.home-v3 .home-video-body h3,
.home-v3 .home-poetry-body h3,
.home-v3 .home-playlist-body h3 { margin-top: 4px; }

@media (max-width: 1199.98px) {
  .home-v3 .home-section { padding-top: 31px; padding-bottom: 31px; }
  .home-v3 .home-video-rail-item { width: calc((100% - 24px) / 3); }
  .home-v3 .home-book-rail-item { width: calc((100% - 24px) / 3); }
  .home-v3 .home-playlist-rail-item { width: calc((100% - 24px) / 3); }
  .home-v3 .home-vertical-ad-wrap { max-width: 260px; }
}

@media (max-width: 991.98px) {
  .home-v3 .slider-section { margin-bottom: 24px !important; }
  .home-v3 .home-section { padding-top: 29px; padding-bottom: 29px; }
  .home-v3 .home-video-rail-item { width: calc((100% - 12px) / 2); }
  .home-v3 .home-book-rail-item { width: calc((100% - 12px) / 2); }
  .home-v3 .home-playlist-rail-item { width: calc((100% - 12px) / 2); }
  .home-v3 .home-vertical-ad-wrap { max-width: 440px; }
  .home-v3 .home-ad-card--vertical { max-height: 220px; aspect-ratio: 16 / 6; }
}

@media (max-width: 767.98px) {
  .home-v3 .slider-section { margin-bottom: 22px !important; }
  .home-v3 .home-section { padding-top: 27px; padding-bottom: 27px; }
  .home-v3 .home-section-head { margin-bottom: 14px; }
  .home-v3 .home-rail-arrow {
    width: 30px;
    height: 30px;
    font-size: 11px;
  }
  .home-v3 .home-rail-arrow--prev { left: -7px; }
  .home-v3 .home-rail-arrow--next { right: -7px; }
  .home-v3 .home-video-rail-item { width: calc((100% - 12px) / 2); }
  .home-v3 .home-book-rail-item { width: calc((100% - 12px) / 2); }
  .home-v3 .home-playlist-rail-item { width: calc((100% - 12px) / 2); }
  .home-v3 .home-sufi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-v3 .home-sufi-body h3,
  .home-v3 .home-poetry-body h3 { font-size: 13px; line-height: 1.4; }
}

@media (max-width: 575.98px) {
  .home-v3 .home-section { padding-top: 24px; padding-bottom: 24px; }
  .home-v3 .home-news-section { padding-top: 24px; }
  .home-v3 .home-sufi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .home-v3 .home-sufi-body,
  .home-v3 .home-poetry-body { padding: 9px; }
  .home-v3 .home-sufi-body h3,
  .home-v3 .home-poetry-body h3 { font-size: 12px; }
  .home-v3 .home-sufi-body small,
  .home-v3 .home-poetry-body small { font-size: 9px; }
  .home-v3 .home-book-rail-item { width: calc((100% - 10px) / 2); }
  .home-v3 .home-playlist-rail-item { width: calc((100% - 10px) / 2); }
  .home-v3 .home-video-rail-item { width: 86%; }
  .home-v3 .home-rail { gap: 10px; }
}

/* =========================================================
   Home V4 — Final production adjustments
   ========================================================= */

/* More breathing room between the slider and News & Updates. */
.home-v3 .home-news-section {
  padding-top: 42px;
}

/* Sufiya first full row, Video Articles second full row. */
.home-v3 .home-discover-section .row {
  row-gap: 34px !important;
}

@media (min-width: 1200px) {
  .home-v3 .home-sufi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
  }

  .home-v3 .home-video-rail-item {
    width: calc((100% - 36px) / 4) !important;
  }
}

/* Home-only vertical ad: neutralize legacy global ad height rules. */
.home-v3 .home-popular-section .col-xl-2 {
  align-self: flex-start !important;
  height: fit-content !important;
}

.home-v3 .home-popular-section .home-vertical-ad-wrap {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: center !important;
  width: 100% !important;
  height: fit-content !important;
  min-height: 0 !important;
  max-height: none !important;
  align-self: flex-start;
}

.home-v3 .home-popular-section .ad__cont.vertical.home-ad-card--vertical {
  display: inline-block !important;
  flex: none !important;
  width: 170px !important;
  min-width: 0 !important;
  max-width: 170px !important;
  height: fit-content !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}

.home-v3 .home-popular-section .home-ad-card--vertical picture {
  display: block !important;
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  height: fit-content !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: hidden;
  line-height: 0;
}

.home-v3 .home-popular-section .home-ad-card--vertical picture img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  object-fit: contain !important;
}
