/* ═══════════════════════════════════════════════════════════════
   MINEMEV — posts_new.css
   Post card styles — matches load_posts.js DOM exactly
   Tokens defined in main_new.css (:root)
═══════════════════════════════════════════════════════════════ */

/* ── Post grid ────────────────────────────────────────────────
   Overrides the grid set in main_new.css #post_container.
   JS appends .post cards as bare divs — the grid handles layout.
──────────────────────────────────────────────────────────────── */
#post_container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  grid-auto-rows: 1fr;
  gap: 16px;
  align-items: stretch;
}


/* ── Post card ──────────────────────────────────────────────── */
.post {
  position: relative;
  background: #111316;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  color: #f0f1f3;
  display: flex;
  flex-direction: column;
  transition:
    border-color .2s cubic-bezier(.4,0,.2,1),
    transform .2s cubic-bezier(.4,0,.2,1),
    box-shadow .2s cubic-bezier(.4,0,.2,1);
}

.post:hover {
  border-color: rgba(255,194,0,.45);
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0,0,0,.55), 0 0 0 0 transparent;
}

/* External-redirect marker */
.post[style*="border: 2px solid gray"],
.post[style*="border:2px solid gray"] {
  border-color: rgba(138,143,156,.4) !important;
}

.post[style*="border: 2px solid gray"]::after,
.post[style*="border:2px solid gray"]::after {
  content: 'External';
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(138,143,156,.15);
  border: 1px solid rgba(138,143,156,.35);
  border-radius: 4px;
  color: #8a8f9c;
  font-family: 'JetBrains Mono', monospace;
  font-size: .62rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 2px 7px;
  pointer-events: none;
}


/* ── Thumbnail ──────────────────────────────────────────────── */
.post > img {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
  background-color: #0d0e11;
  display: block;
  /* no border-radius — card overflow:hidden handles it */
  margin: 0;
  flex-shrink: 0;

  /* Subtle reveal on load */
  transition: transform .35s cubic-bezier(.4,0,.2,1), opacity .2s ease;
  opacity: 1;
}

.post:hover > img {
  transform: scale(1.025);
}


/* ── Post content ───────────────────────────────────────────── */
.post-content {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.post-content h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  color: #f0f1f3;
  margin: 0;
  height: calc(1rem * 1.35 * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* ── Tag pills ──────────────────────────────────────────────── */
.tags-container {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  overflow: hidden;
  height: 24px;
  flex-shrink: 0;
  transition: height .3s cubic-bezier(.4,0,.2,1);
}

.tags-container:hover {
  flex-wrap: wrap;
  height: auto;
  overflow: visible;
}

.tags-container a {
  display: inline-block;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 2px 9px;
  background: rgba(255,194,0,.07);
  border: 1px solid rgba(255,194,0,.18);
  border-radius: 20px;
  color: #8a8f9c;
  font-family: 'JetBrains Mono', monospace;
  font-size: .66rem;
  letter-spacing: .04em;
  text-decoration: none;
  transition:
    color .15s ease,
    background .15s ease,
    border-color .15s ease;
}

.tags-container a:hover {
  color: #ffc200;
  background: rgba(255,194,0,.14);
  border-color: rgba(255,194,0,.38);
}


/* ── Post separator row ─────────────────────────────────────── */
.post_sep {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.06);
}

/* Avatar */
.post_sep .author_pp {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid rgba(255,194,0,.25);
  background: #0d0e11;
  display: block;
}

/* Info column */
.post_info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

/* Author link */
.post_info .author {
  font-family: 'DM Sans', sans-serif;
  font-size: .8rem;
  font-weight: 600;
  color: #ffc200;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  line-height: 1.2;
  transition: color .15s ease;
}

.post_info .author:hover {
  color: #ffce33;
}

/* Stats row: date + downloads */
.post_info .stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #4e5260;
  font-family: 'JetBrains Mono', monospace;
  font-size: .68rem;
  letter-spacing: .02em;
}

.post_info .stats span {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* Download count: inherit stats style but nudge color */
.post_info .stats span:last-child {
  color: #6a6f7e;
}

.post_info .stats svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  stroke: currentColor;
}

/* Critique slot — reserved, hidden by default */
.critique {
  display: none;
}

/* HR — never shown */
hr { display: none; }


/* ── Loading indicator ──────────────────────────────────────── */
.loading-indicator {
  grid-column: 1 / -1;
  text-align: center;
  padding: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #4e5260;

  /* Pulsing dots via letter-spacing animation trick */
  animation: fade-pulse 1.2s ease-in-out infinite;
}

@keyframes fade-pulse {
  0%, 100% { opacity: .4; }
  50%       { opacity: 1; }
}


/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════ */

/* Tablet — 2 col comfortable */
@media (max-width: 1024px) {
  #post_container {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
  }
}

/* Mobile landscape — wide cards */
@media (max-width: 680px) {
  #post_container {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .post {
    border-radius: 10px;
    /* Don't transform on mobile — tap jitter */
    transition: border-color .15s ease;
  }

  .post:hover {
    transform: none;
    box-shadow: none;
  }

  /* Panoramic thumbnail on small screens */
  .post > img {
    aspect-ratio: 16 / 7;
  }

  .post-content {
    padding: 10px 12px 12px;
    gap: 8px;
  }

  .post-content h3 {
    font-size: .92rem;
  }
}

/* Tiny screens */
@media (max-width: 400px) {
  .post > img {
    aspect-ratio: 16 / 6;
  }

  .tags-container a {
    font-size: .62rem;
    padding: 1px 6px;
  }
}