/*
 * events.css — cards for /events/ (inside the Foxiz/Pixwell theme's own
 * content area — cryptogames.css is NEVER enqueued there, see the header on
 * EventsList::eventsList()) and for the event single takeover (which DOES
 * load cryptogames.css; these rules only ADD the hero/facts pieces that file
 * does not already have — see single-calendar.php).
 *
 * Built the way assets/css/modules.css is: our own custom properties with a
 * DARK LITERAL fallback, so the section reads correctly with or without the
 * theme defining anything — two sites, one plugin, never a Foxiz-only string.
 * Everything is scoped under .cg-ev-* / .cg-events-filters so a bare class
 * name here cannot collide with either theme.
 */

.cg-events-filters,
.cg-ev-grid,
.cg-ev-card,
.cg-ev-section-heading {
	--cg-ev-bg: var(--cg-card-bg, var(--color-surface-container-low, #1c1b1c));
	--cg-ev-ink: var(--cg-text, var(--color-on-surface, #e5e2e3));
	--cg-ev-muted: var(--cg-text-muted, var(--color-on-surface-variant, #b9cacb));
	--cg-ev-faint: var(--cg-text-faint, #8fa3a5);
	--cg-ev-hair: var(--cg-hairline, rgba(var(--rgb-outline-variant, 59, 73, 75), 0.3));
	--cg-ev-accent: var(--cg-accent, var(--color-primary-fixed-dim, #00dbe9));
	box-sizing: border-box;
}
.cg-ev-grid *, .cg-ev-card * { box-sizing: border-box; }

/* ---------- filter chips ---------- */

.cg-events-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 20px;
}
.cg-ev-chip {
	font-size: 12px;
	color: var(--cg-ev-muted);
	padding: 4px 12px;
	border: 1px solid var(--cg-ev-hair);
	border-radius: 999px;
	text-decoration: none;
	white-space: nowrap;
	transition: border-color .15s ease, color .15s ease;
}
.cg-ev-chip:hover { color: var(--cg-ev-ink); border-color: var(--cg-ev-accent); }
.cg-ev-chip.is-active {
	font-weight: 700;
	color: var(--cg-ev-ink);
	border-color: var(--cg-ev-accent);
}

/* ---------- section headings (Live now / Upcoming / Past) ---------- */

.cg-ev-section-heading {
	font-size: 18px;
	font-weight: 700;
	color: var(--cg-ev-ink);
	margin: 32px 0 16px;
}
.cg-ev-section-heading:first-of-type { margin-top: 0; }

/* ---------- the grid ---------- */

.cg-ev-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
	margin-bottom: 8px;
}
@media (min-width: 640px) { .cg-ev-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .cg-ev-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- the card ---------- */

.cg-ev-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: var(--cg-ev-bg);
	border: 1px solid var(--cg-ev-hair);
	border-radius: 10px;
	padding: 18px;
	transition: border-color .15s ease, transform .15s ease;
}
.cg-ev-card:hover { border-color: var(--cg-ev-accent); transform: translateY(-2px); }

.cg-ev-date {
	display: flex;
	align-items: baseline;
	gap: 8px;
}
.cg-ev-day {
	font-size: 28px;
	font-weight: 800;
	line-height: 1;
	color: var(--cg-ev-ink);
	font-family: var(--font-headline, inherit);
}
.cg-ev-monthyear, .cg-ev-year {
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--cg-ev-muted);
}
.cg-ev-daterange {
	font-size: 16px;
	font-weight: 700;
	color: var(--cg-ev-ink);
	font-family: var(--font-headline, inherit);
}

.cg-ev-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

.cg-ev-type-chip {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .06em;
	padding: 3px 9px;
	border-radius: 4px;
	background: rgba(var(--rgb-primary-fixed-dim, 0, 219, 233), 0.12);
	color: var(--cg-ev-accent);
	border: 1px solid rgba(var(--rgb-primary-fixed-dim, 0, 219, 233), 0.3);
}

.cg-ev-game {
	position: relative;
	z-index: 2; /* above the card's stretched title link, see .cg-ev-card-link */
	display: inline-flex;
	align-items: center;
	gap: 8px;
	text-decoration: none;
	color: var(--cg-ev-muted);
	font-size: 13px;
	width: fit-content;
}
.cg-ev-game:hover { color: var(--cg-ev-ink); }
.cg-ev-game-icon { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; flex: 0 0 36px; }

.cg-ev-title {
	font-family: var(--font-headline, inherit);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	margin: 0;
}
.cg-ev-card-link {
	color: var(--cg-ev-ink);
	text-decoration: none;
}
/* The stretched-link pattern: the title's own <a> covers the whole card, so
 * the card is one real, crawlable link — and .cg-ev-game above it sits on a
 * higher z-index so it stays clickable in its own right. */
.cg-ev-card-link::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
}
.cg-ev-card:hover .cg-ev-card-link { color: var(--cg-ev-accent); }

.cg-ev-excerpt {
	font-size: 13px;
	line-height: 1.5;
	color: var(--cg-ev-muted);
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.cg-ev-foot {
	font-size: 12px;
	color: var(--cg-ev-faint);
	margin-top: auto;
	padding-top: 8px;
}

/* ---------- single event: hero date block, facts grid extras, more-events cards ---------- */

.cg-ev-hero-date {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	line-height: 1;
	padding: 6px 14px;
	border: 1px solid rgba(229, 226, 227, 0.25);
	border-radius: 8px;
	background: rgba(0, 0, 0, 0.25);
}
.cg-ev-hero-date .cg-ev-day { font-size: 26px; }
.cg-ev-hero-date .cg-ev-daterange { font-size: 15px; }

.cg-ev-gcal {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
/* s325: Add to calendar + Edit event, one row under the title. */
.cg-ev-hero-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

/* s325: "Other events" + "More events for <game>" print the /events/ card. */
.cg-ev-more-heading { font-size: 20px; margin-top: 8px; margin-bottom: 16px; }
.cg-ev-grid-single { margin-bottom: 48px; }

/* ---------- single event: source link + the linked game (s324) ---------- */

.cg-ev-source { display: inline-flex; align-items: center; gap: 8px; }

.cg-ev-game-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.cg-ev-game-logo {
	width: 72px;
	height: 72px;
	flex: 0 0 72px;
	object-fit: cover;
	border-radius: 12px;
	border: 1px solid var(--cg-ev-hair, rgba(var(--rgb-outline-variant, 59, 73, 75), 0.3));
}
.cg-ev-game-kicker {
	display: block;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--cg-ev-muted, var(--color-on-surface-variant, #b9cacb));
}
.cg-ev-game-title { font-size: 22px; margin: 2px 0 8px; }
.cg-ev-game-title a { color: var(--cg-ev-ink, var(--color-on-surface, #e5e2e3)); text-decoration: none; }
.cg-ev-game-title a:hover { color: var(--cg-ev-accent, var(--color-primary-fixed-dim, #00dbe9)); }
.cg-ev-game-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cg-ev-game-chip {
	font-size: 12px;
	padding: 3px 9px;
	border-radius: 999px;
	color: var(--cg-ev-muted, var(--color-on-surface-variant, #b9cacb));
	border: 1px solid var(--cg-ev-hair, rgba(var(--rgb-outline-variant, 59, 73, 75), 0.3));
}
.cg-ev-game-desc {
	font-size: 15px;
	line-height: 1.6;
	color: var(--cg-ev-muted, var(--color-on-surface-variant, #b9cacb));
	margin: 0 0 16px;
}
.cg-ev-game-facts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
	gap: 12px;
	margin: 0 0 20px;
}
.cg-ev-game-facts dt {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--cg-ev-muted, var(--color-on-surface-variant, #b9cacb));
}
.cg-ev-game-facts dd { margin: 2px 0 0; font-size: 14px; color: var(--cg-ev-ink, var(--color-on-surface, #e5e2e3)); }
.cg-ev-game-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.cg-ev-game-actions a { display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 600px) {
	.cg-ev-game-head { align-items: flex-start; }
	.cg-ev-game-logo { width: 56px; height: 56px; flex-basis: 56px; }
}

/* the game box's images, news and socials (s324b) */
.cg-ev-game-cover { display: block; margin: -24px -24px 20px; }
.cg-ev-game-cover img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 5;
	object-fit: cover;
	border-radius: 8px 8px 0 0;
}
.cg-ev-game-shots {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 8px;
	margin: 0 0 20px;
}
.cg-ev-game-shots img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: 6px;
	border: 1px solid var(--cg-ev-hair, rgba(var(--rgb-outline-variant, 59, 73, 75), 0.3));
	transition: border-color .15s ease;
}
.cg-ev-game-shots a:hover img { border-color: var(--cg-ev-accent, var(--color-primary-fixed-dim, #00dbe9)); }
.cg-ev-game-sub {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--cg-ev-muted, var(--color-on-surface-variant, #b9cacb));
	margin: 0 0 8px;
}
.cg-ev-game-news { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 6px; }
.cg-ev-game-news a { color: var(--cg-ev-ink, var(--color-on-surface, #e5e2e3)); text-decoration: none; font-size: 14px; }
.cg-ev-game-news a:hover { color: var(--cg-ev-accent, var(--color-primary-fixed-dim, #00dbe9)); }
.cg-ev-game-news span { font-size: 12px; color: var(--cg-ev-muted, var(--color-on-surface-variant, #b9cacb)); margin-left: 6px; }
.cg-ev-game-socials { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.cg-ev-game-socials a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	padding: 5px 10px;
	border-radius: 6px;
	text-decoration: none;
	color: var(--cg-ev-muted, var(--color-on-surface-variant, #b9cacb));
	border: 1px solid var(--cg-ev-hair, rgba(var(--rgb-outline-variant, 59, 73, 75), 0.3));
}
.cg-ev-game-socials a:hover { color: var(--cg-ev-accent, var(--color-primary-fixed-dim, #00dbe9)); }
.cg-ev-game-socials .material-symbols-outlined { font-size: 16px; }
@media (max-width: 600px) {
	.cg-ev-game-shots { grid-template-columns: repeat(2, 1fr); }
}
