/**
 * WorkAndHire original marketplace gallery — gig-item cards, grid, pagination.
 * Extracted from legacy templates (t_searchdigitaldownload.html, t_searchdata.html, t_freelancedservice.html).
 */

/* --- Grid shell (legacy mp-gig-carousel / block-grid-row) --- */
.wah-gallery-carousel {
  position: relative;
  width: 100%;
}

.wah-gallery-carousel .slider-box {
  overflow: hidden;
}

/* Grid matches the homepage gallery (.wah-listing-grid in home.css) so every
   public marketplace gallery shares one layout: same minimum card width, same
   24px gutters, and a column count that follows the available width instead of
   a fixed per-breakpoint count. The old rule was a 5-across flex row with 10px
   half-gutters and a -10px bleed, which produced narrower, tighter cards than
   the homepage and pushed the last column past the container edge. */
.wah-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  /* 24px literal, not var(--space-5): the homepage loads tokens.css where
     --space-5 is 24px, but the discovery pages load variables.css where the same
     token is 20px. Using the token here therefore produced a 20px gutter on
     /services, /members and /digital and a 24px one on the homepage — the exact
     mismatch this pass exists to remove. 24px is the homepage's resolved value. */
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wah-gallery-grid > .slide,
.wah-gallery-grid > .gig-item {
  box-sizing: border-box;
  /* Grid tracks size the cards now; the flex basis, max-width and gutter
     padding/margin below are cleared so they cannot fight the track. */
  max-width: none;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  height: auto;
  overflow: visible;
}

/* --- Card shell --- */
.gig-item-default {
  background-color: transparent;
  border: none;
  box-sizing: border-box;
  float: none;
  height: auto;
  margin: 0;
  padding: 0;
  position: relative;
  width: 100%;
}

.gig-item-inner {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 20px !important;
  margin: 0;
  padding: 0;
  transition: all 0.5s ease;
}

.gig-item-inner:hover {
  border: 1px solid #000;
  border-radius: 20px !important;
  box-shadow: 0 0 11px 0 rgba(221, 221, 221, 0.9);
}

.gig-item-inner:hover h3 {
  color: #00b22d;
}

/* --- Image --- */
.gig-item-default .gig-thumb-wrapper {
  transition: all 0.15s ease-in-out;
}

.gig-item-default .gig-link-main {
  display: block;
  position: relative;
  text-decoration: none !important;
}

.gig-item-default .gig-pict-22,
.gig-item-default .gig-pict-222 {
  background-color: #fff;
  display: block;
  max-width: 100%;
  margin: 0;
  border: none;
  overflow: hidden;
  text-align: center;
}

.gig-item-default .gig-thumb-wrapper img,
.gig-item-default .gig-pict-22 img,
.gig-item-default .gig-pict-222 img {
  display: block;
  width: 100%;
  height: 139px;
  max-width: 100% !important;
  object-fit: cover;
  border-radius: 20px 20px 0 0;
}

/* --- Body --- */
.gig-item-default .gig-sub {
  padding: 15px;
  position: relative;
}

.gig-item-default .gig-sub.cf::after {
  content: "";
  display: table;
  clear: both;
}

.gig-type-badge {
  background: #eee;
  border-radius: 5px;
  display: inline-block;
  font-size: 12px;
  margin: 0 0 6px;
  padding: 1px 5px;
}

/* Card description preview — fixed 2-line box, shared by every gallery card type.
   Was `max-height: 34px; overflow: hidden`, which cut mid-word with no ellipsis
   and, because the element was only emitted when a listing actually had text,
   left cards with no description reserving no space at all — that produced two
   different card heights in the same gallery (measured 408 vs 366 on /members).
   `height` (not max-height) makes the box reserve its two lines whether the text
   is long, short or empty, so every card in a row is the same height;
   -webkit-line-clamp supplies the trailing ellipsis. The unprefixed line-clamp is
   included for browsers that have moved to the standard property. Full text stays
   intact in the DOM and on the detail pages — this truncates display only. */
.gig-headline {
  color: #777;
  font-size: 12px;
  line-height: 1.4;
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  height: calc(1.4em * 2);
}

.gig-item-default .gig-link-main.gig-title-block h3,
.gig-item-default .gig-link-main h3 {
  color: #303030;
  display: block;
  font-size: 16px;
  font-weight: 400;
  height: 40px;
  line-height: 20px;
  margin: 0 0 13px;
  overflow: hidden;
  transition: all 0.15s ease-in-out;
  word-wrap: break-word;
}

.gig-item-default .gig-sub a.gig-price {
  color: #00b22d;
  display: block;
  float: none;
  font-weight: 700;
  line-height: 20px;
  text-decoration: none;
}

.gig-item-default .gig-sub .gig-price small {
  display: inline-block;
  font-size: 10px;
  font-weight: 400;
  padding: 1px 5px 0 0;
  text-transform: uppercase;
  vertical-align: top;
}

.gig-price-free {
  color: purple;
}

span.delivery-tile {
  display: block;
  font-size: 12px;
  margin-top: 6px;
  opacity: 0.7;
}

span.delivery-tile .fa {
  margin-right: 4px;
}

/* --- Member card marketplace info (languages / availability / response) ---
   Scoped to .gig-member-meta, which is only emitted for member cards in
   views/components/home/listing-card.php, so no other gallery card type is
   affected. Sits inside the same .gig-sub padding box as the price/delivery
   rows and reuses the muted 12px tile treatment of .delivery-tile for
   visual consistency with the existing card design. */
.gig-member-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 8px;
}

.gig-member-tile {
  align-items: center;
  color: #6b6b6b;
  display: inline-flex;
  font-size: 12px;
  line-height: 1.4;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gig-member-tile .fa {
  color: #9a9a9a;
  font-size: 12px;
  margin-right: 4px;
}

.gig-member-avail.is-online {
  color: #178a3f;
}

.gig-member-avail.is-online .fa {
  color: #22b455;
  font-size: 9px;
}

/* --- Member card: Verified/Featured badges + Skills/Categories/Marketplace chips
   (2026-07-25, Members Directory card completion). Scoped to member cards only. --- */
.gig-type-badge--verified {
  background: #e6f7ec;
  color: #178a3f;
}

.gig-type-badge--featured {
  background: #fff4e0;
  color: #b9750a;
  margin-left: 4px;
}

.gig-member-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.gig-chip {
  border-radius: 4px;
  display: inline-block;
  font-size: 11px;
  line-height: 1.4;
  padding: 1px 6px;
  white-space: nowrap;
}

.gig-chip--category {
  background: #eaf1ff;
  color: #2563eb;
}

.gig-chip--skill {
  background: #f2f2f2;
  color: #555;
}

.gig-chip--marketplace {
  background: #f0eaff;
  color: #6d3fc0;
}

.gig-member-avail:not(.is-online) .fa {
  font-size: 9px;
}

/* --- Member card: name leads the card ---
   On member cards the member NAME (the h3 title) is moved above the description
   in listing-card.php and made the standout element: brand colour, bolder, a
   touch larger, and clearly a link on hover. It keeps the base rule's fixed
   height:40px / line-height:20px two-line box, so the larger type does NOT
   increase card height — only weight, size and colour change. Scoped to
   .gig-item-member (emitted only for member cards) so services, digital, jobs,
   AI and physical cards are untouched. */
.gig-item-member .gig-link-main.gig-title-block h3 {
  color: var(--color-primary, #8c0605);
  font-size: 18px;
  font-weight: 700;
}

.gig-item-member .gig-link-main.gig-title-block:hover h3,
.gig-item-member .gig-link-main.gig-title-block:focus-visible h3 {
  text-decoration: underline;
}

/* --- Footer / seller --- */
.gig_footer {
  align-items: center;
  border-top: 1px solid #ddd;
  display: block;
  justify-content: space-between;
  margin-top: 0;
  padding: 9px 10px 15px;
}

.profle_image_label {
  align-items: center;
  display: flex;
}

.profile_image {
  margin-right: 10px;
  min-width: 35px;
}

.profile_image img {
  border-radius: 50%;
  display: block;
  height: 35px;
  max-width: 35px !important;
  object-fit: cover;
  width: 35px;
}

.gig-item-default .gig-seller {
  color: #b2b2b2;
  display: flex;
  flex-direction: column;
  font-size: 12px;
  height: auto !important;
  justify-content: center;
  line-height: 20px;
  padding: 0;
  position: static;
}

.gig-item-default .gig-seller a.seller-name {
  color: #0e0e0f;
  font-size: 14px;
  line-height: 20px;
  text-decoration: none;
}

.gig-seller span.rating {
  color: #00b22d;
  display: block;
  font-size: 14px;
  line-height: 14px;
}

.gig-seller span.rating .fa-star {
  color: #00b22d;
  margin-right: 2px;
}

.gig-seller span.rating #reviews,
.gig-seller span.rating .gig-review-count {
  color: #00b22d;
  font-size: 12px;
}

.gig_footer .favorite {
  float: right;
  margin-top: -40px;
}

.gig_footer .favorite i.fa-heart,
.gig_footer .favorite .fa {
  color: #ff0000;
  font-size: 20px;
}

.gig_footer .favorite button,
.gig_footer .favorite .icn-heart {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  line-height: 1;
  border-radius: 4px;
}

.gig_footer .favorite .icn-heart:focus-visible {
  outline: 2px solid #c0392b;
  outline-offset: 2px;
}

.gig_footer .favorite .icn-heart.is-loading {
  opacity: 0.55;
  pointer-events: none;
}

.gig_footer .favorite .icn-heart:not(.is-saved) .fa-heart-o {
  color: #bbb;
}

.gig_footer .favorite .icn-heart.is-saved .fa-heart,
.gig_footer .favorite .icn-heart .fa-heart {
  color: #ff0000;
}

.buyer-actions .favorite-inline {
  display: inline-flex;
  align-items: center;
}

.wah-favorite-toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  background: #222;
  color: #fff;
  padding: 12px 16px;
  border-radius: 6px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: min(92vw, 360px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.wah-favorite-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.wah-favorite-toast.is-error {
  background: #8b1a1a;
}

.gig-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  width: 100%;
}

.gig-card-actions .btn,
.gig-card-actions form {
  margin: 0;
}

.gig-card-actions .btn {
  font-size: 12px;
  padding: 4px 8px;
}

/* --- Empty state (legacy) --- */
.wah-gallery-empty {
  font-size: 18px;
  padding: 10px;
  text-align: center;
  width: 100%;
}

/* --- Pagination (legacy cPagination) --- */
.cPagination {
  float: left;
  margin: 10px 0 !important;
  padding: 0 !important;
  width: 100%;
}

.cPagination .navigation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  justify-content: center;
}

.cPagination span.lft-off,
.cPagination span.rgt-off {
  border: 1px solid #ddd;
  color: #d3d3d3;
  padding: 4px 5px;
}

.cPagination span.lft-on,
.cPagination span.rgt-on {
  border: 1px solid #ddd;
  cursor: pointer;
  padding: 4px 5px;
}

.cPagination span.lft-on a,
.cPagination span.rgt-on a,
.cPagination span.pg-mid span a {
  color: #7c7f80;
  text-decoration: none;
}

.cPagination span.pg-mid span {
  border: 1px solid #ddd;
  color: #7c7f80;
  cursor: pointer;
  margin: 0 2px;
  padding: 5px 4px;
}

.cPagination span.pg-mid span a {
  padding: 3px 5px;
}

.cPagination span.pg-mid span.no {
  background: #f60;
  color: #fff;
  cursor: default;
  font-weight: 700;
  padding: 5px 8px;
}

.cPagination span.mid {
  display: inline-flex;
  align-items: center;
}

/* --- Featured sections on homepage --- */
.featured-discovery .wah-gallery-grid {
  margin-top: 0;
}

.featured-discovery .wah-gallery-carousel {
  margin-bottom: 8px;
}

/* --- Responsive ---
   The 1200px and 992px breakpoints that forced 25% / 33.333% columns are gone:
   repeat(auto-fill, minmax(260px, 1fr)) already reduces the column count as the
   container narrows, which is what keeps these pages matching the homepage
   inside the narrower filtered-results column. Only the mobile rule remains,
   collapsing to a single column at the same 768px breakpoint home.css uses. */
@media (max-width: 768px) {
  .wah-gallery-grid {
    grid-template-columns: 1fr;
  }

  .gig-item-default .gig-sub .gig-price {
    font-size: 14px !important;
  }

  .profile_image img {
    max-width: 26px !important;
    height: 26px;
    width: 26px;
  }
}

@media (max-width: 576px) {
  /* The grid stays single-column here — inherited from the 768px rule. The
     previous `display: flex` + 49% pair put two cramped cards per row on small
     phones, which is narrower than the homepage's single-column mobile layout
     and would have overridden it. */

  .cPagination {
    float: none;
  }

  .gig-item-inner {
    min-height: 340px;
  }

  .gig_footer {
    padding: 5px !important;
  }
}

/* --- Legacy gig gallery (services & digital discovery) — pixel match old WorkAndHire --- */
.wah-gallery-legacy .slider-hider.block-grid-row {
  /* Was `margin: 0 -10px` — the bleed that cancelled the old flex layout's 10px
     per-item side padding. The grid has no such padding, so the negative margin
     survived as a real 10px overhang: the gallery started 10px left of
     .discovery-main and ran 10px past its right edge (measured rightGap=-10px on
     /services and /digital, while /members, which lacks this legacy class, sat
     correctly at 0). */
  margin: 0;
  overflow: hidden;
}

.wah-gallery-legacy .gig-item-inner {
  border: 1px solid #ddd;
  border-radius: 20px !important;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.wah-gallery-legacy .gig-item-inner:hover {
  border: 1px solid #000;
  box-shadow: 0 0 11px 0 rgba(221, 221, 221, 0.9);
}

.wah-gallery-legacy .gig-item-inner:hover h3 {
  color: #00b22d;
}

.wah-gallery-legacy .gig-thumb-wrapper {
  overflow: hidden;
}

.wah-gallery-legacy .gig-item-inner:hover .gig-card-image {
  transform: scale(1.06);
}

.wah-gallery-legacy .gig-card-image {
  transition: transform 0.2s ease-in-out;
}

.wah-gallery-legacy .gig-sub {
  flex: 1 1 auto;
  padding: 15px;
}

.wah-gallery-legacy .gig-sub .gig-price {
  color: #00b22d;
  font-weight: 700;
  line-height: 20px;
}

.wah-gallery-legacy .gig-sub .gig-price small {
  font-size: 10px;
  font-weight: 400;
  padding: 1px 5px 0 0;
  text-transform: uppercase;
}

.wah-gallery-legacy .gig-price-free {
  color: purple;
  font-weight: 700;
}

.wah-gallery-legacy span.delivery-tile {
  display: block;
  font-size: 12px;
  margin-top: 6px;
  opacity: 0.7;
}

.wah-gallery-legacy .gig-delivery-badge {
  display: inline;
  font-size: 13px;
  font-weight: 700;
}

.wah-gallery-legacy .gig_footer {
  align-items: center;
  border-top: 1px solid #ddd;
  display: flex;
  flex-shrink: 0;
  justify-content: space-between;
  margin-top: auto;
  padding: 9px 10px 15px;
}

.wah-gallery-legacy .profle_image_label {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
}

.wah-gallery-legacy .profile_image {
  margin-right: 10px;
  min-width: 35px;
}

.wah-gallery-legacy .profile_image img {
  border-radius: 50%;
  height: 35px;
  max-width: 35px !important;
  object-fit: cover;
  width: 35px;
}

.wah-gallery-legacy .gig-seller {
  color: #b2b2b2;
  display: flex;
  flex-direction: column;
  font-size: 12px;
  justify-content: center;
  line-height: 20px;
  min-width: 0;
}

.wah-gallery-legacy .gig-seller a.seller-name {
  color: #0e0e0f;
  font-size: 14px;
  line-height: 20px;
  overflow: hidden;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wah-gallery-legacy .gig-seller span.rating {
  color: #00b22d;
  display: block;
  font-size: 14px;
  line-height: 14px;
}

.wah-gallery-legacy .gig-seller span.rating .fa-star,
.wah-gallery-legacy .gig-seller span.rating #reviews {
  color: #00b22d;
}

.wah-gallery-legacy .gig_footer .favorite {
  flex-shrink: 0;
  float: none;
  margin-top: 0;
}

.wah-gallery-legacy .gig_footer .favorite .fa,
.wah-gallery-legacy .gig_footer .favorite .fa-heart,
.wah-gallery-legacy .gig_footer .favorite .fa-heart-o {
  color: #ff0000;
  font-size: 20px;
}

.wah-gallery-legacy .gig_footer .favorite .icn-heart {
  padding: 4px;
}

.wah-gallery-legacy .wah-gallery-grid > .slide,
.wah-gallery-legacy .wah-gallery-grid > .gig-item {
  display: flex;
}

.wah-gallery-legacy .wah-gallery-grid > .slide > .gig-item-inner,
.wah-gallery-legacy .wah-gallery-grid > .gig-item > .gig-item-inner {
  width: 100%;
}

@media (max-width: 960px) {
  .wah-gallery-legacy .gig_footer {
    padding: 5px !important;
  }

  .wah-gallery-legacy .profile_image img {
    height: 26px;
    max-width: 26px !important;
    width: 26px;
  }

  .wah-gallery-legacy .gig-seller span.rating {
    font-size: 11px !important;
  }
}

@media (max-width: 480px) {
  .wah-gallery-legacy .profile_image img {
    height: 25px;
    max-width: 25px !important;
    width: 25px;
  }

  .wah-gallery-legacy .gig-sub .gig-price {
    font-size: 12px !important;
  }
}
