/* ══════════════════════════════════════════════════════════════════════════
   "עדכוני {maker}" / "עדכוני {maker} {model}" — the updates feed shared by
   model.php AND maker.php (includes/updates_view.php; $updatesCtx: 'model' |
   'maker'). Replaces the main column only for the /{maker}/{model}/updates[/{n}]
   and /{maker}/updates[/{n}] routes; header/breadcrumb/quick-actions/sidebar
   are unaffected either way. The identity heading above the feed reuses each
   page's OWN hero classes as-is (model: .cl2-md-hero-*, assets/ui-v2/model.css;
   maker: .cl2-maker-hero-*, assets/ui-v2/maker.css) — no heading styles here.
   Everything below the hero (calendar, feed, pager) is 100% visual-language-
   identical between the two contexts: clean vertical list, compact calendar-
   style date block per entry, subtle separators, no cards/shadows, full main-
   column width. Originally model.php-only CSS (assets/ui-v2/model.css); moved
   here unchanged when the maker updates page was added, so both pages load ONE
   copy instead of duplicating ~380 lines.
   ══════════════════════════════════════════════════════════════════════════ */
/* Single wrapper carries the horizontal gutter for everything below the hero
   (calendar + feed + pager) — the SAME --ms-5 gutter .panel-body/.panel-head
   use elsewhere in this shell, so the sidebar divider gets matching breathing
   room without adding a margin to every item. */
.cl2-md-upd-body-wrap {
  padding: 0 var(--ms-5) var(--ms-6);
}

/* 3-year monthly deliveries calendar — reads from the SAME durable-report source as the
   feed below it (cl_delivery_monthly_calendar()/_maker(), db/update_arch/lib/update_report.php).
   Three INDEPENDENT card panels (own border/radius each, gap between — not one shared
   bordered table split into columns); each panel's 12 months are a compact tile grid,
   not a list of rows. Long, thin rail buttons flank the cards, outside them. */
.cl2-md-cal {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "fwd panels back";
  align-items: stretch;
  gap: 10px;
  margin: 20px 0 8px;
}

.cl2-md-cal-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}

/* Newer years → the reading-start side (right in RTL); older years → the reading-end
   side (left in RTL) — same convention as the feed pager above. Each icon already
   points toward its own edge (outward), so only the grid placement needed to change. */
.cl2-md-cal-nav--fwd {
  grid-area: fwd;
}

.cl2-md-cal-nav--back {
  grid-area: back;
}

.cl2-md-cal-nav:hover:not(:disabled) {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

.cl2-md-cal-nav:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cl2-md-cal-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.cl2-md-cal-panels {
  grid-area: panels;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

/* Each year is its OWN card — independent border/radius, not a shared table column. */
.cl2-md-cal-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 6px 8px;
}

.cl2-md-cal-year {
  margin: 0 0 6px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  text-align: center;
}

/* 12-tile month grid (3 columns × 4 rows) inside each card — small, dense tiles.
   Zero-count tiles keep the plain neutral background; positive counts get an
   inline heatmap tint (rgba(accent)) written per-tile in PHP/JS — see
   $clCalHeatStyle / heatStyle() — scaled to the highest count in THIS window. */
.cl2-md-cal-months {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}

.cl2-md-cal-month {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 4px 2px;
  border-radius: 5px;
  background: var(--surface);
  text-align: center;
}

.cl2-md-cal-month-label {
  font-family: var(--sans);
  font-size: 8.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.cl2-md-cal-month-count {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text);
}

.cl2-md-cal-month-count--zero {
  font-weight: 400;
  color: var(--text-dim);
}

/* Task (Updates page): tablet keeps the desktop 3-across layout unchanged
   down to 721px -- the 300px-sidebar tablet range (Part C) does make each
   panel narrower (measured ~148-198px), but that's still 3 real panels, not
   the single-panel mobile mode below. Only genuine mobile (<=720px, this
   page's own mobile/tablet split) switches to one-year-at-a-time. */
@media (max-width: 720px) {
  /* Same DOM/data/renderPanels()/windowEnd state as desktop -- nothing here
     re-renders or duplicates anything. PHP and renderPanels() both emit the
     3-year window newest-first (see includes/updates_view.php), so
     .cl2-md-cal-panel:first-child is ALWAYS the current/newest year in the
     window; hiding the other two turns the existing "shift the 3-year window
     by 1" back/fwd behavior into correct single-year navigation for free --
     clicking back/fwd still moves windowEnd by exactly one year, so the one
     visible (first) panel simply becomes that new year. Layout mirrors
     desktop's own shape (nav | panel | nav, one row) instead of stacking. */
  .cl2-md-cal-panels {
    grid-template-columns: 1fr;
  }
  .cl2-md-cal-panel:not(:first-child) {
    display: none;
  }
}

.cl2-md-upd-empty {
  padding: 40px 0;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-muted);
}

.cl2-md-upd-feed {
  display: flex;
  flex-direction: column;
  margin-top: 16px;
}

.cl2-md-upd-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.cl2-md-upd-item:last-child {
  border-bottom: none;
}

/* Compact calendar-style date block — day (large) over month (small), or for
   month-precision historical entries, month (large) over year (small). */
.cl2-md-upd-date {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  line-height: 1.1;
}

.cl2-md-upd-date-day {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.cl2-md-upd-date-month {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.cl2-md-upd-date--month .cl2-md-upd-date-month {
  font-size: 13px;
  color: var(--text);
}

.cl2-md-upd-date-year {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
}

.cl2-md-upd-body {
  flex: 1 1 auto;
  min-width: 0;
}

.cl2-md-upd-item-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-bottom: 6px;
}

.cl2-md-upd-item-kind {
  margin: 0;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
}

.cl2-md-upd-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--text-dim);
  white-space: nowrap;
}

.cl2-md-upd-dot {
  opacity: 0.7;
}

.cl2-md-upd-text {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
}

/* Maker context: a grouped feed item's per-model links inside the sentence text — same
   accent as the rest of the identity system, underlined only on hover/focus so a dense
   Hebrew-joined list ("A, B ו-C") doesn't read as a wall of underlines. */
.cl2-md-upd-model-link {
  color: var(--accent);
  text-decoration: none;
}

.cl2-md-upd-model-link:hover,
.cl2-md-upd-model-link:focus-visible {
  text-decoration: underline;
}

/* "ועוד N דגמים" reveal for a grouped item with more models than fit inline — native
   <details>/<summary>, no JS needed. Collapsed: an inline accent-colored trigger matching
   the sentence's own type scale (not a separate button style). Expanded: the remaining
   names on their own line, same as the inline list's own typography. */
.cl2-md-upd-more {
  display: inline;
}

.cl2-md-upd-more summary {
  display: inline;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.cl2-md-upd-more summary::-webkit-details-marker {
  display: none;
}

.cl2-md-upd-more summary:hover,
.cl2-md-upd-more summary:focus-visible {
  text-decoration: underline;
}

.cl2-md-upd-more-list {
  display: block;
  margin-top: 4px;
  color: var(--text);
}

/* Pager: one row — newer (start) / page numbers (true center via the outer
   1fr columns) / older (end). Grid (not flex+space-between) so the numbers
   stay centered regardless of the two CTA labels' widths; RTL-safe by default
   since grid column order follows the inherited dir="rtl". */
.cl2-md-upd-pager {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px 16px;
}

.cl2-md-upd-pager-cta {
  display: inline-flex;
  align-items: center;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  transition: background 0.12s;
}

/* Explicit grid slots (not :first-of-type/:last-of-type) — either link can be
   absent on its own (first/last page), so position must not depend on the
   other one's presence. */
.cl2-md-upd-pager-newer {
  grid-column: 1;
  justify-self: start;
}

.cl2-md-upd-pager-older {
  grid-column: 3;
  justify-self: end;
}

.cl2-md-upd-pager-cta:hover {
  background: var(--accent-dim);
}

.cl2-md-upd-pager-nums {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}

.cl2-md-upd-pager-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 6px;
  color: var(--text-muted);
  text-decoration: none;
}

a.cl2-md-upd-pager-num:hover {
  background: var(--surface);
  color: var(--text);
}

.cl2-md-upd-pager-num.is-current {
  background: var(--accent);
  color: #fff;
}

/* Updates page: keep newer/numbers/older in ONE row at every width —
   the old grid-template-columns:1fr override here put each in its own
   full-width row (newer above, numbers, older below). Same 3-column grid as
   desktop, just tightened (padding/font/pill size) so it stays compact and
   doesn't wrap on a phone. Same links/state/behavior — layout only. */
@media (max-width: 640px) {
  .cl2-md-upd-pager {
    gap: 6px 6px;
  }

  .cl2-md-upd-pager-cta {
    font-size: 11.5px;
    font-weight: 600;
    padding: 6px 8px;
  }

  .cl2-md-upd-pager-nums {
    gap: 2px;
  }

  .cl2-md-upd-pager-num {
    min-width: 22px;
    height: 22px;
    padding: 0 3px;
    font-size: 11px;
  }
}

@media (max-width: 560px) {
  .cl2-md-upd-item-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}
