/* =============================================================================
   [pid_posts] shortcode (inc/pid-posts-feed.php)
   -----------------------------------------------------------------------------
   Layout only: cards come from css/pid-archive.css, the category list from
   css/pid-category-tree.css, labels and buttons from the site-wide pid-*
   classes in Theme Options CSS.
   ========================================================================== */

/* .pid-btn sets display, which would beat the hidden attribute. */
.pid-feed [hidden] {
  display: none !important;
}

/* Cards on the left, sidebar on the right (the sidebar comes first in the
   HTML so it sits above the cards on phones). */
.pid-feed {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(220px, 1fr);
  gap: 40px;
  align-items: start;
}
.pid-feed__main {
  grid-row: 1;
  grid-column: 1;
}
.pid-feed__sidebar {
  grid-row: 1;
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Sidebar boxes */
.pid-feed__box {
  padding: 22px;
  border-radius: 6px;
  background: #fff;
}

/* Search */
.pid-feed__search {
  position: relative;
  margin: 0;
}
.pid-feed__search-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  color: var(--pid-navy-deep);
  pointer-events: none;
}
.pid-feed__search .pid-feed__search-input {
  width: 100%;
  height: 46px;
  margin: 0;
  padding: 0 16px 0 44px;
  border: 1px solid #c9cdd9;
  border-radius: var(--pid-radius-pill, 999px);
  background: #fff;
  box-shadow: none;
  font-family: var(--pid-font);
  font-size: 15px;
  color: var(--pid-navy-deep);
}
.pid-feed__search .pid-feed__search-input:focus {
  border-color: var(--pid-navy-deep);
  outline: none;
}

/* Cards */
.pid-feed__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  transition: opacity 0.2s ease;
}
.pid-feed__grid.is-loading {
  opacity: 0.45;
  pointer-events: none;
}

.pid-feed__empty,
.pid-feed__error {
  margin: 0;
}
.pid-feed__error {
  margin-top: 20px;
}

/* Load More */
.pid-feed__more {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}
.pid-feed .pid-feed__more-btn {
  height: auto;
  margin: 0;
  padding: 13px 28px;
  box-shadow: none;
  text-shadow: none;
  font-family: var(--pid-font);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.65;
  color: var(--pid-navy-deep);
}
.pid-feed .pid-feed__more-btn:hover,
.pid-feed .pid-feed__more-btn:focus-visible {
  color: #fff;
}
.pid-feed .pid-feed__more-btn:disabled {
  cursor: progress;
  opacity: 0.6;
}

@media (max-width: 900px) {
  .pid-feed {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
  .pid-feed__main,
  .pid-feed__sidebar {
    grid-row: auto;
    grid-column: auto;
  }
}

@media (max-width: 600px) {
  .pid-feed__grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .pid-feed__box {
    padding: 18px;
  }
  .pid-feed .pid-feed__more-btn {
    width: 100%;
  }
}

@media (max-width: 400px) {
  .pid-feed__sidebar {
    gap: 16px;
  }
}
