/*
Theme Name: Tamworth.directory
Theme URI: https://tamworth.directory/
Author: Tamworth.directory
Description: Custom WordPress theme for Tamworth.directory - a local business & trades directory for Tamworth and the surrounding New England region. Includes a Business custom post type with Category and Area taxonomies, live search, and a bulk CSV importer.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: tamworth-directory
*/

/* =========================================================
   1. DESIGN TOKENS - warm cream, terracotta, charcoal, eucalyptus, gold
   ========================================================= */
:root {
  --background: #F5F0E7;
  --foreground: #202522;
  --card: #FFFFFF;
  --primary: #B85C38;           /* terracotta */
  --primary-foreground: #FBF8F3;
  --secondary: #5C765E;         /* eucalyptus */
  --secondary-foreground: #FBF8F3;
  --accent: #C59A5B;            /* muted gold */
  --accent-foreground: #202522;
  --muted: #DED4C5;             /* sand */
  --muted-foreground: #5c5850;
  --border: #DED4C5;
  --charcoal: #202522;
  --cream: #F5F0E7;
  --radius: 1rem;
}

/* =========================================================
   2. RESET / BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; font-family: "Plus Jakarta Sans", "Inter", sans-serif; font-weight: 800; letter-spacing: -.01em; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

.container-tam { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 1.25rem; }
.container-sm { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 1.25rem; }
.container-xs { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 1.25rem; }

/* =========================================================
   3. LAYOUT UTILITIES
   ========================================================= */
.flex { display: flex; }
.grid { display: grid; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.text-center { text-align: center; }
.gap-2 { gap: .5rem; } .gap-3 { gap: .75rem; } .gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; } .gap-8 { gap: 2rem; } .gap-12 { gap: 3rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.w-full { width: 100%; }

@media (max-width: 900px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.py-4{padding-top:1rem;padding-bottom:1rem;} .py-8{padding-top:2rem;padding-bottom:2rem;}
.py-12{padding-top:3rem;padding-bottom:3rem;} .py-16{padding-top:4rem;padding-bottom:4rem;}
.py-20{padding-top:5rem;padding-bottom:5rem;}
.mb-2{margin-bottom:.5rem;} .mb-3{margin-bottom:.75rem;} .mb-4{margin-bottom:1rem;} .mb-6{margin-bottom:1.5rem;}
.mb-8{margin-bottom:2rem;} .mb-12{margin-bottom:3rem;}
.mt-4{margin-top:1rem;} .mt-6{margin-top:1.5rem;} .mt-8{margin-top:2rem;}

/* =========================================================
   4. TYPOGRAPHY
   ========================================================= */
.h1 { font-size: 2.6rem; }
.h2 { font-size: 1.9rem; }
.h3 { font-size: 1.2rem; }
.text-lg { font-size: 1.1rem; }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .75rem; }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.uppercase { text-transform: uppercase; letter-spacing: .08em; }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-accent { color: var(--accent); }
.text-muted { color: var(--muted-foreground); }
.text-cream { color: var(--cream); }
@media (min-width: 768px) { .h1 { font-size: 3.6rem; } }

/* =========================================================
   5. BUTTONS
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border-radius: 999px; font-weight: 600; font-size: .95rem; font-family: "Inter", sans-serif;
  padding: .8rem 1.6rem; border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease; line-height: 1.2;
}
.btn:hover { transform: translateY(-2px); }
.btn-lg { padding: 1rem 2rem; font-size: 1rem; }
.btn-sm { padding: .55rem 1.1rem; font-size: .85rem; }
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-charcoal { background: var(--charcoal); color: var(--cream); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--foreground); }
.btn-outline:hover { border-color: var(--primary); }
.btn-cream { background: var(--cream); color: var(--charcoal); }
.btn-link { background: none; padding: 0; color: var(--primary); font-weight: 600; border-radius: 0; }
.btn-link:hover { transform: none; text-decoration: underline; }

/* =========================================================
   6. CARDS / BADGES
   ========================================================= */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 1.1rem; overflow: hidden; }
.card-body { padding: 1.5rem; }
.card-hover { transition: box-shadow .2s ease, border-color .2s ease, transform .15s ease; }
.card-hover:hover { border-color: var(--primary); box-shadow: 0 12px 28px -10px rgb(0 0 0 / .12); transform: translateY(-2px); }

.badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .7rem; font-weight: 700; padding: .3rem .75rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .05em; }
.badge-cat { background: rgb(184 92 56 / .1); color: var(--primary); }
.badge-verified { background: rgb(92 118 94 / .12); color: var(--secondary); text-transform: none; letter-spacing: 0; font-size: .8rem; }
.badge-servicing { background: rgb(197 154 91 / .18); color: #8a6a2f; text-transform: none; letter-spacing: 0; font-size: .72rem; }
.tag-pill { display: inline-flex; align-items: center; background: var(--muted); padding: .35rem .8rem; border-radius: 999px; font-size: .78rem; font-weight: 500; color: var(--foreground); opacity: .85; }

/* =========================================================
   7. HEADER / NAV
   ========================================================= */
.announcement-bar { background: var(--primary); color: var(--primary-foreground); text-align: center; font-size: .8rem; font-weight: 500; padding: .5rem 0; }
.announcement-bar a { text-decoration: underline; }
.site-header { position: sticky; top: 0; z-index: 50; background: rgb(245 240 231 / .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.site-header .container-tam { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.site-logo { font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: 1.2rem; letter-spacing: -.01em; color: var(--charcoal); }
.site-logo span { color: var(--primary); font-size: .8rem; font-weight: 700; margin-left: .1rem; }
.main-nav { display: flex; align-items: center; gap: 1.8rem; }
.main-nav a { color: rgb(32 37 34 / .8); font-weight: 500; font-size: .92rem; }
.main-nav a:hover { color: var(--primary); }
.header-actions { display: flex; align-items: center; gap: 1.2rem; }
.nav-toggle { display: none; background: none; border: none; color: var(--charcoal); font-size: 1.6rem; }
@media (max-width: 980px) {
  .main-nav, .header-actions .nav-only-desktop { display: none; }
  .main-nav.open { display: flex; position: absolute; top: 100%; left: 0; right: 0; background: var(--cream); border-bottom: 1px solid var(--border); flex-direction: column; align-items: flex-start; padding: 1rem 1.25rem 1.5rem; gap: .25rem; }
  .main-nav.open a { padding: .6rem .25rem; width: 100%; }
  .nav-toggle { display: block; }
}

/* =========================================================
   8. HERO
   ========================================================= */
.hero { position: relative; background: var(--charcoal); overflow: hidden; }
.hero-bg { position: absolute; inset: 0; z-index: 0; opacity: .25; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, rgb(32 37 34 / .7), rgb(32 37 34 / .6), rgb(32 37 34 / .88)); }
.hero-content { position: relative; z-index: 1; padding: 5rem 0; max-width: 46rem; }
.hero-eyebrow { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); }
.hero-search { display: flex; gap: .75rem; margin-top: 2.2rem; flex-wrap: wrap; }
.hero-search-input { flex: 1; min-width: 220px; display: flex; align-items: center; gap: .75rem; background: var(--cream); border-radius: 999px; padding: .9rem 1.3rem; box-shadow: 0 10px 25px rgb(0 0 0 / .2); }
.hero-search-input input { flex: 1; background: none; border: none; color: var(--charcoal); font-size: .95rem; }
.hero-search-input input:focus { outline: none; }
.hero-location-pill { display: flex; align-items: center; gap: .5rem; border: 1px solid rgb(245 240 231 / .3); background: rgb(32 37 34 / .4); color: var(--cream); border-radius: 999px; padding: .9rem 1.3rem; font-size: .92rem; font-weight: 500; }
.hero-popular { margin-top: 1.5rem; font-size: .875rem; color: rgb(245 240 231 / .6); display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.hero-popular a { color: rgb(245 240 231 / .9); font-weight: 500; }
.hero-popular a:hover { color: var(--primary); text-decoration: underline; }

/* =========================================================
   9. FORMS
   ========================================================= */
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .4rem; font-size: .92rem; }
.input, select.input, textarea.input {
  width: 100%; padding: .75rem 1rem; border: 1px solid var(--border); border-radius: .7rem;
  background: #fff; color: var(--foreground);
}
.input:focus, select.input:focus, textarea.input:focus { outline: 2px solid rgb(184 92 56 / .3); border-color: var(--primary); }
.input-lg { padding: .9rem 1rem; font-size: 1rem; }
textarea.input { resize: vertical; min-height: 120px; }

/* =========================================================
   10. SECTIONS
   ========================================================= */
.section { padding: 4.5rem 0; }
.section-charcoal { background: var(--charcoal); color: var(--cream); }
.eyebrow { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--primary); }
.area-tile { padding: 1.5rem; }
.category-pill-link { display: inline-flex; align-items: center; gap: .4rem; background: var(--muted); padding: .55rem 1.1rem; border-radius: 999px; font-size: .875rem; font-weight: 600; }
.category-pill-link:hover { background: rgb(184 92 56 / .12); color: var(--primary); }

/* =========================================================
   11. BUSINESS LISTING CARD
   ========================================================= */
.listing-card { padding: 1.5rem; }
.listing-card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; }
.listing-address { display: flex; gap: .4rem; align-items: flex-start; font-size: .875rem; color: var(--muted-foreground); margin-top: .4rem; }
.listing-desc { font-size: .9rem; color: rgb(32 37 34 / .68); line-height: 1.6; margin-top: .75rem; }
.listing-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.listing-footer { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem; padding-top: 1rem; margin-top: 1.2rem; border-top: 1px solid var(--border); }

.search-layout { display: grid; grid-template-columns: 260px 1fr; gap: 2rem; align-items: start; }
@media (max-width: 900px) { .search-layout { grid-template-columns: 1fr; } }
.pagination { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 2rem; }
.no-results { text-align: center; padding: 3rem 0; color: var(--muted-foreground); }

/* =========================================================
   12. FOOTER
   ========================================================= */
.site-footer { background: var(--charcoal); color: var(--cream); padding: 4rem 0 1.5rem; }
.footer-cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr; gap: 2.5rem; margin-bottom: 3rem; }
@media (max-width: 980px) { .footer-cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-cols { grid-template-columns: 1fr; } }
.footer-col h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: rgb(245 240 231 / .5); font-family: "Inter", sans-serif; font-weight: 600; margin-bottom: 1rem; }
.footer-col ul { display: flex; flex-direction: column; gap: .65rem; }
.footer-col a { color: rgb(245 240 231 / .8); font-size: .9rem; }
.footer-col a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid rgb(245 240 231 / .1); padding-top: 1.5rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; font-size: .875rem; color: rgb(245 240 231 / .6); }

/* =========================================================
   13. MISC
   ========================================================= */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.contact-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 3rem; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
.icon-circle { width: 2.4rem; height: 2.4rem; border-radius: 999px; background: rgb(184 92 56 / .12); color: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
