/*
 * Full-bleed technique: the theme's content column is boxed in by Kadence's
 * container width, so a plain 100% width section still sits inside that
 * padding. Setting width: 100vw and pulling back with a negative margin equal
 * to half the viewport minus half the (boxed) parent width re-centers the
 * section on the viewport itself, ignoring the parent's box entirely.
 */
.hero.full-bleed {
	position: relative;
	width: 100vw;
	margin-left: calc(-50vw + 50%);
	height: 80vh;
	min-height: 500px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.hero__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	/*
	 * The ring/lily subject sits at roughly 65-80% across the photo's width,
	 * not centered. On desktop the hero's aspect ratio is close enough to the
	 * source image's (~2.2:1) that little gets cropped either way. On narrow
	 * mobile viewports the crop is much more aggressive, so object-position
	 * shifts further right below to keep the subject in frame instead of
	 * cropping into the empty black side of the photo.
	 */
	object-position: 65% center;
}

@media (max-width: 767px) {
	.hero__image {
		object-position: 78% center;
	}
}

.hero__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.55) 100%);
}

.hero__content {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1.5rem;
	max-width: 700px;
	padding: 2rem;
	text-align: center;
}

.hero__content h1 {
	margin: 0;
	color: var(--hartwell-white);
}

/*
 * Inverted from the theme's default black/white button pair (not a new
 * color) so the CTA reads against the dark overlay instead of disappearing
 * into it. `.hero__content` (class) + `.wp-block-button__link` (class) is
 * (0,2,0), which already beats hartwell-colors.css's `body .wp-block-button__link`
 * (0,1,1) on specificity alone. The `:visited` variant matters too — see the
 * long comment in hartwell-colors.css on why Kadence's `:visited` button rule
 * needs its own override and can't be caught by testing computed styles.
 */
.hero__content .wp-block-button__link,
.hero__content .wp-block-button__link:visited {
	background-color: var(--hartwell-white);
	color: var(--hartwell-black);
	border-color: var(--hartwell-white);
}

.hero__content .wp-block-button__link:hover {
	background-color: var(--hartwell-black);
	color: var(--hartwell-white);
	border-color: var(--hartwell-white);
}

/*
 * Populære kolleksjoner
 * Unlike the hero, this section stays inside the theme's normal boxed width —
 * `.content-container.site-container` is the same class pair single.php uses
 * to wrap ordinary page content, so the section lines up with the rest of
 * the site instead of introducing a second, one-off container width.
 */
.collections {
	padding: 3rem 0;
}

.collections__heading {
	margin: 0 0 1.5rem;
	font-size: 1.75rem;
	text-align: left;
}

/*
 * Mobile-first 2-column grid (the explicit 2x2 requirement); 1024px is where
 * it steps up to 4 across. Nothing was specified for the 768-1023px tablet
 * range, so it just keeps the 2-column layout up to the 1024px breakpoint.
 */
.collections__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}

@media (min-width: 1024px) {
	.collections__grid {
		grid-template-columns: repeat(4, 1fr);
		gap: 1.5rem;
	}
}

.collection-card {
	position: relative;
	display: block;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	text-decoration: none;
}

.collection-card__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/*
 * Only the bottom portion darkens (unlike the hero's full-image overlay) —
 * these photos are the main content here, the gradient just has to carve out
 * enough contrast for the label sitting on top of it.
 */
.collection-card__overlay {
	position: absolute;
	inset: auto 0 0 0;
	height: 45%;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.6) 100%);
	pointer-events: none;
}

.collection-card__label {
	position: absolute;
	left: 1rem;
	right: 1rem;
	bottom: 1rem;
	z-index: 1;
	color: var(--hartwell-white);
}

/*
 * Dette sier våre kunder
 * `.content-container.site-container` is the same boxed wrapper the
 * collections section above uses.
 */
.testimonials {
	padding: 3rem 0;
	background-color: var(--hartwell-testimonials-bg);
}

.testimonials__heading {
	margin: 0 0 2rem;
	font-size: 1.75rem;
	text-align: center;
}

/*
 * Mobile-first horizontal swipe carousel — one review at a time, with a peek
 * of its neighbors, same idea as a product image gallery. `scroll-snap-align:
 * center` needs room to actually center the first/last cards, hence the
 * left/right padding roughly matching half the leftover width outside each
 * 82%-wide card. No JS is needed for the swipe itself — scroll-snap is native
 * browser behavior; the JS (hartwell-frontpage.js) only syncs the dots.
 * At 1024px this reverts to the unchanged 4-column grid.
 */
.testimonials__grid {
	display: flex;
	gap: 1rem;
	margin: 0 0 1rem;
	padding: 0 9%;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.testimonials__grid::-webkit-scrollbar {
	display: none;
}

.testimonial {
	flex: 0 0 82%;
	scroll-snap-align: center;
	text-align: center;
}

@media (min-width: 1024px) {
	.testimonials__grid {
		display: grid;
		grid-template-columns: repeat(4, 1fr);
		gap: 2rem;
		margin: 0 0 2.5rem;
		padding: 0;
		overflow-x: visible;
		scroll-snap-type: none;
	}

	.testimonial {
		flex: initial;
	}
}

/*
 * Dot indicators — mobile only, hidden once the carousel becomes a static
 * grid at 1024px. Each dot is a generous 32px touch target with a small
 * visual circle centered inside it via ::before, rather than making the
 * whole 32px area visibly filled.
 */
.testimonials__dots {
	display: flex;
	justify-content: center;
	margin: 0 0 2rem;
}

@media (min-width: 1024px) {
	.testimonials__dots {
		display: none;
	}
}

.testimonials__dot {
	position: relative;
	width: 32px;
	height: 32px;
	padding: 0;
	border: none;
	background: transparent;
	cursor: pointer;
}

.testimonials__dot::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background-color: var(--hartwell-product-backdrop);
	transform: translate(-50%, -50%);
}

.testimonials__dot.is-active::before {
	background-color: var(--hartwell-black);
}

.testimonial__rating {
	margin: 0 0 0.75rem;
	color: var(--hartwell-gold);
	font-size: 1.125rem;
	letter-spacing: 0.15em;
}

.testimonial__quote {
	margin: 0 0 1rem;
	line-height: 1.5;
}

.testimonial__quote::before {
	content: "\201C";
}

.testimonial__quote::after {
	content: "\201D";
}

.testimonial__author {
	margin: 0;
	font-weight: 700;
}

.testimonials__cta {
	display: flex;
	justify-content: center;
}

/*
 * Explicit override rather than relying on hartwell-colors.css's base
 * `body .wp-block-button__link` rule to win the cascade unaided — same
 * belt-and-suspenders approach as `.hero__content .wp-block-button__link`
 * above, scoped to (0,2,0) so it isn't left to depend on load order. The
 * `:visited` variant is the one that actually mattered in practice: this
 * link's `href="#"` resolves to the current page's own URL, which the
 * browser already counts as visited, triggering Kadence's competing
 * `:visited` button rule — see the long comment in hartwell-colors.css.
 */
.testimonials__cta .wp-block-button__link,
.testimonials__cta .wp-block-button__link:visited {
	background-color: var(--hartwell-black);
	color: var(--hartwell-white);
	border-color: var(--hartwell-black);
}

.testimonials__cta .wp-block-button__link:hover {
	background-color: var(--hartwell-white);
	color: var(--hartwell-black);
	border-color: var(--hartwell-black);
}
