/* BesserNews Main CSS - Loads Base + Theme System */
@import url('./base.css');

/* Temporary: hide legacy inline per-article language switchers now replaced by global header select */
.language-switcher { display: none !important; }

/* Related Articles Engine */
.related-articles {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.related-card {
  display: flex;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
  align-items: flex-start;
  transition: transform 0.2s ease;
}

.related-card:hover {
  transform: translateX(4px);
}

.related-card:hover h4 {
  color: var(--bn-primary, #007AFF);
}

.related-thumb {
  flex-shrink: 0;
  width: 120px;
  aspect-ratio: 16/9;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f4f6;
}

.related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-content {
  flex: 1;
  min-width: 0;
}

.related-cat {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.25rem;
}

.related-content h4 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 0.25rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #1f2937;
}

.related-meta {
  font-size: 0.8rem;
  color: #9ca3af;
}

@media (min-width: 768px) {
  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========================================
   📦 ARCHIVE BOX - Wayback Machine Links
   ======================================== */
.archive-box {
  margin-block: 2rem;
  padding: 1.25rem;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #f59e0b;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.archive-box summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1.1rem;
  color: #92400e;
  padding: 0.5rem;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}

.archive-box summary::-webkit-details-marker {
  display: none;
}

.archive-box summary::before {
  content: '▶';
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.archive-box[open] summary::before {
  transform: rotate(90deg);
}

.archive-box summary:hover {
  color: #78350f;
}

.archive-box > p {
  margin-block: 0.75rem;
  color: #92400e;
  font-size: 0.9rem;
}

.archive-box .archive-list {
  list-style: none;
  padding: 0;
  margin-block: 0.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: 0.5rem;
}

.archive-box .archive-list li {
  background: white;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding-block: 0.5rem;
  padding-inline: 0.75rem;
  transition: all 0.2s ease;
}

.archive-box .archive-list li::before {
  content: none;
}

.archive-box .archive-list li:hover {
  background: #fffbeb;
  border-color: #f59e0b;
  transform: translateX(4px);
}

.archive-box .archive-list a {
  color: #92400e;
  text-decoration: none;
  font-size: 0.85rem;
  font-family: ui-monospace, 'SF Mono', 'Cascadia Code', 'Roboto Mono', monospace;
  word-break: break-all;
}

.archive-box .archive-list a:hover {
  color: #78350f;
  text-decoration: underline;
}

.archive-box .archive-note {
  font-size: 0.75rem;
  color: #b45309;
  font-style: italic;
  margin-block-start: 0.75rem;
  padding-block-start: 0.75rem;
  border-block-start: 1px solid #fcd34d;
}

/* Dark Mode Archive Box */
@media (prefers-color-scheme: dark) {
  .archive-box {
    background: linear-gradient(135deg, hsl(38, 30%, 15%) 0%, hsl(38, 40%, 12%) 100%);
    border-color: hsl(38, 50%, 35%);
  }
  
  .archive-box summary {
    color: hsl(38, 70%, 65%);
  }
  
  .archive-box ul,
  .archive-box li,
  .archive-box > p {
    color: #e5e7eb;
  }
  
  .archive-box .archive-list li {
    background: #1e293b;
    border-color: hsl(38, 40%, 30%);
  }
  
  .archive-box .archive-list li:hover {
    background: hsl(38, 30%, 18%);
    border-color: hsl(38, 60%, 50%);
  }
  
  .archive-box .archive-list a {
    color: hsl(38, 70%, 65%);
  }
  
  .archive-box .archive-note {
    color: hsl(38, 60%, 60%);
    border-color: hsl(38, 40%, 30%);
  }
}
