/* The Advent flip clock on /advent and the locked Jesse Tree days (#3432 D10, D11).
 * The app's palette (#3415, rn-app countdownPalette.ts): one fixed deep violet card in every
 * appearance, the way a printed countdown is. Contrast is computed there:
 *   numerals #FFF8E1 on tile #6B4A9B 6.42:1, on lower half #62448F 7.21:1,
 *   heading #FFF8E1 on card #402C5D 11.38:1, labels cream at 75% on card 7.14:1.
 * Behaviour lives in /js/advent-countdown.js; without it the card stays hidden and the
 * fallback line shows. */
.jt-countdown{margin:0 0 2rem}
.jt-clock{
  --jt-card:#402C5D;--jt-tile:#6B4A9B;--jt-tile-lower:#62448F;--jt-cream:#FFF8E1;
  --jt-label:rgba(255,248,225,.75);--jt-hinge:rgba(64,44,93,.85);
  --jt-tile-w:clamp(3.5rem,18vw,5rem);
  box-sizing:border-box;width:100%;max-width:380px;padding:1rem;border-radius:20px;
  background:var(--jt-card);box-shadow:0 4px 12px rgba(0,0,0,.18);color:var(--jt-cream)
}
.jt-clock[hidden]{display:none}
.jt-clock-heading{font-size:.75rem;font-weight:700;letter-spacing:.12em;text-align:center;margin:0 0 .5rem}
.jt-clock-row{display:flex;justify-content:space-between;gap:.5rem}
.jt-clock-unit{display:flex;flex-direction:column;align-items:center;flex:1 1 0;min-width:0}
.jt-clock-label{margin-top:.25rem;font-size:.625rem;font-weight:600;letter-spacing:.06em;color:var(--jt-label);white-space:nowrap}
.jt-clock-date{margin:.5rem 0 0;font-size:.8125rem;text-align:center;color:var(--jt-label)}
.jt-tile{
  position:relative;display:block;width:100%;max-width:var(--jt-tile-w);aspect-ratio:1/1.12;
  border-radius:12%/10.7%;overflow:hidden;background:var(--jt-tile);
  font-weight:700;font-variant-numeric:tabular-nums;font-size:clamp(1.5rem,7vw,2.25rem);line-height:1
}
/* The hinge across the middle: the card colour, so it reads as a gap. */
.jt-tile::after{content:"";position:absolute;left:0;right:0;top:calc(50% - 1px);height:2px;background:var(--jt-hinge);z-index:5}
.jt-lower{position:absolute;left:0;right:0;top:50%;bottom:0;background:var(--jt-tile-lower)}
.jt-face{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:var(--jt-cream)}
.jt-half{position:absolute;left:0;right:0;height:50%;overflow:hidden;backface-visibility:hidden}
.jt-half .jt-face{bottom:auto;height:200%}
.jt-half-top{top:0;background:var(--jt-tile);transform-origin:bottom}
.jt-half-bottom{top:50%;background:var(--jt-tile-lower);transform-origin:top}
.jt-half-bottom .jt-face{top:-100%}
/* The flip, 300 ms in all (the app's FLIP_MS): the old top folds down over the hinge, then the
 * new bottom falls into place. */
.jt-flap-top{z-index:3;animation:jt-fold-top 150ms cubic-bezier(.55,0,1,.45) forwards}
.jt-flap-bottom{z-index:3;transform:perspective(400px) rotateX(90deg);animation:jt-fold-bottom 150ms cubic-bezier(0,.55,.45,1) 150ms forwards}
@keyframes jt-fold-top{from{transform:perspective(400px) rotateX(0)}to{transform:perspective(400px) rotateX(-90deg)}}
@keyframes jt-fold-bottom{from{transform:perspective(400px) rotateX(90deg)}to{transform:perspective(400px) rotateX(0)}}
/* Reduced motion: a 200 ms cross-fade (the app's FADE_MS). */
.jt-fade-out{animation:jt-fade-out 200ms linear forwards}
.jt-fade-in{opacity:0;animation:jt-fade-in 200ms linear forwards}
@keyframes jt-fade-out{from{opacity:1}to{opacity:0}}
@keyframes jt-fade-in{from{opacity:0}to{opacity:1}}
@media (prefers-reduced-motion:reduce){
  .jt-flap-top,.jt-flap-bottom{animation:none;display:none}
}
.jt-countdown-small .jt-clock{max-width:320px;padding:.75rem}
.jt-countdown-small .jt-tile{--jt-tile-w:3.75rem;font-size:clamp(1.25rem,6vw,1.75rem)}
/* The landing's clock leads the page under the language switch, centred and a size up. */
.jt-countdown-hero{display:flex;flex-direction:column;align-items:center;text-align:center;margin:.5rem 0 2.5rem}
.jt-countdown-hero .jt-clock{max-width:460px;padding:1.25rem}
.jt-countdown-hero .jt-clock-heading{font-size:.875rem}
.jt-countdown-hero .jt-tile{--jt-tile-w:clamp(3.5rem,19vw,6rem);font-size:clamp(1.5rem,8vw,2.75rem)}
.jt-countdown-hero .jt-clock-label{font-size:.6875rem}
.jt-countdown-hero .jt-clock-fallback{margin-bottom:0}
