/* ==========================================================================
   DESERT TO GLOBAL (D2G) - POSTS GRID / RELATED STORIES WIDGET STYLES
   Exact reproduction of Page Templates/single-post.html (Lines 446-503)
   Colors:
     - Desert Night: #0B3D36 (Headers, cards, badge backgrounds)
     - Desert Gold:  #C89B5B (Badge text, title hover, read more icons)
     - Desert Sand:  #EADCC8 (Borders, card dividers)
     - Desert Oasis: #5F7F6E (Excerpt text, subtitles)
     - Desert Cloud: #F8F7F4 (Card backgrounds)
   ========================================================================== */

.d2g-posts-grid-wrapper {
	width: 100%;
	position: relative;
	box-sizing: border-box;
	clear: both;
	margin-top: 1.5rem;
}

/* --------------------------------------------------------------------------
   Header (Super-title, Heading, View All link)
   -------------------------------------------------------------------------- */
.d2g-grid-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	margin-bottom: 2.5rem;
	gap: 1.5rem;
	width: 100%;
}

.d2g-grid-header-left {
	flex: 1;
}

.d2g-grid-super-title {
	font-family: 'Montserrat', sans-serif;
	font-weight: 700;
	font-size: 0.875rem; /* 14px */
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: #C89B5B;
	margin: 0 0 0.5rem 0;
	display: block;
	line-height: 1.2;
}

.d2g-grid-title,
.d2g-grid-main-title {
	font-family: 'Playfair Display', Georgia, serif;
	font-weight: 700;
	font-size: 1.875rem; /* 30px */
	line-height: 1.25;
	color: #0B3D36;
	margin: 0;
}

.d2g-grid-view-all {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-family: 'Montserrat', sans-serif;
	font-weight: 700;
	font-size: 0.875rem;
	color: #0B3D36;
	text-decoration: none;
	border-bottom: 1px solid #0B3D36;
	padding-bottom: 3px;
	white-space: nowrap;
	transition: all 0.2s ease;
	line-height: 1;
}

.d2g-grid-view-all svg {
	width: 14px;
	height: 14px;
	stroke: currentColor;
	transition: transform 0.2s ease;
}

.d2g-grid-view-all:hover {
	color: #C89B5B;
	border-bottom-color: #C89B5B;
}

.d2g-grid-view-all:hover svg {
	transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   Grid Container
   -------------------------------------------------------------------------- */
.d2g-posts-grid {
	display: grid;
	grid-template-columns: repeat(var(--d2g-grid-cols, 3), 1fr);
	column-gap: 2rem;
	row-gap: 2rem;
	width: 100%;
	box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Post Card
   -------------------------------------------------------------------------- */
.d2g-post-card {
	background-color: #F8F7F4;
	border-radius: 0.75rem; /* 12px */
	overflow: hidden;
	border: 1px solid #EADCC8;
	box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	display: flex;
	flex-direction: column;
	height: 100%;
	position: relative;
	box-sizing: border-box;
}

.d2g-post-card:hover {
	border-color: #C89B5B;
	box-shadow: 0 20px 25px -5px rgba(11, 61, 54, 0.1), 0 8px 10px -6px rgba(11, 61, 54, 0.1);
	transform: translateY(-2px);
}

/* Thumbnail / Media Container */
.d2g-card-media,
.d2g-card-thumb-wrap {
	position: relative;
	width: 100%;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	background-color: #0B3D36;
}

.d2g-card-media-link,
.d2g-card-media > a:not(.d2g-card-badge),
.d2g-card-thumb-wrap > a:not(.d2g-card-badge) {
	display: block;
	width: 100%;
	height: 100%;
}

.d2g-card-media img,
.d2g-card-thumb-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.d2g-post-card:hover .d2g-card-media img,
.d2g-post-card:hover .d2g-card-thumb-img {
	transform: scale(1.05);
}

.d2g-card-media-placeholder {
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #0B3D36 0%, #175e53 100%);
}

/* Category Badge */
.d2g-card-badge,
a.d2g-card-badge {
	position: absolute !important;
	top: 1rem !important;
	left: 1rem !important;
	width: auto !important;
	height: auto !important;
	max-width: calc(100% - 2rem) !important;
	background-color: #0B3D36;
	color: #C89B5B;
	font-family: 'Montserrat', sans-serif;
	font-size: 0.75rem; /* 12px */
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 0.35rem 0.75rem;
	border-radius: 0.25rem;
	z-index: 2;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.15);
	text-decoration: none;
	line-height: 1.2;
	display: inline-block !important;
	white-space: nowrap;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.d2g-card-badge:hover,
a.d2g-card-badge:hover {
	background-color: #C89B5B;
	color: #ffffff;
}

/* Card Body */
.d2g-card-body {
	padding: 1.5rem;
	display: flex;
	flex-direction: column;
	flex: 1;
	box-sizing: border-box;
}

/* Card Title */
.d2g-card-title {
	font-family: 'Playfair Display', Georgia, serif;
	font-weight: 700;
	font-size: 1.25rem; /* 20px */
	line-height: 1.35;
	color: #0B3D36;
	margin: 0 0 0.75rem 0;
}

.d2g-card-title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.d2g-post-card:hover .d2g-card-title a,
.d2g-card-title a:hover {
	color: #C89B5B;
}

/* Card Excerpt */
.d2g-card-excerpt {
	font-family: 'Inter', sans-serif;
	font-size: 0.875rem; /* 14px */
	line-height: 1.6;
	color: #5F7F6E;
	margin: 0 0 1.5rem 0;
	flex: 1;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Card Footer (Read Article ->) */
.d2g-card-footer {
	padding-top: 1rem;
	border-top: 1px solid #EADCC8;
	margin-top: auto;
	display: flex;
	align-items: center;
}

.d2g-read-more-link {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-family: 'Montserrat', sans-serif;
	font-size: 0.75rem; /* 12px */
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #0B3D36;
	text-decoration: none;
	line-height: 1;
	transition: color 0.2s ease;
}

.d2g-read-more-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 14px;
	height: 14px;
	min-width: 14px;
	max-width: 14px;
	max-height: 14px;
	line-height: 1;
	color: #C89B5B;
}

.d2g-read-more-icon svg {
	width: 14px;
	height: 14px;
	max-width: 14px;
	max-height: 14px;
	display: block;
	fill: none;
	stroke: currentColor;
	transition: transform 0.2s ease, stroke 0.2s ease;
}

.d2g-read-more-icon i {
	font-size: 14px;
	line-height: 1;
	display: block;
	color: inherit;
	transition: transform 0.2s ease;
}

.d2g-post-card:hover .d2g-read-more-link,
.d2g-read-more-link:hover {
	color: #C89B5B;
}

.d2g-post-card:hover .d2g-read-more-icon,
.d2g-read-more-link:hover .d2g-read-more-icon {
	transform: translateX(4px);
}

.d2g-no-posts {
	font-family: 'Inter', sans-serif;
	color: #5F7F6E;
	font-size: 0.95rem;
	padding: 1.5rem 0;
	margin: 0;
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
	.d2g-posts-grid {
		grid-template-columns: repeat(var(--d2g-grid-cols-tablet, 2), 1fr);
		column-gap: 1.5rem;
		row-gap: 1.5rem;
	}
}

@media (max-width: 767px) {
	.d2g-posts-grid {
		grid-template-columns: repeat(var(--d2g-grid-cols-mobile, 1), 1fr);
		column-gap: 1.25rem;
		row-gap: 1.25rem;
	}

	.d2g-grid-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.75rem;
		margin-bottom: 1.75rem;
	}

	.d2g-grid-title,
	.d2g-grid-main-title {
		font-size: 1.5rem;
	}
}

/* --------------------------------------------------------------------------
   Pagination Styles (Desert to Global Palette)
   -------------------------------------------------------------------------- */
.d2g-posts-pagination {
	margin-top: 3rem;
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
}

.d2g-posts-pagination ul.page-numbers {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	list-style: none;
	padding: 0;
	margin: 0;
}

.d2g-posts-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.75rem;
	height: 2.75rem;
	padding: 0 0.85rem;
	border-radius: 0.5rem;
	font-family: 'Montserrat', sans-serif;
	font-size: 0.875rem;
	font-weight: 600;
	color: #0B3D36;
	background-color: #FFFFFF;
	border: 1px solid #EADCC8;
	text-decoration: none;
	transition: all 0.25s ease;
}

.d2g-posts-pagination a.page-numbers:hover {
	color: #C89B5B;
	border-color: #C89B5B;
	background-color: #F8F7F4;
	transform: translateY(-1px);
}

.d2g-posts-pagination .page-numbers.current {
	background-color: #0B3D36;
	color: #C89B5B;
	border-color: #0B3D36;
	box-shadow: 0 4px 10px rgba(11, 61, 54, 0.15);
}

.d2g-posts-pagination .page-numbers.dots {
	border: none;
	background: transparent;
	color: #5F7F6E;
	min-width: 1.5rem;
}
