/* Post Gallery Shortcode Styles */

:root {
	--itg-font-family: 'Outfit', sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--itg-font-family);
}

.itg-post-gallery-container {
	font-family: var(--itg-font-family);
	width: 100%;
	margin: 0 auto;
	padding: 0;
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 2rem;
}

.itg-gallery-controls {
	background: transparent;
	padding: 0;
	border-radius: 12px;
	margin-bottom: 0;
	min-width: 280px;
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	grid-column: 1;
	grid-row: 1 / -1;
}

.itg-gallery-controls .form-control,
.itg-gallery-controls .form-select {
	border: 1px solid #143A4D;
	border-radius: 8px;
	padding: 0.875rem;
	font-size: 0.95rem;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	background-color: #fff;
	color: #143A4D;
	font-family: 'Outfit', sans-serif;
}

.itg-gallery-controls .form-control::placeholder {
	color: var(--muted-darker);
}

.itg-gallery-controls .form-control:focus,
.itg-gallery-controls .form-select:focus {
	border-color: var(--primary-light);
	box-shadow: 0 0 0 0.2rem rgba(20, 58, 77, 0.15);
	outline: none;
}

.itg-gallery-controls .form-select {
	appearance: none;
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23143A4D' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
	background-repeat: no-repeat;
	background-position: right 0.875rem center;
	background-size: 16px 12px;
	padding-right: 2.5rem;
}

.itg-gallery-controls label {
	font-size: 0.9rem;
	font-weight: 600;
	color: #143A4D;
	margin-bottom: 0.5rem;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	display: block;
	font-family: 'Outfit', sans-serif;
}

.itg-gallery-controls > div {
	display: flex;
	flex-direction: column;
}

/* Control Card Styling */
.itg-control-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 18px;
	padding: 1.5rem;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.itg-control-card label {
	margin-bottom: 0.75rem;
}

/* Multi-select Category Dropdown */
/* Category Checkboxes */
.itg-category-checkboxes {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.itg-category-item {
	display: flex;
	align-items: center;
	padding: 0.5rem 0;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.itg-category-item:hover {
	background-color: transparent;
}

.itg-category-item input[type="checkbox"] {
	margin-right: 0.75rem;
	cursor: pointer;
	accent-color: #98D7DC;
}

.itg-category-item label {
	margin: 0;
	cursor: pointer;
	font-size: 0.95rem;
	color: #143A4D;
	text-transform: none;
	letter-spacing: normal;
	font-weight: normal;
	font-family: 'Outfit', sans-serif;
}

.itg-gallery-posts {
	flex: 1;
	display: flex;
	flex-wrap: wrap;
	margin-right: -0.5rem;
	margin-left: -0.5rem;
	grid-column: 2;
	grid-row: 1;
}

.itg-no-results-message {
	text-align: center;
	padding: 2rem;
	border-radius: 12px;
	color: var(--primary);
	font-weight: 500;
}

.itg-post-gallery-container .row {
	display: flex;
	flex-wrap: wrap;
	margin-right: -0.5rem;
	margin-left: -0.5rem;
}

.itg-post-gallery-container .row > [class*="col-"] {
	padding-right: 0.5rem;
	padding-left: 0.5rem;
	display: flex;
	box-sizing: border-box;
}

/* Column width definitions */
.itg-post-gallery-container .col-md-1 { width: 8.333%; }
.itg-post-gallery-container .col-md-2 { width: 16.666%; }
.itg-post-gallery-container .col-md-3 { width: 25%; }
.itg-post-gallery-container .col-md-4 { width: 33.333%; }
.itg-post-gallery-container .col-md-6 { width: 50%; }
.itg-post-gallery-container .col-md-12 { width: 100%; }

/* Responsive adjustments for sidebar layout */
@media (max-width: 1095px) {
	.itg-post-gallery-container .col-md-4 { 
		width: 50%; 
	}
}

@media (max-width: 1024px) {
	.itg-post-gallery-container {
		gap: 1.5rem;
	}

	.itg-gallery-controls {
		min-width: 240px;
	}
}

@media (max-width: 768px) {
	.itg-post-gallery-container {
		grid-template-columns: 1fr;
		gap: 1.5rem;
	}

	.itg-gallery-controls {
		grid-column: 1;
		grid-row: 1;
		flex-direction: row;
		flex-wrap: wrap;
		min-width: 100%;
		gap: 1rem;
	}

	.itg-gallery-controls > div {
		flex: 1;
		min-width: 150px;
	}

	.itg-gallery-posts {
		grid-column: 1;
		grid-row: 2;
		margin-left: 0 !important;
		margin-right: 0 !important;
	}

	.itg-gallery-pagination {
		grid-column: 1;
		grid-row: 3;
	}

	.itg-category-dropdown {
		min-width: 150px;
	}
}

.itg-post-card {
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	overflow: hidden;
	border: none;
	display: flex;
	flex-direction: column;
	border-radius: 18px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
	height: 100%;
	min-height: 500px;
}

.itg-post-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
	cursor: pointer;
}

.itg-post-image-wrapper {
	position: relative;
	overflow: hidden;
	height: 250px;
	background-color: #f0f0f0;
	border-radius: 16px 16px 0 0;
}

.itg-post-image-wrapper img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.itg-post-card:hover .itg-post-image-wrapper img {
	transform: scale(1.05);
}

.itg-post-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: rgba(0, 0, 0, 0.7);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.itg-post-overlay .btn {
	background: var(--primary);
	color: #fff;
	transition: background 0.2s, color 0.2s;
}

.itg-post-overlay .btn:hover {
	background: var(--secondary);
	color: #fff;
	border-color: var(--secondary);
}

.itg-post-card:hover .itg-post-overlay {
	opacity: 1;
}

.itg-post-card .card-body {
	padding: 1.5rem;
	flex-grow: 1;
	background: #fff;
}

.itg-post-meta {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	font-size: 0.85rem;
	color: #B0B0B0;
	margin-bottom: 0.75rem;
	flex-wrap: wrap;
}

.itg-post-meta small {
	display: flex;
	align-items: center;
	gap: 0.35rem;
}

.itg-post-meta i {
	margin-right: 0;
}

.itg-post-categories {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
	margin-top: 0.5rem;
}

.itg-post-badge {
	display: inline-block;
	background: #f6fafd;
	border: 1px solid #e1f5fe;
	color: #143A4D;
	font-size: 0.8rem;
	font-weight: 600;
	padding: 4px 12px;
	border-radius: 20px;
	text-decoration: none;
	transition: background 0.2s, border-color 0.2s;
}

.itg-post-badge:hover {
	background: #e1f5fe;
	border-color: #143A4D;
	color: #143A4D;
}

.itg-post-card .card-title {
	font-size: 1.1rem;
	font-weight: 600;
	margin-bottom: 0.75rem;
	line-height: 1.4;
}

.itg-post-card .card-title a {
	color: #143A4D;
	text-decoration: none;
	transition: color 0.2s ease;
}

.itg-post-card .card-title a:hover {
	color: var(--primary);
}

.itg-post-card .card-text {
	font-size: 0.95rem;
	line-height: 1.5;
	margin-bottom: 1rem;
	color: #143A4D;
}

.itg-read-more-link {
	color: var(--primary);
	text-decoration: none;
	font-weight: 600;
	transition: all 0.2s ease;
	white-space: nowrap;
	display: inline-block;
	margin-left: 0.5rem;
}

.itg-read-more-link:hover {
	color: var(--primary-light);
	text-decoration: none;
}

.itg-post-footer {
	margin-top: auto;
	padding-top: 1rem;
	border-top: 1px solid #e9ecef;
	font-size: 0.85rem;
}

.itg-post-footer i {
	margin-right: 0.25rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
	.itg-post-image-wrapper {
		height: 200px;
	}

	.itg-post-card .card-title {
		font-size: 1rem;
	}

	.itg-post-card .card-text {
		font-size: 0.9rem;
	}
}

@media (max-width: 576px) {
	.itg-post-image-wrapper {
		height: 200px;
	}

	.itg-post-card .card-body {
		padding: 1rem;
	}

	.itg-post-meta {
		font-size: 0.8rem;
	}
}

/* Pagination Styles */
.itg-gallery-pagination {
	display: flex;
	justify-content: center;
	width: 100%;
	margin-top: 2rem;
	margin-bottom: 0;
	padding-top: 1.5rem;
	border-top: 1px solid #e0e0e0;
	grid-column: 2;
	grid-row: 2;
}

.itg-gallery-pagination .pagination {
	display: flex;
	list-style: none;
	padding: 0;
	margin: 0;
	gap: 0.25rem;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
}

.itg-gallery-pagination .page-item {
	display: inline-block;
}

.itg-gallery-pagination .page-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 32px;
	height: 32px;
	padding: 0.4rem 0.6rem;
	color: #143A4D;
	background-color: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	text-decoration: none;
	font-weight: 500;
	font-family: 'Outfit', sans-serif;
	font-size: 0.9rem;
	transition: all 0.3s ease;
	cursor: pointer;
}

.itg-gallery-pagination .page-link:hover:not(.disabled) {
	color: #fff;
	background-color: #143A4D;
	border-color: #143A4D;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(20, 58, 77, 0.2);
}

.itg-gallery-pagination .page-item.active .page-link {
	color: #fff;
	background-color: #143A4D;
	border-color: #143A4D;
	cursor: default;
}

.itg-gallery-pagination .page-item.disabled .page-link {
	color: #b0b0b0;
	background-color: #f5f5f5;
	border-color: #e0e0e0;
	cursor: not-allowed;
}

@media (max-width: 576px) {
	.itg-gallery-pagination {
		margin-top: 1.5rem;
	}

	.itg-gallery-pagination .page-link {
		min-width: 28px;
		height: 28px;
		padding: 0.25rem 0.4rem;
		font-size: 0.8rem;
	}
}
