/* Big Tech News - Mobile-first styles with Inter font */
:root {
  --bg: #0a0a0a;
  --bg-card: #141414;
  --bg-elevated: #1a1a1a;
  --bg-hover: #1f1f1f;
  --text: #f5f5f5;
  --text-secondary: #a8a8a8;
  --text-muted: #666;
  --accent: #3b82f6;
  --border: #222;
  --border-light: #333;
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { 
  font-size: 16px; 
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.hidden { display: none !important; }

/* ===== HEADER ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10,10,10,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Search Toggle Button */
.search-toggle {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.search-toggle:hover { background: var(--bg-hover); }

/* Search Bar */
.search-bar {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.2s, opacity 0.2s, visibility 0.2s;
}

.search-bar.open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.search-bar .container {
  display: flex;
  gap: 12px;
}

.search-bar input {
  flex: 1;
  height: 44px;
  padding: 0 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 16px;
  outline: none;
}

.search-bar input:focus {
  border-color: var(--accent);
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-close {
  padding: 0 16px;
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

/* Hamburger Menu */
.menu-toggle {
  width: 44px;
  height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 10px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 60px;
  right: 0;
  width: 320px;
  max-width: 85vw;
  height: calc(100vh - 60px);
  background: var(--bg);
  border-left: 1px solid var(--border);
  z-index: 999;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.sidebar.open { transform: translateX(0); }

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  -webkit-tap-highlight-color: transparent;
}

.sidebar-overlay.open {
  opacity: 1;
  visibility: visible;
}

.sidebar-section {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0;
  margin-bottom: 12px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
}

.sidebar-toggle .chevron {
  transition: transform 0.2s;
}

.sidebar-toggle.expanded .chevron {
  transform: rotate(180deg);
}

.sidebar-list {
  list-style: none;
}

.sidebar-list.collapsible {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.sidebar-list.collapsible.expanded {
  max-height: 500px;
}

.sidebar-item {
  margin-bottom: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: background 0.15s;
}

.sidebar-link:hover {
  background: var(--bg-hover);
}

.sidebar-link-meta {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 2px 8px;
  border-radius: 10px;
}

.sidebar-year {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== MAIN CONTENT ===== */
main {
  padding-top: 60px;
  min-height: 100vh;
}

/* Search Results */
.search-results {
  display: none;
  padding: 24px 0;
}

.search-results.active {
  display: block;
}

.results-count, .no-results {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* Update Time */
.update-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
  padding-top: 20px;
}

/* ===== TOP STORIES ===== */
.top-stories {
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

/* Lead story */
.top-lead {
  display: flex;
  gap: 20px;
  padding: 24px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  margin-bottom: 16px;
  transition: border-color 0.15s, background 0.15s;
}

.top-lead:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
  border-left-color: var(--accent);
}

.top-lead-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
}

.top-lead-body {
  flex: 1;
  min-width: 0;
}

.top-lead-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.top-lead-source {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}

.top-lead-score {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 2px 8px;
  border-radius: 10px;
}

.top-lead-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.top-lead-desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.top-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.top-badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  padding: 3px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

/* Secondary story cards */
.top-grid {
  display: grid;
  gap: 12px;
}

.top-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: border-color 0.15s, background 0.15s;
}

.top-card:hover {
  border-color: var(--border-light);
  background: var(--bg-hover);
}

.top-card-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
}

.top-card-body {
  flex: 1;
  min-width: 0;
}

.top-card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.top-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.top-card-badges {
  display: inline-flex;
  gap: 4px;
}

/* ===== WEEK DIGEST ===== */
.week-digest {
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.view-all {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  white-space: nowrap;
  margin-top: 4px;
}

.week-grid {
  display: grid;
  gap: 12px;
}

.week-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: border-color 0.15s;
}

.week-item:hover {
  border-color: var(--border-light);
}

.week-rank {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-radius: 50%;
}

.week-rank.top {
  background: var(--accent);
  color: #fff;
}

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

.week-title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 6px;
}

.week-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== TODAY'S NEWS ===== */
.today-section {
  padding: 32px 0;
  border-bottom: 1px solid var(--border);
}

.news-list {
  display: flex;
  flex-direction: column;
}

.news-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.news-item:last-child {
  border-bottom: none;
}

.news-item:hover .news-title {
  color: var(--accent);
}

.news-rank {
  flex-shrink: 0;
  width: 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  padding-top: 2px;
}

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

.news-title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  margin-bottom: 4px;
  transition: color 0.15s;
}

.news-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== ARCHIVE ===== */
.archive-section {
  padding: 32px 0 48px;
}

.archive-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.archive-tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.archive-tab:hover {
  background: var(--bg-hover);
}

.archive-tab.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.archive-grid {
  display: grid;
  gap: 12px;
}

.archive-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s;
}

.archive-card:hover {
  border-color: var(--border-light);
}

.archive-title {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 4px;
}

.archive-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.archive-arrow {
  color: var(--text-muted);
  font-size: 18px;
}

/* ===== FOOTER ===== */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.footer p {
  margin-bottom: 8px;
}

.footer a {
  color: var(--text-secondary);
}

.footer a:hover {
  color: var(--text);
}

/* ===== DIGEST PAGE ===== */
.digest-page main {
  padding-top: 76px;
}

.digest-page header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10,10,10,0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.digest-page .header-inner {
  height: 60px;
}

.back-link {
  font-size: 13px;
  color: var(--text-secondary);
}

.back-link:hover {
  color: var(--text);
}

.digest-header {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.digest-type {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.digest-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.digest-date {
  font-size: 14px;
  color: var(--text-secondary);
}

.digest-stats {
  display: flex;
  gap: 24px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.digest-stats strong {
  color: var(--text);
}

.section {
  margin-bottom: 40px;
}

.section h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.article-list {
  list-style: none;
}

.article {
  display: flex;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.article:last-child {
  border-bottom: none;
}

.article-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
  border-radius: 50%;
}

.article-num.top {
  background: var(--accent);
  color: #fff;
}

.article-body {
  flex: 1;
}

.article-title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  margin-bottom: 6px;
}

.article-title a:hover {
  color: var(--accent);
}

.article-source {
  font-size: 12px;
  color: var(--text-muted);
}

.category {
  margin-bottom: 28px;
}

.category-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-count {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.more-list {
  list-style: none;
}

.more-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.5;
}

.more-item:last-child {
  border-bottom: none;
}

.more-item a:hover {
  color: var(--accent);
}

.more-item .source {
  color: var(--text-muted);
  font-size: 12px;
  margin-left: 8px;
}

.empty {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
}

/* ===== RESPONSIVE ===== */
@media (min-width: 640px) {
  .container {
    padding: 0 24px;
  }

  .top-lead-title {
    font-size: 26px;
  }

  .top-grid {
    grid-template-columns: 1fr 1fr;
  }

  .week-grid {
    grid-template-columns: 1fr 1fr;
  }

  .archive-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .top-lead-title {
    font-size: 32px;
  }

  .top-lead {
    padding: 32px;
  }

  .top-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .week-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .archive-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .section-title {
    font-size: 20px;
  }
}
