/* Advent chapter pages. The site's own css/index.css (copied unchanged) does the rest: palette, Nunito,
   the aurora header, the card look of MAIN children, the footer. Only colours from its :root are used. */

/* ---- Header: one column (no character picture), as on the coming-soon page ---- */

.advent-page HEADER .hero {
	grid-template-columns: minmax(0, 1fr);
	padding-top: calc(var(--pad) * 3);
	padding-bottom: calc(var(--pad) * 3);
}
.advent-page HEADER .hero .title { font-size: clamp(2em, 5.5vw, 3.75em); }
.advent-page HEADER .hero .subtitle { font-size: 1.1em; color: var(--ink-soft); }

/* ---- The chapter card ---- */

.advent-page MAIN { justify-items: center; }
.advent-page MAIN .chapter {
	width: 100%;
	max-width: 42em;
	padding: 1.75em 2.25em 2em;
}

/* twenty-five lights: found so far glow, today's glows brightest, the rest wait */
.advent-page MAIN .lights {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: .4em;
	margin: .25em 0 .6em;
}
.advent-page MAIN .light {
	width: .65em;
	height: .65em;
	border-radius: 50%;
	background: var(--placeholder);
}
.advent-page { --teal-deep: #8AE1D4; }	/* the site teal (--live) deepened: --live itself is too faint on white and on the doorway glow (owner 01:29) */
.advent-page MAIN .light.lit:nth-child(3n+1) { background: var(--teal-deep); box-shadow: 0 0 .4em var(--teal-deep); }
.advent-page MAIN .light.lit:nth-child(3n+2) { background: var(--periwinkle); box-shadow: 0 0 .4em var(--periwinkle); }
.advent-page MAIN .light.lit:nth-child(3n)   { background: var(--lilac); box-shadow: 0 0 .4em var(--lilac); }
.advent-page MAIN .light.today {
	transform: scale(1.35);
	box-shadow: 0 0 .5em .15em var(--lilac);
}

/* on a locked page: the light that page is about, an empty ring */
.advent-page MAIN .light.waiting {
	background: transparent;
	box-shadow: inset 0 0 0 2px var(--periwinkle);
}

.advent-page MAIN .day {
	color: var(--ink-soft);
	font-size: .85em;
	font-weight: 800;
	letter-spacing: .08em;
	text-align: center;
	text-transform: uppercase;
}

/* "Jump to today's gift" (owner 02:33: one link from Discord to the page, a button on the page to hop to the gift) */
.advent-page MAIN .chapter .jump-gift {	/* subtle: pale with dark text (owner 02:46-02:47), a gap before the title */
	display: table;
	margin: .6em auto calc(2.4em + 1px);	/* button->title gap = title->text gap, measured from the render (owner 02:48) */
	padding: .25em 1em;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--tint);
	color: var(--ink);
	font-size: .85em;
	font-weight: 600;
	text-decoration: none;
}
.advent-page MAIN .chapter .jump-gift:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; }

/* "Back to the calendar" (owner 03:15): a quiet centred text link at the top of every day page, open or locked */
.advent-page MAIN .chapter .back-link {
	display: table;
	margin: -.4em auto .9em;
	color: var(--ink-soft);
	font-size: .8em;
	font-weight: 700;
	text-decoration: none;
}
.advent-page MAIN .chapter .back-link::before {	/* a small chevron, drawn (no glyph the font might lack) */
	content: "";
	display: inline-block;
	width: .42em;
	height: .42em;
	margin-right: .45em;
	border-left: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-.08em) rotate(45deg);
}
.advent-page MAIN .chapter .back-link:hover { color: var(--ink); text-decoration: underline; }
.advent-page MAIN .chapter .back-link:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; }
HTML { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { HTML { scroll-behavior: auto; } }

/* ---- The chapter text (the fragment: <h2>, <p>, <em>) ---- */

.advent-page MAIN .chapter H2 {
	margin: .3em 0 1em;
	font-size: 1.75em;
	font-weight: 800;
	line-height: 1.2;
	text-align: center;
	color: var(--ink);
}
.advent-page MAIN .chapter P {
	margin: 0 0 1em;
	font-size: 1.125em;
	line-height: 1.7;
}
.advent-page MAIN .chapter P:last-child { margin-bottom: 0; }

/* ---- Today's gift (a second card, under the chapter) ---- */

.advent-page MAIN .gift {
	width: 100%;
	max-width: 42em;
	padding: 1.25em 2.25em 1.75em;
	text-align: center;
}
.advent-page MAIN .gift > .title { margin-bottom: .6em; font-size: 1.5em; }
.advent-page MAIN .gift .gift-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: .75em;
	margin-top: .5em;
}
.advent-page MAIN .gift .gift-label { color: var(--ink-soft); font-weight: 800; }
.advent-page MAIN .gift .gift-picture IMG {
	display: block;
	max-width: 100%;
	max-height: 32em;
	height: auto;
	border-radius: .6em;
	box-shadow: var(--card-shadow);
}
.advent-page MAIN .gift AUDIO { width: 100%; max-width: 26em; }
.advent-page MAIN .gift .gift-save {
	padding: .3em 1.1em;
	border-radius: 999px;
	background: var(--periwinkle);
	color: var(--white);
	font-size: .9em;
	font-weight: 600;
	text-decoration: none;
}
.advent-page MAIN .gift .gift-text {
	width: 100%;
	padding: 1em 1.4em;
	border-radius: .6em;
	background: var(--tint);
	text-align: left;
	line-height: 1.6;
}
.advent-page MAIN .gift .gift-text H3 { margin: .1em 0 .4em; font-size: 1.3em; font-weight: 800; text-align: center; }
.advent-page MAIN .gift .gift-text H4 { margin: 1em 0 .3em; font-size: 1.05em; font-weight: 800; }
.advent-page MAIN .gift .gift-text P { margin: .5em 0; }
.advent-page MAIN .gift .gift-text UL,
.advent-page MAIN .gift .gift-text OL { margin: .3em 0; padding-left: 1.4em; }
.advent-page MAIN .gift .gift-text LI { margin: .25em 0; }
.advent-page MAIN .gift .gift-decor { display: flex; justify-content: center; gap: .9em; font-size: 1.4em; }
.advent-page MAIN .gift .gift-decor IMG.emoji { display: block; width: 1.15em; height: 1.15em; }
.advent-page MAIN .gift .gift-video {
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: .6em;
	overflow: hidden;
	background: var(--clip-bg);
}
.advent-page MAIN .gift .gift-video IFRAME { display: block; width: 100%; height: 100%; border: 0; }
.advent-page MAIN .gift .gift-pending { color: var(--ink-soft); }

/* ---- The calendar (/advent/) ---- */

.advent-page MAIN .calendar {
	width: 100%;
	max-width: 42em;
	padding: 1.75em 2.25em 2em;
}
.advent-page MAIN .calendar > .title { text-align: center; }
.advent-page MAIN .calendar > .intro {
	margin: .5em auto 1em;
	max-width: 30em;
	color: var(--ink-soft);
	font-size: 1.05em;
	line-height: 1.5;
	text-align: center;
}
.advent-page MAIN .calendar .doors {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	grid-auto-rows: 1fr;	/* every door cell the same size, whatever its caption holds */
	gap: .75em;
	margin: 1.25em 0 0;
	padding: 0;
	list-style: none;
}
/* Each door is an arched doorway (taller than wide) with a caption row under it. Closed: a framed panel with a knob,
   its number centred on it. Open: the panel has swung aside (the .leaf, turned on its left hinge), a light glows in
   the doorway, and the number + place are centred in the caption UNDER the door (owner 01:19-01:20: no text over
   the door, nothing off-centre). Colours from the site palette. */
.advent-page MAIN .calendar .door {
	--arch: 50% 50% .35em .35em / 30% 30% .35em .35em;
	--closed: linear-gradient(170deg, #D0E4F8 0%, #CFD3F8 55%, #DBCDFA 100%);
	--glow: var(--lilac);
	container-type: inline-size;
}
.advent-page MAIN .calendar .door:nth-child(3n+1) { --glow: var(--teal-deep); }
.advent-page MAIN .calendar .door:nth-child(3n+2) { --glow: var(--periwinkle); }
.advent-page MAIN .calendar .door > A {
	display: flex;
	flex-direction: column;
	align-items: center;
	color: var(--ink);
	text-decoration: none;
}
.advent-page MAIN .calendar .door .frame {
	position: relative;
	display: flex;
	justify-content: center;
	align-items: center;
	width: 100%;
	aspect-ratio: 3 / 4;
	border-radius: var(--arch);
}
.advent-page MAIN .calendar .door .caption {
	display: flex;
	flex-direction: column;
	align-items: center;
	height: 2.6em;	/* fixed: the same under every door, open or closed */
	overflow: hidden;
	padding-top: .3em;
	text-align: center;
	line-height: 1.15;
}
.advent-page MAIN .calendar .door .caption .num { font-size: 1.05em; font-weight: 800; }
.advent-page MAIN .calendar .door .caption .place { color: var(--ink-soft); font-size: .75em; font-weight: 800; }

/* closed */
.advent-page MAIN .calendar .door .panel {
	background: var(--closed);
	box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .75), 0 2px 6px rgba(28, 42, 68, .08);
	color: var(--ink-soft);
}
.advent-page MAIN .calendar .door .panel .num { position: relative; font-size: 30cqi; font-weight: 800; line-height: 1; }
.advent-page MAIN .calendar .door .panel::before {	/* the inner moulding */
	content: '';
	position: absolute;
	inset: 12% 14% 9%;
	border: 2px solid rgba(255, 255, 255, .6);
	border-radius: var(--arch);
}
.advent-page MAIN .calendar .door .panel::after {	/* the knob */
	content: '';
	position: absolute;
	right: 20%;
	top: 58%;
	width: 8cqi;
	height: 8cqi;
	border-radius: 50%;
	background: var(--white);
	box-shadow: 0 1px 2px rgba(28, 42, 68, .25);
}

/* open */
.advent-page MAIN .calendar .door.open .frame {
	background: radial-gradient(ellipse 80% 70% at 50% 60%, #FFFFFF 0%, rgba(214, 244, 248, .95) 40%, rgba(216, 201, 250, .95) 75%, var(--lilac) 100%);
	box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .75), 0 2px 8px rgba(28, 42, 68, .12);
	transition: transform .15s ease, box-shadow .15s ease;
}
.advent-page MAIN .calendar .door.open .leaf {	/* the panel, swung open on its left hinge */
	position: absolute;
	inset: 0;
	border-radius: var(--arch);
	background: var(--closed);
	box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .75);
	transform-origin: left center;
	transform: perspective(300px) rotateY(68deg);
}
.advent-page MAIN .calendar .door.open .orb {	/* the light that was behind this door */
	width: 26cqi;
	height: 26cqi;
	border-radius: 50%;
	background: radial-gradient(circle, #FFFFFF 0%, #FFFFFF 28%, var(--glow) 70%, rgba(255, 255, 255, 0) 100%);
	box-shadow: 0 0 9cqi 3cqi var(--glow);
	filter: blur(.4px);
}
.advent-page MAIN .calendar .door.open > A:hover .frame,
.advent-page MAIN .calendar .door.open > A:focus-visible .frame {
	transform: translateY(-2px);
	box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .9), 0 6px 14px rgba(28, 42, 68, .16);
}
.advent-page MAIN .calendar .door.open > A:focus-visible { outline: none; }
.advent-page MAIN .calendar .door.open > A:focus-visible .caption .num { text-decoration: underline; }
.advent-page MAIN .calendar .door.today .frame {
	box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .9), 0 0 0 2px var(--lilac), 0 0 1.1em var(--lilac);
}
.advent-page MAIN .calendar .door.today .orb { width: 32cqi; height: 32cqi; }
@media (prefers-reduced-motion: reduce) {
	.advent-page MAIN .calendar .door.open .frame { transition: none; }
	.advent-page MAIN .calendar .door.open > A:hover .frame { transform: none; }
}

/* ---- Not open yet ---- */

.advent-page MAIN .chapter.locked { max-width: 32em; text-align: center; }
.advent-page MAIN .chapter.locked .opens { color: var(--ink-soft); }

/* ---- Phones ---- */

@media (max-width: 500px) {
	.advent-page MAIN .chapter { padding: 1.25em 1.25em 1.5em; }
	.advent-page MAIN .gift { padding: 1em 1.25em 1.5em; }
	.advent-page MAIN .calendar { padding: 1.25em 1em 1.5em; }
	.advent-page MAIN .calendar .doors { gap: .45em; }
	.advent-page MAIN .calendar .door .place { display: none; }	/* too small to read on a phone door */
	.advent-page MAIN .gift .gift-text { padding: .8em 1em; }
	/* all 25 lights on one row down to a 320px phone (25 x .45em + 24 x .25em = 17.25em) */
	.advent-page MAIN .lights { flex-wrap: nowrap; gap: .25em; }
	.advent-page MAIN .light { flex: none; width: .45em; height: .45em; }
	.advent-page MAIN .chapter H2 { font-size: 1.45em; }
	.advent-page MAIN .chapter .jump-gift { margin-bottom: calc(2.4em - 4px); }	/* phone: matches the smaller title->text gap */
	.advent-page MAIN .chapter P { font-size: 1.05em; line-height: 1.65; }
}
