/* =========================================================
   Project Filter Plugin — Stylesheet (Mobile-First)
   Inspired by Tell MAMA UK & Runnymede Trust designs
   ========================================================= */

/* ── Reset & box-sizing ────────────────────────────────── */
.pf-wrapper *,
.pf-wrapper *::before,
.pf-wrapper *::after {
  box-sizing: border-box;
}

/* ── Design tokens ─────────────────────────────────────── */
:root {
  --pf-primary:       #1a1a2e;
  --pf-accent:        #c8102e;
  --pf-accent-light:  #f5e6e8;
  --pf-text:          #1a1a2e;
  --pf-text-muted:    #6b7280;
  --pf-border:        #e5e7eb;
  --pf-bg:            #f9f9fb;
  --pf-white:         #ffffff;
  --pf-card-shadow:   0 2px 12px rgba(26,26,46,.08);
  --pf-card-hover:    0 8px 32px rgba(26,26,46,.14);
  --pf-radius:        6px;
  --pf-radius-lg:     10px;
  --pf-transition:    .22s ease;
  --pf-font:          'Georgia', 'Times New Roman', serif;
  --pf-font-sans:     -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* touch-friendly minimum tap target */
  --pf-tap-min:       44px;
}

/* ═══════════════════════════════════════════════════════════
   WRAPPER
════════════════════════════════════════════════════════════ */
.pf-wrapper {
  font-family: var(--pf-font-sans);
  color: var(--pf-text);
  max-width: 1200px;
  margin: 0 auto;
  /* generous side padding on small screens */
  padding: 0 16px;
  -webkit-text-size-adjust: 100%; /* prevent iOS font inflation */
}

@media (min-width: 480px)  { .pf-wrapper { padding: 0 20px; } }
@media (min-width: 1024px) { .pf-wrapper { padding: 0 24px; } }

/* ═══════════════════════════════════════════════════════════
   FILTER BAR
   Mobile: stacked column  |  Desktop: single row
════════════════════════════════════════════════════════════ */
.pf-filter-bar {
  display: flex;
  flex-direction: column;   /* mobile-first: stack everything */
  gap: 10px;
  padding: 16px 0 14px;
  border-bottom: 2px solid var(--pf-border);
  margin-bottom: 16px;
  order: 2;
}

@media (min-width: 640px) {
  .pf-filter-bar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 20px 0 16px;
    margin-bottom: 18px;
  }
}

/* ── Search ─────────────────────────────────────────────── */
.pf-search-wrap {
  position: relative;
  width: 100%;               /* full-width on mobile */
}

.pf-search-wrap input.pf-search {max-width: 100% !important; margin-top: 0px; height: 44px;}

@media (min-width: 640px) {
  .pf-search-wrap {
    flex: 1 1 200px;
    max-width: 340px;
  }
}

.pf-search {
  width: 100%;
  /* taller input = easier to tap on mobile */
  padding: 12px 44px 12px 14px;
  border: 1.5px solid var(--pf-border);
  border-radius: var(--pf-radius);
  font-size: 16px; /* 16px prevents iOS auto-zoom on focus */
  font-family: var(--pf-font-sans);
  color: var(--pf-text);
  background: var(--pf-white);
  transition: border-color var(--pf-transition), box-shadow var(--pf-transition);
  -webkit-appearance: none;  /* remove iOS inner shadow */
  appearance: none;
}

@media (min-width: 640px) {
  .pf-search { font-size: 14px; padding: 10px 42px 10px 14px; }
}

.pf-search:focus {
  outline: none;
  border-color: var(--pf-accent);
  box-shadow: 0 0 0 3px rgba(200,16,46,.10);
}

.pf-search-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px;              /* larger hit-area */
  cursor: pointer;
  color: var(--pf-text-muted);
  display: flex;
  align-items: center;
  min-width: var(--pf-tap-min);
  min-height: var(--pf-tap-min);
  justify-content: center;
}

.pf-search-btn svg { width: 18px; height: 18px; }

/* ── Dropdowns ──────────────────────────────────────────── */
.pf-dropdown-wrap {
  position: relative;
  width: 100%;               /* full-width on mobile */
}

@media (min-width: 640px) {
  .pf-dropdown-wrap { width: auto; flex-shrink: 0; }
}

.pf-dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  width: 100%;
  min-height: var(--pf-tap-min);
  padding: 10px 14px;
  border: 1.5px solid var(--pf-border);
  border-radius: var(--pf-radius);
  background: var(--pf-white);
  font-size: 15px;
  font-family: var(--pf-font-sans);
  color: var(--pf-text);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--pf-transition), background var(--pf-transition);
  user-select: none;
  -webkit-appearance: none;
  appearance: none;
  text-align: left;
}

@media (min-width: 640px) {
  .pf-dropdown-toggle {
    width: auto;
    justify-content: flex-start;
    font-size: 14px;
  }
}

.pf-dropdown-toggle:hover,
.pf-dropdown-toggle.is-open {
  /*border-color: var(--pf-accent);*/
  border-color: #4e2257;
  /*background: var(--pf-accent-light);*/
  background: var(--pf-accent-white);
}

.pf-dropdown-toggle.has-selection {
  /*border-color: var(--pf-accent);
  background: var(--pf-accent);*/
  border-color: #4e2257;
  background: #4e2257;
  color: var(--pf-white);
}

.pf-dropdown-toggle.has-selection .pf-chevron { stroke: var(--pf-white); }

.pf-chevron {
  width: 16px;
  height: 16px;
  transition: transform var(--pf-transition);
  flex-shrink: 0;
  margin-left: auto;
}

.pf-dropdown-toggle.is-open .pf-chevron { transform: rotate(180deg); }

/* Dropdown Panel — slides up on mobile, floats on desktop */
.pf-dropdown-panel {
  display: none;
  /* mobile: render inline in document flow (no absolute) */
  width: 100%;
  background: var(--pf-white);
  border: 1.5px solid var(--pf-border);
  border-radius: var(--pf-radius-lg);
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  overflow: hidden;
  /* push down slightly from toggle */
  margin-top: 4px;
  z-index: 9999;
}

@media (min-width: 640px) {
  .pf-dropdown-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 230px;
    width: auto;
    margin-top: 0;
    box-shadow: 0 8px 30px rgba(0,0,0,.12);
    animation: pf-panel-in .18s ease;
  }
}

.pf-dropdown-panel.is-open { display: block; }

@keyframes pf-panel-in {
  from { opacity:0; transform:translateY(-6px); }
  to   { opacity:1; transform:translateY(0); }
}

.pf-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px;
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--pf-text-muted);
  border-bottom: 1px solid var(--pf-border);
}

.pf-clear-group {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--pf-accent);
  cursor: pointer;
  padding: 4px 0;
  font-family: var(--pf-font-sans);
  text-decoration: underline;
  min-height: var(--pf-tap-min);
  display: flex;
  align-items: center;
}

.pf-clear-group:hover { color: #900d20; }

.pf-checkbox-list {
  max-height: 240px;
  overflow-y: auto;
  padding: 8px 0 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--pf-border) transparent;
  -webkit-overflow-scrolling: touch; /* smooth iOS scroll */
}

.pf-checkbox-list::-webkit-scrollbar { width: 4px; }
.pf-checkbox-list::-webkit-scrollbar-thumb { background: var(--pf-border); border-radius: 4px; }

.pf-checkbox-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;        /* taller rows = easier tap */
  cursor: pointer;
  transition: background var(--pf-transition);
  font-size: 15px;
  min-height: var(--pf-tap-min);
}

@media (min-width: 640px) {
  .pf-checkbox-item { padding: 7px 16px; font-size: 14px; min-height: unset; }
}

/*.pf-checkbox-item:hover { background: var(--pf-accent-light); }*/
.pf-checkbox-item:hover { background: #e8d9f0; }


.pf-checkbox-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.pf-cb-box {
  width: 20px;
  height: 20px;
  border: 1.8px solid var(--pf-border);
  border-radius: 3px;
  flex-shrink: 0;
  background: var(--pf-white);
  position: relative;
  transition: border-color var(--pf-transition), background var(--pf-transition);
}

@media (min-width: 640px) {
  .pf-cb-box { width: 17px; height: 17px; }
}

.pf-checkbox-item input:checked ~ .pf-cb-box {
  /*background: var(--pf-accent);*/
  background: #4e2257;
  border-color: #4e2257;
  /*border-color: var(--pf-accent);*/
}

.pf-checkbox-item input:checked ~ .pf-cb-box::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 7px;
  height: 11px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

@media (min-width: 640px) {
  .pf-checkbox-item input:checked ~ .pf-cb-box::after {
    left: 4px; top: 1px; width: 6px; height: 10px;
  }
}

.pf-cb-label { flex: 1; line-height: 1.4; }

/* ── Clear-all button ───────────────────────────────────── */
.pf-clear-all {
  background: none;
  border: 1.5px solid var(--pf-border);
  border-radius: var(--pf-radius);
  font-size: 14px;
  color: var(--pf-text-muted);
  cursor: pointer;
  padding: 10px 14px;
  font-family: var(--pf-font-sans);
  text-decoration: none;
  transition: color var(--pf-transition), border-color var(--pf-transition);
  width: 100%;
  min-height: var(--pf-tap-min);
  text-align: center;
}

@media (min-width: 640px) {
  .pf-clear-all {
    width: auto;
    margin-left: auto;
    border: none;
    /*font-size: 13px;*/
    font-size: 15px;
    padding: 6px 4px;
    text-decoration: underline;
    min-height: unset;
    text-align: left;
  }
}

/*.pf-clear-all:hover { color: var(--pf-accent); border-color: var(--pf-accent); }*/
.pf-clear-all:hover { color: #4e2257; border-color: #4e2257; }

/* ═══════════════════════════════════════════════════════════
   CATEGORY BUTTON TABS
   Mobile: horizontally scrollable row (no wrapping overflow)
════════════════════════════════════════════════════════════ */
.pf-category-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--pf-border);
  /* horizontal scroll on small screens */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;         /* hide scrollbar but keep function */
  /* prevent wrapping so scroll kicks in */
  flex-wrap: nowrap;
  /* subtle fade-out hint at right edge */
  -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
  mask-image: linear-gradient(to right, black 85%, transparent 100%);
  padding-right: 32px;           /* room for fade */
  order: 1;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
  margin-top: 50px;
}

.pf-category-tabs::-webkit-scrollbar { display: none; }

@media (min-width: 640px) {
  .pf-category-tabs {
    flex-wrap: wrap;
    overflow-x: visible;
    -webkit-mask-image: none;
    mask-image: none;
    padding-right: 0;
  }
}

.pf-cat-btn {
  /* never shrink so they stay tappable */
  flex-shrink: 0;
  padding: 9px 18px;
  min-height: var(--pf-tap-min);
  /*border: 1.5px solid var(--pf-border);*/
  border: 1.5px solid #4e2257;
  /*border-radius: 30px;*/
  border-radius: 10px;
  background: var(--pf-white);
  font-size: 14px;
  font-family: var(--pf-font-sans);
  color: var(--pf-text);
  cursor: pointer;
  transition: all var(--pf-transition);
  font-weight: 500;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 640px) {
  .pf-cat-btn { padding: 7px 18px; font-size: 13.5px; min-height: unset; }
}

/*.pf-cat-btn:hover  { border-color: var(--pf-accent); color: var(--pf-accent); }*/
.pf-cat-btn:hover  { background: #4e2257; color: var(--pf-white); }
/*.pf-cat-btn.active { background: var(--pf-accent); border-color: var(--pf-accent); color: var(--pf-white); }*/
.pf-cat-btn.active {background: #4e2257;color: var(--pf-white);}

/* ═══════════════════════════════════════════════════════════
   ACTIVE FILTER CHIPS
════════════════════════════════════════════════════════════ */
.pf-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  min-height: 0;
  order: 3;
}

.pf-chip {
  display: inline-flex;
  align-items: center;
  /*gap: 5px;*/
  /*background: var(--pf-accent-light);*/
  background: var(--pf-white);
  /*border: 1px solid #e9b0b8;*/
  border: 1px solid #4e2257;
  /*color: var(--pf-accent);*/
  color: #4e2257;
  /*border-radius: 20px;*/
  border-radius: 5px;
  font-size: 13px;
  /*padding: 6px 12px 6px 14px;*/
  padding: 3px 4px 3px 13px;
  font-family: var(--pf-font-sans);
  margin-top: 15px;
}

.pf-chip-remove {
  background: none;
  border: none;
  cursor: pointer;
  /*color: var(--pf-accent);*/
  color: #4e2257;
  padding: 2px 0 2px 4px;
  font-size: 17px;
  line-height: 1;
  display: flex;
  align-items: center;
  min-width: 28px;
  min-height: 28px;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

/* ═══════════════════════════════════════════════════════════
   RESULTS STATUS
════════════════════════════════════════════════════════════ */
.pf-results-status {
  font-size: 13.5px;
  color: var(--pf-text-muted);
  margin-bottom: 16px;
  min-height: 18px;
  order: 3;
}

/* ═══════════════════════════════════════════════════════════
   GRID — mobile-first: single column → 2 → 3 → 4
════════════════════════════════════════════════════════════ */
.pf-grid {
  display: grid;
  grid-template-columns: 1fr;   /* single column on phones */
  gap: 20px;
  transition: opacity .25s ease;
}

@media (min-width: 480px) {
  .pf-grid { gap: 22px; }
}

@media (min-width: 640px) {
  .pf-cols-2,
  .pf-cols-3,
  .pf-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .pf-grid   { gap: 24px; }
}

@media (min-width: 900px) {
  .pf-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .pf-cols-4 { grid-template-columns: repeat(4, 1fr); }
  .pf-grid   { gap: 28px; }
}

@media (min-width: 1100px) {
  .pf-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

.pf-grid.is-loading { opacity: .4; pointer-events: none; }

/* ═══════════════════════════════════════════════════════════
   CARDS
════════════════════════════════════════════════════════════ */
.pf-card {
  background: var(--pf-white);
  border: 1px solid var(--pf-border);
  border-radius: var(--pf-radius-lg);
  overflow: hidden;
  box-shadow: var(--pf-card-shadow);
  transition: box-shadow var(--pf-transition), transform var(--pf-transition);
  display: flex;
  flex-direction: column;
  /* on very small screens: side-by-side layout */
}

/* hover effect only on pointer devices (not touch) */
@media (hover: hover) and (pointer: fine) {
  .pf-card:hover {
    box-shadow: var(--pf-card-hover);
    transform: translateY(-3px);
  }
  .pf-card:hover .pf-card-img img { transform: scale(1.04); }
}

/* Card image */
.pf-card-img {
  width: 100%;
  /*aspect-ratio: 16 / 10;*/
  /*overflow: hidden;*/
  background: #f0f0f5;
  flex-shrink: 0;
  aspect-ratio: auto;
  height: auto !important;
  overflow: visible;
}

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

.pf-img-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e8e8f0 0%, #d0d0e0 100%);
}

/* Card body */
.pf-card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

@media (min-width: 640px) {
  .pf-card-body { padding: 18px 20px 20px; }
}

.pf-card-category {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  /*color: var(--pf-accent);*/
  color: #4e2257;;
  margin-bottom: 8px;
}

.pf-card-title {
  font-family: var(--pf-font);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 10px;
  /*color: var(--pf-text);*/
  color: #4e2257;
}

@media (min-width: 640px) {
  .pf-card-title { font-size: 17px; }
}

.pf-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color var(--pf-transition);
}

.pf-card-title a:hover { color: var(--pf-accent); }

.pf-card-excerpt {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--pf-text-muted);
  margin: 0 0 14px;
  flex: 1;
}

.pf-card-meta {
  font-size: 12.5px;
  color: var(--pf-text-muted);
  margin-bottom: 10px;
}

.pf-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 14px;
}

.pf-card-tag {
  font-size: 11.5px;
  padding: 3px 9px;
  background: var(--pf-bg);
  border: 1px solid var(--pf-border);
  border-radius: 20px;
  color: var(--pf-text-muted);
}

.pf-card-readmore {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  color: var(--pf-accent);
  text-decoration: none;
  margin-top: auto;
  padding: 4px 0;            /* larger tap target */
  transition: gap var(--pf-transition);
  -webkit-tap-highlight-color: transparent;
}

.pf-card-readmore svg { width: 14px; height: 14px; }

@media (hover: hover) and (pointer: fine) {
  .pf-card-readmore:hover { gap: 9px; }
}

/* ── No results ─────────────────────────────────────────── */
.pf-no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  color: var(--pf-text-muted);
  font-size: 15px;
}

/* ── Loading spinner ────────────────────────────────────── */
.pf-loading {
  display: none;
  justify-content: center;
  align-items: center;
  padding: 40px 0;
}

.pf-loading.is-visible { display: flex; }

.pf-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--pf-border);
  /*border-top-color: var(--pf-accent);*/
  border-top-color: #4e2257;
  border-radius: 50%;
  animation: pf-spin .7s linear infinite;
}

@keyframes pf-spin { to { transform: rotate(360deg); } }

/* ── Load More ──────────────────────────────────────────── */
.pf-load-more-wrap {
  text-align: center;
  padding: 32px 0 10px;
}

.pf-load-more {
  padding: 14px 40px;
  min-height: var(--pf-tap-min);
  background: var(--pf-white);
  /*border: 2px solid var(--pf-accent);*/
  border: 2px solid #4e2257;
  border-radius: 30px;
  /*color: var(--pf-accent);*/
  color: #4e2257;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--pf-font-sans);
  cursor: pointer;
  transition: background var(--pf-transition), color var(--pf-transition);
  -webkit-tap-highlight-color: transparent;
  /* full-width on very small phones */
  width: 100%;
  max-width: 280px;
}

@media (min-width: 400px) {
  .pf-load-more { width: auto; }
}

/*.pf-load-more:hover  { background: var(--pf-accent); color: var(--pf-white); }*/
.pf-load-more:hover  { background: #4e2257; color: var(--pf-white); }
.pf-load-more:disabled { opacity: .5; cursor: not-allowed; }


/*4/42026*/
#pf-wrapper{
  display: flex;
  flex-direction: column;
}
#pf-grid {
  order: 3;
}
#pf-load-more-wrap {
  order: 4;
}