/* DhammaCaKraTra events — styles for the events page, the home strip and the popup.
   Colours fall back to the theme's --pp-* tokens when it defines them. */

.dct-ev {
	--dct-ink: var(--pp-ink, #16171a);
	--dct-body: var(--pp-body, #5e5f63);
	--dct-muted: var(--pp-muted, #8a8277);
	--dct-line: var(--pp-line, #e8dcc2);
	--dct-paper: var(--pp-paper, #fffdf8);
	--dct-burgundy: var(--pp-burgundy, #420201);
	--dct-gold: var(--pp-gold, #fcc204);
	--dct-amber: #b8860b;
	container-type: inline-size;
	color: var(--dct-ink);
	font-family: var(--pp-font, "Rubik", system-ui, -apple-system, sans-serif);
}

.dct-ev *,
.dct-ev *::before,
.dct-ev *::after { box-sizing: border-box; }

.dct-ev h2,
.dct-ev h3,
.dct-ev p { margin: 0; }

.dct-ev button { font: inherit; }

/* ---------- pieces ---------- */

.dct-ev-kicker {
	margin: 0 0 6px;
	font-size: .68rem;
	font-weight: 700;
	letter-spacing: .13em;
	text-transform: uppercase;
	color: var(--dct-amber);
}

.dct-ev-name {
	all: unset;
	cursor: pointer;
	color: inherit;
	font: inherit;
}

.dct-ev-name:focus-visible {
	outline: 3px solid var(--dct-gold);
	outline-offset: 3px;
	border-radius: 6px;
}

.dct-ev-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border-radius: 999px;
	padding: 10px 18px;
	font-size: .8rem;
	font-weight: 600;
	text-decoration: none;
	border: 1px solid transparent;
	cursor: pointer;
	transition: transform .15s ease;
}

.dct-ev-btn:hover { transform: translateY(-1px); }

.dct-ev-btn--gold {
	background: var(--dct-gold);
	color: var(--dct-burgundy);
	box-shadow: 0 6px 16px rgba(252, 194, 4, .35);
}

.dct-ev-btn--line {
	background: transparent;
	color: var(--dct-burgundy);
	border-color: var(--dct-line);
}

.dct-ev-btn--ghost {
	background: var(--dct-paper);
	color: var(--dct-muted);
	border-color: var(--dct-line);
	font-weight: 500;
	font-size: .72rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 100%;
}

.dct-ev-btn--sm { padding: 8px 14px; font-size: .74rem; }

.dct-ev-link {
	font-size: .76rem;
	font-weight: 600;
	color: var(--dct-burgundy);
	text-decoration: none;
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
}

.dct-ev-date {
	display: grid;
	place-items: center;
	gap: 1px;
	width: 56px;
	padding: 8px 0 9px;
	border-radius: 12px;
	background: var(--dct-paper);
	border: 1px solid var(--dct-line);
	box-shadow: 0 6px 18px rgba(66, 2, 1, .10);
	text-align: center;
	flex: none;
}

.dct-ev-date span {
	font-size: .58rem;
	font-weight: 700;
	letter-spacing: .14em;
	color: var(--dct-amber);
}

.dct-ev-date b {
	font-family: Georgia, "Times New Roman", serif;
	font-size: 1.4rem;
	line-height: 1;
	color: var(--dct-burgundy);
}

.dct-ev-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
	font-size: .78rem;
	color: var(--dct-muted);
}

.dct-ev-placeholder {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	background: #f6e9cd;
	color: #c2a06a;
}

.dct-ev-placeholder svg { width: 34%; height: 34%; max-width: 42px; }

/* ---------- subscribe panel ---------- */

.dct-ev-sub {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 18px 24px;
	background: linear-gradient(135deg, #fffdf8, #fff4d2);
	border: 1px solid #f0dda6;
	border-radius: 18px;
	padding: 22px 24px;
	margin: 0 0 34px;
	box-shadow: 0 10px 28px rgba(66, 2, 1, .08);
}

.dct-ev-sub__text { flex: 1 1 300px; min-width: 0; }

.dct-ev-sub h3 {
	font-family: Georgia, "Times New Roman", serif;
	font-size: 1.25rem;
	line-height: 1.2;
	color: var(--dct-burgundy);
	margin: 0 0 6px;
}

.dct-ev-sub p {
	font-size: .84rem;
	line-height: 1.55;
	color: var(--dct-body);
	max-width: 52ch;
}

.dct-ev-sub__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: flex-end;
	flex: 0 1 auto;
	max-width: 100%;
}

.dct-ev-sub__actions .dct-ev-btn--ghost { max-width: 280px; }

/* ---------- featured next event ---------- */

.dct-ev-feature {
	background: var(--dct-paper);
	border: 1px solid var(--dct-line);
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 22px 60px rgba(66, 2, 1, .10);
	margin: 0 0 34px;
}

.dct-ev-feature__img {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #f6e9cd;
}

.dct-ev-feature__photo,
.dct-ev-row__photo,
.dct-ev-card__photo {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	margin: 0;
	border-radius: 0;
}

.dct-ev-feature__img .dct-ev-date {
	position: absolute;
	left: 16px;
	top: 16px;
}

.dct-ev-feature__body {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 24px 26px 26px;
}

.dct-ev-feature__title {
	font-family: Georgia, "Times New Roman", serif;
	font-size: clamp(1.5rem, 2.6vw, 2rem);
	line-height: 1.15;
	color: var(--dct-burgundy);
}

.dct-ev-desc,
.dct-ev-row__desc,
.dct-ev-card__desc {
	font-size: .86rem;
	line-height: 1.65;
	color: var(--dct-body);
}

.dct-ev-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 4px;
}

/* ---------- list rows ---------- */

.dct-ev-rows { display: grid; gap: 12px; }

.dct-ev-row {
	display: grid;
	grid-template-columns: 56px 132px minmax(0, 1fr) auto;
	gap: 16px;
	align-items: center;
	background: var(--dct-paper);
	border: 1px solid var(--dct-line);
	border-radius: 16px;
	padding: 14px 16px;
	box-shadow: 0 10px 28px rgba(66, 2, 1, .06);
}

.dct-ev-row__thumb {
	width: 132px;
	height: 84px;
	overflow: hidden;
	border-radius: 10px;
	background: #f6e9cd;
}

.dct-ev-row__body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }

.dct-ev-row__title {
	font-size: 1.02rem;
	line-height: 1.3;
	color: var(--dct-burgundy);
	font-weight: 600;
}

.dct-ev-row__desc {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.dct-ev-row__actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-items: stretch;
}

.dct-ev-empty {
	padding: 18px 20px;
	border-left: 3px solid var(--dct-gold);
	background: #fffbee;
	color: var(--dct-body);
	border-radius: 8px;
}

/* ---------- home strip ---------- */

.dct-ev--home { margin-top: 0; }

.dct-ev-home__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 26px;
	margin: 0 0 30px;
}

.dct-ev-card {
	display: flex;
	flex-direction: column;
	background: var(--dct-paper);
	border: 1px solid var(--dct-line);
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 10px 28px rgba(66, 2, 1, .08);
	transition: transform .25s ease, box-shadow .25s ease;
}

.dct-ev-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 22px 60px rgba(66, 2, 1, .10);
}

.dct-ev-card__img {
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: #f6e9cd;
}

.dct-ev-card__img .dct-ev-date {
	position: absolute;
	left: 16px;
	top: 16px;
}

.dct-ev-card__body {
	display: flex;
	flex-direction: column;
	gap: 7px;
	padding: 20px 22px 18px;
	flex: 1;
}

.dct-ev-card h3 {
	font-family: Georgia, "Times New Roman", serif;
	font-size: 1.25rem;
	line-height: 1.22;
	color: var(--dct-burgundy);
}

.dct-ev-card h3 a { color: inherit; text-decoration: none; }

.dct-ev-when {
	font-size: .78rem;
	color: var(--dct-muted);
}

.dct-ev-card__desc {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.dct-ev-card__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: auto;
	padding-top: 14px;
	border-top: 1px solid var(--dct-line);
}

.dct-ev-home__all { text-align: center; }

.dct-ev-home__all a {
	font-size: .8rem;
	font-weight: 600;
	color: var(--dct-burgundy);
	text-decoration: none;
}

/* ---------- popup ---------- */

.dct-ev-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.dct-ev-modal[hidden] { display: none; }

.dct-ev-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, .62);
	backdrop-filter: blur(3px);
}

.dct-ev-modal__dialog {
	position: relative;
	width: min(760px, 100%);
	max-height: calc(100vh - 48px);
	max-height: calc(100dvh - 48px);
	overflow-y: auto;
	background: var(--dct-paper);
	border-radius: 18px;
	box-shadow: 0 30px 80px rgba(0, 0, 0, .3);
	color: var(--dct-ink);
	font-family: var(--pp-font, "Rubik", system-ui, sans-serif);
}

.dct-ev-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 3;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .94);
	color: #111827;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .16);
	cursor: pointer;
	font-size: 20px;
	line-height: 1;
}

.dct-ev-modal__media {
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #f6e9cd;
}

.dct-ev-modal__media img { width: 100%; height: 100%; object-fit: cover; display: block; margin: 0; }
.dct-ev-modal__media .dct-ev-placeholder { padding: 0; }

.dct-ev-modal__body { padding: 26px 30px 30px; display: flex; flex-direction: column; gap: 10px; }

.dct-ev-modal__title {
	font-family: Georgia, "Times New Roman", serif;
	font-size: 1.6rem;
	line-height: 1.15;
	color: var(--dct-burgundy);
	margin: 0;
}

.dct-ev-modal__desc { font-size: .9rem; line-height: 1.7; color: var(--dct-body); }
.dct-ev-modal__desc p { margin: 0 0 .9em; }
.dct-ev-modal__desc p:last-child { margin-bottom: 0; }

@container (max-width: 900px) {
	.dct-ev-sub { flex-direction: column; align-items: flex-start; }
	.dct-ev-sub__text { flex: 0 1 auto; }
	.dct-ev-sub__actions { justify-content: flex-start; }
	.dct-ev-sub__actions .dct-ev-btn--ghost { max-width: 100%; }
}

@container (max-width: 640px) {
	.dct-ev-row { grid-template-columns: 56px minmax(0, 1fr); }
	.dct-ev-row__thumb { grid-column: 1 / -1; width: 100%; height: 160px; }
	.dct-ev-row__actions { grid-column: 1 / -1; flex-direction: row; }
	.dct-ev-home__grid { grid-template-columns: 1fr; gap: 18px; }
}

@container (max-width: 560px) {
	.dct-ev-feature__body { padding: 20px 18px 22px; }
	.dct-ev-home__grid { gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
	.dct-ev-btn,
	.dct-ev-card { transition: none !important; }
	.dct-ev-card:hover { transform: none; }
}
