/* =========================================
   BLOG INDEX, POST CARDS & CPT MODULE
   ========================================= */

/* ---------- GLOBAL BLOG WRAPPER ---------- */
.datochai-blog-wrapper {
  padding-top: 50px;
  padding-bottom: 80px;
}

/* =========================================
   1. BLOG HERO SECTION
   ========================================= */
.blog-hero-section {
  margin-bottom: 80px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--color-border-secondary);
}

.hero-content-wrapper {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.blog-hero-title {
  font-family: 'Degular Display', system-ui, sans-serif;
  font-size: 46px;
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 15px 0;
}

.blog-hero-title .title-part-1 {
  color: var(--color-text-primary);
}
.blog-hero-title .title-part-2 {
  color: var(--color-accent);
}

.blog-hero-desc {
  font-size: 18px;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0 auto;
}

.hero-interactions {
  margin-top: 25px;
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-interactions .interact-btn {
  font-size: 15px;
  background: var(--color-surface-tertiary);
  border: 1px solid var(--color-border-secondary);
  padding: 10px 20px;
  border-radius: 30px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.hero-interactions .interact-btn svg,
.hero-interactions .interact-btn .icon-svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  transition: fill 0.2s ease;
}

.hero-interactions .interact-btn:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(211, 47, 47, 0.1);
  color: var(--color-accent);
}

/* =========================================
   2. PILLAR HUB (TOPIC NAVIGATION)
   ========================================= */
.blog-pillar-hub {
  margin-top: 50px;
  margin-bottom: 50px;
  background: var(--color-surface-tertiary);
  padding: 30px;
  border-radius: 12px;
  border: 1px dashed var(--color-border-secondary);
}

.blog-pillar-hub .lottery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 15px;
}

.blog-pillar-hub .lottery-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  text-align: center;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  background-color: #ffffff;
  color: #000000;
}

.blog-pillar-hub .lottery-btn:hover {
  background-color: var(--color-accent);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(211, 47, 47, 0.4);
}

body.light-theme .blog-pillar-hub .lottery-btn,
body[data-theme="light"] .blog-pillar-hub .lottery-btn {
  background-color: var(--color-accent);
  color: #ffffff;
  border-color: var(--color-accent);
}

body.light-theme .blog-pillar-hub .lottery-btn:hover,
body[data-theme="light"] .blog-pillar-hub .lottery-btn:hover {
  background-color: #ffffff;
  color: var(--color-accent);
  border-color: var(--color-accent);
  box-shadow: 0 4px 15px rgba(211, 47, 47, 0.2);
}

/* =========================================
   3. SECTION HEADERS
   ========================================= */
.blog-section {
  margin-bottom: 60px;
}

.section-header-wrap {
  text-align: center;
  max-width: 750px;
  margin: 0 auto 40px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section-title {
  font-family: 'Degular Display', system-ui, sans-serif;
  font-size: 30px;
  font-weight: 800;
  margin: 0 auto 15px auto;
  color: var(--color-text-primary);
  text-transform: capitalize;
  position: relative;
  text-align: center;
  padding-bottom: 12px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: var(--color-accent);
  border-radius: 2px;
}

.section-description {
  font-size: 16px;
  color: var(--color-text-secondary);
  margin: 0 auto;
  line-height: 1.6;
}

/* =========================================
   4. LARGE FEATURED CARD
   ========================================= */
.large-featured-card {
  grid-column: 1 / -1;
  flex-direction: row;
  border: 1px solid var(--color-accent);
}

.large-featured-card .post-card-thumbnail {
  flex: 0 0 45%;
  min-height: 320px;
  background: rgba(0, 0, 0, 0.15);
  padding: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.large-featured-card .post-card-thumbnail img {
  height: 100%;
  width: 100%;
  border-radius: 15px;
  max-height: 320px;
  object-fit: contain !important;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.05));
}

.large-featured-card .post-card-content {
  flex: 1;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.large-featured-card h3.post-card-title {
  font-size: 2.2rem !important;
  margin-bottom: 20px !important;
}

/* =========================================
   5. UNIFIED RESPONSIVE BREAKPOINTS
   ========================================= */
@media (max-width: 1024px) {
  .post-grid,
  .latest-posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .large-featured-card {
    grid-column: 1 / -1;
  }
  .blog-pillar-hub .lottery-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
}

@media (max-width: 768px) {
  .post-grid,
  .latest-posts-grid {
    grid-template-columns: 1fr;
  }
  .large-featured-card {
    flex-direction: column;
  }
  .large-featured-card .post-card-thumbnail {
    flex: auto;
    min-height: 200px;
    padding: 20px;
  }
  .large-featured-card .post-card-thumbnail img {
    height: 220px;
    max-height: 220px;
    object-fit: cover !important;
    border-radius: 12px;
  }
  .large-featured-card .post-card-content {
    padding: 25px;
  }
  .large-featured-card h3.post-card-title {
    font-size: 20px !important;
  }

  .blog-hero-title {
    font-size: 32px;
  }
  .blog-hero-desc {
    font-size: 16px;
  }
  .section-title {
    font-size: 24px;
  }
  .hero-interactions {
    gap: 10px;
  }
  .hero-interactions .interact-btn {
    font-size: 14px;
    padding: 8px 16px;
  }

  .blog-pillar-hub .lottery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .blog-pillar-hub .lottery-btn {
    font-size: 0.85rem;
    padding: 10px 8px;
  }
}

/* =========================================
   SINGLE RAMALAN (CPT) MODULE STYLES
   ========================================= */

.prediction-single-view {
  padding: 40px 0;
  background: var(--color-surface-secondary);
}
.cpt-main-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.cpt-layout-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
}
.cpt-content-column {
  flex: 1;
  min-width: 0;
  max-width: 800px;
}
.cpt-sidebar {
  flex: 0 0 320px;
  width: 320px;
}

.cpt-breadcrumb-header {
  padding: 0 0 20px 0;
  text-align: left;
  border: none;
}
.cpt-breadcrumb-header a {
  color: var(--color-accent);
  text-decoration: none;
}
.cpt-breadcrumb-header .current-page {
  color: var(--color-text-primary);
}
.cpt-ad-box {
  margin-bottom: 30px;
  text-align: center;
  width: 100%;
  min-height: 90px;
  background: rgba(128, 128, 128, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}
.cpt-ad-box-large {
  min-height: 250px;
  border: 1px dashed rgba(128, 128, 128, 0.3);
  margin: 30px 0;
}
.ad-placeholder {
  color: gray;
}

.cpt-glass-card {
  background: var(--color-surface-primary);
  padding: 35px 25px;
  border-radius: 12px;
  border: 1px solid var(--color-border-secondary);
  border-top: 4px solid var(--color-accent);
  margin-bottom: 25px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.cpt-card-header {
  text-align: center;
  margin-bottom: 35px;
}
.cpt-logo {
  max-height: 70px;
  margin-bottom: 15px;
  object-fit: contain;
}
.cpt-title {
  margin: 0 0 15px 0;
  font-size: 32px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--color-text-primary);
}

.cpt-meta-flex {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-weight: 600;
  color: var(--color-text-secondary);
  flex-wrap: wrap;
}
.cpt-meta-flex .meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cpt-svg-icon {
  color: var(--color-accent);
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.meta-highlight {
  color: var(--color-text-primary);
}
.meta-success {
  color: #48bb78;
}

.cpt-prizes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}
.cpt-prize-box {
  background: var(--color-surface-tertiary);
  border: 1px solid var(--color-border-secondary);
  padding: 20px 15px;
  text-align: center;
  border-radius: 10px;
}
.cpt-prize-box.cpt-prize-1 {
  border: 2px solid var(--color-accent);
  box-shadow: 0 10px 20px rgba(211, 47, 47, 0.1);
}
.prize-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.cpt-prize-1 .prize-label {
  color: var(--color-accent);
  font-size: 14px;
}
.prize-number {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--color-text-primary);
  letter-spacing: 2px;
}
.cpt-prize-1 .prize-number {
  font-size: 36px;
}

.cpt-secondary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.cpt-secondary-box {
  background: var(--color-surface-tertiary);
  border: 1px solid var(--color-border-secondary);
  padding: 20px;
  border-radius: 10px;
  text-align: center;
}
.secondary-title {
  margin: 0 0 15px 0;
  font-size: 16px;
  color: var(--color-text-primary);
  border-bottom: 1px dashed var(--color-border-secondary);
  padding-bottom: 10px;
}
.secondary-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.cpt-badge {
  background: var(--color-surface-secondary);
  border: 1px solid var(--color-border-secondary);
  padding: 5px 12px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 16px;
  color: var(--color-text-primary);
}

.cpt-watermark {
  text-align: center;
  margin-top: 35px;
  padding-top: 20px;
  border-top: 1px dashed var(--color-border-secondary);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
}
.cpt-watermark span {
  color: var(--color-accent);
}

.datochai-download-btn,
.cpt-download-btn {
  width: 100%;
  margin-bottom: 30px;
  padding: 18px;
  background: var(--color-accent);
  color: #ffffff !important;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 15px rgba(211, 47, 47, 0.3);
}
button.datochai-download-btn,
button.cpt-download-btn {
  background: var(--color-accent) !important;
  color: #ffffff !important;
  border: none !important;
}
button.datochai-download-btn svg,
button.cpt-download-btn svg {
  stroke: currentColor;
}
.datochai-download-btn svg,
.cpt-download-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.datochai-download-btn:hover,
.cpt-download-btn:hover {
  background: var(--color-accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(211, 47, 47, 0.5);
}
.datochai-download-btn:active,
.cpt-download-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 15px rgba(211, 47, 47, 0.3);
}

.related-strict-grid .datochai-post-card .post-card-thumbnail img,
.related-strict-grid .datochai-post-card .fallback-thumbnail {
  height: auto;
  max-height: 120px;
  object-fit: contain;
  padding: 10px;
  background: var(--color-surface-secondary);
}

.lottery-grid-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 15px;
}
.lottery-link-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px 10px;
  background: var(--color-surface-tertiary);
  border: 1px solid var(--color-border-secondary);
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-text-primary);
  transition: all 0.3s ease;
  text-align: center;
}
.lottery-link-card:hover {
  background: var(--color-accent);
  color: #ffffff;
  border-color: var(--color-accent);
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(211, 47, 47, 0.2);
}
.card-accent-bar {
  display: block;
  width: 40px;
  height: 4px;
  border-radius: 2px;
  margin-bottom: 10px;
  background: var(--color-accent);
}

.cpt-related-section {
  background: var(--color-surface-primary);
  border-top: 1px solid var(--color-border-secondary);
  padding: 60px 0;
  margin-top: 40px;
}
.cpt-related-title {
  text-align: center;
  margin-bottom: 40px;
  font-size: 2rem;
  color: var(--color-text-primary);
  font-weight: 800;
}
.related-strict-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  width: 100%;
}

@media (max-width: 992px) {
  .cpt-layout-wrapper {
    flex-direction: column;
  }
  .cpt-sidebar {
    width: 100% !important;
    flex: 1 1 100% !important;
  }
}

@media (max-width: 768px) {
  .cpt-prizes-grid,
  .cpt-secondary-grid {
    grid-template-columns: 1fr;
  }
  .cpt-navigation-bar {
    flex-direction: column;
    gap: 5px;
    padding: 15px;
  }
  .cpt-nav-date {
    border: none;
    border-top: 1px dashed var(--color-border-secondary);
    border-bottom: 1px dashed var(--color-border-secondary);
    width: 100%;
  }
  .cpt-nav-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 1024px) {
  .related-strict-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .related-strict-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================
   BLOG PAGE – PREMIUM LIVE RESULTS & AI PREDICTIONS GRID
   ========================================= */

.blog-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  margin-top: 30px;
  align-items: start;
}

.blog-card-grid .crc-hub-grid,
.blog-card-grid .crc-home-grid {
  display: contents;
}

.blog-card-grid .crc-ui-wrapper,
.blog-card-grid .pred-ajax-container {
  background: transparent !important;
  border: none;
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.blog-card-grid .crc-mobile-card {
  background: var(--color-surface-primary);
  border: 1px solid var(--color-border-secondary);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: relative;
  height: 380px;
  width: 100%;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card-grid .crc-mobile-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

body.dark-mode .blog-card-grid .crc-mobile-card {
  background: var(--color-surface-primary);
  border-color: var(--color-border-primary);
}
body.dark-mode .blog-card-grid .crc-mobile-card:hover {
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.blog-card-grid .crc-card-header {
  background: transparent;
  padding: 20px 10px 10px;
}
.blog-card-grid .crc-meta-row {
  background: transparent;
  color: var(--color-text-primary);
  border-bottom: 1px solid var(--color-border-secondary);
  font-size: 12px;
  padding: 8px 15px;
}
body.dark-mode .blog-card-grid .crc-meta-row {
  color: var(--color-text-primary);
  border-bottom-color: var(--color-border-primary);
}

.blog-card-grid .crc-logo-container {
  width: 55px;
  height: 55px;
  margin: 0 auto 10px auto;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border: 2px solid #cc0000;
  box-shadow: 0 0 10px rgba(204, 0, 0, 0.2);
}
.blog-card-grid .pred-ajax-container .crc-logo-container {
  border-color: #0056b3;
  box-shadow: 0 0 10px rgba(0, 86, 179, 0.2);
}

.blog-card-grid .crc-pagination-bar {
  display: none !important;
}

.blog-card-grid .crc-mobile-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 140px;
  background: linear-gradient(to top, var(--color-surface-primary) 10%, rgba(255,255,255,0.7) 40%, transparent 100%);
  pointer-events: none;
  z-index: 2;
}
body.dark-mode .blog-card-grid .crc-mobile-card::after {
  background: linear-gradient(to top, var(--color-surface-primary) 10%, rgba(30,30,30,0.7) 40%, transparent 100%);
}

.blog-card-grid .crc-download-action {
  margin-top: 20px;
  width: 100%;
  position: relative;
  z-index: 10;
}

.blog-card-grid .crc-btn-primary {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 14px 0;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  text-decoration: none;
  cursor: pointer;
}

.blog-card-grid .crc-ui-wrapper .crc-btn-primary {
  background: var(--color-accent);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 12px rgba(204, 0, 0, 0.2);
}
.blog-card-grid .crc-ui-wrapper .crc-btn-primary:hover {
  background: var(--color-accent-dark);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(204, 0, 0, 0.4);
  transform: translateY(-2px);
}

.blog-card-grid .pred-ajax-container .crc-btn-primary {
  background: #0056b3;
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 86, 179, 0.2);
}
.blog-card-grid .pred-ajax-container .crc-btn-primary:hover {
  background: #004494;
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(0, 86, 179, 0.4);
  transform: translateY(-2px);
}

.blog-card-grid .crc-ui-wrapper .crc-card-header {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
  border-radius: 16px 16px 0 0;
  padding: 20px 10px 15px;
  border-bottom: none;
}
.blog-card-grid .crc-ui-wrapper .crc-card-header h1,
.blog-card-grid .crc-ui-wrapper .crc-card-header h2,
.blog-card-grid .crc-ui-wrapper .crc-card-header h3,
.blog-card-grid .crc-ui-wrapper .crc-card-header p,
.blog-card-grid .crc-ui-wrapper .crc-card-header span {
  color: #ffffff !important;
}

.blog-card-grid .crc-ui-wrapper .crc-meta-row {
  background: #fcf0f0;
  border-bottom: 1px solid #f5d6d6;
}
body.dark-mode .blog-card-grid .crc-ui-wrapper .crc-meta-row {
  background: #2a1212;
  border-bottom-color: #4a1c1c;
  color: #ffcccc;
}

@media (min-width: 601px) {
  .blog-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1025px) {
  .blog-card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}