/* ══════════════════════════════════════════════════
   Home Banners  –  Apple-style responsive grid
   ══════════════════════════════════════════════════ */

/* ─── Grid container ─── */
.hb-section {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  background: #000;
}

/* ─── Banner card ─── */
.hb-item {
  position: relative;
  overflow: hidden;
  /* mobile width & height driven by CSS custom props */
  flex: 0 0 calc(var(--mc, 12) / 12 * 100%);
  height: var(--hm, 380px);
  background-color: var(--bgc, #1d1d1f);
  cursor: pointer;
}

@media (min-width: 768px) {
  .hb-item {
    flex: 0 0 calc(var(--dc, 12) / 12 * 100%);
    height: var(--hd, 600px);
  }
}

/* ─── Background image ─── */
.hb-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.8s cubic-bezier(.25, .46, .45, .94);
  will-change: transform;
}

/* Desktop vs mobile image swap */
.hb-bg--desktop { display: none; }
.hb-bg--mobile  { display: block; }

@media (min-width: 768px) {
  .hb-bg--desktop { display: block; }
  .hb-bg--mobile  { display: none; }
}

/* Subtle zoom on hover */
.hb-item:hover .hb-bg {
  transform: scale(1.04);
}

/* ─── Content layer ─── */
.hb-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 4vw, 56px);
  /* Default: bottom-center */
  align-items: center;
  justify-content: flex-end;
  text-align: center;
}

/* ─── Text position variants ─── */
.pos-top-left    .hb-content { align-items: flex-start; justify-content: flex-start; text-align: left; }
.pos-top-center  .hb-content { align-items: center;     justify-content: flex-start; text-align: center; }
.pos-top-right   .hb-content { align-items: flex-end;   justify-content: flex-start; text-align: right; }

.pos-middle-left   .hb-content { align-items: flex-start; justify-content: center; text-align: left; }
.pos-middle-center .hb-content { align-items: center;     justify-content: center; text-align: center; }
.pos-middle-right  .hb-content { align-items: flex-end;   justify-content: center; text-align: right; }

.pos-bottom-left   .hb-content { align-items: flex-start; justify-content: flex-end; text-align: left; }
.pos-bottom-center .hb-content { align-items: center;     justify-content: flex-end; text-align: center; }
.pos-bottom-right  .hb-content { align-items: flex-end;   justify-content: flex-end; text-align: right; }

/* ─── Text color ─── */
.tc-light .hb-title    { color: #f5f5f7; }
.tc-light .hb-subtitle { color: rgba(245, 245, 247, 0.82); }
.tc-dark  .hb-title    { color: #1d1d1f; }
.tc-dark  .hb-subtitle { color: rgba(29, 29, 31, 0.72); }

/* ─── Typography ─── */
.hb-title {
  font-size: clamp(24px, 3.5vw, 56px);
  font-weight: 600;
  letter-spacing: -0.3px;
  line-height: 1.07;
  margin: 0 0 10px;
  max-width: 640px;
}

.hb-subtitle {
  font-size: clamp(13px, 1.4vw, 19px);
  font-weight: 400;
  line-height: 1.55;
  margin: 0 0 24px;
  max-width: 520px;
}

/* ─── CTA Buttons ─── */
.hb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 980px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1px;
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
  white-space: nowrap;
}

.tc-light .hb-btn {
  background: rgba(255, 255, 255, 0.16);
  color: #f5f5f7;
  border: 1px solid rgba(255, 255, 255, 0.26);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.tc-light .hb-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
  text-decoration: none;
}

.tc-dark .hb-btn {
  background: rgba(0, 0, 0, 0.08);
  color: #1d1d1f;
  border: 1px solid rgba(0, 0, 0, 0.18);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.tc-dark .hb-btn:hover {
  background: rgba(0, 0, 0, 0.16);
  color: #1d1d1f;
  text-decoration: none;
}

/* ─── Gradient veil for text readability ─── */
.pos-bottom-left  .hb-content::before,
.pos-bottom-center .hb-content::before,
.pos-bottom-right  .hb-content::before {
  content: '';
  position: absolute;
  inset: 40% 0 0 0;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.38));
  pointer-events: none;
}

.tc-dark.pos-bottom-left  .hb-content::before,
.tc-dark.pos-bottom-center .hb-content::before,
.tc-dark.pos-bottom-right  .hb-content::before {
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.3));
}

/* Keep text above veil */
.hb-title, .hb-subtitle, .hb-btn { position: relative; z-index: 1; }

/* ─── No-image placeholder ─── */
.hb-item.no-image .hb-content {
  justify-content: center;
}
