/* Design A: Chinook. Calgary's chinook arch – a band of clear warm sky over the Rockies – heads every page;
   each listing card is topped with a mountain ridge in its category's colour. */
:root {
  --ink: #142a44;
  --muted: #566b84;
  --paper: #f3f6f9;
  --card: #ffffff;
  --line: #dbe3ec;
  --focus: #2b6cb0;
  --sky: #1f4e79;
  --warm: #f6b26b;
  --c: #4a5565;
  --font: "Outfit", system-ui, sans-serif;
}
.g-restaurants-food { --c: #d9572b; }
.g-shops-retail { --c: #2b6cb0; }
.g-personal-care-wellness { --c: #c2417a; }
.g-contractors-trades { --c: #d99a00; }
.g-professional-services { --c: #13858c; }
.g-auto-repair { --c: #55606e; }
.g-recreation-schools-events { --c: #6a4bb5; }
.g-industrial-wholesale-delivery { --c: #3b7d4f; }
.g-other { --c: #8a6d3b; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.55 var(--font); }
a { color: var(--ink); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--focus); }
:focus-visible { outline: 3px solid var(--warm); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* Header: deep winter sky, the chinook arch of warm light, the Rockies along the bottom */
.top {
  position: relative;
  color: #fff;
  background:
    radial-gradient(120% 90% at 50% 135%, transparent 58%, rgba(255, 214, 160, .95) 60%, rgba(246, 178, 107, .55) 66%, transparent 74%),
    linear-gradient(180deg, #0f2f52 0%, var(--sky) 100%);
  padding-bottom: 46px;
}
.top::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 48px;
  background: var(--paper);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 48' preserveAspectRatio='none'%3E%3Cpath d='M0 48V34l38-18 26 12 40-26 34 20 22-8 46 24 30-16 44 22 36-30 30 16 26-6 48 26 28-14 42 20 34-26 30 18 26-10 40 18V48z'/%3E%3C/svg%3E") 0 0 / 100% 100%;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 48' preserveAspectRatio='none'%3E%3Cpath d='M0 48V34l38-18 26 12 40-26 34 20 22-8 46 24 30-16 44 22 36-30 30 16 26-6 48 26 28-14 42 20 34-26 30 18 26-10 40 18V48z'/%3E%3C/svg%3E") 0 0 / 100% 100%;
}
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-top: 16px; padding-bottom: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 1.45rem; letter-spacing: -0.02em; text-decoration: none; }
.brand:hover { color: #fff; }
.brand img { display: block; width: 38px; height: 38px; }
.brand span { color: var(--warm); margin-left: -0.25em; }
.nav { display: flex; flex-wrap: wrap; gap: 4px; }
.nav a { padding: 6px 12px; border-radius: 999px; color: #dce8f5; font-weight: 600; text-decoration: none; }
.nav a:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.nav a[aria-current="page"] { background: var(--warm); color: #142a44; }

/* Hero */
.hero { padding: 36px 0 20px; max-width: 46rem; }
.range { margin: 0 0 8px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; font-size: .85rem; }
.hero h1 { margin: 0; font-size: clamp(2.1rem, 5.2vw, 3.7rem); line-height: 1.02; font-weight: 700; letter-spacing: -0.03em; }
.hero h1 .count {
  display: block; font-size: 2em; line-height: .95; font-weight: 800;
  background: linear-gradient(180deg, var(--sky) 40%, #d9572b 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { margin: 16px 0 0; font-size: 1.15rem; color: var(--muted); max-width: 38rem; }
.lead .count { font-weight: 800; color: var(--ink); }

/* Category chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 8px 6px 14px;
  background: var(--card); border: 1px solid var(--line); border-bottom: 3px solid var(--c);
  border-radius: 10px; font-weight: 600; text-decoration: none; font-size: .95rem;
}
.chip .n { background: color-mix(in srgb, var(--c) 14%, #fff); color: var(--c); border-radius: 999px; padding: 0 8px; font-size: .85rem; font-weight: 700; }
.chip:hover, .chip[aria-current="true"] { background: var(--c); border-color: var(--c); color: #fff; }
.chip:hover .n, .chip[aria-current="true"] .n { background: #fff; color: var(--c); }
.chips {
  position: sticky; top: 0; z-index: 10; padding: 10px 0;
  background: var(--paper); box-shadow: 0 0 0 100vmax var(--paper); clip-path: inset(0 -100vmax -12px);
}
.chips.is-stuck {
  background: var(--card);
  box-shadow: 0 0 0 100vmax var(--card), 0 8px 12px -10px rgba(20, 42, 68, .45);
  animation: bar-drop 320ms cubic-bezier(.2, .8, .2, 1) both;
}
.group h2 { scroll-margin-top: calc(var(--chips-h, 110px) + 16px); }
/* Chips rise like peaks catching the morning light */
.chips.enter .chip { animation: chip-rise 520ms cubic-bezier(.2, .9, .3, 1.15) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes chip-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes bar-drop { from { transform: translateY(-100%); } to { transform: none; } }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .chips.is-stuck, .chips.enter .chip { animation: none; }
}

/* Category sections */
.group { margin-top: 44px; }
.group h2, .more h2 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 16px; font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; }
.group h2::before { content: ""; align-self: center; width: 22px; height: 14px; background: var(--c);
  clip-path: polygon(0 100%, 30% 25%, 48% 60%, 70% 0, 100% 100%); }
.group h2 .n { font-size: 1rem; font-weight: 600; color: var(--muted); }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }

/* A listing: card topped by a ridge line in the category colour */
.biz {
  position: relative; display: grid; grid-template-columns: 1fr auto; gap: 12px;
  padding: 34px 16px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.biz::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 22px;
  background: linear-gradient(180deg, var(--c), color-mix(in srgb, var(--c) 70%, #fff));
  clip-path: polygon(0 0, 100% 0, 100% 55%, 88% 85%, 76% 40%, 63% 75%, 50% 25%, 38% 70%, 27% 45%, 14% 90%, 0 50%);
}
.name { margin: 0 0 8px; font-size: 1.15rem; line-height: 1.2; font-weight: 700; overflow-wrap: anywhere; }
.tags { margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.tag { font-size: .8rem; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--c) 11%, #fff); }
.where { margin: 0; font-size: .92rem; color: var(--muted); display: flex; flex-direction: column; }
.where .addr { color: var(--ink); font-weight: 600; }
.date {
  align-self: start; display: flex; flex-direction: column; align-items: center; min-width: 54px; padding: 6px 6px 5px;
  border-radius: 10px; line-height: 1.1; color: #fff;
  background: linear-gradient(180deg, var(--sky), #2d6a9f 70%, var(--warm) 140%);
}
.date .mon { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.date .day { font-size: 1.5rem; font-weight: 800; }

/* Index pages and footer */
.index, .weeks { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.index li, .weeks li { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; justify-content: space-between; gap: 8px; box-shadow: inset 0 -3px 0 var(--c, var(--sky)); }
.index a, .weeks a { font-weight: 700; }
.index small, .weeks .n { color: var(--muted); }
.more { margin-top: 56px; }
.empty { font-size: 1.1rem; }
main > h1 { font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -0.03em; margin: 36px 0 12px; }
main > h2 { margin-top: 32px; }
main > p, .plain { max-width: 42rem; }
.foot {
  margin-top: 72px; padding: 64px 0 40px; color: #c9d6e6; font-size: .92rem; position: relative;
  background: linear-gradient(180deg, #1f4e79, #0f2f52);
}
.foot::before {
  content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 40px; background: var(--paper);
  clip-path: polygon(0 0, 100% 0, 100% 30%, 92% 70%, 84% 35%, 73% 85%, 62% 40%, 52% 75%, 41% 30%, 30% 80%, 18% 45%, 8% 75%, 0 40%);
}
.foot a { color: #fff; }
.foot p { max-width: 48rem; }
.foot-links { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot-browse { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); padding-bottom: 24px; margin-bottom: 20px; border-bottom: 1px solid rgba(255, 255, 255, .15); }
.foot-browse h2 { margin: 0 0 10px; font-size: 1rem; font-weight: 700; color: var(--warm); }
.foot-browse ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }

@media (max-width: 640px) {
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
}
@media (max-width: 560px) {
  .top .wrap { justify-content: flex-start; }
  .hero { padding-top: 24px; }
}

/* Back-to-top button: a peak under the chinook arch, docked at the right end of the stuck category bar
   (top right on pages without one); slides in like the chips */
.chips { padding-right: 56px; }
.to-top {
  --size: 42px;
  position: fixed; z-index: 11; top: 10px; right: max(16px, calc((100vw - 1120px) / 2 + 16px));
  width: var(--size); height: var(--size); padding: 0;
  border: 0; border-radius: 50%; cursor: pointer;
  background: radial-gradient(circle at 50% 120%, #2d6a9f, var(--sky) 55%, #0f2f52);
  box-shadow: 0 0 0 3px rgba(246, 178, 107, .6), 0 6px 14px -6px rgba(15, 47, 82, .7);
  opacity: 0; visibility: hidden; transform: translateX(28px) scale(.85);
  transition: opacity 260ms ease, transform 480ms cubic-bezier(.2, .9, .3, 1.25), visibility 0s linear 480ms, box-shadow 200ms ease;
}
.to-top.on-bar { top: calc(var(--chips-h, 62px) / 2 - var(--size) / 2); }
.to-top.is-shown { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.to-top svg { display: block; width: 26px; height: 26px; margin: auto; overflow: visible; }
.to-top .arch { fill: none; stroke: var(--warm); stroke-width: 2.6; stroke-linecap: round; transition: stroke 200ms ease, transform 300ms ease; transform-origin: 50% 60%; }
.to-top .peak { fill: #fff; transition: transform 300ms cubic-bezier(.2, .9, .3, 1.3); }
.to-top:hover, .to-top:focus-visible { box-shadow: 0 0 0 4px var(--warm), 0 8px 18px -6px rgba(15, 47, 82, .8); }
.to-top:hover .peak, .to-top:focus-visible .peak { transform: translateY(-3px); }
.to-top:hover .arch, .to-top:focus-visible .arch { stroke: #ffd6a0; transform: scale(1.08) translateY(-1px); }
.to-top:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  .to-top, .to-top.is-shown { transform: none; transition: opacity 200ms ease, visibility 0s linear 200ms; }
  .to-top.is-shown { transition-delay: 0s; }
  .to-top .peak, .to-top .arch { transition: none; }
}
@media print { .to-top { display: none; } }
