/* ==========================================================================
   Sidebar — The Sri COM
   --------------------------------------------------------------------------
   Three stacked blocks in the right rail: a ranked Popular list, topic chips,
   and the newsletter panel. Swiss-editorial treatment — big rank numerals,
   a strict grid and hairline rules doing the separating instead of boxes.
   ========================================================================== */

.spotlight-column {
  --side-line: rgba(180, 204, 237, .14);
  --side-muted: #8ea2bd;
  --side-title: #edf3ff;
  --side-brand: #2475e8;
  --side-thumb: #10254a;
}

html[data-theme="light"] .spotlight-column {
  --side-line: #dce4ef;
  --side-muted: #60738b;
  --side-title: #102038;
  --side-thumb: #dbe6f5;
}

/* The rail was sized for a text-only list. Thumbnails need the extra width,
   otherwise headlines drop to about 140px and truncate mid-word. Loads after
   two-column-layout.css, so these win. */
@media (min-width: 981px) {
  .newsroom-grid { grid-template-columns: minmax(0, 1fr) 285px; }
}

@media (max-width: 980px) {
  .newsroom-grid { grid-template-columns: minmax(0, 1fr) 245px; }
}

.side-block { margin-bottom: 30px; }

/* --- Popular -------------------------------------------------------------- */

.popular-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: popular;
}

.popular-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: start;
  gap: 13px;
  padding: 14px 0;
  border-top: 1px solid var(--side-line);
}

.popular-item:first-child {
  padding-top: 4px;
  border-top: 0;
}

.popular-thumb {
  display: block;
  overflow: hidden;
  width: 56px;
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--side-thumb);
}

.popular-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.popular-item:hover .popular-thumb img { transform: scale(1.07); }

.popular-thumb-empty {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--side-muted);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .08em;
}

.popular-copy { min-width: 0; }

.popular-copy h3 {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 5px;
  font-size: .86rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .01em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.popular-copy h3 a { color: var(--side-title); }
.popular-copy h3 a:hover { color: var(--side-brand); }

.popular-copy .view-count {
  color: var(--side-muted);
  font-size: .68rem;
}

.popular-empty {
  margin: 0;
  color: var(--side-muted);
  font-size: .8rem;
  line-height: 1.55;
}

.popular-empty code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(36, 117, 232, .16);
  color: var(--side-brand);
  font-size: .95em;
}

/* --- Topic chips ---------------------------------------------------------- */

.topic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.topic-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--side-line);
  border-radius: 99px;
  color: var(--side-title);
  font-size: .74rem;
  font-weight: 500;
  line-height: 1;
}

.topic-chip:hover {
  border-color: var(--side-brand);
  background: rgba(36, 117, 232, .12);
  color: var(--side-brand);
}

.topic-count {
  color: var(--side-muted);
  font-size: .68rem;
  font-variant-numeric: tabular-nums;
}

.topic-chip:hover .topic-count { color: var(--side-brand); }

/* --- Newsletter panel ----------------------------------------------------- */
/* Slightly warmer than the old flat panel — a soft brand wash plus a hairline
   rule, so it reads as part of the rail rather than a bolted-on box. */

.spotlight-column .subscribe-panel {
  margin-top: 0;
  border: 1px solid rgba(36, 117, 232, .34);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(36, 117, 232, .18), rgba(12, 27, 51, .55));
}

html[data-theme="light"] .spotlight-column .subscribe-panel {
  border-color: #bcd4f8;
  background: linear-gradient(160deg, #eaf2ff, #f7faff);
}

.spotlight-column .subscribe-panel a { background: var(--side-brand); color: #fff; }
.spotlight-column .subscribe-panel a:hover { background: #1b62cb; color: #fff; }

/* --- Tablet: rail becomes a 3-up row -------------------------------------- */

@media (max-width: 980px) {
  .side-block { margin-bottom: 24px; }
}

/* --- Phone ---------------------------------------------------------------- */

@media (max-width: 650px) {
  /* Full page width down here, so the thumbnail can be bigger. */
  .popular-item {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 14px;
    padding: 13px 0;
  }

  .popular-thumb { width: 68px; }

  .popular-copy h3 {
    font-size: .95rem;
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .popular-item:hover .popular-thumb img { transform: none; }
}
