/* Integrations page (ACF / resource-post build). Everything is scoped to .int-page and prefixed int-.
   Self-contained: carries its own fonts (assets/resources-hub/fonts/) and needs no hub.css / resource-card.css. */

  /* Fonts: Eptura Flexible (Regular, Medium, Bold) and a Font Awesome Pro subset for the arrows, search, chevron and clear icons. Licensed: keep out of public repos. */
  @font-face { font-family: "Eptura Flexible"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/EpturaFlexible-Regular.woff") format("woff"); }
  @font-face { font-family: "Eptura Flexible"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/EpturaFlexible-Medium.woff") format("woff"); }
  @font-face { font-family: "Eptura Flexible"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/EpturaFlexible-Bold.woff") format("woff"); }
  @font-face { font-family: "INT-FA-Light"; font-weight: 300; font-display: swap; src: url("fonts/fa-light.woff2") format("woff2"); }
  @font-face { font-family: "INT-FA-Solid"; font-weight: 900; font-display: swap; src: url("fonts/fa-solid.woff2") format("woff2"); }
  @font-face { font-family: "INT-FA-Regular"; font-weight: 400; font-display: swap; src: url("fonts/fa-regular.woff2") format("woff2"); }
  .int-glyph { font-family: "INT-FA-Solid", "Font Awesome 7 Pro"; font-weight: 900; line-height: 1; }

  .int-page {
    --ink: #0d122e;
    --ink-2: #0c1230;
    --body: rgba(34, 43, 59, 0.8);
    --blue: #1b4bc5;
    --blue-muted: rgba(27, 75, 197, 0.46);
    --gutter: 200px;
    --content: 1328px;
    --card-w: 305px;
    --card-gap-x: 36px;
    --card-gap-y: 86px;
    --font: 'Eptura Flexible', var(--bodyfont, 'Flexible'), 'Flexible', system-ui, sans-serif; /* Eptura Flexible from fonts/, then the theme's own */
  }
  .int-page, .int-page *, .int-page *::before, .int-page *::after { box-sizing: border-box; }
  .int-page { background: #fff; color: var(--ink); font-family: var(--font); font-weight: 400; -webkit-font-smoothing: antialiased; }
  .int-page :where(img) { display: block; }
  .int-page :where(a) { color: inherit; }
  .int-fa { font-family: "INT-FA-Light", "Font Awesome 7 Pro", "Font Awesome 6 Pro"; font-weight: 300; font-style: normal; line-height: 1; }
  .int-wrap { width: 100%; max-width: calc(var(--content) + 2 * var(--gutter)); margin: 0 auto; padding-inline: var(--gutter); }
  .int-trim { text-box: trim-both cap alphabetic; }

  /* Theme compatibility RESET. Must sit BEFORE the component rules: it has the same specificity as a single .int- class,
     so if it came after them it would wipe their margins / padding / letter-spacing (e.g. the category headings lost
     their side padding and sat at the left edge of the page). */
  .int-page :where(h1, h2, h3, p, ul, li) { margin: 0; padding: 0; font-family: var(--font); letter-spacing: normal; }
  .int-page :where(h1, h2, h3) { color: var(--ink); text-transform: none; }
  .int-page :where(p) { margin: 0; }
  .int-page :where(a) { text-decoration: none; }

  /* Never let the page scroll sideways: clip anything that pokes out of the Integrations page */
  /* position: relative makes .int-page the containing block for the visually-hidden .int-sr spans, so the clip catches them too
     (an absolutely positioned child of an off-screen carousel card otherwise widens the page at laptop widths) */
  .int-page { position: relative; overflow-x: clip; }

  /* Page header */
  .int-page-header { padding: 70px 0 50px; text-align: center; }
  .int-page-header .int-wrap { max-width: 1726px; padding-inline: 309px; display: flex; flex-direction: column; gap: 36px; }
  .int-page-header h1 { margin: 0; font-size: 70px; font-weight: 500; line-height: 86px; color: var(--ink); }
  .int-page-header p { margin: 0; font-size: 24px; line-height: 32px; color: var(--ink-2); }

  /* Featured partners */
  .int-featured { padding: 70px 0; overflow: hidden; }
  .int-featured .int-wrap { display: flex; flex-direction: column; gap: 36px; }
  .int-section-head { display: flex; align-items: center; justify-content: space-between; height: 52px; }
  .int-section-head h2 { margin: 0; font-size: 46px; font-weight: 500; line-height: 76px; letter-spacing: 0.46px; }
  .int-carousel-controls { display: flex; gap: 16px; align-items: center; }
  .int-carousel-controls button { all: unset; font-family: "INT-FA-Light", "Font Awesome 7 Pro"; font-weight: 300; line-height: 20px; cursor: pointer; width: 40px; height: 50px; display: grid; place-items: center; font-size: 40px; color: var(--blue); }
  .int-carousel-controls button:disabled { color: var(--blue-muted); cursor: default; }
  .int-carousel-controls button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 50%; }
  .int-featured-track { display: flex; gap: 36px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none;
    margin-right: calc(-1 * (100vw - min(100vw, var(--content) + 2 * var(--gutter))) / 2 - var(--gutter)); padding-right: var(--gutter); }
  .int-featured-track::-webkit-scrollbar { display: none; }
  .int-featured-card { flex: 0 0 419px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 24px; }
  .int-featured-card .int-logo-area { height: 250px; }

  /* Shared card */
  .int-logo-area { height: 200px; padding: 10px; display: flex; align-items: center; justify-content: center; }
  .int-logo { position: relative; flex-shrink: 0; }
  .int-logo .int-lp { position: absolute; inset: 0; display: block; }
  .int-logo > img, .int-logo .int-lp > img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
  .int-card-text { display: flex; flex-direction: column; gap: 16px; }
  .int-card-name { margin: 0; font-size: 20px; font-weight: 500; line-height: normal; color: #000; }
  .int-card-desc { margin: 0; font-size: 16px; line-height: 22px; color: var(--body); }
  .int-card-link { font-size: 14px; line-height: 22px; color: var(--body); text-decoration: underline; text-decoration-skip-ink: none; text-underline-position: from-font; }
  .int-featured-card .int-card-link { font-size: 16px; }
  .int-card-link:hover { color: var(--blue); }
  /* App badges: 4 per row in 70px slots (4×70 + 3×8 = 304px of the 305px card), extra badges wrap to row 2 */
  .int-apps { display: grid; grid-template-columns: repeat(4, 70px); column-gap: 8px; row-gap: 18px; }
  .int-apps-label { margin: 0 0 8px; font-size: 12px; line-height: 22px; color: rgba(34, 43, 59, 0.6); }
  .int-app { width: 70px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; }
  .int-app img { flex-shrink: 0; }
  .int-app span { font-size: 9px; line-height: 11px; font-weight: 500; color: #000; text-align: center; white-space: nowrap; }

  /* Filters */
  .int-filters { background: #fcfcfc; padding: 36px 0; }
  .int-filters-inner { width: 646px; max-width: calc(100% - 32px); margin: 0 auto; padding: 24px 0 12px; }
  .int-search-row { padding: 36px 0; }
  .int-search { display: flex; align-items: center; gap: 12px; height: 44px; border-bottom: 1px solid #4a4a4a; font-size: 24px; }
  .int-search .int-fa { color: var(--ink-2); font-size: 24px; }
  .int-search input { all: unset; flex: 1; font-family: var(--font); font-size: 24px; color: var(--ink-2); }
  .int-search input::placeholder { color: rgba(12, 18, 48, 0.4); }
  .int-search input::-webkit-search-cancel-button { display: none; }
  .int-search-clear { all: unset; cursor: pointer; font-family: "INT-FA-Solid"; font-weight: 900; font-size: 13px; line-height: 20px; color: #6d7183; padding: 4px; }
  .int-search-clear[hidden] { display: none; }
  .int-search-clear:focus-visible { outline: 2px solid var(--blue); border-radius: 50%; }

  /* Inline search results panel (Resources "Search panel") */
  .int-search-row { position: relative; }
  .int-search-panel { position: absolute; z-index: 20; top: calc(100% - 28px); left: 50%; transform: translateX(-50%); width: 1110px; max-width: calc(100vw - 32px);
    background: #fff; border-radius: 12px; box-shadow: 0 24px 20px rgba(13, 18, 46, 0.08), 0 0 0 1px rgba(13, 18, 46, 0.06); overflow: hidden; }
  .int-search-panel[hidden] { display: none; }
  .int-results { list-style: none; margin: 0; padding: 24px; display: flex; flex-direction: column; gap: 36px; }
  .int-result { display: flex; align-items: center; gap: 16px; height: 90px; padding-right: 16px; border-radius: 12px; cursor: pointer; }
  .int-result[aria-selected="true"], .int-result:hover { background: #f4f6fb; }
  .int-result-thumb { position: relative; flex-shrink: 0; width: 133px; height: 90px; border-radius: 12px; overflow: hidden; }
  .int-result-thumb > .int-logo-area { position: absolute; left: 0; top: 1.4px; width: 305px; height: 200px; transform: scale(0.4361); transform-origin: 0 0; }
  .int-result-body { flex: 1 0 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
  .int-result-chips { display: flex; align-items: center; gap: 16px; overflow: hidden; }
  .int-result-meta { display: flex; gap: 3px; }
  .int-chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 4px; font-size: 12px; line-height: 16px; white-space: nowrap; color: #141922; background: #eeeff4; }
  /* App chips: 18% tint of each app's icon colour */
  .int-chip-app { background: color-mix(in srgb, var(--app) 18%, #fff); }
  .int-chip-app[data-app="Visitor"]   { --app: #9b45b6; }
  .int-chip-app[data-app="Workplace"] { --app: #e27b00; }
  .int-chip-app[data-app="Serraview"] { --app: #4db06d; }
  .int-chip-app[data-app="Engage"]    { --app: #00a499; }
  .int-chip-app[data-app="Asset"]     { --app: #376fdd; }
  .int-chip-app[data-app="Archibus"]  { --app: #f83a59; }
  .int-result-title { margin: 0; font-size: 20px; font-weight: 500; line-height: 29px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .int-result-title mark { background: none; color: var(--blue); }
  .int-search-empty { margin: 0; padding: 24px; font-size: 18px; line-height: 26px; color: #6d7183; }
  .int-search-footer { display: flex; justify-content: flex-end; padding: 12px; border-top: 1px solid #ced1d7; }
  .int-search-footer[hidden] { display: none; }
  .int-btn-sm { height: 44px; padding: 6px 20px; border: 0; border-radius: 8px; background: var(--blue); color: #fff; font-family: var(--font); font-size: 16px; font-weight: 500; line-height: 21px; cursor: pointer; }
  .int-btn-sm:hover { background: #163da3; }
  .int-card.int-is-target { outline: 2px solid var(--blue); outline-offset: 8px; border-radius: 2px; transition: outline-color 1.2s ease 1.5s; }
  .int-card.int-is-target.int-fade { outline-color: transparent; }
  @media (max-width: 720px) { .int-result-meta { display: none; } .int-results { padding: 12px; gap: 12px; } }
  .int-dropdown-row { display: flex; gap: 24px; padding: 36px 0; }
  .int-dropdown { flex: 1 0 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
  .int-dropdown label { font-size: 14px; line-height: 12px; color: rgba(12, 18, 48, 0.8); }
  .int-select { position: relative; }
  .int-select select { appearance: none; width: 100%; background: #fff; border: 0.5px solid #9a9a9a; border-radius: 6px; padding: 0 36px 0 16px; font-family: var(--font); font-size: 16px; line-height: 22px; height: 46px; color: var(--ink-2); cursor: pointer; }
  .int-select select:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
  .int-select::after { content: "\f078"; font-family: "INT-FA-Regular", "Font Awesome 6 Pro"; font-weight: 400; font-size: 12px; color: var(--ink-2); position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; }

  /* Categories */
  .int-category-title { margin: 0; padding: 50px var(--gutter) 0; max-width: calc(var(--content) + 2 * var(--gutter)); margin-inline: auto; height: calc(52px + 50px); display: flex; align-items: center; box-sizing: border-box;
    font-size: 28px; font-weight: 500; line-height: 76px; letter-spacing: 0.28px; color: var(--ink); }
  .int-group-title { margin: 0 auto; padding: 36px var(--gutter) 0; max-width: calc(var(--content) + 2 * var(--gutter)); font-size: 20px; font-weight: 500; }
  .int-card-grid { max-width: calc(var(--content) + 2 * var(--gutter)); margin: 0 auto; padding: 36px var(--gutter) 50px;
    display: grid; grid-template-columns: repeat(auto-fill, var(--card-w)); column-gap: var(--card-gap-x); row-gap: var(--card-gap-y); align-items: start; }
  .int-card { display: flex; flex-direction: column; width: var(--card-w); }
  .int-card > .int-logo-area { margin-bottom: 24px; }
  /* App badges sit 36px below each card's description/links */
  .int-card > .int-card-apps:not(:empty) { margin-top: 36px; }
  .int-card[hidden], .int-category[hidden] { display: none; }
  .int-no-results { text-align: center; padding: 80px 16px; font-size: 20px; color: var(--body); }

  /* Join us */
  .int-join { background: #fafafa; padding: 50px 16px 100px; text-align: center; }
  .int-join h2 { margin: 0 0 24px; font-size: 36px; font-weight: 500; line-height: 47px; color: #000; }
  .int-join p { margin: 0 auto 36px; max-width: 801px; font-size: 19px; line-height: 27px; color: var(--ink-2); }
  .int-btn { display: inline-flex; align-items: center; justify-content: center; padding: 16px 24px; border-radius: 8px; background: var(--blue); color: #fff; font-size: 17px; font-weight: 500; line-height: 20px; text-decoration: none; }
  .int-btn:hover { background: #163da3; }

  /* Notes */
  .int-notes { background: #0c1230; padding: 24px 200px 36px 541px; font-size: 12px; line-height: 12px; }
  .int-notes h2 { margin: 0 0 12px; font-size: 12px; font-weight: 500; color: #fff; }
  .int-notes-content { display: flex; gap: 70px; }
  .int-notes-col { display: flex; flex-direction: column; gap: 12px; }
  .int-notes-col > p { margin: 0; color: rgba(255,255,255,0.6); white-space: nowrap; }
  .int-notes-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; color: rgba(255,255,255,0.9); }
  .int-notes-col li span { color: rgba(255,255,255,0.6); }

  /* Responsive */
  @media (max-width: 1700px) { .int-notes { padding-inline: 64px; } .int-notes-content { flex-wrap: wrap; } }
  @media (max-width: 1400px) { .int-page { --gutter: 64px; } .int-page-header .int-wrap { padding-inline: 64px; } .int-notes { padding-inline: 64px; } }
  @media (max-width: 720px) {
    .int-page { --gutter: 16px; --card-w: 100%; }
    .int-page-header h1 { font-size: 44px; line-height: 52px; }
    .int-page-header p { font-size: 18px; line-height: 26px; }
    .int-page-header .int-wrap { padding-inline: 16px; }
    .int-section-head h2 { font-size: 32px; }
    .int-featured-card { flex-basis: 80vw; }
    .int-card-grid { grid-template-columns: 1fr; }
    .int-card { width: 100%; }
    .int-dropdown-row { flex-direction: column; }
    .int-notes { padding: 24px 16px 36px; }
    .int-notes-content { flex-direction: column; gap: 24px; }
    .int-notes-col > p { white-space: normal; }
  }

  /* Theme compatibility (the theme's style.css sets bare p/h1-h3/a/input rules; keep ours on top) */
  .int-page a.int-card-link { text-decoration: underline; }
  .int-page .int-btn, .int-page .int-btn:hover { text-decoration: none; color: #fff; }
  .int-page .int-search input[type="search"]:not(#a):not(#b):not(#c):not(#d):not(#e):not(#f) { border: 0; padding: 0; margin: 0; box-shadow: none; background: none; height: auto; border-radius: 0; }
  .int-page .int-select select { height: 46px; border: 0.5px solid #9a9a9a; border-radius: 6px; padding: 0 36px 0 16px; line-height: 22px; }
  .int-page .int-search-clear, .int-page .int-carousel-controls button { border: 0; background: none; }
  .int-page .int-search-clear[hidden] { display: none; }
  .int-page [hidden] { display: none !important; }
  @media (prefers-reduced-motion: reduce) { .int-page * { scroll-behavior: auto !important; transition: none !important; } }
  .int-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .int-page .int-glyph { font-family: "INT-FA-Solid", "Font Awesome 7 Pro"; font-weight: 900; line-height: 1; }

  /* ===== ACF build additions ===== */

  /* Logo from the ACF image field: SVGs are drawn at design size, so show them at their natural size, centred on the tile */
  .int-logo-area > img, .int-logo-area > .int-logo-img { display: block; flex-shrink: 0; width: auto; height: auto; max-width: 100%; max-height: 100%; }
  .int-logo-area > img.attachment-large, .int-logo-area > img.attachment-medium { width: 100%; height: 100%; object-fit: contain; }
  .int-initials { font-size: 41px; font-weight: 700; color: rgba(255, 255, 255, 0.7); letter-spacing: 1px; }
  /* Card title as a link (config 'link_cards') */
  .int-card-name a, .int-featured-card .int-card-name a { color: inherit; text-decoration: none; }
  .int-card-name a:hover { color: var(--blue); }

  /* Single integration page (resource-integration.php) */
  .int-single-page { background: #fff; color: var(--ink); font-family: var(--font); }
  .int-single { padding: 70px 0 50px; }
  .int-single-back { display: inline-block; margin-bottom: 36px; font-size: 16px; line-height: 22px; color: var(--blue); text-decoration: none; }
  .int-page a.int-single-back:hover { text-decoration: underline; }
  .int-single-head { display: flex; gap: 48px; align-items: flex-start; }
  .int-single-logo { width: var(--card-w); height: 200px; flex: none; }
  .int-single-text { flex: 1; min-width: 0; align-items: flex-start; }
  .int-single-title { font-size: 56px; line-height: 64px; font-weight: 500; color: var(--ink); }
  body .int-page h1.int-single-title { font-size: 56px; line-height: 64px; letter-spacing: 0; }
  .int-single-summary { max-width: 760px; font-size: 22px; line-height: 32px; color: var(--ink-2); }
  .int-single-actions { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; margin-top: 8px; }
  .int-related { padding-bottom: 50px; }
  .int-related-head { max-width: calc(var(--content) + 2 * var(--gutter)); margin: 0 auto; padding-inline: var(--gutter); height: auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
  .int-related-head .int-category-title { padding: 0; margin: 0; height: auto; }
  @media (max-width: 720px) {
    .int-single { padding: 36px 0 24px; }
    .int-single-head { flex-direction: column; gap: 24px; }
    .int-single-logo { width: 100%; }
    .int-single-title, body .int-page h1.int-single-title { font-size: 32px; line-height: 40px; }
    .int-single-summary { font-size: 17px; line-height: 26px; }
    .int-related-head { padding-inline: 16px; }
  }
