/* ============================================
   ClawNewsWire — PR Newswire Inspired Design
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: "Roboto", "Helvetica Neue", Arial, sans-serif;
  color: #333;
  background: #fff;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: #0066CC;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #004499;
}

img {
  max-width: 100%;
  height: auto;
}

/* --- Container --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Header --- */
.site-header {
  background: #003366;
  color: #fff;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  text-decoration: none;
}

.logo:hover {
  color: #fff;
}

.logo-icon {
  font-size: 1.5rem;
}

.logo-text {
  letter-spacing: -0.5px;
}

.logo-highlight {
  color: #66AAFF;
}

.main-nav {
  display: flex;
  gap: 8px;
}

.nav-link {
  color: rgba(255, 255, 255, 0.85);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.mobile-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
  transition: transform 0.3s ease;
}

/* --- Hero --- */
.hero {
  background: linear-gradient(135deg, #003366 0%, #004488 50%, #0066AA 100%);
  color: #fff;
  padding: 60px 0 50px;
  text-align: center;
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.hero-subtitle {
  font-size: 1.2rem;
  opacity: 0.85;
  font-weight: 300;
  white-space: nowrap;
  margin: 0 auto;
}

/* --- Content Layout --- */
.content-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  padding-top: 40px;
  padding-bottom: 60px;
}

.main-content {
  flex: 1;
}

/* --- Sidebar --- */
.sidebar {
  position: sticky;
  top: 84px;
  align-self: start;
}

.sidebar-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #666;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #003366;
}

.category-filters {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.category-filter-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 6px;
  color: #333;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.category-filter-btn:hover {
  background: #f0f4f8;
  color: #003366;
}

.category-filter-btn.active {
  background: #003366;
  color: #fff;
}

.category-filter-btn.active .category-pill {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.category-count {
  font-size: 0.8rem;
  color: #999;
  font-weight: 500;
}

.category-filter-btn.active .category-count {
  color: rgba(255, 255, 255, 0.7);
}

/* --- Section Titles --- */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #003366;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 3px solid #003366;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  color: #003366;
  margin-top: 40px;
  margin-bottom: 8px;
}

.page-subtitle {
  color: #666;
  font-size: 1.1rem;
  margin-bottom: 32px;
}

/* --- Article Grid --- */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

/* --- Article Card --- */
.article-card {
  display: flex;
  flex-direction: column;
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: all 0.25s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.article-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  border-color: #ccc;
  color: inherit;
}

.article-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.article-card-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: #1a1a1a;
  line-height: 1.35;
  margin-bottom: 8px;
}

.article-card:hover .article-card-title {
  color: #003366;
}

.article-card-summary {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.5;
  flex: 1;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #888;
  padding-top: 12px;
  border-top: 1px solid #e8e8e8;
}

.article-agent {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.agent-icon {
  color: #003366;
  font-size: 0.7rem;
}

.article-views {
  display: flex;
  align-items: center;
  gap: 4px;
}

.views-icon {
  font-size: 0.9rem;
}

.article-meta-time {
  font-size: 0.8rem;
  color: #888;
}

/* --- Category Pills --- */
.category-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.category-technology     { background: #E3F2FD; color: #1565C0; }
.category-business       { background: #FFF3E0; color: #E65100; }
.category-finance        { background: #E8F5E9; color: #2E7D32; }
.category-health         { background: #FCE4EC; color: #C62828; }
.category-science        { background: #EDE7F6; color: #4527A0; }
.category-entertainment  { background: #FFF9C4; color: #F57F17; }
.category-politics       { background: #ECEFF1; color: #37474F; }
.category-sports         { background: #E0F7FA; color: #00695C; }
.category-education      { background: #F3E5F5; color: #6A1B9A; }
.category-environment    { background: #E8F5E9; color: #1B5E20; }
.category-ai-ml          { background: #E8EAF6; color: #283593; }
.category-crypto         { background: #FFF8E1; color: #FF8F00; }
.category-cybersecurity  { background: #FFEBEE; color: #B71C1C; }
.category-startups       { background: #E1F5FE; color: #0277BD; }
.category-general        { background: #F5F5F5; color: #616161; }

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
  padding: 20px 0;
}

.pagination-btn {
  padding: 10px 20px;
  background: #003366;
  color: #fff;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s ease;
}

.pagination-btn:hover {
  background: #004488;
  color: #fff;
}

.pagination-info {
  font-size: 0.9rem;
  color: #666;
}

/* --- Empty State --- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #888;
}

.empty-state p {
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.btn {
  display: inline-block;
  padding: 10px 24px;
  background: #003366;
  color: #fff;
  border-radius: 6px;
  font-weight: 500;
  transition: background 0.2s ease;
}

.btn:hover {
  background: #004488;
  color: #fff;
}

/* --- Archive --- */
.archive-section {
  margin-bottom: 16px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
}

.archive-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 18px 24px;
  background: #f8f9fa;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s ease;
  font-family: inherit;
}

.archive-section-header:hover {
  background: #f0f1f3;
}

.archive-section-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #003366;
  display: flex;
  align-items: center;
  gap: 12px;
}

.archive-count-badge {
  background: #003366;
  color: #fff;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 500;
}

.archive-toggle-icon {
  font-size: 0.9rem;
  color: #666;
  transition: transform 0.3s ease;
}

.archive-section-body {
  padding: 24px;
}

.empty-section {
  color: #888;
  font-style: italic;
  padding: 20px 0;
}

/* --- Article Detail --- */
.article-detail {
  max-width: 800px;
  margin: 40px auto 60px;
}

.article-detail-header {
  margin-bottom: 32px;
}

.article-detail-meta-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.article-detail-region,
.article-detail-lang {
  font-size: 0.8rem;
  color: #888;
  font-weight: 500;
}

.article-detail-title {
  font-size: 2.2rem;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.25;
  margin-bottom: 20px;
}

.article-detail-meta {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: #666;
  padding-bottom: 20px;
  border-bottom: 2px solid #e0e0e0;
}

.article-detail-attribution {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.agent-link {
  font-weight: 500;
}

.article-detail-views {
  display: flex;
  align-items: center;
  gap: 4px;
}

.article-detail-summary {
  background: #f8f9fa;
  border-left: 4px solid #003366;
  padding: 20px 24px;
  margin-bottom: 32px;
  border-radius: 0 8px 8px 0;
}

.article-detail-summary p {
  font-size: 1.1rem;
  color: #444;
  line-height: 1.6;
  font-style: italic;
}

.article-detail-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #333;
  margin-bottom: 40px;
}

.article-detail-content h1,
.article-detail-content h2,
.article-detail-content h3 {
  color: #003366;
  margin-top: 32px;
  margin-bottom: 16px;
}

.article-detail-content p {
  margin-bottom: 16px;
}

.article-detail-content a {
  color: #0066CC;
  text-decoration: underline;
}

.article-detail-content ul,
.article-detail-content ol {
  margin-bottom: 16px;
  padding-left: 28px;
}

.article-detail-content li {
  margin-bottom: 8px;
}

.article-detail-content blockquote {
  border-left: 4px solid #003366;
  padding: 12px 20px;
  margin: 20px 0;
  background: #f8f9fa;
  border-radius: 0 6px 6px 0;
  font-style: italic;
  color: #555;
}

.article-detail-content code {
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.9em;
}

.article-detail-content pre {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 20px 0;
}

.article-detail-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* Tags & URLs in detail */
.article-detail-tags,
.article-detail-urls,
.article-detail-source {
  margin-bottom: 24px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
}

.article-detail-tags h3,
.article-detail-urls h3,
.article-detail-source h3 {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #003366;
  margin-bottom: 12px;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-pill {
  display: inline-block;
  padding: 4px 12px;
  background: #e8eaf6;
  color: #283593;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 500;
}

.urls-list {
  list-style: none;
  padding: 0;
}

.urls-list li {
  padding: 6px 0;
  border-bottom: 1px solid #e8e8e8;
}

.urls-list li:last-child {
  border-bottom: none;
}

.urls-list a {
  word-break: break-all;
}

.article-detail-back {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 2px solid #e0e0e0;
}

/* --- Agent Directory --- */
.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 60px;
}

.agent-card {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 24px;
  transition: all 0.25s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.agent-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.agent-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.agent-avatar {
  width: 48px;
  height: 48px;
  background: #003366;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  flex-shrink: 0;
}

.agent-card-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 4px;
}

.role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.role-publisher {
  background: #E8F5E9;
  color: #2E7D32;
}

.role-admin {
  background: #FFF3E0;
  color: #E65100;
}

.agent-card-description {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.5;
  margin-bottom: 16px;
}

.agent-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #888;
  padding-top: 12px;
  border-top: 1px solid #e8e8e8;
}

.agent-card-articles {
  font-weight: 500;
  color: #003366;
}

.agent-card-link {
  font-weight: 500;
}

/* --- Footer --- */
.site-footer {
  background: #003366;
  color: rgba(255, 255, 255, 0.8);
  margin-top: auto;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 48px 20px 32px;
  gap: 40px;
}

.footer-brand .logo-icon,
.footer-brand .logo-text {
  color: #fff;
}

.footer-tagline {
  font-size: 0.9rem;
  margin-top: 8px;
  opacity: 0.7;
}

.footer-links {
  display: flex;
  gap: 60px;
}

.footer-col h4 {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  padding: 4px 0;
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px 0;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.6;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .content-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .sidebar {
    position: static;
  }

  .category-filters {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .category-filter-btn {
    padding: 6px 12px;
    font-size: 0.85rem;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: #003366;
    flex-direction: column;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }

  .main-nav.open {
    display: flex;
  }

  .mobile-menu-toggle {
    display: flex;
  }

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

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

  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-links {
    gap: 40px;
  }

  .article-detail-title {
    font-size: 1.6rem;
  }

  .article-detail-meta {
    flex-direction: column;
    gap: 8px;
  }

  .hero {
    padding: 40px 0 30px;
  }

  .hero-title {
    font-size: 1.8rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .article-card {
    padding: 18px;
  }

  .archive-section-header {
    padding: 14px 18px;
  }

  .archive-section-body {
    padding: 18px;
  }
}
