/* ================================================================
   PICLIVO — BLOG PAGE
================================================================ */

/* ---- Blog hero ---- */
.blog-hero {
  padding: 140px 0 72px;
  position: relative;
  overflow: hidden;
  background: var(--bg);
  text-align: center;
}
[data-theme="light"] .blog-hero {
  background: linear-gradient(155deg, #F4F0FF 0%, #FFF3FB 60%, #EEFAFF 100%);
}
.blog-hero .orb { z-index: 0; }
.blog-hero-inner { position: relative; z-index: 1; }
.blog-hero h1 {
  font-size: clamp(2.4rem, 4.5vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -.025em;
  margin-bottom: 18px;
}
.blog-hero p {
  font-size: 1.05rem;
  color: var(--text2);
  max-width: 500px;
  margin: 0 auto 36px;
  line-height: 1.75;
}
.blog-search {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 420px;
  margin: 0 auto;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: 13px;
  padding: 6px 8px 6px 16px;
  transition: border-color .2s;
}
.blog-search:focus-within { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(123,75,189,.1); }
.blog-search i   { color: var(--text3); font-size: .9rem; flex-shrink: 0; }
.blog-search input {
  flex: 1; border: none; outline: none;
  background: transparent;
  font-family: 'Inter', sans-serif;
  font-size: .9rem; color: var(--text);
}
.blog-search input::placeholder { color: var(--text3); }
.blog-search button {
  background: var(--grad); color: #fff;
  border: none; border-radius: 9px;
  padding: 8px 16px;
  font-family: 'Inter', sans-serif;
  font-size: .82rem; font-weight: 600;
  cursor: pointer;
  transition: opacity .2s;
}
.blog-search button:hover { opacity: .88; }

/* ---- Category filter ---- */
.cat-bar { padding: 32px 0 48px; }
.cat-bar-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.cat-btn {
  padding: 8px 18px;
  border-radius: 50px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text2);
  font-family: 'Inter', sans-serif;
  font-size: .82rem; font-weight: 600;
  cursor: pointer;
  transition: all .22s ease;
  white-space: nowrap;
}
.cat-btn:hover { border-color: var(--border2); color: var(--purple-light); background: rgba(123,75,189,.07); }
.cat-btn.active {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 3px 14px rgba(123,75,189,.35);
}

/* ---- Featured post ---- */
.featured-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text2);
}
.featured-label::before,
.featured-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.featured-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 64px;
  transition: all .3s ease;
}
.featured-card:hover { border-color: var(--border2); box-shadow: var(--card-hover); }

.featured-img {
  min-height: 320px;
  position: relative;
  overflow: hidden;
}
.post-img-bg {
  position: absolute; inset: 0;
  transition: transform .5s ease;
}
.featured-card:hover .post-img-bg { transform: scale(1.04); }

.post-img-bg.i1  { background: linear-gradient(135deg, #7B4BBD 0%, #E91E8C 60%, #F5A624 100%); }
.post-img-bg.i2  { background: linear-gradient(135deg, #4AC8E8 0%, #7B4BBD 100%); }
.post-img-bg.i3  { background: linear-gradient(135deg, #E91E8C 0%, #7B4BBD 60%, #4AC8E8 100%); }
.post-img-bg.i4  { background: linear-gradient(135deg, #F5A624 0%, #E91E8C 100%); }
.post-img-bg.i5  { background: linear-gradient(135deg, #7B4BBD 0%, #4AC8E8 100%); }
.post-img-bg.i6  { background: linear-gradient(135deg, #4AC8E8 0%, #F5A624 60%, #E91E8C 100%); }
.post-img-bg.i7  { background: linear-gradient(135deg, #E91E8C 0%, #F5A624 100%); }
.post-img-bg.i8  { background: linear-gradient(135deg, #7B4BBD 0%, #E91E8C 40%, #4AC8E8 100%); }

.post-img-pattern {
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.07'%3E%3Cpath d='M20 20.5V18H0v5h5v5H0v5h20v-9.5zm-2 4.5H5v-5h13v5zM15 0H0v20h5V5h10V0zm-5 15H5V5h5v10zM40 5.5V0H25v20h5v-5h10V5.5zm-5 4.5H30V5h5v5zm5 5h-5v5H25v5h15V15zm-5 10H30v-5h5v5z'/%3E%3C/g%3E%3C/svg%3E");
}

.featured-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: rgba(255,255,255,.25);
}

.featured-body {
  padding: 36px 36px 36px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.post-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 4px 11px;
  border-radius: 50px;
  margin-bottom: 14px;
}
.cat-ai       { background: rgba(74,200,232,.12);  color: var(--cyan);         border: 1px solid rgba(74,200,232,.22); }
.cat-tips     { background: rgba(123,75,189,.12);  color: var(--purple-light); border: 1px solid rgba(123,75,189,.22); }
.cat-stories  { background: rgba(245,166,36,.12);  color: var(--orange);       border: 1px solid rgba(245,166,36,.22); }
.cat-tutorial { background: rgba(233,30,140,.12);  color: var(--pink);         border: 1px solid rgba(233,30,140,.22); }
.cat-product  { background: rgba(34,197,94,.10);   color: #22C55E;             border: 1px solid rgba(34,197,94,.2);  }

.featured-body h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.018em;
  margin-bottom: 12px;
  line-height: 1.3;
}
.featured-body h2 a {
  text-decoration: none;
  color: var(--text);
  transition: color .2s;
}
.featured-body h2 a:hover { color: var(--purple-light); }

.post-excerpt {
  font-size: .88rem;
  color: var(--text2);
  line-height: 1.75;
  margin-bottom: 22px;
}
.post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.post-author {
  display: flex;
  align-items: center;
  gap: 9px;
}
.author-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.av1 { background: var(--grad); }
.av2 { background: var(--grad2); }
.av3 { background: var(--grad3); }
.av4 { background: linear-gradient(135deg,#E91E8C,#F5A624); }
.av5 { background: linear-gradient(135deg,#4AC8E8,#E91E8C); }
.av6 { background: linear-gradient(135deg,#7B4BBD,#F5A624); }

.author-info { line-height: 1.2; }
.author-name { font-size: .78rem; font-weight: 600; color: var(--text); }
.author-role { font-size: .7rem; color: var(--text2); }

.post-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: .75rem;
  color: var(--text3);
}
.post-meta span { display: flex; align-items: center; gap: 5px; }
.post-meta i    { font-size: .7rem; }

.read-more {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .84rem; font-weight: 600; color: var(--purple-light);
  text-decoration: none;
  transition: gap .2s;
}
.read-more:hover { gap: 10px; }
.read-more i { font-size: .76rem; }

/* ---- Posts grid ---- */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 64px;
}

.post-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  transition: all .3s ease;
  display: flex;
  flex-direction: column;
}
.post-card:hover { border-color: var(--border2); transform: translateY(-4px); box-shadow: var(--card-hover); }

.post-card-img {
  height: 180px;
  position: relative;
  overflow: hidden;
}
.post-card:hover .post-img-bg { transform: scale(1.06); }

.post-card-body {
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.post-card-body h3 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: 10px;
  line-height: 1.4;
  flex: 1;
}
.post-card-body h3 a {
  text-decoration: none;
  color: var(--text);
  transition: color .2s;
}
.post-card-body h3 a:hover { color: var(--purple-light); }
.post-card-body .post-excerpt {
  font-size: .82rem;
  margin-bottom: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* ---- Newsletter CTA ---- */
.blog-newsletter {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 52px 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 64px;
}
.blog-newsletter::before {
  content: '';
  position: absolute; top: -60px; right: -60px;
  width: 280px; height: 280px;
  background: var(--purple); border-radius: 50%;
  filter: blur(80px); opacity: .08; pointer-events: none;
}
.newsletter-text h2 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.018em; margin-bottom: 12px; }
.newsletter-text p  { font-size: .92rem; color: var(--text2); line-height: 1.75; }
.newsletter-form    { position: relative; z-index: 1; }
.newsletter-input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}
.newsletter-input-row input {
  flex: 1;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 11px;
  padding: 12px 16px;
  font-family: 'Inter', sans-serif;
  font-size: .9rem; color: var(--text);
  outline: none;
  transition: border-color .2s;
}
.newsletter-input-row input:focus { border-color: var(--purple); }
.newsletter-input-row input::placeholder { color: var(--text3); }
.newsletter-note { font-size: .74rem; color: var(--text3); }
.newsletter-note i { margin-right: 4px; }

/* ---- Load more / pagination ---- */
.blog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}
.pg-btn {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: .84rem; font-weight: 600; color: var(--text2);
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}
.pg-btn:hover  { border-color: var(--border2); color: var(--purple-light); background: rgba(123,75,189,.07); }
.pg-btn.active { background: var(--grad); border-color: transparent; color: #fff; }
.pg-btn.wide   { width: auto; padding: 0 16px; }

/* ---- Responsive ---- */
@media (max-width: 960px) {
  .featured-card { grid-template-columns: 1fr; }
  .featured-img  { min-height: 220px; }
  .posts-grid    { grid-template-columns: repeat(2, 1fr); }
  .blog-newsletter { grid-template-columns: 1fr; padding: 36px 28px; }
}
@media (max-width: 640px) {
  .posts-grid  { grid-template-columns: 1fr; }
  .blog-hero   { padding: 120px 0 48px; }
  .cat-bar     { padding: 20px 0 32px; }
  .featured-body { padding: 24px; }
  .blog-newsletter { padding: 28px 22px; }
  .newsletter-input-row { flex-direction: column; }
}
