/*
 * Furniture pages (migration order 7), moving to the design system. Each furniture page's content is
 * inside .furniturePage (default.php and frontpage.php add it when $this->isFurniturePage; the
 * furniture layouts always).
 *
 * Loaded on every main-site page, like account.css. Unlayered, so these rules win over everything in
 * the legacy layer, including legacy rules on IDs: keep selectors scoped to .furniturePage and set
 * only the properties that need to change. Colours are changed in default.css (and the furniture
 * pages' own legacy CSS) in place, so the legacy cascade between their rules is unchanged.
 */

/* Keyboard focus. Legacy CSS removes the outline from fields and from everything in the sliders. */
.furniturePage :focus-visible {
	outline: var(--focus-ring);
	outline-offset: var(--focus-ring-offset);
}

/* Links in text are underlined, as in the style guide (.ds-link): steel is too close to the text
   colour for colour alone to show them */
.furniturePage :is(p, li, span, label) a:not(.button):not(:where(.productContainer .title, .productContainer .bookTitle) a) {
	text-decoration: underline;
}

/* Sentence case and the page's font: legacy CSS puts every button in capitals, and browsers give
   <button>s their own font */
.furniturePage button,
.furniturePage .button,
.furniturePage input[type="submit"] {
	text-transform: none;
	font-family: inherit;
}

/* Controls that were links without an href, now buttons: no button look of their own */
.furniturePage .furnitureImages .slider .image,
.furniturePage .slider > .prev,
.furniturePage .slider > .next,
.furniturePage .sortOrderLabel,
.furniturePage #addToWishlist {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	cursor: pointer;
}

/* The thumbnails were inline links around their image: as buttons (inline-block) they'd add a line's
   gap under it */
.furniturePage .furnitureImages .slider .image {
	display: block;
}

/* Legacy CSS gives every <button> a margin (not the sliders' arrows: they centre with margin: auto) */
.furniturePage .furnitureImages .slider .image,
.furniturePage #addToWishlist {
	margin: 0;
}

.furniturePage .furnitureImages .slider .image img {
	display: block;
}

/* Inline, as the link was, so it keeps to the right of the product's box */
.furniturePage #addToWishlist {
	display: inline-block;
	color: var(--color-section-purple);
}

/* Buttons that look like links: the basket's Delete, Move to wishlist and Download basket (they were
   links without an href). 24px tall, as Delete and Move to wishlist sit close together (WCAG 2.5.8). */
.furniturePage .furniturePlainButton {
	display: inline-block;
	min-height: 24px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--color-primary);
	font: inherit;
	cursor: pointer;
}

.furniturePage .furniturePlainButton:hover {
	color: var(--color-primary-hover);
	text-decoration: underline;
}

/* Back is hidden on the first step with opacity and pointer-events (view.html.twig and its script):
   take it out of the Tab order and away from screen readers too */
.furniturePage .back[style*="opacity:0"],
.furniturePage .back[style*="opacity: 0"] {
	visibility: hidden;
}

/* Product options: the swatches and popular colours are toggle buttons (they were links without an
   href). No button colour behind them: a swatch's own colour or picture is its inline style, which
   wins over this. Their size, shape and borders stay with their legacy rules. */
.furniturePage :is(#configurations, #favouriteConfigurations) button.option {
	padding: 0;
	background-color: transparent;
	cursor: pointer;
}

.furniturePage #configurations button.option {
	margin: 0;
}

/* The lists' headers open and close them (role="button") */
.furniturePage #configurations .list > .label[role="button"] {
	cursor: pointer;
}

/* The product image lightbox (after the footer, so outside .furniturePage): Previous and Next were links.
   Navy in both themes: they sit on the lightbox's white panel, which stays white in dark (the text colour
   there was near-white on white). */
#lightbox[role="dialog"] .controls > button {
	min-width: 24px;
	min-height: 24px;
	padding: 4px 8px;
	border: 0;
	background: none;
	color: var(--peters-navy);
	font-size: inherit;
	cursor: pointer;
}

#lightbox[role="dialog"] :focus-visible,
#viewConfigurationModel[role="dialog"] :focus-visible {
	outline: var(--focus-ring);
	outline-offset: var(--focus-ring-offset);
}

/* Search results' wishlist heart: the "add" one shows only on hover, so on keyboard focus too */
.furniturePage .wishlistButton:focus-visible {
	opacity: 1;
}

/* Case studies' tiles: the summary (the tile's link) shows on keyboard focus as on hover */
.furniturePage .caseStudySet .caseStudyItem:focus-within .caseStudyHoveroverText {
	opacity: 1;
}

.furniturePage .caseStudySet .caseStudyItem:focus-within .caseStudyText {
	opacity: 0;
}

/* The sliders' Previous and Next took the link colour as links; Slick disables them at either end */
.furniturePage .slider > .prev,
.furniturePage .slider > .next {
	min-width: 24px;
	color: var(--color-primary);
}

.furniturePage .slider > .slick-disabled {
	color: var(--color-text-muted);
	opacity: .5;
	cursor: default;
}
