← back to Costa Rica
public/verticals.html
93 lines
<!doctype html>
<html lang="en" data-theme="light">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Verticals — Costa Rica Directory</title>
<meta name="description" content="Browse Costa Rica businesses by vertical — tourism, rentals, retail, food, beauty, fitness, creative, pet, cleaning. 12 verticals across all 7 provinces." />
<meta property="og:type" content="website" />
<meta property="og:title" content="Browse by Vertical — Costa Rica Directory" />
<meta property="og:description" content="12 verticals across tourism, rentals, and local services in Costa Rica. Pick one to see top regions and sample listings." />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[
{"@type":"ListItem","position":1,"name":"Home","item":"https://costarica.agentabrams.com/"},
{"@type":"ListItem","position":2,"name":"Verticals","item":"https://costarica.agentabrams.com/verticals"}
]}
</script>
<script>(function(){try{var t=localStorage.getItem('cr-theme');if(t)document.documentElement.setAttribute('data-theme',t);}catch(e){}})();</script>
<style>
:root{--bg:#fafaf7;--fg:#0e1015;--muted:#5a6270;--line:#e3e0d6;--card:#fff;--card-line:#ebe7da;--accent:#0a7a3a;--accent-2:#c2a85a}
[data-theme="dark"]{--bg:#0e1015;--fg:#f3f1ea;--muted:#9aa3b2;--line:#23262d;--card:#15181f;--card-line:#262932;--accent:#3ec07a;--accent-2:#d8c074}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--fg);font-family:-apple-system,BlinkMacSystemFont,'Inter','Segoe UI',Roboto,sans-serif;line-height:1.55}
a{color:inherit;text-decoration:none} a:hover{color:var(--accent)}
.nav{position:sticky;top:0;z-index:30;background:color-mix(in srgb,var(--bg) 88%,transparent);backdrop-filter:saturate(160%) blur(10px);border-bottom:1px solid var(--line)}
.nav-in{max-width:1320px;margin:0 auto;padding:14px 22px;display:flex;align-items:center;gap:18px;flex-wrap:wrap}
.brand{font-weight:700;font-size:18px} .brand .pin{color:var(--accent)}
.nav-links{display:flex;gap:14px;flex-wrap:wrap;color:var(--muted);font-size:14px}
.nav-links a.active{color:var(--fg);font-weight:600}
.ml-auto{margin-left:auto} .icon-btn{appearance:none;background:transparent;color:inherit;border:1px solid var(--line);border-radius:999px;width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
main{max-width:1320px;margin:0 auto;padding:32px 22px 48px}
h1{font-size:clamp(32px,4.5vw,48px);letter-spacing:-.02em;margin:0 0 6px}
.lead{color:var(--muted);max-width:720px;margin:0 0 22px}
.group{margin:24px 0 12px;display:flex;align-items:end;gap:10px}
.group h2{margin:0;font-size:18px;text-transform:capitalize;letter-spacing:-.01em}
.group .ct{color:var(--muted);font-size:13px}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:14px}
.vc{background:var(--card);border:1px solid var(--card-line);border-radius:14px;overflow:hidden;display:flex;flex-direction:column;transition:transform .15s ease,box-shadow .15s ease}
.vc:hover{transform:translateY(-2px);box-shadow:0 10px 22px rgba(0,0,0,.06)}
.vc .img{aspect-ratio:1.6/1;background:linear-gradient(135deg, color-mix(in srgb, var(--accent) 25%, var(--card)), color-mix(in srgb, var(--accent-2) 22%, var(--card)));overflow:hidden}
.vc .img img{width:100%;height:100%;object-fit:cover;display:block}
.vc .body{padding:12px 14px}
.vc .nm{font-weight:700;text-transform:capitalize;letter-spacing:-.01em}
.vc .ct{color:var(--muted);font-size:13px;margin-top:2px}
.skel{height:200px;background:linear-gradient(110deg,var(--card) 8%,var(--bg) 18%,var(--card) 33%);background-size:200% 100%;animation:s 1.6s linear infinite;border-radius:14px}
@keyframes s{0%{background-position:200% 0}100%{background-position:-200% 0}}
</style>
</head>
<body>
<header class="nav"><div class="nav-in">
<a class="brand" href="/"><span class="pin">●</span> Costa Rica Directory</a>
<nav class="nav-links">
<a href="/">Browse</a>
<a href="/search">Search</a>
<a href="/provinces">Provinces</a>
<a href="/verticals" class="active">Verticals</a>
<a href="/stats">Stats</a>
<a href="/about">About</a>
</nav>
<div class="ml-auto"><button class="icon-btn" id="themeBtn" aria-label="Theme">◐</button></div>
</div></header>
<main>
<h1>Browse by vertical</h1>
<p class="lead">12 verticals across tourism, rentals, and local services. Pick one to see the top regions, sample listings, and a province-by-province breakdown.</p>
<div id="out"><div class="grid"><div class="skel"></div><div class="skel"></div><div class="skel"></div><div class="skel"></div></div></div>
</main>
<script>
const themeBtn=document.getElementById('themeBtn');
themeBtn.addEventListener('click',()=>{const cur=document.documentElement.getAttribute('data-theme')||'light';const nx=cur==='light'?'dark':'light';document.documentElement.setAttribute('data-theme',nx);try{localStorage.setItem('cr-theme',nx);}catch{}});
const CAT_ORDER=['tourism','rentals','service'];
const CAT_LABEL={tourism:'Tourism',rentals:'Rentals',service:'Local services'};
const niceVert=v=>v.replace(/^(service|tourism|rentals)_/,'').replace(/_/g,' ');
fetch('/api/verticals').then(r=>r.json()).then(d=>{
const by={};for(const v of d.verticals){(by[v.category]=by[v.category]||[]).push(v);}
const out=document.getElementById('out');
out.innerHTML=CAT_ORDER.filter(c=>by[c]&&by[c].length).map(cat=>{
const items=by[cat];
const total=items.reduce((s,v)=>s+v.n,0);
return `<div class="group"><h2>${CAT_LABEL[cat]}</h2><span class="ct">${items.length} verticals · ${total.toLocaleString()} listings</span></div>
<div class="grid">${items.map(v=>`
<a class="vc" href="/v/${v.slug}">
<div class="img">${v.image_url?`<img loading="lazy" alt="${niceVert(v.vertical)}" src="${v.image_url}" />`:''}</div>
<div class="body"><div class="nm">${niceVert(v.vertical)}</div><div class="ct">${v.n.toLocaleString()} listings</div></div>
</a>`).join('')}</div>`;
}).join('');
}).catch(e=>{document.getElementById('out').innerHTML=`<p style="color:var(--muted)">Could not load: ${e.message}</p>`;});
</script>
</body>
</html>