/**
 * Facebook Feed — front-end styles.
 *
 * Everything is scoped under .facebook-feed and driven by custom properties, so a theme can
 * restyle the block by redefining the variables rather than fighting specificity. No global
 * element selectors are used and nothing outside the block is touched.
 */

.facebook-feed {
	--facebook-feed-columns: 3;
	--facebook-feed-gap: 24px;
	--facebook-feed-border-radius: 8px;
	--facebook-feed-border-color: rgba(0, 0, 0, 0.1);
	--facebook-feed-background: transparent;
	--facebook-feed-padding: 0;
	--facebook-feed-text-color: inherit;
	--facebook-feed-meta-color: rgba(0, 0, 0, 0.6);
	--facebook-feed-link-color: #1877f2;
	--facebook-feed-image-ratio: 4 / 3;
	--facebook-feed-content-padding: 16px;
	--facebook-feed-font-size: 1rem;
	--facebook-feed-meta-font-size: 0.8125rem;
}

.facebook-feed__heading {
	margin: 0 0 var(--facebook-feed-gap);
}

.facebook-feed__grid {
	display: grid;
	grid-template-columns: repeat(1, minmax(0, 1fr));
	gap: var(--facebook-feed-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 600px) {
	.facebook-feed__grid {
		grid-template-columns: repeat(min(2, var(--facebook-feed-columns)), minmax(0, 1fr));
	}
}

@media (min-width: 900px) {
	.facebook-feed__grid {
		grid-template-columns: repeat(var(--facebook-feed-columns), minmax(0, 1fr));
	}
}

.facebook-feed__item {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--facebook-feed-background);
	border: 1px solid var(--facebook-feed-border-color);
	border-radius: var(--facebook-feed-border-radius);
	color: var(--facebook-feed-text-color);
}

.facebook-feed__image-link {
	display: block;
	line-height: 0;
	text-decoration: none;
}

.facebook-feed__image {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: var(--facebook-feed-image-ratio);
	object-fit: cover;
}

.facebook-feed__content {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 8px;
	padding: var(--facebook-feed-content-padding);
	font-size: var(--facebook-feed-font-size);
}

.facebook-feed__date {
	color: var(--facebook-feed-meta-color);
	font-size: var(--facebook-feed-meta-font-size);
}

.facebook-feed__text {
	overflow-wrap: break-word;
}

.facebook-feed__text > p:first-child {
	margin-top: 0;
}

.facebook-feed__text > p:last-child {
	margin-bottom: 0;
}

.facebook-feed__link {
	margin-top: auto;
	padding-top: 8px;
	color: var(--facebook-feed-link-color);
	font-size: var(--facebook-feed-meta-font-size);
	font-weight: 600;
	text-decoration: none;
}

.facebook-feed__link:hover,
.facebook-feed__link:focus {
	text-decoration: underline;
}

.facebook-feed__image-link:focus-visible,
.facebook-feed__link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.facebook-feed__notice {
	margin: 0;
	padding: var(--facebook-feed-content-padding);
	border: 1px dashed var(--facebook-feed-border-color);
	border-radius: var(--facebook-feed-border-radius);
	color: var(--facebook-feed-meta-color);
}

/* Provided in case the active theme does not define it. */
.facebook-feed .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
