/**
 * Public CSS Styles for Dynamic Post Shortcodes.
 * Uses modern CSS variables for dynamic preset styling.
 */

.dps-wrapper {
	--dps-gap: 20px;
	--dps-radius: 8px;
	--dps-text-align: left;
	--dps-aspect-ratio: 16/9;
	--dps-content-spacing: 20px;
	margin: 20px 0;
	box-sizing: border-box;
}

.dps-wrapper *, .dps-wrapper *::before, .dps-wrapper *::after {
	box-sizing: inherit;
}

/* Grid Layout */
.dps-layout-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	row-gap: var(--dps-row-gap, 20px);
	column-gap: var(--dps-col-gap, 20px);
}

/* Card Container */
.dps-card {
	display: flex;
	flex-direction: column;
	background: #ffffff;
	border: 1px solid #eaeaea;
	border-radius: var(--dps-radius);
	overflow: hidden;
	box-shadow: var(--dps-shadow, 0 4px 12px rgba(0, 0, 0, 0.04));
	transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), border-color 0.3s ease, background-color 0.3s ease;
	text-align: var(--dps-text-align);
	position: relative;
	height: 100%;
}

/* Card Image */
.dps-card-image-link {
	display: block;
	overflow: hidden;
	background-color: #f5f5f5;
	position: relative;
}

.dps-card-image-link img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	aspect-ratio: var(--dps-aspect-ratio);
	transition: transform 0.5s ease;
}

.dps-card:hover .dps-card-image-link img {
	transform: scale(1.05);
}

/* Card Content Spacing without wrapper (using content parts) */
.dps-card-content-part {
	padding-left: var(--dps-content-spacing, 20px);
	padding-right: var(--dps-content-spacing, 20px);
	margin-bottom: 12px;
}

.dps-card-content-part:last-child {
	margin-bottom: 0;
}

/* First non-image child gets top padding */
.dps-card-image-link + .dps-card-content-part,
.dps-card > .dps-card-content-part:first-child {
	padding-top: var(--dps-content-spacing, 20px);
}

/* Last child gets bottom padding */
.dps-card > .dps-card-content-part:last-child {
	padding-bottom: var(--dps-content-spacing, 20px);
}

/* Card Date & Meta */
.dps-card-date,
.dps-card-author {
	font-size: 12px;
	color: #8c8f94;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.dps-card-author {
	margin-top: 2px;
}

.dps-card-author a,
.dps-card-categories a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.dps-card-author a:hover,
.dps-card-categories a:hover {
	text-decoration: underline;
}

.dps-card-categories {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.dps-card-category-link {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	color: #2271b1;
	background-color: rgba(34, 113, 177, 0.08);
	padding: 2px 8px;
	border-radius: 4px;
}

/* Card Title */
.dps-card-title {
	font-size: 18px;
	line-height: 1.4;
	font-weight: 700;
	margin: 0;
	color: #1d2327;
}

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

.dps-card-title a:hover {
	color: #2271b1;
}

/* Card Excerpt */
.dps-card-excerpt {
	font-size: 14px;
	line-height: 1.6;
	color: #50575e;
}

.dps-card-excerpt p {
	margin: 0;
}

/* Card Footer / Action Link */
.dps-card-footer {
	margin-top: 8px;
}

.dps-read-more-btn {
	display: inline-block;
	background: #2271b1;
	color: #ffffff;
	padding: 8px 16px;
	font-size: 13px;
	font-weight: 600;
	border-radius: 4px;
	text-decoration: none;
	transition: background 0.2s ease, transform 0.1s ease, border-color 0.2s ease;
}

.dps-read-more-btn:hover {
	background: #135e96;
	color: #ffffff;
}

.dps-read-more-btn:active {
	transform: scale(0.97);
}

/* Alignment support for button alignments */
.dps-wrapper[style*="--dps-text-align: center"] .dps-read-more-btn {
	margin: 0 auto;
}

.dps-wrapper[style*="--dps-text-align: right"] .dps-read-more-btn {
	margin-left: auto;
}

/* -------------------------------------------------------------
 * 1. Horizontal Layout
 * ------------------------------------------------------------- */
.dps-layout-horizontal {
	display: flex;
	flex-direction: column;
	row-gap: var(--dps-row-gap, 20px);
}

.dps-card-horizontal {
	display: flex;
	flex-direction: row !important;
	align-items: stretch;
}

.dps-card-horizontal.dps-image-position-right {
	flex-direction: row-reverse !important;
}

.dps-card-horizontal .dps-card-image-link {
	width: 35%;
	flex-shrink: 0;
	position: relative;
	overflow: hidden;
}

.dps-card-horizontal .dps-card-image-link img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.dps-card-horizontal .dps-card-content {
	flex-grow: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: var(--dps-content-spacing, 20px);
}

.dps-card-horizontal .dps-card-content .dps-card-content-part {
	padding: 0;
	margin-bottom: 12px;
}

.dps-card-horizontal .dps-card-content .dps-card-content-part:last-child {
	margin-bottom: 0;
}

@media (max-width: 767px) {
	.dps-card-horizontal {
		flex-direction: column !important;
	}
	.dps-card-horizontal .dps-card-image-link {
		width: 100%;
		height: 200px;
	}
	.dps-card-horizontal .dps-card-image-link img {
		position: static;
	}
}

/* -------------------------------------------------------------
 * 2. Slick Carousel & Hero Slider Layout (Equal Height)
 * ------------------------------------------------------------- */
.dps-layout-carousel .slick-track,
.dps-layout-hero-slider .slick-track {
	display: flex !important;
}

.dps-layout-carousel .slick-slide,
.dps-layout-hero-slider .slick-slide {
	height: auto !important;
	display: flex !important;
	flex-direction: column;
}

.dps-layout-carousel .dps-carousel-slide {
	height: 100%;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	padding: 0 calc(var(--dps-col-gap, 20px) / 2);
}

.dps-layout-carousel .dps-carousel-slide .dps-card {
	flex-grow: 1;
	margin: 0;
}

.dps-layout-carousel {
	margin: 0 calc(var(--dps-col-gap, 20px) / -2);
	visibility: hidden;
}

.dps-layout-carousel.slick-initialized {
	visibility: visible;
}

/* Arrow Custom Styling base rules (overridden dynamically) */
.dps-wrapper .slick-prev,
.dps-wrapper .slick-next {
	width: 40px;
	height: 40px;
	background: #ffffff;
	border-radius: 50%;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	z-index: 10;
	transition: all 0.2s ease;
}

.dps-wrapper .slick-prev:hover,
.dps-wrapper .slick-next:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.dps-wrapper .slick-prev::before,
.dps-wrapper .slick-next::before {
	font-family: inherit;
	font-size: 18px;
	font-weight: bold;
	display: block;
	line-height: 1;
}

.dps-wrapper .slick-dots {
	bottom: -30px;
}

.dps-wrapper .slick-dots li button::before {
	font-size: 10px;
	opacity: 0.6;
}

.dps-wrapper .slick-dots li.slick-active button::before {
	opacity: 1;
}

/* -------------------------------------------------------------
 * 3. Hero Slider Layout
 * ------------------------------------------------------------- */
.dps-layout-hero-slider {
	visibility: hidden;
}

.dps-layout-hero-slider.slick-initialized {
	visibility: visible;
}

.dps-hero-slide {
	height: 500px;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	position: relative;
}

.dps-hero-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px;
}

.dps-hero-content-wrapper {
	max-width: 800px;
	width: 100%;
}

.dps-hero-card {
	color: #ffffff;
}

.dps-hero-card .dps-card-title,
.dps-hero-card .dps-card-title a,
.dps-hero-card .dps-card-excerpt,
.dps-hero-card .dps-card-date,
.dps-hero-card .dps-card-author,
.dps-hero-card .dps-card-category-link,
.dps-hero-card .dps-author-by {
	color: #ffffff !important;
}

.dps-hero-card .dps-card-title {
	font-size: 36px;
	line-height: 1.2;
	margin-bottom: 20px;
	font-weight: 800;
}

.dps-hero-card .dps-card-excerpt {
	font-size: 16px;
	line-height: 1.6;
	margin-bottom: 30px;
}

.dps-hero-card .dps-card-content-part {
	padding: 0;
	margin-bottom: 12px;
}

.dps-hero-card .dps-card-content-part:last-child {
	margin-bottom: 0;
}

@media (max-width: 767px) {
	.dps-hero-slide {
		height: 400px;
	}
	.dps-hero-card .dps-card-title {
		font-size: 24px;
		margin-bottom: 15px;
	}
	.dps-hero-card .dps-card-excerpt {
		font-size: 14px;
		margin-bottom: 20px;
	}
}

/* -------------------------------------------------------------
 * 4. Overlay Card Layout
 * ------------------------------------------------------------- */
.dps-card-overlay {
	position: relative;
	min-height: 350px;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	overflow: hidden;
}

.dps-card-overlay-bg {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	transition: background-color 0.3s ease;
	z-index: 1;
}

.dps-overlay-content {
	padding: var(--dps-content-spacing, 20px);
	z-index: 2;
	width: 100%;
}

/* Flexbox Position Utilities for Overlays */
.dps-position-top-left {
	justify-content: flex-start !important;
	align-items: flex-start !important;
	text-align: left !important;
}
.dps-position-top-center {
	justify-content: flex-start !important;
	align-items: center !important;
	text-align: center !important;
}
.dps-position-top-right {
	justify-content: flex-start !important;
	align-items: flex-end !important;
	text-align: right !important;
}
.dps-position-center-left {
	justify-content: center !important;
	align-items: flex-start !important;
	text-align: left !important;
}
.dps-position-center-center {
	justify-content: center !important;
	align-items: center !important;
	text-align: center !important;
}
.dps-position-center-right {
	justify-content: center !important;
	align-items: flex-end !important;
	text-align: right !important;
}
.dps-position-bottom-left {
	justify-content: flex-end !important;
	align-items: flex-start !important;
	text-align: left !important;
}
.dps-position-bottom-center {
	justify-content: flex-end !important;
	align-items: center !important;
	text-align: center !important;
}
.dps-position-bottom-right {
	justify-content: flex-end !important;
	align-items: flex-end !important;
	text-align: right !important;
}

.dps-card-overlay .dps-card-title,
.dps-card-overlay .dps-card-title a,
.dps-card-overlay .dps-card-excerpt,
.dps-card-overlay .dps-card-date,
.dps-card-overlay .dps-card-author,
.dps-card-overlay .dps-card-category-link,
.dps-card-overlay .dps-author-by {
	color: #ffffff !important;
}

.dps-card-overlay .dps-card-title a:hover {
	color: #eaeaea !important;
}

.dps-card-overlay .dps-card-content-part {
	padding: 0;
	margin-bottom: 10px;
}

.dps-card-overlay .dps-card-content-part:last-child {
	margin-bottom: 0;
}

/* -------------------------------------------------------------
 * 5. Tab Layout (Category Tabs)
 * ------------------------------------------------------------- */
.dps-layout-tabs-wrapper {
	margin-bottom: 30px;
}

.dps-tabs-nav-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 25px;
	justify-content: center;
}

.dps-tab-nav-btn {
	background: #f5f5f5;
	border: 1px solid #eaeaea;
	color: #50575e;
	padding: 8px 18px;
	font-size: 14px;
	font-weight: 600;
	border-radius: 20px;
	cursor: pointer;
	transition: all 0.3s ease;
}

.dps-tab-nav-btn:hover {
	background: #eaeaea;
	color: #1d2327;
}

.dps-tab-nav-btn.active {
	background: #2271b1;
	border-color: #2271b1;
	color: #ffffff;
}

.dps-tab-card {
	transition: opacity 0.4s ease, transform 0.4s ease;
}

.dps-tab-card.dps-tab-filtered-out {
	display: none !important;
}

/* -------------------------------------------------------------
 * 6. Accordion Layout
 * ------------------------------------------------------------- */
.dps-layout-accordion {
	display: flex;
	flex-direction: column;
	row-gap: var(--dps-row-gap, 15px);
}

.dps-accordion-item {
	background: #ffffff;
	border: 1px solid #eaeaea;
	overflow: hidden;
	margin-bottom: 15px;
	transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.dps-accordion-item:last-child {
	margin-bottom: 0;
}

.dps-accordion-header {
	padding: 15px 20px;
	cursor: pointer;
	background: #fcfcfc;
	user-select: none;
	transition: background 0.3s ease;
}

.dps-accordion-header:hover {
	background: #f5f5f5;
}

.dps-accordion-title {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin: 0 !important;
	font-weight: 600;
}

.dps-accordion-icon {
	font-size: 20px;
	transition: transform 0.3s ease;
	color: #8c8f94;
	line-height: 1;
}

.dps-accordion-body {
	display: none;
	border-top: 1px solid #eaeaea;
}

.dps-accordion-icon-svg {
	display: inline-block;
	vertical-align: middle;
	width: 18px;
	height: 18px;
	transition: transform 0.3s ease;
}
.dps-plus-vertical-line {
	transition: opacity 0.25s ease;
}
.dps-accordion-item.dps-accordion-open .dps-accordion-icon-svg {
	transform: rotate(180deg);
}
.dps-accordion-item.dps-accordion-open .dps-accordion-icon-svg.dps-accordion-plus-icon,
.dps-accordion-item.dps-accordion-open .dps-accordion-icon-svg.dps-accordion-minus-icon,
.dps-accordion-item.dps-accordion-open .dps-accordion-icon-svg.dps-accordion-check-icon {
	transform: none !important;
}
.dps-accordion-item.dps-accordion-open .dps-accordion-plus-icon .dps-plus-vertical-line {
	opacity: 0;
}

.dps-accordion-item.dps-accordion-open .dps-accordion-header {
	background: #ffffff;
}

/* -------------------------------------------------------------
 * 7. Pagination
 * ------------------------------------------------------------- */
.dps-pagination-wrapper {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.dps-pagination-wrapper .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 14px;
	background: #ffffff;
	border: 1px solid #eaeaea;
	color: #50575e;
	text-decoration: none;
	font-size: 14px;
	font-weight: 600;
	transition: all 0.2s ease;
}

.dps-pagination-wrapper .page-numbers:hover {
	border-color: #c3c4c7;
	color: #1d2327;
}

.dps-pagination-wrapper .page-numbers.current {
	background: #2271b1;
	border-color: #2271b1;
	color: #ffffff;
	cursor: default;
}

.dps-pagination-wrapper .page-numbers.disabled {
	opacity: 0.5;
	pointer-events: none;
	background: #f5f5f5;
}

.dps-pagination-wrapper .page-numbers-info {
	font-size: 14px;
	color: #8c8f94;
	margin: 0 10px;
}

.dps-pagination-wrapper .dps-load-more-btn {
	display: inline-block;
	background: #2271b1;
	color: #ffffff;
	border: 1px solid #2271b1;
	padding: 10px 24px;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: all 0.2s ease;
}

.dps-pagination-wrapper .dps-load-more-btn:hover {
	background: #135e96;
	border-color: #135e96;
}

/* Error and Fallback Messages */
.dps-no-posts, .dps-error {
	background: #fcf1f1;
	border: 1px solid #f5c6c6;
	color: #a00;
	padding: 15px;
	border-radius: 4px;
	text-align: center;
	margin: 20px 0;
	font-weight: 500;
}

/* -------------------------------------------------------------
 * 8. Share Popup Modal and Button Styles
 * ------------------------------------------------------------- */
.dps-buttons-flex {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
}
.dps-buttons-align-space-between {
	justify-content: space-between !important;
}
.dps-buttons-align-left {
	justify-content: flex-start !important;
}
.dps-buttons-align-center {
	justify-content: center !important;
}
.dps-buttons-align-right {
	justify-content: flex-end !important;
}

/* Scoped Share Button Base */
.dps-share-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 8px 16px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	background: #eaeaea;
	color: #50575e;
	border: 1px solid #eaeaea;
	border-radius: 4px;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}
.dps-share-btn:active {
	transform: scale(0.97);
}
.dps-share-btn .dashicons,
.dps-share-btn-icon-svg {
	font-size: 16px;
	width: 16px;
	height: 16px;
	line-height: 1;
}

/* Carousel Overlay Positioning & Style Overrides */
.dps-carousel-image-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	transition: background-color 0.3s ease;
	z-index: 2;
}
.dps-carousel-image-overlay .dps-overlay-content {
	padding: var(--dps-content-spacing, 20px);
	width: 100%;
	z-index: 3;
}
.dps-carousel-image-overlay .dps-card-title,
.dps-carousel-image-overlay .dps-card-title a,
.dps-carousel-image-overlay .dps-card-excerpt,
.dps-carousel-image-overlay .dps-card-date,
.dps-carousel-image-overlay .dps-card-author,
.dps-carousel-image-overlay .dps-card-category-link,
.dps-carousel-image-overlay .dps-author-by {
	color: #ffffff !important;
}
.dps-carousel-image-overlay .dps-card-title a:hover {
	color: #eaeaea !important;
}
.dps-carousel-image-overlay .dps-card-content-part {
	padding: 0;
	margin-bottom: 10px;
}
.dps-carousel-image-overlay .dps-card-content-part:last-child {
	margin-bottom: 0;
}

/* Global Modal Overlay (Output in Footer) */
.dps-share-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: var(--dps-modal-overlay, rgba(0, 0, 0, 0.5));
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 99999;
	backdrop-filter: blur(4px);
	animation: dpsModalFadeIn 0.3s ease;
}

.dps-share-modal-box {
	background-color: var(--dps-modal-bg, #ffffff);
	color: var(--dps-modal-text, #1d2327);
	border-radius: var(--dps-modal-radius, 8px);
	width: 90%;
	max-width: 440px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	animation: dpsModalSlideUp 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.dps-share-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.dps-share-modal-title {
	font-size: 16px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.dps-share-modal-close {
	background: none;
	border: none;
	color: inherit;
	font-size: 24px;
	font-weight: 300;
	cursor: pointer;
	padding: 0;
	line-height: 1;
	opacity: 0.6;
	transition: opacity 0.2s ease;
}
.dps-share-modal-close:hover {
	opacity: 1;
}

.dps-share-modal-body {
	padding: 24px 20px;
}

.dps-share-modal-networks {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
	gap: 12px;
	justify-content: center;
}

/* Modal Network Item Buttons */
.dps-share-modal-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background-color: var(--dps-modal-icon-bg, #f5f5f5);
	color: var(--dps-modal-icon-color, #50575e);
	border: none;
	border-radius: var(--dps-modal-radius, 8px);
	padding: 14px 8px;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.dps-share-modal-btn:hover {
	background-color: var(--dps-modal-icon-hover-bg, #e0e0e0);
	color: var(--dps-modal-icon-hover-color, #2271b1);
}

.dps-share-modal-btn:active {
	transform: scale(0.95);
}

.dps-share-modal-btn svg {
	display: block;
	transition: transform 0.2s ease;
}
.dps-share-modal-btn:hover svg {
	transform: translateY(-2px);
}

.dps-share-modal-btn.copied svg {
	display: none;
}

.dps-share-btn-label {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

/* Special color for link copied status */
.dps-share-modal-btn.copied {
	background-color: #46b450 !important;
	color: #ffffff !important;
}

/* Animations */
@keyframes dpsModalFadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes dpsModalSlideUp {
	from { transform: translateY(20px); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}

body.dps-modal-open {
	overflow: hidden;
}

/* Full Card Link overlay styles */
.dps-card-linked {
	position: relative;
	cursor: pointer;
}
.dps-card-full-link {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 1;
	border-radius: inherit;
}
/* Keep interactive elements above the overlay */
.dps-card-linked .dps-card-image-link a,
.dps-card-linked .dps-card-title a,
.dps-card-linked .dps-card-category-link,
.dps-card-linked .dps-card-author a,
.dps-card-linked .dps-read-more-btn,
.dps-card-linked .dps-share-btn {
	position: relative;
	z-index: 2;
}

