/* ==========================================================================
   Aktuálně na obloze — page styles (loads after styles.css, shares its tokens)
   ========================================================================== */
/* The menu marks this page (Site.astro, current="/aktualne-na-obloze/"), as the other sections do. */
.site-nav__list a[aria-current="page"] { color: var(--teal-300); text-decoration: underline; text-underline-offset: 7px; }

:root {
  /* Chart marks, validated against the navy surface (OKLCH band, chroma, CVD, contrast) */
  --obj-bar: #1f9fa4;       /* object above horizon */
  --moon-bar: #b48c38;      /* Moon above horizon, warm gold */
  --warn: #f2b84b;          /* status: unconfirmed estimate */
  --warn-ink: #7a4b00;
  --warn-bg: #fff4dd;
}

/* --- Page head on the navy sky ------------------------------------------- */
.page-head { padding-block: clamp(32px, 5vw, 56px) clamp(40px, 6vw, 72px); }
.page-head__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(24px, 4vw, 64px);
  align-items: end;
}
.page-head h1 {
  font-size: clamp(2rem, 1.3rem + 2.2vw, 3rem);
  line-height: 1.06;
  letter-spacing: -.02em;
  color: #fff;
}
.page-head__lede {
  margin-top: 16px;
  max-width: 40rem;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--on-dark-2);
}
.page-head__aside { display: grid; gap: 10px; justify-items: end; }
.page-head__updated { font-size: .8125rem; color: var(--on-dark-3); font-variant-numeric: tabular-nums; }

.night-switch {
  display: inline-flex;
  padding: 4px;
  border: 1px solid rgba(127, 224, 227, .22);
  border-radius: 14px;
  background: rgba(7, 24, 41, .6);
}
.night-switch__btn {
  display: grid;
  gap: 2px;
  padding: 8px 18px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--on-dark-2);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.night-switch__btn span { font-size: .75rem; }
.night-switch__btn strong { font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.night-switch__btn:hover { color: #fff; }
.night-switch__btn[aria-pressed="true"] {
  background: var(--teal-400);
  color: var(--navy-900);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}

/* --- Sheet adjustments ---------------------------------------------------- */
.sheet--page { padding-top: 0; }
.section--page-first { padding-top: clamp(40px, 6vw, 64px); }
.section__head--wrap { flex-wrap: wrap; align-items: flex-end; }
.section__sub {
  margin-top: 8px;
  max-width: 60ch;
  font-size: .9375rem;
  line-height: 1.55;
  color: var(--ink-2);
}

/* --- Night timeline ------------------------------------------------------- */
.tl {
  --tl-label: 240px;
  --tl-row: 34px;
  position: relative;
  padding: 18px 22px 20px;
  background: var(--navy-900);
  color: var(--on-dark);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-card);
}
.tl__row {
  display: grid;
  grid-template-columns: var(--tl-label) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: var(--tl-row);
}
.tl__row--axis { min-height: 26px; margin-bottom: 6px; }
.tl__group {
  margin: 14px 0 4px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--on-dark-line);
  font-size: .8125rem;
  font-weight: 700;
  color: var(--on-dark-3);
}
.tl__group small { font-weight: 400; margin-left: 6px; }
.tl__label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  font-size: .9375rem;
  font-weight: 600;
  color: #fff;
}
.tl__label > span { min-width: 0; overflow-wrap: anywhere; display: inline-flex; align-items: center; gap: 6px; }
.tl__label small { font-weight: 400; font-size: .8125rem; color: var(--on-dark-3); white-space: nowrap; font-variant-numeric: tabular-nums; }

.tl__axis { position: relative; height: 26px; font-size: .75rem; color: var(--on-dark-3); font-variant-numeric: tabular-nums; }
.tl__axis span { position: absolute; top: 4px; transform: translateX(-50%); }

/* The track carries the twilight bands and hour gridlines as backgrounds. */
.tl__track {
  position: relative;
  height: 24px;
  border-radius: 4px;
  background-image:
    repeating-linear-gradient(90deg, rgba(226, 235, 245, .14) 0 1px, transparent 1px 13.3333%),
    var(--night-bands);
  background-position: 6.6667% 0, 0 0;
  background-size: calc(100% + 1px) 100%, 100% 100%;
}
.tl__bar {
  position: absolute;
  top: 50%;
  height: 10px;
  transform: translateY(-50%);
  border-radius: 5px;
  --bar-color: var(--obj-bar);             /* the open-end fades below reuse it, so a moon bar stays gold */
  background: var(--bar-color);
  box-shadow: 0 0 0 2px var(--navy-900);   /* surface ring: separates the bar from any band */
  cursor: default;
  transition: filter .15s, height .15s;
}
.tl__bar--moon { --bar-color: var(--moon-bar); }
.tl__bar--open-l { border-radius: 0 5px 5px 0; background: linear-gradient(90deg, transparent, var(--bar-color) 40px); }
.tl__bar--open-r { border-radius: 5px 0 0 5px; background: linear-gradient(90deg, var(--bar-color) calc(100% - 40px), transparent); }
.tl__bar--open-l.tl__bar--open-r { border-radius: 0; background: linear-gradient(90deg, transparent, var(--bar-color) 40px, var(--bar-color) calc(100% - 40px), transparent); }
.tl__bar:hover, .tl__bar:focus-visible { filter: brightness(1.15); height: 14px; outline: none; }
.tl__bar:focus-visible { box-shadow: 0 0 0 2px var(--navy-900), 0 0 0 4px #fff; }
.tl__dot {
  position: absolute;
  top: 50%;
  width: 10px; height: 10px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px var(--navy-900);
  pointer-events: none;
}
.tl__tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 5;
  transform: translateX(-50%);
  min-width: 220px;
  max-width: 320px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: .8125rem;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2), 0 16px 40px -12px rgba(0, 0, 0, .5);
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s, visibility .15s;
}
.tl__tip strong { display: block; margin-bottom: 2px; color: var(--navy-900); }
.tl__tip::after {
  content: "";
  position: absolute;
  left: 50%; top: 100%;
  border: 6px solid transparent;
  border-top-color: #fff;
  transform: translateX(-50%);
}
.tl__bar:hover .tl__tip, .tl__bar:focus-visible .tl__tip { opacity: 1; visibility: visible; }
/* keep tooltips inside the panel near its edges */
.tl__bar[style*="left:0"] .tl__tip, .tl__bar[style*="left:0.00%"] .tl__tip { left: 0; transform: none; }
.tl__bar[style*="left:0"] .tl__tip::after, .tl__bar[style*="left:0.00%"] .tl__tip::after { left: 24px; }

.warn-mark { display: inline-flex; color: var(--warn); }
.warn-mark svg { width: 14px; height: 14px; }

.tl-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: .8125rem;
  color: var(--ink-2);
}
.tl-legend li { display: inline-flex; align-items: center; gap: 8px; }
.tl-legend i { display: inline-block; width: 22px; height: 10px; border-radius: 5px; }
.tl-legend__bands { background: linear-gradient(90deg, #4d8fba, #071829); border-radius: 2px !important; }
.tl-legend__moon { background: var(--moon-bar); }
.tl-legend__obj { background: var(--obj-bar); }
.tl-legend__dot { width: 10px !important; height: 10px !important; border-radius: 50% !important; background: #fff; box-shadow: 0 0 0 2px var(--navy-900); }

/* --- Sun & Moon strip ----------------------------------------------------- */
.sunmoon {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 48px);
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.sunmoon h3 { font-size: 1.125rem; margin-bottom: 12px; }
.facts { margin: 0; display: flex; flex-wrap: wrap; gap: 8px 28px; }
.facts > div { display: grid; gap: 2px; }
.facts dt { font-size: .8125rem; color: var(--ink-3); }
.facts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.facts--grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
.twilight {
  width: 100%;
  margin-top: 14px;
  border-collapse: collapse;
  font-size: .875rem;
  font-variant-numeric: tabular-nums;
}
.twilight th, .twilight td { padding: 7px 10px; border-top: 1px solid var(--line); text-align: left; }
.twilight thead th { border-top: 0; padding-top: 0; font-size: .75rem; font-weight: 600; color: var(--ink-3); }
.twilight tbody th { font-weight: 600; color: var(--ink); }
.twilight td { color: var(--ink-2); }
.sunmoon__moonrow { display: flex; gap: 18px; align-items: flex-start; }
.moon--lg { width: 64px; height: 64px; flex: none; }
.moon--lg .moon__disc { fill: var(--navy-800); stroke: var(--line-strong); }
.moon--lg .moon__lit { fill: #fff; stroke: var(--line-strong); stroke-width: .5; }
.sunmoon__phase { font-weight: 600; margin-bottom: 10px; }

/* --- Comets table --------------------------------------------------------- */
.comets {
  width: 100%;
  margin-top: 24px;
  border-collapse: collapse;
  font-size: .9375rem;
  background: var(--paper);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.comets th, .comets td { padding: 14px 14px; vertical-align: top; text-align: left; border-top: 1px solid var(--line); }
.comets thead th {
  border-top: 0;
  padding: 12px 14px;
  background: var(--paper-2);
  font-size: .75rem;
  font-weight: 700;
  color: var(--ink-3);
  white-space: nowrap;
}
.comets tbody th { font-weight: 600; }
/* The row carries the tint, never its cells: on a phone the cells sit apart in a grid and would read as boxes.
   Hover only where a pointer can leave again; a tap leaves it stuck on a touch screen. */
@media (hover: hover) { .comets tbody tr:hover { background: #f8fafc; } }
/* A link from an article or the statistics (#kometa-10p) lands on the comet's row and marks it. */
.comets tbody tr { scroll-margin-top: 24px; }
.comets tbody tr:target { background: rgba(55, 198, 203, .14); }
.comet-name { font-size: 1.0625rem; color: var(--ink); }
.comets .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mag { font-weight: 700; font-size: 1.0625rem; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.src { display: block; margin-top: 2px; font-size: .75rem; color: var(--ink-3); }
.src--cat { color: var(--warn-ink); font-weight: 600; }
.src--cat { display: flex; align-items: center; gap: 4px; }
.src--cat .warn-mark svg { width: 13px; height: 13px; }
.comets__legend { margin-top: 14px; max-width: 72ch; font-size: .8125rem; line-height: 1.5; }
.muted { color: var(--ink-3); font-size: .875rem; }
.chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--teal-700);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s, border-color .2s;
}
.chip:hover { background: var(--paper-2); border-color: var(--teal-700); text-decoration: none; }
/* „Mapka“ + „PDF“ side by side (comet table, shower card head) */
.chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.shower__head .chips { flex: none; justify-content: flex-end; }
.comets .chips { flex-direction: column; align-items: stretch; }
.comets .chip { justify-content: center; }
.note { margin-top: 6px; font-size: .8125rem; font-weight: 400; color: var(--ink-2); max-width: 36rem; }
.note--warn {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.note--warn svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--warn); }
.note--warn strong { color: var(--warn-ink); }

/* --- Meteor showers (design B: strength first) ------------------------- */
.showers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 24px;
}
.shower {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 20px 22px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--paper);
  box-shadow: var(--shadow-card);
}
.shower__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.shower h3 { font-size: 1.1875rem; min-width: 0; }
.shower__code { font-family: var(--font-body); font-size: .8125rem; font-weight: 600; color: var(--ink-3); margin-left: 4px; white-space: nowrap; }
.chips--stack { flex-direction: column; align-items: stretch; }
.chips--stack .chip { justify-content: center; }
.shower__badge {
  margin: -6px 0 0;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .8125rem;
  font-weight: 600;
}
.shower__badge--soon { background: #e0f4f4; color: var(--teal-700); }
.shower__badge--now { background: var(--teal-700); color: #fff; }
.shower__badge--past { background: var(--paper-2); color: var(--ink-3); border: 1px solid var(--line); }
.shower__strength {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: end;
  padding: 14px 0;
  border-block: 1px solid var(--line);
}
.shower__zhr { margin: 0; display: grid; }
.shower__zhr-num { font-family: var(--font-display); font-size: 2.75rem; font-weight: 700; line-height: .9; font-variant-numeric: tabular-nums; }
.shower__zhr-unit { margin-top: 6px; font-size: .6875rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.shower__level p { margin: 0 0 6px; font-size: .875rem; font-weight: 600; color: var(--ink-2); }
.meter { display: flex; gap: 3px; }
.meter i { flex: 1; height: 8px; border-radius: 2px; background: var(--line); }
.meter i.on { background: var(--teal-400); }
.meter__scale { display: flex; justify-content: space-between; margin-top: 3px; font-size: .6875rem; color: var(--ink-3); }
.period {
  position: relative;
  height: 8px;
  margin: 7px 0 0;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--paper-2), var(--line));
  border: 1px solid var(--line);
}
.period__max, .period__today { position: absolute; top: 50%; transform: translate(-50%, -50%); }
.period__max { width: 14px; height: 14px; border-radius: 50%; background: var(--teal-400); box-shadow: 0 0 0 2px #fff; }
.period__today { width: 2px; height: 22px; background: var(--navy-900); border-radius: 1px; }
.period__dates { display: flex; justify-content: space-between; gap: 8px; margin-top: 9px; font-size: .75rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.shower__radiant { margin: 0; font-size: .875rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.shower__foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin: 0; font-size: .8125rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* --- About data ----------------------------------------------------------- */
.section--about-data { padding-block: clamp(32px, 5vw, 48px) clamp(48px, 7vw, 72px); border-top: 1px solid var(--line); }
.about-data h2 { font-size: 1.125rem; margin-bottom: 10px; }
.about-data p { max-width: 70ch; font-size: .875rem; line-height: 1.6; color: var(--ink-2); }

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 1100px) {
  .page-head__grid { grid-template-columns: 1fr; align-items: start; }
  .page-head__aside { justify-items: start; }
  .showers { grid-template-columns: 1fr 1fr; }
  .tl { --tl-label: 200px; }
}

@media (max-width: 820px) {
  .comets, .comets thead, .comets tbody, .comets tr, .comets th, .comets td { display: block; }
  .comets thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  /* Each comet becomes a card with a two-column fact grid */
  .comets tr { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; padding: 16px; border-top: 1px solid var(--line); }
  .comets tbody tr:first-child { border-top: 0; }
  .comets th, .comets td { padding: 0; border: 0; }
  .comets tbody th { grid-column: 1 / -1; padding-bottom: 2px; }
  .comets td::before { content: attr(data-label); display: block; font-size: .75rem; color: var(--ink-3); }
  .comets td[data-label="Mapka"]::before { display: none; }
  .comets td[data-label="Mapka"] { grid-column: 1 / -1; padding-top: 4px; }
  .comets td.comets__nomap { display: none; }
  .comets .chips { flex-direction: row; }
  .comets td[data-label="Východ · kulminace · západ"] { grid-column: 1 / -1; }
  .comets .num { white-space: normal; }
  .sunmoon { grid-template-columns: 1fr; }
  .showers { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  /* The tooltip spans the whole track (--bar-l/--bar-w come from the bar's inline style), so a hidden tip near
     the right edge adds no page width on phones and tablets; the arrow points at the bar's middle. */
  .tl__tip, .tl__bar[style*="left:0"] .tl__tip {
    left: calc(var(--bar-l, 0) / var(--bar-w, 100) * -100%);
    width: calc(100% * 100 / var(--bar-w, 100));
    min-width: 0; max-width: none;
    transform: none;
  }
  .tl__tip::after, .tl__bar[style*="left:0"] .tl__tip::after { left: calc((var(--bar-l, 0) + var(--bar-w, 100) / 2) * 1%); }
}

@media (max-width: 640px) {
  .tl { --tl-row: 52px; padding: 14px 14px 16px; }
  .tl__row { grid-template-columns: 1fr; gap: 4px; align-items: stretch; }
  .tl__row--axis { min-height: 22px; }
  .tl__row--axis .tl__label { display: none; }
  .tl__label { font-size: .875rem; }
  .night-switch { width: 100%; }
  .night-switch__btn { flex: 1; }
  .facts--grid { grid-template-columns: 1fr; }
}

/* --- Near-Earth asteroids (reuse the .comets table) ------------------------ */
.asteroids__notes { max-width: 15rem; line-height: 1.45; }
.asteroids__notes a { color: var(--teal-700); }
.asteroids__name { display: inline-block; min-width: 12rem; }
@media (min-width: 821px) { .asteroids th, .asteroids td { padding-left: 7px; padding-right: 7px; } .asteroids .muted { font-size: .8125rem; } }
