/* =============================================================================
   PID posts / category archive
   (template-pid-posts.php, home.php, archive.php, search.php)
   -----------------------------------------------------------------------------
   Typography, colours, the subhero, sections, labels and the card text
   come from the site-wide pid-* classes in Theme Options CSS. This file only
   adds the layout the Cornerstone elements gave those blocks on Our Work.
   ========================================================================== */

/* X prints its own "Category Archive" landmark header on archives. */
.pid-archive-page .x-header-landmark {
  display: none;
}

/* Hero: the big title (same look as .pid-subhero--title h2 on Our Work). */
.pid-archive .pid-subhero--title {
  margin: 0 0 12px;
}
.pid-archive__title {
  margin: 0;
  font-family: var(--hf, "Poppins", sans-serif);
  font-size: clamp(26px, 3vw, 42px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: normal;
  color: #fff;
  text-shadow: rgba(0, 38, 73, 0.65) 0 2px 34px, rgba(0, 38, 73, 0.45) 0 0 6px;
}

.pid-archive__description {
  max-width: 720px;
}

/* Search box (search.php) */
.pid-archive__search {
  display: flex;
  gap: 8px;
  max-width: 560px;
  margin: 0 0 32px;
}
.pid-archive__search .pid-archive__search-input {
  flex: 1;
  min-width: 0;
  height: 46px;
  margin: 0;
  padding: 0 20px;
  border: 1px solid var(--pid-line);
  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-archive__search .pid-archive__search-input:focus {
  border-color: var(--pid-navy-deep);
  outline: none;
}
.pid-archive__search .pid-archive__search-button {
  flex: none;
  height: 46px;
  margin: 0;
  padding: 0 26px;
  border: 1.5px solid var(--pid-yellow);
  border-radius: var(--pid-radius-pill, 999px);
  background: var(--pid-yellow);
  box-shadow: none;
  text-shadow: none;
  font-family: var(--pid-font);
  font-size: 15px;
  font-weight: 600;
  color: var(--pid-navy-deep);
  cursor: pointer;
}
.pid-archive__search .pid-archive__search-button:hover {
  border-color: var(--pid-yellow-hover, var(--pid-yellow));
  background: var(--pid-yellow-hover, var(--pid-yellow));
}

/* Cards on the left, category panel on the right (same proportions as the
   [pid_posts] block on Our Work). The panel comes first in the HTML so it
   sits above the cards on phones. The list itself is the [pid_categories]
   tree, styled by css/pid-category-tree.css. */
.pid-archive__layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(220px, 1fr);
  gap: 40px;
  align-items: start;
}
.pid-archive__layout .pid-archive__main {
  grid-row: 1;
  grid-column: 1;
}
.pid-archive__layout .pid-archive__side {
  grid-row: 1;
  grid-column: 2;
}
.pid-archive__box {
  padding: 22px;
  border-radius: 6px;
  background: #fff;
}

/* Cards grid */
.pid-archive__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 13px;
}

/* Card (matches the Cornerstone .pid-card--post cards) */
.pid-archive-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(12, 23, 51, 0.06);
  color: var(--pid-navy-deep);
  text-decoration: none;
  transition: box-shadow 0.3s ease;
}
.pid-archive-card:hover,
.pid-archive-card:focus {
  text-decoration: none;
}

.pid-archive-card__media {
  flex: none;
  height: 240px;
  margin: 0;
  overflow: hidden;
  border-radius: 3px 3px 0 0;
}
/* .pid-archive-card in front: beats the site-wide ".site img { height: auto }",
   which loads after this file. */
.pid-archive-card .pid-archive-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
}

.pid-archive-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  margin: 0;
  padding: 18px 18px 20px;
}
.pid-archive-card .pid-card--post-title h2 {
  margin: 0 0 7px;
  letter-spacing: normal;
}
/* Pushes the meta line and Read More to the bottom of the card. */
.pid-archive-card .pid-card--post--body {
  margin-bottom: auto;
}

.pid-archive-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  line-height: 1.65;
}
.pid-archive-card__meta > * {
  color: #000;
}
.pid-archive-card__meta > .pid-archive-card__sep {
  margin: 0 5px;
  color: rgba(0, 0, 0, 0.33);
}

.pid-archive-card .pid-link-arrow-a {
  font-size: 14px;
  line-height: 1.65;
  color: #000;
}

/* Pagination */
.pid-archive__pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}
.pid-archive__pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 6px 14px;
  border: 1px solid var(--pid-line);
  border-radius: var(--pid-radius-pill, 999px);
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: var(--pid-navy-deep);
  text-decoration: none;
}
.pid-archive__pagination a.page-numbers:hover {
  border-color: var(--pid-navy-deep);
}
.pid-archive__pagination .page-numbers.current {
  border-color: var(--pid-navy-deep);
  background: var(--pid-navy-deep);
  color: #fff;
}
.pid-archive__pagination .page-numbers.dots {
  border-color: transparent;
  background: none;
}

/* Next to the panel the cards have room for two columns. */
.pid-archive__layout .pid-archive__grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

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

@media (max-width: 639px) {
  .pid-archive__grid,
  .pid-archive__layout .pid-archive__grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .pid-archive__box {
    padding: 18px;
  }
  .pid-archive-card__media {
    height: 220px;
  }
}
