/* ============================================================
   ReversePilot — /integrations ("Directory" direction, 2026-09)
   Loaded only by templates/marketing/integrations.html via extra_head.
   Tokens come from styles.css :root. Class prefix: .ig-
   The dark hero, orange kicker (.crumbs), .card, .checklist, .eyebrow
   and .cta-band come from the site-wide theme in styles.css.
   ============================================================ */

/* ---------- Hero tools: search + status filter ---------- */
.ig-hero .lede { max-width: 56ch; }
.ig-tools {
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px;
  margin: 36px 0 0;
}
.ig-search {
  display: flex; align-items: center; gap: 10px;
  flex: 0 1 480px; min-width: 240px; height: 52px; padding: 0 18px;
  background: #fff; border-radius: var(--radius); color: var(--muted-2);
  box-shadow: var(--shadow-sm);
}
.ig-search svg { width: 18px; height: 18px; flex: 0 0 auto; }
.ig-search input {
  flex: 1 1 auto; min-width: 0; height: 100%;
  border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 1rem; color: var(--ink);
}
.ig-search input::placeholder { color: var(--muted-2); }
.ig-search:focus-within { box-shadow: 0 0 0 3px rgba(231, 135, 36, 0.45); }
.ig-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.ig-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.ig-chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 14px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.22);
  background: transparent; color: #cfe1ec;
  font-family: var(--font-display); font-weight: 600; font-size: 0.88rem;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.ig-chip b { font-weight: 700; opacity: 0.7; }
.ig-chip:hover { border-color: rgba(255, 255, 255, 0.5); color: #fff; }
.ig-chip.is-on { background: #fff; border-color: #fff; color: var(--navy); }
.ig-chip.is-on b { opacity: 0.6; }
.ig-chip:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

/* ---------- Layout: sticky category rail + groups ---------- */
.ig-catalog { padding: 72px 0 96px; }
.ig-layout {
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 64px; align-items: start;
}
.ig-rail {
  position: sticky; top: calc(var(--site-header-height) + 24px);
  display: flex; flex-direction: column; gap: 2px;
}
.ig-rail-label {
  font-family: var(--font-display); font-weight: 700; font-size: 0.74rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2);
  padding: 0 12px 10px;
}
.ig-rail a {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius);
  font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; color: var(--ink-2);
  transition: background-color .15s ease, color .15s ease;
}
.ig-rail a:hover { background: var(--navy-25); color: var(--navy); }
.ig-rail a.is-on { background: var(--navy-50); color: var(--navy); box-shadow: inset 3px 0 0 var(--orange); }
.ig-rail a span { font-size: 0.78rem; font-weight: 700; color: var(--muted-2); }
.ig-rail-rule { height: 1px; background: var(--line); margin: 10px 12px; }

.ig-groups { display: flex; flex-direction: column; gap: 64px; }
.ig-group { display: flex; flex-direction: column; gap: 22px; }
.ig-group-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
.ig-group-head > div { display: flex; flex-direction: column; gap: 6px; max-width: 60ch; }
.ig-group-head h2 { font-size: 1.75rem; letter-spacing: -0.02em; margin: 0; }
.ig-group-head p { margin: 0; color: var(--muted); font-size: 0.98rem; }
.ig-group-count {
  font-family: var(--font-display); font-weight: 600; font-size: 0.82rem;
  color: var(--muted-2); white-space: nowrap;
}

/* ---------- Capability tiles ---------- */
.ig-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ig-tile {
  display: flex; flex-direction: column; gap: 12px;
  min-height: 168px; padding: 20px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.ig-tile:hover { border-color: var(--navy); box-shadow: var(--shadow); transform: translateY(-2px); }
.ig-tile--soon { background: #f8fafc; border-style: dashed; }
.ig-tile-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ig-icon {
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--navy-25); border: 1px solid var(--line); color: var(--navy);
}
.ig-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ig-tile--soon .ig-icon { color: var(--muted-2); background: #f6f8fa; }
.ig-status {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-display); font-weight: 700; font-size: 0.74rem; letter-spacing: 0.02em;
  white-space: nowrap;
}
.ig-status::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 0 3px rgba(31, 122, 77, 0.16);
}
.ig-status--live { color: var(--green); }
.ig-status--soon { color: #2f86d4; }
.ig-status--soon::before { background: #4a9fe0; box-shadow: 0 0 0 3px rgba(74, 159, 224, 0.18); }
.ig-tile-name { font-size: 1.02rem; line-height: 1.25; letter-spacing: -0.01em; margin: 0; }
.ig-tile-desc { margin: 0; font-size: 0.9rem; line-height: 1.45; color: var(--muted); flex: 1; }
.ig-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* class display rules would otherwise beat the UA [hidden] rule (search/filter/empty state) */
.ig-group[hidden], .ig-tile[hidden], .ig-empty[hidden], .ig-rail a[hidden] { display: none; }

.ig-empty {
  margin: 0; padding: 32px 0; text-align: center; color: var(--muted);
}
.ig-empty-reset {
  border: 0; padding: 0; background: none;
  font: inherit; font-weight: 600; color: var(--navy); text-decoration: underline; cursor: pointer;
}

/* ---------- Beyond the catalog + partner program ---------- */
.ig-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.ig-card { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding: 40px; }
.ig-card .eyebrow { margin-bottom: 0; }
.ig-card h2 { font-size: 1.85rem; margin: 0; }
.ig-card p { margin: 0; color: var(--muted); }
.ig-card .checklist { margin: 4px 0 8px; }

/* ---------- Closing band ---------- */
.ig-cta { display: grid; grid-template-columns: 1.4fr 1fr; gap: 64px; align-items: center; }
.ig-cta h2 { font-size: clamp(2rem, 3.6vw, 3.25rem); margin: 0 0 18px; }
.ig-cta p { font-size: 1.2rem; max-width: 50ch; margin: 0; }
.ig-cta .actions { display: flex; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .ig-layout { grid-template-columns: 200px minmax(0, 1fr); gap: 40px; }
  .ig-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
  .ig-layout { grid-template-columns: 1fr; gap: 32px; }
  .ig-rail {
    position: static; flex-direction: row; flex-wrap: nowrap; gap: 6px;
    overflow-x: auto; padding-bottom: 6px; scrollbar-width: none;
  }
  .ig-rail::-webkit-scrollbar { display: none; }
  .ig-rail-label, .ig-rail-rule { display: none; }
  .ig-rail a { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; }
  .ig-rail a.is-on { box-shadow: none; border-color: var(--navy); }
  .ig-cards { grid-template-columns: minmax(0, 1fr); }
  .ig-card .btn { max-width: 100%; white-space: normal; }
  .ig-cta { grid-template-columns: 1fr; gap: 28px; }
  .ig-cta .actions { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .ig-catalog { padding: 48px 0 72px; }
  .ig-tiles { grid-template-columns: 1fr; }
  .ig-search { flex-basis: 100%; }
  .ig-group-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .ig-card { padding: 28px; }
  .ig-cta .actions { flex-direction: column; align-items: stretch; }
  .ig-cta .actions .btn { width: 100%; justify-content: center; }
}

/* ---------- Tile links + detail pages (WIN-1596) ---------- */
.ig-filters { align-items: center; }
.ig-filters-label {
  font-family: var(--font-display); font-weight: 700; font-size: 0.74rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: #9fbccd;
}
.ig-tile { position: relative; }
.ig-tile-link { color: inherit; }
.ig-tile-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-lg); }
.ig-tile-link:hover { color: var(--navy); }
.ig-tile-link:focus-visible { outline: none; }
.ig-tile:focus-within { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(231, 135, 36, 0.45); }

.ig-detail-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; }
.ig-detail-category {
  font-family: var(--font-display); font-weight: 600; font-size: 0.9rem; color: #cfe1ec;
}
.ig-detail-hero .ig-status--live { color: #6fd39f; }
.ig-detail-hero .ig-status--soon { color: #8cc4f0; }
.ig-detail-hero h1 { max-width: 22ch; }
.ig-detail-hero .lede { max-width: 62ch; }
.ig-detail { padding: 72px 0 88px; }
.ig-detail-layout {
  display: grid; grid-template-columns: minmax(0, 68ch) 300px; gap: 64px;
  align-items: start; justify-content: space-between;
}
.ig-detail-body { grid-column: 1; grid-row: 1; }
.ig-detail-body h2 { font-size: 1.6rem; letter-spacing: -0.02em; margin: 0 0 12px; }
.ig-detail-body p { margin: 0 0 40px; font-size: 1.08rem; color: var(--ink-2); }
.ig-detail-panel {
  grid-column: 2; grid-row: 1;
  position: sticky; top: calc(var(--site-header-height) + 24px);
  display: flex; flex-direction: column; gap: 22px;
  padding: 24px; background: var(--navy-25);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.ig-detail-panel h2 {
  font-family: var(--font-display); font-weight: 700; font-size: 0.74rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); margin: 0 0 6px;
}
.ig-detail-panel p { margin: 0; color: var(--ink-2); font-weight: 600; }
.ig-related { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ig-related a {
  display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 20px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ig-related a:hover, .ig-related a:focus-visible { border-color: var(--navy); box-shadow: var(--shadow); }
.ig-related-name { font-family: var(--font-display); font-weight: 700; color: var(--ink); }
.ig-related-meta { font-size: 0.86rem; color: var(--muted); }

@media (max-width: 920px) {
  .ig-detail-layout { grid-template-columns: 1fr; gap: 32px; }
  .ig-detail-panel, .ig-detail-body { grid-column: 1; grid-row: auto; }
  .ig-detail-panel { position: static; }
}
@media (max-width: 640px) {
  .ig-detail { padding: 48px 0 64px; }
  .ig-related { grid-template-columns: 1fr; }
}
