/* VivaMedica Weihnachten
   Every rule is scoped to html.vm-xmas / html.vm-xmas-snow. gate.js adds these classes only inside the date window
   (Europe/Berlin), so a page served from cache after the last day shows nothing. */

/* === Logo and snow caps === */

/* the overlay lives inside the logo svg (xmas.js); an svg clips everything outside its viewBox by default */
html.vm-xmas svg[data-vmx] { overflow: visible !important; }
html.vm-xmas svg[data-vmx-tone="light"] .vmx-dark,
html.vm-xmas svg[data-vmx]:not([data-vmx-tone="light"]) .vmx-light { display: none; }

/* new site, header buttons (desktop). The buttons themselves use ::before/::after (hover shutter and circle) and
   overflow: hidden, so the snow sits on the wrappers: .vm-hdr-slot ("Termin buchen", vm.js) and the team button widget. */
html.vm-xmas.vmx-snowy .elementor-location-header .vm-hdr-slot,
html.vm-xmas.vmx-snowy .elementor-location-header .vm-hdr-pair .elementor-widget-button { position: relative; }
html.vm-xmas.vmx-snowy .elementor-location-header .vm-hdr-slot::after,
html.vm-xmas.vmx-snowy .elementor-location-header .vm-hdr-pair .elementor-widget-button::after {
  content: ""; position: absolute; z-index: 3; pointer-events: none;
  top: -5px; left: 10%; right: 10%; height: 13px;
  background: url(snow-strip.svg) no-repeat 0 0 / 100% 100%;
}

/* new site, round header buttons on touch (menu, team): icon widgets except the logo */
html.vm-xmas.vmx-snowy .elementor-location-header .elementor-widget-icon:not(.header-logo-white):not(.header-logo-dark) a.elementor-icon { position: relative; }
html.vm-xmas.vmx-snowy .elementor-location-header .elementor-widget-icon:not(.header-logo-white):not(.header-logo-dark) a.elementor-icon::after {
  content: ""; position: absolute; pointer-events: none;
  left: -10%; top: -16%; width: 120%; height: 70%;
  background: url(snow-round.svg) no-repeat 0 0 / 100% 100%;
}

/* old site and Hadamar: the logo is an image and the link box equals it. Overlay = mark x1.705 around its centre.
   The file follows the style (gate.js: html.vmx-st-<key>); default = hat and snow. */
html.vm-xmas [data-id="6df7d77"] a,
html.vm-xmas [data-id="85427f7"] a { position: relative; display: inline-block; }
html.vm-xmas [data-id="6df7d77"] a::after {
  content: ""; position: absolute; pointer-events: none;
  left: -35.246%; top: -35.227%; width: 170.492%; height: 170.455%;
  background: url(overlay-dark.svg) no-repeat 0 0 / 100% 100%;
}
/* old site footer: white mark at the start of a 613x129 svg (mark 0..178.6 x 0..128.5) on a dark background */
html.vm-xmas [data-id="85427f7"] a::after {
  content: ""; position: absolute; pointer-events: none;
  left: -10.27%; top: -35.25%; width: 49.68%; height: 170.5%;
  background: url(overlay-light.svg) no-repeat 0 0 / 100% 100%;
}
/* Branch chooser page (05.12): the mark sits in a round 400x400 icon (image widget, its box = the image;
   mark box 71..329 x 107..293). Overlay = mark x1.705 around the mark, as on the old site: in % of the icon. 0ce6fdb -
   white mark on dark green (light files), 1860a50 - dark mark on white (dark files). */
html.vm-xmas [data-id="0ce6fdb"]::after,
html.vm-xmas [data-id="1860a50"]::after {
  content: ""; position: absolute; pointer-events: none;
  left: -4.984%; top: 10.369%; width: 109.967%; height: 79.262%;
  background: url(overlay-light.svg) no-repeat 0 0 / 100% 100%;
}
html.vm-xmas [data-id="1860a50"]::after { background-image: url(overlay-dark.svg); }
html.vm-xmas.vmx-st-schnee [data-id="0ce6fdb"]::after,
html.vm-xmas.vmx-st-lichter [data-id="0ce6fdb"]::after { background-image: url(overlay-light-schnee.svg); }
html.vm-xmas.vmx-st-zweig [data-id="0ce6fdb"]::after { background-image: url(overlay-light-zweig.svg); }
html.vm-xmas.vmx-st-sterne [data-id="0ce6fdb"]::after { background-image: url(overlay-light-sterne.svg); }
html.vm-xmas.vmx-st-schnee [data-id="1860a50"]::after,
html.vm-xmas.vmx-st-lichter [data-id="1860a50"]::after { background-image: url(overlay-dark-schnee.svg); }
html.vm-xmas.vmx-st-zweig [data-id="1860a50"]::after { background-image: url(overlay-dark-zweig.svg); }
html.vm-xmas.vmx-st-sterne [data-id="1860a50"]::after { background-image: url(overlay-dark-sterne.svg); }
html.vm-xmas.vmx-st-schnee [data-id="6df7d77"] a::after,
html.vm-xmas.vmx-st-lichter [data-id="6df7d77"] a::after { background-image: url(overlay-dark-schnee.svg); }
html.vm-xmas.vmx-st-zweig [data-id="6df7d77"] a::after { background-image: url(overlay-dark-zweig.svg); }
html.vm-xmas.vmx-st-sterne [data-id="6df7d77"] a::after { background-image: url(overlay-dark-sterne.svg); }
html.vm-xmas.vmx-st-schnee [data-id="85427f7"] a::after,
html.vm-xmas.vmx-st-lichter [data-id="85427f7"] a::after { background-image: url(overlay-light-schnee.svg); }
html.vm-xmas.vmx-st-zweig [data-id="85427f7"] a::after { background-image: url(overlay-light-zweig.svg); }
html.vm-xmas.vmx-st-sterne [data-id="85427f7"] a::after { background-image: url(overlay-light-sterne.svg); }

/* lichter: string of lights under each top-level header block (element built by xmas.js). Tile size from the art
   (art/variants/lichter); the tone follows the logo of the same block (xmas.js), light = white mark over a photo. */
html.vm-xmas .vmx-lights-rel { position: relative; }
html.vm-xmas .vmx-lights {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 5; pointer-events: none;
  height: 18px;
  background: url(lights-dark.svg) repeat-x 0 0 / auto 100%;
}
html.vm-xmas .vmx-lights[data-vmx-tone="light"] { background-image: url(lights-light.svg); }

@media print {
  html.vm-xmas .vmx-g, html.vm-xmas .vmx-lights, html.vm-xmas [data-id="6df7d77"] a::after, html.vm-xmas [data-id="85427f7"] a::after,
  html.vm-xmas [data-id="0ce6fdb"]::after, html.vm-xmas [data-id="1860a50"]::after { display: none !important; }
}



/* === Snowfall: first screen of the front page (elements are built by xmas.js) === */

/* xmas.js adds .vmx-snow-rel only when the host is position:static (checked with getComputedStyle). */
html.vm-xmas-snow .vmx-snow-rel {
  position: relative;
}

html.vm-xmas-snow .vmx-snow {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  overflow: hidden;
  contain: paint;
  background: none;
  pointer-events: none;
  z-index: 0;
}

/* Six-armed crystal in the pale brand green-grey (#b9cbc1). Only transform is animated: no filter, no blur. */
html.vm-xmas-snow .vmx-flake {
  position: absolute;
  top: -20px;
  left: 50%;
  display: block;
  width: 10px;
  height: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='%23b9cbc1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2v20M9 4l3 3 3-3M9 20l3-3 3 3'/%3E%3Cpath d='M12 2v20M9 4l3 3 3-3M9 20l3-3 3 3' transform='rotate(60 12 12)'/%3E%3Cpath d='M12 2v20M9 4l3 3 3-3M9 20l3-3 3 3' transform='rotate(120 12 12)'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  animation: vmx-fall 13s linear infinite;
  will-change: transform;
}

/* Branch chooser tiles (05.12): grey video behind the snow - white crystal with a thin dark halo, readable on the light
   and the dark tile; the pale green-grey of the other sites disappeared there (stand 05.12, 1440). */
html.vm-xmas-snow .vmx-snow-tile .vmx-flake {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-1 -1 26 26'%3E%3Cg fill='none' stroke='rgba(38,56,46,0.38)' stroke-width='3.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2v20M9 4l3 3 3-3M9 20l3-3 3 3'/%3E%3Cpath d='M12 2v20M9 4l3 3 3-3M9 20l3-3 3 3' transform='rotate(60 12 12)'/%3E%3Cpath d='M12 2v20M9 4l3 3 3-3M9 20l3-3 3 3' transform='rotate(120 12 12)'/%3E%3C/g%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2v20M9 4l3 3 3-3M9 20l3-3 3 3'/%3E%3Cpath d='M12 2v20M9 4l3 3 3-3M9 20l3-3 3 3' transform='rotate(60 12 12)'/%3E%3Cpath d='M12 2v20M9 4l3 3 3-3M9 20l3-3 3 3' transform='rotate(120 12 12)'/%3E%3C/g%3E%3C/svg%3E");
}

/* Off-screen / hidden tab (xmas.js) and the calm mode of the animations plugin (html.vm-stop). */
html.vm-xmas-snow .vmx-paused .vmx-flake {
  animation-play-state: paused;
}

html.vm-stop .vmx-flake {
  animation-play-state: paused;
}

/* From -5vh above the host to 110 % of its height (--vmx-fall, px, set by xmas.js on the layer).
   Even vertical speed; sideways drift (--vmx-dx) and spin (--vmx-rot) are per flake. */
@keyframes vmx-fall {
  0% {
    transform: translate3d(0, -5vh, 0) rotate(0deg);
  }
  25% {
    transform: translate3d(calc(var(--vmx-dx, 20px) * .55), calc(var(--vmx-fall, 110vh) * .25 - 3.75vh), 0) rotate(calc(var(--vmx-rot, 180deg) * .25));
  }
  50% {
    transform: translate3d(calc(var(--vmx-dx, 20px) * -.25), calc(var(--vmx-fall, 110vh) * .5 - 2.5vh), 0) rotate(calc(var(--vmx-rot, 180deg) * .5));
  }
  75% {
    transform: translate3d(var(--vmx-dx, 20px), calc(var(--vmx-fall, 110vh) * .75 - 1.25vh), 0) rotate(calc(var(--vmx-rot, 180deg) * .75));
  }
  100% {
    transform: translate3d(calc(var(--vmx-dx, 20px) * .3), var(--vmx-fall, 110vh), 0) rotate(var(--vmx-rot, 180deg));
  }
}

/* Reduced motion: no movement at all, the flakes stay where they are (random --vmx-top per flake). */
@media (prefers-reduced-motion: reduce) {
  html.vm-xmas-snow .vmx-flake {
    top: var(--vmx-top, 30%);
    animation: none;
    will-change: auto;
  }
}
