/* Rawnaq category content blocks: intro, subcategories, expanded content, FAQs */

/* Colours, fonts and corners come from the theme, so the blocks match the rest of the site. */
.rqcc {
	--rqcc-brand: var(--wd-primary-color, #a38868);
	--rqcc-brand-2: var(--wd-link-color-hover, #242424);
	--rqcc-tint: rgba(0, 0, 0, .05);
	--rqcc-text: var(--wd-text-color, #767676);
	--rqcc-title: var(--wd-title-color, #242424);
	--rqcc-muted: var(--wd-text-color, #767676);
	--rqcc-line: var(--brdcolor-gray-300, rgba(0, 0, 0, .105));
	--rqcc-surface: transparent;
	--rqcc-radius: var(--wd-brd-radius, 0);
	color: var(--rqcc-text);
	text-align: start;
}

body.dark-mode-active .rqcc {
	--rqcc-brand-2: #fff;
	--rqcc-tint: rgba(255, 255, 255, .08);
	--rqcc-text: rgba(255, 255, 255, .8);
	--rqcc-title: #fff;
	--rqcc-muted: rgba(255, 255, 255, .6);
	--rqcc-line: rgba(255, 255, 255, .15);
}

.rqcc a {
	color: var(--rqcc-brand);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.rqcc a:hover,
.rqcc a:focus-visible {
	color: var(--rqcc-brand-2);
}

/* The toggles are real checkboxes: the collapsed text stays in the HTML and is hidden with CSS only. */
.rqcc-toggle {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
	opacity: 0;
}

.rqcc-more-btn {
	display: inline-flex;
	align-items: center;
	min-height: 32px;
	margin: 0;
	color: var(--rqcc-brand);
	font-size: 14px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.rqcc-more-btn:hover {
	color: var(--rqcc-brand-2);
}

.rqcc-toggle:focus-visible ~ .rqcc-more-btn {
	outline: 2px solid var(--rqcc-brand);
	outline-offset: 3px;
	border-radius: 3px;
}

.rqcc-more-btn__close,
.rqcc-toggle:checked ~ .rqcc-more-btn .rqcc-more-btn__open {
	display: none;
}

.rqcc-toggle:checked ~ .rqcc-more-btn .rqcc-more-btn__close {
	display: inline;
}

/* ---------------------------------------------------------- Breadcrumbs */

/* Full-width band above the sidebar and the products, whatever its place in the page grid. */
.rqcc-top {
	grid-column: 1 / -1;
	order: -1;
	min-width: 0;
}

/* Full-width band below the sidebar and the products. */
.rqcc-bottom {
	grid-column: 1 / -1;
	order: 1;
	min-width: 0;
}

.rqcc-bottom > :first-child {
	margin-top: 0;
}

.rqcc-top > :last-child {
	margin-bottom: 0;
}

.rqcc-breadcrumbs {
	margin: 0 0 10px;
}

/* The breadcrumbs now sit above the H1, so the copy in the sorting bar is not shown. */
.rqcc-active .shop-loop-head .wd-breadcrumbs {
	display: none;
}

/* ---------------------------------------------------------------- 1 Intro */

.rqcc-intro {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	margin: 0 0 18px;
}

.rqcc-intro__text {
	max-width: 900px;
	margin: 0;
	font-size: 15px;
	line-height: 1.7;
}

.rqcc-intro .rqcc-intro__text > :last-child {
	margin-bottom: 0;
}

.rqcc-intro .rqcc-more-btn {
	display: none;
}

/* ------------------------------------------------------- 2 Subcategories */

.rqcc-subcats {
	margin: 0 0 22px;
}

.rqcc-subcats__title {
	margin: 0 0 12px;
	font-size: 18px;
	line-height: 1.3;
}

.rqcc-subcats__list {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.rqcc-subcat {
	position: relative;
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr);
	grid-template-rows: auto auto;
	column-gap: 12px;
	align-content: center;
	align-items: center;
	min-height: 88px;
	margin: 0;
	padding: 12px;
	padding-inline-end: 32px;
	background: var(--rqcc-surface);
	border: 1px solid var(--rqcc-line);
	border-radius: var(--rqcc-radius);
	transition: border-color .2s ease, background-color .2s ease;
}

.rqcc-subcat:hover,
.rqcc-subcat:focus-within {
	background: var(--rqcc-tint);
	border-color: var(--rqcc-brand);
}

.rqcc-subcat__link {
	display: contents;
}

.rqcc .rqcc-subcat__link,
.rqcc .rqcc-subcat__link:hover {
	color: var(--rqcc-title);
	text-decoration: none;
}

/* The whole card is the tap target. */
.rqcc-subcat__link::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: var(--rqcc-radius);
}

.rqcc-subcat__link:focus-visible::after {
	outline: 2px solid var(--rqcc-brand);
	outline-offset: 2px;
}

.rqcc-subcat__img {
	grid-row: 1 / span 2;
	display: block;
	width: 64px;
	height: 64px;
	max-width: none;
	border-radius: 50%;
	object-fit: cover;
	background: var(--rqcc-tint);
}

.rqcc-subcat__img--empty {
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--rqcc-brand);
	font-size: 24px;
	font-weight: 700;
}

.rqcc-subcat__name {
	align-self: end;
	overflow: hidden;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	text-overflow: ellipsis;
}

/* Arrow at the far edge of the card, so long names never push it onto its own line. */
.rqcc-subcat::before {
	content: "\203A";
	position: absolute;
	top: 50%;
	inset-inline-end: 14px;
	color: var(--rqcc-brand);
	font-size: 18px;
	line-height: 1;
	transform: translateY(-50%);
}

.rqcc-subcat__count {
	align-self: start;
	color: var(--rqcc-muted);
	font-size: 13px;
	line-height: 1.4;
}

/* ---------------------------------------------------- 3 Expanded content */

.rqcc-more,
.rqcc-faq {
	clear: both;
	margin: 40px 0 0;
	padding-top: 32px;
	border-top: 1px solid var(--rqcc-line);
}

.rqcc-more {
	position: relative;
}

.rqcc-more__content {
	position: relative;
	max-height: 220px;
	overflow: hidden;
	/* Fades the collapsed text on any page background. */
	-webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 72px), transparent);
	mask-image: linear-gradient(to bottom, #000 calc(100% - 72px), transparent);
	font-size: 15px;
	line-height: 1.8;
}

.rqcc-toggle:checked ~ .rqcc-more__content {
	max-height: none;
	-webkit-mask-image: none;
	mask-image: none;
}

.rqcc-more .rqcc-more-btn {
	margin-top: 10px;
}

.rqcc-more__content h2 {
	margin: 0 0 12px;
	font-size: 22px;
	line-height: 1.35;
}

.rqcc-more__content h3 {
	margin: 24px 0 10px;
	font-size: 17px;
	line-height: 1.4;
}

.rqcc-more__content p,
.rqcc-more__content ul,
.rqcc-more__content ol {
	margin: 0 0 14px;
}

.rqcc-more__content ul,
.rqcc-more__content ol {
	padding-inline-start: 22px;
}

.rqcc-more__content ul {
	list-style: disc;
}

.rqcc-more__content li {
	margin-bottom: 6px;
}

/* Tables scroll sideways inside their frame on small screens. */
.rqcc-table {
	margin: 0 0 16px;
	overflow-x: auto;
	border: 1px solid var(--rqcc-line);
	border-radius: var(--rqcc-radius);
	-webkit-overflow-scrolling: touch;
}

.rqcc-table table {
	width: 100%;
	min-width: 480px;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	font-size: 14px;
}

.rqcc-table th,
.rqcc-table td {
	padding: 10px 14px;
	border: 0;
	border-bottom: 1px solid var(--rqcc-line);
	text-align: start;
	vertical-align: top;
}

.rqcc-table th {
	background: var(--rqcc-tint);
	color: var(--rqcc-title);
	font-weight: 700;
	text-transform: none;
	white-space: nowrap;
}

.rqcc-table tr:last-child td {
	border-bottom: 0;
}

/* ---------------------------------------------------------------- 4 FAQs */

.rqcc-faq__title {
	margin: 0 0 16px;
	font-size: 22px;
	line-height: 1.35;
}

.rqcc-faq__item {
	border-bottom: 1px solid var(--rqcc-line);
}

.rqcc-faq__item:first-of-type {
	border-top: 1px solid var(--rqcc-line);
}

.rqcc-faq__q {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 52px;
	padding: 12px 0;
	color: var(--rqcc-title);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.5;
	list-style: none;
	cursor: pointer;
}

.rqcc-faq__q::-webkit-details-marker {
	display: none;
}

.rqcc-faq__q::after {
	content: "+";
	flex: 0 0 28px;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--rqcc-tint);
	color: var(--rqcc-brand);
	font-size: 20px;
	font-weight: 400;
	line-height: 28px;
	text-align: center;
}

.rqcc-faq__item[open] > .rqcc-faq__q {
	color: var(--rqcc-brand);
}

.rqcc-faq__item[open] > .rqcc-faq__q::after {
	content: "\2212";
}

.rqcc-faq__q:focus-visible {
	outline: 2px solid var(--rqcc-brand);
	outline-offset: 2px;
	border-radius: 4px;
}

.rqcc-faq__a {
	max-width: 820px;
	padding: 0 0 16px;
	font-size: 15px;
	line-height: 1.8;
}

.rqcc-faq__a > :last-child {
	margin-bottom: 0;
}

/* ---------------------------------------------------------------- Mobile */

@media (max-width: 1024px) {
	/* Compact cards in one row; on phones the row becomes a swipeable strip of three and a half cards. */
	.rqcc-subcats__list {
		display: flex;
		gap: 8px;
		margin-inline: -15px;
		padding-inline: 15px;
		overflow-x: auto;
		scroll-padding-inline: 15px;
		scroll-snap-type: x proximity;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}

	.rqcc-subcats__list::-webkit-scrollbar {
		display: none;
	}

	.rqcc-subcat {
		display: flex;
		flex: 1 0 calc((100% - 24px) / 4);
		flex-direction: column;
		align-items: center;
		justify-content: flex-start;
		gap: 4px;
		min-width: 0;
		min-height: 0;
		padding: 10px 6px 8px;
		text-align: center;
		scroll-snap-align: start;
	}

	.rqcc-subcat__link {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 6px;
		max-width: 100%;
	}

	.rqcc-subcat__img {
		width: 56px;
		height: 56px;
	}

	.rqcc-subcat__name {
		max-width: 100%;
		font-size: 13px;
	}

	.rqcc-subcat::before {
		content: none;
	}

	.rqcc-subcat__count {
		font-size: 12px;
	}
}

@media (max-width: 768px) {
	.rqcc-intro {
		margin-bottom: 14px;
	}

	.rqcc-intro__text {
		font-size: 14px;
		line-height: 1.7;
	}

	/* Two lines, then "Read more" expands the rest in place. */
	.rqcc-intro .rqcc-toggle:not(:checked) ~ .rqcc-intro__text > :first-child {
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		line-clamp: 2;
		max-height: 3.4em;
		margin-bottom: 0;
		overflow: hidden;
	}

	.rqcc-toggle:not(:checked) ~ .rqcc-intro__text > :not(:first-child) {
		display: none;
	}

	.rqcc-intro .rqcc-more-btn {
		display: inline-flex;
	}

	.rqcc-subcats {
		margin-bottom: 16px;
	}

	.rqcc-subcats__title {
		margin-bottom: 10px;
		font-size: 16px;
	}

	.rqcc-subcat {
		flex-basis: calc((100% - 24px) / 3.5);
		min-width: 92px;
	}

	.rqcc-more,
	.rqcc-faq {
		margin-top: 28px;
		padding-top: 24px;
	}

	.rqcc-more__content {
		max-height: 260px;
		font-size: 14px;
	}

	.rqcc-more__content h2,
	.rqcc-faq__title {
		font-size: 19px;
	}

	.rqcc-more__content h3 {
		font-size: 16px;
	}

	.rqcc-faq__q {
		font-size: 15px;
	}

	.rqcc-faq__a {
		font-size: 14px;
	}
}
