/* Web Stories Frontend Display Styles */

.web-stories-container {
	width: 100%;
	max-width: 100%;
	margin: 0 auto;
	padding: 0;
}

.web-stories-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 20px;
	padding: 20px;
}

.web-story-card {
	position: relative;
	overflow: hidden;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	transition: all 0.3s ease;
	cursor: pointer;
	aspect-ratio: 9 / 16;
	background: #f0f0f0;
}

.web-story-card:hover {
	box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
	transform: translateY(-4px);
}

.web-story-card img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.web-story-card-overlay {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
	padding: 20px;
	color: white;
	z-index: 2;
}

.web-story-card-title {
	font-size: 16px;
	font-weight: 600;
	margin: 0;
	line-height: 1.3;
}

.web-story-card-meta {
	font-size: 12px;
	margin-top: 5px;
	opacity: 0.8;
}

/* Shortcode display */
.web-stories-shortcode {
	width: 100%;
	max-width: 100%;
}

.web-stories-shortcode amp-story {
	display: block;
	width: 100%;
	height: auto;
}

/* AMP Story Player */
amp-story {
	width: 100%;
	height: auto;
	min-height: 640px;
}

amp-story-page {
	background-color: #fff;
}

amp-story-grid-layer {
	display: grid;
}

/* Text styling in stories */
.story-text {
	color: #333;
	font-size: 16px;
	line-height: 1.5;
	word-wrap: break-word;
}

.story-title {
	font-size: 32px;
	font-weight: 700;
	color: #000;
	margin-bottom: 10px;
}

/* Archive page */
.web-stories-archive {
	padding: 40px 20px;
}

.web-stories-archive h1 {
	text-align: center;
	margin-bottom: 40px;
	font-size: 32px;
	color: #333;
}

.web-stories-archive-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 30px;
	max-width: 1200px;
	margin: 0 auto;
}

.web-story-archive-item {
	position: relative;
	overflow: hidden;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	transition: all 0.3s ease;
	aspect-ratio: 9 / 16;
	background: #f0f0f0;
}

.web-story-archive-item:hover {
	box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
	transform: translateY(-4px);
}

.web-story-archive-item a {
	display: block;
	width: 100%;
	height: 100%;
	text-decoration: none;
	color: inherit;
	position: relative;
	overflow: hidden;
}

.web-story-archive-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.web-story-archive-item:hover img {
	transform: scale(1.05);
}

.web-story-archive-overlay {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
	padding: 20px;
	color: white;
	z-index: 2;
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
}

.web-story-archive-title {
	font-size: 16px;
	font-weight: 600;
	margin: 0;
	line-height: 1.3;
}

.web-story-archive-meta {
	font-size: 12px;
	margin-top: 5px;
	opacity: 0.8;
}

/* Pagination */
.web-stories-pagination {
	display: flex;
	justify-content: center;
	gap: 10px;
	margin-top: 40px;
	flex-wrap: wrap;
}

.web-stories-pagination a,
.web-stories-pagination span {
	padding: 10px 15px;
	border: 1px solid #ddd;
	border-radius: 4px;
	text-decoration: none;
	color: #0073aa;
	transition: all 0.2s;
}

.web-stories-pagination a:hover {
	background: #0073aa;
	color: white;
	border-color: #0073aa;
}

.web-stories-pagination .current {
	background: #0073aa;
	color: white;
	border-color: #0073aa;
}

/* Responsive */
@media (max-width: 768px) {
	.web-stories-grid {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
		gap: 15px;
		padding: 15px;
	}

	.web-stories-archive-grid {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
		gap: 20px;
	}

	.web-story-card-title,
	.web-story-archive-title {
		font-size: 14px;
	}

	.web-story-card-meta,
	.web-story-archive-meta {
		font-size: 11px;
	}
}

@media (max-width: 480px) {
	.web-stories-grid {
		grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
		gap: 10px;
		padding: 10px;
	}

	.web-stories-archive-grid {
		grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
		gap: 15px;
	}

	.web-stories-archive h1 {
		font-size: 24px;
		margin-bottom: 20px;
	}
}

/* Loading state */
.web-stories-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 400px;
	color: #999;
	font-size: 14px;
}

.web-stories-loading::after {
	content: '';
	display: inline-block;
	width: 20px;
	height: 20px;
	margin-left: 10px;
	border: 2px solid #f3f3f3;
	border-top: 2px solid #0073aa;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* Empty state */
.web-stories-empty {
	text-align: center;
	padding: 40px 20px;
	color: #999;
}

.web-stories-empty p {
	font-size: 16px;
	margin: 0;
}
