/**
 * Blog Main Page Specific Styles
 * Article generation, filters, reader panel
 */

html, body {
  scroll-behavior: smooth;
}

/* Hero */
.hero {
  min-height: 52vh;
  display: flex;
  align-items: flex-end;
}

.hero-content {
  padding: 72px 0 44px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

/* Section spacing */
.section {
  padding: 48px 0;
}

/* Filters bar */
.filters-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.search-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1;
}

.search-wrap .input-field {
  flex: 1;
  margin: 0;
}

.chip-filter {
  cursor: pointer;
}

.chip-filter.active {
  background: #e3f2fd;
}

html[data-theme="dark"] .chip-filter.active {
  background: rgba(100, 181, 246, 0.2);
}

/* Topic grid */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.topic-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg, 14px);
  padding: 14px;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

.topic-card h5 {
  margin: 0.25rem 0 0.35rem;
}

.topic-card .meta {
  font-size: 0.86rem;
  color: var(--text-secondary);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.topic-card .tags .chip {
  margin: 4px 6px 0 0;
}

.topic-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
}

html[data-theme="dark"] .topic-card {
  box-shadow: 0 10px 26px rgba(5, 12, 22, 0.35);
}

/* Generation progress */
.gen-progress {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(120%) blur(6px);
  border-bottom: 1px solid var(--border-light);
  display: none;
}

.gen-progress-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 12px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.gen-progress .label {
  min-width: 180px;
  font-weight: 600;
}

.gen-progress .percent {
  width: 56px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] .gen-progress {
  background: rgba(5, 12, 22, 0.9);
  color: var(--text-primary);
}

/* Skeleton loaders */
.skeleton {
  position: relative;
  overflow: hidden;
  background: #eceff1;
  border-radius: var(--radius-md, 8px);
}

.shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

.sk-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg, 14px);
  padding: 14px;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}

.sk-line {
  height: 12px;
  margin: 10px 0;
}

.sk-chip {
  width: 64px;
  height: 26px;
  border-radius: var(--radius-pill, 999px);
  margin: 6px 6px 0 0;
}

/* Article reader panel */
.reader {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(920px, 100%);
  max-width: 100vw;
  background: var(--bg-card);
  border-left: 1px solid var(--border-light);
  z-index: 70;
  transform: translateX(100%);
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
}

.reader.open {
  transform: translateX(0);
}

.reader-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
}

.reader-body {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
  overflow: hidden;
}

@media (max-width: 1100px) {
  .reader-body {
    grid-template-columns: 1fr;
  }
}

.article {
  padding: 16px;
  overflow: auto;
}

.toc {
  padding: 12px;
  border-left: 1px solid var(--border-light);
  overflow: auto;
}

.toc h6 {
  margin: 0.2rem 0 0.4rem;
}

.toc a {
  display: block;
  font-size: 0.95rem;
  margin: 4px 0;
}

/* Article progress */
.article-progress {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
  display: none;
}

.article-progress .row {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.article-progress .label {
  min-width: 160px;
  font-weight: 600;
}

.article-progress .percent {
  width: 56px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] .article-progress {
  color: var(--text-primary);
}

/* Article content */
.article :is(h1, h2, h3) {
  margin-top: 1.1rem;
}

.article pre {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md, 8px);
  padding: 10px;
  overflow: auto;
}

.article blockquote {
  border-left: 4px solid #cfd8dc;
  padding: 6px 10px;
  background: #fafafa;
  border-radius: var(--radius-sm, 6px);
}

html[data-theme="dark"] .article blockquote {
  background: rgba(5, 12, 22, 0.4);
  border-left-color: #607d8b;
}
