/* ═══════════════════════════════════════════════════════
   BLOG.CSS — Rupesh Technologies
   Full redesign with professional post card images
═══════════════════════════════════════════════════════ */

/* ── GOOGLE FONTS already loaded in PHP ── */

/* ══════════════════════════════════════
   RESET & BASE
══════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --blog-bg:       #f4f1ec;
  --blog-card:     #ffffff;
  --blog-ink:      #1a1a2e;
  --blog-ink2:     #4a4a6a;
  --blog-muted:    #9090a8;
  --blog-accent:   #e63946;
  --blog-gold:     #f4a261;
  --blog-teal:     #2a9d8f;
  --blog-dark:     #16213e;
  --blog-border:   rgba(0,0,0,0.08);
  --blog-shadow:   0 2px 20px rgba(0,0,0,0.08);
  --blog-shadow-h: 0 8px 40px rgba(0,0,0,0.15);
  --ease:          cubic-bezier(.4,0,.2,1);
  --radius:        14px;
}

/* ══════════════════════════════════════
   HERO BANNER
══════════════════════════════════════ */
.blog-hero {
  background: linear-gradient(135deg, #16213e 0%, #1a1a2e 50%, #0f3460 100%);
  padding: 72px 24px 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.blog-hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}
.blog-hero::after {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230,57,70,0.12) 0%, transparent 70%);
  top: 50%; left: 50%; transform: translate(-50%,-50%);
  pointer-events: none;
}
.blog-hero-inner {
  position: relative; z-index: 1;
  max-width: 680px; margin: 0 auto;
}
.blog-hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(230,57,70,0.12);
  border: 1px solid rgba(230,57,70,0.3);
  border-radius: 99px;
  padding: 5px 16px;
  font-size: 11px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: #f4a261; margin-bottom: 20px;
}
.blog-hero-eyebrow span {
  width: 6px; height: 6px; border-radius: 50%;
  background: #f4a261;
  animation: hblink 2s infinite;
}
@keyframes hblink { 0%,100%{opacity:1}50%{opacity:.3} }

.blog-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(30px, 5vw, 50px);
  color: #fff; line-height: 1.15;
  margin-bottom: 16px; font-weight: 700;
}
.blog-hero h1 em {
  font-style: italic;
  background: linear-gradient(135deg, #f4a261, #e63946);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.blog-hero p {
  font-size: 15px; color: rgba(255,255,255,0.55);
  line-height: 1.7; margin-bottom: 32px;
}

/* Search bar */
.blog-search {
  display: flex; gap: 0;
  max-width: 520px; margin: 0 auto;
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}
.blog-search input {
  flex: 1;
  background: rgba(255,255,255,0.96);
  border: none; outline: none;
  padding: 14px 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px; color: #1a1a2e;
}
.blog-search input::placeholder { color: #9090a8; }
.blog-search button {
  background: linear-gradient(135deg, #e63946, #c1121f);
  border: none; padding: 14px 22px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 700;
  color: #fff; cursor: pointer;
  white-space: nowrap;
  transition: opacity .2s;
}
.blog-search button:hover { opacity: .88; }

/* ══════════════════════════════════════
   LAYOUT
══════════════════════════════════════ */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* Section labels */
.section-eyebrow {
  font-size: 11px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
  color: #e63946; margin-bottom: 6px;
}
.section-heading {
  font-family: 'Playfair Display', serif;
  font-size: 28px; font-weight: 700;
  color: var(--blog-ink);
  margin-bottom: 28px;
  display: flex; align-items: baseline; gap: 14px;
  border-bottom: 2px solid #f4f1ec;
  padding-bottom: 14px;
}
.section-heading small {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px; font-weight: 500;
  color: var(--blog-muted); margin-left: auto;
}

/* ══════════════════════════════════════
   POST CARD  ← KEY IMPROVEMENT
══════════════════════════════════════ */
.post-card {
  background: var(--blog-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--blog-shadow);
  margin-bottom: 28px;
  border: 1px solid var(--blog-border);
  display: grid;
  grid-template-columns: 1fr;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--blog-shadow-h);
}

/* ── IMAGE WRAP — controlled height ── */
.post-card-img-wrap {
  position: relative;
  width: 100%;
  height: 240px;          /* FIXED height — no more giant images */
  overflow: hidden;
  background: #1a1a2e;    /* fallback while loading */
}
.post-card-img-wrap::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(
    180deg,
    transparent 40%,
    rgba(10,10,30,0.55) 100%
  );
  pointer-events: none;
}
.post-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;          /* crop nicely — no stretch */
  object-position: center top;
  display: block;
  transition: transform .5s var(--ease);
  filter: brightness(0.92) saturate(1.05);
}
.post-card:hover .post-card-img-wrap img {
  transform: scale(1.04);
}

/* Category ribbon on image */
.post-cat-ribbon {
  position: absolute;
  top: 14px; left: 14px;
  z-index: 2;
  display: inline-flex; align-items: center;
  background: linear-gradient(135deg, #e63946, #c1121f);
  color: #fff;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 2px 12px rgba(230,57,70,0.4);
  transition: opacity .2s;
}
.post-cat-ribbon:hover { opacity: .88; color: #fff; text-decoration: none; }

/* ── CARD BODY ── */
.post-card-body {
  padding: 22px 24px 20px;
}

/* Meta row — author + date */
.post-meta-row {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px; flex-wrap: wrap;
}
.author-link {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none;
}
.author-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #e63946, #f4a261);
  color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.author-name {
  font-size: 13px; font-weight: 600;
  color: var(--blog-ink); transition: color .2s;
}
.author-link:hover .author-name { color: #e63946; }
.post-date {
  font-size: 12px; color: var(--blog-muted);
  margin-left: auto; display: flex; align-items: center; gap: 4px;
}

/* Title */
.post-card-body h2 {
  font-family: 'Playfair Display', serif;
  font-size: 20px; font-weight: 700;
  color: var(--blog-ink); line-height: 1.35;
  margin-bottom: 10px;
  border: none; padding: 0;
}
.post-card-body h2:hover { color: #e63946; }

/* Excerpt */
.excerpt {
  font-size: 14px; color: var(--blog-ink2);
  line-height: 1.7; margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Footer row */
.post-card-footer {
  display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(0,0,0,0.06);
}
.comment-badge {
  font-size: 12px; color: var(--blog-muted);
  display: flex; align-items: center; gap: 5px;
  background: #f4f1ec; border-radius: 99px;
  padding: 4px 12px;
}
.read-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: linear-gradient(135deg, #16213e, #1a1a2e);
  color: #fff;
  border-radius: 8px; padding: 9px 18px;
  font-size: 13px; font-weight: 600;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
}
.read-btn svg {
  width: 14px; height: 14px;
  transition: transform .2s;
}
.read-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(22,33,62,0.25);
  color: #fff; text-decoration: none;
}
.read-btn:hover svg { transform: translateX(3px); }

/* ══════════════════════════════════════
   PAGINATION
══════════════════════════════════════ */
.blog-pagination {
  display: flex; flex-wrap: wrap; gap: 8px;
  list-style: none; padding: 0; margin: 32px 0 0;
}
.page-link {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  background: #fff; border: 1px solid var(--blog-border);
  border-radius: 8px; font-size: 13px; font-weight: 600;
  color: var(--blog-ink2); text-decoration: none;
  transition: all .2s;
}
.page-link:hover, .page-item.active .page-link {
  background: #e63946; color: #fff;
  border-color: #e63946; text-decoration: none;
}

/* ══════════════════════════════════════
   SIDEBAR
══════════════════════════════════════ */
.sidebar { display: flex; flex-direction: column; gap: 22px; }

.widget {
  background: var(--blog-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--blog-shadow);
  border: 1px solid var(--blog-border);
}
.widget-head {
  padding: 13px 18px;
  font-size: 13px; font-weight: 700;
  letter-spacing: .05em;
  display: flex; align-items: center; gap: 7px;
}
.widget-head.dark   { background: #16213e; color: #fff; }
.widget-head.red    { background: #e63946; color: #fff; }
.widget-head.gold   { background: linear-gradient(135deg,#f4a261,#e63946); color: #fff; }
.widget-body { padding: 16px 18px; }

/* Channel GIF */
.channel-gif {
  border-radius: 10px; overflow: hidden;
  margin-bottom: 14px; height: 160px;
}
.channel-gif img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.channel-desc {
  font-size: 13px; color: var(--blog-ink2);
  line-height: 1.7; margin-bottom: 14px;
}

/* CTA buttons */
.cta-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 8px; padding: 10px 16px;
  font-size: 13px; font-weight: 600;
  text-decoration: none; margin-bottom: 8px;
  transition: opacity .2s, transform .15s;
}
.cta-btn:hover { opacity: .88; transform: translateY(-1px); text-decoration: none; }
.btn-yt   { background: #e63946; color: #fff; }
.btn-dark { background: #16213e; color: #fff; }
.btn-ig   { background: linear-gradient(135deg,#833ab4,#fd1d1d,#fcb045); color: #fff; }
.btn-fb   { background: #1877f2; color: #fff; }

/* Email sub */
.email-sub {
  display: flex; gap: 0; margin-top: 10px;
  border-radius: 8px; overflow: hidden;
  border: 1px solid var(--blog-border);
}
.email-sub input {
  flex: 1; border: none; outline: none;
  padding: 9px 12px; font-size: 12px;
  font-family: 'DM Sans', sans-serif; color: var(--blog-ink);
}
.email-sub button {
  background: #e63946; border: none; color: #fff;
  padding: 9px 14px; font-size: 12px; font-weight: 700;
  cursor: pointer; transition: opacity .2s;
}
.email-sub button:hover { opacity: .88; }

/* Categories */
.cat-list { list-style: none; padding: 0; margin: 0; }
.cat-list li { border-bottom: 1px solid var(--blog-border); }
.cat-list li:last-child { border-bottom: none; }
.cat-list a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 4px;
  font-size: 13px; color: var(--blog-ink2);
  text-decoration: none; transition: color .15s, padding-left .15s;
}
.cat-list a:hover { color: #e63946; padding-left: 6px; }
.cat-count {
  font-size: 16px; color: var(--blog-muted);
  transition: transform .15s;
}
.cat-list a:hover .cat-count { transform: translateX(3px); }

/* Recent posts */
.recent-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--blog-border);
}
.recent-item:last-child { border-bottom: none; padding-bottom: 0; }
.recent-thumb {
  width: 60px; height: 50px; border-radius: 8px;
  object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--blog-border);
}
.recent-title {
  font-size: 13px; font-weight: 600; color: var(--blog-ink);
  line-height: 1.4; text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.recent-title:hover { color: #e63946; }
.recent-date { font-size: 11px; color: var(--blog-muted); margin-top: 4px; }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 900px) {
  .blog-layout {
    grid-template-columns: 1fr;
    padding: 32px 16px 60px;
  }
  .sidebar { order: 2; }
  .blog-main { order: 1; }
}

@media (max-width: 600px) {
  .blog-hero { padding: 48px 16px 40px; }
  .blog-hero h1 { font-size: 26px; }
  .post-card-img-wrap { height: 200px; }
  .post-card-body { padding: 16px; }
  .post-card-body h2 { font-size: 17px; }
  .blog-search { flex-direction: column; border-radius: 10px; }
  .blog-search input { border-radius: 10px 10px 0 0; }
  .blog-search button { border-radius: 0 0 10px 10px; }
}