/**
 * Public-facing styles for News Releases plugin
 */

/* CSS variables are scoped to plugin-specific wrapper classes to prevent conflicts with other plugins */
.ct-news-releases-list-wrapper,
.ct-news-releases-grid-wrapper {
	margin: 30px 0;
	font-size: var(--ct-news-font-size-base, 16px);
}

/* Filter Position: Left (Default) */
.ct-filter-position-left .ct-news-releases-layout {
	display: grid;
	grid-template-columns: var(--ct-news-sidebar-width, 250px) 1fr;
	gap: 20px;
	min-height: 600px;
}

/* Filter Position: Right */
.ct-filter-position-right .ct-news-releases-layout {
	display: grid;
	grid-template-columns: 1fr var(--ct-news-sidebar-width, 250px);
	gap: 20px;
	min-height: 600px;
}

.ct-filter-position-right .ct-news-releases-filters-sidebar {
	order: 2;
}

.ct-filter-position-right .ct-news-releases-listing {
	order: 1;
}

/* Filter Position: Top */
.ct-filter-position-top .ct-news-releases-layout {
	display: flex;
	flex-direction: column;
	gap: 20px;
	min-height: auto;
}

.ct-filter-position-top .ct-news-releases-filters-sidebar {
	order: 1;
	min-height: auto;
}

.ct-filter-position-top .ct-news-releases-listing {
	order: 2;
}

/* Hide filters when show_filter is 'no' */
.ct-news-releases-list-wrapper[data-show-filter="no"] .ct-news-releases-filters-sidebar,
.ct-news-releases-grid-wrapper[data-show-filter="no"] .ct-news-releases-filters-sidebar {
	display: none;
}

.ct-news-releases-list-wrapper[data-show-filter="no"] .ct-news-releases-layout,
.ct-news-releases-grid-wrapper[data-show-filter="no"] .ct-news-releases-layout {
	grid-template-columns: 1fr;
}

/* Filters Sidebar */
.ct-news-releases-filters-sidebar {
	background: var(--ct-news-filter-sidebar-bg, #f8f9fa);
	padding: 20px;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Sticky sidebar for left and right positions */
.ct-filter-position-left .ct-news-releases-filters-sidebar,
.ct-filter-position-right .ct-news-releases-filters-sidebar {
	position: sticky;
	top: 20px;
	height: fit-content;
}

.ct-news-releases-filters-sidebar h3 {
	margin: 0 0 20px 0;
	font-size: 18px;
	font-weight: 700;
	color: #333;
}

.ct-filter-group {
	margin-bottom: 25px;
}

.ct-filter-group:last-child {
	margin-bottom: 0;
}

.ct-filter-group label {
	display: block;
	font-weight: 600;
	margin-bottom: 10px;
	color: #333;
}

.ct-filter-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ct-filter-list li {
	margin-bottom: 8px;
}
.ct-news-releases-filters-sidebar .ct-filter-list label {
	color: #1f2c38 !important;
}

.ct-filter-list label {
	font-weight: normal;
	cursor: pointer;
	display: flex;
	align-items: center;
	padding: 8px 12px;
	border-radius: 4px;
	transition: all 0.2s;
}

.ct-filter-list label:hover {
	background: rgba(0, 0, 0, 0.05);
}

.ct-filter-radio:checked + span {
	font-weight: 600;
}

.ct-filter-list input[type="radio"] {
	margin-right: 8px;
}

/* Hierarchical category dropdowns in filter sidebars */
.ct-news-releases-filters-sidebar .ct-filter-parent {
	margin-bottom: 8px;
}

.ct-news-releases-filters-sidebar .ct-filter-parent-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
}

.ct-news-releases-filters-sidebar .ct-filter-parent-header label {
	flex: 1;
	margin: 0;
}

.ct-news-releases-filters-sidebar .ct-filter-toggle {
	background: none;
	border: none;
	cursor: pointer;
	padding: 8px 12px;
	color: #666;
	font-size: 12px;
	transition: all 0.2s;
	border-radius: 4px;
	margin-left: 4px;
}

.ct-news-releases-filters-sidebar .ct-filter-toggle:hover {
	color: #0073aa;
	background: rgba(0, 0, 0, 0.05);
}

.ct-news-releases-filters-sidebar .ct-filter-toggle-icon {
	display: inline-block;
	transition: transform 0.2s ease;
	margin-left: 4px;
}

.ct-news-releases-filters-sidebar .ct-filter-toggle-icon.rotated {
	transform: rotate(-90deg);
}

.ct-news-releases-filters-sidebar .ct-filter-children {
	list-style: none;
	padding: 0;
	margin: 0;
	background: rgba(0, 0, 0, 0.02);
	border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.ct-news-releases-filters-sidebar .ct-filter-children li {
	margin-bottom: 8px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.ct-news-releases-filters-sidebar .ct-filter-children li:last-child {
	border-bottom: none;
	margin-bottom: 0;
}

.ct-news-releases-filters-sidebar .ct-filter-children label {
	padding-left: 32px;
	font-weight: 400;
	font-size: 14px;
}

/* News Releases Listing */
.ct-news-releases-listing {
	background: #fff;
}

.ct-news-releases-list {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.ct-news-release-item {
	display: flex;
	gap: 20px;
	padding: 20px 0;
	border-bottom: 1px solid #e0e0e0;
	margin-bottom: 0;
	background: transparent;
	border-radius: 0;
	box-shadow: none;
	transition: none;
	align-items: flex-start;
}

.ct-news-release-item:last-child {
	border-bottom: none;
	padding-bottom: 0;
}

.ct-news-release-item:hover {
	box-shadow: none;
}

.ct-news-release-image-wrapper {
	flex-shrink: 0;
	width: 200px;
	position: relative;
}

.ct-news-release-image {
	display: block;
	width: 200px;
	height: 200px;
	overflow: hidden;
	border-radius: 0;
	background: #f0f0f0;
}

.ct-news-release-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
	display: block;
}

.ct-news-release-category-tags {
	position: absolute;
	bottom: 0;
	left: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	padding: 4px;
}

.ct-news-category-tag {
	display: inline-block;
	padding: 4px 8px;
	background: var(--ct-news-category-tag-bg, #ffd700);
	color: var(--ct-news-category-tag-text, #000000);
	border-radius: 0;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	line-height: 1.2;
	white-space: nowrap;
}

.ct-news-release-content {
	flex: 1;
	padding-top: 0;
	min-width: 0;
}

.ct-news-release-meta {
	margin-bottom: 8px;
	font-size: var(--ct-news-font-size-date, 14px);
	color: var(--ct-news-date-color, #666);
	line-height: 1.4;
}

.ct-news-release-date {
	display: flex;
	align-items: center;
	gap: 6px;
}

.ct-date-icon {
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	vertical-align: middle;
}

.ct-news-release-title {
	margin: 0 0 10px 0;
	font-size: var(--ct-news-font-size-title, 24px);
	color: var(--ct-news-title-color, #333);
	font-weight: 700;
	line-height: 1.3;
}

.ct-news-release-title a {
	color: inherit;
	text-decoration: none;
}

.ct-news-release-title a:hover {
	text-decoration: underline;
	color: #0073aa;
}

.ct-news-release-read-more {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 12px;
	color: var(--ct-news-title-color, #333);
	text-decoration: none;
	font-weight: 500;
	font-size: var(--ct-news-font-size-base, 16px);
	transition: color 0.2s ease;
}

.ct-news-release-read-more:hover {
	color: var(--ct-news-filter-active-bg, #0073aa);
	text-decoration: none;
}

/* Button Style */
.ct-news-release-read-more.ct-read-more-button-style {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 12px;
	padding: 10px 20px;
	background-color: #0073aa;
	color: #ffffff;
	text-decoration: none;
	font-weight: 500;
	font-size: var(--ct-news-font-size-base, 16px);
	border-radius: 4px;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.ct-news-release-read-more.ct-read-more-button-style:hover {
	background-color: var(--ct-read-more-bg-hover, #005a87);
	color: var(--ct-read-more-text-hover, #ffffff);
	text-decoration: none;
}

.ct-read-more-text {
	order: 1;
}

.ct-read-more-icon {
	order: 2;
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	transition: transform 0.2s ease, fill 0.2s ease;
	fill: currentColor;
}

.ct-news-release-read-more:hover .ct-read-more-icon {
	transform: translateX(4px);
}

.ct-news-release-read-more.ct-read-more-button-style .ct-read-more-icon {
	fill: currentColor;
}

.ct-news-release-excerpt {
	margin-bottom: 0;
	font-size: var(--ct-news-font-size-excerpt, 16px);
	color: var(--ct-news-excerpt-color, #555);
	line-height: 1.6;
}

/* Grid View */
.ct-news-releases-grid {
	display: grid;
	grid-template-columns: repeat(var(--ct-news-grid-columns, 3), 1fr);
	gap: 30px;
}

.ct-news-release-card {
	background: var(--ct-news-card-bg, #ffffff);
	border: 1px solid var(--ct-news-card-border, #e0e0e0);
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
	transition: box-shadow 0.3s;
	display: flex;
	flex-direction: column;
}

.ct-news-release-card:hover {
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.ct-news-release-card .ct-news-release-image {
	width: 100%;
	height: 200px;
	overflow: hidden;
}

.ct-news-release-card .ct-news-release-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ct-news-release-card .ct-news-release-content {
	padding: 20px;
	flex: 1;
	display: flex;
	flex-direction: column;
}

/* Pagination */
.ct-news-releases-pagination {
	margin-top: 30px;
	text-align: center;
}

.ct-load-more-btn {
	padding: 12px 30px;
	background: var(--ct-news-filter-active-bg, #0073aa);
	color: var(--ct-news-filter-active-text, #ffffff);
	border: none;
	border-radius: 4px;
	font-size: 16px;
	cursor: pointer;
	transition: opacity 0.3s;
}

.ct-load-more-btn:hover {
	opacity: 0.9;
}

.ct-load-more-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Loading */
.ct-news-releases-loading {
	text-align: center;
	padding: 40px;
}

/* Responsive */
@media (max-width: 1024px) {
	.ct-filter-position-left .ct-news-releases-layout,
	.ct-filter-position-right .ct-news-releases-layout {
		grid-template-columns: 200px 1fr;
		gap: 15px;
	}

	.ct-news-releases-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 20px;
	}
}

@media (max-width: 768px) {
	.ct-filter-position-left .ct-news-releases-layout,
	.ct-filter-position-right .ct-news-releases-layout,
	.ct-filter-position-top .ct-news-releases-layout {
		grid-template-columns: 1fr;
		flex-direction: column;
		gap: 20px;
	}

	.ct-news-releases-filters-sidebar {
		margin-bottom: 20px;
	}

	.ct-news-release-item {
		flex-direction: column;
	}

	.ct-news-release-image-wrapper {
		width: 100%;
	}

	.ct-news-release-image {
		width: 100%;
		height: auto;
		min-height: 200px;
	}

	.ct-news-releases-grid {
		grid-template-columns: 1fr;
	}
}

/* Category Archive Pages */
.ct-news-category-archive {
	max-width: 1200px;
	margin: 0 auto;
	padding: 40px 20px;
}

.ct-news-category-header {
	margin-bottom: 30px;
}

.ct-category-title {
	font-size: 36px;
	font-weight: 700;
	margin: 0 0 15px 0;
	color: #333;
}

.ct-category-description {
	font-size: 16px;
	color: #666;
	line-height: 1.6;
}

.ct-news-category-layout {
	display: grid;
	gap: 30px;
}

/* Sidebar Position: Left */
.ct-sidebar-position-left.ct-news-category-layout {
	grid-template-columns: var(--ct-news-sidebar-width, 250px) 1fr;
}

/* Sidebar Position: Right */
.ct-sidebar-position-right.ct-news-category-layout {
	grid-template-columns: 1fr var(--ct-news-sidebar-width, 250px);
}

.ct-sidebar-position-right .ct-category-sidebar {
	order: 2;
}

.ct-sidebar-position-right .ct-news-category-content {
	order: 1;
}

/* Hide sidebar when setting is 'no' */
.ct-news-category-layout[data-sidebar-show="no"] {
	grid-template-columns: 1fr;
}

.ct-news-category-layout[data-sidebar-show="no"] .ct-category-sidebar {
	display: none;
}

/* Category Sidebar Navigation */
.ct-category-sidebar {
	background: var(--ct-news-filter-sidebar-bg, #f8f9fa);
	padding: 20px;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	height: fit-content;
	position: sticky;
	top: 20px;
}

.ct-category-nav-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ct-category-nav-item {
	margin: 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.ct-category-nav-item:last-child {
	border-bottom: none;
}

.ct-category-nav-item a {
	display: block;
	padding: 12px 16px;
	color: #333;
	text-decoration: none;
	font-weight: 500;
	transition: all 0.2s;
	border-radius: 4px;
	margin: 4px 0;
}

.ct-category-nav-item a:hover {
	background: rgba(0, 0, 0, 0.05);
	color: #0073aa;
}

/* Parent category with children */
.ct-filter-parent {
	margin-bottom: 0;
}

.ct-filter-parent-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
}

.ct-filter-parent-header a {
	flex: 1;
	margin: 0;
	padding: 12px 16px;
}

.ct-filter-toggle {
	background: none;
	border: none;
	cursor: pointer;
	padding: 12px 16px;
	color: #666;
	font-size: 12px;
	transition: all 0.2s;
	border-radius: 4px;
	margin-left: 4px;
}

.ct-filter-toggle:hover {
	color: #0073aa;
	background: rgba(0, 0, 0, 0.05);
}

.ct-filter-toggle-icon {
	display: inline-block;
	transition: transform 0.2s ease;
	margin-left: 4px;
}

.ct-filter-toggle-icon.rotated {
	transform: rotate(-90deg);
}

.ct-filter-children {
	list-style: none;
	padding: 0;
	margin: 0;
	background: rgba(0, 0, 0, 0.02);
	border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.ct-filter-children li {
	margin-bottom: 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.ct-filter-children li:last-child {
	border-bottom: none;
}

.ct-filter-children a {
	padding-left: 32px;
	font-weight: 400;
	font-size: 14px;
}

.ct-category-nav-item.active a {
	background: var(--ct-news-filter-active-bg, #0073aa);
	color: var(--ct-news-filter-active-text, #ffffff);
	font-weight: 600;
}

/* Category Content Area */
.ct-news-category-content {
	min-width: 0;
}

/* Pagination */
.ct-pagination {
	margin-top: 40px;
	text-align: center;
}

.ct-pagination .page-numbers {
	display: inline-block;
	padding: 8px 12px;
	margin: 0 4px;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	text-decoration: none;
	color: #333;
	transition: all 0.2s;
}

.ct-pagination .page-numbers:hover,
.ct-pagination .page-numbers.current {
	background: var(--ct-news-filter-active-bg, #0073aa);
	color: var(--ct-news-filter-active-text, #ffffff);
	border-color: var(--ct-filter-active-bg);
}

/* Responsive Category Pages */
@media (max-width: 768px) {
	.ct-news-category-archive {
		padding: 20px 15px;
	}

	.ct-category-title {
		font-size: 28px;
	}

	.ct-news-category-layout {
		grid-template-columns: 1fr !important;
	}

	.ct-category-sidebar {
		position: static;
		margin-bottom: 30px;
	}
}
