/* Clock widget: digital, analog, flip and word. Tokens from _shared/embed.css. */

.ck-label {
  font-size: 0.2em;
  margin-bottom: 0.15em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ck-date {
  font-size: 0.19em;
  margin-top: 0.3em;
  font-weight: 500;
}

/* ── Digital ── */

.ck-time {
  display: flex;
  align-items: baseline;
  line-height: 1;
}

.ck-sec {
  font-size: 0.5em;
  margin-left: 0.06em;
  opacity: 0.75;
}

.ck-period {
  font-size: 0.3em;
  margin-left: 0.18em;
  font-weight: 600;
  color: var(--muted);
  text-shadow: none;
  letter-spacing: 0.02em;
}

.ck-colon {
  display: inline-block;
  width: 0.34em;
  text-align: center;
}

.ck-blink .ck-colon {
  animation: ck-blink 1s steps(1, end) infinite;
}

@keyframes ck-blink {
  50% {
    opacity: 0.2;
  }
}

/* ── Analog ── */

.ck-analog {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.ck-analog .ck-label,
.ck-analog .ck-date {
  flex: none;
  font-size: clamp(9px, 6.4vmin, 20px);
  margin: 0;
  line-height: 1.35;
  white-space: nowrap;
}

.ck-face {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  overflow: visible;
}

.ck-rim {
  fill: var(--face);
  stroke: var(--face-line);
  stroke-width: 1.5;
}

.ck-tick {
  stroke: var(--face-line);
  stroke-width: 1.4;
  stroke-linecap: round;
}

.ck-tick-major {
  stroke: var(--fg);
  stroke-width: 3;
}

.ck-dot {
  fill: var(--fg);
}

.ck-num {
  fill: var(--fg);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font);
}

.ck-hand {
  stroke: var(--hand);
  stroke-linecap: round;
  fill: none;
}

.ck-hand-sec {
  stroke: var(--accent);
}

.ck-cap {
  fill: var(--accent);
}

.ck-cap-inner {
  fill: var(--face-line);
}

:root[data-style="neon"] .ck-hand,
:root[data-style="neon"] .ck-tick-major,
:root[data-style="neon"] .ck-num {
  filter: drop-shadow(0 0 2.5px color-mix(in srgb, var(--accent) 70%, transparent));
}

:root[data-style="neon"] .ck-tick-major,
:root[data-style="neon"] .ck-dot {
  stroke: var(--accent);
  fill: var(--accent);
}

:root[data-style="neon"] .ck-num {
  fill: var(--accent);
}

:root[data-style="paper"] .ck-rim {
  stroke-width: 2.5;
}

:root[data-style="retro"] .ck-rim {
  stroke-width: 4;
}

/* ── Flip ── */

.ck-flip-row {
  display: flex;
  align-items: center;
  gap: 0.08em;
}

.flip {
  position: relative;
  display: inline-block;
  width: 1.32em;
  height: 1.24em;
  border-radius: 0.12em;
  background: var(--card-bg);
  color: var(--card-fg);
  font-weight: 700;
  perspective: 4em;
  box-shadow: 0 0.04em 0.1em rgba(0, 0, 0, 0.12);
}

:root[data-style="neon"] .flip,
:root[data-style="retro"][data-scheme="dark"] .flip {
  text-shadow: var(--big-shadow);
}

.flip-half {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  overflow: hidden;
  background: var(--card-bg);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.flip-top {
  top: 0;
  border-radius: 0.12em 0.12em 0 0;
}

.flip-bottom {
  bottom: 0;
  border-radius: 0 0 0.12em 0.12em;
}

.flip-t {
  position: absolute;
  left: 0;
  right: 0;
  height: 1.24em;
  line-height: 1.24em;
  text-align: center;
  letter-spacing: -0.02em;
}

.flip-top .flip-t {
  top: 0;
}

.flip-bottom .flip-t {
  bottom: 0;
}

.flip::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% - 0.012em);
  height: 0.024em;
  background: var(--card-line);
  z-index: 3;
}

.flip-leaf-top {
  z-index: 2;
  transform-origin: 50% 100%;
}

.flip-leaf-bottom {
  z-index: 2;
  transform-origin: 50% 0;
  transform: rotateX(90deg);
}

.flip.go .flip-leaf-top {
  animation: flip-down 0.28s ease-in forwards;
}

.flip.go .flip-leaf-bottom {
  animation: flip-up 0.28s ease-out 0.28s forwards;
}

@keyframes flip-down {
  to {
    transform: rotateX(-90deg);
  }
}

@keyframes flip-up {
  from {
    transform: rotateX(90deg);
  }
  to {
    transform: rotateX(0deg);
  }
}

.ck-flip-sep {
  color: var(--muted);
  font-weight: 700;
  width: 0.28em;
  text-align: center;
}

.ck-flip-sec {
  font-size: 0.62em;
}

.ck-flip .ck-period {
  align-self: flex-end;
  margin-left: 0.12em;
}

/* ── Word ── */

.ck-words {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  text-align: center;
}

.ck-sentence {
  max-width: 100%;
  padding: 0 0.2em;
  line-height: 1.12;
  white-space: normal;
}

.ck-sentence .ck-hl {
  color: var(--accent);
}

:root[data-style="neon"] .ck-sentence .ck-hl,
:root[data-style="retro"][data-scheme="dark"] .ck-sentence .ck-hl {
  text-shadow: var(--big-shadow);
}

.ck-grid {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 0.18em 0.36em;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  font-variant-numeric: normal;
}

.ck-cell {
  color: var(--faint);
  transition: color 0.4s ease, text-shadow 0.4s ease;
}

.ck-cell.on {
  color: var(--big);
  text-shadow: var(--big-shadow);
}

.ck-dots {
  display: flex;
  justify-content: center;
  gap: 0.5em;
  margin-top: 0.55em;
}

.ck-dots i {
  width: 0.32em;
  height: 0.32em;
  border-radius: 50%;
  background: var(--faint);
}

.ck-dots i.on {
  background: var(--accent);
}

.ck-words-fit .ck-date,
.ck-words-fit .ck-label {
  font-size: 0.5em;
}

.ck-words-stage {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  overflow: hidden;
}

.ck-words > .ck-label,
.ck-words > .ck-date {
  flex: none;
  margin: 0;
  font-size: clamp(9px, 6vmin, 20px);
  line-height: 1.35;
  white-space: nowrap;
}

.ck-words > .ck-dots {
  flex: none;
  font-size: clamp(8px, 5vmin, 18px);
  margin: 0.35em 0 0.2em;
}
