/*
 * Frontend styles for API Matichonweekly plugin
 * Maintaining existing styles from the original plugin
 */

.matichonweekly-section {
	position: relative;
	overflow: hidden;
	color: #fff;
	z-index: 0;
}

.matichonweekly-section a {
	color: #fff;
}

.matichonweekly-section-background {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

.matichonweekly-section-background img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.matichonweekly-section-header {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 150px;
	gap: 16px;
	margin-block-end: 32px;
	align-items: center;
}

.matichonweekly-section-main-link a {
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
	font-family: "Kanit", sans-serif;
	font-size: 1rem;
	line-height: 1.5;
	color: #fff;
	text-align: center;
	padding: 10px 20px;
	background: #000;
	border-radius: 9999px;
	text-decoration: none;
	transition: background 0.3s ease-in-out;
}

.matichonweekly-section-main-link a svg {
	margin-block-start: 2px;
	margin-inline-start: 4px;
}

.matichonweekly-section-container {
	position: relative;
	z-index: 1;
	width: min(100% - 24px, 1100px);
	margin-inline: auto;
	padding-block-start: 32px;
}

.matichonweekly-section-content {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 32px;
}

@media (min-width: 768px) {
	.matichonweekly-section-content {
		grid-template-columns: minmax(0, 1fr) 280px;
		gap: 16px;
	}

	.matichonweekly-video-section {
		display: none;
	}
}

@media (min-width: 1200px) {
	.matichonweekly-items {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 350px;
		gap: 20px;
	}

	.matichonweekly-video-section {
		display: block;
	}
}

.matichonweekly-news-section-title,
.matichonweekly-video-section-title {
	font-family: "Kanit", sans-serif;
	font-size: 1.625rem;
	font-weight: 500;
	line-height: 1.6;
	margin-block-end: 24px;
}

.matichonweekly-swiper .matichonweekly-item .matichonweekly-thumbnail {
	width: 100%;
	height: auto;
	aspect-ratio: 40/21;
	overflow: hidden;
	border-radius: 8px;
	margin-block-end: 12px;
}

.matichonweekly-swiper .matichonweekly-item .matichonweekly-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease-in-out;
}

.matichonweekly-swiper .matichonweekly-item:hover .matichonweekly-thumbnail img {
	transform: scale(1.05);
}

.matichonweekly-swiper .matichonweekly-item .matichonweekly-category {
	border-width: 1px 0 1px 1px;
	border-style: solid;
	border-image-source: linear-gradient(90deg, #ED1C24 0%, rgba(30, 30, 30, 0) 90%);
	border-image-slice: 1;
	padding: 4px 12px;
	border-radius: 12px;
	font-size: 0.875rem;
	font-weight: 400;
	color: #fff;
	margin-block-end: 8px;
	display: inline-block;
}

.matichonweekly-swiper .matichonweekly-item .matichonweekly-title {
	font-family: "Kanit", sans-serif;
	font-size: 1.25rem;
	font-weight: 500;
	line-height: 1.5;
	margin-block-end: 8px;
	line-clamp: 2;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	transition: all 0.3s ease-in-out;
}

.matichonweekly-swiper .matichonweekly-item:hover .matichonweekly-title {
	color: #ff6d00;
}

.matichonweekly-swiper .matichonweekly-item .matichonweekly-date {
	font-size: 0.875rem;
	font-weight: 400;
	color: #fff;
	margin-block-start: 8px;
}

.matichonweekly-news-section .swiper-pagination {
	--swiper-pagination-bullet-inactive-color: #D7D7D7;
	--swiper-pagination-color: linear-gradient(90deg, #ED1C24 0%, rgba(30, 30, 30, 0) 120%);
	--swiper-pagination-bullet-inactive-opacity: 1;

	position: relative;
	margin-block-start: 24px;
	bottom: 0;
	transition: width 0.3s ease-in-out;
}

.matichonweekly-news-section .swiper-pagination .swiper-pagination-bullet-active {
	width: 32px;
	border-radius: 9999px;
}

.matichonweekly-videos {
	container-type: inline-size;
	container-name: matichonweekly-videos;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 16px;
	padding-block-end: 16px;
}

.matichonweekly-videos .matichonweekly-item {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 8px;
	transition: all 0.3s ease-in-out;
}

@container matichonweekly-videos (min-width: 350px) {
	.matichonweekly-videos .matichonweekly-item {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 16px;
	}
}

.matichonweekly-videos .matichonweekly-item .matichonweekly-thumbnail {
	width: 100%;
	height: auto;
	aspect-ratio: 40/21;
	overflow: hidden;
	border-radius: 8px;
	position: relative;
}

.matichonweekly-videos .matichonweekly-item .matichonweekly-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease-in-out;
}

.matichonweekly-videos .matichonweekly-item:hover .matichonweekly-thumbnail img {
	transform: scale(1.1);
}

.matichonweekly-videos .matichonweekly-item .matichonweekly-thumbnail svg {
	position: absolute;
	bottom: 8px;
	right: 8px;
}

.matichonweekly-videos .matichonweekly-item .matichonweekly-category {
	border-width: 1px 0 1px 1px;
	border-style: solid;
	border-image-source: linear-gradient(90deg, #ED1C24 0%, rgba(30, 30, 30, 0) 90%);
	border-image-slice: 1;
	padding: 0 12px;
	border-radius: 12px;
	font-size: 0.75rem;
	font-weight: 400;
	color: #fff;
	margin-block-end: 4px;
	display: inline-block;
}

.matichonweekly-videos .matichonweekly-item .matichonweekly-title {
	font-family: "Kanit", sans-serif;
	font-size: 0.875rem;
	font-weight: 400;
	line-height: 1.5;
	margin-block-end: 8px;
	line-clamp: 2;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	transition: all 0.3s ease-in-out;
}

.matichonweekly-videos .matichonweekly-item:hover .matichonweekly-title {
	color: #ff6d00;
}

.matichonweekly-videos .matichonweekly-item .matichonweekly-date {
	font-size: 0.875rem;
	font-weight: 400;
	color: #fff;
	margin-block-start: 4px;
}

.matichonweekly-section-magazine {
	width: min(100%, 350px);
	margin-inline: auto;
	background: linear-gradient(29.66deg, #ED1C24 31.86%, rgba(30, 30, 30, 0) 120%);
	padding: 1px 1px 0 1px;
	border-radius: 8px 8px 0 0;
	overflow: hidden;
}

.matichonweekly-section-magazine-container {
	overflow: hidden;
	border-radius: 8px 8px 0 0;
	background: linear-gradient(181.14deg, #000000 -15.94%, #020000 7.96%, #090101 31.66%, #150202 51.72%, #270404 66.3%, #3E0606 80.89%, #5A0909 91.82%, #7C0D0D 104.58%, #A41111 113.7%, #CF1616 122.82%, #DD1818 126.46%);
	padding: 24px 16px;
	height: 100%;
}

.matichonweekly-section-magazine-cover {
	padding: 16px;
	border-radius: 8px;
	overflow: hidden;
	background-color: #000;
}

.matichonweekly-section-magazine-cover img {
	width: 100%;
	height: auto;
	display: block;
}

.matichonweekly-section-magazine-title {
	font-family: "Kanit", sans-serif;
	font-size: 1rem;
	font-weight: 400;
	color: #fff;
	text-align: center;
	margin-bottom: 16px;
}

.matichonweekly-section-magazine-title strong {
	font-size: 1.25rem;
}

.matichonweekly-section-magazine-title small {
	margin-block-end: 8px;
	display: inline-block;
}

.matichonweekly-section-magazine-link a {
	font-family: "Kanit", sans-serif;
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 16px 20px;
	background: #000000;
	border-radius: 12px;
	color: #FFFFFF;
	margin-block-start: 24px;
	text-decoration: none;
	transition: background-color 0.3s ease-in-out;
}

.matichonweekly-section-magazine-link a:hover {
	background-color: #333;
}

/* Error styling */
.matichonweekly-error {
	color: #721c24;
	background-color: #f8d7da;
	border: 1px solid #f5c6cb;
	padding: 12px 16px;
	border-radius: 4px;
	margin: 16px 0;
	font-size: 14px;
}

/* Loading states */
.matichonweekly-loading {
	text-align: center;
	padding: 32px;
	color: #666;
}

.matichonweekly-loading::after {
	content: "";
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 2px solid #f3f3f3;
	border-top: 2px solid #ED1C24;
	border-radius: 50%;
	animation: matichonweekly-spin 1s linear infinite;
	margin-left: 8px;
}

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

/* Accessibility improvements */
.matichonweekly-section a:focus {
	outline: 2px solid #ED1C24;
	outline-offset: 2px;
}

/* Print styles */
@media print {
	.matichonweekly-section {
		color: #000;
		background: #fff;
	}

	.matichonweekly-section-background {
		display: none;
	}

	.matichonweekly-section a {
		color: #000;
		text-decoration: underline;
	}
}
