/**
 * Blog Shortcode - Editorial Magazine Styles
 *
 * Scoped under .ebs-magazine-container and fallback classes to prevent theme pollution.
 * Fonts: Merriweather (Serif) for headings, Inter (Sans-Serif) for metadata and body.
 */

/* Core Container Setup */
.ebs-magazine-container {
	display: grid;
	grid-template-columns: 24fr 52fr 24fr; /* Exact proportions from reference image */
	gap: 2.25rem;
	width: 100%;
	max-width: 1280px;
	margin: 2rem auto;
	padding: 0 1rem;
	box-sizing: border-box;
	background-color: #ffffff;
}

.ebs-magazine-container * {
	box-sizing: border-box;
}

/* Base Editorial Typography */
.ebs-magazine-container h2.ebs-column-header {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
	font-size: 0.8rem;
	font-weight: 500;
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	margin: 0 0 0.5rem 0;
	padding-bottom: 0.5rem;
	border-bottom: 1.5px solid #1e293b; /* Distinct thin editorial underline */
}

/* Columns Base styling */
.ebs-column {
	display: flex;
	flex-direction: column;
	width: 100%;
}

/* ==========================================================================
   LEFT COLUMN: Latest
   ========================================================================== */
.ebs-column-latest {
	border-right: 1px solid #f1f5f9;
	padding-right: 1.25rem;
}

.ebs-latest-posts {
	display: flex;
	flex-direction: column;
}

/* Top post inside Latest column */
.ebs-card-latest-top {
	margin-bottom: 1.25rem;
	padding-top: 1rem;
	border-bottom: 1px solid #f1f5f9;
	padding-bottom: 1.25rem;
}

.ebs-card-latest-top .ebs-card-link {
	text-decoration: none;
	color: inherit;
	display: block;
}

.ebs-card-latest-top .ebs-card-image-wrap {
	position: relative !important;
	width: 100% !important;
	padding-top: 56.25% !important; /* 16:9 Aspect Ratio */
	border-radius: 8px !important;
	overflow: hidden !important;
	background-color: #f8fafc !important;
	margin-bottom: 0.85rem !important;
	display: block !important;
}

/* Explicit hover rules for inner wrapper div to override theme rules like a:hover div */
.ebs-magazine-container .ebs-card-latest-top a.ebs-card-link:hover .ebs-card-image-wrap,
.ebs-magazine-container .ebs-card-latest-top:hover .ebs-card-image-wrap {
	position: relative !important;
	width: 100% !important;
	padding-top: 56.25% !important;
	display: block !important;
}

.ebs-card-latest-top .ebs-card-image-wrap img {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	width: 100% !important;
	height: 100% !important;
	max-width: 100% !important;
	max-height: 100% !important;
	object-fit: cover !important;
	transition: none !important;
}

.ebs-card-latest-top:hover .ebs-card-image-wrap img,
.ebs-card-latest-top a.ebs-card-link:hover .ebs-card-image-wrap img {
	transform: none !important;
	width: 100% !important;
	height: 100% !important;
}

/* Custom icon badge inside thumbnails (e.g. audio/video lines) */
.ebs-overlay-icon-badge {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	background: rgba(15, 23, 42, 0.65);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border-radius: 50%;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ffffff;
	z-index: 5;
}

.ebs-overlay-icon-badge svg {
	width: 16px;
	height: 16px;
}

.ebs-card-latest-top .ebs-card-title {
	font-family: 'Merriweather', Georgia, serif;
	font-size: 1.05rem;
	line-height: 1.35;
	font-weight: 700;
	color: #0f172a;
	margin: 0 0 0.5rem 0;
	transition: color 0.2s ease;
}

.ebs-card-latest-top:hover .ebs-card-title {
	color: #1e40af; /* Deep blue highlight */
}

/* Metadata styling */
.ebs-card-meta {
	font-family: 'Inter', sans-serif;
	font-size: 0.75rem;
	color: #64748b;
	font-weight: 500;
}

/* Text list items inside Latest Column */
.ebs-card-list-text {
	border-bottom: 1px solid #f1f5f9;
	padding: 1rem 0;
}

.ebs-card-list-text:last-of-type {
	border-bottom: none;
}

.ebs-card-list-text .ebs-card-link {
	text-decoration: none;
	color: inherit;
	display: block;
}

.ebs-card-list-text .ebs-card-title {
	font-family: 'Merriweather', Georgia, serif;
	font-size: 0.95rem;
	line-height: 1.4;
	font-weight: 700;
	color: #0f172a;
	margin: 0 0 0.5rem 0;
	transition: color 0.2s ease;
}

.ebs-card-list-text:hover .ebs-card-title {
	color: #1e40af;
}

/* Footer Section "All news" button */
.ebs-latest-footer {
	margin-top: auto;
	padding-top: 1.5rem;
}

.ebs-all-news-btn {
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 0.65rem 1.25rem;
	border: 1px solid #cbd5e1;
	border-radius: 50px;
	color: #0f172a;
	text-decoration: none;
	font-family: 'Inter', sans-serif;
	font-size: 0.85rem;
	font-weight: 600;
	transition: all 0.2s ease;
}

.ebs-all-news-btn:hover {
	border-color: #0f172a;
	background-color: #f8fafc;
}

.ebs-all-news-btn .btn-arrow {
	transition: transform 0.2s ease;
}

.ebs-all-news-btn:hover .btn-arrow {
	transform: translateX(4px);
}


/* ==========================================================================
   MIDDLE COLUMN: Top Stories
   ========================================================================== */
.ebs-column-top-stories {
	padding-bottom: 2rem;
}

/* Hero card styling */
.ebs-hero-post-container {
	margin-top: 1rem;
	margin-bottom: 2rem;
}

.ebs-card-hero {
	position: relative !important;
	width: 100% !important;
	border-radius: 8px !important;
	overflow: hidden !important;
	background-color: #0f172a !important;
	display: block !important;
}

.ebs-hero-link-wrap,
.ebs-hero-link-wrap:hover,
.ebs-hero-link-wrap:focus,
.ebs-hero-link-wrap:active {
	text-decoration: none !important;
	color: #ffffff !important;
	display: block !important;
	position: relative !important;
	width: 100% !important;
	padding-top: 60% !important; /* Aspect Ratio */
}

.ebs-hero-image-wrap {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	width: 100% !important;
	height: 100% !important;
	display: block !important;
	z-index: 1 !important;
}

.ebs-hero-image-wrap img {
	width: 100% !important;
	height: 100% !important;
	max-width: 100% !important;
	max-height: 100% !important;
	object-fit: cover !important;
	transition: none !important;
	display: block !important;
}

.ebs-hero-overlay {
	position: absolute !important;
	inset: 0 !important;
	background: linear-gradient(to bottom, transparent 30%, rgba(0, 0, 0, 0.8) 100%) !important;
	z-index: 2 !important;
	display: block !important;
}

.ebs-card-hero:hover .ebs-hero-image-wrap img,
.ebs-card-hero a.ebs-hero-link-wrap:hover .ebs-hero-image-wrap img {
	transform: none !important;
	width: 100% !important;
	height: 100% !important;
}

/* Explicit hover rules for inner wrapper div to override theme rules like a:hover div */
.ebs-magazine-container .ebs-card-hero a.ebs-hero-link-wrap:hover .ebs-hero-image-wrap,
.ebs-magazine-container .ebs-card-hero:hover .ebs-hero-image-wrap {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	width: 100% !important;
	height: 100% !important;
	display: block !important;
}

.ebs-magazine-container .ebs-card-hero a.ebs-hero-link-wrap:hover .ebs-hero-overlay,
.ebs-magazine-container .ebs-card-hero:hover .ebs-hero-overlay {
	position: absolute !important;
	inset: 0 !important;
	z-index: 2 !important;
	display: block !important;
}

.ebs-hero-content {
	position: absolute !important;
	bottom: 0 !important;
	left: 0 !important;
	right: 0 !important;
	padding: 2.25rem 2rem !important;
	z-index: 3 !important;
	display: block !important;
}

.ebs-magazine-container .ebs-card-hero a.ebs-hero-link-wrap:hover .ebs-hero-content,
.ebs-magazine-container .ebs-card-hero:hover .ebs-hero-content {
	position: absolute !important;
	bottom: 0 !important;
	left: 0 !important;
	right: 0 !important;
	z-index: 3 !important;
	display: block !important;
}

.ebs-hero-title,
.ebs-hero-content h3.ebs-hero-title,
.ebs-card-hero a .ebs-hero-title,
.ebs-magazine-container .ebs-card-hero .ebs-hero-title {
	font-family: 'Merriweather', Georgia, serif;
	font-size: 2rem;
	font-weight: 300;
	line-height: 1.25;
	color: #ffffff !important;
	margin: 0;
	text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 2x2 grid styling below Hero */
.ebs-middle-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2rem;
}

.ebs-card-grid .ebs-card-link {
	text-decoration: none;
	color: inherit;
	display: block;
}

.ebs-card-grid .ebs-card-image-wrap {
	position: relative !important;
	width: 100% !important;
	padding-top: 56.25% !important; /* 16:9 Aspect Ratio */
	border-radius: 8px !important;
	overflow: hidden !important;
	background-color: #f8fafc !important;
	margin-bottom: 0.85rem !important;
	display: block !important;
}

/* Explicit hover rules for inner wrapper div to override theme rules like a:hover div */
.ebs-magazine-container .ebs-card-grid a.ebs-card-link:hover .ebs-card-image-wrap,
.ebs-magazine-container .ebs-card-grid:hover .ebs-card-image-wrap,
.ebs-blog-container .ebs-card-grid a.ebs-card-link:hover .ebs-card-image-wrap,
.ebs-blog-container .ebs-card-grid:hover .ebs-card-image-wrap {
	position: relative !important;
	width: 100% !important;
	padding-top: 56.25% !important;
	display: block !important;
}

.ebs-card-grid .ebs-card-image-wrap img {
	position: absolute !important;
	top: 0 !important;
	left: 0 !important;
	width: 100% !important;
	height: 100% !important;
	max-width: 100% !important;
	max-height: 100% !important;
	object-fit: cover !important;
	transition: none !important;
}

.ebs-card-grid:hover .ebs-card-image-wrap img,
.ebs-card-grid a.ebs-card-link:hover .ebs-card-image-wrap img {
	transform: none !important;
	width: 100% !important;
	height: 100% !important;
}

.ebs-card-grid .ebs-card-title {
	font-family: 'Merriweather', Georgia, serif;
	font-size: 1.05rem;
	line-height: 1.35;
	font-weight: 700;
	color: #0f172a;
	margin: 0 0 0.5rem 0;
	transition: color 0.2s ease;
}

.ebs-card-grid:hover .ebs-card-title {
	color: #1e40af;
}

/* White play icon badge on top right of image */
.ebs-card-grid .ebs-overlay-icon-badge {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	background: rgba(255, 255, 255, 0.9);
	color: #0f172a;
	border-radius: 50%;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 5;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.ebs-card-grid .ebs-overlay-icon-badge svg {
	width: 14px;
	height: 14px;
	transform: translateX(1px);
}


/* ==========================================================================
   RIGHT COLUMN: Sidebar widgets
   ========================================================================== */
.ebs-column-sidebar {
	gap: 1.5rem;
	padding-top: 1.7rem; /* matches alignment with headlines after headers */
}

/* Generic widget container card styling */
.ebs-widget {
	border-radius: 8px;
	padding: 1.75rem;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
}

.ebs-widget-title {
	font-family: 'Merriweather', Georgia, serif;
	font-weight: 700;
	margin: 0 0 0.75rem 0;
	line-height: 1.2;
}

.ebs-widget-desc {
	font-family: 'Inter', sans-serif;
	font-size: 0.85rem;
	line-height: 1.5;
	margin: 0 0 1.25rem 0;
}

.ebs-widget-btn {
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 0.7rem 1.25rem;
	border-radius: 50px;
	text-decoration: none;
	font-family: 'Inter', sans-serif;
	font-size: 0.85rem;
	font-weight: 600;
	margin-top: auto;
	transition: opacity 0.2s ease;
}

.ebs-widget-btn:hover {
	opacity: 0.9;
}

.ebs-widget-btn .btn-arrow {
	transition: transform 0.2s ease;
}

.ebs-widget-btn:hover .btn-arrow {
	transform: translateX(4px);
}

/* Subscribe Widget (White Box) */
.ebs-widget-subscribe {
	background: #ffffff;
	border: 1px solid #e2e8f0;
}

.ebs-widget-subscribe .ebs-widget-title {
	color: #032b21;
	font-size: 1.5rem;
}

.ebs-widget-subscribe .ebs-widget-desc {
	color: #475569;
}

.ebs-btn-newsletter {
	background: #032b21; /* Charcoal/Dark Green button */
	color: #ffffff;
}

/* Contact Widget (Green Box) */
.ebs-widget-contact {
	background: #064e3b; /* Deep forest green */
	color: #ffffff;
}

.ebs-widget-contact .ebs-widget-title {
	color: #ffffff;
	font-size: 1.5rem;
}

.ebs-widget-contact .ebs-widget-desc {
	color: #a7f3d0; /* Minty white */
}

.ebs-btn-contact {
	background: #022c22; /* Even darker green */
	color: #ffffff;
	border: 1px solid rgba(255, 255, 255, 0.15);
}


/* ==========================================================================
   FALLBACK CLASSIC LAYOUTS STYLING
   ========================================================================== */
.ebs-blog-container {
	font-family: 'Inter', sans-serif;
	margin: 2rem 0;
	width: 100%;
}

.ebs-blog-grid {
	display: grid;
	gap: 2rem;
	width: 100%;
}

.ebs-layout-grid.ebs-cols-3 .ebs-blog-grid {
	grid-template-columns: repeat(3, 1fr);
}

.ebs-layout-grid.ebs-cols-2 .ebs-blog-grid {
	grid-template-columns: repeat(2, 1fr);
}

.ebs-layout-grid.ebs-cols-4 .ebs-blog-grid {
	grid-template-columns: repeat(4, 1fr);
}

.ebs-layout-grid.ebs-cols-1 .ebs-blog-grid {
	grid-template-columns: 1fr;
}


/* ==========================================================================
   RESPONSIVENESS AND SCREEN ADAPTABILITY (Mobile friendly)
   ========================================================================== */
@media (max-width: 1024px) {
	.ebs-magazine-container {
		grid-template-columns: 1fr 1fr; /* Switch to 2-column grid */
		gap: 1.75rem;
	}

	.ebs-column-latest {
		border-right: none;
		padding-right: 0;
	}

	.ebs-column-sidebar {
		grid-column: span 2; /* Sidebar wraps full-width at the bottom */
		flex-direction: row; /* Horizontal widgets display */
	}

	.ebs-widget {
		flex: 1;
	}
}

@media (max-width: 768px) {
	.ebs-magazine-container {
		grid-template-columns: 1fr; /* Stack everything vertically */
		gap: 2rem;
		padding: 0 1rem;
	}

	/* Reorder elements logically so readers see main stories first */
	.ebs-column-latest {
		order: 2; /* latest stories go 2nd */
	}

	.ebs-column-top-stories {
		order: 1; /* top featured stories go 1st */
	}

	.ebs-column-sidebar {
		order: 3; /* widgets go 3rd */
		grid-column: span 1;
		flex-direction: column; /* Stack widgets vertically on mobile */
	}

	.ebs-hero-title {
		font-size: 1.5rem;
	}
}

@media (max-width: 480px) {
	.ebs-middle-grid {
		grid-template-columns: 1fr; /* Middle column cards stack into a single vertical list */
		gap: 1.5rem;
	}
	
	.ebs-hero-content {
		padding: 1.25rem 1rem;
	}

	.ebs-hero-title {
		font-size: 1.3rem;
	}
}

/* ==========================================================================
   PAGINATION STYLING (Neat, Elegant & Tiny Circular Design)
   ========================================================================== */
.ebs-pagination {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	flex-wrap: wrap;
}

.ebs-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 26px;
	height: 26px;
	padding: 0;
	border-radius: 50%;
	border: 1px solid #e2e8f0;
	color: #64748b;
	text-decoration: none;
	font-family: 'Inter', sans-serif;
	font-weight: 500;
	font-size: 0.725rem;
	background-color: #ffffff;
	transition: all 0.15s ease;
}

.ebs-pagination .page-numbers:hover:not(.current) {
	border-color: #94a3b8;
	color: #0f172a;
	background-color: #f8fafc;
}

.ebs-pagination .page-numbers.current {
	background-color: #0f172a;
	color: #ffffff;
	border-color: #0f172a;
	font-weight: 600;
}

.ebs-pagination .page-numbers.prev,
.ebs-pagination .page-numbers.next {
	padding: 0 0.65rem;
	border-radius: 13px;
	font-size: 0.68rem;
	min-width: auto;
}

/* Column Specific Pagination Positions */
.ebs-pagination-latest {
	margin-top: 1.25rem;
	justify-content: flex-start;
}

.ebs-pagination-latest .page-numbers {
	min-width: 22px;
	height: 22px;
	font-size: 0.65rem;
	border-radius: 50%;
}

.ebs-pagination-latest .page-numbers.prev,
.ebs-pagination-latest .page-numbers.next {
	padding: 0 0.45rem;
	border-radius: 11px;
}

.ebs-pagination-top-stories {
	margin-top: 2rem;
	justify-content: center;
}

/* ==========================================================================
   THEME COMPATIBILITY OVERRIDES (Preventing external styles from breaking layouts)
   ========================================================================== */
.ebs-magazine-container .ebs-card-hero a.ebs-hero-link-wrap:hover .ebs-hero-image-wrap img,
.ebs-magazine-container .ebs-card-latest-top a.ebs-card-link:hover .ebs-card-image-wrap img,
.ebs-magazine-container .ebs-card-grid a.ebs-card-link:hover .ebs-card-image-wrap img,
.ebs-blog-container .ebs-card-grid a.ebs-card-link:hover .ebs-card-image-wrap img,
.ebs-magazine-container .ebs-card-hero a.ebs-hero-link-wrap .ebs-hero-image-wrap img,
.ebs-magazine-container .ebs-card-latest-top a.ebs-card-link .ebs-card-image-wrap img,
.ebs-magazine-container .ebs-card-grid a.ebs-card-link .ebs-card-image-wrap img,
.ebs-blog-container .ebs-card-grid a.ebs-card-link .ebs-card-image-wrap img {
	width: 100% !important;
	height: 100% !important;
	max-width: 100% !important;
	max-height: 100% !important;
	object-fit: cover !important;
}

/* Hide theme-inserted hover overlays that mess up layout */
.ebs-magazine-container .image-overlay,
.ebs-blog-container .image-overlay {
	display: none !important;
}

