/* ============ /github page styles ============ */
/* Reuse all tokens from styles.css; this file adds page-specific bits. */

.gh-pagehead {
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--border);
}
.gh-pagehead h1 {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -.025em;
  margin: 0 0 8px;
  display: flex; align-items: center; gap: 12px;
}
.gh-pagehead h1 .badge-new { font-size: 11px; }
.gh-pagehead .sub {
  font-size: 14px;
  color: var(--text-2);
  margin: 0 0 14px;
}
.gh-pagehead .live-metrics { margin-bottom: 0; }

/* Sticky toolbar */
.gh-toolbar {
  position: sticky;
  top: 60px; /* below header */
  z-index: 30;
  background: rgba(14, 17, 22, 0.85);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
}
[data-theme="light"] .gh-toolbar { background: rgba(255,255,255,.85); }
.gh-toolbar-inner {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.gh-toolbar-group { display: flex; gap: 6px; align-items: center; }
.gh-toolbar-group + .gh-toolbar-group { padding-left: 10px; border-left: 1px solid var(--border); }
.gh-toolbar-spacer { flex: 1; }

.period-tabs {
  display: inline-flex;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
}
.period-tabs button {
  padding: 5px 10px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-2);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.period-tabs button:hover { color: var(--text); }
.period-tabs button.active { background: var(--accent); color: white; }

/* Tabs (Releases/Trending/Activity) */
.gh-tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--border);
  margin: 24px 0 0;
}
.gh-tab {
  padding: 12px 18px;
  background: transparent;
  border: none;
  color: var(--text-2);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: inline-flex; align-items: center; gap: 8px;
}
.gh-tab:hover { color: var(--text); }
.gh-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.gh-tab .badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-elev-2);
  color: var(--text-3);
  font-family: var(--font-mono);
}

/* Layout: main + sidebar */
.gh-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
  padding: 24px 0 48px;
}
.gh-main { min-width: 0; }
.gh-sidebar {
  display: flex; flex-direction: column;
  gap: 18px;
}

/* Day group header */
.day-group {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  padding: 24px 0 12px;
  display: flex; align-items: center; gap: 12px;
}
.day-group::after {
  content: "";
  flex: 1; height: 1px; background: var(--border);
}
.day-group:first-child { padding-top: 0; }

/* Release card */
.rel-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  margin-bottom: 12px;
  transition: border .15s;
}
.rel-card:hover { border-color: var(--border-strong); }
.rel-card .stripe {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
}
.rel-patch    .stripe { background: #10B981; }
.rel-minor    .stripe { background: #3B82F6; }
.rel-major    .stripe { background: #8B5CF6; }
.rel-preview  .stripe { background: #F59E0B; }
.rel-breaking .stripe { background: #EF4444; }
.rel-prerelease .stripe { background: #6B7280; }

.rel-banner {
  padding: 8px 18px 8px 22px;
  font-size: 12px;
  font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--border);
}
.rel-banner.first    { background: rgba(16,185,129,.10); color: #34D399; }
.rel-banner.comeback { background: rgba(245,158,11,.10); color: #FBBF24; }
.rel-banner.hot      { background: rgba(239,68,68,.10); color: #FB7185; }
.rel-banner.breaking { background: rgba(239,68,68,.10); color: #FB7185; }
[data-theme="light"] .rel-banner.first    { background: rgba(16,185,129,.10); color: #047857; }
[data-theme="light"] .rel-banner.comeback { background: rgba(245,158,11,.12); color: #B45309; }
[data-theme="light"] .rel-banner.hot      { background: rgba(239,68,68,.10); color: #B91C1C; }
[data-theme="light"] .rel-banner.breaking { background: rgba(239,68,68,.10); color: #B91C1C; }

.rel-banner .ico { font-size: 14px; }
.rel-banner .sparkline { margin-left: auto; }

.rel-body { padding: 18px 18px 18px 22px; }
.rel-head {
  display: flex; align-items: flex-start; gap: 12px;
  margin-bottom: 4px;
}
.rel-avatar {
  width: 32px; height: 32px;
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-elev-2);
  color: var(--text);
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 12px;
  flex-shrink: 0;
}
.rel-title {
  flex: 1;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.rel-name {
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: -.01em;
}
.rel-name .owner { color: var(--text-2); font-weight: 400; }
.rel-name .repo { color: var(--accent); font-weight: 600; }

.ver-badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
}

.type-badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.type-patch    { background: rgba(16,185,129,.14); color: #34D399; }
.type-minor    { background: rgba(59,130,246,.14); color: #60A5FA; }
.type-major    { background: rgba(139,92,246,.14); color: #A78BFA; }
.type-preview  { background: rgba(245,158,11,.16); color: #FBBF24; }
.type-breaking { background: rgba(239,68,68,.14); color: #FB7185; }
.type-prerelease{ background: rgba(107,114,128,.18); color: #9CA3AF; }
[data-theme="light"] .type-patch    { color: #047857; }
[data-theme="light"] .type-minor    { color: #1D4ED8; }
[data-theme="light"] .type-major    { color: #6D28D9; }
[data-theme="light"] .type-preview  { color: #B45309; }
[data-theme="light"] .type-breaking { color: #B91C1C; }
[data-theme="light"] .type-prerelease{ color: #4B5563; }

.rel-desc {
  color: var(--text-2);
  font-size: 13px;
  margin: 2px 0 12px;
  line-height: 1.5;
}

.rel-meta {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 14px;
}
.rel-meta .stars { color: var(--text); }
.rel-meta .delta { color: var(--green); }
.rel-meta .lang-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; margin-right: 5px; vertical-align: middle;
}

.rel-divider {
  height: 1px; background: var(--border);
  margin: 0 0 14px;
}

.rel-summary-h {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
  margin: 0 0 8px;
}
.rel-bullets {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  display: flex; flex-direction: column;
  gap: 6px;
}
.rel-bullets li {
  position: relative;
  padding-left: 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}
.rel-bullets li::before {
  content: "·";
  position: absolute; left: 4px; top: -2px;
  font-weight: bold;
  color: var(--text-3);
  font-size: 18px;
}
.rel-bullets li .tag-breaking  { color: #FB7185; font-weight: 600; }
.rel-bullets li .tag-deprecated{ color: #FBBF24; font-weight: 600; }
.rel-bullets li .tag-new       { color: #34D399; font-weight: 600; }
.rel-bullets li .tag-fixed     { color: #60A5FA; font-weight: 600; }
[data-theme="light"] .rel-bullets li .tag-breaking { color: #B91C1C; }
[data-theme="light"] .rel-bullets li .tag-deprecated { color: #B45309; }
[data-theme="light"] .rel-bullets li .tag-new       { color: #047857; }
[data-theme="light"] .rel-bullets li .tag-fixed     { color: #1D4ED8; }

.rel-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.rel-actions .btn-link {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
  height: 30px;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .12s;
}
.rel-actions .btn-link:hover { color: var(--text); border-color: var(--border-strong); background: var(--bg-hover); }
.rel-actions .btn-link.active { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }

/* Sparkline */
.sparkline {
  display: inline-block;
  vertical-align: middle;
}

/* Trending grid */
.trending-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}
.trending-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  transition: border .15s, transform .15s;
  text-decoration: none; color: inherit;
}
.trending-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.trending-card .rank {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: -.02em;
  line-height: 1;
}
.trending-card .name {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.3;
  letter-spacing: -.01em;
}
.trending-card .name .owner { color: var(--text-2); }
.trending-card .name .repo { color: var(--accent); font-weight: 600; }
.trending-card .desc {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.4;
  min-height: 32px;
}
.trending-card .stars-row {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-mono);
  font-size: 13px;
}
.trending-card .stars-row .total { color: var(--text); font-weight: 500; }
.trending-card .stars-row .delta { color: var(--green); font-size: 12px; }
.trending-card .spark-row {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.trending-card .lang {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-mono);
  display: inline-flex; align-items: center; gap: 5px;
}
.trending-card .lang .lang-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.trending-card .cat {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-mono);
}
.trending-card .last-rel {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-mono);
}
.trending-card .open-card {
  margin-top: auto;
  padding-top: 8px;
  display: flex; align-items: center; gap: 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  border-top: 1px solid var(--border);
}

/* Activity feed */
.activity-feed {
  display: flex; flex-direction: column;
  gap: 0;
}
.activity-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.activity-row:first-child { border-top: none; padding-top: 0; }
.activity-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-top: 6px;
  margin-left: 4px;
}
.activity-dot.merged    { background: #10B981; box-shadow: 0 0 10px rgba(16,185,129,.5); }
.activity-dot.newcontrib{ background: #3B82F6; box-shadow: 0 0 10px rgba(59,130,246,.5); }
.activity-dot.preview   { background: #F59E0B; box-shadow: 0 0 10px rgba(245,158,11,.5); }
.activity-dot.closed    { background: #8B5CF6; box-shadow: 0 0 10px rgba(139,92,246,.5); }
.activity-dot.archived  { background: #EF4444; box-shadow: 0 0 10px rgba(239,68,68,.5); }
.activity-dot.discuss   { background: var(--text-3); }

.activity-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 13px;
  margin-bottom: 4px;
}
.activity-head .name {
  font-family: var(--font-mono);
  font-weight: 500;
}
.activity-head .name .repo { color: var(--accent); font-weight: 600; }
.activity-head .name .owner { color: var(--text-2); font-weight: 400; }
.activity-head .label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-elev-2);
}
.activity-body {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 4px;
  line-height: 1.4;
}
.activity-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}
.activity-when {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  padding-top: 1px;
}

/* Sidebar panels */
.side-panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.side-panel h3 {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 12px;
  letter-spacing: -.01em;
  display: flex; align-items: center; gap: 8px;
}
.side-panel h3 .ico { font-size: 14px; }
.side-panel .footer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}

.drops-row, .issues-row, .contrib-row, .ru-row {
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.drops-row:first-child, .issues-row:first-child,
.contrib-row:first-child, .ru-row:first-child { border-top: none; padding-top: 0; }

.drops-row .name, .issues-row .name {
  font-family: var(--font-mono);
  font-size: 12px;
  margin-bottom: 4px;
}
.drops-row .name .repo, .issues-row .name .repo { color: var(--accent); }
.drops-row .desc {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.3;
  margin-bottom: 5px;
}
.drops-row .spark { display: block; }

.issues-row .body {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 4px;
  line-height: 1.4;
}
.issues-row .meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}

.contrib-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
}
.contrib-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-elev-2);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}
.contrib-row .name {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
}
.contrib-row .repos {
  font-size: 11px;
  color: var(--text-3);
  margin: 2px 0;
}
.contrib-row .stats {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-2);
}

.ru-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.ru-row .name {
  font-family: var(--font-mono);
  font-size: 12px;
}
.ru-row .name .repo { color: var(--accent); }
.ru-row .delta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--green);
}

/* Stats bar */
.stats-bar {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 28px;
  margin-top: 24px;
}
.stats-bar h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 14px;
  display: flex; align-items: center; gap: 8px;
  color: var(--text-2);
}
.stats-bar h3 b { color: var(--text); font-family: var(--font-mono); font-weight: 600; }
.stats-grid {
  display: grid;
  grid-template-columns: 100px 1fr 1fr 1fr;
  row-gap: 8px;
  column-gap: 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  align-items: baseline;
}
.stats-grid .label { color: var(--text-3); }
.stats-grid .v { color: var(--text); font-variant-numeric: tabular-nums; }
.stats-grid .v b { color: var(--accent); font-weight: 500; }
.stats-bar .open-link {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* Load more */
.load-more {
  display: flex; justify-content: center;
  padding: 18px 0;
}

/* Mobile filter sheet trigger */
.mob-filters-btn { display: none; }

/* Responsive */
@media (max-width: 1280px) {
  .trending-grid { grid-template-columns: repeat(3, 1fr); }
  .gh-layout { grid-template-columns: 1fr 280px; gap: 24px; }
}
@media (max-width: 1024px) {
  .gh-layout { grid-template-columns: 1fr; }
  .gh-sidebar { position: static; flex-direction: column; }
  .trending-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .gh-pagehead h1 { font-size: 24px; }
  .trending-grid { grid-template-columns: 1fr; }
  .gh-toolbar-inner > .gh-toolbar-group:not(:first-child) {
    display: none;
  }
  .mob-filters-btn { display: inline-flex; }
  .gh-toolbar { top: 52px; }
  .stats-grid { grid-template-columns: 1fr; }
  .stats-grid .label { padding-top: 8px; border-top: 1px solid var(--border); }
}

/* fixes: клик на GitHub, скрыть пустой футер, sparkline не переполняет */
.trending-card svg{max-width:100%;height:auto}
.side-panel .footer:empty{display:none}
.drops-row,.ru-row,.issues-row,.contrib-row{cursor:pointer}
.drops-row:hover,.ru-row:hover,.issues-row:hover,.contrib-row:hover{background:var(--bg-hover)}
