/* ═══════════════════════════════════════════
 * Goshen Bento Video Grid
 * ═══════════════════════════════════════════ */

/* Section */
.goshen-bento-video {
	box-sizing: border-box;
}

.goshen-bento-video *,
.goshen-bento-video *::before,
.goshen-bento-video *::after {
	box-sizing: inherit;
}

/* Section Subtitle */
.goshen-bento-subtitle {
	font-size: 15px;
	font-weight: 400;
	color: #6b7280;
	line-height: 1.5;
	margin: 0 0 8px 0;
}

/* Section Title — right-aligned with blue accent bar */
.goshen-bento-title {
	position: relative;
	padding-right: 18px;
	margin: 0 0 32px 0;
	font-size: 28px;
	font-weight: 700;
	line-height: 1.3;
	color: #1a1a2e;
}

.goshen-bento-title::before {
	content: '';
	position: absolute;
	right: 0;
	top: 2px;
	bottom: 2px;
	width: 4px;
	border-radius: 2px;
	background-color: #0099cc;
}

/* ─── Grid System ────────────────────────── */
.goshen-bento-grid {
	display: grid;
	gap: 12px;
}

/* 1 video: full width */
.goshen-bento-layout-1 {
	grid-template-columns: 1fr;
	grid-template-rows: 1fr;
}

/* 2 videos: hero right (RTL col 1), 1 left */
.goshen-bento-layout-2 {
	grid-template-columns: 1fr 1fr;
	grid-template-rows: 1fr;
}
.goshen-bento-layout-2 .goshen-bento-tile:nth-child(1) {
	grid-column: 1;
	grid-row: 1;
}
.goshen-bento-layout-2 .goshen-bento-tile:nth-child(2) {
	grid-column: 2;
	grid-row: 1;
}

/* 3 videos: hero right spanning 2 rows, 2 stacked left */
.goshen-bento-layout-3 {
	grid-template-columns: 1fr 1.5fr;
	grid-template-rows: 1fr 1fr;
}
.goshen-bento-layout-3 .goshen-bento-tile:nth-child(1) {
	grid-column: 1;
	grid-row: 1 / -1;
}
.goshen-bento-layout-3 .goshen-bento-tile:nth-child(2) {
	grid-column: 2;
	grid-row: 1;
}
.goshen-bento-layout-3 .goshen-bento-tile:nth-child(3) {
	grid-column: 2;
	grid-row: 2;
}

/* ─── 4 videos (Figma layout) ───────────────
 * RTL grid: col 1 = visual RIGHT, col 4 = visual LEFT
 * Hero: right side spanning 2 cols + 2 rows
 * Card 2: top-left (2 cols wide)
 * Card 3 + 4: bottom-left (1 col each, side by side)
 * ─────────────────────────────────────────── */
.goshen-bento-layout-4 {
	grid-template-columns: repeat(4, 1fr);
	grid-template-rows: 1fr 1fr;
}
.goshen-bento-layout-4 .goshen-bento-tile:nth-child(1) {
	grid-column: 1 / 3;
	grid-row: 1 / 3;
}
.goshen-bento-layout-4 .goshen-bento-tile:nth-child(2) {
	grid-column: 3 / 5;
	grid-row: 1;
}
.goshen-bento-layout-4 .goshen-bento-tile:nth-child(3) {
	grid-column: 3;
	grid-row: 2;
}
.goshen-bento-layout-4 .goshen-bento-tile:nth-child(4) {
	grid-column: 4;
	grid-row: 2;
}

/* 5 videos: hero right 2×2, 1 top-left wide, 2 bottom-left small */
.goshen-bento-layout-5 {
	grid-template-columns: repeat(4, 1fr);
	grid-template-rows: 1fr 1fr;
}
.goshen-bento-layout-5 .goshen-bento-tile:nth-child(1) {
	grid-column: 1 / 3;
	grid-row: 1 / 3;
}
.goshen-bento-layout-5 .goshen-bento-tile:nth-child(2) {
	grid-column: 3 / 5;
	grid-row: 1;
}
.goshen-bento-layout-5 .goshen-bento-tile:nth-child(3) {
	grid-column: 3;
	grid-row: 2;
}
.goshen-bento-layout-5 .goshen-bento-tile:nth-child(4) {
	grid-column: 4;
	grid-row: 2;
}
/* 5th tile: hidden in standard bento — use 6-layout for more */
.goshen-bento-layout-5 .goshen-bento-tile:nth-child(5) {
	display: none;
}

/* 6 videos: hero right 2 cols × 2 rows, 4 tiles in 2×2 left grid */
.goshen-bento-layout-6 {
	grid-template-columns: repeat(4, 1fr);
	grid-template-rows: repeat(3, 1fr);
}
.goshen-bento-layout-6 .goshen-bento-tile:nth-child(1) {
	grid-column: 1 / 3;
	grid-row: 1 / 3;
}
.goshen-bento-layout-6 .goshen-bento-tile:nth-child(2) {
	grid-column: 3;
	grid-row: 1;
}
.goshen-bento-layout-6 .goshen-bento-tile:nth-child(3) {
	grid-column: 4;
	grid-row: 1;
}
.goshen-bento-layout-6 .goshen-bento-tile:nth-child(4) {
	grid-column: 3;
	grid-row: 2;
}
.goshen-bento-layout-6 .goshen-bento-tile:nth-child(5) {
	grid-column: 4;
	grid-row: 2;
}
.goshen-bento-layout-6 .goshen-bento-tile:nth-child(6) {
	grid-column: 1 / 5;
	grid-row: 3;
}

/* ─── Tile ───────────────────────────────── */
.goshen-bento-tile {
	position: relative;
	overflow: hidden;
	cursor: pointer;
	border-radius: 16px;
	background-color: #2a2a3a;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	min-height: 44px;
	min-width: 44px;
}

.goshen-bento-tile:hover {
	transform: scale(1.01);
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

/* Focus indicator — WCAG AA compliant */
.goshen-bento-tile:focus-visible {
	outline: 3px solid #0099cc;
	outline-offset: 3px;
	z-index: 3;
}

/* Cover image */
.goshen-bento-cover {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.goshen-bento-tile:hover .goshen-bento-cover {
	transform: scale(1.04);
}

/* Overlay gradient — dark enough for WCAG AA white text contrast */
.goshen-bento-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to top,
		rgba(0, 0, 0, 0.78) 0%,
		rgba(0, 0, 0, 0.5) 40%,
		rgba(0, 0, 0, 0.08) 100%
	);
	pointer-events: none;
	z-index: 1;
}

/* ─── Play Icon — frosted glass, top-left visually ─ */
.goshen-bento-play {
	position: absolute;
	top: 14px;
	left: 14px; /* visually top-left in RTL */
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background-color: rgba(255, 255, 255, 0.2);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.goshen-bento-tile:hover .goshen-bento-play {
	background-color: rgba(255, 255, 255, 0.35);
	transform: scale(1.08);
}

.goshen-bento-play svg {
	width: 18px;
	height: 18px;
	fill: #ffffff;
	margin-left: 2px;
}

/* ─── Content overlay ────────────────────── */
.goshen-bento-content {
	position: absolute;
	bottom: 0;
	right: 0;
	left: 0;
	z-index: 2;
	padding: 20px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
}

.goshen-bento-tile--hero .goshen-bento-content {
	padding: 28px;
	gap: 6px;
}

.goshen-bento-tile-title {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	color: #ffffff;
	line-height: 1.4;
}

/* Larger title for hero tile */
.goshen-bento-tile--hero .goshen-bento-tile-title {
	font-size: 22px;
	line-height: 1.35;
}

.goshen-bento-tile-desc {
	margin: 0;
	font-size: 13px;
	color: rgba(255, 255, 255, 0.85);
	line-height: 1.55;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Hero tile shows more description lines */
.goshen-bento-tile--hero .goshen-bento-tile-desc {
	font-size: 14px;
	-webkit-line-clamp: 3;
}

/* Show description on all tiles */

/* ─── CTA — text link with warm amber color + chevron ───── */
.goshen-bento-cta {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 8px;
	padding: 0;
	font-size: 13px;
	font-weight: 600;
	color: #D4A574;
	background: none;
	border: none;
	border-radius: 0;
	text-decoration: none;
	cursor: pointer;
	transition: opacity 0.2s ease, gap 0.2s ease;
	min-height: 44px;
	line-height: 44px;
}

.goshen-bento-tile--hero .goshen-bento-cta {
	font-size: 14px;
	margin-top: 10px;
}

.goshen-bento-cta:hover {
	opacity: 0.85;
}

.goshen-bento-cta:focus-visible {
	outline: 2px solid #D4A574;
	outline-offset: 2px;
	border-radius: 4px;
}

/* Chevron arrow */
.goshen-bento-cta__arrow {
	display: inline-flex;
	align-items: center;
	font-size: 18px;
	line-height: 1;
	transform: scaleX(-1);
	transition: transform 0.2s ease;
}

.goshen-bento-cta:hover .goshen-bento-cta__arrow {
	transform: scaleX(-1) translateX(-3px);
}

/* Show CTA on ALL tiles */

/* ═══════════════════════════════════════════
 * Video Modal
 * ═══════════════════════════════════════════ */

.goshen-bento-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.goshen-bento-modal[aria-hidden="false"] {
	opacity: 1;
	visibility: visible;
}

.goshen-bento-modal-backdrop {
	position: absolute;
	inset: 0;
	background-color: var(--goshen-modal-backdrop, rgba(0, 0, 0, 0.85));
}

.goshen-bento-modal-inner {
	position: relative;
	z-index: 1;
	width: 90vw;
	max-width: 960px;
	display: flex;
	flex-direction: column;
	transform: scale(0.9);
	transition: transform 0.3s ease;
}

.goshen-bento-modal[aria-hidden="false"] .goshen-bento-modal-inner {
	transform: scale(1);
}

.goshen-bento-modal-body {
	position: relative;
	aspect-ratio: 16 / 9;
	background-color: #000;
	border-radius: 12px;
	overflow: hidden;
}

/* Article CTA button below the video */
.goshen-bento-modal-article {
	text-align: center;
	padding: 16px 0 0;
}

.goshen-bento-modal-article[aria-hidden="true"] {
	display: none;
}

.goshen-bento-modal-article-btn {
	display: inline-block;
	padding: 12px 32px;
	background-color: #0099cc;
	color: #ffffff;
	text-decoration: none;
	border-radius: 8px;
	font-weight: 600;
	font-size: 15px;
	direction: rtl;
	transition: background-color 0.2s ease, transform 0.15s ease;
}

.goshen-bento-modal-article-btn:hover {
	background-color: #007aa3;
	color: #ffffff;
	transform: translateY(-1px);
}

/* Post title overlay — appears at top of video player */
.goshen-bento-modal-title {
	display: none;
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 2;
	padding: 16px 20px 40px;
	background: linear-gradient(to bottom, rgba(0, 0, 0, 0.72) 0%, transparent 100%);
	color: #ffffff;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.4;
	direction: rtl;
	text-align: right;
	pointer-events: none;
}

.goshen-bento-modal-article-btn:focus-visible {
	outline: 3px solid #ffffff;
	outline-offset: 3px;
}

.goshen-bento-modal-close {
	position: absolute;
	top: -44px;
	left: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: none;
	background: none;
	color: #ffffff;
	cursor: pointer;
	border-radius: 50%;
	transition: background-color 0.2s ease;
}

.goshen-bento-modal-close:hover {
	background-color: rgba(255, 255, 255, 0.15);
}

.goshen-bento-modal-close:focus-visible {
	outline: 3px solid #0099cc;
	outline-offset: 2px;
}

.goshen-bento-modal-player {
	width: 100%;
	height: 100%;
}

.goshen-bento-modal-player iframe,
.goshen-bento-modal-player video {
	width: 100%;
	height: 100%;
	border: none;
	display: block;
}

/* ═══════════════════════════════════════════
 * Screen Reader Only
 * ═══════════════════════════════════════════ */
.goshen-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ═══════════════════════════════════════════
 * Reduced Motion
 * ═══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
	.goshen-bento-tile,
	.goshen-bento-cover,
	.goshen-bento-play,
	.goshen-bento-cta,
	.goshen-bento-cta__arrow,
	.goshen-bento-modal,
	.goshen-bento-modal-body,
	.goshen-bento-modal-close {
		transition: none !important;
	}

	.goshen-bento-tile:hover {
		transform: none;
	}

	.goshen-bento-tile:hover .goshen-bento-cover {
		transform: none;
	}

	.goshen-bento-tile:hover .goshen-bento-play {
		transform: none;
	}

	.goshen-bento-cta:hover .goshen-bento-cta__arrow {
		transform: none;
	}
}

/* ═══════════════════════════════════════════
 * Responsive
 * ═══════════════════════════════════════════ */

@media (max-width: 768px) {

	/* All layouts collapse to single column on mobile */
	.goshen-bento-grid {
		height: auto !important;
	}

	.goshen-bento-layout-1,
	.goshen-bento-layout-2,
	.goshen-bento-layout-3,
	.goshen-bento-layout-4,
	.goshen-bento-layout-5,
	.goshen-bento-layout-6 {
		grid-template-columns: 1fr !important;
		grid-template-rows: auto !important;
	}

	.goshen-bento-layout-1 .goshen-bento-tile,
	.goshen-bento-layout-2 .goshen-bento-tile,
	.goshen-bento-layout-3 .goshen-bento-tile,
	.goshen-bento-layout-4 .goshen-bento-tile,
	.goshen-bento-layout-5 .goshen-bento-tile,
	.goshen-bento-layout-6 .goshen-bento-tile {
		grid-column: 1 !important;
		grid-row: auto !important;
		display: block !important;
		min-height: 200px;
	}

	.goshen-bento-tile--hero {
		min-height: 280px;
	}

	.goshen-bento-tile-title {
		font-size: 15px;
	}

	.goshen-bento-tile--hero .goshen-bento-tile-title {
		font-size: 19px;
	}

	.goshen-bento-content {
		padding: 16px;
	}

	.goshen-bento-tile--hero .goshen-bento-content {
		padding: 20px;
	}

	.goshen-bento-modal-inner {
		width: 95vw;
	}

	.goshen-bento-modal-close {
		top: -44px;
	}
}

@media (min-width: 769px) and (max-width: 1024px) {
	/* Tablet: simplify larger layouts to 2 columns */
	.goshen-bento-layout-4 {
		grid-template-columns: 1fr 1fr !important;
		grid-template-rows: auto auto !important;
	}

	.goshen-bento-layout-4 .goshen-bento-tile:nth-child(1) {
		grid-column: 1 / -1 !important;
		grid-row: 1 !important;
		min-height: 280px;
	}

	.goshen-bento-layout-4 .goshen-bento-tile:nth-child(n+2) {
		grid-column: auto !important;
		grid-row: auto !important;
		min-height: 180px;
	}

	.goshen-bento-layout-5,
	.goshen-bento-layout-6 {
		grid-template-columns: 1fr 1fr !important;
		grid-template-rows: auto auto auto !important;
	}

	.goshen-bento-layout-5 .goshen-bento-tile:nth-child(1),
	.goshen-bento-layout-6 .goshen-bento-tile:nth-child(1) {
		grid-column: 1 / -1 !important;
		grid-row: 1 !important;
		min-height: 280px;
	}

	.goshen-bento-layout-5 .goshen-bento-tile:nth-child(n+2),
	.goshen-bento-layout-6 .goshen-bento-tile:nth-child(n+2) {
		grid-column: auto !important;
		grid-row: auto !important;
		display: block !important;
		min-height: 180px;
	}
}
