/* /assets/cards.css
   StartLocal Flip Card system
   Paper business card (both sides white) + STRONG lift
   - Front “pop” without bottom “panel”
   - Mobile full-width ambient glow (not a slab)
   - HARD reset on .card.sl-flip-outer so global .card styles cannot move it
*/

:root{
  /* Base */
  --slInk: #111827;
  --slMuted: #6b7280;

  /* Paper */
  --slPaper: #fffdf8;                  /* warm paper */
  --slPaper2: #ffffff;                 /* highlight */

  /* Per-face backgrounds (themes can override) */
  --slFrontBg: linear-gradient(180deg, var(--slPaper2) 0%, var(--slPaper) 65%, var(--slPaper) 100%);
  --slBackBg: var(--slPaper);
  --slFaceBorder: var(--slPaperEdge);
  --slFrontGlowOpacity: .55;
  --slPaperEdge: rgba(17,17,17,.18);   /* physical border */
  --slPaperEdgeSoft: rgba(17,17,17,.10);

  /* Accent (themes can override per-card) */
  --slAccent: #111827;

  /* Shape */
  --slCardRadius: 16px;

  /* Size */
  --slCardMaxW: 420px;
  --slCardRatio: 3.5 / 2; /* 1.75 */

  /* STRONG lift shadows */
  --slLiftShadow:
    0 34px 70px rgba(0,0,0,.18),
    0 18px 30px rgba(0,0,0,.12),
    0 8px 12px rgba(0,0,0,.10),
    0 2px 3px rgba(0,0,0,.08);

  /* Back watermark system (themes can override) */
  --slBackWatermarkImg: none;
  --slBackWatermarkSize: contain;
  --slBackWatermarkOpacity: 0;
  --slBackWatermarkFilter: none;
}

/* =========================================================
   CRITICAL RESET
   Global site CSS styles `.card` as a grid card with hover lift.
   Our converted result cards are still `.card`, so we must hard reset.
========================================================= */
.card.sl-flip-outer{
  display:block !important;
  position:relative !important;
  box-sizing:border-box !important;

  padding:0 !important;
  margin:0 !important;

  border:0 !important;
  border-radius:0 !important;

  background:transparent !important;
  box-shadow:none !important;

  gap:0 !important;
  grid-template-rows:none !important;
  grid-template-columns:none !important;

  aspect-ratio:auto !important;
  min-height:0 !important;
  height:auto !important;

  overflow:visible !important;
  cursor:default !important;

  transition:none !important;
  transform:none !important;

  z-index:0;
}

.card.sl-flip-outer:hover,
.card.sl-flip-outer:active,
.card.sl-flip-outer:focus,
.card.sl-flip-outer:focus-within{
  transform:none !important;
  box-shadow:none !important;
  border-color:transparent !important;
}

.card.sl-flip-outer .slFlipCard{
    position:relative;
    z-index:1;
  }

/* Mobile category body stack: force full-width vertical stack */
:is(#results,#cardPreview) .sl-catBody.sl-catStack{
  display:flex !important;
  flex-direction:column !important;
  gap: 14px !important;
}

:is(#results,#cardPreview) .sl-catBody.sl-catStack > .card,
:is(#results,#cardPreview) .sl-catBody.sl-catStack .card{
  display:block !important;
  width:100% !important;
  max-width:none !important;
  flex: 1 1 auto !important;
}

:is(#results,#cardPreview) .sl-catBody.sl-catStack .slFlipCard{
  width:100% !important;
  max-width:none !important;
  min-width:0 !important;
}

/* Grid looks like business cards (stack of full-width cards)
   IMPORTANT: do not center the flip card shell.
   Centering + max-width caps make cards look "tiny" on mobile.
*/
:is(#results,#cardPreview) .cards{
  display:grid;
  gap:14px;
  align-items:start;
  justify-items:stretch;
}

:is(#results,#cardPreview) .cards .card{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
}

/* =========================================================
   Business page: single-card preview should match index.html results styling
   (same grid/stretch behavior, especially on mobile)
========================================================= */
#cardPreview .cards{
  display:grid;
  gap:14px;
  align-items:start;
  justify-items:stretch;
}

#cardPreview .cards .card{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
}


/* Reusable business-style card grid (used by index + kiosk + optional business sections) */
.sl-businessCardsGrid{
  display:grid;
  gap:16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 420px));
  align-items:start;
  justify-items:stretch;
  justify-content:start;
}

.sl-businessCardsGrid > .card{
  width:100%;
  max-width:100%;
  align-self:flex-start;
}

.sl-businessCardsGrid .slFlipCard{
  width:100%;
  max-width:100%;
}



/* =========================================================
   Category accordion panels (index results)
========================================================= */
#results .sl-catRow{
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(17,17,17,.12);
  border-radius: 16px;
  box-shadow: 0 10px 26px rgba(0,0,0,.06);
  margin-bottom: 16px;
  overflow: clip;
}

#results .sl-catToggle{
  width: 100%;
  border: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(250,250,250,.96));
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  padding: 14px 16px;
  text-align:left;
  cursor:pointer;
}

#results .sl-catToggle:hover{
  background: linear-gradient(180deg, rgba(255,255,255,1), rgba(245,245,245,.98));
}

#results .sl-catToggle:focus-visible{
  outline: 2px solid rgba(17,17,17,.5);
  outline-offset: -2px;
}

#results .sl-catToggleMeta{
  display:inline-flex;
  align-items:center;
  gap: 10px;
  flex-shrink: 0;
}

#results .sl-catTitle{
  margin:0;
  font-family: Merriweather, Georgia, serif;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -.01em;
  line-height: 1.1;
}

#results .sl-catMeta{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  white-space:nowrap;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(17,17,17,.72);
  font-weight: 800;
  border: 1px solid rgba(17,17,17,.15);
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(255,255,255,.92);
}

#results .sl-catChevron{
  width: 9px;
  height: 9px;
  border-right: 2px solid rgba(17,17,17,.72);
  border-bottom: 2px solid rgba(17,17,17,.72);
  transform: rotate(-45deg);
  transition: transform 180ms ease;
  margin-right: 2px;
}

#results .sl-catToggle[aria-expanded="true"] .sl-catChevron{
  transform: rotate(45deg);
}

#results .sl-catRow.is-collapsed .sl-catChevron{
  transform: rotate(-45deg);
}

#results .sl-catBody{
  padding: 0 16px 16px;
}

#results .sl-catRow.is-collapsed .sl-catBody{
  display: none !important;
  padding-bottom: 0;
}

#results .sl-catControls{
  display:flex;
  gap: 10px;
  margin: 0 0 14px;
}

#results .sl-catControlBtn{
  border:1px solid rgba(17,17,17,.2);
  border-radius:999px;
  background:#fff;
  color: rgba(17,17,17,.88);
  font-size:12px;
  font-weight:700;
  letter-spacing:.04em;
  text-transform:uppercase;
  padding: 8px 12px;
  cursor:pointer;
}

#results .sl-catControlBtn:hover{
  background: rgba(17,17,17,.06);
}

#results .sl-catControlBtn:focus-visible{
  outline: 2px solid rgba(17,17,17,.5);
  outline-offset: 2px;
}

/* =========================
   Flip shell
========================= */
.slFlipCard{
  width:100%;
  max-width: var(--slCardMaxW);
  aspect-ratio: var(--slCardRatio);
  min-height: 0;

  border-radius: var(--slCardRadius);
  perspective: 1100px;
  -webkit-perspective: 1100px;
  position:relative;
  outline:none;

  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  cursor:pointer;

  /* Prevent horizontal page-drag while still allowing vertical scroll */
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;

  /* IMPORTANT: removed `contain: layout paint;` (can break iOS hit-testing in scrollers) */
  /* contain: layout paint; */

  --slFrontBar: var(--slAccent);
  overflow:visible;

  transform:none !important;
}


/* “table contact” shadow puddle (local to the card) */
.slFlipCard::after{
  content:"";
  position:absolute;
  left: 14px;
  right: 14px;
  bottom: -10px;
  height: 18px;
  border-radius: 999px;
  background: rgba(0,0,0,.25);
  filter: blur(16px);
  opacity: .55;
  pointer-events:none;
  z-index: 0;
}

.slFlipInner{
  width:100%;
  height:100%;
  position:relative;
  z-index: 1;

  transform-style:preserve-3d;
  -webkit-transform-style: preserve-3d;

  will-change: transform;

  /* Same transition on desktop + mobile (parity) */
  transition: transform 520ms cubic-bezier(.2,.8,.2,1), -webkit-transform 520ms cubic-bezier(.2,.8,.2,1);
  -webkit-transition: -webkit-transform 520ms cubic-bezier(.2,.8,.2,1);

  border-radius: var(--slCardRadius);

  transform:rotateY(0deg);
  -webkit-transform: rotateY(0deg);
}

.slFlipCard.is-flipped .slFlipInner{
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
}


/* =========================
   Paper face (border + lift)
========================= */
.slFlipFace{
  position:absolute;
  inset:0;
  border-radius: var(--slCardRadius);
  overflow:hidden;

  backface-visibility:hidden;
  -webkit-backface-visibility:hidden;

  border: 1px solid var(--slFaceBorder, var(--slPaperEdge));
  outline: 1px solid rgba(255,255,255,.55);
  outline-offset: -2px;

  background: var(--slFaceBg, var(--slPaper));
  box-shadow: var(--slLiftShadow);

  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  z-index: 1;
}

.slFlipFace::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius: inherit;
  pointer-events:none;
  background:
    linear-gradient(to bottom, rgba(255,255,255,.70), rgba(255,255,255,0)) 0 0/100% 10px no-repeat,
    linear-gradient(to top, rgba(0,0,0,.05), rgba(0,0,0,0)) 0 100%/100% 10px no-repeat,
    linear-gradient(to right, rgba(255,255,255,.55), rgba(255,255,255,0)) 0 0/10px 100% no-repeat,
    linear-gradient(to left, rgba(0,0,0,.04), rgba(0,0,0,0)) 100% 0/10px 100% no-repeat;
  opacity: .9;
}

.slFlipFace::before{
  content:"";
  position:absolute;
  inset:-12%;
  z-index:0;
  pointer-events:none;
  opacity:.09;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(17,17,17,.06) 0px,
      rgba(17,17,17,.06) 1px,
      rgba(255,255,255,0) 2px,
      rgba(255,255,255,0) 7px
    );
  transform: rotate(-2deg);
}

.slFaceInner{
  position:relative;
  z-index:2;
  height:100%;
  box-sizing:border-box;

  padding:10px 12px;

  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:6px;
}

/* =========================
   Back watermark
========================= */
.slBack .slFaceInner::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:0;
  pointer-events:none;

  background-image: var(--slBackWatermarkImg);
  background-repeat:no-repeat;
  background-position:center;
  background-size: var(--slBackWatermarkSize);

  opacity: var(--slBackWatermarkOpacity);
  filter: var(--slBackWatermarkFilter);
  transform: translateZ(0);
}

.slBack .slFaceInner > *{
  position:relative;
  z-index:1;
}

/* =========================
   Front
========================= */
.slFront{ --slFaceBg: var(--slFrontBg, var(--slPaper)); }

.slFrontBar{
  height:7px;
  border-radius:999px;
  background: var(--slFrontBar);
  opacity:.92;
  margin-bottom: 2px;
}

.slFront .slFaceInner::after{
  content:"";
  position:absolute;
  inset:-1px;
  z-index:0;
  pointer-events:none;
  border-radius: calc(var(--slCardRadius) - 2px);
  background:
    radial-gradient(120% 80% at 18% 0%, rgba(255,255,255,.75) 0%, rgba(255,255,255,0) 55%),
    radial-gradient(130% 120% at 85% 120%, rgba(0,0,0,.06) 0%, rgba(0,0,0,0) 55%),
    linear-gradient(to bottom, rgba(255,255,255,.18), rgba(255,255,255,0) 42%);
  opacity: var(--slFrontGlowOpacity, .55);
}

.slFront .slFaceInner > *{
  position:relative;
  z-index:1;
}

.slTop{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}

.slKicker{
  font:800 10px/1 Inter,system-ui,sans-serif;
  letter-spacing:.20em;
  text-transform:uppercase;
  color: var(--slInk);
  opacity:.50;
  margin-top:2px;
}

.slName{
  font:900 16px/1.12 Merriweather, Georgia, serif;
  color: var(--slInk);
  letter-spacing:-0.01em;
  margin-top:3px;

  display:-webkit-box;
  -webkit-line-clamp:2;
  line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.slMeta{
  margin-top:3px;
  font:600 13px/1.25 Inter,system-ui,sans-serif;
  color: rgba(17,24,39,.78);

  display:-webkit-box;
  -webkit-line-clamp:2;
  line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.slLogoBadge{
  width:40px;
  height:40px;
  border-radius:12px;
  background: linear-gradient(var(--slPaper2), var(--slPaper));
  border: 1px solid var(--slPaperEdgeSoft);
  display:grid;
  place-items:center;
  overflow:hidden;
  flex:0 0 auto;

  box-shadow:
    0 10px 18px rgba(0,0,0,.12),
    0 1px 0 rgba(255,255,255,.75) inset;
}

.slLogoText{
  font:800 12px/1 Inter,system-ui,sans-serif;
  color: var(--slInk);
  letter-spacing:.02em;
}
.slLogoImg{
  width:100%;
  height:100%;
  object-fit:contain;
  padding:6px;
  display:block;
}

.slLabel{
  font:800 10px/1 Inter,system-ui,sans-serif;
  letter-spacing:.16em;
  text-transform:uppercase;
  color: var(--slMuted);
}

.slAddress{
  margin-top:4px;
  font:600 13px/1.3 Inter,system-ui,sans-serif;
  color: var(--slInk);
  text-align:left;

  display:-webkit-box;
  -webkit-line-clamp:2;
  line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.slInfoPanel{
  margin-top: 10px;
  padding-top: 10px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.slInfoPanel .slLabel{ margin-top: 0; }
.slInfoPanel .slAddress{ margin-top: 6px; }

.slFront .slFaceInner > div:last-child{
  margin-top:auto;
  align-self:flex-start;
}

/* =========================
   Back
========================= */
.slBack{
  --slFaceBg: var(--slBackBg, var(--slPaper));
  --slFaceBorder: var(--slBackBorder, var(--slFaceBorder, var(--slPaperEdge)));
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
}

.slBackStripe{
  height:7px;
  border-radius:999px;
  background: var(--slAccent);
  opacity:.90;
  margin-bottom: 2px;
}

.slMuted{ color: rgba(17,24,39,.62); }

.slKV{
  margin-top:6px;
  display:grid;
  gap:6px;
  font:600 13px/1.2 Inter,system-ui,sans-serif;
  color: rgba(17,24,39,.82);
}

.slKVRow{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}

.slVal{
  text-align:right;
  font-weight:700;
  max-width:62%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color: rgba(17,24,39,.92);
}

.slBack .slLink{
  color: rgba(17,24,39,.92);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.slBack .slLink:hover{ opacity:.95; }

.slSocialRow{
  margin-top:10px;
  display:flex;
  justify-content:flex-end;
  gap:8px;
}

.slSocialIcon{
  width:32px;
  height:32px;
  border-radius:10px;
  border:1px solid rgba(17,17,17,.12);
  background: linear-gradient(#fff, var(--slPaper));
  display:grid;
  place-items:center;
  color: rgba(17,24,39,.90);
  text-decoration:none;
  box-shadow:
    0 8px 14px rgba(0,0,0,.08),
    0 1px 0 rgba(255,255,255,.75) inset;
}

.slSocialIcon svg{
  width:18px;
  height:18px;
  display:block;
}

.slBackBottom{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:10px;
  margin-top:auto;
}

.slTagline{
  font:700 13px/1.15 Inter,system-ui,sans-serif;
  margin-top:3px;
  color: rgba(17,24,39,.92);
}

/* Hide Save button */
.like-btn{
  display:none !important;
}

/* Button */
.slShowMore{
  margin-top:8px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  padding:.46rem .82rem;

  font:800 12px/1 Inter,system-ui,sans-serif;
  letter-spacing:.02em;

  border:1px solid rgba(17,17,17,.14);
  background: linear-gradient(#fff, var(--slPaper));
  color:#111827;

  box-shadow:
    0 10px 18px rgba(0,0,0,.10),
    0 1px 0 rgba(255,255,255,.80) inset;

  text-decoration:none;
  white-space:nowrap;
  width:fit-content;
}

.slSocialIcon:hover{ transform: translateY(-1px); }

.slShowMore:active{ transform: translateY(0px); }
.slSocialIcon:active{ transform: translateY(0px); }


:is(#results,#cardPreview) .cards > .card,
#cardPreview .cards > .card{ align-self:flex-start; }

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce){
  .slFlipInner{ transition-duration: 200ms !important; }
}

/* =========================================================
   Mobile / tablet sizing
   The flip shell defaults to max-width: var(--slCardMaxW) (420px).
   On smaller screens this makes cards look undersized.
   Force full-width cards for results stacks.
========================================================= */
@media (max-width: 1024px){
  :root{ --slCardMaxW: 100%; }
  :is(#results,#cardPreview) .slFlipCard{ max-width:100% !important; }
  #cardPreview .slFlipCard{ max-width:100% !important; }
}

/*
  Mobile behavior (Startlocal)
  ---------------------------
  On phones we do NOT allow horizontal scrolling carousels.
  Cards must fit the viewport (no clipping) and stack vertically.

  NOTE: index.html/main.js now create accordion sections + "show more",
  so this file must not force the old horizontal scroller behavior.
*/
@media (max-width: 1024px){
  html, body{ overflow-x:hidden; }

  /* Ensure category rows and legacy .cards stacks do NOT become scrollers */
  :is(#results,#cardPreview) .cards,
  :is(#results,#cardPreview) .sl-catScroller,
  .sl-businessCardsGrid{
    overflow-x:hidden !important;
    overflow-y:visible !important;
    scroll-snap-type:none !important;
  }

  /* Ensure the business card preview behaves like results stacks on mobile */
  #cardPreview .cards{
    overflow-x:hidden !important;
    overflow-y:visible !important;
  }

  /* Make the outer card wrapper span the available width */
  :is(#results,#cardPreview) .cards > .card,
  :is(#results,#cardPreview) .sl-catScroller > .card,
  .sl-businessCardsGrid > .card{
    width:100% !important;
    max-width:100% !important;
    flex:1 1 auto !important;
  }

  #cardPreview .cards > .card{
    width:100% !important;
    max-width:100% !important;
  }

  /* Some views wrap cards inside additional containers; ensure descendants stretch too */
  :is(#results,#cardPreview) .sl-catScroller .card{
    width:100% !important;
    max-width:100% !important;
    flex:1 1 auto !important;
  }

  /*
    Make the flip card itself fluid.
    NOTE: iOS Safari + flex layouts can still render cards "narrow" if the
    outer wrapper centers the flip card. So we also remove centering on mobile.
  */
  :is(#results,#cardPreview) .cards .card,
  :is(#results,#cardPreview) .sl-catStack .card,
  :is(#results,#cardPreview) .sl-catScroller .card{
    justify-content: stretch !important;
  }

  :is(#results,#cardPreview) .slFlipCard,
  :is(#results,#cardPreview) .sl-catStack .slFlipCard,
  :is(#results,#cardPreview) .sl-catScroller .slFlipCard{
    width:100% !important;
    max-width:none !important; /* allow true full-width cards */
    min-width:0 !important;
  }

  #cardPreview .slFlipCard{
    width:100% !important;
    max-width:none !important;
    min-width:0 !important;
  }

  /* The outer wrapper created by cards.js must also be allowed to stretch */
  :is(#results,#cardPreview) .card.sl-flip-outer{
    width:100% !important;
    max-width:none !important;
  }

  #cardPreview .card.sl-flip-outer{
    width:100% !important;
    max-width:none !important;
  }
}
/* =========================================================
   Shadow removal (requested)
   This *prevents* any shadow from being rendered (not hidden).
   ========================================================= */
:is(#results,#cardPreview) .slFlipCard,
:is(#results,#cardPreview) .slFlipCardInner,
:is(#results,#cardPreview) .slFlipCardFront,
:is(#results,#cardPreview) .slFlipCardBack,
:is(#results,#cardPreview) .card,
#cardPreview .slFlipCard,
#cardPreview .slFlipCardInner,
#cardPreview .slFlipCardFront,
#cardPreview .slFlipCardBack,
#cardPreview .card{
  box-shadow: none !important;
  filter: none !important;
}

/* The "puddle" shadow is drawn via a generated pseudo-element */
:is(#results,#cardPreview) .slFlipCard::after,
#cardPreview .slFlipCard::after{
  content: none !important;   /* stops the pseudo-element from being created */
}
