/* =====================================================================
 * Calendrier Pro — deep navy + gold, matching the Milady Opéra cards:
 * dark panels, hairline gold borders, generous radius, serif gold
 * headings. Calendar left, agenda right.
 *
 * A light variant is available with [calendrier_pro theme="light"].
 * ================================================================== */

.calpro {
	--calpro-accent: #c9a227;
	/* Lifted from the near-black of 2.7: the panel now sits clearly above
	   the page, and the muted tone passes contrast against it instead of
	   reading as grey-on-blue. */
	--calpro-navy: #0a1730;
	--calpro-navy-2: #16294e;
	--calpro-glow: rgba(201, 162, 39, .22);
	--calpro-ink: #f7f5ee;
	--calpro-muted: rgba(247, 245, 238, .80);
	--calpro-line: rgba(201, 162, 39, .45);
	--calpro-line-soft: rgba(247, 245, 238, .16);
	--calpro-radius: 14px;
	max-width: 1180px;
	margin-inline: auto;
	color: var(--calpro-ink);
}

.calpro * { box-sizing: border-box; }

.calpro__title {
	margin: 0 0 30px;
	font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
	font-weight: 400;
	font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.4rem);
	line-height: 1.15;
	letter-spacing: .01em;
	text-align: center;
	color: var(--calpro-accent);
}

.calpro__inner {
	display: grid;
	grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
	gap: clamp(18px, 2.6vw, 30px);
	align-items: start;
	transition: opacity .18s ease;
}

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

.calpro.is-loading .calpro__inner { opacity: .4; pointer-events: none; }

/* Shared panel treatment: the card look from the site. */
.calpro__panel--cal,
.calpro__event {
	border: 1px solid var(--calpro-line);
	border-radius: var(--calpro-radius);
	background:
		radial-gradient(120% 100% at 20% 0%, rgba(40, 74, 130, .55), transparent 62%),
		linear-gradient(160deg, var(--calpro-navy-2), var(--calpro-navy) 70%);
	box-shadow: 0 0 34px var(--calpro-glow), 0 18px 40px rgba(0, 0, 0, .45);
}

.calpro__panel--cal {
	position: sticky;
	top: 20px;
	padding: 26px 24px 22px;
}

/* Ornament: a single gold diamond on a hairline, as on the reference. */
.calpro__orn {
	position: relative;
	margin: 14px 0 18px;
	text-align: center;
	color: var(--calpro-accent);
	font-size: .8rem;
	line-height: 1;
}

.calpro__orn::before,
.calpro__orn::after {
	content: "";
	position: absolute;
	top: 50%;
	width: 26%;
	height: 1px;
	background: linear-gradient(90deg, transparent, rgba(201, 162, 39, .5));
}

.calpro__orn::before { left: 8%; }

.calpro__orn::after {
	right: 8%;
	background: linear-gradient(270deg, transparent, rgba(201, 162, 39, .5));
}

.calpro__orn--lg { font-size: 1rem; margin: 10px 0 14px; }

.calpro__subtitle {
	margin: 0 0 28px;
	text-align: center;
	font-size: 1rem;
	color: rgba(247, 245, 238, .82);
}

/* ------------------------------------------------------------- Bar */

.calpro__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 20px;
}

.calpro__month {
	margin: 0;
	flex: 1;
	text-align: center;
	font-family: Georgia, "Iowan Old Style", serif;
	font-size: 1.24rem;
	font-weight: 400;
	letter-spacing: .02em;
	text-transform: capitalize;
	color: var(--calpro-accent);
}

.calpro__nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	flex: none;
	border-radius: 50%;
	border: 1px solid var(--calpro-line);
	background: transparent;
	color: var(--calpro-accent);
	text-decoration: none;
	font-size: 1.15rem;
	line-height: 1;
	cursor: pointer;
	transition: background .16s ease, color .16s ease;
}

.calpro__nav:hover {
	background: var(--calpro-accent);
	color: var(--calpro-navy);
}

/* ------------------------------------------------------------ Grid */

.calpro__weekdays,
.calpro__days {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 4px;
}

.calpro__weekdays { margin-bottom: 8px; }

.calpro__weekdays span {
	padding: 4px 2px;
	text-align: center;
	font-size: .64rem;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--calpro-accent);
	opacity: 1;
}

.calpro__day {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	aspect-ratio: 1;
	padding: 2px;
	border: 1px solid transparent;
	border-radius: 9px;
	background: transparent;
	font: inherit;
	color: rgba(247, 245, 238, .62);
	transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.calpro__day.is-empty { visibility: hidden; }

.calpro__num { font-size: .95rem; font-weight: 600; line-height: 1; }

/* Days that hold something are the whole point of the grid: they get a
   lifted surface, a gold hairline and full-strength type. Empty days stay
   readable but recede. */
/* Empty days are bare numbers; only days holding an event get the gold
   frame and the dot. That contrast is what makes the month readable at a
   glance — filling every cell flattened it. */
button.calpro__day {
	cursor: pointer;
	color: var(--calpro-ink);
	border-color: rgba(201, 162, 39, .75);
	background: rgba(255, 255, 255, .04);
	box-shadow: 0 0 14px rgba(201, 162, 39, .16);
}

button.calpro__day .calpro__num { color: #fff; font-weight: 700; }

button.calpro__day:hover {
	border-color: var(--calpro-accent);
	background: rgba(201, 162, 39, .22);
	box-shadow: 0 0 20px rgba(201, 162, 39, .38);
}

button.calpro__day:focus-visible {
	outline: 2px solid var(--calpro-accent);
	outline-offset: 2px;
}

.calpro__day.is-today {
	border-color: var(--calpro-ink);
}

.calpro__day.is-today .calpro__num {
	color: var(--calpro-ink);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.calpro__day.is-selected,
.calpro__day.is-selected:hover {
	background: var(--calpro-accent);
	border-color: var(--calpro-accent);
	box-shadow: 0 6px 18px rgba(201, 162, 39, .35);
}

.calpro__day.is-selected .calpro__num,
.calpro__day.is-selected:hover .calpro__num {
	color: #16294a;
	font-weight: 700;
	text-decoration: none;
}

.calpro__day.is-selected .calpro__dot { background: var(--calpro-navy); }

.calpro__dots { display: flex; gap: 3px; height: 6px; align-items: center; }

.calpro__dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--calpro-cat, var(--calpro-accent));
	box-shadow: 0 0 0 1px rgba(0, 0, 0, .25);
	flex: none;
}

.calpro__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	list-style: none;
	margin: 20px 0 0;
	padding: 15px 0 0;
	border-top: 1px solid var(--calpro-line-soft);
}

.calpro__legend li {
	display: flex;
	align-items: center;
	gap: 7px;
	margin: 0;
	font-size: .78rem;
	color: rgba(247, 245, 238, .85);
}

/* ---------------------------------------------------------- Agenda */

.calpro__agenda-head {
	margin-bottom: 18px;
}

.calpro__agenda-head .calpro__orn { margin: 8px 0 14px; }

.calpro__daytitle {
	margin: 0;
	text-align: center;
	font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem);
	font-family: Georgia, "Iowan Old Style", serif;
	font-size: 1.08rem;
	font-weight: 400;
	letter-spacing: .01em;
	text-transform: capitalize;
	color: var(--calpro-accent);
}

.calpro__reset {
	display: block;
	margin: 0 auto;
	padding: 6px 16px;
	border-radius: 999px;
	border: 1px solid var(--calpro-line);
	background: transparent;
	font: inherit;
	font-size: .74rem;
	font-weight: 600;
	color: var(--calpro-accent);
	cursor: pointer;
	transition: background .16s ease, color .16s ease;
}

.calpro__reset:hover { background: var(--calpro-accent); color: var(--calpro-navy); }

.calpro__list { display: flex; flex-direction: column; gap: 12px; }

.calpro__empty {
	margin: 0;
	padding: 34px 20px;
	text-align: center;
	color: var(--calpro-muted);
	border: 1px dashed var(--calpro-line-soft);
	border-radius: var(--calpro-radius);
}

/* Cards: uniform gold hairline, no coloured rail. */
.calpro__event {
	display: grid;
	grid-template-columns: 128px minmax(0, 1fr) auto;
	align-items: center;
	gap: 20px;
	padding: 14px 20px 14px 14px;
	transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.calpro__event:hover {
	border-color: var(--calpro-accent);
	box-shadow: 0 14px 36px rgba(0, 0, 0, .38);
	transform: translateY(-2px);
}

.calpro__thumb {
	position: relative;
	display: block;
	aspect-ratio: 16 / 10;
	border-radius: 10px;
	overflow: hidden;
	background: rgba(255, 255, 255, .05);
	border: 1px solid rgba(201, 162, 39, .55);
	box-shadow: 0 0 18px rgba(201, 162, 39, .14);
}

.calpro__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.calpro__thumb-date {
	position: absolute;
	left: 6px;
	bottom: 6px;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 4px 9px;
	border-radius: 7px;
	background: rgba(6, 12, 26, .92);
	border: 1px solid var(--calpro-accent);
	color: var(--calpro-accent);
	line-height: 1;
}

.calpro__thumb-date strong { font-size: 1.22rem; font-weight: 700; }

.calpro__thumb-date em {
	font-style: normal;
	font-size: .55rem;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	opacity: .8;
}

.calpro__body { min-width: 0; }

.calpro__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }

.calpro__status,
.calpro__cat {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 2px 11px;
	border-radius: 999px;
	font-size: .62rem;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	white-space: nowrap;
}

.calpro__status {
	color: var(--calpro-status, var(--calpro-accent));
	border: 1px solid currentColor;
}

.calpro__status::before {
	content: "";
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: currentColor;
}

/* Anything that limits access is filled, so it reads by shape as well
   as by hue. */
.calpro__status {
	color: #fff;
	background: var(--calpro-status, var(--calpro-accent));
	border-color: var(--calpro-status, var(--calpro-accent));
}

/* The category keeps its hue, but only as a dot — the rail is gone. */
.calpro__cat {
	color: rgba(247, 245, 238, .9);
	border: 1px solid var(--calpro-line-soft);
	background: rgba(255, 255, 255, .06);
}

.calpro__cat::before {
	content: "";
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--calpro-cat, var(--calpro-accent));
}

.calpro__event-title {
	margin: 0 0 9px;
	font-size: 1.35rem;
	font-family: Georgia, "Iowan Old Style", serif;
	font-size: 1.14rem;
	line-height: 1.28;
	font-weight: 400;
	letter-spacing: .01em;
}

.calpro__event-title a { color: var(--calpro-accent); text-decoration: none; }
.calpro__event-title a:hover { color: #fff; }

.calpro__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 20px;
	margin: 0;
	font-size: .88rem;
	color: rgba(247, 245, 238, .88);
	text-transform: capitalize;
}

.calpro__meta-item {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.calpro__meta-item svg {
	width: 15px;
	height: 15px;
	flex: none;
	color: var(--calpro-accent);
}

.calpro__sep { margin: 0 6px; }

.calpro__cta {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	flex: none;
	padding: 12px 26px;
	border-radius: 8px;
	border: 1px solid var(--calpro-accent);
	background: transparent;
	color: var(--calpro-accent);
	font-size: .76rem;
	font-weight: 600;
	letter-spacing: .12em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	box-shadow: 0 0 16px rgba(201, 162, 39, .18);
	transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}

.calpro__cta svg { width: 15px; height: 15px; }

.calpro__cta:hover {
	background: var(--calpro-accent);
	color: var(--calpro-navy);
	box-shadow: 0 0 26px rgba(201, 162, 39, .45);
}

/* ====================================================== Light theme */

.calpro--light {
	--calpro-navy: #ffffff;
	--calpro-navy-2: #fafafb;
	--calpro-ink: #14161a;
	--calpro-muted: #6b7280;
	--calpro-line: rgba(0, 0, 0, .12);
	--calpro-line-soft: rgba(0, 0, 0, .07);
}

.calpro--light .calpro__nav:hover,
.calpro--light .calpro__reset:hover,
.calpro--light .calpro__cta:hover,
.calpro--light .calpro__day.is-selected { color: #fff; }

.calpro--light .calpro__event-title a { color: var(--calpro-ink); }
.calpro--light .calpro__event-title a:hover { color: var(--calpro-accent); }
.calpro--light button.calpro__day { background: rgba(0, 0, 0, .03); }

/* ------------------------------------------------------ Responsive */

@media (max-width: 900px) {
	.calpro__inner { grid-template-columns: minmax(0, 1fr); }
	.calpro__panel--cal { position: static; }

	.calpro__event {
		grid-template-columns: 100px minmax(0, 1fr);
		grid-template-areas: "thumb body" "cta cta";
		gap: 14px;
	}

	.calpro__thumb { grid-area: thumb; }
	.calpro__body { grid-area: body; }
	.calpro__cta { grid-area: cta; text-align: center; }
}

@media (max-width: 480px) {
	.calpro__panel--cal { padding: 15px; }
	.calpro__num { font-size: .8rem; }
	.calpro__event { grid-template-columns: 78px minmax(0, 1fr); padding: 12px; gap: 12px; }
	.calpro__event-title { font-size: 1.02rem; }
}

@media (prefers-reduced-motion: reduce) {
	.calpro__event, .calpro__nav, .calpro__day, .calpro__cta, .calpro__inner { transition: none; }
	.calpro__event:hover { transform: none; }
}

@media print {
	.calpro__nav, .calpro__cta, .calpro__reset { display: none; }
	.calpro__event { box-shadow: none; break-inside: avoid; }
	.calpro__event[hidden] { display: grid !important; }
}
