/*
 * Categories index page - redesigned per owner-supplied `AR_Categories-standalone.html` (chat
 * instruction), superseding the TASK-027/TASK-031 image-box/description/CTA card below it in
 * history.
 *
 * Mobile-first and logical-direction only.
 *
 * PROVENANCE: `AR_Categories-standalone.html`, a single fixed-desktop (~1425px-derived) export
 * with no mobile screen and no CSS media queries of its own - confirmed by inspecting its
 * computed styles directly (the grid stayed a literal 4-column track regardless of test
 * width). The mobile values below (2-column grid, reduced hero type scale,
 * `--zahra-gutter-mobile--provisional` padding) are this project's own mobile-first
 * adaptation, following the same convention already used for the Brands Index redesign - not
 * part of the supplied file.
 *
 * Colors are the design's own inline hex values, mapped onto this project's existing tokens
 * rather than introduced as new one-off hex: #8E2C22 is --zahra-color-brand, #E2DBCD is
 * --zahra-color-line, #4A443A is --zahra-color-ink-2, #A79C88 (the decorative number) is
 * closest to --zahra-color-muted-2.
 *
 * TERMINOLOGY: this page keeps the project's own «التصنيفات» wording (owner decision, chat) -
 * only the visual structure below comes from the supplied design, which itself uses «الفئات».
 *
 *   desktop : hero padding 52px 60px 40px, eyebrow 12px, h1 44px/1.32, intro 16px max 640px;
 *             full-bleed 4-column grid, cards ~132px min-height, 26px/22px padding, mono
 *             decorative number, name 18px/600, brand-colored arrow
 *   mobile  : hero padding reduced, h1 scaled down (this project's own adaptation), 2-column
 *             grid, reduced card padding
 */

.zahra-categories-index__breadcrumb {
	display: flex;
	align-items: center;
	gap: 6px;
	block-size: 36px;
	padding-inline: var(--zahra-gutter-mobile--provisional);
	border-block-end: 1px solid var(--zahra-color-line);
	color: var(--zahra-color-muted);
	font-size: 11px;
	text-decoration: none;
}

.zahra-categories-index__breadcrumb a {
	color: var(--zahra-color-muted);
	text-decoration: none;
}

.zahra-categories-index__breadcrumb [aria-current="page"] {
	color: var(--zahra-color-ink);
	font-weight: 600;
}

/* ---------------------------------------------------------------------------
 * Hero
 * ------------------------------------------------------------------------- */

.zahra-categories-hero {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 28px var(--zahra-gutter-mobile--provisional) 24px;
	border-block-end: 1px solid var(--zahra-color-line);
}

.zahra-categories-hero__eyebrow {
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: .08em;
	color: var(--zahra-color-brand);
}

.zahra-categories-hero__title {
	margin: 0;
	font-size: 28px;
	font-weight: 700;
	line-height: 1.38;
}

.zahra-categories-hero__intro {
	margin: 0;
	max-inline-size: 640px;
	font-size: 14.5px;
	line-height: 2;
	color: var(--zahra-color-ink-2);
}

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

.zahra-categories-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1px;
	background: var(--zahra-color-line);
	border-block-start: 1px solid var(--zahra-color-line);
}

/*
 * Mobile is 2 columns and the real 14-term count already divides evenly, so a filler never
 * renders here. On the 4-column desktop grid it fills whatever cell(s) the last row leaves
 * empty when the term count isn't a multiple of 4, matching the real cards' own background so
 * leftover space reads as a normal cell instead of the container's hairline-gap background.
 */
.zahra-categories-grid__filler {
	display: none;
}

.zahra-categories-grid__card {
	background: var(--zahra-color-surface);
	padding: 18px 16px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 16px;
	min-block-size: 104px;
	text-decoration: none;
	color: var(--zahra-color-ink);
	transition: background .15s ease;
}

.zahra-categories-grid__card:hover,
.zahra-categories-grid__card:focus-visible {
	background: var(--zahra-color-sand-3);
}

.zahra-categories-grid__card:focus-visible {
	outline: 2px solid var(--zahra-color-brand);
	outline-offset: -2px;
}

.zahra-categories-grid__number {
	font-family: var(--zahra-font-mono);
	font-size: 11px;
	color: var(--zahra-color-muted-2);
}

.zahra-categories-grid__row {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 8px;
}

.zahra-categories-grid__name {
	font-size: 14.5px;
	font-weight: 600;
	line-height: 1.4;
}

.zahra-categories-grid__arrow {
	flex: 0 0 auto;
	color: var(--zahra-color-brand);
	font-size: 13px;
}

@media (min-width: 1024px) {

	.zahra-categories-index__breadcrumb {
		gap: 8px;
		block-size: 38px;
		padding-inline: var(--zahra-gutter);
		font-size: 11.5px;
	}

	.zahra-categories-hero {
		padding: 52px var(--zahra-gutter) 40px;
	}

	.zahra-categories-hero__title {
		font-size: 44px;
		line-height: 1.32;
		letter-spacing: -.01em;
	}

	.zahra-categories-hero__intro {
		font-size: 16px;
	}

	.zahra-categories-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.zahra-categories-grid__filler {
		display: block;
		background: var(--zahra-color-surface);
	}

	.zahra-categories-grid__card {
		padding: 26px 22px;
		min-block-size: 132px;
	}

	.zahra-categories-grid__number {
		font-size: 12px;
	}

	.zahra-categories-grid__name {
		font-size: 18px;
	}

	.zahra-categories-grid__arrow {
		font-size: 14px;
	}
}
