/* Digital Greenhouse — christmas-music.css
   The Christmas music section (/music/christmas): the hub, the three level
   pages and each piece's page. Layered over kids-piano.css (the player, the
   paper and the piece-page layout). The header is a festive night sky in both
   themes, so its colours are fixed; the cards follow the site theme. */

:root {
  --xm-red: #b81d28;
  --xm-red-deep: #8e1620;
  --xm-green: #14633f;
  --xm-green-deep: #0b3d2a;
  --xm-gold: #e8b53a;
  --xm-gold-ink: #8a6526;      /* gold legible on white */
  --xm-night: #0d2240;
  --xm-cream: #fff6e0;
}

/* ---------- the festive header ---------- */
main.xm .page-header.xm-header {
  overflow: hidden;
  color: var(--xm-cream);
  border-bottom: 0;
  background:
    radial-gradient(600px 300px at 85% 0%, rgba(232, 181, 58, 0.22), transparent 65%),
    radial-gradient(500px 260px at 0% 100%, rgba(184, 29, 40, 0.35), transparent 70%),
    linear-gradient(180deg, #0a1b38 0%, #13325e 70%, #1b4373 100%);
}
main.xm .page-header.xm-header::after {          /* a garland edge: red and green stripes */
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 8px; z-index: 2;
  background: repeating-linear-gradient(135deg, var(--xm-red) 0 14px, #fff 14px 20px, var(--xm-green) 20px 34px, #fff 34px 40px);
}
main.xm .page-header.xm-header .container { position: relative; z-index: 1; }
main.xm .page-header.xm-header h1 { color: #fff; }
main.xm .page-header.xm-header p { color: rgba(255, 246, 224, 0.9); }
main.xm .page-header.xm-header .crumb,
main.xm .page-header.xm-header .crumb a { color: rgba(255, 246, 224, 0.75); }
main.xm .page-header.xm-header .crumb a:hover { color: var(--xm-gold); }
main.xm .page-header.xm-header .crumb span { color: #fff; }
main.xm .page-header.xm-header .eyebrow { color: var(--xm-gold); }
main.xm .page-header.xm-header .eyebrow a { color: inherit; }
main.xm .page-header.xm-header strong { color: #fff; }
main.xm .page-header.xm-header a:focus-visible { outline: 3px solid var(--xm-gold); outline-offset: 2px; }
main.xm .xm-header .kp-pic { box-shadow: 0 0 0 4px rgba(255, 246, 224, 0.9), 0 18px 40px -18px rgba(0, 0, 0, 0.7); }

/* falling snow: two layers of dots drifting down (still when motion is reduced) */
.xm-snow, .xm-snow::before {
  position: absolute; inset: -200px 0 0 0; pointer-events: none;
  background-image:
    radial-gradient(2px 2px at 20px 30px, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 90px 120px, rgba(255, 255, 255, 0.8) 50%, transparent 51%),
    radial-gradient(3px 3px at 160px 60px, rgba(255, 255, 255, 0.9) 50%, transparent 51%),
    radial-gradient(2px 2px at 60px 170px, rgba(255, 255, 255, 0.7) 50%, transparent 51%),
    radial-gradient(3px 3px at 130px 190px, #fff 50%, transparent 51%);
  background-size: 200px 200px;
  opacity: 0.55;
  animation: xm-fall 18s linear infinite;
}
.xm-snow::before {
  content: ""; inset: 0;
  background-size: 290px 290px;
  background-position: 70px 40px;
  opacity: 0.6;
  animation: xm-fall 28s linear infinite;
}
@keyframes xm-fall { from { transform: translateY(0); } to { transform: translateY(200px); } }
@media (prefers-reduced-motion: reduce) { .xm-snow, .xm-snow::before { animation: none; } }

/* the hub's header: text, then the banner across the full width */
.xm-header--hub { padding-bottom: 0 !important; }
.xm-hub-head { max-width: 820px; }
.xm-banner { display: block; width: 100%; max-width: 1200px; height: auto; margin: var(--space-5) auto 0; position: relative; z-index: 1; border-radius: 18px 18px 0 0; }

.xm-jumps { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.xm-jump {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 6px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 246, 224, 0.35);
  color: #fff !important; font-weight: 700; font-size: var(--fs-sm); text-decoration: none;
}
.xm-jump span { font-weight: 500; color: rgba(255, 246, 224, 0.8); }
.xm-jump:hover { background: rgba(255, 255, 255, 0.18); border-color: var(--xm-gold); }
.xm-others { font-size: var(--fs-base) !important; }
main.xm .page-header.xm-header .xm-others a { color: var(--xm-gold); }

/* level chip in a piece's eyebrow */
.xm-chip { display: inline-block; padding: 1px 10px; border-radius: 999px; color: #fff !important; letter-spacing: 0.08em; text-decoration: none; }
.xm-chip--kids { background: #7a2ea8; }
.xm-chip--absolute-beginner { background: #0f7c8c; }
.xm-chip--beginner { background: var(--xm-green); }
.xm-chip--intermediate { background: var(--xm-red); }
.xm-chip--advanced { background: #1f3b73; }

.xm-badge { flex: none; }
.xm-badge--h1 { display: inline-block; vertical-align: middle; margin: -6px 12px 0 0; }

/* ---------- the level sections and the cards ---------- */
.xm-body { position: relative; }
.xm-level { margin: var(--space-6) 0 var(--space-7); scroll-margin-top: 90px; }
.xm-level:first-child { margin-top: var(--space-2); }
.xm-level__head { display: flex; gap: var(--space-4); align-items: center; margin-bottom: var(--space-4); }
.xm-level__head h2 { margin: 0 0 var(--space-1); font-size: var(--fs-2xl, 1.8rem); }
.xm-level__head h2 a { color: inherit; text-decoration: none; }
.xm-level__head h2 a:hover { color: var(--xm-red); }
.xm-level__head p { margin: 0; color: var(--text-muted); max-width: 820px; }

.xm-cards { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.xm-cards--level { margin-top: var(--space-2); }
.xm-card {
  display: flex; flex-direction: column;
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--color-line); border-radius: 16px; overflow: hidden;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
  position: relative;
}
.xm-card::before {                   /* a ribbon across the top of each card */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; z-index: 1;
  background: repeating-linear-gradient(90deg, var(--xm-red) 0 18px, var(--xm-gold) 18px 22px, var(--xm-green) 22px 40px, var(--xm-gold) 40px 44px);
}
.xm-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--xm-gold); }
.xm-card:focus-visible { outline: 3px solid var(--xm-gold); outline-offset: 3px; }
.xm-card img { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; }
.xm-card__body { display: flex; flex-direction: column; gap: 4px; padding: var(--space-3) var(--space-4) var(--space-4); }
.xm-card__level { align-self: flex-start; font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 1px 9px; border-radius: 999px; color: #fff; }
.xm-card__level--kids { background: #7a2ea8; }
.xm-card__level--absolute-beginner { background: #0f7c8c; }
.xm-card__level--beginner { background: var(--xm-green); }
.xm-card__level--intermediate { background: var(--xm-red); }
.xm-card__level--advanced { background: #1f3b73; }
.xm-card__title { color: var(--text); font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 600; line-height: 1.25; }
.xm-card__facts { font-size: var(--fs-sm); color: var(--xm-gold-ink); font-weight: 600; }
.xm-card__blurb { font-size: var(--fs-sm); color: var(--text-muted); line-height: 1.5; }

.xm-more { max-width: var(--container-narrow); margin: var(--space-7) auto 0; }
.xm-more .faq { margin-inline: 0; }

/* "Where your hand goes" on a Kids / Absolute beginner piece */
.xm-hand { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: var(--space-4) var(--space-6); align-items: center; margin-top: var(--space-6); }
.xm-hand__paper { background: #fff; border: 1px solid var(--color-line); border-top: 4px solid var(--xm-red); border-radius: 14px; padding: 14px; line-height: 0; }
.xm-hand__paper svg { width: 100%; height: auto; }
.xm-hand h2 { font-size: var(--fs-xl); margin: 0 0 var(--space-2); }
.xm-hand p { margin: 0 0 var(--space-2); color: var(--text-muted); }
[data-theme="dark"] .xm-hand__paper { border-color: rgba(255, 255, 255, 0.12); border-top-color: var(--xm-red); }
@media (max-width: 760px) { .xm-hand { grid-template-columns: minmax(0, 1fr); } .xm-hand__paper { max-width: 380px; } }
@media print { .xm-hand { display: none !important; } }

/* the practice tip on a piece page */
.prose .xm-tip { padding: var(--space-3) var(--space-4); border-left: 4px solid var(--xm-red); background: rgba(232, 181, 58, 0.12); border-radius: 0 10px 10px 0; }

/* the music paper gets a thin festive edge */
main.xm .kp-paper { border-top: 4px solid var(--xm-red); }

/* ---------- dark theme ---------- */
[data-theme="dark"] .xm-card { border-color: rgba(255, 255, 255, 0.12); }
[data-theme="dark"] .xm-card__facts { color: var(--xm-gold); }
[data-theme="dark"] .xm-level__head h2 a:hover { color: var(--xm-gold); }
[data-theme="dark"] .prose .xm-tip { background: rgba(232, 181, 58, 0.1); }

@media (max-width: 600px) {
  .xm-level__head { align-items: flex-start; }
  .xm-level__head .xm-badge { width: 48px; height: 48px; }
  .xm-banner { border-radius: 12px 12px 0 0; }
  .xm-badge--h1 { width: 40px; height: 40px; }
  .xm-jump span { display: none; }
}

/* ---------- print: only the music (kids-piano.css hides the rest) ---------- */
@media print {
  .xm-snow, .xm-banner { display: none !important; }
  main.xm .kp-paper { border-top: 0; }
}
