/*
 * [ub_events] and [ub_event_results]: the "Jamek & Versenyek" page and its
 * results page. Scoped to .ub-events. Headings take the site's Montserrat
 * 900 italic, body text the theme's own font. The upcoming and the day's
 * event sit on a navy band; past events are white cards grouped by year.
 */
.ub-events {
	--ub-ev-neon: #a3ff00;
	--ub-ev-navy: #0f172a;
	--ub-ev-navy-card: #1e293b;
	--ub-ev-slate: #2f3b40;
	--ub-ev-muted: #64748b;
	--ub-ev-line: #e2e8f0;
	--ub-ev-link: #2b6a12;
	--ub-ev-light-green: #edfbe2;
	--ub-ev-display: 'Montserrat', sans-serif;
	display: flex;
	flex-direction: column;
	gap: 56px;
	color: var(--ub-ev-slate);
}
.ub-events ul, .ub-events ol { list-style: none; margin: 0; padding: 0; }
.ub-events li { margin: 0; }
.ub-events p { margin: 0; }
.ub-events a:focus-visible { outline: 3px solid var(--ub-ev-neon); outline-offset: 2px; border-radius: 4px; }
/* The theme underlines every link with a rule that outranks a class; the
   buttons and the card links are overruled here, inside this shortcode only. */
.ub-events .ub-ev-button, .ub-events .ub-ev-links a, .ub-events .ub-ev-footer a, .ub-events .ub-ev-back a { text-decoration: none !important; }

.ub-ev-icon { width: 1.05em; height: 1.05em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* The display headings: the theme's h2 is large, so each size is set here. */
.ub-events .ub-ev-band-title,
.ub-events .ub-ev-past-title,
.ub-events .ub-ev-year-title,
.ub-events .ub-ev-feature-title,
.ub-events .ub-ev-results-title,
.ub-events .ub-ev-section-title,
.ub-events .ub-ev-category-title {
	margin: 0;
	font-family: var(--ub-ev-display);
	font-weight: 900;
	font-style: italic;
	text-transform: uppercase;
	letter-spacing: 0;
	line-height: 1.05;
}

.ub-ev-pill { display: inline-flex; align-items: center; min-height: 26px; padding: 2px 10px; border-radius: 999px; background: var(--ub-ev-neon); color: var(--ub-ev-navy); font-family: var(--ub-ev-display); font-weight: 800; font-size: 13px; line-height: 1; }
.ub-ev-pill--on-image, .ub-ev-pill--dark { background: var(--ub-ev-navy); color: var(--ub-ev-neon); }
.ub-ev-pill--on-image { position: absolute; left: 12px; top: 12px; }

/* --- The navy band: what comes next, or the day's event --- */
.ub-ev-band { background: var(--ub-ev-navy); color: #e2e8f0; border-radius: 16px; padding: 28px 20px; display: flex; flex-direction: column; gap: 20px; }
@media (min-width: 768px) { .ub-ev-band { padding: 40px; } }
.ub-events .ub-ev-band-title { color: var(--ub-ev-neon); font-size: clamp(2rem, 5vw, 3.25rem) !important; }

.ub-ev-featured { display: flex; flex-direction: column; gap: 20px; }
.ub-ev-feature { min-width: 0; display: flex; flex-wrap: wrap; overflow: hidden; border-radius: 12px; background: var(--ub-ev-navy-card); }
.ub-ev-feature-media { flex: 1 1 min(320px, 100%); min-width: 0; min-height: 220px; position: relative; background: #334155; }
.ub-ev-feature-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ub-ev-feature-body { flex: 1 1 min(360px, 100%); min-width: 0; display: flex; flex-direction: column; gap: 16px; padding: 24px; }
/* Two events side by side: each card is a column, image on top. */
@media (min-width: 900px) {
	.ub-ev-featured--two { flex-direction: row; }
	.ub-ev-featured--two .ub-ev-feature { flex: 1 1 0; flex-direction: column; flex-wrap: nowrap; }
	.ub-ev-featured--two .ub-ev-feature-media { flex: none; aspect-ratio: 16 / 9; min-height: 0; }
	.ub-ev-featured--two .ub-ev-feature-body { flex: 1 1 auto; }
}

.ub-ev-feature-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ub-ev-chip { display: inline-flex; align-items: center; min-height: 26px; padding: 2px 10px; border-radius: 999px; border: 1px solid #475569; color: #e2e8f0; font-size: 13px; font-weight: 600; line-height: 1; }
.ub-ev-chip--today { border-color: var(--ub-ev-neon); color: var(--ub-ev-neon); }

.ub-ev-feature-head { display: flex; gap: 16px; align-items: flex-start; }
.ub-ev-dateblock { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 64px; height: 72px; border-radius: 10px; background: var(--ub-ev-neon); color: var(--ub-ev-navy); font-family: var(--ub-ev-display); }
.ub-ev-dateblock-month { font-size: 13px; font-weight: 800; text-transform: lowercase; line-height: 1; }
.ub-ev-dateblock-day { font-size: 30px; font-weight: 900; font-style: italic; line-height: 1.05; }
.ub-events .ub-ev-feature-title { color: #fff; font-size: clamp(1.35rem, 3vw, 1.85rem) !important; margin-bottom: 8px; }

.ub-ev-meta { display: flex; align-items: center; gap: 8px; font-size: 15px; line-height: 1.4; }
.ub-ev-feature .ub-ev-meta { color: #cbd5e1; }
.ub-ev-meta + .ub-ev-meta { margin-top: 2px; }
.ub-ev-excerpt { color: #cbd5e1; line-height: 1.55; max-width: 62ch; }

.ub-ev-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: auto; }
.ub-events .ub-ev-button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 22px; border-radius: 10px; background: var(--ub-ev-neon); color: var(--ub-ev-navy); font-family: var(--ub-ev-display); font-weight: 800; font-size: 15px; line-height: 1.2; }
.ub-events .ub-ev-button:hover { background: #b8ff3d; color: var(--ub-ev-navy); }
.ub-events .ub-ev-button--quiet { background: transparent; color: #fff; border: 1px solid #475569; }
.ub-events .ub-ev-button--quiet:hover { background: transparent; color: var(--ub-ev-neon); border-color: var(--ub-ev-neon); }

/* --- The idősávs of the day --- */
.ub-ev-slots { display: flex; flex-direction: column; border-radius: 10px; overflow: hidden; border: 1px solid #334155; }
.ub-ev-slot { display: grid; grid-template-columns: 7.5em 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 14px; font-size: 15px; }
.ub-ev-slot + .ub-ev-slot { border-top: 1px solid #334155; }
.ub-ev-slot-time { font-variant-numeric: tabular-nums; font-weight: 600; color: #fff; }
.ub-ev-slot-name { color: #e2e8f0; }
.ub-ev-slot-state { font-size: 13px; font-weight: 700; color: #94a3b8; white-space: nowrap; }
.ub-ev-slot--running { background: rgba(163, 255, 0, .1); }
.ub-ev-slot--running .ub-ev-slot-state { color: var(--ub-ev-neon); }
.ub-ev-slot--running .ub-ev-slot-state::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--ub-ev-neon); vertical-align: 1px; }
.ub-ev-slot--finished .ub-ev-slot-time, .ub-ev-slot--finished .ub-ev-slot-name { opacity: .6; }
@media (max-width: 520px) {
	.ub-ev-slot { grid-template-columns: 1fr auto; }
	.ub-ev-slot-name { grid-column: 1 / -1; grid-row: 2; }
}
.ub-ev-updated { font-size: 13px; color: #94a3b8; }

/* --- Past events, grouped by year --- */
.ub-ev-past { display: flex; flex-direction: column; gap: 40px; }
.ub-events .ub-ev-past-title { color: var(--ub-ev-navy); font-size: clamp(2rem, 5vw, 3.25rem) !important; }
.ub-ev-year { display: flex; flex-direction: column; gap: 20px; }
.ub-ev-year-head { display: flex; align-items: baseline; gap: 16px; padding-bottom: 8px; border-bottom: 3px solid var(--ub-ev-neon); }
.ub-events .ub-ev-year-title { color: var(--ub-ev-navy); font-size: 40px !important; }
.ub-ev-year-count { color: var(--ub-ev-muted); font-size: 15px; }

.ub-ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 20px; }
.ub-ev-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--ub-ev-line); border-radius: 10px; background: #fff; }
.ub-ev-card-media { position: relative; aspect-ratio: 16 / 9; background: var(--ub-ev-navy); }
.ub-ev-card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ub-ev-card-body { display: flex; flex-direction: column; gap: 8px; padding: 16px; flex: 1; }
.ub-ev-meta--card { color: var(--ub-ev-muted); font-size: 14px; }
.ub-events .ub-ev-card-title { margin: 0; font-size: 1.1rem !important; font-weight: 700; line-height: 1.3; color: var(--ub-ev-navy); letter-spacing: 0; }
.ub-ev-links { display: flex; flex-direction: column; gap: 2px; margin-top: auto !important; padding-top: 8px !important; }
.ub-events .ub-ev-links a, .ub-events .ub-ev-footer a { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; color: var(--ub-ev-link); font-weight: 600; }
.ub-events .ub-ev-links a:hover, .ub-events .ub-ev-footer a:hover { color: var(--ub-ev-navy); }

/* --- The results page --- */
.ub-ev-results { gap: 32px; }
.ub-events .ub-ev-back a { display: inline-flex; min-height: 36px; align-items: center; color: var(--ub-ev-link); font-weight: 600; }
.ub-ev-results-head { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.ub-events .ub-ev-results-title { color: var(--ub-ev-navy); font-size: clamp(1.9rem, 5vw, 3rem) !important; }
.ub-ev-results-date { color: var(--ub-ev-muted); font-size: 16px; }
.ub-ev-notice { padding: 12px 16px; border-radius: 10px; background: var(--ub-ev-light-green); border-left: 4px solid var(--ub-ev-link); line-height: 1.5; }
.ub-ev-results-section { display: flex; flex-direction: column; gap: 16px; }
.ub-events .ub-ev-section-title { color: var(--ub-ev-navy); font-size: 1.6rem !important; padding-bottom: 6px; border-bottom: 3px solid var(--ub-ev-neon); }

.ub-ev-slots--light { border-color: var(--ub-ev-line); }
.ub-ev-slots--light .ub-ev-slot + .ub-ev-slot { border-top-color: var(--ub-ev-line); }
.ub-ev-slots--light .ub-ev-slot-time { color: var(--ub-ev-navy); }
.ub-ev-slots--light .ub-ev-slot-name { color: var(--ub-ev-slate); }
.ub-ev-slots--light .ub-ev-slot-state { color: var(--ub-ev-muted); }
.ub-ev-slots--light .ub-ev-slot--running { background: var(--ub-ev-light-green); }
.ub-ev-slots--light .ub-ev-slot--running .ub-ev-slot-state { color: var(--ub-ev-link); }
.ub-ev-slots--light .ub-ev-slot--running .ub-ev-slot-state::before { background: var(--ub-ev-link); }

.ub-ev-category { display: flex; flex-direction: column; gap: 12px; }
.ub-ev-category + .ub-ev-category { margin-top: 20px; }
.ub-events .ub-ev-category-title { color: var(--ub-ev-navy); font-size: 1.35rem !important; }
.ub-events .ub-ev-bucket-title { margin: 8px 0 0; font-size: 1rem !important; font-weight: 700; color: var(--ub-ev-slate); letter-spacing: 0; }
.ub-ev-bucket-title span { margin-left: 6px; color: var(--ub-ev-muted); font-weight: 400; }

.ub-ev-table-wrap { overflow-x: auto; border: 1px solid var(--ub-ev-line); border-radius: 10px; }
.ub-events .ub-ev-table { width: 100%; margin: 0; border: 0; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.ub-events .ub-ev-table th, .ub-events .ub-ev-table td { padding: 9px 12px; border: 0; border-bottom: 1px solid var(--ub-ev-line); text-align: right; white-space: nowrap; }
.ub-events .ub-ev-table tbody tr:last-child td { border-bottom: 0; }
.ub-events .ub-ev-table th { background: #f8fafc; color: var(--ub-ev-muted); font-size: 13px; font-weight: 700; }
.ub-events .ub-ev-table abbr { text-decoration: none; border: 0; cursor: help; }
.ub-events .ub-ev-table .ub-ev-col-name { text-align: left; white-space: normal; width: 100%; }
.ub-events .ub-ev-table .ub-ev-col-rank { text-align: center; width: 3em; font-weight: 700; }
.ub-events .ub-ev-table td.ub-ev-col-points { font-weight: 700; color: var(--ub-ev-navy); }
.ub-ev-podium .ub-ev-col-rank { color: var(--ub-ev-link); }
@media (max-width: 560px) {
	.ub-events .ub-ev-table .ub-ev-col-optional { display: none; }
	.ub-events .ub-ev-table th, .ub-events .ub-ev-table td { padding: 8px; }
}

.ub-events-empty { color: var(--ub-ev-muted); line-height: 1.5; }
