/* ============================================================
   Post Filter Grid - [conant_post_grid]
   Ported from the Women's Health theme (2026-10), in Conant colours.
   Navy #0f445a, blue #0086bf, green #9bce60. Text is darker than
   the site's #5e7983 body colour for readability.
   ============================================================ */

.pfg-wrap {
  --pfg-navy: #0f445a;
  --pfg-blue: #0086bf;
  --pfg-green: #9bce60;
  --pfg-text: #1f2d33;
  --pfg-muted: #4a5a61;
  --pfg-border: #d9e1e4;
  --pfg-tint: #eef4f6;

  position: relative;
  font-family: "Poppins", Helvetica, Arial, Lucida, sans-serif;
  color: var(--pfg-text);
}

/* - Controls ----------------------------------------------- */
.pfg-controls {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.pfg-control {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.pfg-control--search {
  flex: 1 1 420px;
}

.pfg-control--category {
  flex: 0 0 300px;
}

.pfg-filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pfg-navy);
}

.pfg-search-inner {
  position: relative;
  display: flex;
  align-items: center;
}

.pfg-search-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--pfg-navy);
  pointer-events: none;
}

.pfg-wrap .pfg-search {
  width: 100%;
  height: 48px;
  padding: 0 2.6rem;
  border: 2px solid var(--pfg-navy);
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--pfg-text);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
}

.pfg-wrap .pfg-search::placeholder {
  color: var(--pfg-muted);
  opacity: 1;
}

.pfg-wrap .pfg-search:focus,
.pfg-wrap .pfg-category-select:focus {
  outline: none;
  border-color: var(--pfg-blue);
  box-shadow: 0 0 0 3px rgba(0, 134, 191, 0.18);
}

.pfg-search::-webkit-search-cancel-button { display: none; }

.pfg-search-clear {
  position: absolute;
  right: 10px;
  display: flex;
  align-items: center;
  padding: 4px;
  border: none;
  background: none;
  color: var(--pfg-navy);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.pfg-search-clear:hover { opacity: 1; }
.pfg-search-clear svg { width: 15px; height: 15px; }

.pfg-wrap .pfg-category-select {
  width: 100%;
  height: 48px;
  padding: 0 2.4rem 0 0.9rem;
  border: 2px solid var(--pfg-navy);
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  color: var(--pfg-text);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f445a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 0.85rem center / 16px;
  appearance: none;
  cursor: pointer;
}

@media (max-width: 760px) {
  .pfg-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .pfg-control--search,
  .pfg-control--category {
    flex: 1 1 auto;
  }
}

/* - Status ------------------------------------------------- */
.pfg-status {
  min-height: 1.2em;
  margin-bottom: 1rem;
  font-size: 0.92rem;
  color: var(--pfg-muted);
}

/* - Grid --------------------------------------------------- */
.pfg-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.75rem;
  min-height: 200px;
  transition: opacity 0.2s;
}

.pfg-wrap--loading .pfg-grid { opacity: 0.4; pointer-events: none; }

@media (max-width: 980px) {
  .pfg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .pfg-grid { grid-template-columns: minmax(0, 1fr); }
}

/* - Card --------------------------------------------------- */
.pfg-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  background: #fff;
  border: 1px solid var(--pfg-border);
  border-radius: 8px;
  text-align: left;
  transition: box-shadow 0.2s, transform 0.2s;
}

.pfg-card:hover {
  box-shadow: 0 6px 24px rgba(15, 68, 90, 0.12);
  transform: translateY(-3px);
}

.pfg-card__thumb-link {
  display: block;
  overflow: hidden;
  text-decoration: none;
}

.pfg-card__thumb {
  width: 100%;
  padding-top: 56.25%;
  background-color: var(--pfg-tint);
  background-position: center;
  background-size: contain;
  transition: transform 0.3s ease;
}

.pfg-card:hover .pfg-card__thumb { transform: scale(1.03); }

.pfg-card__thumb--placeholder {
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 6px,
    rgba(15, 68, 90, 0.06) 6px,
    rgba(15, 68, 90, 0.06) 12px
  );
}

.pfg-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.1rem 1.25rem 1.25rem;
}

.pfg-card__cat {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pfg-blue);
}

.pfg-wrap .pfg-card__title {
  margin: 0;
  padding: 0;
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.35;
}

.pfg-card__title a {
  color: var(--pfg-navy);
  text-decoration: none;
  transition: color 0.15s;
}

.pfg-card__title a:hover { color: var(--pfg-blue); }

.pfg-wrap .pfg-card__excerpt {
  flex: 1;
  margin: 0.25rem 0 0;
  padding: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--pfg-muted);
}

.pfg-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--pfg-tint);
  font-size: 0.85rem;
  color: var(--pfg-muted);
}

.pfg-card__more {
  font-weight: 600;
  color: var(--pfg-blue);
  text-decoration: none;
  white-space: nowrap;
}

.pfg-card__more:hover { color: var(--pfg-navy); }

/* - No results -------------------------------------------- */
.pfg-no-results {
  grid-column: 1 / -1;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--pfg-muted);
}

.pfg-no-results svg {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  opacity: 0.35;
}

.pfg-no-results p {
  margin: 0;
  font-size: 1.1rem;
}

/* - Pagination -------------------------------------------- */
.pfg-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 2.5rem;
}

.pfg-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.6rem;
  border: 2px solid var(--pfg-border);
  border-radius: 6px;
  background: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--pfg-navy);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.pfg-page-btn:hover:not(:disabled):not(.pfg-page-btn--active) {
  border-color: var(--pfg-blue);
  color: var(--pfg-blue);
}

.pfg-page-btn--active {
  background: var(--pfg-navy);
  border-color: var(--pfg-navy);
  color: #fff;
  cursor: default;
}

.pfg-page-btn--prev,
.pfg-page-btn--next { font-size: 1.15rem; }

.pfg-page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pfg-page-ellipsis {
  padding: 0 0.25rem;
  line-height: 40px;
  color: var(--pfg-muted);
}

/* - Loading dots ------------------------------------------ */
.pfg-loading {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 1.5rem;
}

.pfg-wrap--loading .pfg-loading { display: flex; }

.pfg-loading span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pfg-blue);
  animation: pfgPulse 1.2s ease-in-out infinite;
}

.pfg-loading span:nth-child(2) { animation-delay: 0.2s; }
.pfg-loading span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pfgPulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}
