/* ==========================================================================
   Elementor Multisite Posts – Frontend Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   Widget root & CSS custom properties
   -------------------------------------------------------------------------- */
.emp-widget {
	--emp-columns: 3;
	--emp-gap: 24px;
	--emp-accent: #0073aa;
}

/* --------------------------------------------------------------------------
   Responsive grid
   -------------------------------------------------------------------------- */
.emp-grid {
	display: grid;
	grid-template-columns: repeat( var( --emp-columns ), 1fr );
	gap: var( --emp-gap );
	align-items: stretch;
}

/* Tablet: cap at 2 if widget is set to more */
@media ( max-width: 1024px ) {
	.emp-grid {
		grid-template-columns: repeat( min( var( --emp-columns ), 2 ), 1fr );
	}
}

/* Mobile: single column */
@media ( max-width: 600px ) {
	.emp-grid {
		grid-template-columns: 1fr;
	}
}

/* --------------------------------------------------------------------------
   Card
   -------------------------------------------------------------------------- */
.emp-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.1 );
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.emp-card:not( .emp-card--skeleton ):hover {
	transform: translateY( -3px );
	box-shadow: 0 6px 20px rgba( 0, 0, 0, 0.15 );
}

/* Image area */
.emp-card__image {
	flex-shrink: 0;
	overflow: hidden;
}

.emp-card__image-link {
	display: block;
	line-height: 0;
}

.emp-card__image img {
	width: 100%;
	height: 200px;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.emp-card:hover .emp-card__image img {
	transform: scale( 1.04 );
}

.emp-card__image-placeholder {
	width: 100%;
	height: 200px;
	background-color: #e8e8e8;
}

/* Body */
.emp-card__body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 16px;
	flex: 1;
}

/* Source label */
.emp-card__source {
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #666;
}

/* Title */
.emp-card__title {
	margin: 0;
	font-size: 17px;
	line-height: 1.35;
}

.emp-card__title a {
	color: inherit;
	text-decoration: none;
}

.emp-card__title a:hover,
.emp-card__title a:focus-visible {
	text-decoration: underline;
}

/* Date */
.emp-card__date {
	display: block;
	font-size: 13px;
	color: #888;
}

/* More link */
.emp-card__more {
	margin-top: auto;
	display: inline-block;
	color: var( --emp-accent );
	text-decoration: none;
	font-size: 14px;
	font-weight: 600;
}

.emp-card__more:hover,
.emp-card__more:focus-visible {
	text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Skeleton / loading shimmer
   -------------------------------------------------------------------------- */
.emp-card--skeleton {
	pointer-events: none;
	user-select: none;
}

.emp-skeleton {
	border-radius: 4px;
	background: linear-gradient( 90deg, #e4e4e4 25%, #f0f0f0 50%, #e4e4e4 75% );
	background-size: 200% 100%;
	animation: emp-shimmer 1.6s ease-in-out infinite;
}

@keyframes emp-shimmer {
	0%   { background-position:  200% 0; }
	100% { background-position: -200% 0; }
}

.emp-skeleton--image {
	width: 100%;
	height: 200px;
	border-radius: 0;
}

.emp-skeleton--source {
	height: 11px;
	width: 30%;
}

.emp-skeleton--title {
	height: 18px;
	width: 90%;
}

.emp-skeleton--title + .emp-skeleton--title {
	width: 70%;
}

.emp-skeleton--date {
	height: 13px;
	width: 45%;
}

/* Prevent Elementor from showing its own "empty widget" placeholder while
   the grid is waiting for JS to populate it (editor initial render). */
.emp-grid:empty {
	min-height: 120px;
}

/* --------------------------------------------------------------------------
   Empty / error states
   -------------------------------------------------------------------------- */
.emp-no-posts,
.emp-error {
	grid-column: 1 / -1;
	text-align: center;
	padding: 48px 16px;
	color: #888;
	font-size: 15px;
}

.emp-error {
	color: #c0392b;
}

/* --------------------------------------------------------------------------
   Numbered pagination
   -------------------------------------------------------------------------- */
.emp-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: center;
	margin-top: 32px;
}

.emp-page-btn {
	min-width: 38px;
	height: 38px;
	padding: 0 10px;
	border: 1px solid #d0d0d0;
	background: #fff;
	color: #333;
	border-radius: 4px;
	font-size: 14px;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
	line-height: 1;
}

.emp-page-btn:hover:not( :disabled ) {
	background: #f0f7fb;
	border-color: var( --emp-accent );
	color: var( --emp-accent );
}

.emp-page-btn.is-active {
	background: var( --emp-accent );
	border-color: var( --emp-accent );
	color: #fff;
	font-weight: 700;
	cursor: default;
}

.emp-page-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   Load-more pagination
   -------------------------------------------------------------------------- */
.emp-load-more-wrap {
	display: flex;
	justify-content: center;
	margin-top: 32px;
}

.emp-load-more-btn {
	padding: 12px 36px;
	background: var( --emp-accent );
	color: #fff;
	border: none;
	border-radius: 4px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s, opacity 0.2s;
}

.emp-load-more-btn:hover:not( :disabled ) {
	filter: brightness( 1.1 );
}

.emp-load-more-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   Editor preview hint
   -------------------------------------------------------------------------- */
.emp-widget--preview .emp-grid {
	pointer-events: none;
}
