/* Al-Mashreq Catalog
   Brand-led, Arabic-first. See .impeccable.md for the design context.

   Colour comes from the fruit: warm neutrals carry the page, orange and lime
   appear only as accents. Every offset uses logical properties, so the Arabic
   (RTL) and English (LTR) renderings come from one stylesheet. */

/* Tokens live on :root, not on a body class.
   Themes are free to replace the body class list entirely — this one does —
   and every border and colour here is a custom property, so scoping them to a
   class the theme might drop makes the whole design silently evaluate to
   nothing. Every name is --msq- prefixed, so :root is safe. */
/* Sizes are written in px on purpose. A theme is free to set its own root
   font size — Agrios sets html { font-size: 10px } — and every rem in this
   file would then render at 62.5% of the intended size, shrinking the type,
   the spacing and the images all at once. px is the only unit here that
   means the same thing under every theme. */

:root {
	/* Brand, taken from the logo mark. */
	--msq-orange: #f29100;
	--msq-lime: #d0d516;
	--msq-accent: var(--msq-orange);

	/* Neutrals tinted toward the brand hue — never pure black or white. */
	--msq-ink: #2b2418;
	--msq-ink-soft: #6f6655;
	--msq-ground: #fdfbf7;
	--msq-surface: #fffefb;
	--msq-line: #e9e2d6;

	--msq-radius: 14px;
	--msq-gap: clamp(16px, 1.6vw, 28px);
	--msq-cols-lg: 3;

	/* Everything in the catalogue scales from this. Arabic needs a little more
	   size than Latin at the same nominal value to read comfortably. */
	--msq-base: 17px;

	/* Exposed in Catalog → Settings so the look can be tuned without CSS. */
	--msq-border-w: 1px;
	--msq-card-ratio: 4 / 3;
	--msq-title-scale: 1.24;
}

.msq-catalog,
.msq-single,
.msq-archive {
	color: var(--msq-ink);
	font-size: var(--msq-base);
}

.msq-wrap {
	max-width: 1180px;
	margin-inline: auto;
	padding-inline: clamp(16px, 4vw, 32px);
}

/* Breadcrumb ------------------------------------------------------------- */

.msq-breadcrumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 7.2px;
	margin-block: clamp(16px, 3vw, 32px) 14.4px;
	font-size: .88em;
	color: var(--msq-ink-soft);
}

.msq-breadcrumb a {
	color: inherit;
	text-decoration: none;
	border-block-end: 1px solid transparent;
	transition: color .2s ease, border-color .2s ease;
}

.msq-breadcrumb a:hover {
	color: var(--msq-accent);
	border-block-end-color: currentColor;
}

.msq-breadcrumb__sep {
	opacity: .4;
}

.msq-breadcrumb [aria-current] {
	color: var(--msq-ink);
	font-weight: 600;
}

/* Single ----------------------------------------------------------------- */

.msq-single__title {
	margin-block: 0 9.6px;
	font-size: clamp(30.4px, 4.4vw, 48px);
	line-height: 1.12;
	letter-spacing: -.01em;
}

/* The lead sits on its own measure. Long Arabic lines are hard to track, so
   it is capped well short of the container. */
.msq-single__description {
	max-width: 62ch;
	margin-block-end: clamp(28px, 4vw, 44px);
	font-size: 1.08em;
	line-height: 1.85;
	color: var(--msq-ink-soft);
}

.msq-single__description p:last-child {
	margin-block-end: 0;
}

.msq-single__layout {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
	gap: clamp(24px, 3.5vw, 48px);
	align-items: start;
	margin-block-end: clamp(40px, 6vw, 64px);
}

.msq-single__image {
	width: 100%;
	height: auto;
	display: block;
	border-radius: var(--msq-radius);
	/* Cut-out produce on a transparent ground: cap the height so a tall source
	   file does not push the specifications off the first screen. */
	max-height: 480px;
	object-fit: contain;
	object-position: center;
}

/* No specifications to sit beside — a category, not a product. */
.msq-single__layout--solo {
	grid-template-columns: minmax(0, 1fr);
}

.msq-single__layout--solo .msq-single__media {
	max-width: 512px;
}

.msq-single__layout--solo .msq-single__image {
	max-height: 352px;
}

/* Specification summary --------------------------------------------------
   Hairlines instead of a bordered, striped box: the data carries itself and
   the rules only need to separate rows. */

.msq-summary {
	margin: 0;
	border: 0;
	border-block-start: 2px solid var(--msq-ink);
	/* Long specification values do not need the full column width to read. */
	max-width: 672px;
}

.msq-summary__row {
	display: grid;
	grid-template-columns: minmax(96px, 240px) 1fr;
	gap: 20px;
	padding-block: 12.48px;
	border-block-end: 1px solid var(--msq-line);
}

.msq-summary dt,
.msq-summary dd {
	margin: 0;
}

.msq-summary dt {
	font-size: .85em;
	font-weight: 600;
	letter-spacing: .03em;
	color: var(--msq-ink-soft);
	align-self: center;
}

.msq-summary dd {
	font-size: 1em;
	font-weight: 600;
	line-height: 1.6;
	/* Latin figures inside Arabic values keep their own direction. */
	unicode-bidi: isolate;
}

/* Tables -----------------------------------------------------------------
   The reason the page exists, so they get real attention: tabular figures so
   columns of sizes align, and per-cell bidi isolation so Latin numerals sit
   correctly inside Arabic rows. */

.msq-table-block {
	margin-block-end: clamp(32px, 4vw, 48px);
}

.msq-table-block__title {
	display: inline-block;
	margin-block: 0 16px;
	padding: 0 0 7.2px;
	border: 0;
	border-block-end: 3px solid var(--msq-lime);
	font-size: 1.18em;
	font-weight: 700;
	color: var(--msq-ink);
}

.msq-table-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
}

.msq-data-table {
	width: 100%;
	border: 0;
	border-collapse: collapse;
	background: none;
	font-size: 1em;
	font-variant-numeric: tabular-nums;
}

.msq-data-table th,
.msq-data-table td {
	border: 0;
	background: none;
	padding: 11.52px 14.4px;
	text-align: start;
	vertical-align: top;
	unicode-bidi: isolate;
}

.msq-data-table thead th {
	font-size: .85em;
	font-weight: 700;
	letter-spacing: .03em;
	color: var(--msq-ink);
	white-space: nowrap;
	background: color-mix(in srgb, var(--msq-lime) 18%, transparent);
	border-block-end: 2px solid var(--msq-lime);
}

.msq-data-table tbody tr + tr th,
.msq-data-table tbody tr + tr td {
	border-block-start: 1px solid var(--msq-line);
}

.msq-data-table tbody tr:hover td,
.msq-data-table tbody tr:hover th {
	background: color-mix(in srgb, var(--msq-orange) 6%, transparent);
}

/* Label/value tables: the label column reads as a quiet heading. */
.msq-data-table--kv th {
	width: 38%;
	font-weight: 600;
	color: var(--msq-ink-soft);
}

.msq-data-table--kv td {
	font-weight: 600;
}

/* Cards ------------------------------------------------------------------
   Layout follows the trade-catalogue pattern: photograph, then a panel
   carrying the name and the few figures a buyer scans, then one action.
   The colours and type are this catalogue's own. */

.msq-cards {
	/* Derived, never set inline, so the breakpoints below can override it. */
	--msq-cols: var(--msq-cols-lg, 3);
	display: grid;
	grid-template-columns: repeat(var(--msq-cols), minmax(0, 1fr));
	gap: var(--msq-gap);
	list-style: none;
	margin: 0;
	padding: 0;
}

.msq-card {
	margin: 0;
}

.msq-card__inner {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	border: var(--msq-border-w) solid var(--msq-line);
	border-radius: var(--msq-radius);
	background: var(--msq-surface);
	transition: border-color .25s ease, box-shadow .25s ease;
}

.msq-card__inner:hover,
.msq-card__inner:focus-within {
	border-color: color-mix(in srgb, var(--msq-accent) 40%, var(--msq-line));
	box-shadow: 0 6px 18px rgba(31, 26, 17, .07);
}

.msq-card__media {
	display: block;
	position: relative;
	/* A warm wash, because the produce photography is cut out on a
	   transparent or white ground and needs something to sit on. */
	background: radial-gradient(120% 90% at 50% 12%, #fffefa 0%, #faf5ea 60%, #f3ecdd 100%);
}

.msq-card__media img {
	width: 100%;
	aspect-ratio: var(--msq-card-ratio);
	object-fit: contain;
	display: block;
	padding: clamp(9.6px, 1.6vw, 17.6px);
	mix-blend-mode: multiply;
	transition: transform .7s cubic-bezier(.22, .61, .36, 1);
}

.msq-card__placeholder {
	display: block;
	aspect-ratio: var(--msq-card-ratio);
}

.msq-card__inner:hover .msq-card__media img {
	transform: scale(1.025);
}

/* Category tag over the photograph. */
.msq-card__pill {
	position: absolute;
	inset-block-start: 11.2px;
	inset-inline-start: 11.2px;
	padding: 3.2px 9.6px;
	border-radius: 100px;
	background: rgba(31, 26, 17, .78);
	color: #fff;
	font-size: .8em;
	font-weight: 700;
	letter-spacing: .03em;
	line-height: 1.7;
}

.msq-card__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	gap: 8.8px;
	padding: 16.8px 17.6px 17.6px;
}

.msq-card__title {
	margin: 0;
	font-size: calc(var(--msq-title-scale) * 1em);
	font-weight: 700;
	line-height: 1.4;
}

.msq-card__title a {
	color: var(--msq-ink);
	text-decoration: none;
}

.msq-card__title a:hover {
	color: var(--msq-orange);
}

.msq-card__variety {
	margin: -4px 0 0;
	font-size: .95em;
	color: var(--msq-ink-soft);
}

/* Label/value rows, aligned so the values form a column. */
.msq-card__specs {
	margin: 2.4px 0 0;
	display: grid;
	gap: 6.4px;
}

.msq-card__spec {
	display: grid;
	grid-template-columns: minmax(72px, 32%) 1fr;
	gap: 9.6px;
	align-items: start;
	font-size: .95em;
	line-height: 1.6;
}

.msq-card__spec dt {
	margin: 0;
	color: var(--msq-ink-soft);
	font-weight: 600;
}

.msq-card__spec dd {
	margin: 0;
	color: var(--msq-ink);
	unicode-bidi: isolate;
}

.msq-card__draft {
	align-self: flex-start;
	padding: 1.6px 7.2px;
	border-radius: 3px;
	background: var(--msq-lime);
	color: var(--msq-ink);
	font-size: .8em;
	font-weight: 700;
}

/* One action per card, quiet until hovered. */
.msq-card__cta {
	margin-block-start: auto;
	padding: 9.6px 16px;
	border: var(--msq-border-w) solid var(--msq-line);
	border-radius: calc(var(--msq-radius) - 6px);
	background: none;
	color: var(--msq-ink);
	font-size: 1em;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
	transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

.msq-card__cta:hover,
.msq-card__cta:focus-visible {
	background: var(--msq-orange);
	border-color: var(--msq-orange);
	color: #fff;
}

.msq-card__title a:focus-visible,
.msq-card__cta:focus-visible {
	outline: 3px solid var(--msq-orange);
	outline-offset: 3px;
}

/* Gallery ---------------------------------------------------------------- */

.msq-gallery-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
	gap: 8px;
	list-style: none;
	margin: 12px 0 0;
	padding: 0;
}

.msq-gallery-grid img {
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	display: block;
	border-radius: calc(var(--msq-radius) - 6px);
	transition: opacity .2s ease;
}

.msq-gallery-grid a:hover img {
	opacity: .82;
}

/* Section headings ------------------------------------------------------- */

.msq-section-title {
	margin-block: 0 clamp(16px, 2.5vw, 24px);
	font-size: clamp(20px, 2.2vw, 25.6px);
	font-weight: 700;
}

.msq-single__children {
	margin-block-end: clamp(40px, 6vw, 64px);
}

/* Archive ---------------------------------------------------------------- */

.msq-archive__title {
	margin-block: clamp(16px, 3vw, 32px) clamp(24px, 4vw, 40px);
	font-size: clamp(32px, 5vw, 52px);
	line-height: 1.1;
	letter-spacing: -.01em;
}

.msq-archive__section {
	margin-block-end: clamp(40px, 6vw, 72px);
}

.msq-archive__section-title {
	margin-block: 0 clamp(14.4px, 2vw, 20px);
	font-size: clamp(20px, 2.4vw, 28px);
}

.msq-archive__section-title a {
	color: inherit;
	text-decoration: none;
	border-block-end: 2px solid transparent;
	transition: border-color .2s ease;
}

.msq-archive__section-title a:hover {
	border-block-end-color: var(--msq-orange);
}

.msq-empty {
	color: var(--msq-ink-soft);
}

/* Arabic needs more leading than Latin at the same size. */
.msq-lang-ar .msq-single__description,
.msq-lang-ar .msq-data-table,
.msq-lang-ar .msq-summary dd {
	line-height: 1.95;
}

/* Responsive ------------------------------------------------------------- */

@media (max-width: 1000px) {
	.msq-cards {
		--msq-cols: min(2, var(--msq-cols-lg, 3));
	}

	.msq-single__layout {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 560px) {
	.msq-cards {
		--msq-cols: 1;
	}

	.msq-summary__row {
		grid-template-columns: minmax(0, 1fr);
		gap: 3.2px;
	}

	.msq-card__media img,
	.msq-card__placeholder {
		aspect-ratio: 16 / 10;
	}
}

@media (prefers-reduced-motion: reduce) {
	.msq-card__media img,
	.msq-card__link::after,
	.msq-breadcrumb a,
	.msq-gallery-grid img {
		transition: none;
	}

	.msq-card__link:hover .msq-card__media img {
		transform: none;
	}
}

/* Theme reset -------------------------------------------------------------
   The catalogue renders inside whatever theme is active, and themes style bare
   elements — tables, lists, headings — with borders and backgrounds of their
   own. These resets are scoped to the catalogue so the design above survives
   without resorting to !important. */

.msq-data-table tbody tr,
.msq-data-table thead tr {
	border: 0;
	background: none;
}

.msq-data-table tbody tr:nth-child(odd) th,
.msq-data-table tbody tr:nth-child(odd) td {
	background: none;
}

.msq-summary,
.msq-summary__row,
.msq-summary dt,
.msq-summary dd {
	background: none;
}

.msq-cards,
.msq-gallery-grid {
	list-style: none;
}

.msq-cards li::before,
.msq-gallery-grid li::before {
	content: none;
}

/* No per-column caps here: they left the image and the specifications sitting
   at opposite edges of the layout with a gutter between them. The grid sets the
   proportions, and .msq-summary caps its own measure. */
.msq-single__media img {
	width: 100%;
}

/* Archive filter tabs ----------------------------------------------------- */

.msq-archive__header {
	margin-block-end: clamp(20px, 3vw, 32px);
}

.msq-archive__count {
	margin: 6.4px 0 0;
	font-size: .95em;
	color: var(--msq-ink-soft);
}

.msq-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 24px;
	margin-block-end: clamp(24px, 3vw, 36px);
	border-block-end: 1px solid var(--msq-line);
}

.msq-tabs .msq-tab {
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	text-transform: none;
	letter-spacing: normal;
	min-height: 0;
	width: auto;
	padding: 9.6px 0 12px;
	margin: 0 0 -1px;
	border-block-end: 2px solid transparent;
	color: var(--msq-ink-soft);
	font: inherit;
	font-size: 1.05em;
	font-weight: 600;
	line-height: 1.4;
	cursor: pointer;
	transition: color .2s ease, border-color .2s ease;
}

.msq-tabs .msq-tab:hover,
.msq-tabs .msq-tab:focus {
	background: none;
	box-shadow: none;
	color: var(--msq-ink);
}

.msq-tabs .msq-tab.is-active {
	background: none;
}

.msq-tab.is-active {
	color: var(--msq-ink);
	border-block-end-color: var(--msq-orange);
}

.msq-tab:focus-visible {
	outline: 3px solid var(--msq-orange);
	outline-offset: 2px;
}

.msq-archive__empty {
	padding-block: 32px;
	color: var(--msq-ink-soft);
}

/* Without JavaScript every card simply stays visible. */
.msq-card[hidden] {
	display: none;
}

/* Enquiry action on the product page. */
.msq-single__cta {
	display: inline-block;
	margin-block-start: 24px;
	padding: 12.8px 28px;
	border: 1px solid var(--msq-orange);
	border-radius: calc(var(--msq-radius) - 6px);
	background: var(--msq-orange);
	color: #fff;
	font-size: 1em;
	font-weight: 700;
	text-decoration: none;
	transition: background-color .2s ease, border-color .2s ease;
}

.msq-single__cta:hover,
.msq-single__cta:focus-visible {
	background: color-mix(in srgb, var(--msq-orange) 85%, #000);
	border-color: color-mix(in srgb, var(--msq-orange) 85%, #000);
	color: #fff;
}

.msq-single__cta:focus-visible {
	outline: 3px solid var(--msq-ink);
	outline-offset: 3px;
}
