/* Porchlight Instagram Feed — [porchlight_instagram] */

.plig {
	--plig-per-view: var(--plig-pv-desktop, 5);
	--plig-gap: 12px;
	--plig-radius: 4px;
	position: relative;
	width: 100%;
	margin: 0 0 1.5em;
}

/* Tablet: up to 3 across. Phone: 2 across. */
@media (max-width: 980px) {
	.plig { --plig-per-view: min(var(--plig-pv-desktop, 5), 3); --plig-gap: 10px; }
}
@media (max-width: 600px) {
	.plig { --plig-per-view: min(var(--plig-pv-desktop, 5), 2); --plig-gap: 8px; }
}

/* Track — native horizontal scroll so swiping works on touch screens. */
.plig .plig-track {
	position: relative;
	display: flex;
	gap: var(--plig-gap);
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
}
.plig .plig-track::-webkit-scrollbar { display: none; }

.plig .plig-item {
	flex: 0 0 calc((100% - (var(--plig-per-view) - 1) * var(--plig-gap)) / var(--plig-per-view));
	margin: 0;
	padding: 0;
	list-style: none;
	scroll-snap-align: start;
}

.plig .plig-link {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: var(--plig-radius);
	background: rgba(127, 127, 127, 0.15);
	text-decoration: none;
	color: #fff;
}

.plig .plig-img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform 0.6s ease;
}

/* Darkened caption overlay */
.plig .plig-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0.75em;
	padding: 14px;
	background: rgba(0, 0, 0, 0.72);
	color: #fff;
	font-size: 14px;
	line-height: 1.45;
	text-align: left;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.plig .plig-caption {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 7;
	line-clamp: 7;
	overflow: hidden;
	white-space: pre-line;
	overflow-wrap: anywhere;
	color: #fff;
}

.plig .plig-cta {
	font-size: 0.8em;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.85);
}
.plig .plig-cta::after { content: " \2192"; }

/* Show overlay: hover (mouse), keyboard focus, or first tap (touch, set by JS). */
@media (hover: hover) {
	.plig .plig-link:hover .plig-overlay { opacity: 1; }
	.plig .plig-link:hover .plig-img { transform: scale(1.05); }
}
.plig .plig-link:focus-visible .plig-overlay,
.plig .plig-link.is-revealed .plig-overlay { opacity: 1; }
.plig .plig-link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Video / multi-photo indicator */
.plig .plig-badge {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 18px;
	height: 18px;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
	pointer-events: none;
}
.plig .plig-badge--video {
	background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M7 4.5v15l13-7.5z'/%3E%3C/svg%3E");
}
.plig .plig-badge--carousel_album {
	background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M8 2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zM2 7h2v13h13v2H4a2 2 0 0 1-2-2z'/%3E%3C/svg%3E");
}

/* Controls — Porchlight orange by default; shortcode controls="white" (or any hex) overrides. */
.plig .plig-controls {
	color: var(--plig-controls-color, #ffa14e);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin-top: 14px;
}
.plig .plig-controls[hidden] { display: none; }

.plig .plig-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 1px solid currentColor;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	cursor: pointer;
	opacity: 0.7;
	transition: opacity 0.2s ease;
}
.plig .plig-arrow:hover,
.plig .plig-arrow:focus-visible { opacity: 1; }
.plig .plig-arrow svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.plig .plig-dots {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px;
}
.plig .plig-dot {
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
}
.plig .plig-dot::before {
	content: "";
	display: block;
	width: 8px;
	height: 8px;
	margin: auto;
	border-radius: 50%;
	background: currentColor;
	opacity: 0.3;
	transition: opacity 0.2s ease, transform 0.2s ease;
}
.plig .plig-dot[aria-current="true"]::before { opacity: 0.9; transform: scale(1.25); }

.plig .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;
}

@media (max-width: 600px) {
	.plig .plig-overlay { padding: 10px; font-size: 12.5px; }
	.plig .plig-caption { -webkit-line-clamp: 5; line-clamp: 5; }
	.plig .plig-arrow { width: 32px; height: 32px; flex: 0 0 auto; }
	.plig .plig-controls { gap: 8px; }
	.plig .plig-dots { gap: 0; }
	.plig .plig-dot { width: 18px; height: 24px; }
	.plig .plig-dot::before { width: 7px; height: 7px; }
}

@media (prefers-reduced-motion: reduce) {
	.plig .plig-track { scroll-behavior: auto; }
	.plig .plig-img,
	.plig .plig-overlay { transition: none; }
	.plig .plig-link:hover .plig-img { transform: none; }
}
