/**
 * HSCMD Social Feeds — front-end styles.
 * Palette and fonts taken from the Divi-HSCMD child theme so the feeds read
 * as part of the site rather than as embedded widgets.
 */

.hscmd-social {
	--hscmd-pink: #E5469A;
	--hscmd-pink-dark: #C42876;
	--hscmd-pink-pale: #FCEEF4;
	--hscmd-green: #508227;
	--hscmd-ink: #090C0D;
	--hscmd-body: #3D4547;
	--hscmd-muted: #7C8486;
	--hscmd-line: #EAE6E7;
	--hscmd-ig-cols: 4;

	font-family: "Asap", Helvetica, Arial, sans-serif;
	color: var(--hscmd-body);
}

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

.hscmd-social-title {
	margin: 0 0 18px !important;
	padding: 0 !important;
	font-family: "Asap Condensed", "Asap", Helvetica, Arial, sans-serif;
	font-weight: 700;
	font-size: 27px;
	line-height: 1.15;
	color: var(--hscmd-pink-dark);
}

.hscmd-sr {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap; border: 0;
}

.hscmd-social-adminhint {
	margin: 0 !important;
	padding: 14px 16px !important;
	border-left: 4px solid var(--hscmd-pink, #E5469A);
	background: #FFF8FB;
	font-family: "Asap", Helvetica, Arial, sans-serif;
	font-size: 14px;
	color: #6B4457;
}

/* ---------- Facebook ---------------------------------------------------- */

.hscmd-fb-list {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 20px;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.hscmd-fb-item {
	display: flex;
	flex-direction: column;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
	background: #fff;
	border: 1px solid var(--hscmd-line);
	border-radius: 15px;
	overflow: hidden;
	transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.hscmd-fb-item:hover {
	border-color: #F3B7D3;
	box-shadow: 0 12px 28px -14px rgba(9, 12, 13, .3);
	transform: translateY(-2px);
}

.hscmd-fb-media {
	display: block;
	aspect-ratio: 16 / 9;
	background: var(--hscmd-pink-pale);
	overflow: hidden;
	line-height: 0;
}
.hscmd-fb-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .35s ease;
}
.hscmd-fb-item:hover .hscmd-fb-media img { transform: scale(1.04); }

.hscmd-fb-body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1 1 auto;
	padding: 16px 18px 18px;
}

.hscmd-fb-date {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .07em;
	text-transform: uppercase;
	color: var(--hscmd-muted);
}

.hscmd-fb-text {
	margin: 0 !important;
	padding: 0 !important;
	font-size: 14.5px;
	line-height: 1.55;
	color: var(--hscmd-body);
}

.hscmd-fb-more {
	margin-top: auto;
	font-family: "Cabin", Helvetica, Arial, sans-serif;
	font-weight: 700;
	font-size: 14.5px;
	color: var(--hscmd-pink-dark) !important;
	text-decoration: none !important;
}
.hscmd-fb-more::after {
	content: " \2192";
	display: inline-block;
	transition: transform .15s ease;
}
.hscmd-fb-more:hover { color: var(--hscmd-pink) !important; }
.hscmd-fb-more:hover::after { transform: translateX(3px); }
.hscmd-fb-more:focus-visible { outline: 3px solid var(--hscmd-green); outline-offset: 3px; }

/* ---------- Instagram --------------------------------------------------- */

.hscmd-ig-grid {
	display: grid;
	grid-template-columns: repeat(var(--hscmd-ig-cols), minmax(0, 1fr));
	gap: 10px;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.hscmd-ig-item {
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.hscmd-ig-link {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	border-radius: 12px;
	overflow: hidden;
	background: var(--hscmd-pink-pale);
	text-decoration: none !important;
	line-height: 0;
}
.hscmd-ig-link img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .4s ease;
}
.hscmd-ig-link:hover img,
.hscmd-ig-link:focus-visible img { transform: scale(1.06); }
.hscmd-ig-link:focus-visible { outline: 3px solid var(--hscmd-green); outline-offset: 3px; }

.hscmd-ig-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-end;
	padding: 12px;
	background: linear-gradient(to top, rgba(9, 12, 13, .82) 0%, rgba(9, 12, 13, .25) 45%, rgba(9, 12, 13, 0) 75%);
	opacity: 0;
	transition: opacity .2s ease;
}
.hscmd-ig-link:hover .hscmd-ig-overlay,
.hscmd-ig-link:focus-visible .hscmd-ig-overlay { opacity: 1; }

.hscmd-ig-caption {
	font-family: "Asap", Helvetica, Arial, sans-serif;
	font-size: 12.5px;
	line-height: 1.4;
	color: #fff;
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.hscmd-ig-badge {
	position: absolute;
	top: 9px; right: 9px;
	width: 24px; height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(9, 12, 13, .55);
	pointer-events: none;
}
.hscmd-ig-badge svg {
	width: 13px; height: 13px;
	fill: #fff;
	stroke: #fff;
	stroke-width: 0;
}
.hscmd-ig-badge svg rect { fill: none; stroke: #fff; stroke-width: 2; }

.hscmd-ig-follow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 18px;
	padding: 11px 22px;
	border: 2px solid var(--hscmd-pink);
	border-radius: 60px;
	font-family: "Cabin", Helvetica, Arial, sans-serif;
	font-weight: 700;
	font-size: 15px;
	color: var(--hscmd-pink-dark) !important;
	text-decoration: none !important;
	transition: background .15s ease, color .15s ease;
}
.hscmd-ig-follow:hover {
	background: var(--hscmd-pink);
	color: #fff !important;
}
.hscmd-ig-follow:focus-visible { outline: 3px solid var(--hscmd-green); outline-offset: 3px; }
.hscmd-ig-follow svg {
	width: 17px; height: 17px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
}

/* ---------- Responsive -------------------------------------------------- */

/* Breakpoints match the Divi-HSCMD theme (980 / 767) so the feeds change shape
   on the same edges as the rest of the page.

   The ranges are mutually exclusive — min-and-max paired. Overlapping ranges
   were the original bug here: a wider band had to undo a narrower band's
   rules and lost the specificity fight. Exactly one block is ever live now,
   so nothing needs undoing. */

/* ============ phone and tablet portrait: up to 767px ============ */
@media (max-width: 767px) {
	/* One per row for both networks. A single column makes every row complete
	   by definition, so no partial-row trimming is needed here — every item
	   is shown. */
	.hscmd-fb-list { grid-template-columns: minmax(0, 1fr); gap: 16px; }
	.hscmd-fb-item { grid-column: auto; }

	.hscmd-ig-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }

	.hscmd-social-title { font-size: 23px; }
	.hscmd-fb-more { padding: 6px 0; }
	.hscmd-ig-follow { display: flex; width: 100%; justify-content: center; text-align: center; font-size: 14.5px; }
}

/* ============ tablet landscape: 768-980px ============ */
@media (min-width: 768px) and (max-width: 980px) {
	/* two cards per row; a lone last card widens to fill the row */
	.hscmd-fb-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.hscmd-fb-item { grid-column: auto; }
	.hscmd-fb-list > li:last-child:nth-child(odd) { grid-column: span 2; }

	.hscmd-ig-grid { grid-template-columns: repeat(min(var(--hscmd-ig-cols), 3), minmax(0, 1fr)); }

	.hscmd-ig--cols-2 .hscmd-ig-grid > li:nth-child(2n+1):nth-child(n+3):nth-last-child(-n+1),
	.hscmd-ig--cols-2 .hscmd-ig-grid > li:nth-child(2n+1):nth-child(n+3):nth-last-child(-n+1) ~ li { display: none; }
	.hscmd-ig--cols-3 .hscmd-ig-grid > li:nth-child(3n+1):nth-child(n+4):nth-last-child(-n+2),
	.hscmd-ig--cols-3 .hscmd-ig-grid > li:nth-child(3n+1):nth-child(n+4):nth-last-child(-n+2) ~ li { display: none; }
	.hscmd-ig--cols-4 .hscmd-ig-grid > li:nth-child(3n+1):nth-child(n+4):nth-last-child(-n+2),
	.hscmd-ig--cols-4 .hscmd-ig-grid > li:nth-child(3n+1):nth-child(n+4):nth-last-child(-n+2) ~ li { display: none; }
	.hscmd-ig--cols-5 .hscmd-ig-grid > li:nth-child(3n+1):nth-child(n+4):nth-last-child(-n+2),
	.hscmd-ig--cols-5 .hscmd-ig-grid > li:nth-child(3n+1):nth-child(n+4):nth-last-child(-n+2) ~ li { display: none; }
	.hscmd-ig--cols-6 .hscmd-ig-grid > li:nth-child(3n+1):nth-child(n+4):nth-last-child(-n+2),
	.hscmd-ig--cols-6 .hscmd-ig-grid > li:nth-child(3n+1):nth-child(n+4):nth-last-child(-n+2) ~ li { display: none; }

}

/* ============ desktop: 981px and up ============ */
@media (min-width: 981px) {
	/* Six tracks with each card spanning two gives three per row, while letting
	   an orphan span the leftover tracks instead of leaving a hole. Facebook
	   posts are never hidden to tidy a row — that would drop real content. */
	.hscmd-fb-list { grid-template-columns: repeat(6, minmax(0, 1fr)); }
	.hscmd-fb-item { grid-column: span 2; }
	.hscmd-fb-list > li:last-child:nth-child(3n+1) { grid-column: span 6; }
	.hscmd-fb-list > li:nth-last-child(2):nth-child(3n+1),
	.hscmd-fb-list > li:nth-last-child(2):nth-child(3n+1) ~ li { grid-column: span 3; }

	.hscmd-ig-grid { grid-template-columns: repeat(var(--hscmd-ig-cols), minmax(0, 1fr)); }

	.hscmd-ig--cols-2 .hscmd-ig-grid > li:nth-child(2n+1):nth-child(n+3):nth-last-child(-n+1),
	.hscmd-ig--cols-2 .hscmd-ig-grid > li:nth-child(2n+1):nth-child(n+3):nth-last-child(-n+1) ~ li { display: none; }
	.hscmd-ig--cols-3 .hscmd-ig-grid > li:nth-child(3n+1):nth-child(n+4):nth-last-child(-n+2),
	.hscmd-ig--cols-3 .hscmd-ig-grid > li:nth-child(3n+1):nth-child(n+4):nth-last-child(-n+2) ~ li { display: none; }
	.hscmd-ig--cols-4 .hscmd-ig-grid > li:nth-child(4n+1):nth-child(n+5):nth-last-child(-n+3),
	.hscmd-ig--cols-4 .hscmd-ig-grid > li:nth-child(4n+1):nth-child(n+5):nth-last-child(-n+3) ~ li { display: none; }
	.hscmd-ig--cols-5 .hscmd-ig-grid > li:nth-child(5n+1):nth-child(n+6):nth-last-child(-n+4),
	.hscmd-ig--cols-5 .hscmd-ig-grid > li:nth-child(5n+1):nth-child(n+6):nth-last-child(-n+4) ~ li { display: none; }
	.hscmd-ig--cols-6 .hscmd-ig-grid > li:nth-child(6n+1):nth-child(n+7):nth-last-child(-n+5),
	.hscmd-ig--cols-6 .hscmd-ig-grid > li:nth-child(6n+1):nth-child(n+7):nth-last-child(-n+5) ~ li { display: none; }

}

/* The caption overlay needs a pointer. On touch there is no hover, so it would
   either never show or stick after a tap. */
@media (hover: none) {
	.hscmd-ig-overlay { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.hscmd-fb-item,
	.hscmd-fb-media img,
	.hscmd-ig-link img,
	.hscmd-ig-overlay,
	.hscmd-fb-more::after { transition: none !important; }
	.hscmd-fb-item:hover { transform: none; }
	.hscmd-ig-link:hover img { transform: none; }
}
