/*
FacetWP Loop Grid Fix
*/

h3:not(.ctsnet-archive-loop-container h3,
.ctsnet-announcement-text h3,
#ctsnet-header-responsive h3) {
    font-size: 18px !important;
    line-height: 24px !important;
    font-weight: 600 !important;
    margin-bottom: 15px !important;
    color: #18171D;;
}

a {
  text-decoration: none !important;
}

.fs-wrap {
  width: 100% !important;
  height: 40px !important;
}

.fs-label-wrap .fs-label,
.facetwp-dropdown option,
select.facetwp-dropdown,
.facetwp-search {
  padding: 12px 22px 12px 14px !important;
  font-size: 13px !important;
  text-transform: uppercase;
  font-weight: 500 !important;
  color: #515151 !important;
}

.facetwp-facet {
  margin-bottom: 0 !important;
}

.facetwp-input-wrap {
  width: 100%;
  height: 47px;
}

.facetwp-facet input.facetwp-search, .facetwp-facet input.facetwp-location,
.facetwp-dropdown {
  width: 100%;
  border-radius: 18px;
}

.fs-label-wrap {
  border-radius: 18px;
}

.facetwp-icon {
  top: -3px;
}

.fs-arrow {
    right: 13px !important;
}

.facetwp-icon::before {
  background-size: 16px 16px !important;
}

.fwpl-result{
  background-color: #fff;
  border: 1px solid var(--brand-red);
  padding: 25px;
}

.facetwp-type-fselect .fs-option .fs-option-label {
  font-weight: 500 !important;
  font-size: 14px !important;
}

/* Alternate full-width row backgrounds for FacetWP user grid */
.fwpl-layout.user_profile {
  /* --ctsnet-row-alt-odd: #27AAE1; */
  --ctsnet-row-alt-even: #27AAE117;
  --ctsnet-row-gap: 90px;
  --ctsnet-container-width: 1235px; /* match your page container max-width */
  position: relative;
  isolation: isolate;
  overflow: visible;
  row-gap: var(--ctsnet-row-gap) !important;
}

.fwpl-layout.user_profile .fwpl-result {
  position: relative;
  /* no z-index: avoids creating a stacking context that traps ::after above the card background */
}

/* Reset pseudo-element and apply only on row-start items */
.fwpl-layout.user_profile .fwpl-result::after {
  content: none;
}

/* Desktop (4 cols): stripe starts at item 5, 13, 21... */
.fwpl-layout.user_profile .fwpl-result:nth-child(8n + 5)::after {
  content: "";
  position: absolute;
  top: calc(var(--ctsnet-row-gap) * -0.5);
  height: calc(100% + var(--ctsnet-row-gap));
  left: calc((var(--ctsnet-container-width) - 100vw) / 2);
  width: 100vw;
  z-index: -1;
  pointer-events: none;
  background: var(--ctsnet-row-alt-even);
}

/* Desktop (4 cols): stripe starts at item 5, 13... */
/* .fwpl-layout.user_profile .fwpl-result.r5::after,
.fwpl-layout.user_profile .fwpl-result:nth-child(8n+14)::after {
    content: "";
    position: absolute;
    top: calc(var(--ctsnet-row-gap) * -0.5);
    height: calc(100% + var(--ctsnet-row-gap));
    left: calc((var(--ctsnet-container-width) - 100vw) / 2);
    width: 100vw;
    z-index: -1;
    pointer-events: none;
    background: var(--ctsnet-row-alt-even);
} */

/* Tablet (2 cols): stripe starts at item 3, 7, 11... */
@media (max-width: 1024px) {
  .fwpl-layout.user_profile {
    --ctsnet-row-gap: 48px;
    --ctsnet-container-width: 100vw; /* adjust if container still has side margins at this breakpoint */
  }

  .fwpl-layout.user_profile .fwpl-result:nth-child(8n + 5)::after {
    content: none;
  }

  .fwpl-layout.user_profile .fwpl-result:nth-child(4n + 3)::after {
    content: "";
    position: absolute;
    top: calc(var(--ctsnet-row-gap) * -0.5);
    height: calc(100% + var(--ctsnet-row-gap));
    left: calc((var(--ctsnet-container-width) - 100vw) / 2);
    width: 100vw;
    z-index: -1;
    pointer-events: none;
    background: var(--ctsnet-row-alt-even);
  }
}

/* Mobile (1 col): stripe on every even card */
@media (max-width: 767px) {
  .fwpl-layout.user_profile {
    --ctsnet-row-gap: 50px;
    --ctsnet-container-width: 100vw; /* full-width on mobile */
  }

  .fwpl-layout.user_profile .fwpl-result:nth-child(4n + 3)::after {
    content: none;
  }

  .fwpl-layout.user_profile .fwpl-result:nth-child(even)::after {
    content: "";
    position: absolute;
    top: calc(var(--ctsnet-row-gap) * -0.5);
    height: calc(100% + var(--ctsnet-row-gap));
    left: calc((var(--ctsnet-container-width) - 123vw) / 2);
    width: 100vw;
    z-index: -1;
    pointer-events: none;
    background: var(--ctsnet-row-alt-even);
  }
}

.user-header {
  display: flex;
  margin-bottom: 15px;
}

.user-header .avatar {
  flex:0 0 40%;          /* max 40% of the header row */
  max-width:40%;
  aspect-ratio:1 / 1;    /* always a square */
  border-radius:50%;     /* make it a circle */
  overflow:hidden;       /* crop the image */
  position:relative;
}

.user-header .avatar img {
  width:100%;
  height:100%;
  object-fit:cover;      /* cover the entire container */
  position:absolute;
  top:50%;
  left:50%;
  transform:translate(-50%, -50%);
}

.user-avatar-with-badges .avatar {
    width: 240px;
    height: 305px;
    border-radius: 10px;
    overflow: hidden;
}

.user-avatar-with-badges .avatar img {
    object-fit:cover;      /* cover the entire container */
    top:50%;
    left:50%;
}

p.user-meta-label {
  margin: 0 !important;
}

.user-card .user-meta p {
  text-transform: capitalize;
}

.user-name a:hover h3 {
  text-decoration: none;
  color: #27AAE1 !important;
}

.facetwp-load-more {
  border: none !important;
}



/********** FacetWP User Avatar + Badges **********/

.facetwp-user-avatar-wrapper {
  text-align: center;
  display: inline-block;
  width: 100%;
}

.facetwp-user-badges-container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  width: 50%;
}

.user-avatar-with-badges .facetwp-user-badges-container  {
  width: 100%;
}

.facetwp-user-badges-container .ctsnet-badges {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
}

.facetwp-user-badges-container .ctsnet-badge {
  width: 35px;
  height: auto;
  display: block;
}

.facetwp-user-badges-container .ctsnet-badge-wrap {
  display: flex;
  line-height: 0;
  justify-content: center;
}

.profile-city-field > div::after {
    content: " , ";
    margin: 0 4px 0 0;
}

/* Ad banner */

.facetwp-template .fwpl-layout.user_profile {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 90px 28px;
}

.facetwp-template .ctsnе-entity-placement,
.facetwp-template .ctsne-entity-placement {
  grid-column: 1 / -1;
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 30px 0;
}
