/*
 * Hot or Not Skin — BuddyX Child Theme
 *
 * Applies the Hot or Not visual identity on top of BuddyX.
 * Loaded globally on the front-end (after buddyx-style and buddyx-child-style).
 *
 * Design token reference:
 *   --hon-primary      Brand red (Hot)
 *   --hon-primary-dark Darker red for hover/text
 *   --hon-cool         Cool blue accent (Not)
 *   --hon-surface      Warm off-white surface
 *   --hon-bg           Subtle warm body tint
 *
 * BuddyX CSS variables overridden here:
 *   --color-theme-primary → hon-primary
 *   --color-link          → hon-primary
 *   --color-link-hover    → hon-primary-dark
 */

/* ============================================================
   1. Design Tokens
   ============================================================ */
:root {
	/* Brand palette */
	--hon-primary:      #e32232;
	--hon-primary-dark: #b91c1c;
	--hon-primary-glow: rgba(227, 34, 50, 0.28);
	--hon-cool:         #2b6cb0;
	--hon-cool-dark:    #1a4d8a;

	/* Surfaces */
	--hon-surface:      #fffaf5;
	--hon-bg:           #fdf8f4;
	--hon-border:       #ead8cc;

	/* Rank badge palette */
	--hon-rank-gold:    #f59e0b;
	--hon-rank-silver:  #9ca3af;
	--hon-rank-bronze:  #c87533;

	/* Override BuddyX primary accent */
	--color-theme-primary: var(--hon-primary);
	--color-link:          var(--hon-primary);
	--color-link-hover:    var(--hon-primary-dark);
}

/* ============================================================
   2. Body & Global Background
   ============================================================ */
body {
	background-color: var(--hon-bg);
}

/* ============================================================
   3. Vote Button Animations
   ============================================================ */
@keyframes hon-pulse {
	0%   { box-shadow: 0 0 0 0 var(--hon-primary-glow); }
	60%  { box-shadow: 0 0 0 10px transparent; }
	100% { box-shadow: 0 0 0 0 transparent; }
}

@keyframes hon-vote-bounce {
	0%, 100% { transform: scale(1); }
	40%       { transform: scale(1.12); }
	70%       { transform: scale(0.96); }
}

@keyframes hon-flash-in {
	from { opacity: 0; transform: translateY(-4px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Pulse on idle state for the primary vote button */
.hnc-hot-button:not(.is-disabled):not(:disabled) {
	animation: hon-pulse 2.6s ease-out infinite;
}

/* Kill the idle pulse while user hovers (avoids jitter) */
.hnc-hot-button:hover,
.hnc-hot-button:focus {
	animation: none;
	box-shadow: 0 0 0 4px var(--hon-primary-glow), 0 10px 24px var(--hon-primary-glow);
	transition: box-shadow 0.18s ease, background 0.18s ease;
}

/* Play bounce animation once after a successful vote */
.hnc-hot-button.voted-animation {
	animation: hon-vote-bounce 0.45s ease forwards;
}

/* Feedback text entrance */
.hnc-feedback:not(:empty),
.hnc-submit-feedback:not(:empty) {
	animation: hon-flash-in 0.25s ease;
}

/* ============================================================
   4. Matchup Card Enhancements
   ============================================================ */

/* Warm card surface + lifted shadow */
.hnc-card {
	background: var(--hon-surface);
	border-color: var(--hon-border);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.hnc-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 22px 44px rgba(36, 23, 20, 0.1);
}

/* Hot badge — branded red pill in image corner */
.hnc-card-badge {
	background: var(--hon-primary);
	color: #fff;
}

/* Vote pill matches brand */
.hnc-vote-pill {
	background: linear-gradient(180deg, #fff0ef 0%, var(--hon-surface) 100%);
	border-color: rgba(227, 34, 50, 0.18);
}

.hnc-vote-pill-value {
	color: var(--hon-primary-dark);
}

/* ============================================================
   5. BuddyPress Member Loop — Hot/Not Overlay Badge
   ============================================================ */

/*
 * The hot-or-not-voting plugin outputs .hon-voting-component inside
 * each member card. We add a small Hot Rating badge on the avatar
 * when the member has a high hot-vote score.
 *
 * Usage: the voting plugin adds data-hot-pct="<int>" to the
 * .item-avatar element; CSS shows the badge via a pseudo-element
 * when the value is ≥ 80. (JS toggling the class .is-hot is simpler
 * and is wired in the companion JS below.)
 */
.item-avatar.is-hot {
	position: relative;
}

.item-avatar.is-hot::after {
	content: "🔥 Hot";
	position: absolute;
	bottom: 4px;
	left: 50%;
	transform: translateX(-50%);
	padding: 0.2rem 0.55rem;
	border-radius: 999px;
	background: var(--hon-primary);
	color: #fff;
	font-size: 0.65rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	white-space: nowrap;
	pointer-events: none;
}

/* ============================================================
   6. Leaderboard Rank Badges
   ============================================================ */

/* Full-page leaderboard shortcode.
 * Plugin markup:
 *   .hnc-leaderboard > ol.hnc-leaderboard-list > li.hnc-leaderboard-item
 *     > .hnc-rank  +  a.hnc-leaderboard-link > img.hnc-leaderboard-thumb
 *                                             > .hnc-leaderboard-name
 *     > .hnc-leaderboard-votes
 */
.hnc-leaderboard {
	margin: 1.5rem 0;
}

.hnc-leaderboard-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.hnc-leaderboard-item {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 0.9rem 1.1rem;
	border-radius: var(--global-border-radius, 14px);
	border: 1px solid var(--hon-border);
	background: var(--hon-surface);
	margin-bottom: 0.6rem;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hnc-leaderboard-item:hover {
	transform: translateX(4px);
	box-shadow: 0 8px 20px rgba(36, 23, 20, 0.07);
}

/* Rank number badge (.hnc-rank is the plugin's class) */
.hnc-rank {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 2.1rem;
	height: 2.1rem;
	border-radius: 50%;
	font-size: 0.78rem;
	font-weight: 800;
	flex-shrink: 0;
	background: #f3f4f6;
	color: #374151;
	border: 2px solid transparent;
}

/* Top-3 gold / silver / bronze treatment */
.hnc-leaderboard-item:nth-child(1) .hnc-rank {
	background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
	color: #92400e;
	border-color: var(--hon-rank-gold);
}

.hnc-leaderboard-item:nth-child(2) .hnc-rank {
	background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
	color: #374151;
	border-color: var(--hon-rank-silver);
}

.hnc-leaderboard-item:nth-child(3) .hnc-rank {
	background: linear-gradient(135deg, #fef6ee 0%, #fde8d0 100%);
	color: #7c3c0e;
	border-color: var(--hon-rank-bronze);
}

/* Anchor wrapping avatar + name */
.hnc-leaderboard-link {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex: 1;
	text-decoration: none;
	color: inherit;
	min-width: 0;
}

.hnc-leaderboard-link:hover .hnc-leaderboard-name {
	color: var(--hon-primary);
}

.hnc-leaderboard-thumb {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
	border: 2px solid var(--hon-border);
}

.hnc-leaderboard-name {
	font-weight: 700;
	font-size: 1rem;
	transition: color 0.15s ease;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Vote count column */
.hnc-leaderboard-votes {
	font-size: 0.82rem;
	font-weight: 700;
	color: var(--hon-primary-dark);
	white-space: nowrap;
}

/* ============================================================
   7. Archive Contestants Grid
   ============================================================ */
.post-type-archive-contestants .site-main,
.archive-contestants .site-main {
	background: var(--hon-bg);
}

.hnc-archive-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 1.25rem;
	margin: 1.5rem 0;
}

.hnc-archive-item {
	margin: 0;
}

.hnc-archive-item .hnc-card {
	height: 100%;
}

.hnc-archive-item-link-row {
	margin: 0.55rem 0 0;
	text-align: right;
}

/* Single contestant CPT page — full-width override */
.single-contestants .entry-header {
	background: linear-gradient(160deg, #fff1e6 0%, var(--hon-surface) 100%);
	padding: 2rem;
	border-radius: var(--global-border-radius, 16px);
	margin-bottom: 1.5rem;
	border: 1px solid var(--hon-border);
}

/* ============================================================
   8. Hero Banner (homepage / Vote Now page)
   ============================================================ */
.hon-hero {
	position: relative;
	overflow: hidden;
	padding: 3.5rem 1.5rem;
	text-align: center;
	background: linear-gradient(135deg, #1a0a0a 0%, #3b0e0e 38%, #1a0a0a 100%);
	color: #fff;
	border-radius: var(--global-border-radius, 20px);
	margin-bottom: 2rem;
}

/* Decorative background fire gradient layer */
.hon-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse at 50% 120%, rgba(227, 34, 50, 0.55) 0%, transparent 65%),
	            radial-gradient(ellipse at 80% -10%,  rgba(255, 107, 87, 0.25) 0%, transparent 55%);
	pointer-events: none;
}

.hon-hero-eyebrow {
	position: relative;
	margin: 0 0 0.6rem;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.6);
}

.hon-hero-title {
	position: relative;
	margin: 0 0 0.75rem;
	font-size: clamp(2rem, 5vw, 3.5rem);
	line-height: 1.05;
	font-weight: 900;
	color: #fff;
}

.hon-hero-title em {
	font-style: normal;
	color: #ff8c7a;
}

.hon-hero-desc {
	position: relative;
	max-width: 42rem;
	margin: 0 auto 1.75rem;
	color: rgba(255, 255, 255, 0.75);
	font-size: 1.05rem;
	line-height: 1.65;
}

.hon-hero-cta {
	position: relative;
	display: inline-block;
	padding: 0.85rem 2rem;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--hon-primary) 0%, #ff6b57 100%);
	color: #fff;
	font-weight: 700;
	font-size: 1rem;
	text-decoration: none;
	box-shadow: 0 16px 36px rgba(227, 34, 50, 0.35);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.hon-hero-cta:hover,
.hon-hero-cta:focus {
	transform: translateY(-2px);
	box-shadow: 0 20px 44px rgba(227, 34, 50, 0.45);
	color: #fff;
}

/* Phase 2 page template headers */
.hon-page-vote-content,
.hon-page-leaderboard-content {
	padding: 1.25rem;
	border-radius: var(--global-border-radius, 16px);
	background: var(--hon-surface);
	border: 1px solid var(--hon-border);
}

.hon-leaderboard-header,
.hon-contestants-archive-header {
	margin: 0 0 1.25rem;
	padding: 1.2rem 1.25rem;
	border-radius: var(--global-border-radius, 16px);
	border: 1px solid var(--hon-border);
	background: linear-gradient(160deg, #fff1e6 0%, var(--hon-surface) 100%);
}

.hon-leaderboard-page-title,
.hon-contestants-archive-header .archive-title {
	margin: 0;
}

.hon-leaderboard-page-desc,
.hon-contestants-archive-header .archive-description {
	margin: 0.55rem 0 0;
	color: #7a6860;
}

/* ============================================================
   9. Ad Widget Slots
   ============================================================ */
.hon-ad-slot {
	margin: 0 0 1.25rem;
	padding: 1rem;
	border-radius: var(--global-border-radius, 16px);
	border: 1px dashed rgba(227, 34, 50, 0.28);
	background: #fff;
}

.hon-ad-slot .widget {
	margin-bottom: 0;
}

.hon-ad-slot .widget-title,
.hon-ad-widget-title {
	margin: 0 0 0.6rem;
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #8f7870;
}

.hon-ad-slot.hon-hide-widget-title .widget-title,
.hon-ad-slot.hon-hide-widget-title .hon-ad-widget-title {
	display: none;
}

.hon-ad-slot img,
.hon-ad-slot iframe,
.hon-ad-slot .wp-block-image img {
	max-width: 100%;
	height: auto;
	display: block;
	margin-left: auto;
	margin-right: auto;
}

@media (min-width: 1025px) {
	.hon-hide-desktop {
		display: none !important;
	}
}

@media (min-width: 769px) and (max-width: 1024px) {
	.hon-hide-tablet {
		display: none !important;
	}
}

@media (max-width: 768px) {
	.hon-hide-mobile {
		display: none !important;
	}
}

/* ============================================================
	10. Navigation — Hot or Not accent
	============================================================ */

/* Active/hover nav items pick up the brand red automatically via
   --color-theme-primary override above. The rules below add
   a subtle underline glow on the primary nav. */
.site-navigation .menu > li.current-menu-item > a,
.site-navigation .menu > li.current_page_item > a {
	color: var(--hon-primary);
}

.site-navigation .menu > li > a:hover {
	color: var(--hon-primary);
}

/* ============================================================
	11. BuddyPress Profile — Hot or Not Stats Tab
	============================================================ */

/* The stats tab added via bp_core_new_nav_item inherits primary
   color from --color-theme-primary, so no extra rules needed.
   These rules style the content panel wrapper. */
.hon-stats-panel {
	padding: 1.5rem;
	border-radius: var(--global-border-radius, 16px);
	background: var(--hon-surface);
	border: 1px solid var(--hon-border);
}

.hon-stats-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 0.85rem;
	margin-top: 1rem;
}

.hon-stat-card {
	padding: 1rem;
	border-radius: var(--global-border-radius, 14px);
	background: #fff;
	border: 1px solid rgba(227, 34, 50, 0.1);
	text-align: center;
}

.hon-stat-value {
	display: block;
	font-size: 1.75rem;
	font-weight: 900;
	color: var(--hon-primary-dark);
	line-height: 1;
}

.hon-stat-label {
	display: block;
	margin-top: 0.35rem;
	font-size: 0.8rem;
	font-weight: 600;
	color: #7a6860;
	text-transform: uppercase;
	letter-spacing: 0.07em;
}

/* ============================================================
	12. Dark Mode Overrides
	============================================================ */
.buddyx-dark-theme {
	--hon-surface: #1e1414;
	--hon-bg:      #160e0e;
	--hon-border:  #3b2424;
}

.buddyx-dark-theme .hnc-card {
	background: var(--hon-surface);
	border-color: var(--hon-border);
	color: #e8d8d0;
}

.buddyx-dark-theme .hnc-vote-pill {
	background: linear-gradient(180deg, #2e1a1a 0%, #1e1414 100%);
	border-color: rgba(227, 34, 50, 0.2);
}

.buddyx-dark-theme .hnc-leaderboard-item {
	background: var(--hon-surface);
	border-color: var(--hon-border);
	color: #e8d8d0;
}

.buddyx-dark-theme .hon-hero {
	background: linear-gradient(135deg, #0d0505 0%, #2a0808 38%, #0d0505 100%);
}

.buddyx-dark-theme .hon-stats-panel,
.buddyx-dark-theme .hon-stat-card {
	background: var(--hon-surface);
	border-color: var(--hon-border);
}

.buddyx-dark-theme .hon-ad-slot {
	background: var(--hon-surface);
	border-color: rgba(227, 34, 50, 0.35);
}

/* ============================================================
	13. Responsive Adjustments
	============================================================ */
@media (max-width: 768px) {
	.hnc-leaderboard-item {
		padding: 0.75rem 0.85rem;
		gap: 0.7rem;
	}

	.hnc-leaderboard-thumb {
		width: 40px;
		height: 40px;
	}

	.hon-hero {
		padding: 2.5rem 1rem;
	}

	.hnc-archive-grid {
		grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
		gap: 0.85rem;
	}

	.hon-stats-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.hon-ad-slot {
		padding: 0.8rem;
		margin-bottom: 1rem;
	}
}

@media (max-width: 480px) {
	.hon-hero-title {
		font-size: 1.9rem;
	}

	.hon-stats-grid {
		grid-template-columns: 1fr;
	}
}

/* ============================================================
	14. Vote Page Stabilizers
	============================================================ */

/* Keep Vote page as a focused landing experience. */
.page-template-page-vote .site-main.hon-page-vote {
	padding-top: 1rem;
	padding-bottom: 1.25rem;
}

/* Prevent an oversized dark hero block impression. */
.page-template-page-vote .hon-hero {
	padding: 2rem 1rem;
	margin-bottom: 1.25rem;
	background: linear-gradient(135deg, #2f0d0d 0%, #5e1212 55%, #2a0a0a 100%);
}

.page-template-page-vote .hon-hero-desc {
	margin-bottom: 0;
}

.page-template-page-vote .hon-page-vote-content {
	padding: 1rem;
}

/* Hide demo footer widgets on Vote page only; keep site-info/copyright. */
.page-template-page-vote .site-footer-wrapper .footer-inner {
	display: none;
}

.page-template-page-vote .site-footer-wrapper {
	padding-top: 0;
	padding-bottom: 0;
	background: transparent;
}
