/*
 * PureCSS.com
 * https://purecss.com/calendar/
 * A monthly calendar built with CSS Grid: 7 columns, hover states, and today highlighted.
 */

.demo-calendar .cal-center {
	display: flex;
	justify-content: center;
}

.demo-calendar .cal-wrap {
		background: var(--surface);
		border: 1px solid var(--border);
		border-radius: var(--radius-lg);
		overflow: hidden;
		width: 100%;
		max-width: 380px;
	}

.demo-calendar .cal-header {
		padding: 1rem 1.25rem;
		display: flex;
		align-items: center;
		justify-content: space-between;
		border-bottom: 1px solid var(--border);
	}

.demo-calendar .cal-month-label {
		font-weight: 700;
		font-size: .95rem;
		color: var(--text);
	}

.demo-calendar .cal-nav {
		display: flex;
		gap: .4rem;
	}

.demo-calendar .cal-nav-btn {
		background: none;
		border: 1px solid var(--border);
		color: var(--text-muted);
		width: 28px;
		height: 28px;
		border-radius: var(--radius);
		cursor: pointer;
		font-size: .8rem;
		display: flex;
		align-items: center;
		justify-content: center;
		transition: border-color .15s, color .15s;
	}

:is(.demo-calendar .cal-nav-btn):hover {
			border-color: var(--accent);
			color: var(--accent);
		}

.demo-calendar .cal-grid {
		display: grid;
		grid-template-columns: repeat(7, 1fr);
		padding: .25rem .5rem .75rem;
	}

.demo-calendar .cal-day-name {
		font-family: var(--font-mono);
		font-size: .58rem;
		text-transform: uppercase;
		letter-spacing: .07em;
		color: var(--text-muted);
		text-align: center;
		padding: .6rem .25rem .4rem;
	}

.demo-calendar .cal-day {
		aspect-ratio: 1;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: .8rem;
		color: var(--text);
		cursor: pointer;
		border-radius: 50%;
		transition: background .15s, color .15s;
		margin: .1rem;
		position: relative;
	}

:is(.demo-calendar .cal-day):hover {
			background: var(--surface-2);
		}

.cal-today:is(.demo-calendar .cal-day) {
			background: var(--accent);
			color: var(--bg);
			font-weight: 700;
		}

.cal-today:is(.demo-calendar .cal-day):hover {
				background: var(--accent);
			}

.cal-muted:is(.demo-calendar .cal-day) {
			color: var(--text-muted);
			opacity: .35;
		}

.cal-has-event:is(.demo-calendar .cal-day)::after {
				content: "";
				position: absolute;
				bottom: 3px;
				left: 50%;
				transform: translateX(-50%);
				width: 3px;
				height: 3px;
				border-radius: 50%;
				background: var(--accent);
			}

.cal-has-event.cal-today:is(.demo-calendar .cal-day)::after {
				background: #0c0c0d;
			}

.demo-calendar .cal-footer {
		border-top: 1px solid var(--border);
		padding: .6rem 1rem;
		display: flex;
		gap: 1.25rem;
	}

.demo-calendar .cal-legend {
		display: flex;
		align-items: center;
		gap: .4rem;
		font-family: var(--font-mono);
		font-size: .62rem;
		color: var(--text-muted);
		letter-spacing: .04em;
	}

:is(.demo-calendar .cal-legend)::before {
			content: "";
			width: 8px;
			height: 8px;
			border-radius: 50%;
			background: var(--accent);
		}

.cal-legend-today:is(.demo-calendar .cal-legend)::before {
			border-radius: 50%;
		}

/* ── Variant: week view, events spanning hour rows ── */

.demo-calendar .cal-week {
		width: 100%;
		max-width: 460px;
		background: var(--surface);
		border: 1px solid var(--border);
		border-radius: var(--radius-lg);
		padding: .9rem;
	}

.demo-calendar .cal-week-head {
		display: grid;
		grid-template-columns: 30px repeat(5, 1fr);
		gap: 2px;
		margin-bottom: .4rem;
	}

.demo-calendar .cal-week-head span {
		font-family: var(--font-mono);
		font-size: .58rem;
		text-transform: uppercase;
		letter-spacing: .07em;
		color: var(--text-muted);
		text-align: center;
	}

/* a narrow gutter for the hours, then one track per weekday. The hour rules
   are drawn with one repeating gradient rather than bordering cells that do
   not exist, because empty slots are never in the DOM at all. */
.demo-calendar .cal-week-grid {
		display: grid;
		grid-template-columns: 30px repeat(5, 1fr);
		grid-template-rows: repeat(6, 34px);
		gap: 2px;
		background-image: repeating-linear-gradient(to bottom, var(--border) 0 1px, transparent 1px 36px);
	}

/* a column only, so auto placement drops each label into the next free row */
.demo-calendar .cal-hour {
		grid-column: 1;
		font-family: var(--font-mono);
		font-size: .6rem;
		color: var(--text-muted);
		text-align: right;
		padding-right: .3rem;
	}

.demo-calendar .cal-event {
		border-radius: 6px;
		padding: .3rem .45rem;
		font-size: .65rem;
		font-weight: 600;
		line-height: 1.25;
		overflow: hidden;
		color: var(--bg);
	}

.demo-calendar .cal-event-sky    { background: var(--sky); }

.demo-calendar .cal-event-violet { background: var(--violet); }

.demo-calendar .cal-event-teal   { background: var(--teal); }

.demo-calendar .cal-event-yellow { background: var(--yellow); }

.demo-calendar .cal-event-coral  { background: var(--coral); }

/* ── Variant: a year in seven rows ── */

.demo-calendar .cal-year-wrap {
		width: 100%;
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: .75rem;
	}

/* seven rows are declared; the columns are created as cells arrive, so a
   longer range needs more spans and no stylesheet change */
.demo-calendar .cal-year {
		display: grid;
		grid-template-rows: repeat(7, 11px);
		grid-auto-flow: column;
		grid-auto-columns: 11px;
		gap: 3px;
		max-width: 100%;
		overflow-x: auto;
		padding-bottom: .4rem;
	}

.demo-calendar .cal-heat {
		border-radius: 2px;
		background: var(--accent);
	}

/* one hue at five weights: opacity rather than five hard-coded tints, so the
   scale still reads correctly when the theme swaps the accent */
.demo-calendar .cal-heat-0 { background: var(--surface-2); }

.demo-calendar .cal-heat-1 { opacity: .22; }

.demo-calendar .cal-heat-2 { opacity: .45; }

.demo-calendar .cal-heat-3 { opacity: .7; }

.demo-calendar .cal-heat-4 { opacity: 1; }

.demo-calendar .cal-year-key {
		display: flex;
		align-items: center;
		gap: .35rem;
		font-family: var(--font-mono);
		font-size: .58rem;
		letter-spacing: .05em;
		color: var(--text-muted);
	}

.demo-calendar .cal-year-key .cal-heat {
		width: 11px;
		height: 11px;
	}
