/* Brookstreet "Follow Us on Instagram" section.
   Rendered by the [brookstreet_instagram] shortcode. Naming + colours follow
   the theme's bsw- BEM convention and theme.json palette variables. */

.bsw-instagram {
	/* Full width in normal flow. Never use a 100vw breakout here — 100vw
	   includes the vertical scrollbar, so it forces a horizontal scrollbar
	   on every page. The section sits at template root (and post-content
	   uses default layout), so it's already full-bleed. */
	background: #fff;
	/* Design gaps are tight (~60px above the icon, ~57px to the footer). The
	   preceding section (faq/testimonials) already owns the top gap with its
	   own bottom padding, so this section adds none on top; the bottom is the
	   section boundary to the footer. */
	padding-block: 0 57px;
	overflow: hidden;
	margin-top:25px;
}

/* Header cluster — normal block flow (not flex), so margins collapse and the
   icon sits naturally above the heading. Centered via text-align. */
.bsw-instagram__header {
	text-align: center;
	margin-block-end: 28px;
}

.bsw-instagram__header p {
	margin-top:0;
}

.bsw-instagram__icon {
	/* SVG declares width/height="100%" (no intrinsic size); aspect-ratio keeps
	   height:auto from collapsing to the 150px replaced-element default. */
	width: 107px;
	aspect-ratio: 107 / 66;
	height: auto;
	margin-block-end: 0;
}

.bsw-instagram__heading {
	font-family: var(--wp--preset--font-family--cormorant, 'Cormorant', serif);
	font-style: italic;
	font-weight: 400;
	font-size: 42px;
	line-height: 1.2;
	color: var(--wp--preset--color--taupe, #8c857b);
	margin: 0;
}

.bsw-instagram__handle {
	font-family: var(--wp--preset--font-family--cardo, 'Cardo', serif);
	font-size: 16px;
	color: var(--wp--preset--color--stone, #867b70);
	margin-block-start: 10px;
	text-decoration: underline;
	text-decoration-color: transparent;
	transition: text-decoration-color 0.2s ease;
}

a.bsw-instagram__handle:hover {
	text-decoration-color: currentColor;
}

/* Image strip — a pure-CSS marquee. The track holds the images twice and
   slides left forever; at one set-width the duplicate sits exactly where the
   original began, so the loop is seamless and only ever moves one direction. */
.bsw-instagram__strip {
	overflow: hidden;
}

.bsw-instagram__track {
	display: flex;
	width: max-content;
	animation-name: bsw-instagram-marquee;
	animation-timing-function: linear;
	animation-iteration-count: infinite;
	/* animation-duration is set inline, scaled to the number of images. */
}

/* Pause when the visitor hovers so they can look at a photo. */
.bsw-instagram__strip:hover .bsw-instagram__track {
	animation-play-state: paused;
}

.bsw-instagram__tile {
	flex: 0 0 300px;
	width: 300px;
	height: 300px;
	margin-right: 20px;
	display: block;
	overflow: hidden;
}

@keyframes bsw-instagram-marquee {
	from { transform: translateX(0); }
	to   { transform: translateX(-50%); }
}

/* Respect users who prefer no motion: show a static row. */
@media (prefers-reduced-motion: reduce) {
	.bsw-instagram__track {
		animation: none;
	}
}

.bsw-instagram__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease-in-out;
}

a.bsw-instagram__tile:hover .bsw-instagram__img {
	transform: scale(1.05);
}

@media (max-width: 767px) {
	.bsw-instagram {
		padding-block: 60px 50px;
	}

	.bsw-instagram__icon {
		width: 90px;
	}

	.bsw-instagram__heading {
		font-size: 38px;
	}
}
