/* Legit9ja — responsive refinements + green-gradient treatment.
   Loaded last so its overrides win. Mobile-first: base styles target phones,
   these add tablet/desktop polish and small-phone fixes. */

/* ---- Green gradient treatment (toggle in Customizer → Theme Colours) ---- */
body.has-brand-gradient .utility,
body.has-brand-gradient .masthead,
body.has-brand-gradient .primary-nav,
body.has-brand-gradient .site-search,
body.has-brand-gradient .drawer__panel,
body.has-brand-gradient .site-footer { background: var(--grad-brand); }
/* keep the accent underline + active states reading over the gradient */
body.has-brand-gradient .primary-nav { border-bottom-color: var(--c-accent); }
body.has-brand-gradient .site-footer { background: var(--grad-brand); }
/* subtle green wash behind the newsletter block */
body.has-brand-gradient .newsletter {
  background: color-mix(in srgb, var(--c-brand) 8%, #fff);
  border-color: color-mix(in srgb, var(--c-brand) 22%, var(--c-hairline));
}

/* ---- Fluid media & safe overflow (spec §2, §8) ---- */
.entry img, .entry iframe, .entry video, .card__media img, .carousel__slide img { max-width: 100%; height: auto; }
.entry table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; }
.entry pre { overflow-x: auto; }
:where(.container, .site-main) { overflow-x: clip; }   /* body never scrolls sideways */

/* ---- Responsive helpers ---- */
.hide-mobile { display: none; }
@media (min-width: 768px) { .hide-mobile { display: initial; } .hide-desktop { display: none; } }

/* ---- Small phones (≤380px): tighten chrome ---- */
@media (max-width: 380px) {
  body { font-size: 16px; }
  .brand__text, .logo { font-size: 22px; }
  .masthead__inner { min-height: 56px; }
  .utility__inner { flex-wrap: wrap; gap: 4px 12px; padding-block: 4px; }
  .card--compact { grid-template-columns: 92px 1fr; }
  .chart__row { grid-template-columns: 28px 46px 1fr; }
  .newsletter__form { flex-direction: column; }
}

/* ---- Hero lead caption: tighter overlay on phones so it doesn't bury the photo ---- */
@media (max-width: 600px) {
  .card--lead .slide__body { padding: var(--s-2); }
  .card--lead .card__title { -webkit-line-clamp: 2; }
  .card--lead .eyebrow { margin-bottom: 4px; }
}

/* ---- Phablet (480–767): 2-up latest grid, roomier cards ---- */
@media (min-width: 480px) and (max-width: 767px) {
  .grid--cards { grid-template-columns: repeat(2, 1fr); }
}

/* ---- Tablet (768–1023): hero still stacks but rail goes 2-col ---- */
@media (min-width: 768px) and (max-width: 1023px) {
  .hero { grid-template-columns: 1fr; }
  .hero__rail { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s-3); }
  .hero__rail .rail__title { grid-column: 1 / -1; }
  .primary-nav__menu { flex-wrap: wrap; }
}

/* ---- Desktop (≥1024): full editorial layout ---- */
@media (min-width: 1024px) {
  .hero { grid-template-columns: 62% 1fr; }
  .section { margin-block: var(--s-6); }
}

/* ---- Large (≥1280): a touch more breathing room ---- */
@media (min-width: 1280px) {
  :root { --wide: 1200px; }
}

/* ---- Landscape phones: cap hero/carousel height so it doesn't dominate ---- */
@media (max-width: 900px) and (orientation: landscape) {
  .carousel__slide .card__media, .hero__lead .card__media { aspect-ratio: 21/9; }
}

/* ---- Print ---- */
@media print {
  .utility, .primary-nav, .ticker, .carousel__btn, .carousel__dots, .ad-slot, .newsletter, .site-footer { display: none !important; }
  body { font-size: 12pt; color: #000; }
}
