/**
 * Engagement Features Styles
 * Quiz, Accordion, Newsletter, Author Box, Progress Bar
 * Dark Theme — matches site-wide #0a0a0a palette
 *
 * @package HTG
 * @since 2.5.4
 */

/* CSS Variables — inherit from main design tokens in style.css */
:root {
	--htg-engagement-primary: var(--htg-navy, #1a1f36);
	--htg-engagement-secondary: var(--htg-accent, #00d4aa);
	--htg-engagement-bg: var(--htg-bg-card, #121212);
	--htg-engagement-card: var(--htg-bg-elevated, #1a1a1a);
	--htg-engagement-border: var(--htg-border, #2a2a2a);
	--htg-engagement-text: var(--htg-text-body, #e0e0e0);
	--htg-engagement-muted: var(--htg-text-muted, #b0b0b0);
	--htg-engagement-heading: var(--htg-text-primary, #ffffff);
}

/* ===========================================
   Interactive Quiz System
   =========================================== */

.HTG-quiz-container {
	background: linear-gradient(135deg, var(--htg-engagement-card) 0%, var(--htg-engagement-bg) 100%);
	border-radius: 12px;
	padding: 30px;
	margin: 40px 0;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	position: relative;
	border: 2px solid var(--htg-engagement-border);
}

.HTG-quiz-header {
	display: flex;
	align-items: center;
	gap: 15px;
	margin-bottom: 25px;
}

.HTG-quiz-icon {
	font-size: 36px;
	line-height: 1;
}

.HTG-quiz-question {
	font-size: 22px;
	font-weight: 700;
	color: var(--htg-engagement-heading);
	margin: 0;
	line-height: 1.3;
}

.HTG-quiz-options {
	display: grid;
	gap: 12px;
	margin-bottom: 20px;
}

.HTG-quiz-option {
	background: var(--htg-engagement-card);
	border: 2px solid var(--htg-engagement-border);
	border-radius: 8px;
	padding: 18px 20px;
	color: var(--htg-engagement-text);
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	display: flex;
	justify-content: space-between;
	align-items: center;
	text-align: left;
	width: 100%;
}

.HTG-quiz-option:hover {
	border-color: var(--htg-engagement-secondary);
	background: var(--htg-engagement-primary);
	color: #ffffff;
	transform: translateX(4px);
}

.HTG-quiz-option-arrow {
	font-size: 18px;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.HTG-quiz-option:hover .HTG-quiz-option-arrow {
	opacity: 1;
}

.HTG-quiz-results {
	display: grid;
	gap: 15px;
	margin-bottom: 20px;
}

.HTG-quiz-result {
	background: var(--htg-engagement-card);
	border-radius: 8px;
	padding: 15px;
	border: 2px solid var(--htg-engagement-border);
}

.HTG-quiz-result.user-choice {
	border-color: var(--htg-engagement-secondary);
	background: rgba(0, 212, 170, 0.08);
}

.HTG-quiz-result-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
}

.HTG-quiz-result-text {
	font-weight: 600;
	color: var(--htg-engagement-text);
	font-size: 15px;
}

.HTG-quiz-your-vote {
	display: inline-block;
	margin-left: 8px;
	color: var(--htg-engagement-secondary);
	font-size: 13px;
}

.HTG-quiz-result-percentage {
	font-size: 18px;
	font-weight: 700;
	color: var(--htg-engagement-secondary);
}

.HTG-quiz-result-bar {
	height: 8px;
	background: var(--htg-engagement-border);
	border-radius: 4px;
	overflow: hidden;
	margin-bottom: 8px;
}

.HTG-quiz-result-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--htg-engagement-primary) 0%, var(--htg-engagement-secondary) 100%);
	border-radius: 4px;
	transition: width 0.8s ease;
}

.HTG-quiz-result-votes {
	font-size: 12px;
	color: var(--htg-engagement-muted);
}

.HTG-quiz-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-top: 20px;
	border-top: 1px solid var(--htg-engagement-border);
	font-size: 14px;
}

.HTG-quiz-total-votes {
	color: var(--htg-engagement-muted);
	font-weight: 600;
}

.HTG-quiz-prompt {
	color: var(--htg-engagement-secondary);
	font-weight: 600;
}

.HTG-quiz-thanks {
	color: #10b981;
	font-weight: 600;
}

.HTG-quiz-loading {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(10, 10, 10, 0.92);
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.HTG-quiz-spinner {
	width: 40px;
	height: 40px;
	border: 4px solid var(--htg-engagement-border);
	border-top-color: var(--htg-engagement-secondary);
	border-radius: 50%;
	animation: HTG-spin 0.8s linear infinite;
}

@keyframes HTG-spin {
	to { transform: rotate(360deg); }
}

/* ===========================================
   Accordion System
   =========================================== */

.HTG-accordion {
	margin: 30px 0;
}

.HTG-accordion-item {
	background: var(--htg-engagement-card);
	border: 1px solid var(--htg-engagement-border);
	border-radius: 8px;
	margin-bottom: 12px;
	overflow: hidden;
	transition: all 0.3s ease;
}

.HTG-accordion-item:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.HTG-accordion-item.is-open {
	border-color: var(--htg-engagement-secondary);
}

.HTG-accordion-header {
	background: #0f0f0f;
	border: none;
	padding: 18px 20px;
	color: var(--htg-engagement-text);
	width: 100%;
	display: flex;
	justify-content: space-between;
	align-items: center;
	cursor: pointer;
	transition: all 0.3s ease;
	font-size: 16px;
	font-weight: 600;
	text-align: left;
}

.HTG-accordion-item.is-open .HTG-accordion-header {
	background: var(--htg-engagement-primary);
	color: #ffffff;
}

.HTG-accordion-header:hover {
	background: var(--htg-engagement-border);
}

.HTG-accordion-item.is-open .HTG-accordion-header:hover {
	background: #0d1a3d;
}

.HTG-accordion-icon {
	transition: transform 0.3s ease;
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.HTG-accordion-item.is-open .HTG-accordion-icon {
	transform: rotate(180deg);
}

.HTG-accordion-content {
	transition: max-height 0.3s ease, opacity 0.3s ease;
}

.HTG-accordion-body {
	padding: 20px;
	color: var(--htg-engagement-text);
	line-height: 1.7;
}

/* Accordion Styles */
.HTG-accordion-minimal .HTG-accordion-item {
	border: none;
	border-bottom: 1px solid var(--htg-engagement-border);
	border-radius: 0;
}

.HTG-accordion-minimal .HTG-accordion-header {
	background: transparent;
	padding-left: 0;
	padding-right: 0;
}

.HTG-accordion-bordered .HTG-accordion-item {
	border-width: 2px;
}

/* ===========================================
   Newsletter System
   =========================================== */

.HTG-newsletter-box {
	background: linear-gradient(135deg, var(--htg-engagement-card) 0%, var(--htg-engagement-bg) 100%);
	border-radius: 12px;
	padding: 40px;
	margin: 40px 0;
	border: 2px solid var(--htg-engagement-border);
	display: flex;
	gap: 30px;
	align-items: center;
}

.HTG-newsletter-icon {
	flex-shrink: 0;
	width: 80px;
	height: 80px;
	background: var(--htg-engagement-primary);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ffffff;
}

.HTG-newsletter-icon svg {
	width: 48px;
	height: 48px;
}

.HTG-newsletter-content {
	flex: 1;
}

.HTG-newsletter-title {
	font-size: 24px;
	font-weight: 700;
	color: var(--htg-engagement-heading);
	margin: 0 0 10px;
}

.HTG-newsletter-description {
	font-size: 15px;
	color: var(--htg-engagement-muted);
	margin: 0 0 20px;
}

.HTG-newsletter-input-group {
	display: flex;
	gap: 10px;
	margin-bottom: 15px;
}

.HTG-newsletter-input {
	flex: 1;
	padding: 14px 20px;
	border: 2px solid var(--htg-engagement-border);
	border-radius: 8px;
	font-size: 15px;
	transition: all 0.3s ease;
	background: #0a0a0a;
	color: var(--htg-engagement-text);
}

.HTG-newsletter-input:focus {
	border-color: var(--htg-engagement-secondary);
	outline: none;
	box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.15);
}

.HTG-newsletter-button {
	padding: 14px 30px;
	background: var(--htg-engagement-secondary);
	color: #0a0a0a;
	border: none;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	gap: 8px;
}

.HTG-newsletter-button:hover {
	background: #00e6b8;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
	color: #0a0a0a;
}

.HTG-newsletter-message {
	padding: 12px;
	border-radius: 6px;
	margin-bottom: 10px;
	font-size: 14px;
	font-weight: 600;
}

.HTG-newsletter-message.success {
	background: rgba(16, 185, 129, 0.1);
	color: #10b981;
	border: 1px solid rgba(16, 185, 129, 0.3);
}

.HTG-newsletter-message.error {
	background: rgba(239, 68, 68, 0.1);
	color: #ef4444;
	border: 1px solid rgba(239, 68, 68, 0.3);
}

.HTG-newsletter-privacy {
	font-size: 12px;
	color: #888888;
	margin: 0;
}

/* Newsletter Styles */
.HTG-newsletter-minimal {
	background: transparent;
	border: none;
	padding: 30px;
	flex-direction: column;
	text-align: center;
}

.HTG-newsletter-boxed {
	background: var(--htg-engagement-primary);
	color: #ffffff;
	border-color: var(--htg-engagement-primary);
}

.HTG-newsletter-boxed .HTG-newsletter-title,
.HTG-newsletter-boxed .HTG-newsletter-description {
	color: #ffffff;
}

.HTG-newsletter-boxed .HTG-newsletter-icon {
	background: rgba(255, 255, 255, 0.2);
}

.HTG-newsletter-boxed .HTG-newsletter-button {
	background: #ffffff;
	color: var(--htg-engagement-primary);
}

.HTG-newsletter-boxed .HTG-newsletter-button:hover {
	background: var(--htg-engagement-secondary);
	color: #0a0a0a;
}

.HTG-newsletter-gradient {
	background: linear-gradient(135deg, var(--htg-engagement-primary) 0%, #0d1a3d 100%);
	color: #ffffff;
	border: none;
}

.HTG-newsletter-gradient .HTG-newsletter-title,
.HTG-newsletter-gradient .HTG-newsletter-description {
	color: #ffffff;
}

/* ===========================================
   Author Box
   =========================================== */

.HTG-author-box {
	background: var(--htg-engagement-card);
	border-radius: 12px;
	padding: 30px;
	margin: 40px 0;
	display: flex;
	gap: 25px;
	border: 2px solid var(--htg-engagement-border);
}

.HTG-author-avatar {
	flex-shrink: 0;
}

.HTG-author-avatar img {
	border-radius: 50%;
	width: 120px;
	height: 120px;
	border: 4px solid var(--htg-engagement-border);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.HTG-author-info {
	flex: 1;
}

.HTG-author-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 15px;
}

.HTG-author-name {
	font-size: 22px;
	font-weight: 700;
	margin: 0 0 8px;
	color: var(--htg-engagement-heading);
}

.HTG-author-name a {
	color: var(--htg-engagement-heading);
	text-decoration: none;
	transition: color 0.3s ease;
}

.HTG-author-name a:hover {
	color: var(--htg-engagement-secondary);
}

.HTG-author-title {
	font-size: 14px;
	color: var(--htg-engagement-muted);
	font-weight: 500;
}

.HTG-author-job-title {
	font-weight: 600;
	color: var(--htg-engagement-secondary);
}

.HTG-author-stats {
	text-align: right;
}

.HTG-author-post-count {
	display: inline-block;
	background: #0a0a0a;
	padding: 8px 15px;
	border-radius: 20px;
	font-size: 13px;
	color: var(--htg-engagement-muted);
	border: 1px solid var(--htg-engagement-border);
}

.HTG-author-post-count strong {
	color: var(--htg-engagement-secondary);
	font-size: 16px;
}

.HTG-author-bio {
	color: var(--htg-engagement-text);
	line-height: 1.7;
	margin-bottom: 20px;
}

.HTG-author-bio p {
	margin: 0 0 10px;
}

.HTG-author-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-top: 15px;
	border-top: 1px solid var(--htg-engagement-border);
}

.HTG-author-social {
	display: flex;
	gap: 10px;
}

.HTG-author-social-link {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #0a0a0a;
	border: 2px solid var(--htg-engagement-border);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--htg-engagement-muted);
	text-decoration: none;
	font-size: 14px;
	font-weight: 700;
	transition: all 0.3s ease;
}

.HTG-author-social-link:hover {
	background: var(--htg-engagement-secondary);
	border-color: var(--htg-engagement-secondary);
	color: #0a0a0a;
	transform: translateY(-2px);
}

.HTG-author-link {
	color: var(--htg-engagement-secondary);
	text-decoration: none;
	font-weight: 600;
	font-size: 14px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	transition: all 0.3s ease;
}

.HTG-author-link:hover {
	color: #00e6b8;
	gap: 12px;
}

/* Author Box Styles */
.HTG-author-box-minimal {
	background: transparent;
	border: none;
	padding: 20px 0;
}

.HTG-author-box-card {
	background: var(--htg-engagement-card);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.HTG-author-box-gradient {
	background: linear-gradient(135deg, var(--htg-engagement-primary) 0%, #0d1a3d 100%);
	color: #ffffff;
	border: none;
}

.HTG-author-box-gradient .HTG-author-name a,
.HTG-author-box-gradient .HTG-author-bio {
	color: #ffffff;
}

.HTG-author-box-gradient .HTG-author-title {
	color: var(--htg-engagement-secondary);
}

/* ===========================================
   Reading Progress Bar
   =========================================== */

.HTG-progress-bar {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 4px;
	background: rgba(255, 255, 255, 0.05);
	z-index: 9999;
}

.HTG-progress-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--htg-engagement-primary) 0%, var(--htg-engagement-secondary) 100%);
	width: 0%;
	transition: width 0.1s ease;
}

/* ===========================================
   Responsive Design
   =========================================== */

@media (max-width: 768px) {
	.HTG-quiz-container,
	.HTG-newsletter-box,
	.HTG-author-box {
		padding: 25px;
	}

	.HTG-newsletter-box,
	.HTG-author-box {
		flex-direction: column;
		text-align: center;
	}

	.HTG-author-avatar img {
		width: 100px;
		height: 100px;
	}

	.HTG-author-header,
	.HTG-author-footer {
		flex-direction: column;
		gap: 15px;
	}

	.HTG-newsletter-input-group {
		flex-direction: column;
	}
}

/* ===========================================
   AJAX Post Grid & Filters
   =========================================== */

.HTG-ajax-post-grid-container {
	margin: 40px 0;
}

.HTG-post-filters {
	text-align: center;
	margin-bottom: 40px;
}

.HTG-filters-title {
	font-size: 28px;
	font-weight: 700;
	color: var(--htg-engagement-heading);
	margin: 0 0 25px;
}

.HTG-filter-buttons {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
}

.HTG-filter-btn {
	padding: 12px 24px;
	background: var(--htg-engagement-card);
	border: 2px solid var(--htg-engagement-border);
	border-radius: 8px;
	font-size: 15px;
	font-weight: 600;
	color: var(--htg-engagement-muted);
	cursor: pointer;
	transition: all 0.3s ease;
}

.HTG-filter-btn:hover {
	border-color: var(--htg-engagement-secondary);
	color: var(--htg-engagement-secondary);
	transform: translateY(-2px);
}

.HTG-filter-btn.active {
	background: var(--htg-engagement-secondary);
	border-color: var(--htg-engagement-secondary);
	color: #0a0a0a;
}

.HTG-filter-count {
	display: inline-block;
	margin-left: 6px;
	opacity: 0.7;
	font-size: 13px;
}

.HTG-ajax-posts-grid {
	display: grid;
	gap: 30px;
	margin-bottom: 40px;
}

.HTG-grid-columns-2 {
	grid-template-columns: repeat(2, 1fr);
}

.HTG-grid-columns-3 {
	grid-template-columns: repeat(3, 1fr);
}

.HTG-grid-columns-4 {
	grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
	.HTG-grid-columns-4 {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 768px) {
	.HTG-grid-columns-3,
	.HTG-grid-columns-4 {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 480px) {
	.HTG-grid-columns-2,
	.HTG-grid-columns-3,
	.HTG-grid-columns-4 {
		grid-template-columns: 1fr;
	}
}

.HTG-ajax-post-card {
	background: var(--htg-engagement-card);
	border-radius: 12px;
	overflow: hidden;
	border: 1px solid var(--htg-engagement-border);
	transition: all 0.3s ease;
	display: flex;
	flex-direction: column;
}

.HTG-ajax-post-card:hover {
	transform: translateY(-6px);
	box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
	border-color: var(--htg-engagement-secondary);
}

.HTG-ajax-post-thumbnail {
	position: relative;
	height: 220px;
	overflow: hidden;
}

.HTG-ajax-post-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.HTG-ajax-post-card:hover .HTG-ajax-post-thumbnail img {
	transform: scale(1.08);
}

.HTG-post-format-badge {
	position: absolute;
	top: 15px;
	right: 15px;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(26, 31, 54, 0.9);
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
}

.HTG-post-format-badge .dashicons {
	width: 20px;
	height: 20px;
	font-size: 20px;
}

.HTG-ajax-post-content {
	padding: 20px;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.HTG-ajax-post-title {
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
	margin: 10px 0;
}

.HTG-ajax-post-title a {
	color: var(--htg-engagement-heading);
	text-decoration: none;
	transition: color 0.3s ease;
}

.HTG-ajax-post-title a:hover {
	color: var(--htg-engagement-secondary);
}

.HTG-ajax-post-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 15px;
	font-size: 13px;
	color: var(--htg-engagement-muted);
	margin-bottom: 15px;
}

.HTG-ajax-post-meta span {
	display: flex;
	align-items: center;
	gap: 5px;
}

.HTG-ajax-post-meta .dashicons {
	width: 16px;
	height: 16px;
	font-size: 16px;
}

.HTG-ajax-post-excerpt {
	color: #cccccc;
	font-size: 14px;
	line-height: 1.6;
	margin-bottom: 15px;
	flex: 1;
}

.HTG-ajax-post-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--htg-engagement-secondary);
	font-weight: 600;
	font-size: 14px;
	text-decoration: none;
	transition: all 0.3s ease;
	margin-top: auto;
}

.HTG-ajax-post-link:hover {
	color: #00e6b8;
	gap: 12px;
}

.HTG-ajax-post-link .dashicons {
	width: 16px;
	height: 16px;
	font-size: 16px;
}

.HTG-load-more-container {
	text-align: center;
	margin: 40px 0;
}

.HTG-load-more-btn {
	padding: 16px 40px;
	background: var(--htg-engagement-secondary);
	color: #0a0a0a;
	border: none;
	border-radius: 8px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.HTG-load-more-btn:hover {
	background: #00e6b8;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 212, 170, 0.3);
}

.HTG-load-more-btn:disabled {
	background: #333333;
	color: #666666;
	cursor: not-allowed;
	transform: none;
}

.HTG-spinner {
	display: inline-block;
	width: 18px;
	height: 18px;
	border: 3px solid rgba(0, 0, 0, 0.2);
	border-top-color: #0a0a0a;
	border-radius: 50%;
	animation: HTG-spin 0.8s linear infinite;
}

.HTG-no-posts {
	text-align: center;
	padding: 60px 20px;
	background: var(--htg-engagement-card);
	border: 1px solid var(--htg-engagement-border);
	border-radius: 12px;
	margin: 20px 0;
}

.HTG-no-posts p {
	font-size: 18px;
	color: var(--htg-engagement-muted);
	margin: 0;
}

/* ===========================================
   Error Messages
   =========================================== */

.HTG-error-message {
	position: relative;
	margin: 15px 0;
	padding: 0;
	opacity: 1;
	transition: opacity 0.3s ease;
	animation: slideInDown 0.3s ease;
}

.HTG-error-content {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 20px;
	background: rgba(239, 68, 68, 0.1);
	border: 2px solid rgba(239, 68, 68, 0.3);
	border-radius: 8px;
}

.HTG-error-icon {
	font-size: 24px;
	line-height: 1;
	flex-shrink: 0;
}

.HTG-error-text {
	font-size: 15px;
	font-weight: 500;
	color: #ef4444;
	line-height: 1.4;
}

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

/* ===========================================
   Print Styles
   =========================================== */

@media print {
	.HTG-quiz-container,
	.HTG-newsletter-box,
	.HTG-progress-bar,
	.HTG-sticky-share,
	.HTG-post-filters,
	.HTG-load-more-container {
		display: none;
	}
}
