/* ================================================= */
/* SHALOM LINK MISSION – FULL BLOG CSS (2025)        */
/* 3 Posts Per Row | Modern | Responsive | Premium   */
/* ================================================= */

@tailwind base;
@tailwind components;
@tailwind utilities;

/* =============== DESIGN TOKENS =============== */
:root {
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-text: #222222;
  --color-primary: #0092d7;
  --color-accent: #f97316;
  --color-muted: #777777;
  --color-border: #e5e7eb;
  --color-shadow: rgba(0, 0, 0, 0.08);

  --font-base: 'Inter', 'Helvetica Neue', sans-serif;
  --font-size-base: 16px;
  --line-height-base: 1.7;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-card: 0 4px 15px var(--color-shadow);
  --shadow-elevated: 0 10px 35px rgba(0, 0, 0, 0.15);

  --transition-fast: 0.2s ease;
  --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Support */
[data-theme="dark"] {
  --color-bg: #0f172a;
  --color-surface: #1e293b;
  --color-text: #f1f5f9;
  --color-muted: #94a3b8;
  --color-border: #334155;
  --color-shadow: rgba(0, 0, 0, 0.4);
}

/* =============== GLOBAL RESET & BASE =============== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: var(--font-size-base); }
body {
  font-family: var(--font-base);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: var(--line-height-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =============== BLOG LAYOUT =============== */
.blog-wrapper {
  display: flex;
  max-width: 1400px;
  margin: 3rem auto;
  gap: 3rem;
  padding: 0 1.5rem;
}

.blog-sidebar {
  flex: 0 0 220px;
  font-size: 0.95rem;
}

.blog-main {
  flex: 1;
  min-width: 0;
}

/* =============== SINGLE BLOG POST =============== */
.page-hero.blog-post-hero {
  padding: clamp(4rem, 6vw, 6rem) 0;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.2), transparent 32%),
    linear-gradient(135deg, var(--color-primary) 0%, #0f766e 50%, var(--color-accent) 100%);
  color: #ffffff;
  position: relative;
}

.page-hero.blog-post-hero::after {
  content: '';
  position: absolute;
  inset: auto -5% -20% auto;
  width: 240px;
  height: 240px;
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
  filter: blur(6px);
}

.page-hero-content {
  max-width: 860px;
  margin: 0 auto;
  text-align: center;
}

.blog-category {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.page-hero-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.16;
  margin-bottom: 1rem;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem 1rem;
  margin-top: 1.2rem;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.95);
}

.post-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.8rem;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.blog-post-section {
  padding: clamp(2.5rem, 4vw, 4rem) 0 5rem;
}

.blog-post-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.95fr);
  gap: 2rem;
  align-items: start;
}

.blog-post-main {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: clamp(1.25rem, 2vw, 2rem);
}

.post-featured-image {
  margin-bottom: 1.6rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #f8fafc;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.08);
}

.post-featured-image img {
  display: block;
  width: 100%;
  max-height: 470px;
  object-fit: cover;
}

.post-content.article-body {
  font-size: 1.03rem;
  line-height: 1.9;
  color: #334155;
}

.post-content.article-body p,
.post-content.article-body ul,
.post-content.article-body ol {
  margin-bottom: 1.15rem;
}

.post-content.article-body h2,
.post-content.article-body h3,
.post-content.article-body h4 {
  color: var(--color-text);
  margin: 1.7rem 0 0.75rem;
  line-height: 1.3;
  font-weight: 700;
}

.post-content.article-body h2 { font-size: 1.55rem; }
.post-content.article-body h3 { font-size: 1.3rem; }
.post-content.article-body h4 { font-size: 1.15rem; }

.post-content.article-body ul,
.post-content.article-body ol {
  padding-left: 1.2rem;
}

.post-content.article-body li {
  margin-bottom: 0.5rem;
}

.post-content.article-body img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  margin: 1.25rem 0;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.post-content.article-body blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.2rem;
  border-left: 4px solid var(--color-primary);
  background: #eff6ff;
  color: #334155;
  border-radius: 0 12px 12px 0;
  font-style: italic;
}

.post-content.article-body a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.18em;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
}

.tags-label {
  font-weight: 700;
  color: var(--color-text);
}

.tag-link {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: #eff6ff;
  color: var(--color-primary);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.tag-link:hover {
  background: var(--color-primary);
  color: #ffffff;
  transform: translateY(-1px);
}

.blog-post-section .blog-sidebar {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.35rem;
  position: sticky;
  top: 110px;
}

.blog-post-section .sidebar-widget {
  margin-bottom: 1.4rem;
  padding: 1rem;
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: var(--radius-md);
}

.blog-post-section .sidebar-widget:last-child {
  margin-bottom: 0;
}

.blog-post-section .widget-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.9rem;
  padding-bottom: 0;
  border-bottom: none;
  color: var(--color-primary);
}

.author-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}

.author-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #e0f2fe;
  box-shadow: 0 8px 20px rgba(0, 146, 215, 0.16);
}

.author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-info h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}

.author-info p {
  font-size: 0.92rem;
  color: #64748b;
}

.recent-post {
  margin-bottom: 0.8rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--color-border);
}

.recent-post:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.recent-post-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
}

.recent-post-link:hover {
  color: var(--color-primary);
  transform: translateX(3px);
}

.recent-post-image {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 0.65rem;
  flex-shrink: 0;
}

.recent-post h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.recent-post-date {
  font-size: 0.82rem;
  color: #64748b;
}

.cta {
  padding: 0 0 2rem;
}

.cta-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid var(--color-border);
  border-radius: 1.5rem;
  box-shadow: var(--shadow-card);
  padding: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.cta-card .card-title {
  color: var(--color-text);
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.cta-card .card-text {
  color: #64748b;
}

.cta-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.cta-input {
  min-width: min(280px, 100%);
  padding: 0.85rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: #ffffff;
}

.cta-btn {
  border-radius: 999px;
  padding: 0.85rem 1.25rem;
  font-weight: 700;
}

/* Responsive: Stack on tablet & mobile */
@media (max-width: 992px) {
  .blog-wrapper {
    flex-direction: column;
    gap: 2rem;
  }
  .blog-sidebar {
    order: -1;
    flex: none;
  }
}

/* =============== TYPOGRAPHY =============== */
h1.page-title {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: var(--space-xl);
  text-align: center;
}

/* =============== POSTS GRID – 3 PER ROW =============== */
.posts-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 auto;
}

/* Tablet: 2 columns */
@media (max-width: 1024px) {
  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile: 1 column */
@media (max-width: 640px) {
  .posts-grid {
    grid-template-columns: 1fr;
    gap: 1.8rem;
  }
}

/* =============== POST CARD – PREMIUM DESIGN =============== */
.post-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-smooth);
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--color-border);
}

.post-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-elevated);
  border-color: transparent;
}

/* Image */
.post-card .aspect-video {
  position: relative;
  height: 230px;
  overflow: hidden;
  background: #f1f5f9;
}

.post-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.post-card:hover img {
  transform: scale(1.1);
}

/* Content */
.post-card > div {
  padding: 1.6rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* Category Badge */
.post-card .post-cat {
  background: #dbeafe;
  color: #1d4ed8;
  padding: 0.35rem 0.75rem;
  border-radius: 0.375rem;
  font-weight: 600;
  font-size: 0.8rem;
  align-self: flex-start;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

[data-theme="dark"] .post-cat {
  background: #1e40af;
  color: #dbeafe;
}

/* Title */
.post-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 1rem 0 0.75rem;
  line-height: 1.4;
  color: inherit;
}

.post-card h3 a {
  color: inherit;
  transition: color var(--transition-fast);
}

.post-card h3 a:hover {
  color: var(--color-primary);
}

/* Excerpt */
.post-card .post-excerpt {
  color: #4b5563;
  font-size: 0.975rem;
  line-height: 1.65;
  margin-bottom: 1rem;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

[data-theme="dark"] .post-card .post-excerpt {
  color: #cbd5e1;
}

/* Read More – Always at bottom */
.post-card .read-more-wrapper {
  margin-top: auto;
  padding-top: 1.2rem;
  text-align: right;
}

.post-card .read-more {
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.post-card .read-more:hover {
  color: var(--color-accent);
  gap: 0.6rem;
}

.post-card .read-more svg {
  width: 1.1em;
  height: 1.1em;
  transition: transform 0.3s ease;
}

.post-card .read-more:hover svg {
  transform: translateX(5px);
}

/* =============== SIDEBAR =============== */
.blog-sidebar .sidebar-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 1.2rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--color-accent);
  display: inline-block;
}

.cat-list {
  list-style: none;
}

.cat-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  color: var(--color-text);
  font-weight: 500;
  border-bottom: 1px solid var(--color-border);
  transition: all var(--transition-fast);
}

.cat-link:hover,
.cat-link.active {
  color: var(--color-accent);
  padding-left: 0.5rem;
}

.cat-link .count {
  background: var(--color-primary);
  color: white;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  min-width: 28px;
  text-align: center;
}

/* =============== LOAD MORE =============== */
.load-more-wrap {
  text-align: center;
  margin-top: var(--space-2xl);
}

.btn-load-more {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 1rem 2.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all var(--transition-smooth);
  box-shadow: 0 4px 15px rgba(0, 146, 215, 0.3);
}

.btn-load-more:hover {
  background: var(--color-accent);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(249, 115, 22, 0.3);
}

.btn-load-more:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  transform: none;
}

/* =============== DARK MODE =============== */
[data-theme="dark"] .post-card,
[data-theme="dark"] .blog-sidebar,
[data-theme="dark"] .blog-main {
  background: var(--color-surface);
  border-color: var(--color-border);
}

[data-theme="dark"] h1.page-title {
  color: #e2e8f0;
}

[data-theme="dark"] .btn-load-more {
  background: var(--color-accent);
}

/* =============== RESPONSIVE TWEAKS =============== */
@media (max-width: 992px) {
  .blog-post-grid {
    grid-template-columns: 1fr;
  }

  .blog-post-section .blog-sidebar {
    position: static;
  }
}

@media (max-width: 480px) {
  h1.page-title { font-size: 2.2rem; }
  .post-card .aspect-video { height: 200px; }
  .post-card > div { padding: 1.2rem; }
  .blog-post-main {
    padding: 1rem;
  }
  .cta-card {
    padding: 1.25rem;
  }
  .cta-form {
    width: 100%;
  }
  .cta-input {
    width: 100%;
  }
}

/* =============== ACTIVE CATEGORY – GORGEOUS & CLEAR =============== */
.cat-link {
    position: relative;
    overflow: hidden;
}

.cat-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 0;
    background: white;
    border-radius: 0 4px 4px 0;
    transition: height 0.4s ease;
}

.cat-link.active::before {
    height: 60%;
}

.cat-link.active {
    transform: translateX(6px);
    box-shadow: 0 8px 25px rgba(0, 146, 215, 0.25) !important;
}

.cat-link:hover:not(.active) {
    transform: translateX(4px);
}

/* Optional: Pulse animation on active */
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 8px 25px rgba(0, 146, 215, 0.25); }
    50% { box-shadow: 0 8px 35px rgba(0, 146, 215, 0.4); }
}
.cat-link.active {
    animation: pulseGlow 4s infinite;
}