/*
 * Image treatment for the retained Current community-guide design.
 * The reference presentation deliberately has no dependency on these rules.
 */

body.swfl-community-v2 .swfl-cg .cg-current-design {
  --cgi-card-border: #cfe3f0;
  --cgi-card-bg: #fff;
  --cgi-ink: #082b5b;
  --cgi-link: #0d5d9f;
  --cgi-muted: #58708a;
}

body.swfl-community-v2 .swfl-cg .cg-current-design :is(.cgi-grid, .s2-pro-index__grid) {
  display: grid !important;
  gap: 16px !important;
  margin: 16px 0 0 !important;
  padding: 0 !important;
}

/* Dining benefits from a compact, three-column browse grid. Golf stays roomier. */
body.swfl-community-v2 .swfl-cg .cg-current-design [data-dc-tpl="407"].cgi-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

body.swfl-community-v2 .swfl-cg .cg-current-design [data-dc-tpl="388"].cgi-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)) !important;
}

body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-card {
  display: flex !important;
  min-width: 0;
  overflow: hidden !important;
  color: var(--cgi-ink) !important;
  background: var(--cgi-card-bg) !important;
  border: 1px solid var(--cgi-card-border) !important;
  border-radius: 7px !important;
  box-shadow: none !important;
  flex-direction: column !important;
}

body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-media,
body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-media figure {
  display: block;
  width: 100%;
  margin: 0 !important;
}

body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-media {
  flex: 0 0 auto;
  overflow: hidden;
  background: #dceefa;
}

body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-media img {
  display: block !important;
  width: 100% !important;
  aspect-ratio: 16 / 10;
  height: auto !important;
  max-width: none !important;
  margin: 0 !important;
  object-fit: cover !important;
  object-position: center;
}

body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-media figcaption {
  padding: 7px 16px 8px;
  color: var(--cgi-muted);
  background: #f5fbfe;
  border-top: 1px solid var(--cgi-card-border);
  font-size: 11px;
  line-height: 1.35;
}

body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-card__body {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 16px !important;
}

body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-card__body > * {
  min-width: 0;
  margin: 0 !important;
}

body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-card :is([data-dc-tpl="391"], [data-dc-tpl="410"], [data-dc-tpl="411"]) {
  color: var(--cgi-ink) !important;
  font-family: 'Space Grotesk', 'Source Sans 3', Arial, sans-serif;
  font-size: 18px !important;
  font-weight: 750 !important;
  line-height: 1.2 !important;
}

body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-card :is([data-dc-tpl="391"], [data-dc-tpl="410"], [data-dc-tpl="411"]) a {
  color: var(--cgi-ink) !important;
  text-decoration: underline;
  text-decoration-color: #9bc8e4;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-card [data-dc-tpl="392"] {
  display: grid !important;
  gap: 8px;
  align-items: start;
  color: var(--cgi-muted) !important;
}

body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-card :is([data-dc-tpl="393"], [data-dc-tpl="412"], [data-dc-tpl="413"], [data-dc-tpl="414"]) {
  color: var(--cgi-muted) !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
}

body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-card :is([data-dc-tpl="398"], [data-dc-tpl="416"], [data-dc-tpl="417"], [data-dc-tpl="418"]) {
  color: var(--cgi-link) !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1.35 !important;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* Service category cards: a photograph leads into a separately legible status/name row. */
body.swfl-community-v2 .swfl-cg .cg-current-design .s2-pro-index__grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)) !important;
}

body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-service-card {
  display: flex !important;
  min-width: 0;
  overflow: hidden !important;
  color: var(--cgi-ink) !important;
  background: #fff !important;
  border: 1px solid var(--cgi-card-border) !important;
  border-radius: 7px !important;
  box-shadow: none !important;
  flex-direction: column !important;
}

body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-service-card .cgi-media img {
  aspect-ratio: 16 / 10;
}

body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-service-card__body {
  display: grid !important;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 7px 10px;
  align-items: center;
  min-width: 0;
  padding: 14px 16px 16px !important;
}

body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-service-card__body > * {
  min-width: 0;
  margin: 0 !important;
}

body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-service-card .s2-pro-index__status {
  grid-column: 1 / -1;
  position: static !important;
  width: auto !important;
  padding: 0 0 8px !important;
  color: var(--cgi-muted) !important;
  border-bottom: 1px solid var(--cgi-card-border);
  font-size: 10px !important;
  line-height: 1.2 !important;
  letter-spacing: .11em !important;
  white-space: normal !important;
}

body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-service-card .s2-pro-index__glyph {
  display: grid !important;
  grid-column: 1;
  width: 30px !important;
  height: 30px !important;
  place-items: center;
  color: var(--cgi-link) !important;
  background: #eaf5fc;
  border-radius: 4px;
}

body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-service-card .s2-pro-index__glyph svg {
  width: 21px !important;
  height: 21px !important;
}

body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-service-card b {
  grid-column: 2;
  color: var(--cgi-ink) !important;
  font-family: 'Space Grotesk', 'Source Sans 3', Arial, sans-serif;
  font-size: 16px !important;
  font-weight: 750 !important;
  line-height: 1.2 !important;
  overflow-wrap: anywhere;
}

body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-service-card .s2-pro-index__arrow {
  grid-column: 3;
  color: var(--cgi-link) !important;
  font-size: 19px !important;
  line-height: 1;
}

/* A photographic category card does not need a second, competing icon. */
body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-service-card:has(.cgi-media img) .cgi-service-card__body {
  grid-template-columns: minmax(0, 1fr) auto;
}

body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-service-card:has(.cgi-media img) .s2-pro-index__glyph {
  display: none !important;
}

body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-service-card:has(.cgi-media img) b {
  grid-column: 1;
}

body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-service-card:has(.cgi-media img) .s2-pro-index__arrow {
  grid-column: 2;
}

body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-service-card:focus-visible {
  outline: 3px solid var(--cg-orange, #ff790d);
  outline-offset: 3px;
}

/* The original contractor panel remains operational; this only gives its new illustration room. */
body.swfl-community-v2 .swfl-cg .cg-current-design .s2-pro-panel .cgi-service-feature {
  display: block;
  width: 100%;
  margin: 0 !important;
  overflow: hidden;
  background: #dceefa;
}

body.swfl-community-v2 .swfl-cg .cg-current-design .s2-pro-panel .cgi-service-feature img {
  display: block !important;
  width: 100% !important;
  height: 180px !important;
  max-width: none !important;
  margin: 0 !important;
  object-fit: cover !important;
  object-position: center;
}

body.swfl-community-v2 .swfl-cg .cg-current-design .s2-pro-panel .cgi-service-feature figcaption {
  padding: 7px 16px;
  color: var(--cgi-muted);
  background: #f5fbfe;
  font-size: 11px;
  line-height: 1.35;
}

body.swfl-community-v2 .swfl-cg .cg-current-design [hidden] { display: none !important; }

@media (max-width: 980px) {
  body.swfl-community-v2 .swfl-cg .cg-current-design [data-dc-tpl="407"].cgi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 620px) {
  body.swfl-community-v2 .swfl-cg .cg-current-design :is(.cgi-grid, .s2-pro-index__grid),
  body.swfl-community-v2 .swfl-cg .cg-current-design [data-dc-tpl="407"].cgi-grid,
  body.swfl-community-v2 .swfl-cg .cg-current-design [data-dc-tpl="388"].cgi-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
  }

  body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-card__body { padding: 16px !important; }
  body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-service-card__body { padding: 14px 16px 16px !important; }
}

body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-card { padding: 0 !important; }
body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-service-card { padding: 0 !important; gap: 0 !important; }
body.swfl-community-v2 .swfl-cg .cg-current-design :is(.cgi-card, .cgi-service-card) { align-items: stretch !important; justify-content: flex-start !important; text-align: left !important; }
body.swfl-community-v2 .swfl-cg .cg-current-design :is(.cgi-card__body, .cgi-service-card__body) { width: 100% !important; align-self: stretch !important; }
body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-service-card .s2-pro-index__arrow { position: static !important; transform: none !important; }
body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-service-card.is-selected { outline: 2px solid #ff790d; outline-offset: 1px; }
body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-service-card.is-selected::after { display: none !important; }
body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-service-card .s2-pro-index__status { background: transparent !important; color: #58708a !important; }
body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-grid { border-top: 0 !important; }
body.swfl-community-v2 .swfl-cg .cg-current-design .swfl-guide-rd { padding: 18px 20px !important; }
@media (max-width: 980px) {
  body.swfl-community-v2 .swfl-cg .cg-current-design .s2-pro-index > header { display: block !important; }
  body.swfl-community-v2 .swfl-cg .cg-current-design .s2-pro-index > header > div { width: 100% !important; max-width: none !important; }
  body.swfl-community-v2 .swfl-cg .cg-current-design .s2-pro-index > header h3 { max-width: none !important; word-break: normal !important; overflow-wrap: normal !important; }
  body.swfl-community-v2 .swfl-cg .cg-current-design .s2-pro-index > header p { max-width: 65ch !important; margin-top: 12px !important; }
}

/* Verified listings stand out (Sep 30 2026): an orange badge with a check instead of the grey label Local uses,
   and an orange edge on the card. Verified = sponsored and neither Local nor a staging sample. */
body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-service-card.s2-pro-index__item--sponsored:not(.s2-pro-index__item--local):not(.s2-pro-index__item--sample) {
  border-color: #F7B27A !important;
  box-shadow: 0 0 0 1px #F7B27A, 0 14px 30px -22px rgba(245, 130, 32, .7) !important;
}
body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-service-card.s2-pro-index__item--sponsored:not(.s2-pro-index__item--local):not(.s2-pro-index__item--sample) .s2-pro-index__status {
  justify-self: start;
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  width: max-content !important;
  margin-bottom: 4px !important;
  padding: 5px 10px 5px 8px !important;
  border: 0 !important;
  border-radius: 999px;
  background: #F58220 !important;
  color: #fff !important;
  font-weight: 800 !important;
}
body.swfl-community-v2 .swfl-cg .cg-current-design .cgi-service-card.s2-pro-index__item--sponsored:not(.s2-pro-index__item--local):not(.s2-pro-index__item--sample) .s2-pro-index__status::before {
  content: "";
  width: 11px;
  height: 11px;
  background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}
