/**
 * Relatedly Plugin Stylesheet
 * 
 * @package   Relatedly
 * @author    Krafty Sprouts Media, LLC
 * @created   26/10/2025
 * @version   1.7.0
 * @modified  22/11/2025
 */

/* Inline Related Posts */
.relatedly-inline-simple,
.relatedly-inline-minimal,
.relatedly-inline-featured,
.relatedly-inline-quote,
.relatedly-inline-badge,
.relatedly-inline-callout,
.relatedly-inline-sidebar,
.relatedly-inline-gradient {
	margin: 20px 0;
	clear: both;
	animation: fadeInUp 0.6s ease-out;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.relatedly-inline-simple:hover,
.relatedly-inline-minimal:hover,
.relatedly-inline-featured:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.relatedly-inline-simple a,
.relatedly-inline-minimal a,
.relatedly-inline-featured a {
	transition: color 0.3s ease, transform 0.2s ease;
}

.relatedly-inline-simple a:hover,
.relatedly-inline-minimal a:hover,
.relatedly-inline-featured a:hover {
	transform: translateX(3px);
}

.relatedly-inline-featured {
	overflow: hidden;
}

.relatedly-inline-featured img {
	max-width: 100%;
	height: auto;
	transition: transform 0.4s ease;
}

.relatedly-inline-featured:hover img {
	transform: scale(1.05);
}

/* End Content Related Posts */
.relatedly-end-content-list,
.relatedly-end-content-grid,
.relatedly-end-content-cards,
.relatedly-end-content-theme4,
.relatedly-end-content-masonry,
.relatedly-end-content-carousel,
.relatedly-end-content-magazine,
.relatedly-end-content-timeline,
.relatedly-end-content-compact,
.relatedly-end-content-hero {
	margin: 30px 0;
	clear: both;
	animation: fadeInUp 0.6s ease-out;
}

.relatedly-end-content-grid,
.relatedly-end-content-cards {
	display: flex;
	flex-wrap: wrap;
	gap: 2%;
}

/* Grid and Cards hover effects */
.relatedly-end-content-grid > div,
.relatedly-end-content-cards > div {
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	animation: fadeInUp 0.6s ease-out;
	animation-fill-mode: both;
}

.relatedly-end-content-grid > div:nth-child(1) { animation-delay: 0.1s; }
.relatedly-end-content-grid > div:nth-child(2) { animation-delay: 0.2s; }
.relatedly-end-content-grid > div:nth-child(3) { animation-delay: 0.3s; }
.relatedly-end-content-grid > div:nth-child(4) { animation-delay: 0.4s; }
.relatedly-end-content-grid > div:nth-child(5) { animation-delay: 0.5s; }

.relatedly-end-content-cards > div:nth-child(1) { animation-delay: 0.1s; }
.relatedly-end-content-cards > div:nth-child(2) { animation-delay: 0.2s; }
.relatedly-end-content-cards > div:nth-child(3) { animation-delay: 0.3s; }
.relatedly-end-content-cards > div:nth-child(4) { animation-delay: 0.4s; }
.relatedly-end-content-cards > div:nth-child(5) { animation-delay: 0.5s; }

.relatedly-end-content-grid > div:hover,
.relatedly-end-content-cards > div:hover {
	transform: translateY(-5px) scale(1.02);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.relatedly-end-content-grid img,
.relatedly-end-content-cards img {
	transition: transform 0.4s ease;
	width: 100%;
	height: auto;
	max-height: 200px;
	object-fit: cover;
	display: block;
}

.relatedly-end-content-grid > div:hover img,
.relatedly-end-content-cards > div:hover img {
	transform: scale(1.1);
}

/* Theme2 Grid - Improved thumbnail container */
.relatedly-end-content-grid > div {
	position: relative;
	overflow: hidden;
}

.relatedly-end-content-grid > div > div:first-child {
	width: 100%;
	overflow: hidden;
	background: #f5f5f5;
	line-height: 0;
}

.relatedly-end-content-grid > div > div:first-child a {
	display: block;
	text-decoration: none;
}

.relatedly-end-content-grid > div > div:first-child img {
	width: 100%;
	height: auto;
	max-height: 200px;
	object-fit: cover;
	display: block;
	margin: 0;
	padding: 0;
}

.relatedly-end-content-grid a,
.relatedly-end-content-cards a {
	transition: color 0.3s ease;
}

.relatedly-end-content-list ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.relatedly-end-content-list li {
	margin-bottom: 15px;
	padding-bottom: 15px;
	border-bottom: 1px solid #ddd;
	transition: transform 0.3s ease, padding-left 0.3s ease;
	animation: fadeInLeft 0.5s ease-out;
	animation-fill-mode: both;
}

.relatedly-end-content-list li:nth-child(1) { animation-delay: 0.1s; }
.relatedly-end-content-list li:nth-child(2) { animation-delay: 0.2s; }
.relatedly-end-content-list li:nth-child(3) { animation-delay: 0.3s; }
.relatedly-end-content-list li:nth-child(4) { animation-delay: 0.4s; }
.relatedly-end-content-list li:nth-child(5) { animation-delay: 0.5s; }

.relatedly-end-content-list li:hover {
	transform: translateX(5px);
	padding-left: 5px;
}

.relatedly-end-content-list li:last-child {
	border-bottom: none;
}

.relatedly-end-content-list a {
	transition: color 0.3s ease;
}

/* Theme 4 List Styles */
.relatedly-end-content-theme4 ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.relatedly-end-content-theme4 li {
	margin: 0 0 10px 0;
	padding: 0;
	position: relative;
	padding-left: 20px;
	transition: transform 0.3s ease, padding-left 0.3s ease;
	animation: fadeInLeft 0.5s ease-out;
	animation-fill-mode: both;
}

.relatedly-end-content-theme4 li:nth-child(1) { animation-delay: 0.1s; }
.relatedly-end-content-theme4 li:nth-child(2) { animation-delay: 0.2s; }
.relatedly-end-content-theme4 li:nth-child(3) { animation-delay: 0.3s; }
.relatedly-end-content-theme4 li:nth-child(4) { animation-delay: 0.4s; }
.relatedly-end-content-theme4 li:nth-child(5) { animation-delay: 0.5s; }

.relatedly-end-content-theme4 li:hover {
	transform: translateX(5px);
	padding-left: 25px;
}

.relatedly-end-content-theme4 li::before {
	content: '→';
	position: absolute;
	left: 0;
	color: #333333;
	font-weight: bold;
	line-height: 1.6;
	transition: transform 0.3s ease, color 0.3s ease;
}

.relatedly-end-content-theme4 li:hover::before {
	transform: translateX(3px);
	color: #0073aa;
}

.relatedly-end-content-theme4 li a {
	transition: color 0.3s ease, transform 0.2s ease;
	display: inline-block;
}

.relatedly-end-content-theme4 li a:hover {
	transform: translateX(2px);
}

.relatedly-end-content-theme4 li:last-child {
	margin-bottom: 0;
}

/* Placeholder Image */
.relatedly-placeholder-img {
	background: #f0f0f0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #999;
	font-size: 12px;
}

.relatedly-placeholder-img::before {
	content: '📷';
	font-size: 24px;
}

/* Custom Animations */
@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes fadeInLeft {
	from {
		opacity: 0;
		transform: translateX(-20px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

/* Responsive Design - Mobile First */
@media (max-width: 768px) {
	.relatedly-end-content-grid > div,
	.relatedly-end-content-cards > div {
		width: 100% !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
		margin-bottom: 20px !important;
	}
	
	.relatedly-end-content-grid,
	.relatedly-end-content-cards {
		gap: 0 !important;
		margin: 0 !important;
	}
}

@media (max-width: 480px) {
	.relatedly-inline-simple,
	.relatedly-inline-minimal,
	.relatedly-inline-featured {
		padding: 12px !important;
		margin: 15px 0 !important;
	}
	
	.relatedly-end-content-list,
	.relatedly-end-content-grid,
	.relatedly-end-content-cards,
	.relatedly-end-content-theme4 {
		margin: 20px 0 !important;
		padding: 15px !important;
	}
	
	.relatedly-end-content-grid > div,
	.relatedly-end-content-cards > div {
		padding: 12px !important;
	}
}

/* New Inline Theme Styles */

/* Theme4: Quote/Blockquote */
.relatedly-inline-quote {
	position: relative;
}

.relatedly-inline-quote blockquote {
	font-style: italic;
}

.relatedly-inline-quote cite {
	display: block;
	margin-top: 10px;
	font-size: 12px;
	font-style: normal;
}

/* Theme5: Badge/Pill */
.relatedly-inline-badge {
	display: inline-block;
	border-radius: 20px;
	line-height: 1.4;
}

/* Theme6: Callout Box */
.relatedly-inline-callout {
	position: relative;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Theme7: Sidebar */
.relatedly-inline-sidebar {
	border-radius: 4px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.relatedly-inline-sidebar img {
	max-width: 100%;
	height: auto;
}

/* Theme8: Gradient */
.relatedly-inline-gradient {
	border-radius: 12px;
	box-shadow: 0 4px 15px rgba(0,0,0,0.2);
	position: relative;
	overflow: hidden;
}

/* New End Content Theme Styles */

/* Theme5: Masonry Grid */
.relatedly-masonry-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 20px;
}

.relatedly-masonry-grid > div {
	transition: transform 0.3s ease;
}

.relatedly-masonry-grid > div:hover {
	transform: translateY(-4px);
}

/* Theme6: Carousel */
.relatedly-carousel-container {
	position: relative;
	overflow: hidden;
}

.relatedly-carousel-wrapper {
	display: flex;
	transition: transform 0.5s ease;
	gap: 20px;
}

.relatedly-carousel-item {
	flex: 0 0 auto;
	min-width: 0;
	padding: 0 10px;
}

.relatedly-carousel-prev,
.relatedly-carousel-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(0,0,0,0.5);
	color: white;
	border: none;
	padding: 10px 15px;
	cursor: pointer;
	border-radius: 50%;
	font-size: 20px;
	z-index: 10;
	transition: background 0.3s ease;
}

.relatedly-carousel-prev:hover,
.relatedly-carousel-next:hover {
	background: rgba(0,0,0,0.8);
}

.relatedly-carousel-prev {
	left: 10px;
}

.relatedly-carousel-next {
	right: 10px;
}

/* Theme7: Magazine */
.relatedly-end-content-magazine > div:first-child {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	margin-bottom: 30px;
}

.relatedly-end-content-magazine img {
	width: 100%;
	height: auto;
}

/* Theme8: Timeline */
.relatedly-end-content-timeline {
	position: relative;
}

.relatedly-end-content-timeline > div {
	position: relative;
	padding-left: 40px;
}

.relatedly-end-content-timeline > div::before {
	content: '';
	position: absolute;
	left: 15px;
	top: 0;
	bottom: 0;
	width: 2px;
	background: #0073aa;
}

/* Timeline item animations */
.relatedly-timeline-item {
	opacity: 0;
	animation: fadeInLeft 0.6s ease-out forwards;
	animation-fill-mode: both;
}

.relatedly-timeline-item:nth-child(1) { animation-delay: 0.1s; }
.relatedly-timeline-item:nth-child(2) { animation-delay: 0.25s; }
.relatedly-timeline-item:nth-child(3) { animation-delay: 0.4s; }
.relatedly-timeline-item:nth-child(4) { animation-delay: 0.55s; }
.relatedly-timeline-item:nth-child(5) { animation-delay: 0.7s; }
.relatedly-timeline-item:nth-child(6) { animation-delay: 0.85s; }
.relatedly-timeline-item:nth-child(7) { animation-delay: 1s; }
.relatedly-timeline-item:nth-child(8) { animation-delay: 1.15s; }

@keyframes fadeInLeft {
	from {
		opacity: 0;
		transform: translateX(-30px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

/* Theme9: Compact List */
.relatedly-end-content-compact ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.relatedly-end-content-compact li {
	display: flex;
	align-items: center;
	gap: 15px;
	padding: 12px 0;
	border-bottom: 1px solid #e1e1e1;
	transition: background 0.2s ease;
}

.relatedly-end-content-compact li:hover {
	background: #f0f0f0;
}

.relatedly-end-content-compact li:last-child {
	border-bottom: none;
}

/* Theme10: Hero + Grid */
.relatedly-end-content-hero > div:first-child {
	position: relative;
	overflow: hidden;
	border-radius: 12px;
	box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.relatedly-end-content-hero > div:first-child > div:first-child {
	position: relative;
	overflow: hidden;
	max-height: 400px;
}

.relatedly-end-content-hero > div:first-child > div:first-child > div {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
	padding: 30px;
}

.relatedly-end-content-hero > div:first-child h2 {
	margin: 0 0 10px 0;
}

.relatedly-end-content-hero > div:first-child h2 a {
	color: #fff;
	text-decoration: none;
}

.relatedly-end-content-hero > div:first-child p {
	color: rgba(255,255,255,0.9);
}

/* Responsive adjustments for new themes */
@media (max-width: 768px) {
	.relatedly-masonry-grid {
		grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
		gap: 15px;
	}
	
	.relatedly-end-content-magazine > div:first-child {
		grid-template-columns: 1fr;
	}
	
	.relatedly-end-content-magazine > div:last-child {
		grid-template-columns: 1fr !important;
	}
	
	.relatedly-inline-sidebar {
		float: none !important;
		width: 100% !important;
		margin: 15px 0 !important;
	}
	
	.relatedly-carousel-wrapper {
		flex-direction: column;
	}
	
	.relatedly-carousel-item {
		width: 100% !important;
		flex: 0 0 100% !important;
	}
	
	.relatedly-end-content-timeline > div {
		padding-left: 30px;
	}
}

@media (max-width: 480px) {
	.relatedly-masonry-grid {
		grid-template-columns: 1fr;
	}
	
	.relatedly-inline-badge {
		display: block;
		text-align: center;
	}
	
	.relatedly-end-content-compact li {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
	.relatedly-inline-simple,
	.relatedly-inline-minimal,
	.relatedly-inline-featured,
	.relatedly-inline-quote,
	.relatedly-inline-badge,
	.relatedly-inline-callout,
	.relatedly-inline-sidebar,
	.relatedly-inline-gradient,
	.relatedly-end-content-list,
	.relatedly-end-content-grid,
	.relatedly-end-content-cards,
	.relatedly-end-content-theme4,
	.relatedly-end-content-masonry,
	.relatedly-end-content-carousel,
	.relatedly-end-content-magazine,
	.relatedly-end-content-timeline,
	.relatedly-end-content-compact,
	.relatedly-end-content-hero,
	.relatedly-end-content-list li,
	.relatedly-end-content-theme4 li,
	.relatedly-end-content-grid > div,
	.relatedly-end-content-cards > div,
	.relatedly-masonry-grid > div,
	.relatedly-end-content-compact li {
		animation: none;
		transition: none;
	}
	
	.relatedly-inline-simple:hover,
	.relatedly-inline-minimal:hover,
	.relatedly-inline-featured:hover,
	.relatedly-inline-gradient:hover,
	.relatedly-end-content-grid > div:hover,
	.relatedly-end-content-cards > div:hover,
	.relatedly-end-content-list li:hover,
	.relatedly-end-content-theme4 li:hover,
	.relatedly-masonry-grid > div:hover,
	.relatedly-end-content-compact li:hover {
		transform: none;
	}
	
	.relatedly-carousel-wrapper {
		transition: none;
	}
}
