/**
 * JackpotPress front-end styles.
 * Dramatic lottery-card treatment with per-game color themes.
 */

/* ---------- Design tokens ---------- */

:where(.jp-hero, .jp-draw) {
	--jp-font-display: 'Google Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
	--jp-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
	--jp-radius: 20px;
	--jp-accent: #4f46e5;
	--jp-accent-2: #7c3aed;
	--jp-accent-ink: #ffffff;
	--jp-ball-bg: #ffffff;
	--jp-ball-ink: #0f172a;
}

/* ---------- Hero ---------- */

.jp-hero {
	position: relative;
	border-radius: var(--jp-radius);
	padding: 36px 40px 40px;
	margin: 0 0 32px;
	color: #ffffff;
	background:
		radial-gradient(900px 400px at 85% -20%, rgba(255, 214, 0, 0.35), transparent 60%),
		radial-gradient(600px 400px at 0% 120%, rgba(236, 72, 153, 0.45), transparent 55%),
		linear-gradient(135deg, #0f172a 0%, #1e1b4b 45%, #4c1d95 100%);
	overflow: hidden;
	isolation: isolate;
	box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.45);
}

.jp-hero::before {
	content: '';
	position: absolute;
	inset: 0;
	background-image:
		radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
	background-size: 22px 22px;
	opacity: 0.5;
	pointer-events: none;
	z-index: -1;
}

.jp-hero::after {
	content: '';
	position: absolute;
	top: -40px;
	right: -40px;
	width: 220px;
	height: 220px;
	border-radius: 50%;
	background: radial-gradient(closest-side, rgba(250, 204, 21, 0.55), transparent 70%);
	filter: blur(8px);
	pointer-events: none;
	z-index: -1;
}

.jp-hero__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--jp-font-display);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: #fde68a;
	padding: 6px 12px;
	border-radius: 999px;
	background: rgba(250, 204, 21, 0.12);
	border: 1px solid rgba(250, 204, 21, 0.35);
	margin-bottom: 16px;
}

.jp-hero__eyebrow::before {
	content: '✦';
	font-size: 11px;
	color: #facc15;
}

.jp-hero__title {
	font-family: var(--jp-font-display);
	font-size: clamp(26px, 4vw, 36px);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.02em;
	margin: 0 0 14px;
	color: #ffffff;
}

.jp-hero__lede {
	margin: 0;
	color: rgba(255, 255, 255, 0.82);
	font-size: 16px;
	line-height: 1.55;
	max-width: 60ch;
}

/* ---------- Intro paragraph (admin-configurable, sits between hero and cards) ---------- */

.jp-intro {
	margin: 0 0 28px;
	padding: 0;
	color: #334155;
	font-family: var(--jp-font-body);
	font-size: 16px;
	line-height: 1.65;
}

.jp-intro a {
	color: var(--jp-accent, #4f46e5);
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* When the intro sits directly after the hero, tighten the gap so they feel
   related rather than disconnected. */
.jp-hero + .jp-intro {
	margin-top: -8px;
}

/* Theme safety net: some themes (including the default entry-content styles)
   add their own margins to stray <p> tags. Re-assert ours so the intro keeps
   its own rhythm. */
.entry-content .jp-intro {
	margin: 0 0 28px;
}

/* ---------- Draw card ---------- */

.jp-draw {
	position: relative;
	border-radius: var(--jp-radius);
	padding: 0;
	margin: 20px 0;
	/* Subtle vertical gradient from pure white at the top down to a barely-
	   perceptible tint of the game's accent color at the bottom. Matches the
	   reference graphic's soft warmth without competing with the colored
	   header or the glossy balls. The @supports fallback below handles
	   browsers that don't yet ship color-mix(). */
	background: linear-gradient(180deg, #ffffff 0%, color-mix(in srgb, var(--jp-accent) 2%, #fbfbfc) 100%);
	border: 1px solid #e5e7eb;
	box-shadow:
		0 1px 2px rgba(15, 23, 42, 0.04),
		0 10px 30px -15px rgba(15, 23, 42, 0.18);
	overflow: hidden;
	transition: transform .25s ease, box-shadow .25s ease;
}

@supports not (background: color-mix(in srgb, red, blue)) {
	.jp-draw {
		background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
	}
}

.jp-draw:hover {
	transform: translateY(-2px);
	box-shadow:
		0 2px 4px rgba(15, 23, 42, 0.06),
		0 20px 40px -18px rgba(15, 23, 42, 0.28);
}

/* Accent bar on left edge */
.jp-draw::before {
	content: '';
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 6px;
	background: linear-gradient(180deg, var(--jp-accent), var(--jp-accent-2));
	z-index: 1;
}

/* ---------- Card header (colored) ---------- */

.jp-draw__header {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	padding: 18px 26px 18px 30px;
	background:
		linear-gradient(135deg, var(--jp-accent) 0%, var(--jp-accent-2) 100%);
	color: var(--jp-accent-ink);
	position: relative;
	overflow: hidden;
}

/* Date chip always sits on the right */
.jp-draw__date {
	margin-left: auto;
}

/* Game logo, injected by the the_content filter when a Games row has an image.
   Uses max-width/max-height rather than fixed width/height so wide OR tall logos
   both fit cleanly. !important guards against theme rules like
   `.entry-content img { height: auto !important }` that would otherwise stretch it. */
.entry-content .jp-draw__logo,
.jp-draw__logo {
	width: 56px !important;
	height: 56px !important;
	max-width: 56px !important;
	max-height: 56px !important;
	min-width: 56px;
	min-height: 56px;
	border-radius: 12px;
	object-fit: contain;
	object-position: center;
	padding: 6px;
	background: rgba(255, 255, 255, 0.96);
	border: 1px solid rgba(255, 255, 255, 0.35);
	box-shadow:
		0 2px 4px rgba(0, 0, 0, 0.15),
		inset 0 1px 0 rgba(255, 255, 255, 0.9);
	flex-shrink: 0;
	flex-grow: 0;
	position: relative;
	z-index: 1;
	display: inline-block;
	margin: 0;
	box-sizing: border-box;
	vertical-align: middle;
}

.jp-draw__header::after {
	content: '';
	position: absolute;
	top: -50%;
	right: -10%;
	width: 200px;
	height: 200%;
	background: radial-gradient(closest-side, rgba(255, 255, 255, 0.18), transparent 70%);
	pointer-events: none;
}

.jp-draw__name {
	font-family: var(--jp-font-display);
	font-size: 20px;
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.2;
	color: inherit;
	position: relative;
	z-index: 1;
	text-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
}

.jp-draw__date {
	font-family: var(--jp-font-body);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.88);
	padding: 5px 12px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.18);
	border: 1px solid rgba(255, 255, 255, 0.25);
	backdrop-filter: blur(4px);
	position: relative;
	z-index: 1;
	white-space: nowrap;
}

.jp-draw__date::before {
	content: 'Draw Date: ';
	opacity: 0.7;
	font-weight: 500;
}

/* ---------- Balls row ---------- */

.jp-balls {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
	/* Extra top padding gives the "Winning Numbers" micro-label AND the
	   per-ball jp-ball__tag column headers (POWERBALL / MEGA BALL / WB /
	   etc.) room to sit above the balls without overlapping them. Matches
	   the reference graphic's spacing. */
	padding: 44px 26px 24px 30px;
	margin: 0;
	list-style: none;
	position: relative;
}

/* "Winning Numbers" micro-label above the main row of balls. Only applies
   to the TOP-LEVEL balls row of each card — nested jp-draw__section rows
   (Double Play, merged multi-draw days) get their own pill label via
   jp-draw__section-title, so they skip this. */
.jp-draw > .jp-balls::before {
	content: 'Winning Numbers';
	position: absolute;
	top: 16px;
	left: 30px;
	font-family: var(--jp-font-display);
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: #64748b;
	line-height: 1;
	pointer-events: none;
}

.jp-ball {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	font-family: var(--jp-font-display);
	font-size: 20px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.02em;
	color: var(--jp-ball-ink);
	/* Two-layer treatment per the design pass:
	   1) Linear color gradient gives a clean directional fall-off (lit from
	      top-left, fading to a soft gray bottom-right).
	   2) Inset box-shadows do the spherical lighting — a bright top rim
	      and a darker bottom rim — so we no longer need a separate ::before
	      gloss-dot pseudo-element. */
	background: linear-gradient(145deg, #ffffff, #e5e7eb);
	border: 1px solid rgba(15, 23, 42, 0.43);
	box-shadow:
		inset 0 2px 4px rgba(255, 255, 255, 0.8),
		inset 0 -4px 6px rgba(0, 0, 0, 0.15),
		0 4px 10px rgba(0, 0, 0, 0.12);
	flex: 0 0 auto;
	line-height: 1;
}

/* The explicit gloss-dot pseudo-element is no longer needed: the linear
   color gradient + inset top/bottom shadows on .jp-ball already produce
   the spherical lighting effect cleanly. Kept the rule as a hard reset
   (rather than deleted) in case any legacy markup relies on the element
   existing — it just renders nothing. */
.jp-ball::before {
	content: none;
}

/* Bonus ball: uses the game accent color */
.jp-ball--bonus {
	color: var(--jp-accent-ink);
	/* Layered spherical-lighting treatment:
	   1) Top layer is a small white spotlight at top-left (lighting only).
	   2) Bottom layer is the game-accent color sphere offset toward bottom-
	      right, so the lit side and the shadowed side feel deliberate.
	   This is what gives the ball the "tactile, expensive, modern" depth
	   instead of a flat single-radial fade. */
	background:
		radial-gradient(
			circle at 30% 25%,
			rgba(255, 255, 255, 0.25) 0%,
			rgba(255, 255, 255, 0.08) 18%,
			transparent 40%
		),
		radial-gradient(
			circle at 65% 70%,
			var(--jp-accent) 0%,
			var(--jp-accent-2) 100%
		);
	border-color: rgba(15, 23, 42, 0.25);
	box-shadow:
		inset 0 2px 4px rgba(255, 255, 255, 0.13),
		inset 0 -6px 10px rgba(0, 0, 0, 0.22),
		0 6px 16px -2px rgba(0, 0, 0, 0.3),
		0 0 0 2px rgba(255, 255, 255, 0.4);
	text-shadow: 0 1px 2px rgba(15, 23, 42, 0.35);
	/* Space for the vertical divider (::after below) that separates the
	   main 5 balls from the accent bonus ball — mirrors the graphic. */
	margin-left: 24px;
}

/* Thin vertical divider sitting in the gap between the last main ball and
   the bonus ball. Fades top/bottom so it doesn't feel like a hard rule. */
.jp-ball--bonus::after {
	content: '';
	position: absolute;
	left: -14px;
	top: -4px;
	bottom: -4px;
	width: 1px;
	background: linear-gradient(180deg, transparent 0%, #d1d5db 25%, #d1d5db 75%, transparent 100%);
	pointer-events: none;
}

/* Column header above a bonus/special ball (POWERBALL, MEGA BALL, WB, ASB,
   etc.). Reduced visual weight per the design pass: lighter weight, tighter
   letter-spacing, and a low opacity so the colored ball below carries the
   meaning while the abbreviation reads as a quiet supporting label. */
.jp-ball__tag {
	position: absolute;
	top: -20px;
	left: 50%;
	transform: translateX(-50%);
	background: transparent;
	color: #64748b;
	font-family: var(--jp-font-display);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 0;
	border-radius: 0;
	line-height: 1;
	white-space: nowrap;
	box-shadow: none;
	text-shadow: none;
	opacity: 0.6;
	z-index: 2;
}

/* ---------- Nested section (Double Play, EZ Match, merged multi-draw days) ---------- */

.jp-draw__section {
	margin: 0 20px 0 24px;
	padding: 14px 0 0;
	/* Solid low-opacity divider replaces the old dashed line — reads as
	   a modern, intentional separator instead of a default-HTML dashed rule. */
	border-top: 1px solid rgba(15, 23, 42, 0.08);
	position: relative;
}

/* When the section is the FIRST child after the header (merged multi-draw days like
   Cash 3 Morning/Midday/Evening in one card), don't draw a dashed line at the very
   top — it looks like a stray border. The second and subsequent sections keep theirs. */
.jp-draw__header + .jp-draw__section {
	border-top: none;
	padding-top: 18px;
	margin-top: 0;
}

/* But if two merged sections sit back to back, we still want a separator between them. */
.jp-draw__header + .jp-draw__section + .jp-draw__section {
	border-top: 1px solid rgba(15, 23, 42, 0.08);
	padding-top: 14px;
	margin-top: 4px;
}

/* Flex row that keeps the section pill and the per-draw date on the same
   line, immune to whatever wpautop/the_content filters inject between
   sibling elements. */
.jp-draw__section-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin: 0 0 10px;
}

.jp-draw__section-title {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	vertical-align: middle;
	font-family: var(--jp-font-display);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--jp-accent);
	margin: 0;
	padding: 3px 10px;
	background: color-mix(in srgb, var(--jp-accent) 10%, white);
	border-radius: 999px;
	border: 1px solid color-mix(in srgb, var(--jp-accent) 25%, transparent);
}

/* When a section-title renders without a wrapper (legacy markup from posts
   generated before we introduced .jp-draw__section-head), restore its own
   bottom margin so the balls don't crash into it. */
.jp-draw__section > .jp-draw__section-title:first-child {
	margin-bottom: 10px;
}

/* Per-draw date shown next to the section-title pill in merged multi-draw
   cards (e.g. Cash 3 Morning + APRIL 24, 2026). Muted uppercase so it sits
   quietly beside the colored pill without competing for attention. */
.jp-draw__section-date {
	display: inline-block;
	margin: 0;
	padding: 0;
	font-family: var(--jp-font-display);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #94a3b8;
	white-space: nowrap;
}

/* Graceful fallback for browsers that don't support color-mix */
@supports not (background: color-mix(in srgb, red, blue)) {
	.jp-draw__section-title {
		background: rgba(15, 23, 42, 0.04);
		border-color: rgba(15, 23, 42, 0.1);
	}
}

.jp-draw__section-title::before {
	content: '';
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--jp-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--jp-accent) 20%, transparent);
}

.jp-draw__section .jp-balls {
	padding: 0 6px 8px;
	gap: 10px;
}

.jp-draw__section .jp-ball {
	width: 48px;
	height: 48px;
	font-size: 17px;
}

/* ---------- Legal / CYA disclaimer (appended to every generated post) ---------- */

.jp-disclaimer {
	display: block;
	margin: 28px 0 8px;
	padding: 16px 20px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-left: 3px solid #94a3b8;
	border-radius: 8px;
	font-size: 12px;
	line-height: 1.55;
	color: #64748b;
	font-style: italic;
}

.jp-disclaimer a {
	color: #475569;
	text-decoration: underline;
}

/* ---------- Meta (chips) ---------- */

.jp-draw__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	padding: 0 26px 22px 30px;
	margin: 0;
	color: #475569;
	font-size: 13px;
}

.jp-draw__meta:empty {
	display: none;
}

.jp-chip {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 10px 18px;
	border-radius: 999px;
	background: #f1f5f9;
	color: #334155;
	font-family: var(--jp-font-display);
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.01em;
	line-height: 1.4;
	white-space: nowrap;
	border: 1px solid #e2e8f0;
}

.jp-chip::before {
	font-size: 16px;
	opacity: 0.95;
	line-height: 1;
}

.jp-chip--jackpot {
	background: linear-gradient(135deg, #fef3c7, #fde68a);
	color: #854d0e;
	border-color: #fcd34d;
}
.jp-chip--jackpot::before { content: '💰'; }

.jp-chip--mult {
	background: linear-gradient(135deg, #ede9fe, #ddd6fe);
	color: #5b21b6;
	border-color: #c4b5fd;
}
.jp-chip--mult::before { content: '⚡'; }

.jp-chip--next {
	background: linear-gradient(135deg, #dbeafe, #bfdbfe);
	color: #1e40af;
	border-color: #93c5fd;
	/* Slightly tighter horizontal padding than the other chips per design
	   feedback — the date string is the longest, so trimming a few px keeps
	   the chip from feeling oversized next to its siblings. */
	padding: 10px 14px;
}
.jp-chip--next::before { content: '📅'; }

/* ---------- Per-game themes ---------- */

.jp-draw--powerball       { --jp-accent: #dc2626; --jp-accent-2: #991b1b; }
.jp-draw--mega-millions   { --jp-accent: #1e40af; --jp-accent-2: #f59e0b; }
.jp-draw--lotto-america   { --jp-accent: #7c3aed; --jp-accent-2: #4c1d95; }
.jp-draw--tn-cash         { --jp-accent: #ea580c; --jp-accent-2: #9a3412; }
.jp-draw--tn-jackpot      { --jp-accent: #059669; --jp-accent-2: #064e3b; }
.jp-draw--cash3           { --jp-accent: #0d9488; --jp-accent-2: #134e4a; }
.jp-draw--cash4           { --jp-accent: #0ea5e9; --jp-accent-2: #075985; }
.jp-draw--mfl             { --jp-accent: #db2777; --jp-accent-2: #9d174d; }
.jp-draw--pick3           { --jp-accent: #14b8a6; --jp-accent-2: #0f766e; }
.jp-draw--pick4           { --jp-accent: #0284c7; --jp-accent-2: #075985; }
.jp-draw--pick5           { --jp-accent: #6366f1; --jp-accent-2: #3730a3; }
.jp-draw--lucky-for-life  { --jp-accent: #16a34a; --jp-accent-2: #14532d; }
.jp-draw--fantasy-5       { --jp-accent: #8b5cf6; --jp-accent-2: #5b21b6; }
.jp-draw--generic         { --jp-accent: #4f46e5; --jp-accent-2: #7c3aed; }

/* Subtle cycling for any unmatched games using :where() to keep specificity at 0
   so that any explicit .jp-draw--X class will still win. */
:where(.jp-draw):nth-of-type(6n + 1) { --jp-accent: #4f46e5; --jp-accent-2: #7c3aed; }
:where(.jp-draw):nth-of-type(6n + 2) { --jp-accent: #0ea5e9; --jp-accent-2: #2563eb; }
:where(.jp-draw):nth-of-type(6n + 3) { --jp-accent: #059669; --jp-accent-2: #065f46; }
:where(.jp-draw):nth-of-type(6n + 4) { --jp-accent: #db2777; --jp-accent-2: #9d174d; }
:where(.jp-draw):nth-of-type(6n + 5) { --jp-accent: #ea580c; --jp-accent-2: #9a3412; }
:where(.jp-draw):nth-of-type(6n + 6) { --jp-accent: #7c3aed; --jp-accent-2: #4c1d95; }

/* ---------- Responsive tuning ---------- */

@media (max-width: 640px) {
	.jp-hero {
		padding: 28px 22px 30px;
		border-radius: 16px;
	}
	.jp-hero__title { font-size: 24px; }
	.jp-hero__lede { font-size: 15px; }

	.jp-draw { border-radius: 16px; }
	.jp-draw__header {
		padding: 14px 18px 14px 22px;
	}
	.jp-draw__name { font-size: 17px; }
	.jp-draw__date { font-size: 10px; padding: 4px 9px; }
	.jp-balls { padding: 38px 18px 18px 22px; gap: 8px; }
	.jp-draw > .jp-balls::before { top: 14px; left: 22px; font-size: 9px; }
	.jp-ball {
		width: 46px;
		height: 46px;
		font-size: 17px;
	}
	.jp-ball__tag { font-size: 9px; top: -16px; }
	.jp-ball--bonus { margin-left: 20px; }
	.jp-ball--bonus::after { left: -12px; }
	.jp-draw__meta { padding: 0 18px 18px 22px; }
}

/* ---------- Reset inherited list/margin from theme ---------- */

.entry-content .jp-balls,
.entry-content .jp-draw__meta {
	list-style: none;
	padding-left: 30px;
}

.entry-content .jp-hero + .jp-draw {
	margin-top: 0;
}

.entry-content .jp-hero__title,
.entry-content .jp-draw__name {
	margin: 0;
}
