/* ============================================================
   LEETFX — Enhanced Market Post Cards (Home Page)
   ============================================================ */

/* Grid layout */
.market-post-grid--enhanced {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  padding: 8px 0 24px;
}

/* Card base */
.mpc {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(14, 12, 28, 0.82);
  border: 1px solid rgba(212, 169, 67, 0.18);
  box-shadow: 0 4px 30px rgba(0,0,0,0.4), 0 0 0 0 rgba(212,169,67,0);
  transition: transform 0.32s cubic-bezier(.22,.68,0,1.2),
              box-shadow 0.32s ease,
              border-color 0.25s ease;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.mpc:hover {
  transform: translateY(-6px) scale(1.015);
  box-shadow: 0 18px 55px rgba(0,0,0,0.55), 0 0 0 1.5px rgba(212,169,67,0.45);
  border-color: rgba(212,169,67,0.45);
}

/* Cover image area */
.mpc-cover {
  position: relative;
  width: 100%;
  height: 195px;
  overflow: hidden;
  flex-shrink: 0;
}
.mpc-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.mpc:hover .mpc-cover img {
  transform: scale(1.06);
}
.mpc-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10,8,20,0.1) 0%,
    rgba(10,8,20,0.62) 70%,
    rgba(10,8,20,0.92) 100%
  );
}

/* Placeholder cover when no image */
.mpc-cover--none {
  background: linear-gradient(135deg, #0d1229 0%, #1a0d2e 50%, #0e1520 100%);
}
.mpc-cover-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(212,169,67,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212,169,67,0.07) 1px, transparent 1px);
  background-size: 32px 32px;
  animation: gridShift 8s linear infinite;
}
@keyframes gridShift {
  0% { background-position: 0 0; }
  100% { background-position: 32px 32px; }
}

/* Card body */
.mpc-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 22px 20px;
  flex: 1;
}

/* Top meta row */
.mpc-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.mpc-cat {
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #d4a943;
  text-transform: uppercase;
}
.mpc-date {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  color: #64748b;
  letter-spacing: 0.05em;
}

/* Big number */
.mpc-num {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.4rem;
  font-weight: 700;
  color: rgba(212,169,67,0.18);
  line-height: 1;
  margin: -4px 0 -8px;
  user-select: none;
}

/* Title */
.mpc-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.18rem;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.38;
  margin: 0;
}

/* Excerpt */
.mpc-excerpt {
  font-family: 'Manrope', sans-serif;
  font-size: 0.87rem;
  color: #94a3b8;
  line-height: 1.65;
  margin: 0;
  flex: 1;
}

/* Footer */
.mpc-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.07);
  gap: 8px;
}
.mpc-read-time {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: #64748b;
  letter-spacing: 0.05em;
}
.mpc-link {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: #d4a943;
  text-decoration: none;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s, gap 0.2s;
}
.mpc-link:hover {
  color: #f0d58d;
  gap: 10px;
}

/* Accent variant colours */
.mpc-0 { --accent: rgba(212,169,67,0.22); }
.mpc-1 { --accent: rgba(99,179,237,0.15); }
.mpc-2 { --accent: rgba(167,243,208,0.12); }
.mpc-3 { --accent: rgba(249,168,212,0.12); }
.mpc-4 { --accent: rgba(196,181,253,0.13); }
.mpc-5 { --accent: rgba(253,230,138,0.13); }

.mpc-0::before, .mpc-1::before, .mpc-2::before,
.mpc-3::before, .mpc-4::before, .mpc-5::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, var(--accent), transparent 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s;
}
.mpc:hover::before {
  opacity: 1;
}

/* Shimmer loading skeleton */
.mpc-skeleton {
  border-radius: 20px;
  overflow: hidden;
  background: rgba(14,12,28,0.82);
  border: 1px solid rgba(255,255,255,0.06);
  animation: shimmer 1.8s infinite linear;
  background-size: 200% 100%;
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Pagination */
.article-pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.article-pagination span {
  color: #64748b;
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
}
.article-pagination button {
  background: rgba(212,169,67,0.1);
  border: 1px solid rgba(212,169,67,0.25);
  color: #d4a943;
  border-radius: 8px;
  padding: 6px 14px;
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.article-pagination button.active,
.article-pagination button:hover {
  background: rgba(212,169,67,0.25);
  border-color: rgba(212,169,67,0.6);
}

/* Empty state */
.research-empty {
  grid-column: 1 / -1;
  padding: 60px 20px;
  text-align: center;
  color: #475569;
  font-family: 'DM Mono', monospace;
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 700px) {
  .market-post-grid--enhanced {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .mpc-cover { height: 160px; }
}

/* ============================================================
   ADMIN — Rich Editor Anti-Jitter & Stable Scrolling Fix
   ============================================================ */
.form-field-group {
  margin: 0 0 17px;
}

.editor-label {
  display: block;
  margin-bottom: 8px;
  color: #b9c5db;
  font: 500 10px "DM Mono", monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.rich-editor {
  min-height: 380px;
  max-height: 650px !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  scroll-behavior: auto !important;
  position: relative;
  word-break: break-word;
  user-select: text !important;
  -webkit-user-select: text !important;
  cursor: text !important;
}

/* Slug field highlight */
.slug-field {
  background: rgba(212,169,67,0.06);
  border: 1px solid rgba(212,169,67,0.3) !important;
  border-radius: 12px;
  padding: 14px 16px !important;
}

.slug-field input {
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.04em;
  color: #f0d58d !important;
}

/* Post list slug badge */
.post-row-slug {
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: #d4a943;
  margin-top: 4px;
  opacity: 0.85;
}

