/* UKPTG Directories v1.2.8 */
:root { --ukptg-container: 1200px; --ukptg-gap: 14px; }
.ukptg-wrap { max-width: var(--ukptg-container); margin: 0 auto; padding: 0 12px; }
.ukptg-search { display:flex; flex-wrap:wrap; gap:10px; align-items:flex-end; margin: 10px 0 18px; }
.ukptg-search label { font-size:.8rem; display:block; color:#111827; }
.ukptg-search select, .ukptg-search input[type=text] { padding:6px 8px; border:1px solid #d1d5db; border-radius:8px; }

.ukptg-dir-grid { display:grid; gap: var(--ukptg-gap); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.ukptg-cols-8 .ukptg-dir-grid { grid-template-columns: repeat(8, minmax(0,1fr)); }
.ukptg-cols-7 .ukptg-dir-grid { grid-template-columns: repeat(7, minmax(0,1fr)); }
.ukptg-cols-6 .ukptg-dir-grid { grid-template-columns: repeat(6, minmax(0,1fr)); }
@media (max-width: 1536px) { .ukptg-cols-8 .ukptg-dir-grid { grid-template-columns: repeat(6, minmax(0,1fr)); } }
@media (max-width: 1280px) { .ukptg-cols-8 .ukptg-dir-grid, .ukptg-cols-7 .ukptg-dir-grid { grid-template-columns: repeat(5, minmax(0,1fr)); } }
@media (max-width: 1100px) { .ukptg-cols-8 .ukptg-dir-grid, .ukptg-cols-7 .ukptg-dir-grid, .ukptg-cols-6 .ukptg-dir-grid { grid-template-columns: repeat(4, minmax(0,1fr)); } }
@media (max-width: 900px) { .ukptg-cols-* .ukptg-dir-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 640px) { .ukptg-cols-* .ukptg-dir-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }

.ukptg-card { position:relative; border:1px solid #e5e7eb; border-radius:12px; padding:12px; background:#fff; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.ukptg-thumb { width:100%; height:auto; border-radius:10px; display:block; }
.ukptg-title { margin:8px 0 2px; font-size:1rem; line-height:1.2; }
.ukptg-meta { color:#6b7280; font-size:.85rem; margin:0 0 6px; }
.ukptg-desc { color:#374151; font-size:.9rem; line-height:1.35; }
.ukptg-btn { display:inline-block; padding:7px 10px; border-radius:10px; border:1px solid #111827; text-decoration:none; background:#fff; font-size:.9rem; }
.ukptg-premium-bar { display:inline-block; background:#FFD700; color:#111827; font-weight:600; font-size:.78rem; line-height:1; padding:6px 10px; border-radius:10px; box-shadow:0 1px 0 rgba(0,0,0,.08); margin:8px 0; }
.ukptg-pagination { display:flex; gap:8px; justify-content:center; margin:16px 0; }
.ukptg-pagination a, .ukptg-pagination span { border:1px solid #d1d5db; padding:6px 10px; border-radius:8px; text-decoration:none; }
.ukptg-pagination .current { background:#111827; color:#fff; border-color:#111827; }
.ukptg-ok { background:#ecfdf5; border:1px solid #10b981; padding:10px; border-radius:8px; margin-bottom:10px; }
.ukptg-err { background:#fef2f2; border:1px solid #ef4444; padding:10px; border-radius:8px; margin-bottom:10px; }


/* v1.3.0 layout tweaks */
.ukptg-card { display:flex; flex-direction:column; min-height: 260px; }
.ukptg-grow { flex: 1 1 auto; }
.ukptg-actions { margin-top: 10px; }

/* Sponsor strip cards (smaller) */
.ukptg-sponsor-strip { margin: 8px 0 14px; }
.ukptg-sponsor-strip .ukptg-dir-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.ukptg-sponsor-card .ukptg-desc { display:none; }
.ukptg-sponsor-card .ukptg-thumb { max-height: 110px; object-fit: cover; }
.ukptg-sponsor-card { min-height: 200px; }
.ukptg-premium-bar.sponsor { background:#FFD700; }


/* v1.3.1 Sponsor hero background cards */
.ukptg-sponsor-hero { margin: 8px 0 14px; }
.ukptg-sponsor-hero .ukptg-dir-grid { grid-template-columns: repeat(6, minmax(0,1fr)); }
@media (max-width: 1280px){ .ukptg-sponsor-hero .ukptg-dir-grid { grid-template-columns: repeat(4, minmax(0,1fr)); } }
@media (max-width: 900px){ .ukptg-sponsor-hero .ukptg-dir-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 640px){ .ukptg-sponsor-hero .ukptg-dir-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }

.ukptg-hero-card { position:relative; border-radius:12px; overflow:hidden; min-height: 180px; display:flex; }
.ukptg-hero-bg { position:absolute; inset:0; background-size:cover; background-position:center; transform:scale(1.02); filter: saturate(1.05); }
.ukptg-hero-overlay { position:absolute; inset:0; background: linear-gradient(180deg, rgba(0,0,0,.32), rgba(0,0,0,.45)); }
.ukptg-hero-content { position:relative; z-index:2; padding:14px; color:#fff; display:flex; flex-direction:column; width:100%; }
.ukptg-hero-title { font-weight:700; margin:0 0 4px; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.ukptg-hero-sub { font-size:.9rem; opacity:.95; margin:0; }
.ukptg-hero-actions { margin-top:auto; }
.ukptg-hero-btn { display:inline-block; padding:6px 10px; border-radius:10px; border:1px solid rgba(255,255,255,.9); color:#fff; text-decoration:none; background:rgba(0,0,0,.25); }


/* v1.3.2 hero tweaks */
.ukptg-hero-card { min-height: 140px; }
.ukptg-hero-bg { filter: saturate(1.05) brightness(0.98); }
.ukptg-hero-title { display:none; } /* move name into badge */
.ukptg-hero-badge { position: absolute; left: 14px; bottom: 12px; background:#FFD700; color:#111827; font-weight:700; padding:8px 12px; border-radius:12px; z-index:3; display:inline-block; }
.ukptg-hero-sub { display:none; } /* keep it compact */
.ukptg-hero-stretch { position:absolute; inset:0; z-index:4; }


/* v1.3.4 hero card refinements for 300x150 look */
.ukptg-sponsor-hero .ukptg-dir-grid { grid-template-columns: repeat(6, minmax(0,1fr)); }
.ukptg-hero-card { position:relative; height:150px; min-height:150px; border:1px solid #e5e7eb; border-radius:12px; overflow:hidden; background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.04); }
.ukptg-hero-bg { position:absolute; inset:0; background-size:cover; background-position:center; transform:scale(1.01); filter:saturate(1.02); }
.ukptg-hero-overlay { position:absolute; inset:0; background: linear-gradient(180deg, rgba(0,0,0,.10), rgba(0,0,0,.35)); }
.ukptg-hero-badge { position:absolute; left:10px; bottom:10px; background:#FFD700; color:#111827; font-weight:700; font-size:.9rem; padding:6px 10px; border-radius:10px; }
.ukptg-hero-stretch { position:absolute; inset:0; z-index:5; }

/* v1.3.5 visual polish */
.ukptg-hero-badge { font-size:.85rem; padding:5px 10px; border-radius:10px; box-shadow:0 1px 0 rgba(0,0,0,.12); }
.ukptg-sponsor-hero .ukptg-dir-grid { gap:12px; }
.ukptg-searchband { background: linear-gradient(180deg,#f5f7f9,#eef1f4); border:1px solid #e5e7eb; border-radius:14px; padding:12px; margin-bottom:14px; }
.ukptg-searchband .ukptg-search { margin:0; }
.ukptg-black-bar { height:44px; background:#0f172a; border-radius:10px; margin:16px auto 0; max-width: var(--ukptg-container); }
.ukptg-wrap .az-filter, .ukptg-wrap .alpha-bar, .ukptg-wrap .ukptg-az { display:none !important; } /* hide A-Z if present inside our container */

/* v1.3.6 precise hero sizing + full-width footer bar */
.ukptg-hero-card { position:relative; height:150px; min-height:150px; border:1px solid #e5e7eb; border-radius:12px; overflow:hidden; background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.04); padding:6px; }
.ukptg-hero-img { width:100%; height:100%; object-fit:contain; border-radius:8px; background:#fff; }
/* remove previous bg layers if present */
.ukptg-hero-bg, .ukptg-hero-overlay { display:none !important; }
.ukptg-hero-badge { font-size:.8rem; padding:4px 9px; border-radius:9px; bottom:8px; left:8px; }
.ukptg-black-bar { height:28px; width:100vw; margin-left:calc(50% - 50vw); margin-right:calc(50% - 50vw); border-radius:0; }

/* v1.3.8 polish */
.ukptg-hero-card { height:150px; min-height:150px; border:1px solid #e5e7eb; border-radius:12px; overflow:hidden; background:#fff; padding:0; }
.ukptg-hero-img { width:100%; height:100%; object-fit:contain; display:block; background:#fff; }
/* Badge smaller and closer */
.ukptg-hero-badge { font-size:.78rem; padding:4px 8px; border-radius:9px; bottom:8px; left:8px; }

/* Search band alignment */
.ukptg-search { display:grid; grid-auto-flow:column; grid-auto-columns:max-content; gap:12px; align-items:center; }
.ukptg-search label { font-weight:600; color:#111827; opacity:.85; }
.ukptg-search select, .ukptg-search input { height:38px; }
.ukptg-searchband { background: linear-gradient(180deg,#f7f8fb,#eef2f7); border:1px solid #e5e7eb; border-radius:14px; padding:14px 16px; margin-bottom:16px; }

/* Full-width black bar */
.ukptg-black-bar { height:28px; width:100vw; position:relative; left:50%; transform:translateX(-50%); border-radius:0; background:#0f172a; }

/* Hide various A–Z bars whenever our body class is present */
.ukptg-hide-az .az, 
.ukptg-hide-az .a-z, 
.ukptg-hide-az .az-index, 
.ukptg-hide-az .alphabet, 
.ukptg-hide-az .kb-az, 
.ukptg-hide-az [class*="alphabet"], 
.ukptg-hide-az [class*="az-"], 
.ukptg-hide-az [aria-label*="A–Z"] { display:none !important; }

/* v1.3.9 layout polish */
.ukptg-search { display:grid; grid-auto-flow:column; grid-auto-columns:max-content; gap:14px; align-items:center; justify-content:center; }
.ukptg-searchband { margin-top:6px; margin-bottom:14px; }
.ukptg-wrap { margin-top:8px; }

/* Sponsor hero exact fill (no top gap) */
.ukptg-hero-card { aspect-ratio: 2 / 1; height:auto; min-height:unset; }
.ukptg-hero-img { width:100%; height:100%; object-fit:cover; display:block; }

/* Badge size */
.ukptg-hero-badge { font-size:.75rem; padding:4px 8px; }

/* Full-bleed footer bar without viewport quirks */
.ukptg-black-bar { height:26px; width:100vw; position:relative; left:50%; transform:translateX(-50%); margin:14px 0 0 0; border-radius:0; background:#0f172a; }
@media (min-width: 1600px){ .ukptg-black-bar { width:100%; left:0; transform:none; } }

/* v1.4.0 responsive cards + true full-bleed bar */
/* Make all directory grids wrap instead of squashing */
.ukptg-dir-grid { display:grid; gap:16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
/* Sponsor hero grid wraps at 300px tiles */
.ukptg-sponsor-hero .ukptg-dir-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
/* Ensure cards have flex to place button at bottom */
.ukptg-card { display:flex; flex-direction:column; }
.ukptg-actions { margin-top:auto; }

/* Full-bleed black bar using margin calc to escape containers */
.ukptg-black-bar { height:26px; width:100vw; margin-left: calc(50% - 50vw) !important; margin-right: calc(50% - 50vw) !important; background:#0f172a; border-radius:0; }

/* v1.4.1 sponsor hero fix + black bar width 100% */
.ukptg-sponsor-hero .ukptg-dir-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, 300px);
  grid-auto-rows: 150px;
  gap:16px;
  justify-content:flex-start;
}
.ukptg-hero-card{ width:300px; height:150px; min-height:150px; border:1px solid #e5e7eb; border-radius:12px; overflow:hidden; background:#fff; position:relative; }
.ukptg-hero-img{ width:100%; height:100%; object-fit:cover; display:block; }
.ukptg-hero-badge{ font-size:.78rem; padding:4px 8px; border-radius:9px; position:absolute; left:8px; bottom:8px; background:#FFD700; color:#111827; font-weight:700; }

/* Make black bar exactly 100% of its container */
.ukptg-black-bar{ width:100%; height:26px; margin:14px 0 0 0 !important; border-radius:0; background:#0f172a; left:auto; transform:none; }

/* v1.4.2: sponsor tiles + full-viewport black bar */
.ukptg-sponsor-hero .ukptg-dir-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, 300px);
  grid-auto-rows: 150px;
  gap:16px;
  justify-content:flex-start;
}
.ukptg-hero-card{ width:300px; height:150px; min-height:150px; border:1px solid #e5e7eb; border-radius:12px; overflow:hidden; background:#fff; position:relative; }
.ukptg-hero-img{ width:100%; height:100%; object-fit:contain; display:block; background:#fff; }
.ukptg-hero-badge{ font-size:.78rem; padding:4px 8px; border-radius:9px; position:absolute; left:8px; bottom:8px; background:#FFD700; color:#111827; font-weight:700; }

/* Force black bar to bleed viewport edges */
.ukptg-black-bar{
  position:relative;
  height:26px;
  width:100vw;
  left:50%;
  right:auto;
  transform:translateX(-50%);
  max-width:100vw;
  margin:14px 0 0 0 !important;
  border-radius:0;
  background:#0f172a;
  box-shadow:none;
}

/* v1.4.3 sponsor 4-across, tighter spacing, full-bleed bar with smaller gap */
.ukptg-wrap { margin-top:4px; }

/* Sponsor hero: exactly 4 across, 2:1 aspect */
.ukptg-sponsor-hero .ukptg-dir-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:16px;
}
.ukptg-sponsor-hero .ukptg-hero-card{
  width:100%;
  aspect-ratio: 2 / 1;
  height:auto;
  min-height:unset;
  border:1px solid #e5e7eb;
  border-radius:12px;
  overflow:hidden;
  position:relative;
  background:#fff;
}
.ukptg-sponsor-hero .ukptg-hero-img{
  width:100%;
  height:100%;
  object-fit:cover; /* fill nicely with your 2:1 screenshots */
  display:block;
  background:#fff;
}

/* Full-viewport black bar with smaller gap to footer */
.ukptg-black-bar{
  position:relative;
  height:24px;
  width:100vw;
  left:50%;
  transform:translateX(-50%);
  max-width:100vw;
  margin:10px 0 6px 0 !important; /* smaller bottom gap */
  border-radius:0;
  background:#0f172a;
}

/* v1.4.4 sponsor hero: strict 300x150, 4-up on desktop, wrap below */
.ukptg-sponsor-hero .ukptg-dir-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 300px));
  grid-auto-rows: 150px;
  gap:16px;
  justify-content:space-between;
}
@media (min-width: 1280px){
  .ukptg-sponsor-hero .ukptg-dir-grid{
    grid-template-columns: repeat(4, 300px);
  }
}
.ukptg-sponsor-hero .ukptg-hero-card{
  width:300px; height:150px; min-height:150px;
  border:1px solid #e5e7eb; border-radius:12px; overflow:hidden; position:relative; background:#fff;
}
.ukptg-sponsor-hero .ukptg-hero-img{
  width:100%; height:100%; object-fit:contain; display:block; background:#fff;
}
/* keep badge small */
.ukptg-hero-badge{ font-size:.78rem; padding:4px 8px; border-radius:9px; position:absolute; left:8px; bottom:8px; background:#FFD700; color:#111827; font-weight:700; }

/* v1.4.5 spacing tweaks */
.ukptg-wrap{ margin-top:0 !important; }
.ukptg-searchband{ margin-top:6px !important; margin-bottom:10px !important; }
.ukptg-black-bar{ margin:6px 0 2px 0 !important; }

/* v1.4.6 sponsor grid alignment: 4 equal columns */
.ukptg-sponsor-hero .ukptg-dir-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:16px;
  justify-content:start;
}
.ukptg-sponsor-hero .ukptg-hero-card{
  width:100%;
  height:150px;
  border:1px solid #e5e7eb;
  border-radius:12px;
  overflow:hidden;
  position:relative;
  background:#fff;
}
.ukptg-sponsor-hero .ukptg-hero-img{
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
  background:#fff;
}

/* v1.4.8 spacing + CTA alignment */
.ukptg-searchband{ margin-top:4px !important; margin-bottom:8px !important; }
.ukptg-wrap{ margin-top:0 !important; }
.ukptg-dir-grid{ margin-bottom:12px; }

/* Ensure cards push CTA to bottom consistently */
.ukptg-card{ display:flex; flex-direction:column; }
.ukptg-card .ukptg-actions{ margin-top:auto; }

/* Clamp variable text so card heights normalize */
.ukptg-card .ukptg-summary,
.ukptg-card .entry-summary,
.ukptg-card .ukptg-excerpt,
.ukptg-card p{
  display:-webkit-box;
  -webkit-line-clamp:4;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

/* Smaller CTA buttons and consistent sizing */
.ukptg-card .ukptg-actions a,
.ukptg-card .ukptg-actions .button,
.ukptg-card .ukptg-actions button{
  font-size:0.95rem;
  padding:8px 14px;
  line-height:1.1;
  border-radius:10px;
}

/* Add small breathing room above black bar */
.ukptg-black-bar{ margin-top:8px !important; margin-bottom:4px !important; }

/* v1.4.9 gap fixes (theme-agnostic) */

/* Kill themes' first-child margin so band hugs the header */
.entry-content > .ukptg-searchband:first-child,
.entry-content > .ukptg-wrap:first-child,
.entry-content > .ukptg-dir-grid:first-child {
  margin-top: 4px !important;
}

/* Reduce spacing between grid and black bar */
.ukptg-dir-grid{ margin-bottom: 6px !important; }
.ukptg-black-bar{ margin-top: 4px !important; margin-bottom: 0 !important; }

/* Kill themes' last-child bottom margin so bar hugs the footer */
.entry-content > .ukptg-black-bar:last-child,
.entry-content > .ukptg-wrap:last-child,
.entry-content > .ukptg-dir-grid:last-child {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Also neutralize generic paragraph margins when they end the page right above the bar */
.entry-content > p:last-child{ margin-bottom: 0 !important; }

/* v1.5.0 definitive gap control */
.ukptg-root{
  --ukptg-top-gap: 6px;
  --ukptg-bottom-gap: 2px;
  margin-top: var(--ukptg-top-gap) !important;
  margin-bottom: var(--ukptg-bottom-gap) !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
/* Make sure nothing inside reintroduces big gaps */
.ukptg-root > *:first-child{ margin-top: 0 !important; }
.ukptg-root > *:last-child{ margin-bottom: 0 !important; }

/* Search band tighten */
.ukptg-root .ukptg-searchband{ margin: 4px 0 8px 0 !important; }

/* Grid to bar spacing */
.ukptg-root .ukptg-dir-grid{ margin-bottom: 6px !important; }
.ukptg-root .ukptg-black-bar{ margin-top: 4px !important; margin-bottom: 0 !important; }

/* Optional: tiny nudge to avoid touching the faint theme divider */
.ukptg-root .ukptg-black-bar{ transform: translateX(-50%); } /* keep full-bleed behavior */

/* v1.5.1: Full-bleed search band */
.ukptg-root .ukptg-searchband{
  position: relative;
  width: 100vw;
  left: 50%;
  transform: translateX(-50%);
  max-width: 100vw;
  padding-left: 16px;
  padding-right: 16px;
  box-sizing: border-box;
}
.ukptg-root .ukptg-search{
  margin: 0 auto;
  width: min(1200px, 100%);
}

/* Prevent any horizontal scroll due to bleed */
.ukptg-root{ overflow-x: clip; }
