/* fix154 - the home page product cards under the slideshow (kelola -> Website Design -> Home page product cards:
   design = "Photo cards"; only on the home page). Each card (.content-top .col-3 > .carpet#<id>, made from the news
   items of the home page) becomes: a sharp room photo on top (our own photos in images/rchome/cards/<id>.jpg for the six
   ranges; a card added later shows its own picture), the name, three lines of its text and the View All button; the
   whole card is a link (the button's ::before covers the card). Rules start at #wrapper to win over fix26's edge-to-edge
   tile rules (body[class*=rcd-deskwidth-]:not(...) .content-top .carpet, !important). Colours from the site colour scheme (--rcd-*).
   fix155 (owner: "a little bit compact ... reduce by 20% in height and width"): each card is 80% as wide as its share of
   the row (the row stays centred) and about 80% as tall (smaller photo, words, spaces and button).
   fix155b (owner: "all the six cards in one row in all the device types"): always six in a row; a card is never narrower
   than 150 px (or its full share of the row if that is less), and its words, spaces and button scale with the card's
   own width (container units), so no name is cut. Below 700 px (phones with the "optimised" layout) the row scrolls sideways. */
html body.rcd-homecard-photo {
	--rhc-ink: var(--rcd-ink, #001745); --rhc-accent: var(--rcd-accent, #2B518F); --rhc-mute: #55647c;
	--rhc-font: 'IBM Plex Sans', 'Gudea', Arial, sans-serif; --rhc-gap: 18px; --rhc-r: 12px;
	--rhc-size: .8;	/* fix155: card width = 80% of its share of the row */
}
html body.rcd-homecard-photo #wrapper .content-top {
	--rhc-share: calc((100% - 5 * var(--rhc-gap)) / 6);
	display: grid !important; grid-template-columns: repeat(6, max(calc(var(--rhc-share) * var(--rhc-size)), min(var(--rhc-share), 150px))); gap: var(--rhc-gap);
	justify-content: center;
	height: auto !important; margin: 0 !important; padding: 26px clamp(14px, 2.2vw, 32px) 30px !important; box-sizing: border-box;
	background: none !important;
}
html body.rcd-homecard-photo #wrapper .content-top::before, html body.rcd-homecard-photo #wrapper .content-top::after,
html body.rcd-homecard-photo #wrapper .content-top > style { display: none !important; content: none !important; }
html body.rcd-homecard-photo #wrapper .content-top .col-3 { width: auto !important; float: none !important; margin: 0 !important; padding: 0 !important; min-width: 0; }

/* the card */
html body.rcd-homecard-photo #wrapper .content-top .carpet {
	position: relative; display: flex !important; flex-direction: column; height: 100% !important; min-height: 0; width: auto !important;
	container-type: inline-size;	/* fix155b: the sizes inside follow the card's width (cqi) */
	margin: 0 !important; padding: 0 0 13px !important; box-sizing: border-box; overflow: hidden; isolation: isolate;
	background-color: #fff !important; background-size: 0 0 !important; background-position: -9999px -9999px !important; background-repeat: no-repeat !important;
	border: 0 !important; border-radius: var(--rhc-r) !important;
	box-shadow: 0 1px 2px rgba(0, 23, 69, .06), 0 14px 32px -20px rgba(0, 23, 69, .45) !important;
	transform: none !important; transition: transform .35s cubic-bezier(.22, .61, .36, 1), box-shadow .35s ease !important; cursor: pointer;
}
html body.rcd-homecard-photo #wrapper .content-top .carpet::after { content: none !important; display: none !important; }	/* the older hover effects' light layer */
/* the photo: the card's own picture by default (inherited, its photo part is at the bottom), our sharp photo for the six */
html body.rcd-homecard-photo #wrapper .content-top .carpet::before {
	content: ""; display: block; flex: 0 0 auto; width: 100%; aspect-ratio: 3 / 2; margin: 0 0 11px; margin-bottom: clamp(8px, 6.8cqi, 11px);
	background-image: inherit; background-size: cover; background-position: center bottom; background-repeat: no-repeat; background-color: #e9eef3;
	transition: transform .6s cubic-bezier(.22, .61, .36, 1); transform-origin: 50% 60%;
	-webkit-mask: linear-gradient(#000, #000); mask: linear-gradient(#000, #000);	/* keeps the zoom inside the photo's box */
}
html body.rcd-homecard-photo #wrapper .content-top #broadloomcarpet::before { background-image: url(../../../images/rchome/cards/broadloomcarpet.jpg); background-position: center; }
html body.rcd-homecard-photo #wrapper .content-top #tilemodularcarpet::before { background-image: url(../../../images/rchome/cards/tilemodularcarpet.jpg); background-position: center; }
html body.rcd-homecard-photo #wrapper .content-top #colarisdigitalprinted::before { background-image: url(../../../images/rchome/cards/colarisdigitalprinted.jpg); background-position: center; }
html body.rcd-homecard-photo #wrapper .content-top #printedgelrugs::before { background-image: url(../../../images/rchome/cards/printedgelrugs.jpg); background-position: center; }
html body.rcd-homecard-photo #wrapper .content-top #axminstercarpet::before { background-image: url(../../../images/rchome/cards/axminstercarpet.jpg); background-position: center; }
html body.rcd-homecard-photo #wrapper .content-top #artificialgrass::before { background-image: url(../../../images/rchome/cards/artificialgrass.jpg); background-position: center; }

/* name and text */
html body.rcd-homecard-photo #wrapper .content-top .carpet h2 {
	position: static !important; margin: 0 clamp(8px, 7.4cqi, 12px) clamp(3px, 3cqi, 5px) !important; padding: 0 !important; min-height: 0 !important; border: 0 !important;
	background: none !important; box-shadow: none !important; text-shadow: none !important;
	color: var(--rhc-ink) !important; -webkit-text-fill-color: currentColor; font: 600 13px/1.25 var(--rhc-font) !important; font-size: clamp(9.5px, 8cqi, 13px) !important;
	letter-spacing: 0 !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: none !important; text-align: left !important;
}
html body.rcd-homecard-photo #wrapper .content-top .carpet h2::before, html body.rcd-homecard-photo #wrapper .content-top .carpet h2::after { content: none !important; display: none !important; }
html body.rcd-homecard-photo #wrapper .content-top .carpet > p {
	position: static !important; opacity: 1 !important; margin: 0 clamp(8px, 7.4cqi, 12px) clamp(8px, 6.8cqi, 11px) !important; padding: 0 !important; max-height: none !important;
	color: var(--rhc-mute) !important; font: 400 11.5px/1.5 var(--rhc-font) !important; font-size: clamp(9px, 7.1cqi, 11.5px) !important; text-align: left !important;
	display: -webkit-box !important; -webkit-box-orient: vertical !important; -webkit-line-clamp: 3 !important; line-clamp: 3; overflow: hidden !important;
}
html body.rcd-homecard-photo #wrapper .content-top .carpet > p * { font: inherit !important; color: inherit !important; }

/* View All: an outlined pill with an arrow at the bottom of the card; its ::before covers the whole card (one link) */
html body.rcd-homecard-photo #wrapper .content-top .carpet .viewall {
	position: static !important; top: auto !important; bottom: auto !important; align-self: flex-start; margin: auto clamp(8px, 7.4cqi, 12px) 0 !important;
	display: inline-flex !important; align-items: center; gap: 6px; height: 28px; height: clamp(22px, 17.3cqi, 28px); padding: 0 11px 0 13px !important; box-sizing: border-box;
	border: 1px solid color-mix(in srgb, var(--rhc-accent) 45%, transparent) !important; border-radius: 999px !important;
	background: transparent !important; background-image: none !important; box-shadow: none !important; transform: none !important;
	color: var(--rhc-accent) !important; font: 600 10.5px/1 var(--rhc-font) !important; font-size: clamp(8.5px, 6.5cqi, 10.5px) !important; letter-spacing: .05em; text-transform: uppercase; text-decoration: none;
	transition: background-color .25s ease, color .25s ease, border-color .25s ease !important;
}
html body.rcd-homecard-photo #wrapper .content-top .carpet .viewall::before {
	content: "" !important; position: absolute !important; inset: 0 !important; z-index: 2; margin: 0 !important;
	background: none !important; border-radius: var(--rhc-r); width: auto !important; height: auto !important;
}
html body.rcd-homecard-photo #wrapper .content-top .carpet .viewall::after {
	content: "" !important; display: block !important; position: static !important; inset: auto !important; width: 12px !important; height: 12px !important;
	padding: 0 !important; margin: 0 !important; border: 0 !important; border-radius: 0 !important; opacity: 1 !important; filter: none !important; animation: none !important;
	background: currentColor !important; transition: transform .25s ease !important;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat !important;
	        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat !important;
}

/* mouse-over: the card lifts, the photo zooms a little, the button fills */
html body.rcd-homecard-photo #wrapper .content-top .carpet:hover {
	transform: translateY(-4px) !important; box-shadow: 0 2px 4px rgba(0, 23, 69, .06), 0 26px 44px -22px rgba(0, 23, 69, .55) !important;
}
html body.rcd-homecard-photo #wrapper .content-top .carpet:hover::before { transform: scale(1.06); }
html body.rcd-homecard-photo #wrapper .content-top .carpet:hover .viewall,
html body.rcd-homecard-photo #wrapper .content-top .carpet .viewall:focus-visible { background: var(--rhc-accent) !important; border-color: var(--rhc-accent) !important; color: #fff !important; }
html body.rcd-homecard-photo #wrapper .content-top .carpet:hover .viewall::after { transform: translateX(3px); }
html body.rcd-homecard-photo #wrapper .content-top .carpet .viewall:focus-visible { outline: 2px solid var(--rhc-accent); outline-offset: 3px; }

/* fix155b: six in a row on every screen (phones with "fit" show the 1024 px page). Very narrow pages (phones with the
   "optimised" layout): the six keep their size and the row scrolls sideways */
@media (max-width: 1199px) {
	html body.rcd-homecard-photo { --rhc-gap: 12px; }
	html body.rcd-homecard-photo #wrapper .content-top { padding-left: 14px !important; padding-right: 14px !important; }
}
@media (max-width: 699px) {
	html body.rcd-homecard-photo #wrapper .content-top {
		grid-template-columns: repeat(6, 150px); justify-content: start; overflow-x: auto; scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch; scrollbar-width: none;
	}
	html body.rcd-homecard-photo #wrapper .content-top .col-3 { scroll-snap-align: start; }
}
@media (prefers-reduced-motion: reduce) {
	html body.rcd-homecard-photo #wrapper .content-top .carpet, html body.rcd-homecard-photo #wrapper .content-top .carpet::before { transition: none !important; }
	html body.rcd-homecard-photo #wrapper .content-top .carpet:hover { transform: none !important; }
	html body.rcd-homecard-photo #wrapper .content-top .carpet:hover::before { transform: none; }
}
