/* =============================================
   LoomPay Blog Design — loompay.pro
   Matches site brand: purple accent, dark tones, Roboto
   ============================================= */

:root {
  --lp-purple: #A886CD;
  --lp-purple-light: #c4a8e4;
  --lp-dark: #1a1a2e;
  --lp-darker: #0f0f1a;
  --lp-text: #e0e0e0;
  --lp-text-muted: #9a9ab0;
  --lp-card-bg: #16213e;
  --lp-card-border: rgba(168, 134, 205, 0.15);
  --lp-radius: 12px;
  --lp-max-width: 1200px;
  --lp-content-width: 780px;
}

/* ── Blog Archive Page ── */

.lp-blog-archive {
  max-width: var(--lp-max-width);
  margin: 0 auto;
  padding: 40px 24px 80px;
  font-family: "Roboto", sans-serif;
}

.lp-blog-header {
  text-align: center;
  margin-bottom: 48px;
  padding: 48px 20px;
  background: linear-gradient(135deg, var(--lp-darker), var(--lp-dark));
  border-radius: var(--lp-radius);
  border: 1px solid var(--lp-card-border);
}

.lp-blog-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 12px;
}

.lp-blog-header p {
  font-size: 1.1rem;
  color: var(--lp-text-muted);
  margin: 0;
}

/* ── Post Grid ── */

.lp-post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 32px;
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ── Post Card ── */

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

.lp-post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(168, 134, 205, 0.15);
}

.lp-post-card a {
  text-decoration: none;
  color: inherit;
}

.lp-post-card .lp-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  position: relative;
}

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

.lp-post-card:hover .lp-card-thumb img {
  transform: scale(1.05);
}

.lp-post-card .lp-card-thumb .lp-placeholder-thumb {
  border-radius: 0 !important;
}

.lp-card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

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

.lp-card-meta .lp-meta-dot {
  width: 3px;
  height: 3px;
  background: var(--lp-text-muted);
  border-radius: 50%;
}

.lp-card-body h2 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  color: #fff;
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lp-card-body h2 a {
  color: #fff;
}

.lp-card-body h2 a:hover {
  color: var(--lp-purple-light);
}

.lp-card-excerpt {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--lp-text-muted);
  margin: 0 0 16px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lp-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.lp-read-more {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--lp-purple);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.lp-read-more:hover {
  color: var(--lp-purple-light);
}

.lp-read-more svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
}

.lp-read-more:hover svg {
  transform: translateX(3px);
}

.lp-reading-time {
  font-size: 0.82rem;
  color: var(--lp-text-muted);
}

/* ── Pagination ── */

.lp-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
}

.lp-pagination a,
.lp-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}

.lp-pagination a {
  background: var(--lp-card-bg);
  border: 1px solid var(--lp-card-border);
  color: var(--lp-text);
}

.lp-pagination a:hover {
  background: var(--lp-purple);
  color: #fff;
  border-color: var(--lp-purple);
}

.lp-pagination span.current {
  background: var(--lp-purple);
  color: #fff;
}

/* ── Single Post ── */

.lp-single-post {
  max-width: var(--lp-content-width);
  margin: 0 auto;
  padding: 40px 24px 80px;
  font-family: "Roboto", sans-serif;
}

/* Back link */
.lp-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--lp-purple);
  text-decoration: none;
  margin-bottom: 32px;
  transition: color 0.2s;
}

.lp-back-link:hover {
  color: var(--lp-purple-light);
}

/* Post header */
.lp-post-header {
  margin-bottom: 32px;
}

.lp-post-header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
  margin: 0 0 16px;
}

.lp-post-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.88rem;
  color: var(--lp-text-muted);
  flex-wrap: wrap;
}

.lp-post-meta .lp-meta-sep {
  width: 4px;
  height: 4px;
  background: var(--lp-text-muted);
  border-radius: 50%;
}

/* Featured image */
.lp-featured-image {
  margin-bottom: 36px;
  border-radius: var(--lp-radius);
  overflow: hidden;
  border: 1px solid var(--lp-card-border);
}

.lp-featured-image img {
  width: 100%;
  height: auto;
  display: block;
}

.lp-featured-image .lp-placeholder-thumb {
  aspect-ratio: 16/9;
}

/* Post content */
.lp-post-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--lp-text);
}

.lp-post-content h2 {
  font-size: 1.6rem;
  font-weight: 600;
  color: #fff;
  margin: 2.5em 0 0.8em;
  padding-bottom: 0.4em;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.lp-post-content h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #fff;
  margin: 2em 0 0.6em;
}

.lp-post-content h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin: 1.5em 0 0.5em;
}

.lp-post-content p {
  margin: 0 0 1.2em;
}

.lp-post-content a {
  color: var(--lp-purple-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lp-post-content a:hover {
  color: var(--lp-purple);
}

.lp-post-content ul,
.lp-post-content ol {
  margin: 0 0 1.5em;
  padding-left: 1.5em;
}

.lp-post-content li {
  margin-bottom: 0.5em;
}

.lp-post-content blockquote {
  border-left: 3px solid var(--lp-purple);
  margin: 1.5em 0;
  padding: 1em 1.5em;
  background: rgba(168, 134, 205, 0.08);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--lp-text-muted);
}

.lp-post-content pre,
.lp-post-content code {
  background: var(--lp-darker);
  border-radius: 6px;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.9rem;
}

.lp-post-content code {
  padding: 2px 6px;
}

.lp-post-content pre {
  padding: 16px 20px;
  overflow-x: auto;
  margin: 1.5em 0;
  border: 1px solid var(--lp-card-border);
}

.lp-post-content pre code {
  padding: 0;
  background: none;
}

.lp-post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1em 0;
}

.lp-post-content hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin: 2em 0;
}

.lp-post-content strong {
  color: #fff;
  font-weight: 600;
}

/* Tags */
.lp-post-tags {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lp-post-tags a {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(168, 134, 205, 0.12);
  color: var(--lp-purple-light);
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}

.lp-post-tags a:hover {
  background: var(--lp-purple);
  color: #fff;
}

/* Post navigation */
.lp-post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.lp-post-nav a {
  display: block;
  padding: 20px;
  background: var(--lp-card-bg);
  border: 1px solid var(--lp-card-border);
  border-radius: var(--lp-radius);
  text-decoration: none;
  transition: all 0.2s;
}

.lp-post-nav a:hover {
  border-color: var(--lp-purple);
  transform: translateY(-2px);
}

.lp-post-nav .lp-nav-label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--lp-text-muted);
  margin-bottom: 8px;
}

.lp-post-nav .lp-nav-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 500;
  color: #fff;
  line-height: 1.4;
}

.lp-post-nav .lp-nav-next {
  text-align: right;
}

/* CTA box at bottom of post */
.lp-post-cta {
  margin-top: 48px;
  padding: 32px;
  background: linear-gradient(135deg, rgba(168, 134, 205, 0.15), rgba(110, 193, 228, 0.1));
  border: 1px solid var(--lp-card-border);
  border-radius: var(--lp-radius);
  text-align: center;
}

.lp-post-cta h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #fff;
  margin: 0 0 8px;
}

.lp-post-cta p {
  font-size: 0.95rem;
  color: var(--lp-text-muted);
  margin: 0 0 20px;
}

.lp-post-cta .lp-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--lp-purple);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.2s;
}

.lp-post-cta .lp-cta-btn:hover {
  background: var(--lp-purple-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(168, 134, 205, 0.3);
}

/* ── Responsive ── */

@media (max-width: 768px) {
  .lp-post-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .lp-blog-header h1 {
    font-size: 1.8rem;
  }

  .lp-post-header h1 {
    font-size: 1.6rem;
  }

  .lp-post-content {
    font-size: 1rem;
  }

  .lp-post-nav {
    grid-template-columns: 1fr;
  }

  .lp-post-nav .lp-nav-next {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .lp-blog-archive,
  .lp-single-post {
    padding: 20px 16px 60px;
  }

  .lp-blog-header {
    padding: 32px 16px;
  }

  .lp-card-body {
    padding: 16px;
  }
}

/* ── Fix for Elementor overrides ── */

/* Dark background for blog pages (other pages use Elementor sections for dark bg) */
body.blog,
body.archive,
body.single-post,
body.search {
  background: var(--lp-dark) !important;
}

body.blog .site-main,
body.archive .site-main,
body.single-post .site-main {
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Hide default WP title that Hello Elementor adds */
body.blog .page-header .entry-title,
body.archive .page-header .entry-title,
body.single-post .page-header .entry-title {
  display: none;
}

/* Fix Elementor-added header spacing on blog */
body.blog .elementor-location-header + .site-main,
body.archive .elementor-location-header + .site-main,
body.single-post .elementor-location-header + .site-main {
  margin-top: 0 !important;
}

/* Ensure links in post content are readable on dark bg */
body.single-post .entry-content a,
body.single-post .page-content a {
  color: var(--lp-purple-light);
}
