/* fallback */
.note.small{font-size:13px; padding:10px 12px; border-radius:14px; border:1px solid var(--line); background:var(--soft); display:inline-block;}
code{background:#f1f5f9;padding:2px 6px;border-radius:8px;border:1px solid var(--line);}

/* Badge pill layout */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  text-decoration: none;
  background: #f5f7fa;
  color: #222;
  margin: 0;
}

/* Icon sizing (THIS fixes the issue) */
.pill img {
  width: 16px;
  height: 16px;
  display: block;
}

/* Optional hover polish */
.pill:hover {
  background: #e9eef5;
}

/* Supplier image container */
/* Larger featured image in supplier cards */
.listing-thumb {
  width: 140px;
  height: 140px;
  flex-shrink: 0;
  border-radius: 14px;
  object-fit: contain;
  background: #fff;

  border: 2px solid #333;   /* darker border */
  padding: 8px;
  display: block;

  margin: 0 auto 10px;      /* center the image + add a bit of spacing below */
}



/* Supplier card base */
.listing-card {
  border: 1px solid #e6e8eb;   /* soft light gray */
  border-radius: 14px;
  background: #fff;
  padding: 16px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.listing-card:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

/* Responsive grid container */
#listingGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  align-items: stretch;
}

/* Make each card fill its grid cell */
#listingGrid .listing-card {
  height: 100%;
}

@media (max-width: 480px) {
  #listingGrid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .listing-thumb {
    width: 72px;
    height: 72px;
    padding: 6px;
  }
}


/* Directory grid layout */
#listingGrid{
  display:grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap:16px;
  align-items:stretch;
}

/* Make sure cards can layer */
.listing-card{
  position: relative;
}

@media (min-width: 700px){
  #listingGrid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1100px){
  #listingGrid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Let the directory section use most of the viewport width */
#directoryApp{
  max-width: 1400px;   /* adjust: 1200–1600 depending on taste */
  width: 100%;
  margin: 0 auto;
  padding: 0 12px;     /* small breathing room on edges */
}

/* Vertical stacking inside card */
.listing-body{
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Contact rows: icon + value */
/* Vertical contacts block */
.contacts{
  display:flex;
  flex-direction:column;
  gap:6px;
}

/* One contact line: icon + text */
.contact-row{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:14px;
  font-family: inherit;     /* ensures same font */
  color:#333;
  text-decoration:none;
}

.contact-row img{
  width:14px;
  height:14px;
  display:block;
  flex-shrink:0;
}

.contact-row:hover{
  text-decoration:underline;
}


.pills{ display:flex; flex-direction:column; gap:6px; }

.listing-title h3{
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 600;
  text-align: center;   /* NEW */
}


/* Make Directory intro text match supplier grid width */
.page-id-18 .kpd-intro {
    max-width: 1200px;   /* match your card grid width */
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* Make the Directory page H1 match the card grid width */
.page-id-18 #kpd-intro-title {
  display: block !important;
  width: 100% !important;
  max-width: 1200px !important;   /* adjust to match your card grid */
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 24px !important;
  padding-right: 24px !important;
  box-sizing: border-box !important;
  text-align: center;             /* optional */
}

/* Taxonomy pages only: shrink common header/logo/icon blocks */
.tax-supplier_category .wp-block-site-logo img,
.tax-location .wp-block-site-logo img,
.tax-supplier_category .wp-block-site-logo svg,
.tax-location .wp-block-site-logo svg {
  width: 48px !important;
  height: auto !important;
  max-width: 48px !important;
}

/* Taxonomy pages: stop giant thumbnails/featured images */
.tax-supplier_category img.wp-post-image,
.tax-location img.wp-post-image,
.tax-supplier_category .wp-block-post-featured-image img,
.tax-location .wp-block-post-featured-image img {
  width: 80px !important;
  height: 80px !important;
  object-fit: contain !important;
  border-radius: 12px; /* optional */
}

.tax-supplier_category .wp-block-post-featured-image,
.tax-location .wp-block-post-featured-image {
  max-width: 80px !important;
  max-height: 80px !important;
}

/* Make header/navigation container wider to prevent wrapping */
.wp-site-blocks header,
.wp-site-blocks .wp-block-template-part,
.wp-site-blocks .wp-block-group {
  max-width: 1400px !important;   /* adjust if needed */
  margin-left: auto;
  margin-right: auto;
}

/* Enlarge the Add Your Company illustration */
/* Enlarge just this image block by 2.5× */
.page-id-128 figure.wp-block-image.size-full {
  transform: scale(2.5);
  transform-origin: center center; /* or center center */
}

/* Prevent cropping */
.page-id-128 .wp-block-column,
.page-id-128 .wp-block-group,
.page-id-128 .wp-block-columns,
.page-id-128 .entry-content {
  overflow: visible !important;
}

/* TESTING */
.page-id-128 figure.wp-block-image.size-full {
  outline: 3px solid red;
}

body { outline: 8px solid hotpink !important; }

/* Align Province + Town columns neatly */
.kpd-loc-col{
  display: grid;
  grid-template-rows: 22px auto;  /* Province row, then towns */
  align-items: start;
}

/* Province header line */
.kpd-loc-prov{
  margin: 0;
  height: 22px;
  line-height: 22px;
  font-weight: 600;
  display: flex;
  align-items: center;
}

/* Towns start at same Y position */
.kpd-loc-town{
  margin: 4px 0 0;
  line-height: 1.2;
}

/* Directory page: remove ONLY the spacer directly ABOVE the page title */
.page-id-18 main > .wp-block-group.has-global-padding > .wp-block-spacer:first-child {
  display: none !important;
  height: 0 !important;
}

/* ---------- More branches & info modal ---------- */

.kpd-more-link{
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-decoration: underline;
  font-size: 0.95rem;
  color: #333;
}

.kpd-modal-overlay{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.55);
}

.kpd-modal-overlay[hidden]{
  display: none !important;
}

.kpd-modal{
  width: min(720px, 100%);
  max-height: min(80vh, 820px);
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 35px rgba(0,0,0,0.25);
  outline: none;
  position: relative;
  padding: 18px 18px 14px;
}

.kpd-modal-header{
  padding-right: 34px;
  margin-bottom: 8px;
}

.kpd-modal-title{
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.kpd-modal-close{
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  background: rgba(0,0,0,0.06);
  font-size: 22px;
  line-height: 36px;
}
.kpd-modal {
  position: relative;
}

.kpd-modal-close {
  z-index: 10;
  pointer-events: auto;
}


.kpd-modal-body{ padding-top: 6px; }

.kpd-modal-section{
  padding: 12px 0;
  border-top: 1px solid rgba(0,0,0,0.08);
}

.kpd-modal-section:first-child{
  border-top: 0;
  padding-top: 0;
}

.kpd-modal-h{
  margin: 0 0 6px 0;
  font-size: 1.05rem;
}

.kpd-modal-p{
  margin: 0;
  line-height: 1.5;
}

.kpd-location-list{
  display: grid;
  gap: 6px;
}

.kpd-location-row{
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0,0,0,0.04);
}

.kpd-contact-block > div{ margin: 6px 0; }

/* Prevent background scrolling when modal is open */
html.kpd-modal-open,
body.kpd-modal-open{
  overflow: hidden;
}

.kpd-branches-list{
  display: grid;
  gap: 10px;
}

.kpd-branch-row{
  padding: 10px;
  border-radius: 10px;
  background: rgba(0,0,0,0.04);
  display: grid;
  gap: 6px;
}

.kpd-branch-location{
  font-weight: 600;
}

.kpd-branch-contacts > div{
  margin: 4px 0;
}

/* Featured floating panel (desktop) */
.kpd-featured-panel{
  position: fixed;
  top: 110px;           /* adjust to clear your header */
  right: 24px;
  width: 320px;
  max-height: calc(100vh - 140px);
  overflow: auto;

  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.10);
  z-index: 9999;
}

.kpd-featured-panel header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.kpd-featured-title{
  font-weight: 700;
  font-size: 14px;
  margin: 0;
}

.kpd-featured-toggle{
  border: 0;
  background: rgba(0,0,0,0.06);
  border-radius: 10px;
  cursor: pointer;
  padding: 6px 10px;
  font-size: 13px;
}

.kpd-featured-body{
  padding: 12px 14px;
  display: grid;
  gap: 12px;
}

.kpd-featured-item{
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.06);
}

.kpd-featured-item{
  width: 100%;
  text-align: left;
  cursor: pointer;
  background: #fff;
}

.kpd-featured-item:hover{
  box-shadow: 0 6px 18px rgba(0,0,0,0.10);
}

.kpd-featured-item:focus{
  outline: 3px solid rgba(34,197,94,0.35);
  outline-offset: 2px;
}


.kpd-featured-logo{
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(0,0,0,0.10);
}

.kpd-featured-name{
  font-weight: 700;
  font-size: 13px;
  margin: 0 0 2px;
}

.kpd-featured-meta{
  font-size: 12px;
  opacity: 0.75;
  margin: 0;
}

.kpd-featured-cta{
  display:inline-block;
  margin-top: 6px;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

/* Minimized state */
.kpd-featured-panel.is-minimized .kpd-featured-body{
  display: none;
}

/* Hide on smaller screens (you can later move it below filters instead) */
@media (max-width: 1100px){
  .kpd-featured-panel{ display:none; }
}

/* Strong highlight that sits on top of neighbors */
.kpd-card-flash{
  z-index: 50;                 /* lift above other cards */
  outline: 4px solid rgba(34, 197, 94, 0.70);
  outline-offset: 4px;
  box-shadow: 0 0 0 10px rgba(34, 197, 94, 0.18),
              0 18px 40px rgba(0,0,0,0.18);
  transform: translateZ(0);    /* helps some browsers layer it cleanly */
}

.kpd-featured-item:hover .kpd-featured-meta{
  text-decoration: underline;
}











