/*
  Creole Fried: store locator styling.
  Website developed by pressific.com Emily Park, Dileep C. Kaluaratchie and Tech Generation Ltd.

  Map left, list right on a wide screen; list under the map on a narrow one.
  The list scrolls inside its own column rather than the page, so the map stays
  in view while a visitor reads down 44 addresses.
*/

.cf-locator {
  --cf-red: #a4161a;
  --cf-red-dark: #6e0d10;
  --cf-cream: #fdf6ec;
  --cf-ink: #1c1917;
  --cf-muted: #6b625c;
  --cf-line: #e6dccd;
  --cf-gold: #e0a458;

  background: var(--cf-cream);
  color: var(--cf-ink);
  padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 4vw, 3rem);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.cf-locator__head { max-width: 60rem; margin: 0 auto clamp(1.5rem, 3vw, 2.5rem); }
.cf-locator__head h2 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  line-height: 1.1; margin: 0 0 .4rem; letter-spacing: -.02em;
}
.cf-locator__count { margin: 0 0 1.25rem; color: var(--cf-muted); }

/* ---- search ---- */
.cf-search__label {
  display: block; font-size: .8rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; color: var(--cf-muted); margin-bottom: .4rem;
}
.cf-search__row { display: flex; gap: .5rem; flex-wrap: wrap; }
.cf-search__input {
  flex: 1 1 18rem; min-width: 0;
  padding: .8rem 1rem; font-size: 1rem; color: var(--cf-ink);
  background: #fff; border: 2px solid var(--cf-line); border-radius: .5rem;
}
.cf-search__input:focus-visible { outline: 3px solid var(--cf-gold); outline-offset: 2px; border-color: var(--cf-red); }
.cf-search__geo {
  padding: .8rem 1.15rem; font-size: 1rem; font-weight: 600; cursor: pointer;
  color: #fff; background: var(--cf-red); border: 2px solid var(--cf-red); border-radius: .5rem;
}
.cf-search__geo:hover { background: var(--cf-red-dark); border-color: var(--cf-red-dark); }
.cf-search__geo:focus-visible { outline: 3px solid var(--cf-gold); outline-offset: 2px; }
.cf-search__status { margin: .6rem 0 0; min-height: 1.4em; font-size: .9rem; color: var(--cf-muted); }

/* ---- layout ---- */
.cf-locator__body {
  display: grid; gap: 1.25rem; max-width: 82rem; margin: 0 auto;
  grid-template-columns: 1fr;
}
@media (min-width: 60rem) {
  .cf-locator__body { grid-template-columns: 1.35fr 1fr; align-items: start; }
  .cf-list { max-height: 34rem; overflow-y: auto; scrollbar-gutter: stable; }
}

.cf-map {
  min-height: 22rem; height: 34rem; border-radius: .75rem; overflow: hidden;
  background: #e8e2d8; border: 1px solid var(--cf-line);
}
.is-listonly .cf-locator__body { grid-template-columns: 1fr; }

/* ---- list ---- */
.cf-list__state {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  margin: 0; padding: .6rem .25rem; font-size: .82rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--cf-red); background: var(--cf-cream); border-bottom: 2px solid var(--cf-line);
}
.cf-list__tally {
  font-size: .75rem; padding: .1rem .5rem; border-radius: 1rem;
  color: var(--cf-muted); background: #fff; border: 1px solid var(--cf-line);
}
.cf-list__items { list-style: none; margin: 0 0 1.25rem; padding: 0; }

.cf-store {
  /* The selected row is marked with a bar down its left edge. That bar needs a
     gutter of its own: drawn as an inset shadow over a row with no left
     padding, it sat on top of the first character of every line. */
  padding: .9rem .25rem .9rem .9rem;
  border-bottom: 1px solid var(--cf-line);
  cursor: pointer; transition: background .15s ease, box-shadow .15s ease;
}
.cf-store:hover { background: #fff; }
.cf-store:focus-visible { outline: 3px solid var(--cf-gold); outline-offset: -3px; }
.cf-store.is-active { background: #fff; box-shadow: inset 3px 0 0 var(--cf-red); }
.cf-store__name { margin: 0 0 .2rem; font-size: 1rem; font-weight: 700; }
.cf-store__addr { margin: 0 0 .35rem; font-style: normal; font-size: .92rem; color: var(--cf-muted); line-height: 1.45; }
.cf-store__phone, .cf-store__dir {
  display: inline-block; margin-right: .9rem; font-size: .9rem; font-weight: 600;
  color: var(--cf-red); text-decoration: none; border-bottom: 1px solid currentColor;
}
.cf-store__phone:hover, .cf-store__dir:hover { color: var(--cf-red-dark); }
.cf-store__dist { margin: 0 0 .35rem; font-size: .85rem; font-weight: 600; color: var(--cf-gold); }
.cf-list__empty { padding: 1.5rem .25rem; color: var(--cf-muted); }

/* ---- pins ---- */
.cf-pin {
  width: 1.6rem; height: 1.6rem; padding: 0; cursor: pointer;
  background: var(--cf-red); border: 3px solid #fff; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg); box-shadow: 0 2px 6px rgb(0 0 0 / .35);
}
.cf-pin:hover, .cf-pin:focus-visible { background: var(--cf-gold); outline: none; }

.cf-popup .cf-store__name { font-size: .95rem; }
.cf-popup .cf-store__dist { display: none; }


@media (prefers-reduced-motion: reduce) {
  .cf-store { transition: none; }
}

/* ---- pins, zoomed in ----
   Past the logo threshold the teardrop gives way to the mark itself. Both live
   in the same button so the swap is a class change, not 44 markers rebuilt. */
/* No `position` here. MapLibre positions every marker with
   `.maplibregl-marker { position: absolute }` and drives it by transform;
   locator.css loads after maplibre-gl.css, so declaring `position: relative`
   on the same element beat it and dropped all 44 markers out of map
   positioning into normal document flow. They stacked up as a neat grid in
   the middle of the Atlantic. The absolute position MapLibre sets is already
   a containing block, so the logo below anchors to it without any help. */
.cf-pin__logo {
  position: absolute; inset: 0; margin: auto;
  width: 150%; height: auto; max-width: none;
  transform: rotate(45deg);          /* cancel the teardrop's own rotation */
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.pins-logo .cf-pin {
  width: 2.4rem; height: 2.4rem;
  background: #fff; border-color: #fff; border-radius: 50%;
  transform: none; box-shadow: 0 3px 10px rgb(0 0 0 / .3);
}
.pins-logo .cf-pin__logo { opacity: 1; width: 84%; transform: none; }
.pins-logo .cf-pin:hover { background: #fff; box-shadow: 0 4px 16px rgb(0 0 0 / .45); }
.cf-pin { transition: width .25s ease, height .25s ease, border-radius .25s ease, background .2s ease; }

/* ---- the mobile cap ----
   The class is only ever added by script, so with no JavaScript nothing is
   hidden and the full list renders. */
.cf-store.is-over-cap { display: none; }

.cf-list__more {
  display: block; width: 100%; margin: 1rem 0 0; padding: .95rem 1.25rem;
  font: inherit; font-weight: 700; cursor: pointer;
  color: var(--cf-red); background: #fff;
  border: 2px solid var(--cf-line); border-radius: .6rem;
  transition: background .2s ease, border-color .2s ease;
}
.cf-list__more:hover { background: var(--cf-cream); border-color: var(--cf-red); }
.cf-list__more:focus-visible { outline: 3px solid var(--cf-gold); outline-offset: 2px; }

/* ---- the map lock ---- */
.cf-map-wrap { position: relative; }
.cf-map__hint {
  position: absolute; inset: auto 0 0.9rem 0; margin: 0; text-align: center;
  pointer-events: none;              /* the dismissing click IS the engaging click */
  opacity: 0; transition: opacity .25s ease;
  font-size: .82rem; font-weight: 600; color: #fff;
}
.cf-map__hint::before {
  content: ""; display: inline-block; vertical-align: middle;
  width: .95rem; height: .95rem; margin-right: .45rem;
  background: currentColor;
  -webkit-mask: center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 3v13.5l3-2.5 2.2 5 2.3-1-2.2-4.9H18L9 3z'/%3E%3C/svg%3E");
          mask: center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 3v13.5l3-2.5 2.2 5 2.3-1-2.2-4.9H18L9 3z'/%3E%3C/svg%3E");
}
.cf-map__hint span, .cf-map__hint { text-shadow: 0 1px 6px rgba(0,0,0,.55); }
.map-locked .cf-map-wrap:hover .cf-map__hint { opacity: .95; }
@media (hover: none) {
  /* No hover on touch, so say it up front and let it fade after a moment. */
  .map-locked .cf-map__hint { opacity: .95; }
}

/* ---- host store and hours ---- */
.cf-store__host {
  margin: 0 0 .3rem; font-size: .8rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; color: var(--cf-gold);
}
.cf-store__hours { margin: 0 0 .35rem; font-size: .85rem; color: var(--cf-muted); }
.cf-popup .cf-store__host { font-size: .72rem; margin-bottom: .2rem; }
.cf-popup .cf-store__hours { font-size: .8rem; }
