/**
 * Lịch sự kiện – default styles (overridable via the element's Bricks controls).
 * Colors use the Bricks palette variables (--gp-*).
 */

.gp-cal {
	display: grid;
	width: 100%; /* Bricks containers align children to flex-start: don't shrink to content */
	grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
	align-items: start;
	gap: 32px;
}

.gp-cal__card {
	padding: 32px;
	border: 1px solid color-mix(in srgb, var(--gp-gold) 45%, transparent);
	background-color: var(--gp-card);
}

/* Prev | month title (centered) | "Hôm nay" + next */
.gp-cal__head {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 8px;
	margin-bottom: 20px;
}

.gp-cal__head-end {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
}

.gp-cal__title {
	text-align: center;
}

.gp-cal__today {
	height: 36px;
	padding: 0 12px;
	border: 1px solid var(--gp-gold-40);
	background-color: var(--gp-background);
	color: var(--gp-foreground);
	font: inherit;
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .1), 0 1px 2px -1px rgba(0, 0, 0, .1);
	cursor: pointer;
	transition: background-color .15s, color .15s, opacity .15s;
}

.gp-cal__today:hover:not(:disabled) {
	background-color: var(--gp-gold);
	color: var(--gp-accent-foreground);
}

.gp-cal__today:disabled {
	opacity: .45;
	box-shadow: none;
	cursor: default;
}

.gp-cal__nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 1px solid var(--gp-gold-40);
	background-color: var(--gp-background);
	color: var(--gp-foreground);
	box-shadow: 0 1px 3px rgba(0, 0, 0, .1), 0 1px 2px -1px rgba(0, 0, 0, .1);
	cursor: pointer;
	transition: background-color .15s, color .15s;
}

.gp-cal__nav:hover {
	background-color: var(--gp-gold);
	color: var(--gp-accent-foreground);
}

.gp-cal__nav svg {
	width: 16px;
	height: 16px;
}

.gp-cal__title {
	font-size: 20px;
	font-weight: 600;
	line-height: 28px;
}

.gp-cal__weekdays,
.gp-cal__days {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	text-align: center;
}

.gp-cal__weekdays span {
	padding: 12px 0;
	font-size: 12px;
	font-weight: 500;
	line-height: 16px;
	color: var(--gp-muted-foreground);
}

.gp-cal__days {
	row-gap: 16px;
}

.gp-cal__day {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	width: 100%;
	max-width: 64px;
	height: 64px;
	margin: 0 auto;
	padding: 8px 0;
	border: 1px solid transparent;
	border-radius: 0;
	background: none;
	color: var(--gp-foreground);
	font: inherit;
	cursor: pointer;
	transition: background-color .15s, color .15s;
}

.gp-cal__day:hover {
	background-color: var(--gp-gold);
	color: var(--gp-accent-foreground);
}

.gp-cal__day.is-outside {
	color: color-mix(in srgb, var(--gp-muted-foreground) 40%, transparent);
}

.gp-cal__day[aria-pressed="true"] {
	border-color: var(--gp-gold);
	background-color: var(--gp-gold-20);
	color: var(--gp-foreground);
}

.gp-cal__day[aria-pressed="true"]:hover {
	background-color: var(--gp-gold-30);
}

.gp-cal__solar {
	font-size: 16px;
	font-weight: 500;
	line-height: 24px;
}

/* Today: light dashed frame + soft tint + red number (selected state still wins for border/background) */
.gp-cal__day.is-today {
	border: 1px dashed var(--gp-gold-60);
	background-color: color-mix(in srgb, var(--gp-gold) 8%, transparent);
}

.gp-cal__day.is-today .gp-cal__solar {
	font-weight: 700;
	color: var(--gp-primary);
}

.gp-cal__day.is-today:hover .gp-cal__solar {
	color: inherit;
}

.gp-cal__day.is-today:hover {
	background-color: var(--gp-gold);
}

.gp-cal__day.is-today[aria-pressed="true"] {
	border-style: solid;
	border-color: var(--gp-gold);
	background-color: var(--gp-gold-20);
}

.gp-cal__day.is-today[aria-pressed="true"]:hover {
	background-color: var(--gp-gold-30);
}

.gp-cal__lunar {
	font-size: 9px;
	line-height: 1.43;
	opacity: .65;
}

.gp-cal__dot {
	width: 4px;
	height: 4px;
	flex: none;
	border-radius: 9999px;
	background-color: var(--gp-primary);
}

.gp-cal__dots {
	position: absolute;
	top: 6px;
	right: 6px;
	display: flex;
	gap: 2px;
}

.gp-cal__legend {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 24px;
	padding-top: 16px;
	border-top: 1px solid color-mix(in srgb, var(--gp-gold) 25%, transparent);
	font-size: 12px;
	line-height: 16px;
	color: var(--gp-muted-foreground);
}

/* Selected day panel */

.gp-cal__panel {
	min-height: 256px;
	padding: 32px;
	border: 1px solid color-mix(in srgb, var(--gp-gold) 45%, transparent);
	background-color: var(--gp-parchment);
}

.gp-cal__label {
	font-size: 10px;
	font-weight: 600;
	line-height: 1.5;
	text-transform: uppercase;
	color: var(--gp-primary);
}

.gp-cal__date {
	margin-top: 8px;
	font-size: 12px;
	line-height: 16px;
	color: var(--gp-muted-foreground);
}

.gp-cal__empty {
	margin-top: 20px;
	font-size: 14px;
	line-height: 20px;
	color: var(--gp-muted-foreground);
}

.gp-cal__event {
	margin-top: 20px;
}

.gp-cal__date strong {
	font-weight: 600;
	color: var(--gp-primary);
}

/* Several events on one day: compact list */

.gp-cal__events {
	margin: 0;
	padding: 0;
	list-style: none;
}

.gp-cal__event.is-compact {
	padding-top: 16px;
}

.gp-cal__event.is-compact:first-child {
	margin-top: 16px;
}

.gp-cal__event.is-compact + .gp-cal__event.is-compact {
	margin-top: 16px;
	border-top: 1px solid color-mix(in srgb, var(--gp-gold) 25%, transparent);
}

.gp-cal__time {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 4px;
	font-size: 12px;
	font-weight: 600;
	line-height: 16px;
	color: var(--gp-primary);
}

.gp-cal__time svg {
	width: 14px;
	height: 14px;
}

.gp-cal__event.is-compact .gp-cal__event-title {
	font-size: 18px;
}

.gp-cal__event.is-compact .gp-cal__meta {
	margin-top: 8px;
}

.gp-cal__event.is-compact .gp-cal__excerpt {
	margin-top: 8px;
}

.gp-cal__event-title {
	font-size: 20px;
	font-weight: 600;
	line-height: 1.375;
}

.gp-cal__event-title a:hover {
	text-decoration: underline;
	text-underline-offset: 4px;
}

.gp-cal__meta {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 20px;
	font-size: 14px;
	line-height: 20px;
	color: var(--gp-muted-foreground);
}

.gp-cal__meta-row {
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

.gp-cal__meta-row.is-center {
	align-items: center;
}

.gp-cal__meta-row svg {
	width: 16px;
	height: 16px;
	flex: none;
	margin-top: 2px;
	color: var(--gp-primary);
}

.gp-cal__meta-row.is-center svg {
	margin-top: 0;
}

.gp-cal__meta-sub {
	margin-top: 4px;
	font-size: 12px;
	line-height: 16px;
}

.gp-cal__excerpt {
	margin-top: 24px;
	font-size: 14px;
	line-height: 1.625;
	color: var(--gp-muted-foreground);
}

/* Breakpoints match Bricks: tablet ≤ 1023px, mobile ≤ 639px */

@media (max-width: 1023px) {
	.gp-cal {
		grid-template-columns: 1fr;
		gap: 24px;
	}

	.gp-cal__card {
		padding: 24px;
	}

	.gp-cal__panel {
		padding: 24px;
	}
}

@media (max-width: 639px) {
	.gp-cal__card {
		padding: 12px;
	}

	.gp-cal__title {
		font-size: 18px;
	}

	/* Not enough room to keep the title exactly centered */
	.gp-cal__head {
		grid-template-columns: auto 1fr auto;
	}

	.gp-cal__days {
		row-gap: 8px;
	}

	.gp-cal__day {
		height: 56px;
	}
}
