/* ============================================
   Founderhub - Modern News Website Styles
   ============================================ */

/* Color scheme derived from site name hash */
:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --primary-light: #60a5fa;
  --text: #1a1a2e;
  --text-light: #666;
  --bg: #ffffff;
  --bg-alt: #f8f9fa;
  --header-bg: #1a1a2e;
  --shadow: rgba(0, 0, 0, 0.1);
  --shadow-hover: rgba(0, 0, 0, 0.15);
}

/* ============================================
   Reset & Base Styles
   ============================================ */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--bg-alt);
  line-height: 1.6;
  font-size: 16px;
}

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

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
}

/* ============================================
   Header
   ============================================ */

header {
  background: var(--header-bg);
  color: white;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px var(--shadow);
}

header .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.75rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
  letter-spacing: -0.5px;
}

.logo span {
  color: var(--primary-light);
}

nav ul {
  list-style: none;
  display: flex;
  gap: 2rem;
}

nav a {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

nav a:hover {
  color: var(--primary-light);
}

/* ============================================
   Main Container
   ============================================ */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

main {
  background: var(--bg);
  min-height: calc(100vh - 400px);
}

/* ============================================
   Hero Section
   ============================================ */

.hero {
  position: relative;
  height: 500px;
  overflow: hidden;
  margin-bottom: 3rem;
  border-radius: 0;
}

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

.hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.3));
  padding: 3rem;
  color: white;
}

.hero-category {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  max-width: 900px;
}

.hero p {
  font-size: 1.15rem;
  line-height: 1.5;
  opacity: 0.95;
  max-width: 700px;
}

/* ============================================
   Content Layout
   ============================================ */

.content-wrapper {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
  padding: 2rem 0;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.main-content {
  min-width: 0;
}

/* ============================================
   Section Headers
   ============================================ */

.section-header {
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 3px solid var(--primary);
}

.section-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
}

.category-header {
  padding: 3rem 0 2rem;
  text-align: center;
}

.category-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.category-header p {
  font-size: 1.15rem;
  color: var(--text-light);
  max-width: 700px;
  margin: 0 auto;
}

/* ============================================
   Article Grid
   ============================================ */

.article-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-bottom: 3rem;
}

.article-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px var(--shadow-hover);
}

.article-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.article-card-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.category-badge {
  display: inline-block;
  background: var(--primary-light);
  color: white;
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
  width: fit-content;
}

.article-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.article-card p {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  flex: 1;
}

.article-meta {
  display: flex;
  gap: 0.5rem;
  color: var(--text-light);
  font-size: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--bg-alt);
}

/* ============================================
   Sidebar
   ============================================ */

.sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
}

.sidebar-widget {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px var(--shadow);
  margin-bottom: 2rem;
}

.sidebar-widget h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  color: var(--text);
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--primary);
}

.trending-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--bg-alt);
}

.trending-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.trending-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-light);
  line-height: 1;
  flex-shrink: 0;
}

.trending-item h4 {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}

.trending-item a {
  color: var(--text);
}

.trending-item a:hover {
  color: var(--primary);
}

/* ============================================
   Article Page
   ============================================ */

.article-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.article-header {
  margin-bottom: 2rem;
}

.article-header .category-badge {
  margin-bottom: 1rem;
}

.article-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.article-byline {
  display: flex;
  gap: 1rem;
  color: var(--text-light);
  font-size: 0.95rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--bg-alt);
}

.article-image {
  margin: 2rem 0;
  border-radius: 8px;
  overflow: hidden;
}

.article-image img {
  width: 100%;
  height: auto;
}

.article-body {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text);
}

.article-body p {
  margin-bottom: 1.5rem;
}

.article-body p:last-child {
  margin-bottom: 0;
}

/* ============================================
   Related Articles
   ============================================ */

.related-articles {
  max-width: 800px;
  margin: 4rem auto 0;
  padding: 2rem 1.5rem;
  border-top: 2px solid var(--bg-alt);
}

.related-articles h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

/* ============================================
   Back Link
   ============================================ */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  color: var(--text-light);
  font-weight: 500;
  transition: color 0.2s ease;
}

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

.back-link::before {
  content: '←';
  font-size: 1.2rem;
}

/* ============================================
   Footer
   ============================================ */

footer {
  background: var(--header-bg);
  color: rgba(255, 255, 255, 0.8);
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.2s ease;
}

.footer-section a:hover {
  color: var(--primary-light);
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 0.9rem;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 1024px) {
  .content-wrapper {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

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

@media (max-width: 768px) {
  nav ul {
    gap: 1rem;
  }

  nav a {
    font-size: 0.85rem;
  }

  .hero {
    height: 400px;
  }

  .hero-overlay {
    padding: 2rem 1.5rem;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

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

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

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

  .article-header h1 {
    font-size: 2rem;
  }

  .article-body {
    font-size: 1.05rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .category-header h1 {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 1.4rem;
  }

  nav ul {
    gap: 0.75rem;
  }

  nav a {
    font-size: 0.8rem;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .article-header h1 {
    font-size: 1.75rem;
  }
}
