/* ============================================================
   SmartAI Earning Blog — Theme Stylesheet
   ============================================================ */

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

:root {
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-50:  #eff6ff;
  --gray-50:  #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-900: #111827;
  --white:    #ffffff;
  --radius:   0.75rem;
  --shadow:   0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  color: var(--gray-700);
  background: var(--gray-50);
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }
a   { color: inherit; text-decoration: none; }
ul  { list-style: none; }

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

/* ============================================================
   HEADER / NAV — rendered by React
   ============================================================ */
#smartai-header-root { position: sticky; top: 0; z-index: 50; }

/* ============================================================
   HERO — rendered by React
   ============================================================ */
#smartai-hero-root {}

/* ============================================================
   SECTIONS
   ============================================================ */
.section-featured  { padding: 4rem 0; background: var(--gray-50); }
.section-articles  { padding: 4rem 0; background: var(--white); }
.section-categories{ padding: 4rem 0; background: var(--white); }
.section-newsletter{ padding: 4rem 0; background: linear-gradient(135deg, var(--blue-600), var(--blue-700)); }

.section-header { margin-bottom: 3rem; }
.section-header h2 { font-size: 2.25rem; font-weight: 700; color: var(--gray-900); margin-bottom: 1rem; }
.section-header p  { font-size: 1.125rem; color: var(--gray-500); }

/* ============================================================
   CARDS
   ============================================================ */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.article-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .3s, box-shadow .3s;
  cursor: pointer;
}

.article-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0,0,0,.15);
}

.article-card__image {
  position: relative;
  height: 12rem;
  overflow: hidden;
}

.article-card__image img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s;
}

.article-card:hover .article-card__image img { transform: scale(1.05); }

.article-card__badge {
  position: absolute;
  top: 1rem; left: 1rem;
  background: var(--blue-600);
  color: var(--white);
  font-size: .75rem;
  font-weight: 600;
  padding: .25rem .75rem;
  border-radius: 9999px;
}

.article-card__body { padding: 1.5rem; }
.article-card__title { font-size: 1.125rem; font-weight: 700; color: var(--gray-900); margin-bottom: .75rem; line-height: 1.4; }
.article-card__title:hover { color: var(--blue-600); }
.article-card__excerpt { color: var(--gray-500); font-size: .95rem; margin-bottom: 1rem; }

.article-card__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: .8rem;
  color: var(--gray-500);
  margin-bottom: 1rem;
}

.article-card__meta span { display: flex; align-items: center; gap: .25rem; }

.btn-read-more {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: none;
  border: none;
  color: var(--blue-600);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-size: .95rem;
  transition: gap .2s;
}

.btn-read-more:hover { gap: .75rem; }

/* Featured article */
.featured-article {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .3s;
}

.featured-article:hover { transform: translateY(-4px); }

.featured-article__inner { display: grid; grid-template-columns: 1fr 1fr; }

.featured-article__image { position: relative; min-height: 300px; overflow: hidden; }
.featured-article__image img { width: 100%; height: 100%; object-fit: cover; }
.featured-article__badge {
  position: absolute; top: 1rem; left: 1rem;
  background: var(--blue-600); color: var(--white);
  font-size: .85rem; font-weight: 600;
  padding: .3rem 1rem; border-radius: 9999px;
}

.featured-article__body { padding: 2.5rem; display: flex; flex-direction: column; justify-content: center; }
.featured-article__title { font-size: 1.75rem; font-weight: 700; color: var(--gray-900); margin-bottom: 1rem; line-height: 1.3; }
.featured-article__title:hover { color: var(--blue-600); cursor: pointer; }
.featured-article__excerpt { color: var(--gray-500); margin-bottom: 1.5rem; line-height: 1.7; }
.featured-article__meta { display: flex; gap: 1.5rem; font-size: .875rem; color: var(--gray-500); margin-bottom: 1.5rem; }
.featured-article__meta span { display: flex; align-items: center; gap: .4rem; }

/* ============================================================
   CATEGORIES
   ============================================================ */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.category-card {
  background: var(--gray-50);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all .3s;
  font-weight: 700;
  color: var(--gray-700);
}

.category-card:hover {
  border-color: var(--blue-600);
  background: var(--blue-50);
  color: var(--blue-600);
  transform: translateY(-3px);
}

.category-card__count { font-size: .85rem; font-weight: 400; color: var(--gray-500); margin-top: .25rem; }

/* ============================================================
   NEWSLETTER
   ============================================================ */
.newsletter-section { text-align: center; color: var(--white); }
.newsletter-section h2 { font-size: 2rem; font-weight: 700; margin-bottom: 1rem; }
.newsletter-section p  { font-size: 1.1rem; opacity: .9; margin-bottom: 2rem; }

.newsletter-form { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; }

.newsletter-form input {
  padding: .75rem 1.5rem;
  border-radius: 9999px;
  border: none;
  font-size: 1rem;
  width: 300px;
  outline: none;
}

.newsletter-form button {
  background: var(--white);
  color: var(--blue-600);
  font-weight: 700;
  border: none;
  padding: .75rem 2rem;
  border-radius: 9999px;
  cursor: pointer;
  font-size: 1rem;
  transition: opacity .2s;
}

.newsletter-form button:hover { opacity: .9; }
.newsletter-note { font-size: .85rem; opacity: .75; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--gray-900);
  color: #9ca3af;
  padding: 3rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand h3 { color: var(--white); font-size: 1.25rem; font-weight: 700; margin-bottom: .75rem; }
.footer-brand p  { font-size: .9rem; line-height: 1.7; }

.footer-col h4 { color: var(--white); font-weight: 600; margin-bottom: 1rem; font-size: .95rem; }
.footer-col ul li { margin-bottom: .5rem; }
.footer-col ul li a { font-size: .9rem; transition: color .2s; }
.footer-col ul li a:hover { color: var(--white); }

.footer-bottom { border-top: 1px solid #374151; padding-top: 1.5rem; text-align: center; font-size: .85rem; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .article-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid  { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

@media (max-width: 768px) {
  .featured-article__inner { grid-template-columns: 1fr; }
  .featured-article__image { min-height: 220px; }
  .article-grid { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid  { grid-template-columns: 1fr; gap: 2rem; }
  .section-header h2 { font-size: 1.75rem; }
}

@media (max-width: 480px) {
  .category-grid { grid-template-columns: 1fr; }
  .newsletter-form input { width: 100%; }
}
