/**
 * Divi Event Hub — shared event card, grid/list containers, archive and
 * single fallback templates. Every value is a custom property so the Divi 5
 * modules can override them from their design settings.
 *
 * @package Divi_Event_Hub
 * @since   1.0.0
 */

.deh-grid,
.deh-list {
	--deh-gap: 28px;
	--deh-cols: 3;
	display: grid;
	gap: var(--deh-gap);
}

.deh-grid {
	grid-template-columns: repeat(var(--deh-cols), minmax(0, 1fr));
}

.deh-grid--cols-1 { --deh-cols: 1; }
.deh-grid--cols-2 { --deh-cols: 2; }
.deh-grid--cols-3 { --deh-cols: 3; }
.deh-grid--cols-4 { --deh-cols: 4; }

.deh-list {
	grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 980px) {
	.deh-grid:not(.deh-grid--module) { --deh-cols: 2; }
}

@media (max-width: 767px) {
	.deh-grid:not(.deh-grid--module) { --deh-cols: 1; }
}

/* ── Card ─────────────────────────────────────────────────────────────── */

/* Design tokens live on the containers (not the card) so a module can
   override them for every card it holds. */
.deh-grid,
.deh-list,
.deh-carousel,
.deh-single,
.deh-archive {
	--deh-card-bg: #ffffff;
	--deh-card-radius: 14px;
	--deh-card-border: 1px solid #e6e9f0;
	--deh-card-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
	--deh-card-shadow-hover: 0 12px 28px rgba(15, 23, 42, 0.10);
	--deh-card-padding: 20px;
	--deh-accent: #1d47ff;
	--deh-text: #0f172a;
	--deh-muted: #64748b;
	--deh-badge-bg: #ffffff;
	--deh-badge-color: #0f172a;
	--deh-image-ratio: 16 / 10;

}

.deh-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--deh-card-bg);
	border: var(--deh-card-border);
	border-radius: var(--deh-card-radius);
	box-shadow: var(--deh-card-shadow);
	overflow: hidden;
	transition: box-shadow .25s ease, transform .25s ease;
}

.deh-card:hover {
	box-shadow: var(--deh-card-shadow-hover);
	transform: translateY(-2px);
}

.deh-card--list {
	flex-direction: row;
}

.deh-card--list .deh-card__media {
	flex: 0 0 34%;
	max-width: 34%;
}

.deh-card--list .deh-card__image {
	height: 100%;
	min-height: 180px;
	aspect-ratio: auto;
}

@media (max-width: 640px) {
	.deh-card--list { flex-direction: column; }
	.deh-card--list .deh-card__media { flex-basis: auto; max-width: none; }
	.deh-card--list .deh-card__image { aspect-ratio: var(--deh-image-ratio); }
}

.deh-card__media {
	position: relative;
}

.deh-card__image {
	display: block;
	aspect-ratio: var(--deh-image-ratio);
	background: linear-gradient(135deg, #e7f0fe, #f3f6fb);
	overflow: hidden;
}

.deh-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .4s ease;
}

.deh-card:hover .deh-card__image img {
	transform: scale(1.04);
}

.deh-card__badge {
	position: absolute;
	top: 14px;
	left: 14px;
	min-width: 54px;
	padding: 8px 10px;
	text-align: center;
	background: var(--deh-badge-bg);
	color: var(--deh-badge-color);
	border-radius: 10px;
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
	line-height: 1.05;
}

.deh-card__badge-day {
	display: block;
	font-size: 22px;
	font-weight: 700;
}

.deh-card__badge-month {
	display: block;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--deh-accent);
}

.deh-card__status {
	position: absolute;
	top: 14px;
	right: 14px;
	padding: 4px 10px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	border-radius: 999px;
	color: #fff;
	background: #64748b;
}

.deh-card__status--cancelled { background: #dc2626; }
.deh-card__status--postponed { background: #d97706; }

.deh-card--cancelled .deh-card__title,
.deh-card--cancelled .deh-card__meta {
	opacity: .65;
}

.deh-card--past .deh-card__image img {
	filter: grayscale(.35);
}

.deh-card__body {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: var(--deh-card-padding);
	flex: 1 1 auto;
}

.deh-card__cats {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.deh-card__cat {
	--deh-cat-color: var(--deh-accent);
	display: inline-block;
	padding: 3px 10px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--deh-cat-color);
	background: color-mix(in srgb, var(--deh-cat-color) 12%, #ffffff);
	border-radius: 999px;
	text-decoration: none;
}

.deh-card__title {
	margin: 0;
	font-size: 20px;
	line-height: 1.3;
	font-weight: 700;
	color: var(--deh-text);
}

.deh-card__title a {
	color: inherit;
	text-decoration: none;
}

.deh-card__title a:hover {
	color: var(--deh-accent);
}

.deh-card__meta {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: 13.5px;
	color: var(--deh-muted);
}

.deh-card__meta-item {
	display: flex;
	align-items: center;
	gap: 8px;
}

.deh-card__meta-item .deh-icon {
	flex: 0 0 16px;
	color: var(--deh-accent);
}

.deh-card__excerpt {
	margin: 0;
	font-size: 14px;
	line-height: 1.6;
	color: var(--deh-muted);
}

.deh-card__footer {
	margin-top: auto;
	padding-top: 6px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.deh-card__cost {
	font-weight: 700;
	color: var(--deh-text);
}

.deh-card__btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 18px;
	font-size: 13.5px;
	font-weight: 600;
	color: #fff;
	background: var(--deh-accent);
	border-radius: 8px;
	text-decoration: none;
	transition: filter .2s ease;
}

.deh-card__btn:hover {
	filter: brightness(1.1);
	color: #fff;
}

/* ── Card styles, image position, detail rows (since 2.1.0) ───────────── */

/* List with the picture on the right. */
.deh-card--list.deh-card--image-right { flex-direction: row-reverse; }

/* Overlay ("cover"): the picture fills the card, the text sits on a dark wash. */
.deh-card--style-overlay {
	--deh-overlay-height: 420px;
	min-height: var(--deh-overlay-height);
	justify-content: flex-end;
	isolation: isolate;
	background: #0f172a;
}
.deh-card--list.deh-card--style-overlay { flex-direction: column; --deh-overlay-height: 300px; }
.deh-card--style-overlay .deh-card__media { position: absolute; inset: 0; z-index: 0; flex: none; max-width: none; }
.deh-card--style-overlay .deh-card__image { height: 100%; aspect-ratio: auto; min-height: 0; }
.deh-card--style-overlay .deh-card__media::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(180deg, rgba(15, 23, 42, 0) 20%, rgba(15, 23, 42, .55) 55%, rgba(15, 23, 42, .92) 100%);
	pointer-events: none;
}
.deh-card--style-overlay .deh-card__badge,
.deh-card--style-overlay .deh-card__status { z-index: 2; }
.deh-card--style-overlay .deh-card__body { position: relative; z-index: 2; flex: 0 0 auto; }
.deh-card--style-overlay .deh-card__title,
.deh-card--style-overlay .deh-card__title a,
.deh-card--style-overlay .deh-card__cost,
.deh-card--style-overlay .deh-card__meta-label { color: #ffffff; }
.deh-card--style-overlay .deh-card__meta,
.deh-card--style-overlay .deh-card__excerpt { color: rgba(255, 255, 255, .82); }
.deh-card--style-overlay .deh-card__meta-item .deh-icon { color: #ffffff; }
.deh-card--style-overlay .deh-card__cat { color: #ffffff; background: rgba(255, 255, 255, .18); }

/* Minimal: no picture, the date block leads. */
.deh-card--style-minimal .deh-card__media { position: static; padding: var(--deh-card-padding) var(--deh-card-padding) 0; }
.deh-card--style-minimal .deh-card__badge {
	position: static;
	display: inline-block;
	box-shadow: none;
	background: color-mix(in srgb, var(--deh-accent) 10%, #ffffff);
	color: var(--deh-text);
}
.deh-card--style-minimal .deh-card__status { position: static; display: inline-block; margin-left: 8px; vertical-align: top; }
.deh-card--list.deh-card--style-minimal .deh-card__media {
	flex: 0 0 auto;
	max-width: none;
	padding: var(--deh-card-padding) 0 var(--deh-card-padding) var(--deh-card-padding);
}
.deh-card--list.deh-card--style-minimal.deh-card--image-right .deh-card__media { padding: var(--deh-card-padding) var(--deh-card-padding) var(--deh-card-padding) 0; }

/* Detail rows: labels, both, none, and one-line. */
.deh-card__meta-label {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--deh-text);
	min-width: 72px;
}
.deh-card--meta-inline .deh-card__meta { flex-direction: row; flex-wrap: wrap; column-gap: 16px; row-gap: 6px; }
.deh-card--meta-inline .deh-card__meta-label { min-width: 0; }
.deh-card--meta-inline.deh-card--meta-none .deh-card__meta-item + .deh-card__meta-item::before {
	content: '·';
	margin-right: 8px;
	opacity: .6;
}

/* Month headings between cards ("Group by month"). */
.deh-listing__month {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 18px 0 -6px;
	padding: 0;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--deh-accent);
}
.deh-listing__month::after { content: ''; flex: 1 1 auto; height: 1px; background: currentColor; opacity: .2; }
.deh-listing__month:first-child { margin-top: 0; }

@media (max-width: 640px) {
	.deh-card--list.deh-card--image-right { flex-direction: column; }
	.deh-card--list.deh-card--style-minimal .deh-card__media { padding: var(--deh-card-padding) var(--deh-card-padding) 0; }
}

.deh-empty {
	grid-column: 1 / -1;
	padding: 36px;
	text-align: center;
	color: var(--deh-muted, #64748b);
	background: #f8fafc;
	border: 1px dashed #cbd5e1;
	border-radius: 12px;
}

/* ── Load more / pagination (modules) ─────────────────────────────────── */

.deh-loadmore {
	display: flex;
	justify-content: center;
	margin-top: 28px;
}

.deh-loadmore__btn {
	padding: 12px 26px;
	font-weight: 600;
	color: #fff;
	background: var(--deh-accent, #1d47ff);
	border: 0;
	border-radius: 8px;
	cursor: pointer;
}

.deh-loadmore__btn[disabled] {
	opacity: .6;
	cursor: default;
}

.deh-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: center;
	margin-top: 28px;
}

.deh-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 10px;
	border-radius: 8px;
	border: 1px solid #e6e9f0;
	color: #0f172a;
	text-decoration: none;
}

.deh-pagination .page-numbers.current {
	background: var(--deh-accent, #1d47ff);
	border-color: transparent;
	color: #fff;
}

/* ── Archive fallback ─────────────────────────────────────────────────── */

.deh-archive {
	padding: 40px 0 60px;
}

.deh-archive__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 28px;
}

.deh-archive__title {
	margin: 0;
}

.deh-archive__scope {
	display: inline-flex;
	padding: 4px;
	background: #f1f5f9;
	border-radius: 999px;
}

.deh-archive__scope-link {
	padding: 8px 18px;
	border-radius: 999px;
	font-weight: 600;
	font-size: 13.5px;
	color: #475569;
	text-decoration: none;
}

.deh-archive__scope-link.is-active {
	background: #fff;
	color: #0f172a;
	box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}

/* ── Single fallback ──────────────────────────────────────────────────── */

.deh-single {
	padding: 40px 0 60px;
}

.deh-single__hero {
	margin-bottom: 24px;
}

.deh-single__title {
	margin: 10px 0 12px;
	font-size: 40px;
	line-height: 1.15;
}

.deh-single__hero .deh-card__status {
	position: static;
	display: inline-block;
	margin-bottom: 12px;
}

.deh-single__meta {
	flex-direction: row;
	flex-wrap: wrap;
	gap: 18px;
	font-size: 15px;
}

.deh-single__image img {
	width: 100%;
	height: auto;
	border-radius: 16px;
	display: block;
}

.deh-single__layout {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
	gap: 40px;
	margin-top: 32px;
}

@media (max-width: 900px) {
	.deh-single__layout { grid-template-columns: minmax(0, 1fr); }
}

.deh-single__box {
	padding: 22px;
	background: #f8fafc;
	border: 1px solid #e6e9f0;
	border-radius: 14px;
}

.deh-single__box + .deh-single__box {
	margin-top: 18px;
}

.deh-single__box-title {
	margin: 0 0 12px;
	font-size: 16px;
}

.deh-single__dl {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 8px 16px;
	margin: 0 0 16px;
	font-size: 14px;
}

.deh-single__dl dt {
	font-weight: 600;
	color: #475569;
}

.deh-single__dl dd {
	margin: 0;
}

.deh-single__map iframe {
	width: 100%;
	height: 220px;
	border: 0;
	border-radius: 10px;
}

.deh-single__speakers {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.deh-single__speakers li {
	display: flex;
	align-items: center;
	gap: 12px;
}

.deh-single__speakers img {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	object-fit: cover;
}
