/* Unique namespace to avoid conflicts in WordPress.
   Design mirrors the "CONOCIMIENTO" section of cambios/blog.html. */
.pf-ext-wrapper {
  --pf-ink: #132230;
  --pf-cream: #f9f2e2;
  --pf-rust: #bf4624;
  --pf-muted: #5c6873;
  --pf-line: rgba(19, 34, 48, 0.12);

  font-family: "Kantumruy Pro", -apple-system, BlinkMacSystemFont, sans-serif;
  max-width: 100%;
  width: 100%;
  padding: 36px 0;
  box-sizing: border-box;
  color: var(--pf-ink);
  /* The theme centers text in this section; the mockup is left-aligned. */
  text-align: left;
}

.pf-ext-wrapper * {
  box-sizing: border-box;
}

/* Filter row: pills on the left, result count on the right */
.pf-ext-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.pf-ext-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pf-ext-filter-btn {
  padding: 9px 18px;
  border-radius: 999px;
  background-color: #ffffff;
  border: 1px solid var(--pf-line);
  color: var(--pf-ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.pf-ext-filter-btn:hover {
  border-color: var(--pf-rust);
}

.pf-ext-filter-btn.pf-ext-active {
  background-color: var(--pf-ink);
  border-color: var(--pf-ink);
  color: var(--pf-cream);
  font-weight: 700;
}

.pf-ext-count {
  font-size: 13.5px;
  color: var(--pf-muted);
  white-space: nowrap;
}

.pf-ext-divider {
  height: 1px;
  background: rgba(19, 34, 48, 0.1);
  margin-bottom: 36px;
}

/* Grid Layout — fixed 3 columns, collapsing on narrower viewports */
.pf-ext-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

@media (max-width: 900px) {
  .pf-ext-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .pf-ext-grid {
    grid-template-columns: 1fr;
  }
}

.pf-ext-grid.pf-ext-loading {
  opacity: 0.5;
  transition: opacity 0.15s ease;
}

/* Card: borderless block — image, category pill, title, excerpt, read link */
.pf-ext-card {
  display: flex;
  flex-direction: column;
  background: transparent;
  text-decoration: none !important;
  color: inherit;
  cursor: pointer;
}

.pf-ext-card-header {
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 16px;
  width: 100%;
  aspect-ratio: 4 / 3;
}

.pf-ext-card-img,
.pf-ext-card-header img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.pf-ext-card:hover .pf-ext-card-img,
.pf-ext-card:hover .pf-ext-card-header img {
  transform: scale(1.03);
}

.pf-ext-card-body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.pf-ext-tag {
  display: inline-block;
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  margin-bottom: 10px;
}

.pf-ext-card-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--pf-ink);
  line-height: 1.35;
  transition: color 0.15s ease;
}

.pf-ext-card:hover .pf-ext-card-title {
  color: var(--pf-rust);
}

.pf-ext-card-desc {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--pf-muted);
  line-height: 1.6;
}

.pf-ext-card-more {
  margin-top: auto;
  align-self: flex-start;
  font-size: 13px;
  font-weight: 700;
  color: var(--pf-rust);
}

/* Category color variants — also used as the flat-color header fallback
   for cards without a featured image (see scd_get_post_color_class()). */
.pf-ext-bg-blue {
  background-color: rgba(59, 130, 196, 0.12);
  color: #3b82c4;
}
.pf-ext-bg-green {
  background-color: rgba(107, 158, 63, 0.15);
  color: #4a7c2e;
}
.pf-ext-bg-purple {
  background-color: rgba(122, 95, 199, 0.15);
  color: #5b3fa0;
}
.pf-ext-bg-orange {
  background-color: rgba(191, 70, 36, 0.12);
  color: var(--pf-rust);
}

/* Loader / empty state */
.pf-ext-loader,
.pf-ext-grid .scd-no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  font-size: 15px;
  color: var(--pf-muted);
}
