/* Peekaboo Santa (Light Routes and Lights pages only; added by santa-peek.js). */
.clgoa-santa {
    --santa-h: 200px;
    --santa-w: calc(var(--santa-h) * 267 / 400);
    position: fixed;
    right: 0;
    bottom: 0;
    z-index: 9990;
    width: var(--santa-w);
    height: var(--santa-h);
    pointer-events: none;
}
.clgoa-santa__window {
    position: absolute;
    inset: 0;
    overflow: hidden;
}
.clgoa-santa__figure {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    transform: translateX(100%);
    transition: transform 1.4s cubic-bezier(.22, .8, .3, 1);
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
}
.clgoa-santa__figure img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    user-select: none;
    -webkit-user-drag: none;
}
.clgoa-santa__hand {
    transform-origin: 23.2% 38.2%; /* his wrist (Santa is mirrored, so measured from the left) */
}
.clgoa-santa__figure:focus-visible {
    outline: 3px solid var(--clgoa-gold, #ebab32);
    outline-offset: -3px;
}

/* Peeking: he leans in, whole waving hand showing, and gives one small wave as a hint to click.
   Clicked: he leans the rest of the way out and waves properly. */
.clgoa-santa[data-state="peek"] .clgoa-santa__figure { transform: translateX(10%); }
.clgoa-santa[data-state="peek"] .clgoa-santa__hand { animation: clgoa-santa-wave 1.1s ease-in-out 1.3s 1; }
.clgoa-santa[data-state="out"] .clgoa-santa__figure {
    transform: translateX(0);
    transition-duration: .6s;
}
.clgoa-santa[data-state="hiding"] .clgoa-santa__figure {
    transform: translateX(100%);
    transition-duration: .8s;
    transition-timing-function: ease-in;
}
.clgoa-santa[data-state="out"] .clgoa-santa__hand { animation: clgoa-santa-wave 1.1s ease-in-out .55s 3; }
.clgoa-santa.is-rewave .clgoa-santa__hand { animation: clgoa-santa-wave 1.1s ease-in-out 0s 2; }
@keyframes clgoa-santa-wave {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-14deg); }
    75% { transform: rotate(10deg); }
}

/* Speech bubble, to the left of Santa at about head height. */
.clgoa-santa__bubble {
    box-sizing: border-box;
    position: absolute;
    right: calc(100% - 6px);
    bottom: 64%;
    width: max-content;
    max-width: min(290px, calc(100vw - var(--santa-w) - 16px));
    margin: 0;
    padding: 14px 34px 14px 18px;
    color: var(--clgoa-ink, #252b28);
    font-family: var(--clgoa-sans, sans-serif);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    background: #fffaf1;
    border: 2px dashed var(--clgoa-red, #c82d20);
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(17, 73, 41, .18);
    opacity: 0;
    transform: translateY(8px) scale(.92);
    transform-origin: 100% 100%;
    transition: opacity .35s ease, transform .35s ease;
    pointer-events: none;
}
.clgoa-santa__bubble::after { /* the tail, pointing down toward Santa */
    content: "";
    position: absolute;
    right: 18px;
    bottom: -11px;
    width: 18px;
    height: 18px;
    background: #fffaf1;
    border-right: 2px dashed var(--clgoa-red, #c82d20);
    border-bottom: 2px dashed var(--clgoa-red, #c82d20);
    transform: rotate(45deg);
}
.clgoa-santa__bubble p {
    margin: 0;
    padding: 0;
    color: inherit;
    font: inherit;
}
.clgoa-santa[data-state="out"] .clgoa-santa__bubble {
    opacity: 1;
    transform: none;
    transition-delay: .5s;
    pointer-events: auto;
}
.clgoa-santa__close {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    color: var(--clgoa-muted, #5a625c);
    font: 700 20px/28px var(--clgoa-sans, sans-serif);
    text-align: center;
    background: none;
    border: 0;
    border-radius: 50%;
}
.clgoa-santa__close:hover,
.clgoa-santa__close:focus-visible {
    color: var(--clgoa-red, #c82d20);
    background: rgba(200, 45, 32, .08);
    outline: none;
}

/* Three gold sparkles left behind when he ducks away. */
.clgoa-santa__sparkles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.clgoa-santa__sparkle {
    position: absolute;
    color: var(--clgoa-gold, #ebab32);
    font-size: 18px;
    line-height: 1;
    text-shadow: 0 0 6px rgba(255, 214, 90, .9);
    opacity: 0;
    pointer-events: none;
}
.clgoa-santa__sparkle:nth-of-type(1) { right: 22%; bottom: 82%; }
.clgoa-santa__sparkle:nth-of-type(2) { right: 8%; bottom: 66%; font-size: 13px; }
.clgoa-santa__sparkle:nth-of-type(3) { right: 30%; bottom: 60%; font-size: 15px; }
.clgoa-santa.is-sparkling .clgoa-santa__sparkle { animation: clgoa-santa-sparkle 1.4s ease-out both; }
.clgoa-santa.is-sparkling .clgoa-santa__sparkle:nth-of-type(2) { animation-delay: .18s; }
.clgoa-santa.is-sparkling .clgoa-santa__sparkle:nth-of-type(3) { animation-delay: .34s; }
@keyframes clgoa-santa-sparkle {
    0% { opacity: 0; transform: translateY(6px) scale(.4) rotate(0); }
    30% { opacity: 1; transform: translateY(0) scale(1.1) rotate(25deg); }
    100% { opacity: 0; transform: translateY(-16px) scale(.6) rotate(70deg); }
}

@media (max-width: 600px) {
    .clgoa-santa { --santa-h: 140px; }
    .clgoa-santa__bubble { font-size: 14px; padding: 12px 30px 12px 14px; }
}

/* Visitors who ask for less motion: Santa fades in and out instead of sliding, and doesn't wave. */
@media (prefers-reduced-motion: reduce) {
    .clgoa-santa__figure { transition: opacity .4s ease; opacity: 0; }
    .clgoa-santa[data-state="peek"] .clgoa-santa__figure,
    .clgoa-santa[data-state="out"] .clgoa-santa__figure { opacity: 1; }
    .clgoa-santa[data-state="peek"] .clgoa-santa__figure { transform: translateX(10%); }
    .clgoa-santa[data-state="hiding"] .clgoa-santa__figure { opacity: 0; transform: translateX(0); }
    .clgoa-santa[data-state="hiding"][data-from="peek"] .clgoa-santa__figure { transform: translateX(10%); }
    .clgoa-santa__hand,
    .clgoa-santa.is-rewave .clgoa-santa__hand { animation: none !important; }
    .clgoa-santa.is-sparkling .clgoa-santa__sparkle { animation: none; }
}

@media print {
    .clgoa-santa { display: none !important; }
}
