/*!
 * Scanlons branch directory 1.1.4 — [scanlons_branch_directory]
 *
 * One component for every footer / contact page: five branches grouped by
 * region (Limerick 3 | Dublin 2), identical card anatomy, rows aligned across
 * cards with subgrid. Layout responds to the space it is given (container
 * queries), so it works full-width in a footer and inside a content column.
 * Theme rules are emphatic (!important) because host themes style footer
 * p / a / dl with ID selectors.
 */

.sbd {
  --sbd-text: #ffffff;
  --sbd-muted: #c4c4c4;
  --sbd-name: #ffffff;
  --sbd-label: #ffffff;
  --sbd-link: #5fd3df;
  --sbd-rule: rgba(255, 255, 255, 0.16);
  --sbd-scanlons: #2dc0d0;
  --sbd-limitless: #a888ff;
  --sbd-display: inherit;
  --sbd-gap: 28px;
  container-type: inline-size;
  width: 100%;
  color: var(--sbd-text);
  text-align: left;
}
/* Elementor measures a widget inside a flex-column container at its narrowest
   intrinsic width before stretching it. The container queries then pick the
   one-column layout and the widget keeps that (much taller) height, leaving a
   blank gap under the directory. A definite width stops that. */
.elementor-widget:has(.sbd) {
  width: 100%;
}

/* ---------------------------------------------------------------- themes */
.sbd--pharmacy {
  --sbd-name: #ea96e7;
  --sbd-display: Signika, 'Source Sans Pro', sans-serif;
}
.sbd--healthcare {
  --sbd-text: #f1f2f3;
  --sbd-muted: #c3c6ca;
  --sbd-name: #33cccc;
  --sbd-link: #5ee0e0;
  --sbd-display: Rubik, sans-serif;
}
.sbd--limitless {
  --sbd-muted: #b3b3c2;
  --sbd-link: #c2adff;
  --sbd-rule: rgba(255, 255, 255, 0.14);
  --sbd-limitless: #9b7bff;
  --sbd-display: Manrope, sans-serif;
}
.sbd--light {
  --sbd-text: #1f2a2e;
  --sbd-muted: #4f5e63;
  --sbd-name: #1f2a2e;
  --sbd-label: #1f2a2e;
  --sbd-link: #0b6f7b;
  --sbd-rule: rgba(31, 42, 46, 0.16);
  --sbd-scanlons: #1aa7b8;
  --sbd-limitless: #6a3fb0;
  --sbd-display: Signika, 'Source Sans Pro', sans-serif;
}

/* ------------------------------------------------------- reset + type */
.sbd p,
.sbd dl,
.sbd dt,
.sbd dd {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  text-align: left !important;
}
.sbd a {
  color: var(--sbd-link) !important;
  text-decoration: none !important;
  border: 0 !important;
  box-shadow: none !important;
  background: none !important;
  transition: color 0.15s ease, opacity 0.15s ease;
}
.sbd a:hover,
.sbd a:focus-visible {
  text-decoration: underline !important;
  text-underline-offset: 3px;
}
.sbd a:focus-visible {
  outline: 2px solid var(--sbd-link);
  outline-offset: 3px;
  border-radius: 2px;
}
.sbd .sbd-icon {
  display: inline-block;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  vertical-align: -3px;
}
/* Line icons: some themes set svg { fill: currentColor } */
.sbd .sbd-icon,
.sbd .sbd-icon * {
  fill: none !important;
  stroke: currentColor;
}
.sbd .sbd-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------------------------------------------------------- region label */
.sbd .sbd__region-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px !important;
  margin-bottom: 24px !important;
  border-bottom: 1px solid var(--sbd-rule) !important;
  color: var(--sbd-label) !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
}
.sbd .sbd__region-name {
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.sbd .sbd__region-count {
  color: var(--sbd-muted);
  font-size: 12px;
}

/* ------------------------------------------------------------------ card */
.sbd .sbd-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  font-size: 14px;
  line-height: 1.5;
}
.sbd .sbd-card__brand {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 6px !important;
  color: var(--sbd-muted) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
}
.sbd .sbd-card__dot {
  margin-bottom: 3px;
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--sbd-scanlons);
}
.sbd .sbd-card--limitless .sbd-card__dot {
  background: var(--sbd-limitless);
}
.sbd .sbd-card__name {
  margin-bottom: 10px !important;
  color: var(--sbd-name) !important;
  font-family: var(--sbd-display) !important;
  font-size: 21px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
}
.sbd .sbd-card__address {
  margin-bottom: 16px !important;
  color: var(--sbd-muted) !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
}
.sbd .sbd-card__hours {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 3px;
  align-content: start;
  margin-bottom: 16px !important;
  padding: 10px 0 !important;
  border-top: 1px solid var(--sbd-rule) !important;
  border-bottom: 1px solid var(--sbd-rule) !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
  font-variant-numeric: tabular-nums;
}
.sbd .sbd-card__hours > div {
  display: contents;
}
.sbd .sbd-card__hours dt {
  color: var(--sbd-muted) !important;
  font-weight: 400 !important;
  white-space: nowrap;
}
.sbd .sbd-card__hours dd {
  color: var(--sbd-text) !important;
  font-weight: 500 !important;
  white-space: nowrap;
}
.sbd .sbd-card__phone {
  margin-bottom: 6px !important;
  font-size: 17px !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
}
.sbd .sbd-card__phone a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  color: var(--sbd-text) !important;
}
.sbd .sbd-card__phone .sbd-icon {
  color: var(--sbd-link);
}
.sbd .sbd-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
}
.sbd .sbd-card__links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
}

/* ----------------------------------------------------------- shared line */
.sbd .sbd__shared {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 32px !important;
  padding-top: 20px !important;
  border-top: 1px solid var(--sbd-rule) !important;
  color: var(--sbd-muted) !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
}
.sbd .sbd__shared .sbd-icon {
  color: var(--sbd-link);
}
.sbd .sbd__shared a {
  font-weight: 600;
}

/* ----------------------------------------------------------- trust strip
   <div class="sbd sbd--{theme}"><div class="sbd-trust">
     <div class="sbd-trust__awards"><figure class="sbd-trust__award"><img …>
       <figcaption>…</figcaption></figure>…</div>
     <p class="sbd-trust__pay">…</p></div></div>                              */
.sbd .sbd-trust {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px 48px;
  padding-top: 28px;
  border-top: 1px solid var(--sbd-rule);
}
.sbd .sbd-trust__awards {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 40px;
}
.sbd .sbd-trust__award {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 !important;
  padding: 0 !important;
}
.sbd .sbd-trust__award img {
  display: block;
  flex: 0 0 auto;
  width: auto !important;
  height: 48px !important;
  max-width: none !important;
  margin: 0 !important;
  border-radius: 4px;
}
.sbd .sbd-trust__award figcaption {
  max-width: 15em;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--sbd-muted) !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 1.4 !important;
  text-align: left !important;
}
.sbd .sbd-trust__pay {
  color: var(--sbd-muted) !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
}
/* Directly under a directory: one shared rule above the email line is enough */
.sbd + .sbd {
  margin-top: 28px;
}
.sbd + .sbd .sbd-trust {
  padding-top: 0;
  border-top: 0;
}
@container (max-width: 599.98px) {
  .sbd .sbd-trust {
    align-items: flex-start;
    flex-direction: column;
  }
  .sbd .sbd-trust__award img {
    height: 40px !important;
  }
}
/* Tablet: keep both awards on one line (captions wrap tighter) rather than
   stacking them and leaving the right half of the strip empty. */
@container (min-width: 600px) and (max-width: 959.98px) {
  .sbd .sbd-trust__awards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, max-content));
    column-gap: 32px;
  }
}

/* ---------------------------------------------- layouts by container size */

/* Wide: one row of five, Limerick | Dublin, rows aligned across all cards */
@container (min-width: 960px) {
  .sbd--regions .sbd__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) 0 repeat(2, minmax(0, 1fr));
    column-gap: var(--sbd-gap);
  }
  .sbd--regions .sbd__region {
    display: contents;
  }
  .sbd--regions .sbd__region-label {
    grid-row: 1;
  }
  .sbd--regions .sbd__region--limerick .sbd__region-label {
    grid-column: 1 / 4;
  }
  .sbd--regions .sbd__region--dublin .sbd__region-label {
    grid-column: 5 / 7;
  }
  .sbd--regions .sbd__region--limerick .sbd-card:nth-of-type(1) { grid-column: 1; }
  .sbd--regions .sbd__region--limerick .sbd-card:nth-of-type(2) { grid-column: 2; }
  .sbd--regions .sbd__region--limerick .sbd-card:nth-of-type(3) { grid-column: 3; }
  .sbd--regions .sbd__region--dublin .sbd-card:nth-of-type(1) { grid-column: 5; }
  .sbd--regions .sbd__region--dublin .sbd-card:nth-of-type(2) { grid-column: 6; }
  .sbd--regions .sbd-card {
    display: grid;
    grid-row: 2 / span 6;
    grid-template-rows: subgrid;
  }
}

/* Medium: one row per region, three columns */
@container (min-width: 600px) and (max-width: 959.98px) {
  .sbd--regions .sbd__region + .sbd__region {
    margin-top: 40px;
  }
  .sbd--regions .sbd__region {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 28px;
  }
  .sbd--regions .sbd__region-label {
    grid-column: 1 / -1;
  }
  .sbd--regions .sbd-card {
    display: grid;
    grid-row: 2 / span 6;
    grid-template-rows: subgrid;
  }
}

/* Single region (set="limerick" / "dublin"): one row of n */
@container (min-width: 600px) {
  .sbd:not(.sbd--regions) .sbd__region {
    display: grid;
    grid-template-columns: repeat(var(--sbd-n, 2), minmax(0, 1fr));
    column-gap: var(--sbd-gap);
  }
  .sbd:not(.sbd--regions) .sbd__region-label {
    grid-column: 1 / -1;
  }
  .sbd:not(.sbd--regions) .sbd-card {
    display: grid;
    grid-row: 2 / span 6;
    grid-template-rows: subgrid;
  }
}

/* Narrow: two columns, then one */
@container (max-width: 599.98px) {
  .sbd .sbd__region {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px 24px;
  }
  .sbd .sbd__region + .sbd__region {
    margin-top: 40px;
  }
  .sbd .sbd__region-label {
    grid-column: 1 / -1;
    margin-bottom: 0 !important;
  }
  .sbd .sbd-card__phone a,
  .sbd .sbd-card__links a {
    min-height: 44px;
  }
  .sbd .sbd-card__links {
    gap: 0 18px;
  }
  /* phone number and links share one action row */
  .sbd .sbd-card {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 20px;
  }
  .sbd .sbd-card > * {
    flex: 1 0 100%;
  }
  .sbd .sbd-card > .sbd-card__phone,
  .sbd .sbd-card > .sbd-card__links {
    flex: 0 1 auto;
    margin-bottom: 0 !important;
  }
  .sbd .sbd-card__hours {
    margin-bottom: 8px !important;
  }
}
@container (max-width: 419.98px) {
  .sbd .sbd__region {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 16px;
  }
  .sbd .sbd-card + .sbd-card {
    padding-top: 24px;
    border-top: 1px solid var(--sbd-rule);
  }
}

/* No container-query support: readable stacked cards */
@supports not (container-type: inline-size) {
  .sbd .sbd__region {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 32px;
  }
  .sbd .sbd__region-label {
    grid-column: 1 / -1;
  }
}
