/* ub/integrations: what a shop can be connected to.
   Full (/integrari/; Tomi, 2026-11-03: "tabbed and with images like gomag"): a search and the category tabs (shown
   only with JavaScript, laid out from the first paint by html.ub-js), the legend and the result line, then each
   category (icon in a tinted square, name, what it does) over a grid of brand cards; a card already running on our
   clients' sites has a dot in its corner. filter.js hides what the tab or the search leaves out ([hidden]).
   Compact (Tomi, 2026-11-03: like Gomag's): a grid of white brand cards (a logo or a typographic mark in the same
   tinted square, the name, the category) and a navy card "+ N more" with a round arrow to the full page.
   Theme tokens only; the icons are the theme's (icons.css: .ub-icon--<name> sets --ub-icon, --ub-i-arrow-right). */

.wp-block-ub-integrations {
	container: ub-int / inline-size;
	box-sizing: border-box;
}
.wp-block-ub-integrations > * { margin-block: 0; }

/* The head reads like every section's (the theme's .ub-section-head), here too for the editor's preview */
.wp-block-ub-integrations > .ub-int__head { max-inline-size: 46rem; margin-block-end: var(--wp--preset--spacing--40); }
.ub-int__head > * { margin-block: 0; }
.ub-int__head > * + * { margin-block-start: 0.75rem; }

/* The legend, and the dot that marks a name */
.ub-int__legend {
	display: flex; align-items: center; gap: 0.5rem; margin: 0;
	font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted);
}
.ub-int__dot, .ub-int__card.is-delivered > .ub-int__card-link::after {
	content: ""; flex: none; display: block;
	inline-size: 0.5rem; block-size: 0.5rem; border-radius: 50%;
	background: var(--wp--preset--color--primary);
}

/* A category: its head (icon, name, what it does, a note) over its cards */
.ub-int__about { max-inline-size: 46rem; margin-block-end: 1.25rem; }
.ub-int__about > * { margin-block: 0; }
.ub-int__about > * + * { margin-block-start: 0.5rem; }

/* The name with its icon in a disc on the left */
.ub-int__name {
	position: relative;
	font-size: var(--wp--preset--font-size--x-large);
	line-height: 1.2;
	letter-spacing: -0.02em;
	text-wrap: balance;
}
.ub-int__name.has-icon {
	display: flex; align-items: center;
	min-block-size: 3rem;
	padding-inline-start: 3.75rem;
}
.ub-int__name.has-icon::before, .ub-int__name.has-icon::after {
	content: ""; position: absolute; inset-block-start: 50%; translate: 0 -50%;
}
.ub-int__name.has-icon::before {
	inset-inline-start: 0; inline-size: 3rem; block-size: 3rem; border-radius: var(--wp--custom--radius--small, 12px);
	background: var(--wp--preset--color--tint);
}
.ub-int__name.has-icon::after {
	inset-inline-start: 0.75rem; inline-size: 1.5rem; block-size: 1.5rem;
	background: var(--wp--preset--color--primary);
	-webkit-mask: var(--ub-icon) center / contain no-repeat; mask: var(--ub-icon) center / contain no-repeat;
}
.ub-int__what { color: var(--wp--preset--color--muted); }
.ub-int__note {
	padding: 0.5rem 0.75rem; border-radius: var(--wp--custom--radius--small, 12px);
	background: var(--wp--preset--color--surface);
	font-size: var(--wp--preset--font-size--small);
}

/* The brand cards (both layouts), one a row on phones, two from 560 px, three from 900 px, the mark beside the name.
   Compact: the navy card closes the grid (across the row while there are two), and the cards are links to their
   category on the full page. Full: plain cards. */
.ub-int__grid, .ub-int__cards {
	display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.5rem;
	margin: 0; padding: 0; list-style: none;
}
.ub-int__card { display: flex; margin: 0; }
.ub-int__card-link {
	display: flex; align-items: center; gap: 1rem;
	box-sizing: border-box; inline-size: 100%; min-block-size: 4.5rem; padding: 0.75rem 1rem;
	border: 1px solid var(--wp--preset--color--line); border-radius: var(--wp--custom--radius--small, 12px);
	background: var(--wp--preset--color--base); color: var(--wp--preset--color--ink); text-decoration: none;
}
a.ub-int__card-link:hover { border-color: color-mix(in srgb, var(--wp--preset--color--primary) 45%, var(--wp--preset--color--line)); box-shadow: var(--wp--preset--shadow--soft); }
a.ub-int__card-link:hover .ub-int__card-name { color: var(--wp--preset--color--primary); }
@container ub-int (min-width: 560px) {
	.ub-int__grid, .ub-int__cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
	.ub-int__card--more { grid-column: 1 / -1; }
	.ub-int__card-link { gap: 1.25rem; min-block-size: 6rem; padding: 1.25rem 1.5rem; border-radius: var(--wp--custom--radius--card, 24px); }
}
@container ub-int (min-width: 900px) {
	.ub-int__grid, .ub-int__cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
	.ub-int__card--more { grid-column: auto; }
}
/* The logo's slot: a tinted square holding the logo, or the brand's initials until there is one */
.ub-int__logo {
	flex: none; display: grid; place-items: center; box-sizing: border-box;
	inline-size: 3.25rem; block-size: 2.5rem; padding: 0.25rem;
	border-radius: var(--wp--custom--radius--small, 12px); background: var(--wp--preset--color--tint);
	color: var(--wp--preset--color--primary); font-size: 1.125rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1;
}
.ub-int__logo.has-image { background: transparent; padding: 0; }
.ub-int__logo img { display: block; inline-size: auto; block-size: auto; max-inline-size: 100%; max-block-size: 100%; object-fit: contain; }
/* Two logos side by side ("Facebook și Instagram") */
.ub-int__logo.is-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.25rem; }
/* A feature (not a brand): the theme's icon in the tinted square (icons.css: .ub-icon--<name> sets --ub-icon) */
.ub-int__logo.has-icon::after {
	content: ""; inline-size: 1.5rem; block-size: 1.5rem; background: var(--wp--preset--color--primary);
	-webkit-mask: var(--ub-icon) center / contain no-repeat; mask: var(--ub-icon) center / contain no-repeat;
}
.ub-int__card-text { display: flex; flex-direction: column; gap: 0.125rem; min-inline-size: 0; }
.ub-int__card-name { font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.015em; line-height: 1.25; }
.ub-int__card-line { font-size: var(--wp--preset--font-size--small); line-height: 1.4; color: var(--wp--preset--color--muted); text-wrap: pretty; }
@container ub-int (min-width: 560px) {
	.ub-int__logo { inline-size: 4rem; block-size: 3rem; padding: 0.375rem; }
}
@container ub-int (min-width: 900px) {
	.ub-int__card-name { font-size: 1.25rem; }
}
/* The navy card: how many more, and a round arrow */
.ub-int__card--more .ub-int__card-link {
	flex-direction: row; align-items: center; justify-content: space-between; gap: 1rem; min-block-size: 5rem;
	border-color: transparent; background: linear-gradient(135deg, var(--wp--preset--color--deep-2), var(--wp--preset--color--deep));
	color: var(--wp--preset--color--on-deep);
}
.ub-int__card--more .ub-int__card-line { color: var(--wp--preset--color--on-deep-muted); }
.ub-int__card--more a.ub-int__card-link:hover .ub-int__card-name { color: var(--wp--preset--color--on-deep); }
.ub-int__round {
	position: relative; flex: none; inline-size: 2.75rem; block-size: 2.75rem; border-radius: 50%;
	background: var(--wp--preset--color--on-deep);
}
.ub-int__round::after {
	content: ""; position: absolute; inset: 0; margin: auto; inline-size: 1.25rem; block-size: 1.25rem;
	background: var(--wp--preset--color--deep);
	-webkit-mask: var(--ub-i-arrow-right) center / contain no-repeat; mask: var(--ub-i-arrow-right) center / contain no-repeat;
}
@media (prefers-reduced-motion: no-preference) {
	html:not([data-ub-motion="off"]) a.ub-int__card-link { transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease; }
	html:not([data-ub-motion="off"]) a.ub-int__card-link:hover { transform: translateY(-2px); }
	html:not([data-ub-motion="off"]) .ub-int__round { transition: translate 0.2s ease; }
	html:not([data-ub-motion="off"]) a.ub-int__card-link:hover .ub-int__round { translate: 0.25rem 0; }
}

/* The editor's note when the list is empty (nothing shows on the site) */
.wp-block-ub-integrations.is-empty .ub-int__empty {
	margin: 0; padding: 1rem 1.25rem; border: 2px dashed var(--wp--preset--color--line); border-radius: var(--wp--custom--radius--small, 12px);
	color: var(--wp--preset--color--muted); font-size: var(--wp--preset--font-size--small);
}

/* ---- Full: the tools, the legend and result line, the groups ------------------------------------------------- */

/* Without JavaScript nothing filters: no tools, no result line, every category in order */
html:not(.ub-js) .ub-int__tools, html:not(.ub-js) .ub-int__status { display: none; }
.ub-int__tools { display: grid; gap: 1rem; margin-block-end: var(--wp--preset--spacing--30); }
.ub-int__search { position: relative; max-inline-size: 26rem; }
.ub-int__search::before { /* the magnifier, inside the field */
	content: ""; position: absolute; inset-block: 0; inset-inline-start: 1rem; margin-block: auto;
	inline-size: 1.25rem; block-size: 1.25rem; pointer-events: none; background: var(--wp--preset--color--muted);
	-webkit-mask: var(--ub-i-search) center / contain no-repeat; mask: var(--ub-i-search) center / contain no-repeat;
}
.wp-block-ub-integrations .ub-int__q {
	box-sizing: border-box; inline-size: 100%; min-block-size: 3rem; margin: 0; padding: 0.625rem 1rem 0.625rem 2.75rem;
	border: 1px solid var(--wp--preset--color--line); border-radius: var(--wp--custom--radius--pill, 999px);
	background: var(--wp--preset--color--base); color: var(--wp--preset--color--ink);
	font: inherit; font-size: var(--wp--preset--font-size--medium); line-height: 1.4;
}
.ub-int__q::placeholder { color: var(--wp--preset--color--muted); opacity: 1; }
.ub-int__q:hover { border-color: color-mix(in srgb, var(--wp--preset--color--primary) 45%, var(--wp--preset--color--line)); }
.ub-int__q:focus-visible { outline: 2px solid var(--ub-focus, var(--wp--preset--color--primary)); outline-offset: 2px; border-color: var(--wp--preset--color--primary); }

/* The tabs: pills, the chosen one filled; a count after each name */
.ub-int__tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.wp-block-ub-integrations .ub-int__tab {
	display: inline-flex; align-items: center; gap: 0.4em; box-sizing: border-box; min-block-size: 2.75rem; margin: 0; padding: 0.5rem 1rem;
	border: 1px solid var(--wp--preset--color--line); border-radius: var(--wp--custom--radius--pill, 999px);
	background: var(--wp--preset--color--base); color: var(--wp--preset--color--ink);
	font: inherit; font-size: var(--wp--preset--font-size--small); font-weight: 600; line-height: 1.2; letter-spacing: 0;
	white-space: nowrap; cursor: pointer;
}
.wp-block-ub-integrations .ub-int__tab:hover { border-color: var(--wp--preset--color--primary); color: var(--wp--preset--color--primary); }
.wp-block-ub-integrations .ub-int__tab[aria-pressed="true"] { border-color: var(--wp--preset--color--primary); background: var(--wp--preset--color--primary); color: var(--wp--preset--color--on-primary); }
.wp-block-ub-integrations .ub-int__tab:focus-visible { outline: 2px solid var(--ub-focus, var(--wp--preset--color--primary)); outline-offset: 2px; }
.ub-int__n { font-weight: 500; font-variant-numeric: tabular-nums; }
/* Phones: the tabs in one row that scrolls sideways, to the screen's edges, faded where it goes on */
@container ub-int (max-width: 559.98px) {
	.ub-int__tabs {
		flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
		margin-inline: calc(-1 * var(--wp--style--root--padding-left, 1rem)) calc(-1 * var(--wp--style--root--padding-right, 1rem));
		padding: 0.25rem var(--wp--style--root--padding-right, 1rem) 0.25rem var(--wp--style--root--padding-left, 1rem);
		scroll-padding-inline: 2rem;
		-webkit-mask-image: linear-gradient(90deg, transparent, #000 0.75rem, #000 calc(100% - 2rem), transparent);
		mask-image: linear-gradient(90deg, transparent, #000 0.75rem, #000 calc(100% - 2rem), transparent);
	}
	.ub-int__tabs::-webkit-scrollbar { display: none; }
	.ub-int__search { max-inline-size: none; }
}

/* The legend (left) and the result line (right) */
.ub-int__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; margin-block-end: var(--wp--preset--spacing--40); }
.ub-int__status { margin: 0; font-size: var(--wp--preset--font-size--small); font-weight: 600; color: var(--wp--preset--color--ink); }

/* The groups, one under the other */
.ub-int__list { display: grid; gap: var(--wp--preset--spacing--50); }
/* Below the sticky header when reached through /integrari/#… (kit.css sets the scroll padding for the page) */
.ub-int__cat { scroll-margin-block-start: 1rem; }
/* Reached through /integrari/#… with JavaScript: the category is alone, under the tools; its margin is the tools'
   height and the line's (filter.js sets --ub-int-lead), so the jump shows the tools too */
[data-filtered] > .ub-int__list > .ub-int__cat { scroll-margin-block-start: var(--ub-int-lead, 1rem); }
.ub-int__cat[hidden], .ub-int__card[hidden] { display: none !important; }

/* A card already running on our clients' sites: a dot in its top right corner (the legend says what it means) */
.ub-int__card.is-delivered > .ub-int__card-link { position: relative; }
.ub-int__card.is-delivered > .ub-int__card-link::after { position: absolute; inset-block-start: 0.875rem; inset-inline-end: 0.875rem; }
.ub-int__card-extra { font-weight: 500; color: var(--wp--preset--color--muted); }
[data-variant="full"] .ub-int__card-name { padding-inline-end: 0.75rem; text-wrap: pretty; }

/* Nothing found: where to ask (a plain line: on /integrari/ the page's own "ask us" card follows the block) */
.ub-int__none { margin: 0; font-size: var(--wp--preset--font-size--large); font-weight: 600; color: var(--wp--preset--color--ink); }
.ub-int__none[hidden] { display: none; }
.ub-int__none a { color: var(--wp--preset--color--primary); }
