.cel-resource-listing {
  display: grid;
  grid-template-columns: repeat(var(--cel-resource-tiles-row, 1), minmax(0, 1fr));
  gap: 2rem;
  width: 100%;
  align-items: stretch;
}

.cel-resource-tile {
  height: 100%;
  background: var(--cel_resource_tile_bg, #edf2f2);
  border-radius: 20px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  padding: 1.25rem 1.5rem;
  width: 100%;
  box-sizing: border-box;
  transition: box-shadow 0.2s ease;
}

.cel-resource-tile:hover {
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.13);
}

.cel-resource-tile-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  margin: 0 -0.5rem;
}

.cel-resource-col {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  min-width: 0;
  padding:10px;
}

.cel-resource-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  margin-bottom:1.3rem;
}
.cel-resource-line--loc-6.cel-resource-line--loc-5 {
  gap: 0.35rem ;
}

.cel-resource-line.cel-resource-line--loc-8, .cel-resource-line.cel-resource-line--loc-4, .cel-resource-line.cel-resource-line--loc-6
, .cel-resource-line.cel-resource-line--loc-7, .cel-resource-line.cel-resource-line--loc-9 {
   margin-bottom: 0.3rem;
}
.cel-resource-photo {
  width: 100%;
  max-width: 180px;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

/* One grid column: every bar shares the width of the longest label. */
.cel-resource-subcats {
  display: inline-grid;
  grid-template-columns: minmax(0, max-content);
  gap: 1rem;
  width: max-content;
  max-width: 100%;
  flex: 0 0 auto;
  align-self: flex-start;
  margin-bottom: 20px;
}

.cel-resource-listing .cel-resource-line > .cel-resource-subcats.cel-fmt-right {
  margin-left: auto;
}

.cel-resource-listing .cel-resource-line > .cel-resource-subcats.cel-fmt-center {
  margin-left: auto;
  margin-right: auto;
}

.cel-resource-listing .cel-resource-line > .cel-resource-subcats.cel-fmt-left {
  margin-right: auto;
}

.cel-resource-listing .cel-resource-line > .cel-resource-photo.cel-fmt-right {
  margin-left: auto;
}

.cel-resource-listing .cel-resource-line > .cel-resource-photo.cel-fmt-center {
  margin-left: auto;
  margin-right: auto;
}

.cel-resource-listing .cel-resource-line > .cel-resource-photo.cel-fmt-left {
  margin-right: auto;
}

.cel-resource-subcat-bar,
.cel-resource-listing .cel-resource-tile .cel-resource-line .cel-resource-subcat-bar {
  background: var(--cel_resource_subcat_bg, var(--cel_primary_color, #6a3d8a));
  color: var(--cel_resource_subcat_color, #fff);
  font-size: var(--cel_resource_subcat_font_size, 0.75rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: var(--cel_resource_subcat_text_transform, uppercase);
  padding: 3px 15px;
  border-radius: var(--cel_resource_subcat_radius, 4px);
  text-align: center;
  width: auto;
  justify-self: stretch;
  box-sizing: border-box;
}

.cel-resource-btn {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  background: var(--cel_resource_btn_bg, #ffc830);
  color: var(--cel_resource_btn_color, #000);
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.cel-resource-btn:hover {
  background: var(--cel_resource_btn_hover_bg, #e6b331);
  color: var(--cel_resource_btn_hover_color, #000);
  text-decoration: none;
}

.cel-resource-listing .cel-fmt-bold { font-weight: 700; }
.cel-resource-listing .cel-fmt-italics { font-style: italic; }
.cel-resource-listing .cel-fmt-underline { text-decoration: underline; }
.cel-resource-listing .cel-fmt-left { text-align: left; }
.cel-resource-listing .cel-fmt-right { text-align: right; }
.cel-resource-listing .cel-fmt-center { text-align: center; }
.cel-resource-listing .cel-resource-col .cel-resource-line.cel-fmt-top {
  margin-top: 0;
}

.cel-resource-listing .cel-resource-col .cel-resource-line.cel-fmt-middle {
  margin-top: auto;
  margin-bottom: auto;
}

.cel-resource-listing .cel-resource-col .cel-resource-line.cel-fmt-bottom {
  margin-top: auto;
}

/* Text blocks in a column may use full width; subcats/button stay shrink-wrapped. */
.cel-resource-listing .cel-resource-col .cel-resource-line > span.cel-fmt-left,
.cel-resource-listing .cel-resource-col .cel-resource-line > span.cel-fmt-right,
.cel-resource-listing .cel-resource-col .cel-resource-line > span.cel-fmt-center,
.cel-resource-listing .cel-resource-col .cel-resource-line > div[data-index="4"],
.cel-resource-listing .cel-resource-col .cel-resource-line > div[data-index="5"] {
  display: block;
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
}

.cel-resource-listing .cel-resource-subcats.cel-fmt-left,
.cel-resource-listing .cel-resource-subcats.cel-fmt-right,
.cel-resource-listing .cel-resource-subcats.cel-fmt-center {
  display: inline-grid;
  text-align: inherit;
}

.cel-resource-listing a.cel-resource-btn.cel-fmt-left,
.cel-resource-listing a.cel-resource-btn.cel-fmt-right,
.cel-resource-listing a.cel-resource-btn.cel-fmt-center {
  display: inline-block;
  width: auto;
  max-width: 100%;
  flex: 0 0 auto;
  text-align: center;
}

.cel-resource-listing .cel-resource-line:has(> a.cel-resource-btn.cel-fmt-center) {
  justify-content: center;
}

.cel-resource-listing .cel-resource-line:has(> a.cel-resource-btn.cel-fmt-right) {
  justify-content: flex-end;
}

.cel-resource-listing .cel-resource-line:has(> a.cel-resource-btn.cel-fmt-left) {
  justify-content: flex-start;
}

.cel-resource-listing .cel-resource-tile .cel-resource-line span,
.cel-resource-listing .cel-resource-tile .cel-resource-line div {
  color: var(--cel_resource_normal_color, var(--cel_normal_font_color, #2e2c2e));
  font-size: var(--cel_resource_normal_font_size, var(--cel_normal_font_size, 0.9rem));
}


.cel-resource-listing .cel-resource-tile .cel-resource-line a.cel-resource-phone,
.cel-resource-listing .cel-resource-tile .cel-resource-line a.cel-resource-phone:link,
.cel-resource-listing .cel-resource-tile .cel-resource-line a.cel-resource-phone:visited,
.cel-resource-listing .cel-resource-tile .cel-resource-line a.cel-resource-phone:hover,
.cel-resource-listing .cel-resource-tile .cel-resource-line a.cel-resource-phone:focus,
.cel-resource-listing .cel-resource-tile .cel-resource-line a.cel-resource-phone:active {
  color: var(--cel_resource_normal_color, var(--cel_normal_font_color, #2e2c2e));
  font-size: var(--cel_resource_normal_font_size, var(--cel_normal_font_size, 0.9rem));
  text-decoration: none;
  cursor: default;
}

.cel-resource-listing .cel-resource-tile .cel-resource-line a.cel-resource-phone.cel-fmt-underline,
.cel-resource-listing .cel-resource-tile .cel-resource-line a.cel-resource-phone.cel-fmt-underline:hover {
  text-decoration: underline;
}

.cel-resource-listing .cel-resource-tile .cel-resource-line .cel-resource-name,
.cel-resource-listing .cel-resource-tile .cel-resource-line a.cel-resource-name {
  color: var(--cel_resource_name_color, var(--cel_heading_font_color, #111));
  font-size: var(--cel_resource_name_font_size, 1.25rem);
  font-weight: 700;
}

.cel-resource-trainer-date .cel-resource-tile {
  display: flex;
  flex-direction: column;
}

.cel-resource-trainer-date .cel-resource-tile-footer {
  margin-top: auto;
  padding-top: 0.75rem;
}

.cel-resource-trainer-date .cel-resource-line-overview-back {
  justify-content: center;
  margin-bottom: 0;
}

.cel-resource-trainer-date .cel-resource-overview-back {
  display: inline-block;
  width: auto;
  max-width: 100%;
  margin-top: 0;
}

.cel-trainer-date-seminare-heading {
  margin: 1.75rem 0 1.25rem;
  padding: 0;
  color: var(--cel_heading_font_color, #111);
  font-size: var(--cel_heading_font_size, 1.5rem);
  font-family: inherit;
  font-weight: 700;
  line-height: 1.3;
}

/* LocContent=7 — same phone row pattern as appointment details (.loc-phone-sec). */
.cel-resource-listing .cel-resource-loc-phone.loc-phone-sec {
  display: flex;
  gap: 5px;
  align-items: center;
  flex: 0 0 auto;
  max-width: 100%;
}

/* Resource tile icons: sized from Ressource Listing → Normal font size only. */
.cel-resource-listing .svg-img {
  display: flex;
}

.cel-resource-listing .svg-img svg {
  width: var(--cel_resource_svg_icon_width, var(--cel_svg_icon_width));
  vertical-align: top;
  fill: var(--cel_icon_color);
}

.cel-resource-listing .svg-img svg path {
  stroke: var(--cel_icon_color) !important;
}

/* LocContent=8 — email row (no extra black hover underline). */
.cel-resource-listing .cel-resource-loc-email.loc-email-sec {
  display: flex;
  gap: 5px;
  align-items: center;
  flex: 0 0 auto;
  max-width: 100%;
}

.cel-resource-listing .cel-resource-loc-email .cel-res-email a.cel-resource-email,
.cel-resource-listing .cel-resource-loc-email .cel-res-email a.cel-resource-email:link,
.cel-resource-listing .cel-resource-loc-email .cel-res-email a.cel-resource-email:visited {
  color: var(--cel_icon_color);
  font-size: var(--cel_resource_normal_font_size, var(--cel_normal_font_size, 0.9rem));
  text-decoration: none;
  word-break: break-word;
}

.cel-resource-listing .cel-resource-loc-email .cel-res-email a.cel-resource-email:hover,
.cel-resource-listing .cel-resource-loc-email .cel-res-email a.cel-resource-email:focus {
  color: var(--cel_resource_normal_color, var(--cel_normal_font_color, #2e2c2e));
  text-decoration: underline;
}

/* LocContent=9 — website/link row (no extra black hover underline). */
.cel-resource-listing .cel-resource-loc-link.loc-link-sec {
  display: flex;
  gap: 5px;
  align-items: center;
  flex: 0 0 auto;
  max-width: 100%;
}

.cel-resource-listing .cel-resource-loc-link .location-link a.cel-resource-link,
.cel-resource-listing .cel-resource-loc-link .location-link a.cel-resource-link:link,
.cel-resource-listing .cel-resource-loc-link .location-link a.cel-resource-link:visited {
  color: var(--cel_icon_color);
  font-size: var(--cel_resource_normal_font_size, var(--cel_normal_font_size, 0.9rem));
  text-decoration: none;
  word-break: break-word;
}

.cel-resource-listing .cel-resource-loc-link .location-link a.cel-resource-link:hover,
.cel-resource-listing .cel-resource-loc-link .location-link a.cel-resource-link:focus {
  color: var(--cel_resource_normal_color, var(--cel_normal_font_color, #2e2c2e));
  text-decoration: underline;
}

/* Explicitly kill any leftover ::after underline from older CSS / theme templates. */
.cel-resource-listing .cel-resource-loc-email.loc-email-sec:after,
.cel-resource-listing .cel-resource-loc-link.loc-link-sec:after,
.cel-resource-listing .cel-resource-loc-email .cel-res-email a.cel-resource-email:after,
.cel-resource-listing .cel-resource-loc-link .location-link a.cel-resource-link:after {
  content: none !important;
  display: none !important;
  border: none !important;
  opacity: 0 !important;
}
.cel-resource-tile .cel-resource-line--trn-description img { width: auto; height: auto;}

@media (max-width: 1024px) {
  .cel-resource-listing {
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 1.25rem;
  }

  .cel-resource-tile {
    padding: 1.25rem;
  }

  /* Fixed-percentage columns (photo / text / button) only work at desktop
     widths. Below 1024px a tile is rarely wider than ~450px, so a 25% column
     for the CTA button crushes it to <100px and its label wraps one letter
     per line. Stack the columns instead of letting them starve for width. */
  .cel-resource-tile-row {
    flex-direction: column;
    margin: 0;
    gap: 1rem;
  }

  .cel-resource-col {
    width: 100% !important;
    padding: 0;
    text-align: center;
  }

  /* Center every line's content (name, text, photo, button, subcat bars)
     as a group, not just left-align it inside the now full-width column. */
  .cel-resource-line {
    justify-content: center;
  }

  .cel-resource-subcats {
    align-items: center;
  }

  .cel-resource-photo {
    max-width: 160px;
    margin: 0 auto;
  }

  .cel-resource-btn {
    max-width: 100%;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 767px) {
  .cel-resource-listing {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .cel-resource-tile {
    padding: 1rem 1.1rem;
    border-radius: 16px;
  }

  .cel-resource-col {
    width: 100% !important;
  }

  .cel-resource-photo {
    max-width: 140px;
  }
}
