/* The app directory's own styles (pages/integrations.mjs): /integrations and its category views,
   the 1,000 app pages and the request page. On top of site.css; its tokens and components. Lean on
   purpose: the directory carries 1,000 cards, so a card is a bare <li> styled from here (no wrapper,
   no classes inside), and its logo tile is the <img> itself. */

/* ------------------------------------------------------------------- Hero */
.ix-hero { padding-bottom: clamp(1.5rem, 1rem + 1.5vw, 2.25rem); }
.ix-hero .hero-copy { max-width: 50rem; }
.ix-hero .hero-lead { max-width: 46rem; }

/* -------------------------------------------------------------- App cards */
.app-cards { display: grid; gap: 0.875rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16.5rem), 1fr)); }
.app-cards > li {
	position: relative;
	display: grid;
	grid-template-columns: 2.75rem minmax(0, 1fr);
	grid-template-rows: auto auto 1fr;
	column-gap: 0.875rem;
	align-content: start;
	padding: 1.125rem 1.125rem 1.25rem;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-sm);
	transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}
.app-cards > li:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.app-cards > li:has(> a:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
/* The logo's tile is the image: white, ringed, the mark inside the padding. */
.app-cards > li > img {
	grid-row: 1 / span 2;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0.4375rem;
	border-radius: 0.75rem;
	background: #FFFFFF;
	box-shadow: 0 0 0 1px var(--line), var(--shadow-sm);
	object-fit: contain;
}
.app-cards > li > a {
	grid-column: 2;
	align-self: end;
	font-family: var(--font-display);
	font-size: 1.0625rem;
	font-weight: 600;
	line-height: 1.3;
	color: var(--ink);
	text-decoration: none;
	overflow-wrap: break-word;
}
.app-cards > li > a::after { content: ''; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.app-cards > li > a:focus-visible { outline: none; }
.app-cards > li > span { grid-column: 2; font-size: 0.8125rem; line-height: 1.45; color: var(--muted); }
.app-cards > li > p {
	grid-column: 1 / -1;
	margin-top: 0.75rem;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 0.9rem;
	line-height: 1.5;
	color: var(--text);
}
.app-cards > li:hover > a { color: var(--orange-ink); }

/* -------------------------------------------------------------- Directory */
.dir-search.directory-bar { grid-template-columns: minmax(0, 1fr); margin-bottom: 1.25rem; }
.dir-search .search-field .form-input { min-height: 3.5rem; font-size: 1.0625rem; box-shadow: var(--shadow-sm); }
/* The shadow above would hide the focus ring every other field shows. */
.dir-search .search-field .form-input:focus { box-shadow: 0 0 0 3px var(--orange-ring), var(--shadow-sm); }
.dir-body { display: grid; gap: 1.25rem; }
.dir-main { min-width: 0; }
.dir-count { margin-bottom: 1rem; font-size: 0.875rem; color: var(--muted); }

.dir-cat-list a {
	display: flex;
	align-items: center;
	min-height: 2.25rem;
	padding: 0.375rem 0.75rem;
	border-radius: var(--radius-sm);
	font-size: 0.9375rem;
	line-height: 1.3;
	color: var(--text);
	text-decoration: none;
}
.dir-cat-list a:hover { background: var(--surface-soft); color: var(--ink); }
.dir-cat-list a[aria-current="true"] { background: var(--ink); color: #FFFFFF; font-weight: 500; }

/* Phones and tablets: the categories fold into one drop-down list above the cards. */
.dir-pick { border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.dir-pick > summary {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	min-height: 3rem;
	padding: 0.5rem 1rem;
	list-style: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.dir-pick > summary::-webkit-details-marker { display: none; }
.dir-pick > summary::after {
	content: '';
	flex: none;
	width: 0.5rem;
	height: 0.5rem;
	margin: 0 0.25rem 0.25rem auto;
	border-right: 2px solid var(--subtle);
	border-bottom: 2px solid var(--subtle);
	transform: rotate(45deg);
	transition: transform 0.2s var(--ease);
}
.dir-pick[open] > summary::after { margin-bottom: -0.25rem; transform: rotate(-135deg); }
.dir-pick > summary:focus-visible { outline-offset: -2px; border-radius: var(--radius); }
.dir-pick-label { font-size: 0.875rem; color: var(--muted); }
.dir-pick-value { min-width: 0; font-weight: 600; color: var(--ink); overflow-wrap: break-word; }
.dir-pick[open] > summary { border-bottom: 1px solid var(--line); }
.dir-pick .dir-cat-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 9.5rem), 1fr));
	gap: 0.125rem 0.25rem;
	max-height: min(28rem, 60vh);
	overflow-y: auto;
	padding: 0.5rem;
	overscroll-behavior: contain;
}
.dir-side { display: none; }
@media (min-width: 64rem) {
	.dir-body { grid-template-columns: 14rem minmax(0, 1fr); gap: 2.5rem; align-items: start; }
	.dir-pick { display: none; }
	.dir-side {
		display: block;
		position: sticky;
		top: calc(var(--header-h) + 1rem);
		max-height: calc(100vh - var(--header-h) - 2rem);
		overflow-y: auto;
		overscroll-behavior: contain;
		margin-left: -0.75rem;
	}
	.dir-side-title { margin: 0 0 0.375rem 0.75rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
	.dir-cat-list a { min-height: 2.125rem; font-size: 0.9rem; }
}

/* The first view: 48 cards (24 on a phone) until assets/integrations.js takes over the same count. */
.dir-grid[data-paged] > li:nth-child(n+49) { display: none; }
@media (max-width: 39.99rem) { .dir-grid[data-paged] > li:nth-child(n+25) { display: none; } }

.dir-more { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; margin-top: 2rem; }
.dir-progress { font-size: 0.875rem; color: var(--muted); }
.dir-empty { padding: 2.5rem 1.5rem; border: 1px dashed var(--line-strong); border-radius: var(--radius-xl); background: var(--surface); text-align: center; }
.dir-empty-title { max-width: 30rem; margin-inline: auto; font-family: var(--font-display); font-size: 1.125rem; font-weight: 600; line-height: 1.35; color: var(--ink); }
.dir-empty p:not(.dir-empty-title) { max-width: 30rem; margin: 0.5rem auto 0; color: var(--muted); }
.dir-how { margin-top: 2rem; }

/* "Don't see your app?" */
.ix-ask {
	display: grid;
	gap: 1.5rem 3rem;
	padding: clamp(1.5rem, 1rem + 2.5vw, 3rem);
	border: 1px solid #FBDDBB;
	border-radius: var(--radius-2xl);
	background: linear-gradient(135deg, var(--orange-soft), #FFFFFF 70%);
	box-shadow: var(--shadow-sm);
}
@media (min-width: 56rem) { .ix-ask { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } }
.ix-ask-copy .eyebrow { margin-bottom: 0.75rem; }
.ix-ask-title { font-size: clamp(1.625rem, 1.3rem + 1.3vw, 2.25rem); line-height: 1.12; letter-spacing: -0.025em; }
.ix-ask-copy p:not(.eyebrow) { max-width: 40rem; margin-top: 0.875rem; color: var(--text); }

/* -------------------------------------------------------------- App pages */
.app-hero-crumbs { margin-bottom: 1.5rem; }
.app-hero-main { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.app-hero .app-logo--lg { width: 5rem; height: 5rem; border-radius: 1.25rem; }
.app-hero .app-logo--lg img { width: 3.5rem; height: 3.5rem; }
.app-hero-copy { min-width: 0; }
.app-hero .hero-title { font-size: clamp(2rem, 1.5rem + 2.2vw, 3.25rem); overflow-wrap: break-word; }
.app-hero .hero-lead { max-width: 46rem; margin-top: 0.875rem; }
.app-hero .hero-actions { margin-top: 1.75rem; }
.app-facts-row { display: flex; flex-wrap: wrap; gap: 0.5rem 2rem; margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: 0.9375rem; line-height: 1.45; }
.app-facts-row > div { display: flex; flex-wrap: wrap; gap: 0 0.375rem; min-width: 0; }
.app-facts-row dt { color: var(--muted); }
.app-facts-row dt::after { content: ':'; }
.app-facts-row dd { font-weight: 500; color: var(--ink); }
@media (max-width: 39.99rem) {
	.app-hero-main { grid-template-columns: minmax(0, 1fr); gap: 1.125rem; }
	.app-hero .app-logo--lg { width: 4rem; height: 4rem; border-radius: 1rem; }
	.app-hero .app-logo--lg img { width: 2.75rem; height: 2.75rem; }
}

/* Block 4: three ideas. */
.ix-ideas { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 56rem) { .ix-ideas { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; } }
.ix-idea {
	display: flex;
	flex-direction: column;
	min-width: 0;
	padding: 1.5rem;
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	background: var(--surface);
	box-shadow: var(--shadow-sm);
}
.ix-idea::before {
	content: '';
	width: 0.875rem;
	height: 0.875rem;
	margin-bottom: 1.125rem;
	background:
		linear-gradient(var(--orange) 0 0) 0 0 / 0.375rem 0.375rem no-repeat,
		linear-gradient(var(--orange) 0 0) 100% 0 / 0.375rem 0.375rem no-repeat,
		linear-gradient(var(--orange) 0 0) 0 100% / 0.375rem 0.375rem no-repeat,
		linear-gradient(var(--line-strong) 0 0) 100% 100% / 0.375rem 0.375rem no-repeat;
}
.ix-idea-title { font-size: 1.125rem; line-height: 1.3; letter-spacing: -0.012em; }
.ix-idea-text { margin-top: 0.5rem; font-size: 0.9375rem; line-height: 1.6; color: var(--muted); }

/* Under the ideas: a customer story that lists the app. */
.ix-story { margin-top: 1.75rem; font-size: 0.9375rem; color: var(--muted); }
.ix-story .link-arrow { margin-left: 0.25rem; }

/* Blocks 5 and 6: connecting in three steps, the request line and the ChatGPT line. */
.ix-connect { max-width: 52rem; }
/* A title-only head over the steps: they sit under it, not a grid's gap away. */
.section-head:has(+ .ix-connect) { margin-bottom: 1.25rem; }
.ix-steps { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); counter-reset: ix-step; list-style: none; padding: 0; }
@media (min-width: 48rem) { .ix-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; } }
.ix-steps > li { counter-increment: ix-step; min-width: 0; padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.ix-steps > li::before {
	content: counter(ix-step);
	display: inline-grid;
	place-items: center;
	width: 1.75rem;
	height: 1.75rem;
	margin-bottom: 0.875rem;
	border-radius: 999px;
	background: var(--orange-soft);
	color: var(--orange-ink-deep);
	font-size: 0.875rem;
	font-weight: 600;
}
.ix-step-title { font-size: 1.0625rem; line-height: 1.3; letter-spacing: -0.01em; }
.ix-steps > li p { margin-top: 0.375rem; font-size: 0.9375rem; line-height: 1.55; color: var(--muted); }
.ix-connect .link-arrow { margin-top: 1.25rem; }
.ix-line { display: flex; align-items: flex-start; gap: 0.625rem; margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: 0.9375rem; line-height: 1.55; color: var(--text); }
.ix-line svg { flex: none; width: 1.125rem; height: 1.125rem; margin-top: 0.125rem; color: var(--orange-ink); }

/* Block 7: more apps from the category. */
.ix-more-link { margin-top: 1.5rem; }

/* ----------------------------------------------------------- Request page */
@media (min-width: 64rem) { .ix-request { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); } }
.ix-aside { padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-soft); gap: 0.5rem; }
.ix-aside-title { font-family: var(--font-display); font-size: 1.125rem; font-weight: 600; color: var(--ink); }
.ix-aside p:not(.ix-aside-title) { color: var(--text); }
