/* ============================================================
   IB News — custom magazine homepage (.ibhome)
   Loaded only on the front page.
   ============================================================ */
/* CSS custom properties — scoped to .ibhome (PHP template) or injected globally for Elementor */
.ibhome,
.ibhome-hero, .ibhome-band, .ibhome-rail, .ibhome-cta {
  --ink: #0f1e3d;
  --muted: #94a3b8;
  --line: #e9edf4;
  --body: #4a5a78;
}
.ibhome {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  padding: 26px 0 8px;
}
/* In Elementor mode the .ibhome wrapper is absent; restore the top breathing room on the hero */
.elementor .ibhome-hero { padding-top: 26px; }
/* When rendered by Elementor shortcodes the .ibhome wrapper is absent — apply fonts to sections */
.ibhome-hero, .ibhome-band, .ibhome-rail, .ibhome-cta {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}
.ibhome a { text-decoration: none; }
/* Images — cover all section contexts whether or not .ibhome wrapper exists */
.ibhome img,
.ibhome-lead__media img,
.ibhome-sec__media img,
.ibhome-hcard__media img,
.ibhome-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* All media wrappers must be block so aspect-ratio applies (they are <a> = inline by default) */
/* Neutral gradient fallback so a thumbnail-less card never shows a white void. */
.ibhome-lead__media,
.ibhome-sec__media,
.ibhome-hcard__media,
.ibhome-card__media { display: block; background: linear-gradient(135deg, #eef2f9 0%, #dde5f2 100%); }

/* Category tag — small coloured uppercase label */
.ibhome-tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 9px;
}
.ibhome-tag:hover { text-decoration: underline; text-underline-offset: 2px; }

/* Shared section header */
.ibhome-h {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.018em;
  color: var(--ink);
  margin: 0 0 24px;
  padding: 0 0 15px;
  border-bottom: 2px solid #eef1f7;
}
.ibhome-h__bar {
  width: 5px; height: 22px; border-radius: 3px;
  background: var(--rail, #1e40af);
}
.ibhome-h__all {
  margin-left: auto;
  font-size: 12.5px; font-weight: 700;
  color: var(--rail, #1e40af);
}
.ibhome-h__all::after { content: " \2192"; }
.ibhome-h--side { font-size: 16px; }

/* ── HERO ─────────────────────────────────────────────────────────── */
.ibhome-hero {
  display: grid;
  grid-template-columns: 1.65fr 1fr;
  gap: 36px;
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line);
}
.ibhome-lead__media {
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 20px;
}
.ibhome-lead__media img { transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.ibhome-lead:hover .ibhome-lead__media img { transform: scale(1.04); }
.ibhome-lead__title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.022em;
  margin: 0 0 14px;
}
.ibhome-lead__title a { color: var(--ink); transition: color .18s; }
.ibhome-lead:hover .ibhome-lead__title a { color: #1d4ed8; }
.ibhome-lead__excerpt {
  font-size: 16px;
  line-height: 1.65;
  color: var(--body);
  margin: 0 0 16px;
  max-width: 60ch;
}
.ibhome-meta { font-size: 13px; color: var(--muted); font-weight: 500; }

/* Secondary stack */
.ibhome-secondary { display: flex; flex-direction: column; }
.ibhome-sec-head,
.ibhome-lead-head {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 14px;
  padding: 0 0 11px;
  border-bottom: 2px solid #dbe4f3;
  display: flex;
  align-items: center;
  gap: 9px;
}
.ibhome-sec-head::before,
.ibhome-lead-head::before {
  content: "";
  width: 4px; height: 15px; border-radius: 2px;
  background: #1d4ed8;
}
.ibhome-sec {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.ibhome-sec:first-child { padding-top: 0; }
.ibhome-sec:last-child { border-bottom: 0; }
.ibhome-sec__media {
  aspect-ratio: 1 / 1;
  border-radius: 9px;
  overflow: hidden;
}
.ibhome-sec__media img { transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.ibhome-sec:hover .ibhome-sec__media img { transform: scale(1.06); }
.ibhome-sec__body .ibhome-tag { margin-bottom: 5px; font-size: 9.5px; }
.ibhome-sec__title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.34;
  letter-spacing: -.01em;
  margin: 0 0 6px;
}
.ibhome-sec__title a { color: var(--ink); }
.ibhome-sec:hover .ibhome-sec__title a { color: #1d4ed8; }
.ibhome-sec__date { font-size: 12px; color: var(--muted); }

/* ── LATEST + MOST READ ───────────────────────────────────────────── */
.ibhome-band {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 44px;
  margin-bottom: 44px;
}
.ibhome-hcard {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 22px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.ibhome-hcard:first-of-type { padding-top: 0; }
.ibhome-hcard__media {
  aspect-ratio: 16 / 10;
  border-radius: 11px;
  overflow: hidden;
}
.ibhome-hcard__media img { transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.ibhome-hcard:hover .ibhome-hcard__media img { transform: scale(1.05); }
.ibhome-hcard__title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: -.015em;
  margin: 0 0 8px;
}
.ibhome-hcard__title a { color: var(--ink); transition: color .18s; }
.ibhome-hcard:hover .ibhome-hcard__title a { color: #1d4ed8; }
.ibhome-hcard__excerpt {
  font-size: 14px;
  line-height: 1.6;
  color: var(--body);
  margin: 0 0 10px;
}
.ibhome-hcard__date { font-size: 12.5px; color: var(--muted); }

/* Most read sidebar */
.ibhome-band__side { align-self: start; position: sticky; top: 96px; }
.ibhome-rank { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.ibhome-rank__item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.ibhome-rank__item:first-child { padding-top: 0; }
.ibhome-rank__item:last-child { border-bottom: 0; }
.ibhome-rank__num {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  color: #cdd6e6;
  letter-spacing: -.04em;
}
.ibhome-rank__body .ibhome-tag { margin-bottom: 4px; font-size: 9px; }
.ibhome-rank__title {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.34;
  letter-spacing: -.01em;
  margin: 0 0 5px;
}
.ibhome-rank__title a { color: var(--ink); }
.ibhome-rank__item:hover .ibhome-rank__title a { color: #1d4ed8; }
.ibhome-rank__date { font-size: 11.5px; color: var(--muted); }

/* ── CATEGORY RAILS ───────────────────────────────────────────────── */
.ibhome-rail { margin-bottom: 42px; }
/* Low-content board: Latest News grid fills the row regardless of card count */
.ibhome-rail--latest .ibhome-grid { grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); }
.ibhome-rail .ibhome-h { border-bottom-color: #eef1f7; }
.ibhome-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px;
}
.ibhome-card__media {
  aspect-ratio: 16 / 10;
  border-radius: 11px;
  overflow: hidden;
  margin-bottom: 13px;
}
.ibhome-card__media img { transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.ibhome-card:hover .ibhome-card__media img { transform: scale(1.05); }
.ibhome-card__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.36;
  letter-spacing: -.012em;
  margin: 0 0 9px;
}
.ibhome-card__title a { color: var(--ink); transition: color .18s; }
.ibhome-card:hover .ibhome-card__title a { color: var(--rail, #1d4ed8); }
.ibhome-card__date { font-size: 12px; color: var(--muted); }

/* ── NEWSLETTER CTA ───────────────────────────────────────────────── */
.ibhome-cta {
  margin: 8px 0 24px;
  border-radius: 18px;
  background: linear-gradient(120deg, #0f1e3d 0%, #16306a 55%, #1d4ed8 130%);
  overflow: hidden;
}
.ibhome-cta__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 48px 52px;
  flex-wrap: wrap;
}
.ibhome-cta__text h2 {
  font-size: 27px; font-weight: 800; color: #fff;
  margin: 0 0 8px; letter-spacing: -.02em;
}
.ibhome-cta__text p {
  font-size: 15px; color: #aebbd6; margin: 0; max-width: 46ch; line-height: 1.55;
}
.ibhome-cta__form { display: flex; gap: 10px; flex: 1; min-width: 320px; max-width: 460px; }
.ibhome-cta__form input {
  flex: 1;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  color: #fff;
  border-radius: 9px;
  padding: 14px 16px;
  font-size: 14.5px;
  outline: none;
}
.ibhome-cta__form input::placeholder { color: #9fb0d0; }
.ibhome-cta__form input:focus { border-color: #6ea8ff; background: rgba(255,255,255,.12); }
.ibhome-cta__form button {
  border: 0;
  background: #fff;
  color: #0f1e3d;
  font-weight: 800;
  font-size: 14.5px;
  padding: 0 26px;
  border-radius: 9px;
  cursor: pointer;
  transition: transform .15s, background .15s;
}
.ibhome-cta__form button:hover { background: #e6edff; transform: translateY(-1px); }

/* ── RESPONSIVE ───────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .ibhome-hero { grid-template-columns: 1fr; gap: 32px; }
  .ibhome-band { grid-template-columns: 1fr; gap: 44px; }
  .ibhome-band__side { position: static; }
  .ibhome-grid { grid-template-columns: repeat(2, 1fr); gap: 24px 20px; }
  .ibhome-lead__title { font-size: 28px; }
}
@media (max-width: 600px) {
  .ibhome-hcard { grid-template-columns: 1fr; gap: 12px; }
  .ibhome-hcard__media { aspect-ratio: 16 / 9; }
  .ibhome-grid { grid-template-columns: 1fr; }
  .ibhome-lead__title { font-size: 24px; }
  .ibhome-cta__inner { padding: 34px 26px; }
  .ibhome-cta__form { min-width: 0; }
}
