/* ==========================================================================
   AI Pulse Modern Blog & Publication Theme
   ========================================================================== */

:root {
  --primary: #5156be;
  --primary-hover: #43479e;
  --primary-rgb: 81, 86, 190;
  --accent: #06b6d4;
  --dark: #0f172a;
  --text: #334155;
  --text-muted: #64748b;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --border: #e2e8f0;
  --container-width: 1180px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --shadow-lg: 0 10px 25px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.05);
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* --------------------------------------------------
   Header & Navigation
   -------------------------------------------------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: all 0.2s ease;
}

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

.site-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--dark);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.02em;
}

.site-logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  box-shadow: 0 4px 10px rgba(81, 86, 190, 0.25);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.92rem;
  transition: color 0.15s ease;
}

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

.header-search {
  position: relative;
}

.header-search form {
  display: flex;
  align-items: center;
  position: relative;
}

.header-search .search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  font-size: 1rem;
}

.header-search input {
  padding: 7px 14px 7px 34px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  background: var(--bg-soft);
  color: var(--dark);
  width: 170px;
  transition: all 0.25s ease;
  outline: none;
  font-family: inherit;
}

.header-search input:focus {
  width: 220px;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(81, 86, 190, 0.12);
}

/* --------------------------------------------------
   Hero Section
   -------------------------------------------------- */
.hero-post {
  margin: 36px 0 48px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.hero-post:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.hero-img-wrap {
  width: 100%;
  min-height: 380px;
  background: #f1f5f9;
  position: relative;
  overflow: hidden;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.hero-post:hover .hero-img {
  transform: scale(1.03);
}

.hero-body {
  padding: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  background: rgba(81, 86, 190, 0.1);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 14px;
  width: fit-content;
}

.hero-title {
  font-size: 1.95rem;
  font-weight: 800;
  color: var(--dark);
  line-height: 1.25;
  margin-bottom: 16px;
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: color 0.15s ease;
}

.hero-title:hover {
  color: var(--primary);
}

.hero-excerpt {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 24px;
}

.meta-author {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.author-badge {
  font-weight: 600;
  color: var(--dark);
}

/* --------------------------------------------------
   Bento Grid Section
   -------------------------------------------------- */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 50px;
}

.bento-card {
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
}

.bento-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(81, 86, 190, 0.3);
}

.bento-img-wrap {
  height: 190px;
  background: #f1f5f9;
  overflow: hidden;
  position: relative;
}

.bento-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.bento-card:hover .bento-img {
  transform: scale(1.04);
}

.bento-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.bento-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.35;
  margin: 8px 0 10px;
  letter-spacing: -0.01em;
}

.bento-excerpt {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
  flex-grow: 1;
}

/* --------------------------------------------------
   Trending Section
   -------------------------------------------------- */
.trending-box {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 50px;
}

.trending-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.trending-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.trending-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.trending-card {
  display: flex;
  gap: 14px;
  align-items: center;
  background: #ffffff;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
}

.trending-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: rgba(81, 86, 190, 0.3);
}

.trending-rank {
  font-size: 1.25rem;
  font-weight: 800;
  color: rgba(81, 86, 190, 0.35);
  font-family: monospace;
  min-width: 28px;
  text-align: center;
}

.trending-thumb {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #e2e8f0;
}

.trending-content {
  overflow: hidden;
}

.trending-post-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.trending-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* --------------------------------------------------
   Latest Posts Grid
   -------------------------------------------------- */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  margin-bottom: 50px;
}

.post-card {
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(81, 86, 190, 0.3);
}

.card-img-wrap {
  width: 100%;
  height: 200px;
  background: #f1f5f9;
  overflow: hidden;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.post-card:hover .card-img {
  transform: scale(1.03);
}

.card-body {
  padding: 22px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.35;
  margin-bottom: 10px;
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: color 0.15s;
}

.card-title:hover {
  color: var(--primary);
}

.card-excerpt {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 18px;
  flex-grow: 1;
  line-height: 1.55;
}

.card-footer-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: auto;
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
}

/* Category Filter Buttons */
.category-pills-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 24px;
  scrollbar-width: thin;
}

.pill-btn {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-muted);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  white-space: nowrap;
  transition: all 0.15s;
}

.pill-btn:hover, .pill-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* --------------------------------------------------
   Newsletter CTA Block
   -------------------------------------------------- */
.newsletter-cta {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  text-align: center;
  box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.3);
  margin-bottom: 60px;
}

.newsletter-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: inline-block;
  margin-bottom: 12px;
}

.newsletter-title {
  font-size: 1.95rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.newsletter-text {
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.95rem;
  max-width: 540px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

.newsletter-form {
  display: flex;
  gap: 8px;
  max-width: 460px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.newsletter-input {
  flex: 1;
  min-width: 240px;
  padding: 12px 18px;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  font-family: inherit;
}

.newsletter-btn {
  background: #0f172a;
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  font-family: inherit;
}

.newsletter-btn:hover {
  background: #1e293b;
}

/* --------------------------------------------------
   Single Post Article View
   -------------------------------------------------- */
.article-header {
  padding: 48px 0 24px;
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
}

.article-title {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--dark);
  line-height: 1.2;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.article-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.article-featured-img {
  max-width: 960px;
  margin: 32px auto 44px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.article-featured-img img {
  width: 100%;
  display: block;
}

.article-content {
  max-width: 760px;
  margin: 0 auto 60px;
  font-size: 1.1rem;
  line-height: 1.8;
  color: #1e293b;
}

.article-content h2 {
  font-size: 1.7rem;
  font-weight: 800;
  margin: 44px 0 16px;
  color: var(--dark);
  letter-spacing: -0.01em;
}

.article-content h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 32px 0 12px;
  color: var(--dark);
}

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

.article-content ul, .article-content ol {
  margin: 0 0 24px 28px;
}

.article-content blockquote {
  border-left: 4px solid var(--primary);
  padding: 16px 24px;
  background: var(--bg-soft);
  font-style: italic;
  margin: 28px 0;
  border-radius: 0 8px 8px 0;
}

/* --------------------------------------------------
   Footer
   -------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: #ffffff;
  padding: 48px 0 32px;
  margin-top: 60px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
  padding-bottom: 32px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 24px;
}

.footer-tagline {
  max-width: 360px;
  font-size: 0.85rem;
  margin-top: 6px;
}

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

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

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

.footer-bottom {
  text-align: center;
  font-size: 0.82rem;
}

/* --------------------------------------------------
   Responsive Breakpoints
   -------------------------------------------------- */
@media (max-width: 900px) {
  .hero-post {
    grid-template-columns: 1fr;
  }
  .hero-img-wrap {
    min-height: 260px;
  }
  .hero-body {
    padding: 28px;
  }
  .article-title {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .site-nav {
    display: none;
  }
  .article-title {
    font-size: 1.8rem;
  }
}
