/*
 * New homepage (site redesign). Loaded on the front page only, by front-page.php.
 *
 * The page's own look is written on the elements in home.php, exactly as in
 * Eoghan's design. This file holds only what cannot be written there:
 *   1. making the theme's page container full width;
 *   2. stopping the theme's general styles leaking into the page;
 *   3. the reviews carousel;
 *   4. opening and closing the questions.
 */

/* ---------- 1. Full width, straight under the menu ---------- */

body.dl-home #content.site-content {
	padding-top: 0;
	padding-bottom: 0;
}

body.dl-home .site-content .col-full {
	max-width: none;
	padding: 0;
}

body.dl-home .site-content .archive-header {
	display: none;
}

/* ---------- 2. Keep the theme's general styles out ---------- */

.dlh {
	clear: both;
	font-size: 16px;
	line-height: normal;
	text-align: left;
}

.dlh *,
.dlh *::before,
.dlh *::after {
	box-sizing: border-box;
}

.dlh h1,
.dlh h2,
.dlh h3,
.dlh p,
.dlh span,
.dlh a,
.dlh button {
	font-family: inherit;
	text-transform: none;
}

.dlh h1,
.dlh h2,
.dlh h3 {
	padding: 0;
}

.dlh h1::before,
.dlh h1::after,
.dlh h2::before,
.dlh h2::after,
.dlh h3::before,
.dlh h3::after {
	content: none;
}

.dlh img {
	max-width: 100%;
	border-radius: 0;
}

.dlh a {
	color: #0D7A54;
	box-shadow: none;
}

.dlh a:hover {
	color: #0A5F41;
}

/*
 * The theme removes the underline from every link. In the design, a text link
 * with no underline setting of its own is underlined ("Read the buying guide",
 * the links under the questions), so that is put back here.
 */
.dlh a:not([style*="text-decoration"]) {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.dlh button:hover,
.dlh button:focus {
	box-shadow: none;
}

.dlh a:focus-visible,
.dlh button:focus-visible,
.dlh .rv-track:focus-visible {
	outline: 2px solid #16191D;
	outline-offset: 3px;
}

/* ---------- 3. Reviews carousel ---------- */

.dlh .rv-row {
	display: flex;
	align-items: stretch;
	gap: 20px;
	flex-wrap: wrap;
}

.dlh .rv-row > .rv-summary {
	flex: 0 0 300px;
}

/* The moving row, with an arrow on each side, level with the middle of the cards. */
.dlh .rv-view {
	flex: 1 1 480px;
	min-width: 0;
	position: relative;
	padding: 0 64px;
}

.dlh .rv-track {
	display: flex;
	gap: 20px;
	height: 100%;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.dlh .rv-track::-webkit-scrollbar {
	display: none;
}

.dlh .rv-card {
	flex: 0 0 calc((100% - 20px) / 2);
	scroll-snap-align: start;
}

/* Long reviews stop after seven lines, so every card is the same height. */
.dlh .rv-text {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 7;
	overflow: hidden;
}

.dlh .rv-arrow {
	position: absolute;
	top: 50%;
	z-index: 2;
	width: 44px;
	height: 44px;
	min-height: 0;
	margin: -22px 0 0;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #FFFFFF;
	border: 1px solid #E6E8EC;
	border-radius: 50%;
	box-shadow: 0 10px 28px rgba(22, 30, 50, 0.14);
	color: #16191D;
	cursor: pointer;
}

.dlh .rv-arrow:hover,
.dlh .rv-arrow:focus {
	background: #FFFFFF;
	border-color: #16191D;
	color: #16191D;
	box-shadow: 0 10px 28px rgba(22, 30, 50, 0.14);
}

.dlh .rv-arrow:disabled {
	opacity: 0.35;
	box-shadow: none;
	cursor: default;
}

.dlh .rv-prev {
	left: 0;
}

.dlh .rv-next {
	right: 0;
}

/* Position dots, centred under the moving cards. The current one is longer. */
.dlh .rv-dots {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	padding-top: 4px;
	padding-left: 320px;
}

.dlh .rv-dots button {
	width: 8px;
	height: 8px;
	min-height: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: #C5CBD6;
	cursor: pointer;
	transition: width 0.2s ease;
}

.dlh .rv-dots button[aria-current="true"] {
	width: 24px;
	background: #16191D;
}

@media (max-width: 820px) {
	.dlh .rv-row > .rv-summary {
		flex: 1 1 100%;
	}

	.dlh .rv-view {
		padding: 0;
	}

	.dlh .rv-card {
		flex-basis: 100%;
	}

	/* Phones swipe the row, so the arrows are not shown. */
	.dlh .rv-arrow {
		display: none;
	}

	.dlh .rv-dots {
		padding-left: 0;
	}
}

/* ---------- 4. Phones ---------- */

/*
 * The values here are the ones from Eoghan's phone design ("Homepage on a
 * phone", 390 wide). The page's desktop look is written on the elements
 * themselves, so each phone value needs "!important" to take over from it.
 */
@media (max-width: 640px) {
	/* Hero: one column, full-width buttons, picture underneath. */
	.dlh .dlh-hero-in {
		flex-direction: column !important;
		flex-wrap: nowrap !important;
		align-items: stretch !important;
		gap: 30px !important;
		padding: 30px 20px 74px !important;
	}

	.dlh .dlh-hero-text,
	.dlh .dlh-hero-art {
		flex: 0 0 auto !important;
		max-width: none !important;
	}

	.dlh .dlh-pill {
		padding: 7px 14px 7px 9px !important;
		font-size: 13px !important;
	}

	.dlh .dlh-h1 {
		margin-top: 16px !important;
		font-size: 34px !important;
		line-height: 1.1 !important;
	}

	.dlh .dlh-lead {
		margin-top: 14px !important;
		max-width: none !important;
		font-size: 17px !important;
	}

	.dlh .dlh-hero-btns {
		align-self: stretch;
		flex-direction: column !important;
		flex-wrap: nowrap !important;
		gap: 10px !important;
		margin-top: 24px !important;
	}

	.dlh .dlh-hero-btn {
		display: flex !important;
		min-height: 54px !important;
		padding: 0 16px !important;
	}

	.dlh .dlh-hero-frame {
		padding: 26px 30px 46px !important;
		border-radius: 14px !important;
		box-shadow: 0 16px 36px rgba(22, 30, 50, 0.10) !important;
	}

	.dlh .dlh-chip {
		left: 14px !important;
		bottom: -20px !important;
		gap: 12px !important;
		padding: 10px 16px 10px 14px !important;
	}

	.dlh .dlh-chip-num {
		font-size: 25px !important;
	}

	.dlh .dlh-chip-label {
		font-size: 12.5px !important;
	}

	/* The four tiles: two by two, icon above the words. */
	.dlh .dlh-trust {
		margin-top: -40px !important;
		padding: 0 20px !important;
	}

	.dlh .dlh-trust-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		font-size: 14px !important;
	}

	.dlh .dlh-trust-tile {
		flex-direction: column !important;
		gap: 8px !important;
		padding: 16px 8px !important;
		text-align: center;
	}

	.dlh .dlh-trust-tile:nth-child(odd) {
		border-left: 0 !important;
	}

	.dlh .dlh-trust-tile:nth-child(n+3) {
		border-top: 1px solid #EEF0F3;
	}

	.dlh .dlh-trust-ico {
		width: 38px !important;
		height: 38px !important;
	}

	/* Section headings. */
	.dlh .dlh-h2 {
		font-size: 26px !important;
	}

	.dlh .dlh-h2-help {
		font-size: 24px !important;
	}

	/* Find your next laptop. */
	.dlh .dlh-find {
		gap: 10px !important;
		padding: 44px 20px 48px !important;
	}

	.dlh .dlh-find-p {
		font-size: 16px !important;
		line-height: 1.55 !important;
	}

	.dlh .dlh-prices {
		gap: 0 12px !important;
		margin-top: 6px;
		font-size: 14px !important;
	}

	.dlh .dlh-prices-label {
		flex: 0 0 100%;
		text-align: center;
	}

	.dlh .dlh-prices-link {
		padding: 12px 0 !important;
		white-space: nowrap;
	}

	/* Laptop cards: one per row, picture on the left, details on the right. */
	.dlh .dlh-cards {
		display: flex !important;
		flex-direction: column;
		gap: 12px !important;
		margin-top: 4px !important;
	}

	.dlh .dlh-card {
		display: grid !important;
		grid-template-columns: 128px minmax(0, 1fr);
		grid-template-rows: auto 1fr;
	}

	.dlh .dlh-card-top {
		grid-column: 1;
		grid-row: 1;
		padding: 10px 10px 0 !important;
	}

	.dlh .dlh-card-save {
		padding: 5px 8px !important;
		font-size: 12px !important;
	}

	.dlh .dlh-card-img {
		grid-column: 1;
		grid-row: 2;
		height: auto !important;
		padding: 6px 10px 10px !important;
	}

	.dlh .dlh-card-img img {
		height: 88px !important;
	}

	.dlh .dlh-card-body {
		grid-column: 2;
		grid-row: 1 / span 2;
		gap: 7px !important;
		padding: 12px 14px !important;
		border-top: 0 !important;
		border-left: 1px solid #EFF1F3;
	}

	.dlh .dlh-card-screen {
		font-size: 12.5px !important;
	}

	.dlh .dlh-card-name {
		font-size: 16px !important;
	}

	.dlh .dlh-card-chips {
		font-size: 12px !important;
	}

	.dlh .dlh-card-chip {
		padding: 4px 9px !important;
	}

	.dlh .dlh-card-foot {
		flex-wrap: nowrap !important;
		gap: 8px !important;
		padding-top: 4px !important;
	}

	.dlh .dlh-card-price {
		font-size: 22px !important;
	}

	.dlh .dlh-card-was {
		font-size: 14px !important;
	}

	.dlh .dlh-card-view {
		font-size: 13.5px !important;
		white-space: nowrap;
	}

	.dlh .dlh-viewall {
		align-self: stretch;
		display: flex !important;
		min-height: 52px !important;
		margin-top: 10px !important;
	}

	/* Deal of the week. */
	.dlh .dlh-deal-in {
		padding: 40px 20px !important;
	}

	.dlh .dlh-deal-p {
		font-size: 16px !important;
	}

	.dlh .dlh-deal-price {
		font-size: 42px !important;
	}

	/* What to expect from refurbished. */
	.dlh .dlh-refurb {
		padding: 46px 20px !important;
	}

	.dlh .dlh-refurb-p {
		font-size: 16px !important;
		text-wrap: balance;
	}

	/* Reviews. */
	.dlh .dlh-reviews-in {
		padding: 44px 20px !important;
	}

	.dlh .dlh-rv-sum,
	.dlh .rv-card {
		padding: 22px !important;
	}

	/* Help box and the Toughbook picture. */
	.dlh #dlh-help {
		padding: 44px 20px 0 !important;
	}

	.dlh .dlh-help-box {
		padding: 24px 22px !important;
	}

	.dlh .dlh-help-p {
		font-size: 16px !important;
	}

	.dlh .dlh-toughbook {
		flex: 1 1 100% !important;
	}

	/* Questions. */
	.dlh .dlh-faq-sec {
		padding: 46px 20px !important;
	}

	.dlh .dlh-faq-q {
		font-size: 16.5px !important;
	}

	.dlh .dlh-faq-a {
		padding: 0 26px 20px 4px !important;
	}

	/* Brand logos: three across, smaller. */
	.dlh .dlh-brands-in {
		padding: 36px 20px 40px !important;
	}

	.dlh .dlh-brands-row {
		display: grid !important;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		align-items: center;
		justify-items: center;
		gap: 26px 20px !important;
	}

	.dlh .dlh-brands-row img[alt="Dell"] { height: 26px !important; }
	.dlh .dlh-brands-row img[alt="Lenovo"] { height: 29px !important; }
	.dlh .dlh-brands-row img[alt="HP"] { height: 31px !important; }
	.dlh .dlh-brands-row img[alt="Panasonic"] { height: 15px !important; }
	.dlh .dlh-brands-row img[alt="Apple"] { height: 31px !important; }
	.dlh .dlh-brands-row img[alt="Microsoft"] { height: 19px !important; }
}

/* ---------- 5. Questions ---------- */

.dlh .dlh-faq-q:hover,
.dlh .dlh-faq-q:focus {
	background: transparent;
	color: #2B3037;
}

.dlh .dlh-faq-chev {
	flex: 0 0 auto;
	transition: transform 0.2s ease;
}

.dlh .dlh-faq-q[aria-expanded="true"] .dlh-faq-chev {
	transform: rotate(180deg);
}

.dlh .dlh-faq-a[hidden] {
	display: none !important;
}
