/**
 * Organisational Event — front-end styles (cards, single, archive).
 * AISG brand: navy #0B1F3A, coral #E8352A. Scoped under `oe-` classes.
 *
 * @package AISG\OrgEvent
 */

.oe-events,
.oe-single-event,
.oe-archive {
	--oe-navy: #0b1f3a;
	--oe-coral: #ae2514;        /* AI Singapore red */
	--oe-coral-text: #ae2514;   /* AA-safe red for text on light surfaces */
	--oe-coral-strong: #ae2514; /* red behind white text (badges/buttons) */
	--oe-ink: #1a2a44;
	--oe-muted: #5a6a82;
	--oe-line: #d7dce3;
	--oe-surface: #ffffff;
	--oe-subtle: #f4f6f9;
	--oe-radius: 12px;
	--oe-radius-sm: 8px;
	--oe-shadow: 0 1px 2px rgba(11, 31, 58, 0.08), 0 8px 24px rgba(11, 31, 58, 0.06);
}

/* ---------------------------------------------------------------- */
/* Card grid                                                        */
/* ---------------------------------------------------------------- */

.oe-events {
	list-style: none;
	margin: 1.5rem 0;
	padding: 0;
	display: grid;
	gap: 1.25rem;
	grid-template-columns: repeat(1, minmax(0, 1fr));
}

.oe-events--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.oe-events--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.oe-events--cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 960px) {
	.oe-events--cols-3,
	.oe-events--cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
	.oe-events { grid-template-columns: 1fr; }
}

.oe-events--empty {
	display: block;
	color: var(--oe-muted);
}

.oe-event-card {
	list-style: none;
	background: var(--oe-surface);
	border: 1px solid var(--oe-line);
	border-radius: var(--oe-radius);
	overflow: hidden;
	box-shadow: var(--oe-shadow);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.oe-event-card:hover,
.oe-event-card:focus-within {
	transform: translateY(-3px);
	box-shadow: 0 4px 8px rgba(11, 31, 58, 0.12), 0 16px 40px rgba(11, 31, 58, 0.1);
}

.oe-event-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
	color: inherit;
}

.oe-event-card__link:focus-visible {
	outline: 3px solid var(--oe-coral);
	outline-offset: 2px;
}

.oe-event-card__media {
	position: relative;
	aspect-ratio: 16 / 9;
	background: var(--oe-subtle);
	overflow: hidden;
}

/* Absolutely fill the 16:9 box so the image is always cropped to ratio,
   regardless of the source image's intrinsic dimensions (portrait sources
   otherwise fall back to their natural height via the height:100% + aspect-ratio
   circular-sizing case). */
.oe-event-card__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.oe-event-card__img--placeholder {
	background: linear-gradient(135deg, var(--oe-navy), #16335c);
}

.oe-badge {
	display: inline-block;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	line-height: 1;
	padding: 0.4em 0.7em;
	border-radius: 999px;
}

.oe-badge--type {
	position: absolute;
	top: 0.75rem;
	left: 0.75rem;
	background: var(--oe-coral-strong);
	color: #fff;
}

.oe-event-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	padding: 1rem 1.1rem 1.2rem;
	flex: 1 1 auto;
}

.oe-event-card__cat {
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--oe-coral-text);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.oe-event-card__title {
	margin: 0;
	font-size: 1.15rem;
	line-height: 1.3;
	color: var(--oe-ink);
}

.oe-event-card__meta {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	margin: 0;
	font-size: 0.9rem;
	color: var(--oe-muted);
}

.oe-event-card__cta {
	margin-top: auto;
	padding-top: 0.6rem;
	font-weight: 700;
	color: var(--oe-navy);
	display: inline-flex;
	gap: 0.35rem;
	align-items: center;
}

.oe-icon { font-size: 0.95em; line-height: 1; }

/* ---------------------------------------------------------------- */
/* Archive filters                                                  */
/* ---------------------------------------------------------------- */

.oe-archive__header { margin-bottom: 1rem; }

.oe-archive__filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
	padding: 0.85rem 1rem;
	background: var(--oe-subtle);
	border: 1px solid var(--oe-line);
	border-radius: var(--oe-radius);
	margin-bottom: 1.25rem;
}

.oe-segmented {
	display: inline-flex;
	border: 1px solid var(--oe-line);
	border-radius: 999px;
	overflow: hidden;
	background: var(--oe-surface);
}

.oe-seg-btn {
	appearance: none;
	border: 0;
	background: transparent;
	color: var(--oe-ink);
	font-weight: 600;
	font-size: 0.88rem;
	padding: 0.5rem 1rem;
	cursor: pointer;
	text-decoration: none;
	line-height: 1.4;
}

.oe-seg-btn.is-active,
.oe-seg-btn[aria-current="true"] {
	background: var(--oe-navy);
	color: #fff;
}

.oe-seg-btn:focus-visible {
	outline: 3px solid var(--oe-coral);
	outline-offset: -3px;
}

.oe-filter select {
	padding: 0.45rem 0.6rem;
	border: 1px solid var(--oe-line);
	border-radius: var(--oe-radius-sm);
	background: var(--oe-surface);
	color: var(--oe-ink);
	font-size: 0.9rem;
}

/* Filter submit button (always visible; keyboard/AT-friendly). */
.oe-archive__filters .oe-btn--filter {
	padding: 0.5rem 1.1rem;
	font-size: 0.9rem;
}

/* ---------------------------------------------------------------- */
/* Single event                                                     */
/* ---------------------------------------------------------------- */

.oe-single-event { color: var(--oe-ink); }

.oe-event__hero {
	position: relative;
	border-radius: var(--oe-radius);
	overflow: hidden;
	margin-bottom: 1.75rem;
	background: var(--oe-navy);
	color: #fff;
}

.oe-event__hero-media { line-height: 0; }

.oe-event__hero-img {
	width: 100%;
	max-height: 420px;
	object-fit: cover;
	opacity: 0.55;
}

.oe-event__hero.has-image .oe-event__hero-inner {
	position: absolute;
	inset: auto 0 0 0;
	background: linear-gradient(0deg, rgba(11, 31, 58, 0.92), rgba(11, 31, 58, 0));
}

.oe-event__hero-inner { padding: 1.75rem clamp(1rem, 4vw, 2.5rem); }

.oe-event__title {
	margin: 0.5rem 0 0.75rem;
	font-size: clamp(1.7rem, 4vw, 2.6rem);
	line-height: 1.15;
	color: #fff;
}

.oe-event__hero .oe-badge--type {
	position: static;
	display: inline-block;
}

.oe-event__when {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	font-size: 1.05rem;
	font-weight: 600;
	margin: 0 0 0.5rem;
	color: #fff;
}

.oe-event__tz {
	font-size: 0.8rem;
	font-weight: 500;
	opacity: 0.8;
	padding: 0.15em 0.5em;
	border: 1px solid rgba(255, 255, 255, 0.4);
	border-radius: 999px;
}

.oe-event__actions { margin: 0.75rem 0 0; }

.oe-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	font-weight: 700;
	font-size: 0.92rem;
	padding: 0.6rem 1.1rem;
	border-radius: 999px;
	border: 2px solid var(--oe-coral-strong);
	background: var(--oe-coral-strong);
	color: #fff;
	text-decoration: none;
	cursor: pointer;
}

.oe-btn--ghost {
	background: transparent;
	color: #fff;
	border-color: rgba(255, 255, 255, 0.7);
}

.oe-btn:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

.oe-event__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 2rem;
	align-items: start;
}

@media (max-width: 820px) {
	.oe-event__layout { grid-template-columns: 1fr; }
}

.oe-event__content { font-size: 1.02rem; line-height: 1.7; }

.oe-event__tags {
	margin-top: 1.5rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.oe-tag {
	font-size: 0.82rem;
	color: var(--oe-navy);
	background: var(--oe-subtle);
	border: 1px solid var(--oe-line);
	padding: 0.25em 0.7em;
	border-radius: 999px;
	text-decoration: none;
}

.oe-event__panel {
	background: var(--oe-surface);
	border: 1px solid var(--oe-line);
	border-radius: var(--oe-radius);
	padding: 1.25rem 1.35rem;
	box-shadow: var(--oe-shadow);
	position: sticky;
	top: 2rem;
}

.oe-event__panel-title {
	margin: 0 0 0.75rem;
	font-size: 1.05rem;
	color: var(--oe-navy);
	border-bottom: 3px solid var(--oe-coral);
	padding-bottom: 0.5rem;
	display: inline-block;
}

.oe-event__details { margin: 0; }
.oe-event__details dt {
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--oe-muted);
	margin-top: 0.9rem;
}
.oe-event__details dt:first-child { margin-top: 0; }
.oe-event__details dd {
	margin: 0.2rem 0 0;
	font-size: 0.98rem;
	color: var(--oe-ink);
}

.oe-muted { color: var(--oe-muted); font-size: 0.85rem; }

.oe-link { color: var(--oe-coral-text); font-weight: 600; }

.oe-pill {
	display: inline-block;
	font-size: 0.85rem;
	font-weight: 700;
	padding: 0.25em 0.75em;
	border-radius: 999px;
}
.oe-pill--open { background: rgba(0, 115, 62, 0.12); color: #00733e; }
.oe-pill--full,
.oe-pill--closed { background: rgba(198, 43, 33, 0.1); color: var(--oe-coral-text); }

.oe-event__register { margin-top: 2rem; }

.oe-block-notice {
	padding: 1rem 1.25rem;
	border: 1px dashed var(--oe-line);
	border-radius: var(--oe-radius);
	color: var(--oe-muted);
	background: var(--oe-subtle);
}

/* Archive: follow the theme's content width (plugin renders its own full-width template). */
.oe-archive {
	max-width: var(--global-content-width, 1140px);
	margin-left: auto;
	margin-right: auto;
	padding-left: 1.25rem;
	padding-right: 1.25rem;
	box-sizing: border-box;
}

/* Pagination for [oe_events paginate="true"] (sits outside .oe-events var scope,
   so uses literal AI Singapore colours). */
.oe-pagination { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; margin: 1.75rem 0 0.5rem; }
.oe-pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 2.4rem; height: 2.4rem; padding: 0 0.7rem;
	border: 1px solid #d7dce3; border-radius: 8px;
	color: #0b1f3a; background: #fff; text-decoration: none; font-weight: 700; font-size: 0.9rem; line-height: 1;
}
.oe-pagination .page-numbers:hover { background: #f4f6f9; }
.oe-pagination .page-numbers.current { background: #0b1f3a; color: #fff; border-color: #0b1f3a; }
.oe-pagination .page-numbers.dots { border: 0; background: transparent; }
