/* =========================================================================
   MarocBeauté Instagram — front-end styles
   -------------------------------------------------------------------------
   Written against the child theme's design tokens (--wd-*) with literal
   fallbacks, so the subsystem inherits the store's colours and type where the
   theme is present and still renders correctly if a token is ever renamed.

   Everything here is logical-property based (inline-start / inline-end), so
   the Arabic route and the two LTR routes come out of one set of rules with
   nothing mirrored by hand.
   ====================================================================== */

/* -------------------------------------------------------------------------
   GRID
   -------------------------------------------------------------------------
   The brief's column counts: 2 on mobile, 3 on tablet, 4 on desktop.
   ------------------------------------------------------------------------ */
.mbig-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 768px) {
	.mbig-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
}

@media (min-width: 992px) {
	.mbig-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
}

/* the horizontal variant used in the pre-footer and on About */
@media (max-width: 767px) {
	.mbig-grid--snap {
		display: flex;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}

	.mbig-grid--snap::-webkit-scrollbar { display: none; }

	.mbig-grid--snap > .mbig-card {
		flex: 0 0 62%;
		max-width: 62%;
		scroll-snap-align: start;
	}
}

/* -------------------------------------------------------------------------
   CARD
   -------------------------------------------------------------------------
   ONE link per card. The whole face is the link, so there is a single tab
   stop and a single accessible name per item rather than an image link and a
   title link that go to the same place.
   ------------------------------------------------------------------------ */
.mbig-card {
	min-width: 0;
	background: var(--wd-bg, #fff);
	border: 1px solid var(--wd-line, #E9E9E9);
}

.mbig-card__link {
	display: grid;
	grid-template-rows: auto auto;
	height: 100%;
	color: inherit;
	text-decoration: none;
}

.mbig-card__link:focus-visible {
	outline: 2px solid var(--wd-accent-dk, #915A3C);
	outline-offset: 2px;
}

.mbig-card__media {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: var(--wd-alt, #F7F6F4);
}

/*
 * `cover` here, not `contain`. An Instagram grid is a grid of equal tiles and
 * that is what a visitor expects to scan; a poster frame cropped slightly is
 * normal, unlike a product photograph where cropping loses information — which
 * is why the product gallery uses `contain` and this does not.
 */
.mbig-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease;
}

@media (hover: hover) {
	.mbig-card__link:hover .mbig-card__img { transform: scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
	.mbig-card__img { transition: none; }
	.mbig-card__link:hover .mbig-card__img { transform: none; }
}

/* the play mark: this is a POSTER, and the card says so */
.mbig-card__play {
	position: absolute;
	inset-block-end: 10px;
	inset-inline-end: 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: var(--wd-head, #333);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.mbig-card__body {
	display: block;
	padding: 12px 14px 14px;
}

.mbig-card__title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-family: var(--wd-font-head, inherit);
	font-size: 14px;
	line-height: 1.4;
	color: var(--wd-head, #333);
}

.mbig-card__kind {
	display: block;
	margin-top: 4px;
	font-size: 11px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--wd-soft, #6B6B6B);
}

/* -------------------------------------------------------------------------
   RAIL
   ------------------------------------------------------------------------ */
.mbig-rail { margin-block: clamp(32px, 5vw, 64px); }

.mbig-rail__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px 20px;
	margin-bottom: 18px;
}

.mbig-rail__title {
	margin: 0;
	font-family: var(--wd-font-head, inherit);
	font-size: clamp(18px, 2vw, 24px);
	line-height: 1.25;
	color: var(--wd-head, #333);
}

.mbig-rail__more {
	font-size: 13px;
	color: var(--wd-accent-dk, #915A3C);
	text-decoration: underline;
}

.mbig-rail__more:focus-visible {
	outline: 2px solid var(--wd-accent-dk, #915A3C);
	outline-offset: 3px;
}

/* the pre-footer rail sits inside the site's own container */
.mbig-rail--prefooter,
.mbig-rail--home {
	max-width: var(--wd-max, 1214px);
	margin-inline: auto;
	padding-inline: var(--wd-gutter, 20px);
}

/* the sidebar column is one card wide */
.mbig-rail--sidebar .mbig-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/*
 * The blog sidebar duplicates the pre-footer rail on a phone, where the
 * sidebar drops below the article and the two end up one above the other.
 * Hidden on small screens for that reason, not to save space.
 */
@media (max-width: 991px) {
	.mbig-rail--sidebar { display: none; }
}

/* -------------------------------------------------------------------------
   HUB
   ------------------------------------------------------------------------ */
.mbig-hub__wrap,
.mbig-single__wrap {
	max-width: var(--wd-max, 1214px);
	margin-inline: auto;
	padding-inline: var(--wd-gutter, 20px);
	padding-block: clamp(24px, 4vw, 48px);
}

.mbig-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 10px;
	margin-bottom: 24px;
}

.mbig-filters__item {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 6px 16px;
	border: 1px solid var(--wd-line, #E9E9E9);
	background: var(--wd-bg, #fff);
	color: var(--wd-text, #616161);
	font-size: 13px;
	text-decoration: none;
}

.mbig-filters__item.is-on {
	background: var(--wd-accent-dk, #915A3C);
	border-color: var(--wd-accent-dk, #915A3C);
	color: #fff;
}

.mbig-filters__item:focus-visible {
	outline: 2px solid var(--wd-accent-dk, #915A3C);
	outline-offset: 2px;
}

.mbig-empty {
	padding: 40px 0;
	color: var(--wd-soft, #6B6B6B);
}

.mbig-pagination { margin-top: 32px; }

/* -------------------------------------------------------------------------
   DETAIL
   -------------------------------------------------------------------------
   A reading column, capped, with the media allowed to be wider than the text.
   ------------------------------------------------------------------------ */
.mbig-detail {
	max-width: 760px;
	margin-inline: auto;
}

.mbig-detail__title {
	margin: 0 0 20px;
	font-family: var(--wd-font-head, inherit);
	font-size: clamp(22px, 3vw, 32px);
	line-height: 1.22;
	color: var(--wd-head, #333);
}

.mbig-detail__media { margin-bottom: 22px; }

.mbig-detail__img {
	display: block;
	width: 100%;
	height: auto;
	background: var(--wd-alt, #F7F6F4);
}

/*
 * Video keeps its REAL aspect ratio, taken from the archive and written into
 * a custom property by the template. A tall portrait reel is capped at 80vh so
 * it cannot fill a laptop screen top to bottom.
 */
.mbig-video {
	margin: 0;
	background: #000;
}

.mbig-video__el {
	display: block;
	width: 100%;
	height: auto;
	max-height: 80vh;
	aspect-ratio: var(--mbig-ar, 16 / 9);
	object-fit: contain;
	background: #000;
}

.mbig-source {
	margin-bottom: 26px;
	padding-block: 12px;
	border-block: 1px solid var(--wd-line, #E9E9E9);
	font-size: 13px;
	color: var(--wd-soft, #6B6B6B);
}

.mbig-source p { margin: 4px 0; }

.mbig-source__link a {
	color: var(--wd-accent-dk, #915A3C);
	text-decoration: underline;
}

/*
 * THE TWO TEXT BLOCKS.
 *
 * They are given different treatments on purpose. The original caption is a
 * quotation with a rule down its inline-start edge; the store's own text is
 * plain running prose. A reader should be able to tell whose words they are
 * reading without having to read the label.
 */
.mbig-original,
.mbig-editorial { margin-bottom: 28px; }

.mbig-original__label,
.mbig-editorial__label,
.mbig-detail__label {
	margin: 0 0 10px;
	font-family: var(--wd-font-head, inherit);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wd-soft, #6B6B6B);
}

.mbig-original__text {
	margin: 0;
	padding-inline-start: 18px;
	border-inline-start: 3px solid var(--wd-line, #E9E9E9);
	color: var(--wd-text, #616161);
	font-size: 16px;
	line-height: 1.75;
}

.mbig-editorial__text {
	color: var(--wd-text, #616161);
	font-size: 16px;
	line-height: 1.8;
}

.mbig-original__text p:last-child,
.mbig-editorial__text p:last-child { margin-bottom: 0; }

/* -------------------------------------------------------------------------
   RELATED PRODUCTS on a detail page
   -------------------------------------------------------------------------
   NO add-to-cart here. A card links to the product page, where the real
   commerce controls and the real Product schema live.
   ------------------------------------------------------------------------ */
.mbig-detail__products,
.mbig-detail__article { margin-bottom: 30px; }

.mbig-products {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
}

@media (min-width: 768px) {
	.mbig-products { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.mbig-product {
	display: grid;
	gap: 8px;
	padding: 10px;
	border: 1px solid var(--wd-line, #E9E9E9);
	color: inherit;
	text-decoration: none;
}

.mbig-product:focus-visible {
	outline: 2px solid var(--wd-accent-dk, #915A3C);
	outline-offset: 2px;
}

.mbig-product__media {
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #fff;
}

.mbig-product__img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.mbig-product__name {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 13px;
	line-height: 1.4;
	color: var(--wd-head, #333);
}

.mbig-product__price {
	font-size: 13px;
	font-weight: 700;
	color: var(--wd-head, #333);
}

.mbig-article {
	display: grid;
	gap: 4px;
	padding: 16px 18px;
	border: 1px solid var(--wd-line, #E9E9E9);
	background: var(--wd-alt, #F7F6F4);
	color: inherit;
	text-decoration: none;
}

.mbig-article:focus-visible {
	outline: 2px solid var(--wd-accent-dk, #915A3C);
	outline-offset: 2px;
}

.mbig-article__k {
	font-size: 11px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wd-soft, #6B6B6B);
}

.mbig-article__t {
	font-family: var(--wd-font-head, inherit);
	font-size: 16px;
	line-height: 1.35;
	color: var(--wd-head, #333);
}
