/*
 * posts-grid.css
 * Plugin: Posts Grid
 * Loaded only on pages that use the [posts_grid] shortcode.
 */

@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap");

/* ── Scoped reset ─────────────────────────────────────────── */
.pgrid,
.pgrid * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Grid ─────────────────────────────────────────────────── */
.pgrid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);  justify-content: center;
  gap: 20px;
  width: 100%;
}

/* ── Card ─────────────────────────────────────────────────── */
.pgrid-card {
  position: relative;
  width: 100%;
  height: 400px;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  background: #1c1c1c;
  border: 1px solid #e85c1a;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

/* ── Background image ─────────────────────────────────────── */
.pgrid-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  background-color: #2a2a2a;
}

/* Placeholder gradient when no featured image */
.pgrid-no-img .pgrid-bg {
  background: linear-gradient(145deg, #1e1e1e 0%, #2e2e2e 100%);
}

/* ── Gradient overlay ─────────────────────────────────────── */
.pgrid-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.76) 0%,
    rgba(0, 0, 0, 0) 40%,
    rgba(0, 0, 0, 0) 54%,
    rgba(0, 0, 0, 0.9) 100%
  );
}

/* ── Top: user date + title ───────────────────────────────── */
.pgrid-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 24px;
  z-index: 2;
}

.pgrid-meta {
  font-family: "Montserrat", sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 12px;
  line-height: 1.4;
}

.pgrid-title {
  font-family: "Montserrat", sans-serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
  color: #ffffff;
  /* text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55); */
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Bottom: read button ──────────────────────────────────── */
.pgrid-bottom {
  position: absolute;
  bottom: 24px;
  left: 24px;
  right: 24px;
  z-index: 2;
  text-align: left; /* Align to the left as shown in the image */
}

/* Ensure no underlines on any links in the card, especially from theme CSS */
.pgrid-card a,
.pgrid-card a:hover,
.pgrid-card a:focus,
.pgrid-card a:active {
  text-decoration: none !important;
  box-shadow: none !important;
  border-bottom: none !important;
}

/* Hide theme injected categories if they appear inside the wrapper or above card content */
.pgrid-wrapper .category,
.pgrid-wrapper .post-categories,
.pgrid-wrapper .cats-wrapper,
.pgrid-card .category,
.pgrid-card .post-categories,
.pgrid-cat,
.pgrid-cat + span {
  display: none !important;
}

.pgrid-btn {
  display: inline-block;
  background: #ffffff;
  color: #e85c1a;
  text-decoration: none !important;
  font-family: "Montserrat", sans-serif;
  font-size: 20px;
  font-weight: 700;
  padding: 10px 40px;
  border-radius: 50px;
  border: none !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  transition:
    background 0.22s,
    color 0.22s,
    transform 0.22s;
}

.pgrid-btn:hover {
  background: #e85c1a;
  color: #ffffff;
  transform: scale(1.05);
}

/* ── Empty state ──────────────────────────────────────────── */
.pgrid-empty {
  font-family: "Barlow", sans-serif;
  color: #888888;
  font-size: 0.95rem;
  padding: 40px 0;
  text-align: center;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1000px) {
  .pgrid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .pgrid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .pgrid-title {
    font-size: 1rem;
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }
}