/*
 * Index Brands — directory screens.
 *
 * Values here trace to §0 and §2 of the spec. Where a number looks arbitrary it
 * is quoted from the prototype (cover 118px, badge 56px at -28px, cards 20px
 * radius); where a colour is needed it comes from a token in tokens.css.
 *
 * Layout uses logical properties throughout — padding-inline, margin-inline,
 * inset-inline-end — because Arabic RTL is the primary direction and a `left`
 * anywhere in here would put the hex chip on the wrong side of every card.
 */

/* ---------------------------------------------------------------- shared */

.ib-index .ib-spacer {
	flex: 1;
}

.ib-index .ib-arrow {
	flex-shrink: 0;
}

/* Arrows point the way the language reads. */
.ib-index[dir='rtl'] .ib-arrow {
	transform: scaleX(-1);
}

.ib-index .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* ------------------------------------------------------------------ hero */

.ib-index .ib-hero {
	padding-block: 52px 40px;
	max-width: 900px;
}

.ib-index .ib-hero__h {
	font-size: var(--fs-hero);
	font-weight: 600;
	letter-spacing: -0.05em;
	line-height: 0.96;
	margin: 0 0 20px;
	text-wrap: balance;
	color: var(--ink);
}

.ib-index .ib-hero__lede {
	font-size: 18.5px;
	line-height: 1.6;
	color: var(--muted);
	margin: 0 0 30px;
	max-width: 48ch;
	text-wrap: pretty;
}

/* The search field is the visual focus of the page, §2.2. */
.ib-index .ib-search {
	display: flex;
	align-items: center;
	gap: 14px;
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--r-pill);
	height: var(--h-search);
	padding-inline: 26px 7px;
	max-width: 660px;
	transition: border-color .18s ease;
}

.ib-index .ib-search:focus-within {
	border-color: var(--ink);
}

.ib-index .ib-search__icon {
	flex-shrink: 0;
	color: var(--muted);
}

.ib-index .ib-search__input {
	flex: 1;
	min-width: 0;
	border: 0;
	background: transparent;
	font-size: 18px;
	color: var(--ink);
	font-family: inherit;
}

.ib-index .ib-search__input::placeholder {
	color: var(--faint);
}

.ib-index .ib-search__input:focus {
	outline: none;
}

.ib-index .ib-search__kbd {
	font-size: 12px;
	font-weight: 600;
	color: var(--muted);
	border: 1px solid var(--border);
	border-radius: 7px;
	padding: 5px 9px;
	flex-shrink: 0;
}

/* The hint is a keyboard affordance; on touch there is no ⌘ to press. */
@media (hover: none), (max-width: 620px) {
	.ib-index .ib-search__kbd {
		display: none;
	}
}

.ib-index .ib-search__go {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 52px;
	padding-inline: 30px;
	font-size: 16px;
	font-weight: 600;
	background: var(--ink);
	color: #fff;
	border: 0;
	border-radius: var(--r-pill);
	cursor: pointer;
	white-space: nowrap;
}

/* --------------------------------------------------------- suggest chips */

.ib-index .ib-suggests {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 14px;
}

.ib-index .ib-suggest {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: var(--h-btn-sm);
	padding-inline: 5px 14px;
	background: #fff;
	border: 1px solid #EAE9E4;
	border-radius: var(--r-pill);
	text-decoration: none;
	color: var(--ink);
	transition: border-color .18s ease;
}

.ib-index .ib-suggest:hover,
.ib-index .ib-suggest:focus-visible {
	border-color: var(--ink);
}

.ib-index .ib-suggest__dot {
	width: 28px;
	height: 28px;
	border-radius: var(--r-pill);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.ib-index .ib-suggest__name {
	font-size: 13.5px;
	font-weight: 600;
}

.ib-index .ib-verified {
	display: inline-flex;
	flex-shrink: 0;
	color: var(--faint-2);
}

/* ----------------------------------------------------------------- stats */

.ib-index .ib-stats {
	display: flex;
	align-items: baseline;
	gap: 24px;
	flex-wrap: wrap;
	margin-top: 22px;
}

.ib-index .ib-stat {
	font-size: 13.5px;
	color: var(--muted);
}

.ib-index .ib-stat b {
	display: inline-block;
	font-size: 17px;
	font-weight: 600;
	letter-spacing: -0.02em;
	color: var(--ink);
	margin-inline-end: 3px;
}

/* ------------------------------------------------------------------ rail */

.ib-index .ib-rail-wrap {
	padding-bottom: 20px;
}

.ib-index .ib-rail {
	display: flex;
	align-items: center;
	gap: 5px;
	overflow-x: auto;
	scrollbar-width: none;
	background: #fff;
	border: 1px solid var(--border-soft);
	border-radius: var(--r-pill);
	padding: 6px;
}

.ib-index .ib-rail::-webkit-scrollbar {
	display: none;
}

.ib-index .ib-rail__chip {
	display: inline-flex;
	align-items: center;
	min-height: var(--h-btn-sm);
	padding-inline: 18px;
	border-radius: var(--r-pill);
	font-size: 13.5px;
	font-weight: 600;
	color: var(--muted);
	text-decoration: none;
	white-space: nowrap;
	flex-shrink: 0;
	transition: background-color .18s ease, color .18s ease;
}

.ib-index .ib-rail__chip:hover {
	background: var(--grey-soft);
	color: var(--ink);
}

.ib-index .ib-rail__chip.is-active {
	background: var(--ink);
	color: #fff;
}

/* ------------------------------------------------------------------ grid */

.ib-index .ib-grid-wrap {
	padding-bottom: 52px;
}

/* 1 column mobile → 2 tablet → 4 desktop, 14px gap, equal heights, §2.6. */
.ib-index .ib-grid {
	display: grid;
	gap: var(--gap-grid);
	grid-template-columns: 1fr;
	align-items: stretch;
}

@media (min-width: 700px) {
	.ib-index .ib-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1080px) {
	.ib-index .ib-grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

/* ------------------------------------------------------------- add card */

.ib-index .ib-add {
	background: var(--lime-bg);
	border: 1px solid var(--lime-border);
	border-radius: var(--r-card);
	padding: 20px;
	display: flex;
	flex-direction: column;
	min-height: 250px;
	text-decoration: none;
	color: var(--ink);
}

.ib-index .ib-add__top {
	display: flex;
	align-items: flex-start;
	margin-bottom: auto;
}

.ib-index .ib-add__plus {
	width: 34px;
	height: 34px;
	border-radius: 11px;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.ib-index .ib-add__title {
	font-size: 19px;
	font-weight: 600;
	letter-spacing: -0.03em;
	line-height: 1.28;
	text-wrap: pretty;
}

.ib-index .ib-add__note {
	font-size: 13px;
	line-height: 1.55;
	color: var(--muted);
	margin-top: 7px;
	text-wrap: pretty;
}

/* ----------------------------------------------------------- brand card */

.ib-index .ib-brand {
	background: #fff;
	border: 1px solid var(--border-soft);
	border-radius: var(--r-card);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: var(--ink);
}

.ib-index .ib-brand__cover {
	position: relative;
	height: 118px;
	background: var(--brand);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.ib-index .ib-brand__wm,
.ib-index .ib-sale__wm,
.ib-index .ib-trust__wm {
	line-height: 1;
	white-space: nowrap;
	pointer-events: none;
	max-width: 86%;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ib-index .ib-brand__body {
	padding: 0 18px 18px;
	display: flex;
	flex-direction: column;
}

/* The badge overlaps the cover, ringed in the card's own white so the seam
   reads as one object rather than two stacked tiles, §2.6. */
.ib-index .ib-brand__badge {
	position: relative;
	width: 56px;
	height: 56px;
	border-radius: var(--r-pill);
	background: var(--brand);
	border: 3px solid #fff;
	margin-top: -28px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	flex-shrink: 0;
	line-height: 1;
}

.ib-index .ib-brand__row {
	display: flex;
	align-items: center;
	gap: 7px;
	margin-top: 12px;
}

.ib-index .ib-brand__name {
	font-size: var(--fs-card-title);
	font-weight: 600;
	letter-spacing: -0.024em;
}

.ib-index .ib-chip-sale {
	font-size: 10.5px;
	font-weight: 600;
	color: var(--ink);
	background: var(--lime-soft);
	border-radius: var(--r-pill);
	padding: 3px 9px;
	white-space: nowrap;
}

.ib-index .ib-brand__domain {
	font-size: 12.5px;
	color: var(--muted);
	margin-top: 3px;
}

.ib-index .ib-brand__blurb {
	font-size: 13.5px;
	line-height: 1.55;
	color: var(--muted);
	margin-top: 10px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-wrap: pretty;
}

/* -------------------------------------------------------------- hex chip */

/*
 * §2.6: sits in the cover's trailing corner at opacity 0, revealed on card
 * hover. Keyboard users never trigger a hover, so :focus-visible reveals it too
 * — otherwise the control is reachable by Tab but invisible while focused.
 */
.ib-index .ib-hex {
	position: absolute;
	inset-block-start: 10px;
	inset-inline-end: 10px;
	display: inline-flex;
	align-items: center;
	min-height: 0;
	height: 26px;
	padding-inline: 10px;
	font-size: 11px;
	font-weight: 600;
	font-family: inherit;
	letter-spacing: 0.02em;
	background: transparent;
	border: 1px solid currentColor;
	border-radius: var(--r-pill);
	cursor: pointer;
	opacity: 0;
	transition: opacity .2s ease;
	direction: ltr;
	unicode-bidi: isolate;
}

/*
 * §2.6 draws this chip small and §9 requires a 44px target, which is a real
 * conflict. The visual stays 26px and the hit area is grown to 44px with a
 * transparent overlay — the finger gets the target the rule asks for without
 * putting a 44px pill in the corner of every card.
 */
.index-brand .ib-hex::after {
	content: '';
	position: absolute;
	inset-block: -9px;
	inset-inline: -6px;
}

.ib-index .ib-brand:hover .ib-hex,
.ib-index .ib-hex:focus-visible {
	opacity: 1;
}

/* Touch has no hover, so the affordance would never appear at all. */
@media (hover: none) {
	.ib-index .ib-hex {
		opacity: 1;
	}
}

/* ------------------------------------------------------------ load more */

.ib-index .ib-more {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	flex-wrap: wrap;
	padding-top: 30px;
}

.ib-index .ib-more.is-hidden {
	display: none;
}

.ib-index .ib-more__btn {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	min-height: 48px;
	padding-inline: 30px;
	font-size: 14.5px;
	font-weight: 600;
	font-family: inherit;
	color: var(--ink);
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--r-pill);
	cursor: pointer;
	transition: border-color .18s ease;
}

.ib-index .ib-more__btn:hover {
	border-color: var(--ink);
}

.ib-index .ib-more__btn[disabled] {
	opacity: .55;
	cursor: progress;
}

.ib-index .ib-more__count {
	font-size: 13px;
	color: var(--muted);
}

.ib-index .ib-empty {
	text-align: center;
	padding: 48px 0 8px;
}

.ib-index .ib-empty__t {
	font-size: 17px;
	font-weight: 600;
	margin: 0 0 6px;
}

.ib-index .ib-empty__n {
	font-size: 14px;
	color: var(--muted);
	margin: 0;
}

/* ----------------------------------------------------------- trust strip */

.ib-index .ib-trust {
	display: flex;
	align-items: center;
	gap: 30px;
	flex-wrap: wrap;
	padding: 22px 0;
	margin-bottom: 50px;
	border-block: 1px solid #E8E8E2;
}

.ib-index .ib-trust__line {
	font-size: 14px;
	color: var(--muted);
	flex-shrink: 0;
}

.ib-index .ib-trust__marks {
	display: flex;
	align-items: center;
	gap: 30px;
	flex-wrap: wrap;
	opacity: 0.32;
}

/* ------------------------------------------------------------ acquisition */

.ib-index .ib-sale-sec {
	padding-bottom: 58px;
}

.ib-index .ib-sec-head {
	display: flex;
	align-items: baseline;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}

.ib-index .ib-sec-head__h {
	font-size: var(--fs-h2);
	font-weight: 700;
	letter-spacing: var(--ls-h2);
	margin: 0;
}

.ib-index .ib-sec-head__n {
	font-size: 13px;
	color: var(--muted);
}

.ib-index .ib-sale-grid {
	display: grid;
	gap: 12px;
	grid-template-columns: 1fr;
}

@media (min-width: 700px) {
	.ib-index .ib-sale-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

.ib-index .ib-sale {
	background: var(--ink);
	border: 1px solid var(--ink);
	border-radius: 22px;
	overflow: hidden;
	text-decoration: none;
	display: flex;
	flex-direction: column;
}

.ib-index .ib-sale__canvas {
	position: relative;
	height: 150px;
	background: var(--sale-dark);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.ib-index .ib-sale__body {
	padding: 18px 20px 20px;
	display: flex;
	flex-direction: column;
}

.ib-index .ib-sale__row {
	display: flex;
	align-items: baseline;
	gap: 10px;
	margin-bottom: 4px;
}

.ib-index .ib-sale__name {
	font-size: 19px;
	font-weight: 600;
	letter-spacing: -0.026em;
	color: #F2F5E8;
}

.ib-index .ib-sale__price {
	display: inline-block;
	font-size: 17px;
	font-weight: 600;
	color: var(--lime);
}

.ib-index .ib-sale__meta {
	font-size: 13px;
	color: rgba(242, 245, 232, 0.6);
}

.ib-index .ib-sale__foot {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid rgba(242, 245, 232, 0.16);
}

.ib-index .ib-sale__avail {
	font-size: 12.5px;
	font-weight: 500;
	color: var(--lime);
}

/* --------------------------------------------------------------- closing */

.ib-index .ib-closing {
	display: flex;
	align-items: center;
	gap: 20px;
	flex-wrap: wrap;
	padding: 26px 0 40px;
	border-top: 2px solid var(--ink);
}

.ib-index .ib-closing__text {
	flex: 1;
	min-width: 240px;
}

.ib-index .ib-closing__t {
	font-size: 20px;
	font-weight: 600;
	letter-spacing: -0.03em;
	margin: 0 0 6px;
}

.ib-index .ib-closing__n {
	font-size: 14.5px;
	line-height: 1.6;
	color: var(--muted);
	max-width: 48ch;
	margin: 0;
	text-wrap: pretty;
}

.ib-index .ib-btn-ghost {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding-inline: 26px;
	font-size: 15px;
	font-weight: 600;
	color: var(--ink);
	background: #fff;
	border: 1px solid var(--border);
	border-radius: var(--r-pill);
	text-decoration: none;
	white-space: nowrap;
}

.ib-index .ib-btn-ghost:hover {
	border-color: var(--ink);
}

/* ------------------------------------------- category, Arab, add, discover */

.ib-index .ib-hero--sm {
	padding-block: 44px 26px;
}

.ib-index .ib-hero__h--sm {
	font-size: 40px;
	letter-spacing: -0.04em;
	line-height: 1.08;
}

.ib-index .ib-kicker {
	display: block;
	font-size: var(--fs-eyebrow);
	font-weight: 700;
	letter-spacing: var(--ls-eyebrow);
	text-transform: uppercase;
	color: var(--green-ink);
	margin-bottom: 12px;
}

.ib-index .ib-narrow {
	max-width: 560px;
	padding-block: 56px 80px;
}

.ib-index .ib-narrow--wide {
	max-width: 760px;
}

.ib-index .ib-chips {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 24px;
}

/* §8: keep country filtering visually light — outlines, not filled pills. */
.ib-index .ib-chip {
	display: inline-flex;
	align-items: center;
	min-height: var(--h-btn-sm);
	padding-inline: 16px;
	border: 1px solid var(--border);
	border-radius: var(--r-pill);
	background: transparent;
	font-size: 13.5px;
	color: var(--muted);
	text-decoration: none;
}

.ib-index .ib-chip:hover {
	border-color: var(--ink);
	color: var(--ink);
}

.ib-index .ib-chip.is-active {
	background: var(--ink);
	border-color: var(--ink);
	color: #fff;
}

.ib-index .ib-pager {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	justify-content: center;
	padding-top: 30px;
}

.ib-index .ib-pager__n {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding-inline: 12px;
	border: 1px solid var(--border);
	border-radius: 12px;
	font-size: 14px;
	font-weight: 600;
	color: var(--ink-2);
	text-decoration: none;
}

.ib-index .ib-pager__n.is-active {
	background: var(--ink);
	border-color: var(--ink);
	color: #fff;
}

.ib-index .ib-add-form {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 8px;
}

.ib-index .ib-field {
	flex: 1;
	min-width: 220px;
	height: 56px;
	padding-inline: 18px;
	border: 1px solid var(--border);
	border-radius: var(--r-field);
	background: #fff;
	font-family: inherit;
	font-size: 15.5px;
	color: var(--ink);
}

.ib-index .ib-field:focus {
	outline: none;
	border-color: var(--ink);
}

.ib-index .ib-btn-dark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 56px;
	padding-inline: 28px;
	font-size: 15.5px;
	font-weight: 600;
	font-family: inherit;
	color: #fff;
	background: var(--ink);
	border: 0;
	border-radius: var(--r-pill);
	text-decoration: none;
	cursor: pointer;
}

.ib-index .ib-hint-line {
	font-size: 13px;
	color: var(--faint);
	margin: 10px 0 0;
}

.ib-index .ib-error {
	font-size: 14px;
	color: var(--error);
	margin: 12px 0 0;
}

.ib-index .ib-note-ok {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin-top: 16px;
	padding: 14px 16px;
	background: var(--green-soft);
	border-radius: 14px;
	font-size: 14px;
	color: var(--ink-2);
}

.ib-index .ib-link {
	color: var(--green-ink);
	font-weight: 600;
	text-decoration: none;
}

.ib-index .ib-steps {
	margin-top: 40px;
	padding-top: 24px;
	border-top: 1px solid var(--border-soft);
}

.ib-index .ib-steps__t {
	display: block;
	font-size: 15px;
	font-weight: 600;
	margin-bottom: 12px;
}

.ib-index .ib-steps__list {
	margin: 0;
	padding-inline-start: 20px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	font-size: 14px;
	line-height: 1.6;
	color: var(--muted);
}

.ib-index .ib-rail__label {
	font-size: 13px;
	color: var(--faint);
	margin-inline-end: 4px;
}

.ib-index .ib-disc-result {
	display: grid;
	gap: 10px;
	grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
	margin-top: 30px;
}

.ib-index .ib-disc-none {
	margin-top: 34px;
	padding-top: 24px;
	border-top: 1px solid var(--border-soft);
}

.ib-index .ib-disc-none .ib-btn-dark {
	margin-top: 16px;
}

/* --------------------------------------------------------------- modal */

.ib-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 18px;
}

.ib-modal[hidden] {
	display: none;
}

.ib-modal__scrim {
	position: absolute;
	inset: 0;
	background: rgba(11, 59, 46, .38);
}

.ib-modal__panel {
	position: relative;
	width: 100%;
	max-width: 480px;
	max-height: 90vh;
	overflow-y: auto;
	background: #fff;
	border-radius: var(--r-card-lg);
	padding: 24px;
}

.ib-modal__head {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 6px;
}

.ib-modal__h {
	font-size: 21px;
	font-weight: 600;
	letter-spacing: -0.026em;
	margin: 0;
	flex: 1;
}

.ib-modal__x {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: 0;
	background: none;
	color: var(--muted);
	cursor: pointer;
	border-radius: var(--r-pill);
}

.ib-modal__x:hover {
	background: var(--grey-soft);
	color: var(--ink);
}

.ib-modal__note {
	font-size: 14px;
	color: var(--muted);
	margin: 0 0 14px;
}

.ib-modal__topics {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 18px;
}

.ib-modal .ib-role {
	min-height: 44px;
	padding-inline: 16px;
	border: 1px solid var(--border);
	border-radius: var(--r-pill);
	background: #fff;
	font: inherit;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--ink-2);
	cursor: pointer;
}

.ib-modal .ib-role[aria-checked='true'] {
	background: var(--ink);
	border-color: var(--ink);
	color: #fff;
}

.ib-modal .ib-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--ink-2);
	margin-bottom: 7px;
}

.ib-modal .ib-ed__textarea {
	width: 100%;
	min-height: 110px;
	padding: 14px 16px;
	border: 1px solid var(--border);
	border-radius: var(--r-field);
	font-family: inherit;
	font-size: 15px;
	line-height: 1.6;
	color: var(--ink);
	resize: vertical;
}

.ib-modal .ib-ed__textarea:focus {
	outline: none;
	border-color: var(--ink);
}

.ib-modal__foot {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	margin-top: 18px;
}

.ib-modal .ib-link {
	background: none;
	border: 0;
	font: inherit;
	font-weight: 600;
	color: var(--muted);
	cursor: pointer;
	min-height: 44px;
}
