/* ═══════════════════════════════════════════════════════════════
   most_read_topics.css
   Shared pill-list styles for most-read Topic and Author pages.
   Used by:
     templates/issue/most_read_topics.html

   Design language: Icarus editorial — Source Sans 3, #c0392b red,
   clean whitespace, dual fixed-column layouts, staggered animations.
═══════════════════════════════════════════════════════════════ */

:root {
  --tr-accent:    #c0392b;
  --tr-text:      #111111;
  --tr-muted:     #757575;
  --tr-border:    #e8e8e8;
  --tr-bg:        #ffffff;
  --tr-hover-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* ── Page shell ─────────────────────────────────────────────── */
.trending-container {
  max-width: 1240px; /* Extended boundary layout container width */
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

/* ── Page header ────────────────────────────────────────────── */
.trending-header {
  text-align: center;
  margin-bottom: 3.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 3px solid var(--tr-accent);
}


.trending-header h1 {
  font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--tr-text);
  margin: 0 0 0.35rem;
  line-height: 1.2;
}

.trending-header__period {
  font-size: 0.85rem;
  color: var(--tr-muted);
  margin: 0;
  font-style: italic;
}

/* ── Two-Column Split Architecture Grid (Dual Fixed Column Lock) ── */
.trending-layout-grid {
  display: grid;
  grid-template-columns: 380px 640px; /* Both left and right columns are explicitly locked to absolute fixed widths */
  gap: 3.5rem;
  align-items: start;
  justify-content: center; /* Centers the rigid layout block inside the fluid page container wrapper */
}

/* ── Left Side Layout column wrapper ─────────────────────────── */
.trending-main-col {
  min-width: 0;
  width: 380px; /* Enforces exact pixel containment matching the grid definition */
}

.trending-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ── Individual pill card item settings ─────────────────────── */
.trending-pill {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  padding: 1.1rem 1.25rem;
  background: var(--tr-bg);
  border: 1px solid var(--tr-border);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  /* Hardware-accelerated transformation and lighting transitions */
  transition:
    transform     0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    border-color  0.25s ease,
    box-shadow    0.25s ease;
  will-change: transform, box-shadow;
}

.trending-pill:hover,
.trending-pill:focus-visible {
  transform:    translateX(8px);
  border-color: var(--tr-accent);
  box-shadow:   var(--tr-hover-shadow);
  outline: none;
}

/* ── Rank Typography Configurations (All custom backgrounds removed) ── */
.trending-pill__rank {
  width: 1.5rem;
  height: auto;
  background: none !important;
  color: var(--tr-muted);
  font-size: 1.1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
  line-height: 1;
}

/* Clean uniform dark typography hierarchy sizing for top 3 positions */
.trending-list li:nth-child(1) .trending-pill__rank { color: var(--tr-text); font-size: 1.35rem; }
.trending-list li:nth-child(2) .trending-pill__rank { color: var(--tr-text); font-size: 1.25rem; }
.trending-list li:nth-child(3) .trending-pill__rank { color: var(--tr-text); font-size: 1.2rem; }

/* ── Name + Role element groups ───────────────────────────────── */
.trending-pill__name-group {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

/* ── Integrated Article Tag Component Settings ──────────────── */
.trending-pill__name-group .topic-tag {
  display: inline-block;
  font-family: var(--font-ui, sans-serif);
  font-size: 0.85rem;
  font-weight: 700;
  
    color: #ffffff;
  padding: 6px 14px;
  border-radius: 20px;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.25s ease;
}

.trending-pill:hover .topic-tag {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

/* ── View metrics tracking elements ──────────────────────────── */
.trending-pill__views {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
  flex-shrink: 0;
  text-align: right;
}

.trending-pill__count {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--tr-text);
  font-variant-numeric: tabular-nums;
}

.trending-pill__unit {
  font-size: 0.7rem;
  color: var(--tr-muted);
  white-space: nowrap;
}

/* ── Right Column: Sticky Live Articles Preview Framework ────── */
.trending-side-col {
  position: relative;
  min-width: 0;
  width: 640px; /* Absolute fixed width layout configuration matching grid */
}

.preview-panel-sticky {
  position: sticky;
  top: 3rem; /* Dynamic sticky offset for vertical scroll layout alignment */
  background: #fbfbfb;
  border: 1px solid var(--tr-border);
  border-radius: 16px;
  padding: 2.5rem;
  min-height: 460px;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.01);
}

/* Panel presentation visibility rules handled via Javascript hooks */
.articles-preview-pane {
  display: none;
}

.articles-preview-pane.active {
  display: block;
}

.preview-pane-title {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--tr-text);
  margin-top: 0;
  margin-bottom: 1.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--tr-accent);
  animation: panelHeaderFadeIn 0.3s ease-out forwards;
}

@keyframes panelHeaderFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.pane-placeholder-text {
  color: var(--tr-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  font-style: italic;
  animation: panelHeaderFadeIn 0.3s ease-out forwards;
}

/* Preview article sub-list row alignments */
.preview-article-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Micro-staggered keyframe item configurations triggered via Javascript injection */
.preview-article-item {
  border-bottom: 1px dashed var(--tr-border);
  padding-bottom: 0.75rem;
  opacity: 0; /* Starts hidden; animated into view by script values */
  will-change: transform, opacity;
}

.preview-article-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

@keyframes articleItemFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Flex row setup to position thumbnails neatly next to text content */
.preview-article-link {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* ── Miniature Thumbnail Media Styling ───────────────────────── */
.preview-article-thumbnail {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  overflow: hidden;
  background-color: #f0f0f0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--tr-border);
  box-shadow: 0 2px 5px rgba(0,0,0,0.03);
  transition: transform 0.22s ease;
}

.preview-article-thumbnail .thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* High-contrast geometric fallback decoration box if no cover image exists */
.thumb-placeholder-fallback {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb-placeholder-fallback span {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--tr-muted);
}

/* Shared link hover interaction states */
.preview-article-headline {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--tr-text);
  transition: color 0.18s ease, transform 0.18s ease;
  flex: 1;
}

.preview-article-link:hover .preview-article-headline {
  color: var(--tr-accent);
  transform: translateX(4px);
}

.preview-article-link:hover .preview-article-thumbnail {
  transform: scale(1.05);
  border-color: var(--tr-accent);
}

/* ── Empty state fallback elements ───────────────────────────── */
.trending-empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--tr-muted);
  font-size: 0.95rem;
}

/* ── Responsive breakpoints ─────────────────────────────────── */
@media (max-width: 1120px) {
  /* Recalculate or scale back boundaries cleanly if the device viewport drops below total locked width constraints */
  .trending-layout-grid {
    grid-template-columns: 320px 1fr;
    gap: 2rem;
  }
  .trending-main-col { width: 320px; }
  .trending-side-col { width: auto; }
}

@media (max-width: 992px) {
  .trending-layout-grid {
    grid-template-columns: 1fr; /* Fallback cleanly to standard stack on tablet dimensions */
  }
  .trending-main-col { width: 100%; }
  .trending-side-col { display: none; /* Hides preview system layouts completely on smaller portable screens */ }
}

@media (max-width: 600px) {
  .trending-container {
    padding: 2rem 1rem 3rem;
  }

  .trending-header h1 {
    font-size: 1.35rem;
  }

  .trending-pill {
    padding: 0.95rem 1.1rem;
    gap: 0.85rem;
  }
}