/* All In Horizon blog — brand-aligned with allinbridgeloans.com
   Tokens extracted from the live site bundle (index-D-gHEHek.css). */

:root {
  --background: hsl(40 25% 98%);
  --foreground: hsl(210 24% 16%);
  --card: hsl(0 0% 100%);
  --primary: hsl(200 69% 26%);
  --primary-light: hsl(200 60% 35%);
  --primary-fg: hsl(0 0% 100%);
  --secondary: hsl(40 40% 96%);
  --muted: hsl(40 30% 94%);
  --muted-fg: hsl(210 12% 45%);
  --accent: hsl(16 100% 61%);
  --accent-fg: hsl(0 0% 100%);
  --border: hsl(40 20% 88%);
  --radius: 0.75rem;
  --gradient-hero: linear-gradient(135deg, hsl(200 69% 26%) 0%, hsl(200 60% 35%) 100%);
  --shadow-card: 0 4px 20px -2px hsl(200 69% 26% / .08);
  --shadow-hover: 0 8px 30px -4px hsl(200 69% 26% / .12);
  --ease-spring: cubic-bezier(0.16, 1, 0.32, 1);
  --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--foreground);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--primary); text-decoration: none; transition: color .2s var(--ease-spring); }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }

/* ── Header (mirrors main-site navbar) ─────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: hsl(40 25% 98% / .95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header > .inner {
  max-width: 1240px; margin: 0 auto; padding: 0 1.5rem;
  height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .75rem; flex-shrink: 0; }
.brand img { height: 56px; width: auto; mix-blend-mode: multiply; }
.brand .brand-name {
  font-size: 1.35rem; font-weight: 700; color: var(--primary);
  letter-spacing: .01em; white-space: nowrap;
}
.brand:hover .brand-name { color: var(--primary); }

.nav-links { display: flex; gap: 1.5rem; align-items: center; font-size: .875rem; font-weight: 500; }
.nav-links > a { color: var(--foreground); }
.nav-links > a:hover { color: var(--primary); }
.nav-links > a.active { color: var(--primary); font-weight: 700; }

/* Programs dropdown (CSS-only, matches main-site menu) */
.dropdown { position: relative; }
.dropdown > button {
  display: flex; align-items: center; gap: .25rem;
  font: inherit; font-weight: 600; color: var(--accent);
  background: none; border: 0; cursor: pointer; padding: .25rem 0;
  transition: color .2s var(--ease-spring);
}
.dropdown > button:hover { color: hsl(16 100% 61% / .8); }
.dropdown .chev { transition: transform .2s var(--ease-spring); width: 1em; height: 1em; }
.dropdown:hover .chev, .dropdown:focus-within .chev { transform: rotate(180deg); }
.dropdown-menu {
  position: absolute; top: 100%; right: 0; margin-top: .5rem; width: 14rem;
  background: var(--card); border: 1px solid var(--border); border-radius: .75rem;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);
  padding: .5rem 0; opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s var(--ease-spring), transform .2s var(--ease-spring), visibility .2s;
}
.dropdown:hover .dropdown-menu, .dropdown:focus-within .dropdown-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.dropdown-menu a {
  display: block; padding: .625rem 1rem; font-size: .875rem; font-weight: 500;
  color: var(--foreground); transition: background .15s, color .15s;
}
.dropdown-menu a:hover { background: hsl(16 100% 61% / .1); color: var(--accent); }

.header-actions { display: flex; align-items: center; gap: .75rem; flex-shrink: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: calc(var(--radius) - 2px); font-weight: 600; font-size: .875rem;
  padding: .65rem 1.5rem; cursor: pointer; white-space: nowrap;
  transition: background .2s var(--ease-spring), color .2s var(--ease-spring),
              border-color .2s var(--ease-spring), transform .15s var(--ease-spring);
}
.btn:active { transform: scale(.97); }
.btn-outline { border: 1px solid var(--border); background: transparent; color: var(--foreground); }
.btn-outline:hover { background: var(--muted); color: var(--foreground); }
.btn-accent { background: var(--accent); color: var(--accent-fg) !important; border: 0; }
.btn-accent:hover { background: hsl(16 100% 61% / .9); color: var(--accent-fg); }

/* Mobile nav (checkbox toggle) */
.nav-toggle { display: none; }
.nav-toggle-label { display: none; cursor: pointer; padding: .5rem; color: var(--foreground); }
.nav-toggle-label svg { width: 24px; height: 24px; }
.mobile-menu { display: none; }

@media (max-width: 1023px) {
  .nav-links, .header-actions .btn-outline { display: none; }
  .nav-toggle-label { display: block; }
  .mobile-menu {
    display: block; max-height: 0; overflow: hidden; border-top: 0 solid var(--border);
    background: var(--background);
    transition: max-height .35s var(--ease-spring);
  }
  .nav-toggle:checked ~ .mobile-menu { max-height: calc(100vh - 80px); overflow-y: auto; border-top-width: 1px; }
  .mobile-menu .inner { padding: 1rem 1.5rem 1.25rem; display: flex; flex-direction: column; gap: .25rem; }
  .mobile-menu a { padding: .5rem 0; font-weight: 500; color: var(--foreground); }
  .mobile-menu a:hover { color: var(--primary); }
  .mobile-menu .group-label {
    font-size: .7rem; text-transform: uppercase; letter-spacing: .08em;
    color: var(--muted-fg); font-weight: 600; margin-top: .75rem; padding-top: .75rem;
    border-top: 1px solid var(--border);
  }
  .mobile-menu .program-link { color: var(--accent); font-weight: 600; padding-left: .75rem; }
  .mobile-menu .btn { margin-top: .75rem; }
}
@media (max-width: 560px) {
  .brand .brand-name { font-size: 1.05rem; }
  .brand img { height: 44px; }
  .site-header > .inner { height: 68px; }
  .header-actions .btn-accent { padding: .55rem 1rem; }
}

/* ── Index hero ─────────────────────────── */
.hero {
  background: var(--gradient-hero);
  color: var(--primary-fg);
  text-align: center; padding: 4.5rem 1.5rem 5.5rem;
  position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(80% 60% at 50% 0%, hsl(16 100% 61% / .12), transparent 70%);
}
.hero > * { position: relative; z-index: 1; }
.eyebrow {
  display: inline-block; color: var(--accent); font-weight: 600;
  font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 1rem;
}
.hero .eyebrow { color: hsl(16 100% 72%); }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.hero p { max-width: 620px; margin: 1.25rem auto 0; color: hsl(0 0% 100% / .85); font-size: 1.05rem; }

/* ── Post grid ─────────────────────────── */
.container { max-width: 1240px; margin: 0 auto; padding: 0 1.5rem; }
.post-grid {
  display: grid; gap: 1.75rem; padding: 3rem 0 4rem;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.post-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; color: inherit;
  box-shadow: var(--shadow-card);
  transition: transform .3s var(--ease-spring), box-shadow .3s var(--ease-spring), border-color .3s;
  animation: rise .5s var(--ease-spring) backwards;
}
.post-grid .post-card:nth-child(2) { animation-delay: .06s; }
.post-grid .post-card:nth-child(3) { animation-delay: .12s; }
.post-grid .post-card:nth-child(n+4) { animation-delay: .18s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.post-card:hover {
  transform: translateY(-5px); box-shadow: var(--shadow-hover);
  border-color: hsl(200 69% 26% / .25); color: inherit;
}
.post-card .thumb { aspect-ratio: 16/9; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 3rem; background: var(--muted); }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease-spring); }
.post-card:hover .thumb img { transform: scale(1.05); }
.thumb-1 { background: linear-gradient(135deg, hsl(200 69% 26% / .12), hsl(16 100% 61% / .1)); }
.thumb-2 { background: linear-gradient(135deg, hsl(16 100% 61% / .12), hsl(200 60% 35% / .1)); }
.thumb-3 { background: linear-gradient(135deg, hsl(40 40% 90%), hsl(200 69% 26% / .1)); }
.post-card .body { padding: 1.4rem 1.5rem 1.5rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.chip {
  display: inline-block; align-self: flex-start;
  background: hsl(16 100% 61% / .12); color: var(--accent);
  font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: .3rem .7rem; border-radius: 999px;
}
.post-card h2 { font-size: 1.22rem; font-weight: 700; line-height: 1.35; letter-spacing: -.01em; color: var(--primary); }
.post-card:hover h2 { color: var(--primary); }
.post-card p { color: var(--muted-fg); font-size: .93rem; flex: 1; }
.meta { display: flex; align-items: center; gap: .55rem; color: var(--muted-fg); font-size: .82rem; }
.meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-fg); }

/* ── Article ─────────────────────────── */
.progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 60; background: var(--accent); transition: width .1s linear; }
.article-wrap { max-width: 760px; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }
.breadcrumb { font-size: .85rem; color: var(--muted-fg); margin-bottom: 1.75rem; }
.breadcrumb a { font-weight: 600; }
article > .chip { margin-bottom: 1rem; }
article h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 700; line-height: 1.2;
  letter-spacing: -.02em; color: var(--primary); margin-bottom: 1rem;
}
article > .meta { margin-bottom: 2rem; }
.hero-img { border-radius: var(--radius); box-shadow: var(--shadow-card); margin-bottom: 2.25rem; width: 100%; }
article { font-size: 1.125rem; line-height: 1.75; }
article h2 {
  font-size: 1.55rem; font-weight: 700; letter-spacing: -.01em; color: var(--primary);
  margin: 2.5rem 0 1rem; padding-top: 1.25rem; position: relative;
}
article h2::before {
  content: ""; position: absolute; top: 0; left: 0; width: 44px; height: 3px;
  border-radius: 3px; background: var(--accent);
}
article h3 { font-size: 1.22rem; font-weight: 700; color: var(--foreground); margin: 1.9rem 0 .7rem; }
article p { margin-bottom: 1.15rem; }
article ul, article ol { margin: 0 0 1.15rem 1.4rem; }
article li { margin-bottom: .45rem; }
article a { font-weight: 600; text-decoration: underline; text-decoration-color: hsl(200 69% 26% / .3); text-underline-offset: 3px; }
article a:hover { text-decoration-color: var(--accent); }
article blockquote {
  border-left: 3px solid var(--accent); background: var(--secondary);
  padding: 1rem 1.35rem; border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.5rem 0; color: var(--foreground); font-size: 1.05rem;
}
article table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .95rem; }
article th { background: var(--secondary); color: var(--primary); text-align: left; }
article th, article td { border: 1px solid var(--border); padding: .6rem .8rem; }
article strong { color: var(--foreground); }

/* CTA box inside articles */
.cta-box, article .cta {
  background: var(--gradient-hero); color: var(--primary-fg);
  border-radius: var(--radius); padding: 2rem; margin: 2.5rem 0 1rem;
  box-shadow: var(--shadow-hover);
}
.cta-box h2, .cta-box h3, article .cta h2, article .cta h3 { color: var(--primary-fg); margin-top: 0; padding-top: 0; }
.cta-box h2::before, article .cta h2::before { display: none; }
.cta-box p, article .cta p { color: hsl(0 0% 100% / .88); }
.cta-box a, article .cta a {
  display: inline-flex; background: var(--accent); color: var(--accent-fg);
  font-weight: 600; padding: .7rem 1.6rem; border-radius: calc(var(--radius) - 2px);
  text-decoration: none; transition: background .2s var(--ease-spring), transform .15s var(--ease-spring);
}
.cta-box a:hover, article .cta a:hover { background: hsl(16 100% 61% / .9); color: var(--accent-fg); transform: translateY(-1px); }

/* ── Footer (mirrors main site) ─────────────────────────── */
.site-footer { background: var(--primary); color: var(--primary-fg); padding: 3rem 0 2rem; margin-top: 2rem; }
.site-footer .inner { max-width: 1240px; margin: 0 auto; padding: 0 1.5rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 2rem; }
.site-footer h3 { font-size: 1.4rem; font-weight: 700; margin-bottom: 1rem; letter-spacing: .01em; }
.site-footer h4 { font-size: 1rem; font-weight: 600; margin-bottom: .9rem; }
.site-footer p { color: hsl(0 0% 100% / .8); font-size: .95rem; }
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: .5rem; }
.site-footer a { color: hsl(0 0% 100% / .8); font-size: .95rem; }
.site-footer a:hover { color: var(--primary-fg); }
.footer-bottom {
  border-top: 1px solid hsl(0 0% 100% / .2); padding-top: 1.75rem;
  text-align: center; color: hsl(0 0% 100% / .6); font-size: .9rem;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
