/* Didactically precise photographic model of the Prague Orloj.
 *
 * React supplies the astronomical state for every moving part. CSS is limited
 * to photographic separation, material treatment and highlighting. The fixed
 * plate, the two moving annuli and the moving hands all come from the same real
 * Orloj raster; there is no synthetic black/schematic dial underneath them.
 */

.orloj-page-backdrop[data-orloj-controlled="true"] .orloj-hour-ring,
.orloj-page-backdrop[data-orloj-controlled="true"] .orloj-zodiac-ring,
.orloj-page-backdrop[data-orloj-controlled="true"] .orloj-sun-hand,
.orloj-page-backdrop[data-orloj-controlled="true"] .orloj-moon-hand,
.orloj-page-backdrop[data-orloj-controlled="true"] .orloj-star-hand,
.orloj-page-backdrop[data-orloj-controlled="true"] .orloj-moon-phase {
  animation: none !important;
}

/* The fixed plate never rotates. */
.orloj-fixed-plate {
  transform: none !important;
}

/* The openings below the two independently moving photographic rings must not
 * fall through to a synthetic dark plate. A heavily softened copy of the real
 * photograph fills those openings. It deliberately suppresses captured sharp
 * ring/hand positions but keeps the actual material and colour field. */
.orloj-underplate {
  background-image: url("/orloj/orloj-zodiac-hires.jpg") !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-size: cover !important;
  filter: blur(18px) saturate(0.88) brightness(0.92) contrast(0.96) !important;
  transform: scale(1.045) !important;
  transform-origin: 50% 50%;
  opacity: 1 !important;
}

/* Seasonal Old-Czech 24-hour ring. Its rotation is aligned with sunset by the
 * astronomical model instead of being a fixed-speed visual effect. */
.orloj-hour-ring {
  display: block !important;
  transform-origin: 50% 51% !important;
  -webkit-mask-image: radial-gradient(
    circle at 50% 51%,
    transparent 0 38.3%,
    #000 39.1% 45.6%,
    transparent 46.4% 100%
  ) !important;
  mask-image: radial-gradient(
    circle at 50% 51%,
    transparent 0 38.3%,
    #000 39.1% 45.6%,
    transparent 46.4% 100%
  ) !important;
  backface-visibility: hidden;
}

/* Eccentric zodiac/ecliptic ring. It is a second, genuinely independent
 * photographic layer. React drives the astronomical transform; CSS only cuts
 * the real ecliptic ring out of the source image. */
.orloj-zodiac-ring {
  display: block !important;
  transform-origin: 50% 54% !important;
  -webkit-mask-image: radial-gradient(
    circle at 50.5% 42.5%,
    transparent 0 17.7%,
    #000 18.5% 32.2%,
    transparent 33% 100%
  ) !important;
  mask-image: radial-gradient(
    circle at 50.5% 42.5%,
    transparent 0 17.7%,
    #000 18.5% 32.2%,
    transparent 33% 100%
  ) !important;
  backface-visibility: hidden;
}

/* V33 photographic hands: the source raster is clipped in SVG around the real
 * photographed Sun, Moon and star hands, then those cut-outs receive their own
 * React transforms. No gold/silver SVG shaft is used in the production model. */
.orloj-photographic-hand-image {
  pointer-events: none;
  image-rendering: auto;
}

.orloj-photographic-hand {
  transform-box: view-box;
  transform-origin: 500px 540px;
  will-change: transform;
}

.orloj-photographic-hand .orloj-photographic-hand-image {
  filter: saturate(1.04) contrast(1.03) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.56));
}

/* Before the sharp moving cut-outs are painted, the source photograph's
 * captured hand positions are locally overwritten by a strongly blurred copy
 * of those same photographic pixels. That removes the obvious doubled-hand
 * impression without inventing a black or synthetic replacement plate. */
.orloj-static-hand-suppression {
  opacity: 0.98;
  pointer-events: none;
}

/* The old broad wash is no longer needed. Keeping the element inert preserves
 * backwards-compatible DOM/CSS contracts while preventing a dark centre. */
.orloj-mechanism-wash {
  background: none !important;
  opacity: 0 !important;
}

.orloj-educational-layer {
  transition: opacity 180ms ease, filter 180ms ease;
}

.orloj-page-backdrop[data-orloj-highlight]:not([data-orloj-highlight="none"])
  .orloj-educational-layer:not(.is-highlighted) {
  opacity: 0.34;
  filter: saturate(0.72) brightness(0.66);
}

.orloj-page-backdrop .orloj-educational-layer.is-highlighted {
  opacity: 1;
  filter:
    saturate(1.18)
    brightness(1.12)
    drop-shadow(0 0 18px rgba(244, 204, 105, 0.74));
}

@media (prefers-reduced-motion: reduce) {
  .orloj-educational-layer {
    transition: none;
  }
}
