@import url('all-cards.css');

/* =========================================================
   Homepage
   Inherits base, banner, search, pills and buttons from all-cards.css so the
   theme stays identical; this file only adds the homepage components:
   wordmark/topnav, category rails (compact cards), tiles, bank grid,
   eligibility CTA, footer.
   ========================================================= */

/* ---------- Header: site logo + primary nav ----------
   The logo is a per-domain WebP (white artwork on a transparent canvas, /assets/logos/<site>.webp).
   Display height = --logo-h × --logo-scale (per site, set inline from SiteConfig.logo.scale) so the
   leading text is the same size on every domain. The flex item may shrink on narrow screens, in
   which case object-fit keeps the artwork proportional and pinned to the left edge. */
.banner__bar { justify-content: space-between; gap: 16px; }
.wordmark {
  --logo-h: 32px;
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
  height: 44px;
  text-decoration: none;
}
.wordmark__img {
  display: block;
  height: calc(var(--logo-h) * var(--logo-scale, 1));
  width: auto;
  max-width: min(100%, 440px);
  object-fit: contain;
  object-position: left center;
}
/* Footer variant: the artwork is white, so it sits on a navy chip */
.wordmark--dark {
  --logo-h: 30px;
  display: inline-flex;
  height: auto;
  max-width: 100%;
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--navy-top);
}

.topnav { display: flex; align-items: center; flex: none; gap: 6px; }
.topnav__link {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: 600;
  color: #DCE6FA;
  transition: background 0.15s ease, color 0.15s ease;
}
.topnav__link:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
.topnav__link--cta {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
}
.topnav__link--cta:hover { background: rgba(255, 255, 255, 0.16); }

/* ---------- Hero ---------- */
.banner--home { padding-bottom: clamp(44px, 5vw, 80px); }
.banner__body--home {
  grid-template-columns: minmax(0, 1fr);
  margin-top: clamp(28px, 4.2vw, 68px);
  text-align: center;
}
.banner__body--home .banner__copy { max-width: 820px; margin: 0 auto; }
.banner__body--home .banner__title { font-size: clamp(30px, 3.6vw, 54px); letter-spacing: -0.025em; }
.banner__body--home .banner__sub { margin-top: 14px; max-width: 680px; margin-inline: auto; line-height: 1.5; }
.banner__body--home .search { margin: clamp(22px, 2.6vw, 34px) auto 0; max-width: 700px; }
.search__go {
  position: absolute;
  right: 6px;
  top: 6px;
  bottom: 6px;
  height: auto;
  padding: 0 22px;
}

/* ---------- Page ---------- */
.home {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(28px, 3.2vw, 52px) var(--pad-x) 0;
  display: grid;
  gap: clamp(44px, 5vw, 76px);
}
.home > * { min-width: 0; }   /* grid items default to min-width:auto, which lets a scrolling rail widen the page */

/* Section head (shared by every home section) */
/* Each section is a 2-column grid: heading | "View all", then the body across both columns.
   On mobile the areas re-stack so "View all" becomes a full-width button under the body. */
.cat, .more, .banks {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "head all" "body body";
  align-items: end;
  column-gap: 20px;
  row-gap: clamp(16px, 1.8vw, 24px);
}
.cat__head { grid-area: head; min-width: 0; }
.cat__all { grid-area: all; }
.rail, .tiles, .bankgrid { grid-area: body; }
.cat__title { font-size: clamp(22px, 2vw, 30px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.cat__title a:hover { color: var(--blue-500); }
.cat__desc { margin-top: 6px; font-size: 15.5px; color: var(--ink-3); max-width: 720px; }
.cat__all {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  border: 1px solid #C9D8F3;
  background: #fff;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--blue-500);
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.cat__all:hover { border-color: var(--blue-500); background: #F5F8FF; }
.cat__all::after {
  content: '';
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: rotate(45deg);
  margin-left: 2px;
}
.cat__all [data-count]:not(:empty)::before { content: ' '; }

/* ---------- Rail of compact cards ---------- */
.rail {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(14px, 1.4vw, 22px);
  min-width: 0;
}
.mini {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 14px 14px 16px;
  border-radius: 20px;
  border: 1px solid #E1E8F6;
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.mini:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: #C9D8F3; }
.mini__img {
  display: block;
  aspect-ratio: 1.586;
  border-radius: 14px;
  overflow: hidden;
  background: var(--soft);
}
.mini__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.mini:hover .mini__img img { transform: scale(1.03); }
.mini__rank {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  margin-top: 14px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--ink-3);
  background: var(--soft);
}
.mini__rank .icon { font-size: 13px; }
.mini__rank--top { color: #fff; background: linear-gradient(180deg, #123476 0%, #0A1F52 100%); }
.mini__rank--top .icon { color: #FFD466; }
.mini__name { margin-top: 8px; font-size: 16px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.mini__name a:hover { color: var(--blue-500); }
.mini__meta { margin: 4px 0 14px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); min-width: 0; }
.mini__meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini__why {
  margin: 10px 0 14px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mini__foot {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
}
.mini__fee { display: flex; flex-direction: column; gap: 1px; }
.mini__fee small { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.mini__fee strong { font-size: 15.5px; font-weight: 800; color: var(--ink); letter-spacing: 0.01em; }
.mini__fee strong.is-free { color: var(--green); }
.mini__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--blue-500);
  background: #EEF3FC;
  transition: background 0.15s ease, color 0.15s ease;
}
.mini:hover .mini__cta { color: #fff; background: linear-gradient(180deg, #123476 0%, #0A1F52 100%); }

/* Skeleton while the data loads */
.rail[aria-busy="true"] .mini { pointer-events: none; }
.skel { border-radius: 10px; background: linear-gradient(90deg, #EEF3FC 25%, #F6F9FE 50%, #EEF3FC 75%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
.skel--img { aspect-ratio: 1.586; border-radius: 14px; }
.skel--line { height: 14px; margin-top: 12px; }
.skel--line.w60 { width: 60%; }
.skel--line.w80 { width: 80%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---------- More categories: tiles ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.2vw, 18px);
}
.tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid #E1E8F6;
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.tile:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: #C9D8F3; }
.tile__icon {
  flex: none;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--blue-500);
  background: var(--soft);
}
.tile__icon .icon { font-size: 22px; }
.tile__text { display: grid; gap: 2px; min-width: 0; }
.tile__label { font-size: 16px; font-weight: 700; color: var(--ink); }
.tile__sub { font-size: 13.5px; color: var(--ink-3); }
.tile::after {
  content: '';
  margin-left: auto;
  width: 9px;
  height: 9px;
  flex: none;
  border-right: 2px solid #B7C5E0;
  border-top: 2px solid #B7C5E0;
  transform: rotate(45deg);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.tile:hover::after { border-color: var(--blue-500); transform: rotate(45deg) translate(2px, -2px); }

/* ---------- Banks ---------- */
.bankgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.2vw, 18px);
}
.bank {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid #E1E8F6;
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}
.bank:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: #C9D8F3; }
.bank__logo {
  flex: none;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
}
.bank__logo img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.bank__text { display: grid; gap: 3px; min-width: 0; }
.bank__name { font-size: 16.5px; font-weight: 700; color: var(--ink); line-height: 1.25; }
.bank__sub { font-size: 13.5px; color: var(--ink-3); line-height: 1.4; }
.bank__sub strong { color: var(--ink-2); font-weight: 600; }
.bank__arrow {
  margin-left: auto;
  width: 9px;
  height: 9px;
  flex: none;
  border-right: 2px solid #B7C5E0;
  border-top: 2px solid #B7C5E0;
  transform: rotate(45deg);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.bank:hover .bank__arrow { border-color: var(--blue-500); transform: rotate(45deg) translate(2px, -2px); }

/* ---------- Eligibility CTA ---------- */
.cta {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(18px, 2.4vw, 32px);
  padding: clamp(24px, 2.6vw, 36px) clamp(24px, 3vw, 44px);
  border-radius: var(--r-xl);
  color: #fff;
  background:
    radial-gradient(60% 120% at 90% 20%, rgba(47, 111, 232, 0.55) 0%, rgba(47, 111, 232, 0) 70%),
    linear-gradient(180deg, #0B2152 0%, #0A1E4D 100%);
  box-shadow: 0 30px 60px -40px rgba(7, 22, 64, 0.8);
}
.cta__icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
}
.cta__icon svg { width: 30px; height: 30px; }
.cta__title { font-size: clamp(20px, 1.8vw, 26px); font-weight: 700; letter-spacing: -0.015em; }
.cta__sub { margin-top: 6px; font-size: 15px; color: #C9D8F5; max-width: 620px; line-height: 1.5; }
.btn--light { color: var(--navy-900); background: #fff; box-shadow: 0 12px 26px -12px rgba(0, 0, 0, 0.5); }
.btn--light:hover { background: #EEF3FC; transform: translateY(-1px); }

/* ---------- Footer ---------- */
.foot {
  max-width: var(--wrap);
  margin: clamp(56px, 6vw, 96px) auto 0;
  padding: clamp(32px, 3.6vw, 52px) var(--pad-x) 32px;
  border-top: 1px solid var(--line);
}
.foot__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(4, minmax(0, 1fr));
  grid-template-areas: "brand cats banks care explore";
  gap: clamp(24px, 3vw, 48px);
}
.foot__brand { grid-area: brand; }
.foot__col--cats { grid-area: cats; }
.foot__col--banks { grid-area: banks; }
.foot__col--care { grid-area: care; }
.foot__col--explore { grid-area: explore; }
.foot__grid--no-care { grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr)); grid-template-areas: "brand cats banks explore"; }   /* category domains */
.foot__tag { margin-top: 14px; max-width: 420px; font-size: 14.5px; line-height: 1.55; color: var(--ink-3); }
.foot__col { display: grid; gap: 10px; align-content: start; }
.foot__h { font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.foot__col a { font-size: 15px; font-weight: 500; color: var(--ink-2); }
.foot__col a:hover { color: var(--blue-500); }
.foot__legal { margin-top: clamp(28px, 3vw, 40px); padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.55; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .rail {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(250px, 27vw);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 4px var(--pad-x) 14px;
    margin: 0 calc(-1 * var(--pad-x));
    scrollbar-width: none;
  }
  .rail::-webkit-scrollbar { display: none; }
  .mini { scroll-snap-align: start; }
  .tiles, .bankgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot__grid { grid-template-columns: 1fr 1fr; grid-template-areas: "brand brand" "cats banks" "care explore"; }
  .foot__grid--no-care { grid-template-areas: "brand brand" "cats banks" "explore explore"; }
}

@media (max-width: 900px) {
  html, body { overflow-x: clip; }   /* page scrolls vertically only; rails scroll inside themselves */
  .banner--home { padding-top: var(--header-h); }
  .banner__bar { justify-content: space-between; }
  .wordmark { --logo-h: 26px; height: 36px; }
  .wordmark--dark { --logo-h: 24px; padding: 10px 14px; border-radius: 12px; }
  .topnav__link { height: 36px; padding: 0 12px; font-size: 14px; }
  .topnav__link:not(.topnav__link--cta) { display: none; }
  .banner__body--home { margin-top: 22px; text-align: left; }
  .banner__body--home .banner__title { font-size: 30px; }
  .banner__body--home .banner__sub { font-size: 15.5px; margin-inline: 0; }
  .banner__body--home .search { margin-top: 22px; }
  .search__go { display: none; }

  .home { gap: 40px; padding-top: 26px; }
  .cat, .more, .banks { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "body" "all"; row-gap: 14px; }
  .cat__title { font-size: 22px; }
  .cat__desc { font-size: 14.5px; }
  .cat__all { width: 100%; height: 46px; justify-content: center; font-size: 15px; }
  .cat .rail + .cat__all { margin-top: -4px; }
  .rail { grid-auto-columns: min(78vw, 300px); }
  .tiles, .bankgrid { grid-template-columns: 1fr; }
  .bank__logo { width: 56px; height: 56px; }

  .cta { grid-template-columns: 1fr; text-align: left; padding: 24px; border-radius: 22px; }
  .cta__icon { width: 52px; height: 52px; border-radius: 14px; }
  .cta__icon svg { width: 26px; height: 26px; }
  .cta .btn { width: 100%; }

  .foot { margin-top: 48px; padding-bottom: 28px; }
  .foot__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "brand brand" "cats banks" "care explore";
    column-gap: 20px;
    row-gap: 26px;
  }
  .foot__grid--no-care { grid-template-areas: "brand brand" "cats banks" "explore explore"; }
  .foot__col--explore { align-self: start; }
  .foot__col a { font-size: 14.5px; }
  .foot__legal { margin-top: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .skel { animation: none; }
}
