/**
 * YouTube Blog Feed Stylesheet
 * Featuring Hero Layout, FCC Green Accent Aesthetics, Responsive Grid, and Lightbox Modal.
 */

:root {
	--ybf-brand-green: #064e3b;
	--ybf-brand-green-dark: #022c22;
	--ybf-accent-gold: #d97706;
	--ybf-card-bg: #ffffff;
	--ybf-card-border: #e2e8f0;
	--ybf-card-radius: 12px;
	--ybf-text-primary: #0f172a;
	--ybf-text-secondary: #64748b;
	--ybf-accent: #ef4444;
	--ybf-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
	--ybf-shadow-hover: 0 12px 28px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
	--ybf-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ybf-feed-container {
	width: 100%;
	margin: 24px 0;
	box-sizing: border-box;
}

/* ============================================================================
   FEATURED HERO CARD LAYOUT (FCC Style)
   ============================================================================ */
.ybf-layout-featured .ybf-card-featured {
	background: linear-gradient(135deg, var(--ybf-brand-green) 0%, var(--ybf-brand-green-dark) 100%);
	color: #ffffff;
	border-radius: var(--ybf-card-radius);
	overflow: hidden;
	margin-bottom: 32px;
	box-shadow: 0 10px 30px rgba(6, 78, 59, 0.25);
	border: none;
}

.ybf-featured-inner {
	display: flex;
	flex-direction: row;
	align-items: stretch;
}

@media (max-width: 860px) {
	.ybf-featured-inner {
		flex-direction: column;
	}
}

.ybf-featured-media {
	flex: 1.2;
	min-width: 0;
	position: relative;
}

.ybf-featured-content {
	flex: 1;
	padding: 32px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	box-sizing: border-box;
}

@media (max-width: 860px) {
	.ybf-featured-content {
		padding: 24px;
	}
}

.ybf-badge-featured {
	display: inline-block;
	align-self: flex-start;
	background: var(--ybf-accent-gold);
	color: #ffffff;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.8px;
	padding: 5px 12px;
	border-radius: 4px;
	margin-bottom: 14px;
	text-transform: uppercase;
}

.ybf-featured-title {
	font-size: 1.65rem;
	font-weight: 700;
	line-height: 1.3;
	margin: 0 0 14px 0;
	color: #ffffff;
}

.ybf-featured-title .ybf-title-link {
	color: #ffffff;
	text-decoration: none;
	transition: color 0.2s ease;
}

.ybf-featured-title .ybf-title-link:hover {
	color: #fef08a;
}

.ybf-featured-excerpt {
	font-size: 0.95rem;
	line-height: 1.6;
	color: #cbd5e1;
	margin: 0 0 20px 0;
}

.ybf-featured-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: auto;
	flex-wrap: wrap;
}

.ybf-card-featured .ybf-card-date {
	color: #94a3b8;
}

.ybf-btn-watch {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: #10b981;
	color: #022c22;
	font-weight: 700;
	font-size: 0.9rem;
	padding: 10px 20px;
	border-radius: 6px;
	text-decoration: none;
	transition: var(--ybf-transition);
	box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.ybf-btn-watch:hover {
	background: #34d399;
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
	color: #022c22;
}

/* ============================================================================
   GRID LAYOUT & CARDS
   ============================================================================ */
.ybf-grid {
	display: grid;
	gap: 24px;
	width: 100%;
}

.ybf-cols-1 { grid-template-columns: repeat(1, 1fr); }
.ybf-cols-2 { grid-template-columns: repeat(2, 1fr); }
.ybf-cols-3 { grid-template-columns: repeat(3, 1fr); }
.ybf-cols-4 { grid-template-columns: repeat(4, 1fr); }
.ybf-cols-5 { grid-template-columns: repeat(5, 1fr); }
.ybf-cols-6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 1024px) {
	.ybf-cols-4, .ybf-cols-5, .ybf-cols-6 {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 768px) {
	.ybf-cols-2, .ybf-cols-3, .ybf-cols-4, .ybf-cols-5, .ybf-cols-6 {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 520px) {
	.ybf-grid {
		grid-template-columns: 1fr !important;
	}
}

/* Standard Card Styling */
.ybf-card {
	background: var(--ybf-card-bg);
	border: 1px solid var(--ybf-card-border);
	border-radius: var(--ybf-card-radius);
	overflow: hidden;
	box-shadow: var(--ybf-shadow);
	transition: var(--ybf-transition);
	display: flex;
	flex-direction: column;
}

.ybf-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--ybf-shadow-hover);
}

.ybf-card-link {
	display: block;
	text-decoration: none;
	color: inherit;
}

/* Thumbnail Wrapper */
.ybf-thumbnail-wrapper {
	position: relative;
	width: 100%;
	padding-top: 56.25%; /* 16:9 Aspect Ratio */
	background-color: #0f172a;
	overflow: hidden;
}

.ybf-thumbnail {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: var(--ybf-transition);
}

.ybf-card:hover .ybf-thumbnail {
	transform: scale(1.05);
	opacity: 0.9;
}

/* Play Overlay Button */
.ybf-play-overlay {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.25);
	transition: var(--ybf-transition);
}

.ybf-play-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 54px;
	height: 54px;
	background: rgba(239, 68, 68, 0.9);
	color: #ffffff;
	border-radius: 50%;
	box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
	transition: var(--ybf-transition);
}

.ybf-card:hover .ybf-play-icon {
	transform: scale(1.15);
	background: #ef4444;
	box-shadow: 0 6px 16px rgba(239, 68, 68, 0.6);
}

/* Card Content & Title */
.ybf-card-content {
	padding: 18px;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

.ybf-card-title {
	font-size: 1.05rem;
	font-weight: 600;
	line-height: 1.4;
	margin: 0 0 10px 0;
	color: var(--ybf-text-primary);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ybf-title-link {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.ybf-title-link:hover {
	color: var(--ybf-brand-green);
}

.ybf-card-date {
	font-size: 0.85rem;
	color: var(--ybf-text-secondary);
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: auto;
}

.ybf-card-date .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

/* ============================================================================
   PAGINATION (LOAD MORE BUTTON)
   ============================================================================ */
.ybf-pagination-container {
	text-align: center;
	margin-top: 36px;
}

.ybf-load-more-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	background: var(--ybf-brand-green);
	color: #ffffff;
	border: none;
	padding: 14px 36px;
	border-radius: 30px;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(6, 78, 59, 0.3);
	transition: var(--ybf-transition);
}

.ybf-load-more-btn:hover {
	background: #047857;
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(6, 78, 59, 0.4);
}

.ybf-load-more-btn:disabled {
	opacity: 0.7;
	cursor: not-allowed;
	transform: none;
}

.ybf-spinner {
	display: none;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: ybfSpin 0.8s linear infinite;
}

.ybf-load-more-btn.ybf-loading .ybf-spinner {
	display: inline-block;
}

@keyframes ybfSpin {
	to { transform: rotate(360deg); }
}

/* ============================================================================
   ERROR & NOTICES
   ============================================================================ */
.ybf-notice {
	padding: 14px 18px;
	border-radius: 8px;
	margin: 15px 0;
	font-size: 0.95rem;
}
.ybf-notice-error {
	background-color: #fff5f5;
	border-left: 4px solid #e53e3e;
	color: #c53030;
}
.ybf-notice-info {
	background-color: #ebf8ff;
	border-left: 4px solid #3182ce;
	color: #2b6cb0;
}

/* ============================================================================
   LIGHTBOX MODAL
   ============================================================================ */
.ybf-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 999999;
	align-items: center;
	justify-content: center;
}

.ybf-modal.ybf-active {
	display: flex;
}

.ybf-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
	backdrop-filter: blur(6px);
}

.ybf-modal-container {
	position: relative;
	width: 90%;
	max-width: 960px;
	z-index: 1000000;
	animation: ybfPopIn 0.3s ease-out forwards;
}

@keyframes ybfPopIn {
	from {
		opacity: 0;
		transform: scale(0.92);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

.ybf-modal-close {
	position: absolute;
	top: -45px;
	right: 0;
	background: transparent;
	border: none;
	color: #ffffff;
	font-size: 36px;
	font-weight: 300;
	cursor: pointer;
	line-height: 1;
	padding: 5px;
	transition: transform 0.2s ease, color 0.2s ease;
}

.ybf-modal-close:hover {
	color: #ef4444;
	transform: scale(1.15);
}

.ybf-video-wrapper {
	position: relative;
	width: 100%;
	padding-top: 56.25%;
	background: #000000;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.ybf-video-wrapper iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
}
