/**
 * Theme Features Custom Styles
 *
 * @package Health_blog_affiliate
 */

/* ==========================================================================
   Sticky CTA Styles
   ========================================================================== */

.cta-sticky {
	position: sticky;
	top: 20px;
	padding: 1.5rem;
	background: #fff;
	border: 2px solid var(--accent-color, #ff6b6b);
	border-radius: 8px;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
	margin-bottom: 2rem;
	display: none;
}

/* Only show on desktop */
@media (min-width: 1024px) {
	.cta-sticky {
		display: block;
		max-width: 300px;
		float: left;
		margin-right: 2rem;
	}
}

.cta-sticky__image {
	margin-bottom: 1rem;
}

.cta-sticky__image img {
	width: 100%;
	height: auto;
	border-radius: 4px;
}

.cta-sticky__title {
	font-size: 1.25rem;
	margin: 0 0 0.75rem;
	color: #333;
}

.cta-sticky__description {
	font-size: 0.95rem;
	color: #666;
	margin-bottom: 1rem;
	line-height: 1.5;
}

.cta-sticky__button {
	display: block;
	width: 100%;
	padding: 0.875rem 1.5rem;
	background-color: var(--accent-color, #ff6b6b);
	color: #fff;
	text-align: center;
	text-decoration: none;
	border-radius: 4px;
	font-weight: 600;
	transition: background-color 0.3s ease, transform 0.2s ease;
}

.cta-sticky__button:hover {
	background-color: var(--secondary-color, #23282d);
	transform: translateY(-2px);
	color: #fff;
}

/* ==========================================================================
   Entry Footer Schema
   ========================================================================== */

.entry-footer-schema {
	margin-top: 3rem;
	padding-top: 2rem;
	border-top: 2px solid #e0e0e0;
}

.entry-meta-schema {
	display: flex;
	flex-wrap: wrap;
	gap: 2rem;
	align-items: center;
	color: #666;
	font-size: 0.95rem;
}

.entry-author,
.entry-dates {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.author-label,
.date-label {
	font-weight: 600;
	color: #333;
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.entry-author a {
	color: var(--primary-color, #0073aa);
	text-decoration: none;
}

.entry-author a:hover {
	text-decoration: underline;
}

/* ==========================================================================
   Newsletter CTA
   ========================================================================== */

.newsletter-cta {
	background: linear-gradient(135deg, var(--primary-color, #0073aa) 0%, var(--secondary-color, #23282d) 100%);
	color: #fff;
	padding: 4rem 2rem;
	margin: 3rem 0 0;
}

.newsletter-cta__container {
	max-width: 1200px;
	margin: 0 auto;
	display: grid;
	gap: 2rem;
	align-items: center;
}

@media (min-width: 768px) {
	.newsletter-cta__container {
		grid-template-columns: 1fr 1fr;
	}
}

.newsletter-cta__title {
	font-size: 2rem;
	margin: 0 0 1rem;
	color: #fff;
}

.newsletter-cta__description {
	font-size: 1.1rem;
	color: rgba(255, 255, 255, 0.9);
	line-height: 1.6;
}

.newsletter-form {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

@media (min-width: 768px) {
	.newsletter-form {
		flex-direction: row;
	}
}

.newsletter-email {
	flex: 1;
	padding: 1rem 1.25rem;
	border: none;
	border-radius: 4px;
	font-size: 1rem;
}

.newsletter-submit {
	padding: 1rem 2rem;
	background-color: var(--accent-color, #ff6b6b);
	color: #fff;
	border: none;
	border-radius: 4px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.3s ease;
	white-space: nowrap;
}

.newsletter-submit:hover {
	background-color: #e55555;
}

.newsletter-privacy {
	margin-top: 1rem;
	font-size: 0.85rem;
	color: rgba(255, 255, 255, 0.8);
}

.newsletter-privacy a {
	color: #fff;
	text-decoration: underline;
}

.newsletter-message {
	padding: 1rem;
	border-radius: 4px;
	margin-top: 1rem;
}

.newsletter-message.success {
	background-color: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.newsletter-message.error {
	background-color: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

/* ==========================================================================
   Exit Popup
   ========================================================================== */

.exit-popup {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.exit-popup__overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(3px);
}

.exit-popup__content {
	position: relative;
	background: #fff;
	border-radius: 8px;
	max-width: 500px;
	width: 100%;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
	animation: popupSlideIn 0.3s ease-out;
}

@keyframes popupSlideIn {
	from {
		opacity: 0;
		transform: translateY(-50px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.exit-popup__close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	background: transparent;
	border: none;
	font-size: 2rem;
	color: #999;
	cursor: pointer;
	line-height: 1;
	padding: 0.5rem;
	transition: color 0.2s ease;
}

.exit-popup__close:hover {
	color: #333;
}

.exit-popup__inner {
	padding: 3rem 2rem 2rem;
}

.exit-popup__title {
	font-size: 1.75rem;
	margin: 0 0 1rem;
	color: #333;
}

.exit-popup__description {
	font-size: 1rem;
	color: #666;
	margin-bottom: 2rem;
	line-height: 1.6;
}

.exit-popup-form {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.exit-popup-email {
	padding: 1rem 1.25rem;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 1rem;
}

.exit-popup-submit {
	padding: 1rem 2rem;
	background-color: var(--accent-color, #ff6b6b);
	color: #fff;
	border: none;
	border-radius: 4px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.3s ease;
}

.exit-popup-submit:hover {
	background-color: var(--secondary-color, #23282d);
}

.exit-popup-message {
	padding: 1rem;
	border-radius: 4px;
	margin-top: 1rem;
}

.exit-popup-message.success {
	background-color: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.exit-popup-message.error {
	background-color: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

/* ==========================================================================
   Related Posts
   ========================================================================== */

.related-posts {
	margin: 4rem 0;
	padding: 3rem 0;
	border-top: 2px solid #e0e0e0;
}

.related-posts__title {
	font-size: 2rem;
	margin-bottom: 2rem;
	color: #333;
}

.related-posts__grid {
	display: grid;
	gap: 2rem;
	grid-template-columns: 1fr;
}

@media (min-width: 640px) {
	.related-posts__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1024px) {
	.related-posts__grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

.related-post {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	overflow: hidden;
	transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.related-post:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	transform: translateY(-4px);
}

.related-post__thumbnail {
	display: block;
	overflow: hidden;
}

.related-post__thumbnail img {
	width: 100%;
	height: 200px;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.related-post:hover .related-post__thumbnail img {
	transform: scale(1.05);
}

.related-post__content {
	padding: 1.5rem;
}

.related-post__title {
	font-size: 1.25rem;
	margin: 0 0 0.75rem;
}

.related-post__title a {
	color: #333;
	text-decoration: none;
	transition: color 0.2s ease;
}

.related-post__title a:hover {
	color: var(--primary-color, #0073aa);
}

.related-post__meta {
	font-size: 0.85rem;
	color: #999;
	margin-bottom: 1rem;
}

.related-post__excerpt {
	color: #666;
	line-height: 1.6;
	margin-bottom: 1rem;
}

.related-post__link {
	color: var(--primary-color, #0073aa);
	text-decoration: none;
	font-weight: 600;
	transition: color 0.2s ease;
}

.related-post__link:hover {
	color: var(--secondary-color, #23282d);
}

/* ==========================================================================
   Quiz & Landing Page Forms
   ========================================================================== */

.health-quiz,
.health-landing-page {
	background: #f9f9f9;
	padding: 2rem;
	border-radius: 8px;
	margin: 2rem 0;
}

.quiz-title,
.landing-page-title {
	font-size: 1.75rem;
	margin: 0 0 1rem;
	color: #333;
}

.quiz-description,
.landing-page-description {
	color: #666;
	line-height: 1.6;
	margin-bottom: 2rem;
}

.quiz-form,
.landing-page-form {
	background: #fff;
	padding: 2rem;
	border-radius: 8px;
}

.quiz-question-item,
.form-field {
	margin-bottom: 1.5rem;
}

.quiz-question-label,
.form-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.5rem;
	color: #333;
}

.required {
	color: #e74c3c;
}

.quiz-input,
.quiz-select,
.landing-page-input,
.landing-page-textarea {
	width: 100%;
	padding: 0.875rem 1rem;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 1rem;
	transition: border-color 0.2s ease;
}

.quiz-input:focus,
.quiz-select:focus,
.landing-page-input:focus,
.landing-page-textarea:focus {
	border-color: var(--primary-color, #0073aa);
	outline: none;
}

.landing-page-textarea {
	min-height: 120px;
	resize: vertical;
}

.quiz-option {
	display: block;
	padding: 0.5rem 0;
	cursor: pointer;
}

.quiz-option input {
	margin-right: 0.5rem;
}

.quiz-submit,
.landing-page-submit {
	padding: 1rem 2rem;
	background-color: var(--accent-color, #ff6b6b);
	color: #fff;
	border: none;
	border-radius: 4px;
	font-weight: 600;
	font-size: 1rem;
	cursor: pointer;
	transition: background-color 0.3s ease, transform 0.2s ease;
	margin-top: 1rem;
}

.quiz-submit:hover,
.landing-page-submit:hover {
	background-color: var(--secondary-color, #23282d);
	transform: translateY(-2px);
}

.quiz-message,
.landing-page-message {
	padding: 1rem;
	border-radius: 4px;
	margin-top: 1rem;
}

.quiz-message.success,
.landing-page-message.success {
	background-color: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.quiz-message.error,
.landing-page-message.error {
	background-color: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.cta-button {
	display: inline-block;
	padding: 0.875rem 1.75rem;
	background-color: var(--accent-color, #ff6b6b);
	color: #fff !important;
	text-decoration: none;
	border-radius: 4px;
	font-weight: 600;
	transition: all 0.3s ease;
	border: none;
	cursor: pointer;
	font-size: 1rem;
}

.cta-button:hover {
	background-color: var(--secondary-color, #23282d);
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
