/* Exam updates + India date and time (IST), for the homepage and updates.html.
   The news itself is in data/updates.json (see the note at the top of updates.js for how to add one).
   Colours come from style.css (--ink, --muted, --line, --surface, --accent, --ex-cet / -jee / -neet / -hsc). */

:root { --up-card: #fff; --up-edge: #e6e6eb; --up-live: #e5484d; }
:root[data-theme="dark"] { --up-card: #2f2d35; --up-edge: #3a3742; --up-live: #ff6b6f; }

/* ---------- The date / time strip under the homepage top bar ---------- */
.live-strip { background: #f3f1fb; border-bottom: 1px solid #e6e2f5; color: #2a2540; font-size: 13.5px; }
:root[data-theme="dark"] .live-strip { background: #1f1c2b; border-color: #2d2940; color: #e9e6f5; }
.ls-row { display: flex; align-items: center; gap: 14px; max-width: 1024px; min-height: 38px; margin: 0 auto; padding: 0 22px; }
.ist-clock { display: inline-flex; align-items: center; gap: 7px; flex: none; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ist-clock svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .75; }
.ist-clock .ck-date { font-weight: 600; }
.ist-clock .ck-time { font-weight: 700; }
.ist-clock .ck-zone { color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .04em; }
.ls-sep { width: 1px; height: 18px; flex: none; background: currentColor; opacity: .18; }
.ls-news { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.ls-live { display: inline-flex; align-items: center; gap: 5px; flex: none; color: var(--up-live); font-size: 11.5px; font-weight: 800; letter-spacing: .06em; }
.ls-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: up-pulse 1.6s ease-in-out infinite; }
@keyframes up-pulse { 50% { opacity: .3; } }
.ls-win { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; -webkit-mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 24px), transparent); }
.ls-track { display: inline-block; padding-left: 12px; animation: up-tick var(--tick-s, 40s) linear infinite; }
.ls-news:hover .ls-track, .ls-news:focus-visible .ls-track { animation-play-state: paused; }
.ls-item { margin-right: 34px; }
.ls-item b { margin-right: 6px; font-size: 11.5px; letter-spacing: .03em; }
@keyframes up-tick { to { transform: translateX(-50%); } }
.ls-all { flex: none; color: var(--accent); font-weight: 700; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  .ls-track { animation: none; }
  .ls-live::before { animation: none; }
}
@media (max-width: 734px) {
  .ls-row { gap: 10px; padding: 0 14px; font-size: 12.5px; }
  .ist-clock .ck-wd, .ist-clock .ck-yr, .ist-clock svg { display: none; }
  .ls-all { display: none; }
}
@media (max-width: 400px) { .ls-live { font-size: 0; gap: 0; } }

/* ---------- Exam colours (tag → --c). CET / JEE / NEET / HSC use the site's exam colours from style.css ---------- */
.t-cet { --c: var(--ex-cet, #1a63c4); --cf: var(--ex-cet-fill, #1a63c4); }
.t-jee { --c: var(--ex-jee, #b4500f); --cf: var(--ex-jee-fill, #b84f14); }
.t-neet { --c: var(--ex-neet, #17804a); --cf: var(--ex-neet-fill, #1b7a4a); }
.t-hsc { --c: var(--ex-hsc, #a8256a); --cf: var(--ex-hsc-fill, #a8256a); }
.t-cbse { --c: #0b6e7a; --cf: #0b6e7a; }
.t-bitsat, .t-viteee, .t-comedk, .t-met, .t-srmjeee { --c: #3f51b5; --cf: #3f51b5; }
.t-cuet, .t-iat, .t-nest { --c: #6a3fd1; --cf: #6a3fd1; }
.t-nda { --c: #5b6b2a; --cf: #55652a; }
:root[data-theme="dark"] .t-cbse { --c: #5fd0dc; }
:root[data-theme="dark"] :is(.t-bitsat, .t-viteee, .t-comedk, .t-met, .t-srmjeee) { --c: #9aa8ff; }
:root[data-theme="dark"] :is(.t-cuet, .t-iat, .t-nest) { --c: #b9a3ff; }
:root[data-theme="dark"] .t-nda { --c: #c3d28a; }
.up-tag { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--cf, #6a3fd1); color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .04em; line-height: 1.5; }
.ls-item b { color: var(--c); }

/* ---------- Countdown cards ---------- */
.up-count { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 0 0 18px; }
.uc { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 14px; background: var(--up-card); border: 1px solid var(--up-edge); border-radius: 16px; color: var(--ink); text-decoration: none; }
a.uc:hover { box-shadow: 0 8px 20px rgba(91, 42, 157, .08); }
.uc-name { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; line-height: 1.3; }
.uc-name::before { content: ""; flex: none; width: 9px; height: 9px; border-radius: 3px; background: var(--c); }
.uc-days { color: var(--c); font-size: 30px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.uc-days small { margin-left: 4px; font-size: 13px; font-weight: 700; }
.uc-days.na { font-size: 15px; line-height: 1.35; padding: 6px 0 4px; }
.uc-when { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
#up-count[data-home] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { #up-count[data-home] { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .up-count { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.uc[hidden], .up-item[hidden] { display: none; }
@media (max-width: 734px) { .uc { padding: 12px; } .uc-days { font-size: 26px; } }

/* ---------- News list ---------- */
.up-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.up-item { padding: 14px 16px; background: var(--up-card); border: 1px solid var(--up-edge); border-radius: 16px; }
.up-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; color: var(--muted); font-size: 12.5px; }
.up-new { color: var(--up-live); font-size: 11px; font-weight: 800; letter-spacing: .05em; }
.up-item h3 { margin: 0; color: var(--ink); font-size: 16.5px; line-height: 1.35; letter-spacing: -0.01em; }
.up-item p { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.up-src { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; color: var(--accent); font-size: 13.5px; font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.up-src:hover { text-decoration: underline; }
.up-page-link { margin-left: 16px; }
@media (max-width: 480px) { .up-page-link { display: flex; margin-left: 0; margin-top: 6px; } }
.up-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; color: var(--muted); font-size: 13px; }
.up-more { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 980px; background: var(--accent-fill, #6a3fd1); color: #fff; font-size: 14.5px; font-weight: 600; text-decoration: none; }
.up-more:hover { filter: brightness(1.08); }
.up-empty { padding: 14px 16px; color: var(--muted); }

/* homepage section heading: clock on the right of the title */
.up-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 6px 16px; }
.up-head .ist-clock { margin-bottom: 2px; padding: 6px 12px; border-radius: 980px; background: var(--up-card); border: 1px solid var(--up-edge); color: var(--ink); font-size: 13.5px; }
@media (max-width: 734px) { .up-head .ist-clock { margin-left: 12px; } }

/* ---------- updates.html ---------- */
.up-page .up-clockbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0 0; }
.up-page .up-clockbar .ist-clock { padding: 8px 14px; border-radius: 980px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; }
.up-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.up-filter button { min-height: 40px; padding: 0 16px; border: 1px solid var(--line-strong, #86868b); border-radius: 980px; background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.up-filter button[aria-pressed="true"] { background: var(--accent-fill, #6a3fd1); border-color: transparent; color: #fff; }
.up-page h2.up-h { margin: 26px 0 12px; font-size: 21px; letter-spacing: -0.01em; }
.up-page .up-item, .up-page .uc { background: var(--surface); border-color: var(--line); }
.up-page .up-note { margin-top: 20px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.up-page .up-pop { margin: 18px 0 0; padding: 12px 16px; border-radius: 14px; background: var(--accent-soft); font-size: 15px; font-weight: 600; }
.up-page .up-pop a { color: var(--accent); }
