/* ==========================================================================
   DeshipOS — Trusted Brands widget
   Full-width band: a centred eyebrow + title + short description flanked by two
   VERTICAL logo marquees — the left column glides up, the right glides down
   (opposite directions) behind soft top/bottom fades, pausing on hover. Falls
   back to static, scroll-free columns for reduced-motion users.
   Mobile: the centre text sits on top, with the two columns side-by-side below.
   Depends on assets/css/base.css for design tokens.
   ========================================================================== */

.deshipos-brands {
	--dbr-ink:          var(--dew-ink, #0F172A);
	--dbr-text:         var(--dew-text, #1E293B);
	--dbr-muted:        var(--dew-muted, #475569);
	--dbr-faint:        var(--dew-faint, #94A3B8);
	--dbr-border:       var(--dew-divider, #E2E8F0);
	--dbr-brand:        var(--dew-brand, #16A34A);
	--dbr-brand-strong: var(--dew-brand-strong, #15803D);
	--dbr-brand-soft:   var(--dew-brand-soft, rgba(22, 163, 74, .12));
	--dbr-brand-grad:   var(--dew-brand-gradient, linear-gradient(135deg, #16A34A 0%, #22C55E 100%));
	--dbr-bg:           #FFFFFF;
	--dbr-col-h:        360px;
	--dbr-chip-gap:     16px;

	box-sizing: border-box;
	position: relative;
	width: 100%;
	padding: 72px 24px;
	overflow: hidden;
	/* Soft full-width brand wash. */
	background:
		radial-gradient(60% 80% at 0% 50%,   rgba(34, 197, 94, .10) 0%, rgba(34, 197, 94, 0) 55%),
		radial-gradient(60% 80% at 100% 50%, rgba(22, 163, 74, .09) 0%, rgba(22, 163, 74, 0) 55%),
		linear-gradient(180deg, #FFFFFF 0%, #F7FBF8 100%);
}
.deshipos-brands *,
.deshipos-brands *::before,
.deshipos-brands *::after { box-sizing: border-box; }

.deshipos-brands__inner {
	position: relative;
	z-index: 1;
	max-width: 1280px;
	margin: 0 auto;
	min-width: 0;
	display: grid;
	/* minmax(0, …) lets the tracks shrink below the chips' intrinsic (nowrap)
	   width so two columns never force horizontal overflow on small screens. */
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	grid-template-areas:
		"center center"
		"left   right";
	gap: 32px 20px;
	align-items: stretch;
}

/* ==========================================================================
   Centre text
   ========================================================================== */
.deshipos-brands__center {
	grid-area: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 14px;
	padding: 4px 8px;
}

.deshipos-brands__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	margin: 0;
	padding: 6px 14px;
	border-radius: 999px;
	background: var(--dbr-brand-soft);
	border: 1px solid rgba(22, 163, 74, .22);
	color: var(--dbr-brand-strong);
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	line-height: 1.4;
}
.deshipos-brands__eyebrow::before {
	content: "";
	flex: 0 0 auto;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--dbr-brand);
	box-shadow: 0 0 0 0 rgba(22, 163, 74, .5);
	animation: deshipos-brands-pulse 2.4s ease-out infinite;
}

.deshipos-brands__title {
	margin: 0;
	font-size: clamp(1.6rem, 3vw, 2.4rem);
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: var(--dew-tracking-tight, -.02em);
	color: var(--dbr-ink);
	text-wrap: balance;
}

.deshipos-brands__desc {
	margin: 0;
	max-width: 42ch;
	font-size: 1rem;
	line-height: 1.6;
	color: var(--dbr-muted);
}

/* ==========================================================================
   Marquee columns
   ========================================================================== */
.deshipos-brands__col--left  { grid-area: left; }
.deshipos-brands__col--right { grid-area: right; }
.deshipos-brands__col { min-width: 0; }

.deshipos-brands__viewport {
	position: relative;
	min-width: 0;
	height: var(--dbr-col-h);
	overflow: hidden;
	-webkit-mask-image: linear-gradient(180deg, transparent 0, #000 12%, #000 88%, transparent 100%);
	        mask-image: linear-gradient(180deg, transparent 0, #000 12%, #000 88%, transparent 100%);
}

.deshipos-brands__track {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: var(--dbr-chip-gap);
}

/* Motion mode: the track holds the chips twice; translateY(-50%) lands seamless
   because every chip (incl. the seam) shares the same vertical gap. */
.deshipos-brands--marquee .deshipos-brands__track {
	width: 100%;
	will-change: transform;
	animation: deshipos-brands-vmarquee var(--dbr-marquee-duration, 28s) linear infinite;
}
/* Left rolls up, right rolls down — opposite directions. */
.deshipos-brands--marquee .deshipos-brands__col--right .deshipos-brands__track {
	animation-direction: reverse;
}
/* "Swap directions" flips which side goes which way. */
.deshipos-brands--rev-yes.deshipos-brands--marquee .deshipos-brands__col--left  .deshipos-brands__track { animation-direction: reverse; }
.deshipos-brands--rev-yes.deshipos-brands--marquee .deshipos-brands__col--right .deshipos-brands__track { animation-direction: normal; }

.deshipos-brands--marquee .deshipos-brands__viewport:hover .deshipos-brands__track,
.deshipos-brands--marquee .deshipos-brands__track:focus-within {
	animation-play-state: paused;
}

@keyframes deshipos-brands-vmarquee {
	from { transform: translateY(0); }
	to   { transform: translateY(-50%); }
}
@keyframes deshipos-brands-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(22, 163, 74, .45); }
	70%  { box-shadow: 0 0 0 9px rgba(22, 163, 74, 0); }
	100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

/* ==========================================================================
   Brand chip
   ========================================================================== */
.deshipos-brands__item {
	display: flex;
	flex: 0 0 auto;
}

.deshipos-brands__link {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 14px;
	width: 100%;
	padding: 14px 22px 14px 14px;
	text-decoration: none;
	color: var(--dbr-text);
	background: var(--dbr-bg);
	border: 1px solid var(--dbr-border);
	border-radius: 16px;
	white-space: nowrap;
	box-shadow: 0 1px 2px rgba(15, 23, 42, .05), inset 0 1px 0 rgba(255, 255, 255, .65);
	transition:
		transform var(--dew-dur-base, 220ms) var(--dew-ease-out, cubic-bezier(.16, 1, .3, 1)),
		border-color var(--dew-dur-base, 220ms) var(--dew-ease-out, cubic-bezier(.16, 1, .3, 1)),
		box-shadow var(--dew-dur-base, 220ms) var(--dew-ease-out, cubic-bezier(.16, 1, .3, 1));
}
.deshipos-brands__link:hover {
	transform: translateY(-2px);
	border-color: rgba(22, 163, 74, .5);
	box-shadow:
		0 14px 26px -14px rgba(22, 163, 74, .55),
		0 2px 6px rgba(15, 23, 42, .06);
}
a.deshipos-brands__link { cursor: pointer; }
a.deshipos-brands__link:active { transform: translateY(-1px); }
.deshipos-brands__link:focus-visible {
	outline: none;
	border-color: var(--dbr-brand);
	box-shadow: 0 0 0 3px var(--dbr-brand-soft);
}

/* ----- Icon token ----- */
.deshipos-brands__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 60px;
	height: 60px;
	border-radius: 15px;
	background: var(--dbr-brand-soft);
	color: var(--dbr-brand);
	line-height: 1;
	box-shadow: inset 0 0 0 1px rgba(22, 163, 74, .10);
	transition:
		background var(--dew-dur-base, 220ms) var(--dew-ease-out, cubic-bezier(.16, 1, .3, 1)),
		color var(--dew-dur-base, 220ms) var(--dew-ease-out, cubic-bezier(.16, 1, .3, 1)),
		box-shadow var(--dew-dur-base, 220ms) var(--dew-ease-out, cubic-bezier(.16, 1, .3, 1)),
		transform var(--dew-dur-base, 220ms) var(--dew-ease-out, cubic-bezier(.16, 1, .3, 1));
}
.deshipos-brands__icon svg { width: 32px; height: 32px; display: block; }
.deshipos-brands__icon i   { font-size: 32px; line-height: 1; }

/* When a chip is just a logo (no name/subtitle), centre it in the pill. */
.deshipos-brands__icon:only-child { margin-inline: auto; }

.deshipos-brands__link:hover .deshipos-brands__icon {
	background: var(--dbr-brand-grad);
	color: #FFFFFF;
	box-shadow: 0 8px 16px -6px rgba(22, 163, 74, .55);
	transform: scale(1.05);
}

/* Full logo images (wordmarks): no token box. */
.deshipos-brands__icon--image {
	width: auto;
	height: auto;
	min-width: 0;
	max-width: 100%;
	background: none;
	box-shadow: none;
	border-radius: 0;
}
/* A lone logo image fills the pill width so it can sit truly centred. */
.deshipos-brands__icon--image:only-child { width: 100%; }
.deshipos-brands__icon--image img {
	max-width: 100%;
	max-height: 68px;
	width: auto;
	height: auto;
	margin-inline: auto;
	display: block;
	object-fit: contain;
}
.deshipos-brands__link:hover .deshipos-brands__icon--image {
	background: none;
	box-shadow: none;
	transform: none;
}

/* ----- Logos-only mode (name + subtitle hidden) ----- */
.deshipos-brands--logos-only .deshipos-brands__link {
	gap: 0;
	justify-content: center;
	padding: 14px;
}
.deshipos-brands--logos-only .deshipos-brands__icon {
	width: 60px;
	height: 60px;
	border-radius: 15px;
}
.deshipos-brands--logos-only .deshipos-brands__icon svg { width: 32px; height: 32px; }
.deshipos-brands--logos-only .deshipos-brands__icon i   { font-size: 32px; }
.deshipos-brands--logos-only .deshipos-brands__icon--image {
	min-width: 68px;
	padding: 2px 12px;
}

/* ----- Text (name + subtitle) ----- */
.deshipos-brands__text {
	display: flex;
	flex-direction: column;
	gap: 3px;
	line-height: 1.2;
	min-width: 0;
}
.deshipos-brands__name {
	font-size: 1.0625rem;
	font-weight: 700;
	color: var(--dbr-ink);
	letter-spacing: var(--dew-tracking-snug, -.005em);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: color var(--dew-dur-base, 220ms) var(--dew-ease-out, cubic-bezier(.16, 1, .3, 1));
}
.deshipos-brands__link:hover .deshipos-brands__name { color: var(--dbr-brand-strong); }
.deshipos-brands__subtitle {
	font-size: .6875rem;
	font-weight: 700;
	color: var(--dbr-faint);
	text-transform: uppercase;
	letter-spacing: .1em;
	white-space: nowrap;
}

/* ----- Optional grayscale mode (full color on hover) ----- */
.deshipos-brands--grayscale-yes .deshipos-brands__icon {
	filter: grayscale(1);
	opacity: .85;
}
.deshipos-brands--grayscale-yes .deshipos-brands__link:hover .deshipos-brands__icon {
	filter: grayscale(0);
	opacity: 1;
}

/* ==========================================================================
   Static mode (auto-scroll off) — just clip the columns, no animation.
   ========================================================================== */
.deshipos-brands--static .deshipos-brands__track { animation: none; }

/* ==========================================================================
   Desktop — left | center | right
   ========================================================================== */
@media (min-width: 960px) {
	.deshipos-brands {
		padding: 88px 40px;
	}
	.deshipos-brands__inner {
		grid-template-columns: minmax(0, 1fr) minmax(320px, 460px) minmax(0, 1fr);
		grid-template-areas: "left center right";
		align-items: center;
		gap: 48px;
	}
	.deshipos-brands__center { padding: 0 8px; }
}

@media (min-width: 1200px) {
	.deshipos-brands__inner { gap: 64px; }
}

/* ==========================================================================
   Small screens — center on top, the two columns side-by-side below.
   ========================================================================== */
@media (max-width: 599px) {
	.deshipos-brands {
		padding: 48px 16px;
	}
	.deshipos-brands {
		--dbr-col-h: 300px;
	}
	.deshipos-brands__inner { gap: 26px 12px; }
	.deshipos-brands__link {
		padding: 11px 14px 11px 11px;
		gap: 11px;
		border-radius: 14px;
	}
	.deshipos-brands__icon { width: 46px; height: 46px; border-radius: 12px; }
	.deshipos-brands__icon svg { width: 24px; height: 24px; }
	.deshipos-brands__icon i   { font-size: 24px; }
	.deshipos-brands__name { font-size: .9375rem; }
	.deshipos-brands__subtitle { font-size: .625rem; }
	.deshipos-brands__title { font-size: clamp(1.45rem, 7vw, 1.9rem); }
	.deshipos-brands__desc { font-size: .9375rem; }
	.deshipos-brands--logos-only .deshipos-brands__icon { width: 52px; height: 52px; }
}

/* ==========================================================================
   Reduced motion — stop scrolling; show one tidy static (clipped) set.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
	.deshipos-brands__eyebrow::before { animation: none; }
	.deshipos-brands--marquee .deshipos-brands__track { animation: none; }
	.deshipos-brands__item[aria-hidden="true"] { display: none; }

	.deshipos-brands__link,
	.deshipos-brands__icon,
	.deshipos-brands__name { transition-duration: .01ms !important; }
	.deshipos-brands__link:hover { transform: none; }
	.deshipos-brands__link:hover .deshipos-brands__icon { transform: none; }
}
