/* =====================================================
   Emma Joe's Tree Service — Shared Stylesheet
   emmajoestree.com
   ===================================================== */

/* ---------- Reset & Variables ---------- */
:root {
  --green:       #2a6e30;
  --green-dark:  #1a3d1f;
  --green-light: #e8f5e9;
  --green-mid:   #3e8e46;
  --gold:        #d97706;
  --gold-dark:   #b45309;
  --text:        #1a2218;
  --text-muted:  #4a5e4d;
  --border:      #cddecf;
  --bg:          #ffffff;
  --bg-alt:      #f4f9f4;
  --shadow:      0 4px 24px rgba(26,61,31,.10);
  --shadow-lg:   0 8px 40px rgba(26,61,31,.15);
  --radius:      10px;
  --radius-lg:   16px;
  --font:        'Segoe UI', system-ui, -apple-system, Helvetica, Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
ul { list-style: none; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  line-height: 1.22;
  color: var(--green-dark);
  font-weight: 700;
}
h1 { font-size: clamp(1.75rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }
p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }
.lead { font-size: 1.15rem; color: var(--text-muted); line-height: 1.7; }

/* ---------- Layout ---------- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.section { padding: 72px 0; }
.section-sm { padding: 48px 0; }
.section-alt { background: var(--bg-alt); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  font-weight: 700;
  font-size: .95rem;
  padding: 14px 28px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all .18s ease;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.btn-primary {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
  box-shadow: 0 4px 16px rgba(217,119,6,.35);
}
.btn-primary:hover {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(217,119,6,.40);
  text-decoration: none;
  color: #fff;
}
.btn-outline {
  background: transparent;
  color: var(--green-dark);
  border-color: var(--green-dark);
}
.btn-outline:hover {
  background: var(--green-dark);
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
}
.btn-white {
  background: #fff;
  color: var(--green-dark);
  border-color: #fff;
}
.btn-white:hover {
  background: var(--green-light);
  border-color: var(--green-light);
  text-decoration: none;
  color: var(--green-dark);
}
.btn-lg { padding: 16px 36px; font-size: 1.05rem; }

/* ---------- Top Bar ---------- */
.topbar {
  background: var(--green-dark);
  color: rgba(255,255,255,.85);
  font-size: .82rem;
  padding: 8px 0;
}
.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.topbar a {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.topbar a:hover { text-decoration: underline; }
.topbar-badges {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.badge-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ---------- Navigation ---------- */
.site-header {
  background: #fff;
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(26,61,31,.07);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 20px;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-mark {
  width: 42px;
  height: 42px;
  background: var(--green-dark);
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.logo-mark svg { width: 26px; height: 26px; }
.logo-text { line-height: 1.2; }
.logo-name {
  display: block;
  font-weight: 800;
  font-size: 1rem;
  color: var(--green-dark);
  letter-spacing: -.3px;
}
.logo-tag {
  display: block;
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: .6px;
  text-transform: uppercase;
}

/* Main Nav Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-links li { position: relative; }
.nav-links a {
  display: block;
  padding: 8px 14px;
  font-weight: 600;
  font-size: .88rem;
  color: var(--text);
  border-radius: 6px;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.nav-links a:hover,
.nav-links a.active { background: var(--green-light); color: var(--green); }

/* Dropdown */
.nav-links .has-dropdown:hover .dropdown,
.nav-links .has-dropdown:focus-within .dropdown { display: block; }
.dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  padding: 6px;
  z-index: 200;
}
.dropdown a {
  display: block;
  padding: 10px 14px;
  font-size: .86rem;
  border-radius: 6px;
  color: var(--text);
  font-weight: 500;
}
.dropdown a:hover { background: var(--green-light); color: var(--green); }
.nav-cta {
  background: var(--gold) !important;
  color: #fff !important;
  border-radius: 8px !important;
  padding: 10px 18px !important;
  font-size: .88rem !important;
}
.nav-cta:hover {
  background: var(--gold-dark) !important;
  color: #fff !important;
}
.nav-phone {
  font-weight: 700;
  font-size: .9rem;
  color: var(--green-dark) !important;
  white-space: nowrap;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-phone:hover { color: var(--green) !important; text-decoration: underline; }

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-direction: column;
  gap: 5px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--green-dark);
  border-radius: 2px;
  transition: all .25s;
}
.mobile-nav {
  display: none;
  flex-direction: column;
  padding: 16px 0 20px;
  border-top: 1px solid var(--border);
  background: #fff;
}
.mobile-nav a {
  display: block;
  padding: 11px 20px;
  font-weight: 600;
  font-size: .95rem;
  color: var(--text);
  border-bottom: 1px solid var(--bg-alt);
}
.mobile-nav a.phc-link { color: var(--green); }
.mobile-nav .m-cta {
  margin: 12px 20px 0;
  display: block;
  text-align: center;
  background: var(--gold);
  color: #fff !important;
  padding: 14px;
  border-radius: var(--radius);
  font-size: 1rem;
}
.mobile-nav.open { display: flex; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--green-dark) 0%, #2a5c2e 60%, var(--green) 100%);
  color: #fff;
  padding: 80px 0 72px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero .container { position: relative; }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.hero h1 {
  color: #fff;
  margin-bottom: 18px;
}
.hero .lead { color: rgba(255,255,255,.85); margin-bottom: 28px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-trust {
  display: flex;
  gap: 10px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.trust-pill {
  background: rgba(255,255,255,.15);
  color: rgba(255,255,255,.9);
  font-size: .8rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,.2);
}
.hero-photo {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,.35);
  aspect-ratio: 4/3;
}
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.check-circle {
  width: 22px;
  height: 22px;
  background: var(--gold);
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.check-circle svg { width: 13px; height: 13px; }

/* ---------- Section Headers ---------- */
.section-header { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-header h2 { margin-bottom: 12px; }
.kicker {
  display: inline-block;
  color: var(--green);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* ---------- Service Cards ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.service-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all .2s ease;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--green);
  text-decoration: none;
}
.service-icon {
  width: 52px;
  height: 52px;
  background: var(--green-light);
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  flex-shrink: 0;
}
.service-icon svg { width: 28px; height: 28px; color: var(--green); }
.service-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--green-dark);
}
.service-card p {
  font-size: .88rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}
.service-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .85rem;
  font-weight: 700;
  color: var(--green);
  margin-top: 14px;
}
.service-card:hover .service-link { gap: 8px; }

/* PHC featured card */
.service-card.featured {
  border-color: var(--green);
  background: linear-gradient(160deg, var(--green-light) 0%, #fff 60%);
}
.featured-badge {
  display: inline-block;
  background: var(--green);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
  margin-bottom: 12px;
  width: fit-content;
}

/* ---------- Reviews ---------- */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.review-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.stars { color: #f59e0b; font-size: 1rem; margin-bottom: 12px; }
.review-text {
  font-size: .9rem;
  line-height: 1.65;
  color: var(--text);
  font-style: italic;
  margin-bottom: 14px;
}
.reviewer {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* ---------- CTA Banner ---------- */
.cta-banner {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green) 100%);
  color: #fff;
  padding: 64px 0;
  text-align: center;
}
.cta-banner h2 { color: #fff; margin-bottom: 12px; }
.cta-banner p { color: rgba(255,255,255,.85); margin-bottom: 28px; font-size: 1.05rem; }
.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.cta-phone-line {
  margin-top: 20px;
  font-size: .9rem;
  color: rgba(255,255,255,.75);
}
.cta-phone-line a { color: #fff; font-weight: 700; }

/* ---------- Page Hero (inner pages) ---------- */
.page-hero {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 100%);
  color: #fff;
  padding: 56px 0 52px;
}
.page-hero .kicker { background: rgba(255,255,255,.15); color: #fff; padding: 4px 14px; border-radius: 100px; border: 1px solid rgba(255,255,255,.2); }
.page-hero h1 { color: #fff; margin: 12px 0 16px; }
.page-hero .lead { color: rgba(255,255,255,.85); max-width: 700px; }

/* ---------- Content Page ---------- */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 48px;
  align-items: start;
}
.content-body h2 { margin: 36px 0 12px; color: var(--green-dark); }
.content-body h2:first-child { margin-top: 0; }
.content-body h3 { margin: 24px 0 8px; }
.content-body ul, .content-body ol {
  padding-left: 20px;
  margin-bottom: 1em;
}
.content-body ul { list-style: disc; }
.content-body ol { list-style: decimal; }
.content-body li { margin-bottom: 6px; font-size: .95rem; }
.content-body .callout {
  background: var(--green-light);
  border-left: 4px solid var(--green);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin: 24px 0;
}
.content-body .callout p { margin: 0; }
.content-body .warning {
  background: #fef9c3;
  border-left: 4px solid #d97706;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin: 24px 0;
}

/* Sidebar */
.sidebar-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}
.sidebar-card h3 {
  font-size: 1rem;
  margin-bottom: 14px;
  color: var(--green-dark);
}
.sidebar-card .btn { width: 100%; justify-content: center; margin-bottom: 10px; }
.sidebar-contact { margin-top: 14px; font-size: .85rem; color: var(--text-muted); }
.sidebar-contact a { color: var(--green); font-weight: 600; }
.related-links { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.related-links a {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .86rem;
  font-weight: 600;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--border);
}
.related-links a:hover { border-color: var(--green); color: var(--green); text-decoration: none; }

/* ---------- Service Area ---------- */
.area-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.area-tag {
  background: var(--green-light);
  color: var(--green-dark);
  font-size: .82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--green-dark);
  color: rgba(255,255,255,.75);
  padding: 56px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}
.footer-brand .logo-name { color: #fff; font-size: 1.1rem; }
.footer-brand .logo-tag { color: rgba(255,255,255,.5); }
.footer-brand p {
  font-size: .85rem;
  line-height: 1.65;
  margin: 16px 0;
}
.footer-contact { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.footer-contact a {
  color: rgba(255,255,255,.85);
  font-size: .85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-contact a:hover { color: #fff; }
.footer-col h4 {
  color: #fff;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 8px; }
.footer-col a {
  color: rgba(255,255,255,.7);
  font-size: .85rem;
  text-decoration: none;
}
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: .8rem;
}
.footer-certs { display: flex; gap: 12px; flex-wrap: wrap; }
.cert-badge {
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.8);
  font-size: .75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,.15);
}

/* ---------- Stats row ---------- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}
.stat-item strong {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--green-dark);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-item span { font-size: .85rem; color: var(--text-muted); }

/* ---------- Mobile Sticky CTA Bar ---------- */
.mobile-cta-bar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 999;
  background: var(--green-dark);
  padding: 10px 16px;
  padding-bottom: max(10px, env(safe-area-inset-bottom)); /* iPhone notch */
  box-shadow: 0 -4px 24px rgba(0,0,0,.30);
  gap: 10px;
  border-top: 1px solid rgba(255,255,255,.15);
}
.mobile-cta-bar a {
  flex: 1;
  text-align: center;
  padding: 14px 8px;
  border-radius: 10px;
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none !important;
  white-space: nowrap;
  display: block;
}
.mob-call { background: var(--gold); color: #fff !important; }
.mob-call:hover { background: var(--gold-dark); color: #fff !important; }
.mob-estimate { background: rgba(255,255,255,.12); color: #fff !important; border: 1px solid rgba(255,255,255,.3); }
.mob-estimate:hover { background: rgba(255,255,255,.2); color: #fff !important; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-photo { display: none; }
  .content-grid { grid-template-columns: 1fr; }
  /* Sidebar goes BELOW content on mobile (stays in document order) */
  .sidebar { order: 2; }
  .sidebar-card.sticky-top { position: static !important; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  /* Force inline-style 2-col grids to collapse */
  div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; }
  div[style*="grid-template-columns:1fr 340px"],
  div[style*="grid-template-columns: 1fr 340px"] { grid-template-columns: 1fr !important; }
  div[style*="grid-template-columns:1fr 1fr;"] { grid-template-columns: 1fr !important; }
  /* Inline grid gap too wide on tablet */
  div[style*="gap:48px"],
  div[style*="gap: 48px"],
  div[style*="gap:56px"],
  div[style*="gap: 56px"] { gap: 32px !important; }
}

@media (max-width: 700px) {
  /* Nav */
  .nav-links, .nav-phone { display: none; }
  .hamburger { display: flex; }

  /* Topbar — just the phone number on small screens */
  .topbar > .container > span:first-child { display: none; }
  .topbar .container { justify-content: center; }
  .topbar-badges { justify-content: center; flex-wrap: nowrap; }
  .badge-item { display: none; }

  /* Spacing */
  .section { padding: 48px 0; }
  .section-sm { padding: 36px 0; }
  .hero { padding: 48px 0 44px; }
  .cta-banner { padding: 48px 0; }
  .page-hero { padding: 40px 0 36px; }

  /* Grids */
  .services-grid { grid-template-columns: 1fr; }
  .reviews-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }

  /* Typography */
  .lead { font-size: 1rem; }
  .page-hero .lead { font-size: .95rem; }

  /* Cards */
  .service-card { padding: 20px; }
  .review-card { padding: 20px; }
  .sidebar-card { padding: 18px; }
  .hero-trust { gap: 12px; }

  /* Sticky mobile bar */
  .mobile-cta-bar { display: flex; }
  body { padding-bottom: 70px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }

  /* Buttons — full-width stacking */
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .cta-actions { flex-direction: column; align-items: stretch; }
  .cta-actions .btn { width: 100%; justify-content: center; text-align: center; }

  /* Page hero button groups */
  .page-hero div[style*="display:flex"],
  .page-hero div[style*="display: flex"] {
    flex-direction: column;
  }
  .page-hero .btn { width: 100%; justify-content: center; text-align: center; }

  /* Stats */
  .stats-row { gap: 10px; }
  .stat-item strong { font-size: 1.6rem; }

  /* Footer */
  .footer-bottom { flex-direction: column; text-align: center; }

  /* Smaller card padding */
  .service-card { padding: 16px; }
  .hero-card { padding: 20px; }
}

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.text-green { color: var(--green); }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.sticky-top { position: sticky; top: 88px; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ── Photo grids ── */
.photo-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.photo-grid-3 .pg-item {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 3/4;
}
.photo-grid-3 .pg-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
@media (max-width: 600px) {
  .photo-grid-3 { grid-template-columns: 1fr 1fr; }
}
