/*
 * CubeFem Holidays - front-end styles.
 * Colours come from the CubeFem Pixel theme variables (--px-*), so the holiday
 * pieces follow the light / dark switch automatically.
 */

.cfhol-rel { position: relative; }
.cfhol-clicky { cursor: pointer; }

/* ---------------------------------------------------------------- hats */
.cfhol-acc {
	position: absolute !important;
	left: 50%;
	bottom: calc((1 - var(--cfhol-y, 0.3)) * 100%);
	transform: translateX(-50%) rotate(var(--cfhol-rot, 0deg));
	transform-origin: 50% 100%;
	pointer-events: none;
	z-index: 4;
	line-height: 0;
}
.cfhol-acc-art {
	display: block;
	width: 100%;
	height: 0;
	background-repeat: no-repeat;
	background-size: 100% 100%;
	background-position: 0 0;
	image-rendering: pixelated;
}

/* The theme adds margins to children of layout blocks and clips cards with overflow:hidden,
   so card and hero decorations sit just inside the edge with no margin. */
.cfhol-ground,
.cfhol-cap,
.cfhol-web {
	margin-top: 0 !important;
	margin-bottom: 0 !important;
}

@keyframes cfhol-wob {
	0%, 100% { transform: translateX(-50%) rotate(calc(var(--cfhol-rot, 0deg) - 3deg)); }
	50%      { transform: translateX(-50%) rotate(calc(var(--cfhol-rot, 0deg) + 3deg)); }
}
.cfhol-wobble { animation: cfhol-wob 1.8s steps(4) infinite; }

@keyframes cfhol-pop {
	0%   { transform: translateX(-50%) translateY(0) rotate(var(--cfhol-rot, 0deg)); }
	30%  { transform: translateX(-50%) translateY(-7px) rotate(calc(var(--cfhol-rot, 0deg) + 8deg)); }
	60%  { transform: translateX(-50%) translateY(1px) rotate(calc(var(--cfhol-rot, 0deg) - 5deg)); }
	100% { transform: translateX(-50%) translateY(0) rotate(var(--cfhol-rot, 0deg)); }
}
.cfhol-pop { animation: cfhol-pop 0.45s steps(6) 1; }

/* ---------------------------------------------------------- header trim */
.cfhol-trim {
	position: absolute !important;
	left: 0;
	right: 0;
	top: 100%;
	overflow: hidden;
	pointer-events: none;
	z-index: 2;
	transition: transform 0.3s steps(5), opacity 0.3s;
}
.cfhol-trim-a,
.cfhol-trim-b {
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	background-repeat: repeat-x;
	image-rendering: pixelated;
}
@keyframes cfhol-twinkle {
	0%   { opacity: 1; }
	50%  { opacity: 0.1; }
	100% { opacity: 1; }
}
.cfhol-trim-b { animation: cfhol-twinkle 1.7s steps(2) infinite; }

.cfhol-trim-sheen {
	position: absolute;
	inset: 0;
	background: linear-gradient(100deg, transparent 38%, rgba(255, 255, 255, 0.6) 50%, transparent 62%);
	background-size: 220% 100%;
	background-repeat: no-repeat;
	animation: cfhol-sheen 3.6s steps(16) infinite;
}
@keyframes cfhol-sheen {
	0%   { background-position: 130% 0; }
	100% { background-position: -30% 0; }
}

.cfhol-spider {
	position: absolute;
	top: 0;
	width: 21px;
	margin-left: -10px;
	animation: cfhol-drop 5.4s steps(18) infinite;
}
.cfhol-spider::before {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 70%;
	width: 1px;
	height: 80px;
	background: #8B7FB0;
}
.cfhol-spider img { display: block; width: 100%; height: auto; position: relative; }
@keyframes cfhol-drop {
	0%, 100% { transform: translateY(-2px); }
	50%      { transform: translateY(16px); }
}

html.cfhol-scrolled .cfhol-trim,
html.cfhol-scrolled .cfhol-sign {
	transform: translateY(-110%);
	opacity: 0;
	pointer-events: none;
}

/* ---------------------------------------------------------------- sign */
.cfhol-sign {
	position: absolute !important;
	top: calc(100% + 16px);
	left: 0;
	right: 0;
	margin: 0 auto;
	width: fit-content;
	max-width: calc(100% - 32px);
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 8px 7px 10px;
	background: var(--px-card, #FFFFFF);
	color: var(--px-text, #1A1821);
	border: 3px solid var(--px-border-strong, #1A1821);
	box-shadow: 4px 4px 0 var(--cfhol-accent, #F8A2D2);
	font-family: 'Silkscreen', cursive, sans-serif;
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	z-index: 3;
	cursor: default;
	transform-origin: 50% -16px;
	animation: cfhol-swing 3.6s steps(6) infinite;
	transition: transform 0.3s steps(5), opacity 0.3s;
}
.cfhol-sign::before,
.cfhol-sign::after {
	content: "";
	position: absolute;
	top: -19px;
	width: 3px;
	height: 16px;
	background: var(--cfhol-accent, #F8A2D2);
}
.cfhol-sign::before { left: 16px; }
.cfhol-sign::after  { right: 16px; }
.cfhol-sign-ic { display: block; width: 14px; height: auto; flex: none; image-rendering: pixelated; }
.cfhol-sign-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cfhol-sign-x {
	flex: none;
	width: 20px;
	height: 20px;
	padding: 0;
	margin-left: 2px;
	background: transparent;
	color: inherit;
	border: 2px solid currentColor;
	font: inherit;
	font-size: 14px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.6;
}
.cfhol-sign-x:hover { opacity: 1; background: var(--cfhol-accent, #F8A2D2); color: #1A1821; }
.cfhol-sign--gone { display: none; }
@keyframes cfhol-swing {
	0%, 100% { transform: rotate(-0.8deg); }
	50%      { transform: rotate(0.8deg); }
}

/* ------------------------------------------------ hero ground, caps, webs */
.cfhol-hero { isolation: isolate; }
/* !important on position: the theme styles hero children (grid + position:relative) and loads after this file. */
.cfhol-ground,
.cfhol-cap {
	position: absolute !important;
	left: 0;
	right: 0;
	pointer-events: none;
	background-repeat: repeat-x;
	image-rendering: pixelated;
}
.cfhol-ground { bottom: 0; background-position: left bottom; z-index: -1; }
.cfhol-cap--hero { top: 0; z-index: -1; }
.cfhol-cap--card { top: 0; left: 0; right: 0; z-index: 2; }

.cfhol-web {
	position: absolute !important;
	top: 0;
	width: 84px;
	height: 84px;
	pointer-events: none;
	z-index: -1;
	opacity: 0.8;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40' fill='none' stroke='%238B7FB0' stroke-width='1' shape-rendering='crispEdges'%3E%3Cpath d='M0 0L40 0M0 0L37 14M0 0L28 28M0 0L14 37M0 0L0 40'/%3E%3Cpath d='M12 0L9 3L5 9L3 12M24 0L19 6L12 12L6 19L0 24M36 0L29 8L21 14L14 21L8 29L0 36'/%3E%3C/svg%3E") no-repeat 0 0 / 100% 100%;
	image-rendering: pixelated;
}
.cfhol-web--l { left: 0; }
.cfhol-web--r { right: 0; transform: scaleX(-1); }

/* ------------------------------------------------------------ particles */
.cfhol-fx {
	position: fixed;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	z-index: 9000;
}

/* ------------------------------------------------------- preview badge */
.cfhol-preview {
	position: fixed;
	left: 50%;
	bottom: 14px;
	transform: translateX(-50%);
	z-index: 99995;
	display: flex;
	align-items: center;
	gap: 12px;
	max-width: calc(100% - 24px);
	padding: 8px 12px;
	background: #1A1821;
	color: #FFF7FB;
	border: 3px solid #5EE5E6;
	box-shadow: 4px 4px 0 #F8A2D2;
	font-family: 'Silkscreen', cursive, sans-serif;
	font-size: 0.7rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}
.cfhol-preview a { color: #5EE5E6; text-decoration: underline; white-space: nowrap; }

/* ----------------------------------------------------------- small screens */
@media (max-width: 700px) {
	.cfhol-sign { font-size: 0.65rem; padding: 6px 6px 6px 8px; }
	.cfhol-sign-ic { width: 12px; }
}

/* ----------------------------------------------------------- reduced motion */
html.cfhol-still .cfhol-acc,
html.cfhol-still .cfhol-sign,
html.cfhol-still .cfhol-trim-a,
html.cfhol-still .cfhol-trim-b,
html.cfhol-still .cfhol-trim-sheen,
html.cfhol-still .cfhol-spider { animation: none; }

@media print {
	.cfhol-fx, .cfhol-trim, .cfhol-sign, .cfhol-preview { display: none; }
}
