/* =============================================================
   יומיומי · ZMANIM — ONE compact dense grid, color-coded by category
   (replaces the old long colored columns)
   ============================================================= */

/* category colors */
.zg-cell[data-cat="dawn"],   .zg-leg[data-cat="dawn"]   { --sc: #ffb84d; }
.zg-cell[data-cat="shma"],   .zg-leg[data-cat="shma"]   { --sc: #ffd24a; }
.zg-cell[data-cat="noon"],   .zg-leg[data-cat="noon"]   { --sc: #cfd6e6; }
.zg-cell[data-cat="mincha"], .zg-leg[data-cat="mincha"] { --sc: #c08bff; }
.zg-cell[data-cat="sunset"], .zg-leg[data-cat="sunset"] { --sc: #ff7aa0; }
.zg-cell[data-cat="night"],  .zg-leg[data-cat="night"]  { --sc: #7aa2ff; }
.zg-cell[data-cat="shabbat"],.zg-leg[data-cat="shabbat"]{ --sc: #f0c668; }

/* ---- compact legend ---- */
.zg-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--c-border);
}
.zg-leg {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--c-text-3);
  letter-spacing: 0.02em;
}
.zg-leg i {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--sc);
  box-shadow: 0 0 7px color-mix(in srgb, var(--sc) 55%, transparent);
}

/* ---- ONE dense grid — small cells that fill the width ---- */
.zg-flat {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 0.5rem;
}
.zg-cell {
  position: relative;
  padding: 0.55rem 0.6rem 0.6rem;
  background: rgba(255,255,255,0.022);
  border: 1px solid var(--c-border);
  border-top: 2px solid color-mix(in srgb, var(--sc) 70%, transparent);
  border-radius: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition: background 180ms ease, transform 180ms ease, border-color 180ms ease;
}
.zg-cell:hover {
  transform: translateY(-2px);
  background: color-mix(in srgb, var(--sc) 9%, transparent);
  border-color: color-mix(in srgb, var(--sc) 45%, transparent);
  border-top-color: var(--sc);
}
.zg-name {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--c-text-3);
  line-height: 1.25;
  min-height: 1.8em;
  display: flex;
  align-items: center;
  justify-content: center;
}
.zg-time {
  font-family: var(--f-mono);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--sc);
  direction: ltr;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* shabbat/chag — slightly bigger emphasis */
.zg-cell.zg-strong {
  background: color-mix(in srgb, var(--gold) 12%, transparent);
  border-color: color-mix(in srgb, var(--gold) 35%, transparent);
  border-top-color: var(--gold);
}
.zg-cell.zg-strong .zg-time { color: var(--gold-light); font-size: 1.3rem; }

@media (max-width: 520px) {
  .zg-flat { grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); }
  .zg-time { font-size: 1rem; }
}

/* =============================================================
   "בעיתה אחישנה" — the big, living countdown to the 6th millennium
   Overrides the smaller defaults from redesign.css / components.
   ============================================================= */
.card-sixth-mil.sm-featured { padding: clamp(1.4rem, 3vw, 2.6rem); }
.card-sixth-mil.sm-featured .card-head { position: relative; z-index: 1; }

.sm-live {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--f-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-light);
  background: rgba(212,168,67,0.1);
  border: 1px solid rgba(212,168,67,0.35);
  padding: 0.3rem 0.7rem;
  border-radius: var(--r-pill);
}
.sm-live-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--rgb-r, #ff3b6b);
  box-shadow: 0 0 0 0 rgba(255,59,107,0.6);
  animation: sm-live-blink 1.6s ease-in-out infinite;
}
@keyframes sm-live-blink {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,59,107,0.55); opacity: 1; }
  50%      { box-shadow: 0 0 0 7px rgba(255,59,107,0); opacity: 0.55; }
}

.card-sixth-mil.sm-featured .sm-timer {
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(0.5rem, 1.4vw, 1.1rem);
  margin: clamp(1.2rem, 2.5vw, 1.8rem) 0 0;
}
.card-sixth-mil.sm-featured .sm-unit {
  padding: clamp(1rem, 2.4vw, 1.6rem) 0.5rem clamp(0.75rem, 1.6vw, 1rem);
  background: linear-gradient(180deg, rgba(212,168,67,0.14), rgba(212,168,67,0.02));
  border: 1px solid rgba(212,168,67,0.28);
  border-radius: 16px;
  gap: 0.55rem;
}
.card-sixth-mil.sm-featured .sm-num {
  font-size: clamp(2.1rem, 6vw, 4rem);
  font-weight: 900;
  color: var(--gold-light);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  text-shadow: 0 0 30px var(--gold-glow);
  display: inline-block;
  animation: none;
}
.card-sixth-mil.sm-featured .sm-lbl {
  font-size: clamp(0.66rem, 1.4vw, 0.82rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--c-text-2);
}

/* seconds cell — accented + clearly the "ticking" one */
.card-sixth-mil.sm-featured .sm-unit-sec {
  background: linear-gradient(180deg, rgba(255,59,107,0.16), rgba(255,59,107,0.03));
  border-color: rgba(255,122,160,0.4);
}
.card-sixth-mil.sm-featured .sm-unit-sec .sm-num {
  color: #ff9bb6;
  text-shadow: 0 0 30px rgba(255,59,107,0.5);
}

/* per-tick animations driven by JS (sm-bump on change, sm-pulse on every sec) */
.sm-num.sm-bump { animation: sm-bump 420ms var(--ease-spring, cubic-bezier(0.34,1.56,0.64,1)); }
.sm-num.sm-pulse { animation: sm-pulse 1s ease-out; }
@keyframes sm-bump {
  0%   { transform: translateY(-0.12em) scale(1.12); filter: brightness(1.4); }
  100% { transform: translateY(0) scale(1); filter: brightness(1); }
}
@keyframes sm-pulse {
  0%   { transform: scale(1.14); opacity: 0.65; }
  100% { transform: scale(1); opacity: 1; }
}

.card-sixth-mil.sm-featured .sm-target {
  margin-top: clamp(1rem, 2vw, 1.5rem);
  font-size: clamp(0.9rem, 1.8vw, 1.1rem);
  font-weight: 700;
  color: var(--gold-light);
}
.card-sixth-mil.sm-featured .sm-note {
  font-size: clamp(1rem, 2vw, 1.25rem);
}

@media (max-width: 700px) {
  .card-sixth-mil.sm-featured .sm-timer { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .sm-num.sm-bump, .sm-num.sm-pulse, .sm-live-dot { animation: none; }
}
