/**
 * Three60 Post - Frontend Styling (Grid, Cards, Carousel & Modal)
 *
 * @package Three60_Post
 */

.three60-posts-wrapper {
	width: 100%;
	position: relative;
	box-sizing: border-box;
}

.three60-posts-grid {
	display: grid;
	grid-template-columns: repeat(var(--three60-cols, 3), 1fr);
	gap: 20px;
	box-sizing: border-box;
	margin-bottom: 20px;
}

.three60-posts-carousel {
	display: flex;
	overflow-x: auto;
	gap: 20px;
	padding-bottom: 10px;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
}

.three60-posts-carousel::-webkit-scrollbar {
	height: 8px;
}

.three60-posts-carousel::-webkit-scrollbar-thumb {
	background-color: #ccc;
	border-radius: 4px;
}

.three60-post-card {
	box-sizing: border-box;
	margin: 0;
	background: #fff;
	border: 1px solid #eee;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
	display: flex;
	flex-direction: column;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.three60-post-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.three60-posts-carousel .three60-post-card {
	flex: 0 0 calc(((100% - (20px * (var(--three60-cols, 3) - 1))) / var(--three60-cols, 3)) - 1px);
	min-width: 250px;
	scroll-snap-align: start;
}

.three60-posts-grid .three60-post-card {
	width: 100%;
	min-width: 0;
}

.three60-post-image {
	width: 100%;
	height: 200px;
	background-size: cover;
	background-position: center;
	border-bottom: 1px solid #eee;
}

.three60-post-body {
	padding: 20px;
	flex-grow: 1;
	font-size: 14px;
	line-height: 1.6;
	color: #444;
}

.three60-post-title {
	margin: 0 0 10px 0;
	font-size: 18px;
	font-weight: bold;
	color: #222;
}

.three60-post-read-more {
	color: #0073aa;
	text-decoration: none;
	font-weight: bold;
	display: inline-block;
	margin-top: 5px;
	cursor: pointer;
}

.three60-post-read-more:hover {
	text-decoration: underline;
}

.three60-post-footer {
	padding: 15px 20px;
	border-top: 1px solid #eee;
	font-size: 12px;
	color: #888;
	display: flex;
	justify-content: space-between;
	background: #fafafa;
}

.three60-post-source {
	font-weight: bold;
	color: #555;
}

/* Modal Popup */
.three60-post-modal-overlay {
	display: none;
	position: fixed;
	z-index: 99999;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(3px);
	align-items: center;
	justify-content: center;
}

.three60-post-modal-box {
	background-color: #fff;
	margin: auto;
	border-radius: 8px;
	max-width: 650px;
	width: 95%;
	max-height: 90vh;
	overflow-y: auto;
	position: relative;
	box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
}

.three60-post-modal-close {
	position: absolute;
	top: 15px;
	right: 20px;
	font-size: 28px;
	font-weight: bold;
	color: #fff;
	cursor: pointer;
	line-height: 1;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
	background: rgba(0, 0, 0, 0.3);
	width: 36px;
	height: 36px;
	text-align: center;
	border-radius: 50%;
	border: none;
	padding: 0;
	outline: none;
	transition: background-color 0.2s ease;
}

.three60-post-modal-close:hover,
.three60-post-modal-close:focus {
	background: rgba(0, 0, 0, 0.6);
}

.three60-modal-hero-image {
	width: 100%;
	height: 300px;
	background-size: cover;
	background-position: center;
}

.three60-modal-inner {
	padding: 30px;
}

@media (max-width: 768px) {
	.three60-posts-carousel {
		flex-direction: column;
		overflow-x: hidden;
		scroll-snap-type: none;
	}

	.three60-posts-carousel .three60-post-card {
		flex: 1 1 100%;
		width: 100%;
		min-width: 100%;
		margin-bottom: 20px;
	}

	.three60-posts-grid {
		grid-template-columns: 1fr;
	}
}
