/* integrations.css — verbatim port of the prototype's _shared/integrations.css
   (the `.int-*` / `.icat-*` / `.igrid` / `.icard` vocabulary). Shared by
   /integrations and every /integrations/<slug> page. Pairs with
   global/product/cs stylesheets.

   Deviations from the prototype source (all mechanical, per the redesign port
   doctrine):
   - Icon selectors retargeted from the prototype's icon-span wrappers to bare
     `svg` — our port emits LucideIcon / unplugin-icons svg elements directly,
     not the prototype's runtime icon shim.
   - Explicit `line-height: 1.55` added to headings the prototype leaves at the
     inherited body value (our global type scale would otherwise leak a tighter
     line-height into `.icat-head h2` / `.icard h3` / `.int-toc h4` /
     `.int-sec-h h2`). */

/* ── Detail hero ─────────────────────────────────────────────────────────── */
.int-hero {
  padding: 44px 0 84px;
}
.int-crumb {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-subtle);
  margin-bottom: 44px;
}
.int-crumb a:hover {
  color: var(--ink);
}
.int-crumb .sep {
  color: var(--line-strong);
}
.int-crumb .cur {
  color: var(--ink);
}
.int-hero-row {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 28px;
  align-items: center;
}
.int-logo {
  width: 96px;
  height: 96px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 18px 40px -20px rgba(14, 16, 20, 0.22);
  flex: 0 0 auto;
}
.int-logo img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}
.int-kind {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 10px;
  color: var(--ink-muted);
}
.int-hero-main h1 {
  margin: 0 0 10px;
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: var(--ink);
}
.int-hero-main p {
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-muted);
  max-width: 60ch;
}
.int-chip {
  display: inline-flex;
  margin-top: 16px;
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper-soft);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
}
.int-hero-cta {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* Buttons stretch full-width in the stacked column — center their label/arrow. */
.int-hero-cta .btn {
  justify-content: center;
}
@media (max-width: 820px) {
  .int-hero-row {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .int-hero-cta {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

/* ── Catalog: search + filter chips ──────────────────────────────────────── */
.icat-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--ink-muted);
}
.icat-search {
  position: relative;
  max-width: 720px;
  margin: 34px auto 0;
}
.icat-search svg {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--ink-subtle);
}
.icat-search input {
  width: 100%;
  padding: 15px 20px 15px 48px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #fff;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(14, 16, 20, 0.04);
}
.icat-search input::placeholder {
  color: var(--ink-subtle);
}
.icat-search input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-color: transparent;
}
.icat-chips {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}
.icat-chips.k {
  margin-top: 12px;
}
.ichip {
  padding: 8px 16px;
  border-radius: var(--pill);
  border: 1px solid var(--line);
  background: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  transition:
    background 0.18s var(--ease),
    color 0.18s var(--ease),
    border-color 0.18s var(--ease);
}
.ichip:hover {
  border-color: var(--line-strong);
}
/* Selected filter = our secondary (ghost) button in its active state: subtle
   sunken fill + strong ink border + full-ink label — not a solid black pill. */
.ichip.is-active {
  background: var(--paper-sunken);
  color: var(--ink);
  border-color: var(--ink);
}
.ichip.is-active:hover {
  border-color: var(--ink);
}

/* ── Catalog: sections + cards ───────────────────────────────────────────── */
.icat-sec {
  padding: 8px 0 76px;
}
.icat-sec[hidden] {
  display: none;
}
.icat-head {
  margin-bottom: 30px;
}
.icat-head h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.55;
  color: var(--ink);
}
.icat-head .sub {
  margin: 8px 0 0;
  font-size: 15px;
  color: var(--ink-muted);
}
.igrid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
.icat-sec[data-pop] .igrid {
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.igrid.compact {
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
@media (max-width: 1100px) {
  .igrid {
    grid-template-columns: repeat(4, 1fr);
  }
  .icat-sec[data-pop] .igrid {
    grid-template-columns: repeat(3, 1fr);
  }
  .igrid.compact {
    grid-template-columns: repeat(4, 1fr);
  }
}

.icard {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  color: var(--ink);
  transition:
    transform 0.15s var(--ease),
    box-shadow 0.15s var(--ease),
    border-color 0.15s var(--ease);
}
.icard:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 16px 36px -20px rgba(14, 16, 20, 0.28);
}
.icard[hidden] {
  display: none;
}
.icard-logo {
  width: 48px;
  height: 48px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
}
.icard-logo img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}
.icard-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  padding: 4px 9px;
  border-radius: var(--pill);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
}
.icard-badge.src {
  background: var(--p-green-soft);
  color: var(--accent-deep);
}
.icard-badge.dst {
  background: #e7eef6;
  color: #33597c;
}
.icard h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.55;
  color: var(--ink);
}
.icard p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-muted);
  flex: 1;
}
.icard-arr {
  margin-top: 2px;
  color: var(--ink-subtle);
  transition:
    transform 0.15s var(--ease),
    color 0.15s var(--ease);
}
.icard-arr svg {
  width: 18px;
  height: 18px;
}
.icard:hover .icard-arr {
  color: var(--accent);
  transform: translateX(3px);
}
.icard.compact {
  padding: 18px;
  gap: 8px;
  border-radius: 14px;
}
.icard.compact .icard-logo {
  width: 40px;
  height: 40px;
  border-radius: 9px;
}
.icard.compact .icard-logo img {
  width: 26px;
  height: 26px;
}
.icard.compact h3 {
  font-size: 15px;
}
.icard.compact p {
  font-size: 12px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Phones hold 2 columns all the way down (matches production). The
   [data-pop] selector outranks a bare .igrid rule, so name it explicitly or
   the popular grid stays stuck at its desktop 3-4 column count. Cards lose
   their trailing arrow here (the whole tile is the tap target anyway), which
   buys back the vertical room the narrower text well costs. */
@media (max-width: 760px) {
  .igrid,
  .igrid.compact,
  .icat-sec[data-pop] .igrid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .icard {
    padding: 16px;
    gap: 8px;
    border-radius: 14px;
  }
  .icard-logo {
    width: 40px;
    height: 40px;
    border-radius: 9px;
  }
  .icard-logo img {
    width: 26px;
    height: 26px;
  }
  .icard-badge {
    top: 14px;
    right: 14px;
    padding: 3px 7px;
    font-size: 9px;
  }
  .icard h3 {
    font-size: 15px;
  }
  .icard p {
    font-size: 13px;
    line-height: 1.45;
    flex: none;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .icard-arr {
    display: none;
  }
  .icat-chips {
    gap: 6px;
    margin-top: 16px;
  }
  .ichip {
    padding: 6px 12px;
    font-size: 13px;
  }
  .icat-search {
    margin-top: 24px;
  }
  .icat-search input {
    padding: 12px 16px 12px 42px;
    font-size: 15px;
  }
}

.icat-empty {
  padding: 88px 0;
  text-align: center;
  color: var(--ink-muted);
  font-size: 15px;
}
.icat-empty[hidden] {
  display: none;
}

/* ── Detail body: TOC + sections (What you get / Documentation / Connections) ─ */
.int-body {
  padding: 8px 0 96px;
}
.int-grid2 {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 56px;
  align-items: start;
}
@media (max-width: 1000px) {
  .int-grid2 {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
.int-toc {
  position: sticky;
  top: 90px;
  align-self: start;
}
@media (max-width: 1000px) {
  .int-toc {
    display: none;
  }
}
.int-toc h4 {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.55;
  text-transform: uppercase;
  color: var(--ink-subtle);
}
.int-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}
.int-toc a {
  display: block;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink-muted);
  transition:
    background 0.15s var(--ease),
    color 0.15s var(--ease);
}
.int-toc a:hover {
  background: var(--paper-cool);
  color: var(--ink);
}
.int-toc a.is-active {
  background: var(--p-green-soft);
  color: var(--accent-deep);
}

.int-sec + .int-sec {
  margin-top: 56px;
}
.int-sec-h {
  margin-bottom: 24px;
}
.int-sec-h h2 {
  margin: 0;
  font-size: clamp(24px, 2.6vw, 30px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.55;
  color: var(--ink);
}
.int-sec-h p {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-muted);
}

/* Feature + doc cards (shared shape) */
.int-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 680px) {
  .int-cards {
    grid-template-columns: 1fr;
  }
}
.int-fcard {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  align-items: start;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
}
a.int-fcard {
  transition:
    transform 0.15s var(--ease),
    box-shadow 0.15s var(--ease),
    border-color 0.15s var(--ease);
}
a.int-fcard:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 14px 30px -18px rgba(14, 16, 20, 0.22);
}
.int-fcard-ico {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--p-green-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
}
.int-fcard-ico svg {
  width: 18px;
  height: 18px;
}
.int-fcard h3 {
  margin: 2px 0 4px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.3;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
}
.int-fcard h3 svg {
  width: 14px;
  height: 14px;
  color: var(--ink-subtle);
}
a.int-fcard:hover h3 svg {
  color: var(--accent);
}
.int-fcard p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-muted);
}

/* Connection cards */
.int-conn-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 900px) {
  .int-conn-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 560px) {
  .int-conn-grid {
    grid-template-columns: 1fr;
  }
}
.int-conn {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  transition:
    transform 0.15s var(--ease),
    box-shadow 0.15s var(--ease),
    border-color 0.15s var(--ease);
}
/* Explicit `display: flex` above beats the UA `[hidden] { display: none }`,
   so the search's `card.hidden = true` needs this guard to actually hide a
   filtered-out card (mirrors `.icard[hidden]` for the integrations catalog). */
.int-conn[hidden] {
  display: none;
}
.int-conn:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 14px 30px -18px rgba(14, 16, 20, 0.22);
}
.int-conn-logos {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}
.int-conn-logos .t {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
}
.int-conn-logos .t img {
  width: 19px;
  height: 19px;
  object-fit: contain;
}
.int-conn-logos .plus {
  color: var(--ink-subtle);
  font-size: 12px;
}
.int-conn-name {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink);
}

/* ── Connection detail pages ─────────────────────────────────────────────── */
.int-hero-row.conn-row {
  grid-template-columns: auto 1fr auto;
}
.conn-logos {
  display: flex;
  align-items: center;
  gap: 12px;
}
.conn-logos .plus {
  font-size: 22px;
  font-weight: 500;
  color: var(--ink-subtle);
}
@media (max-width: 820px) {
  .int-hero-row.conn-row {
    grid-template-columns: 1fr;
  }
}
.conn-used {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 680px) {
  .conn-used {
    grid-template-columns: 1fr;
  }
}
.conn-used-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  transition:
    transform 0.15s var(--ease),
    box-shadow 0.15s var(--ease),
    border-color 0.15s var(--ease);
}
.conn-used-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 14px 30px -18px rgba(14, 16, 20, 0.22);
}
.conn-used-card .t {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
}
.conn-used-card .t img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}
.conn-used-card .kind {
  position: absolute;
  top: 18px;
  right: 18px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper-soft);
  color: var(--ink-muted);
}
.conn-used-card h3 {
  margin: 4px 0 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.3;
  color: var(--ink);
}
.conn-used-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-muted);
  flex: 1;
}
.conn-used-card .go {
  color: var(--ink-subtle);
  transition:
    color 0.15s var(--ease),
    transform 0.15s var(--ease);
}
.conn-used-card:hover .go {
  color: var(--accent);
  transform: translateX(2px);
}
.conn-used-card .go svg {
  width: 16px;
  height: 16px;
}
.int-cards.one {
  grid-template-columns: 1fr;
}

/* ── Mobile compaction: connections index + connection detail ─────────────
   Appended at the end deliberately — these override base rules of equal
   specificity, and an earlier @media block loses the cascade tie. */
@media (max-width: 700px) {
  .int-conn-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .int-conn {
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
    padding: 12px;
    border-radius: 10px;
    min-width: 0;
  }
  .int-conn-logos {
    gap: 4px;
  }
  .int-conn-logos .t {
    width: 26px;
    height: 26px;
    border-radius: 7px;
  }
  .int-conn-logos .t img {
    width: 16px;
    height: 16px;
  }
  .int-conn-name {
    font-size: 12.5px;
    min-width: 0;
  }

  .int-hero {
    padding: 24px 0 40px;
  }
  .int-crumb {
    margin-bottom: 20px;
    font-size: 13px;
    gap: 6px;
  }
  .int-hero-row {
    gap: 16px;
  }
  .int-hero-main p {
    font-size: 15px;
  }
  .conn-logos .int-logo {
    width: 56px;
    height: 56px;
  }
  .conn-logos .int-logo img {
    width: 34px;
    height: 34px;
  }

  .int-body {
    padding: 4px 0 56px;
  }
  .int-sec + .int-sec {
    margin-top: 36px;
  }
  .int-sec-h {
    margin-bottom: 16px;
  }
  .int-sec-h p {
    font-size: 14px;
  }
  .int-cards {
    gap: 10px;
  }
  .int-fcard {
    grid-template-columns: 30px 1fr;
    gap: 12px;
    padding: 15px;
    border-radius: 12px;
  }
  .int-fcard-ico {
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }
  .int-fcard-ico svg {
    width: 15px;
    height: 15px;
  }
  .int-fcard h3 {
    margin: 1px 0 3px;
    font-size: 14px;
  }
  .int-fcard p {
    font-size: 13px;
    line-height: 1.45;
  }

  .conn-used {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .conn-used-card {
    gap: 8px;
    padding: 14px;
    border-radius: 12px;
  }
  .conn-used-card .t {
    width: 36px;
    height: 36px;
    border-radius: 9px;
  }
  .conn-used-card .t img {
    width: 22px;
    height: 22px;
  }
  .conn-used-card .kind {
    position: static;
    align-self: flex-start;
    font-size: 9px;
    padding: 3px 7px;
  }
  .conn-used-card h3 {
    margin: 0;
    font-size: 14px;
  }
  .conn-used-card p,
  .conn-used-card .go {
    display: none;
  }
}
