/* ============================================================
   Best Handyman Tucson — Interactive Project Map
   Illustrated visitor-map aesthetic: warm paper, ink, watercolor.
   ============================================================ */

:root {
  --paper: #f6efdd;
  --paper-deep: #efe3c3;
  --ink: #2c3a48;
  --ink-soft: #55636f;
  --navy: #1f3a5f;
  --navy-bright: #37507a;
  --amber: #e0803c;
  --amber-deep: #c96a25;
  --gold: #c98a2c;
  --red: #a33b3b;
  --green: #4e7a4f;
  --teal: #2e6e6a;
  --plum: #7b5d7d;
  --card: #fdfaf2;
  --line: rgba(90, 70, 50, 0.18);
  --shadow: 0 10px 30px rgba(44, 58, 72, 0.14);
  --radius: 16px;
  --font-sans: "Familjen Grotesk", "Trebuchet MS", system-ui, sans-serif;
  --font-hand: "Caveat", "Segoe Script", cursive;
  --header-h: 68px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--navy-bright); }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 0.5em; }
[hidden] { display: none !important; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------------- header ---------------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 1200;
  height: var(--header-h);
  display: flex; align-items: center;
  background: rgba(253, 250, 242, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  width: 100%; display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { height: 46px; width: auto; }
.brand span { font-weight: 700; font-size: 1.02rem; letter-spacing: 0.01em; }
.main-nav { display: flex; gap: 20px; margin-left: auto; }
.main-nav a {
  text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: 0.95rem;
}
.main-nav a:hover { color: var(--amber-deep); }
.header-phone {
  text-decoration: none; font-weight: 700; color: var(--navy); white-space: nowrap;
}
.btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none;
  font-family: var(--font-sans); font-weight: 700; font-size: 1rem;
  padding: 12px 22px; border-radius: 999px; transition: transform 0.15s, box-shadow 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(180deg, var(--amber), var(--amber-deep));
  color: #fff; box-shadow: 0 6px 16px rgba(201, 106, 37, 0.35);
}
.btn-primary:hover { box-shadow: 0 8px 22px rgba(201, 106, 37, 0.45); }
.btn-secondary {
  background: var(--card); color: var(--navy); border: 2px solid var(--navy-bright);
}
.btn-secondary:hover { background: var(--navy-bright); color: #fff; }
.btn-sm { padding: 9px 16px; font-size: 0.9rem; }

/* ---------------- map hero ---------------- */
.map-hero {
  position: relative;
  height: calc(100svh - var(--header-h));
  min-height: 480px;
  margin-top: var(--header-h);
  overflow: hidden;
}
#map {
  position: absolute; inset: 0;
  background: var(--paper-deep);
  cursor: grab;
}
#map:active { cursor: grabbing; }
.leaflet-container { font-family: var(--font-sans); background: var(--paper-deep); }

/* hero title card (top-right: keeps metro Tucson, on the map's west side, visible) */
.hero-card {
  position: absolute; z-index: 1000; top: 22px; right: 22px;
  max-width: 430px;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.7, 1), opacity 0.3s;
  background: rgba(253, 250, 242, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px 18px;
  pointer-events: auto;
}
.hero-card .kicker {
  font-family: var(--font-hand); color: var(--amber-deep);
  font-size: 1.35rem; display: block; margin-bottom: 2px;
}
.hero-card h1 { font-size: clamp(1.45rem, 2.6vw, 2rem); color: var(--navy); letter-spacing: -0.01em; }
.hero-card p { margin: 0 0 14px; color: var(--ink-soft); font-size: 0.98rem; }
.hero-card .hero-ctas { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-card.minimized { transform: translateY(-140%); opacity: 0; pointer-events: none; }
.hero-restore {
  position: absolute; z-index: 999; top: 22px; right: 22px;
  border: 1px solid var(--line); background: rgba(253, 250, 242, 0.94);
  color: var(--navy); font-family: var(--font-sans); font-weight: 700; font-size: 0.88rem;
  padding: 9px 15px; border-radius: 999px; cursor: pointer;
  box-shadow: 0 3px 10px rgba(44, 58, 72, 0.12);
}

/* filter chips */
.map-filters {
  position: absolute; z-index: 1000; left: 22px; bottom: 20px; right: 90px;
  display: flex; gap: 8px; flex-wrap: wrap; pointer-events: auto;
}
.chip {
  border: 1.5px solid var(--line); cursor: pointer;
  background: rgba(253, 250, 242, 0.94); color: var(--ink);
  font-family: var(--font-sans); font-weight: 600; font-size: 0.88rem;
  padding: 8px 14px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 7px;
  box-shadow: 0 3px 10px rgba(44, 58, 72, 0.10);
  transition: all 0.15s; white-space: nowrap;
}
.chip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--navy-bright)); }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip:hover { transform: translateY(-1px); }

/* map pins */
.pin { background: none; border: none; }
.pin-inner {
  --pc: var(--navy-bright);
  width: 34px; height: 34px; border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  background: var(--pc);
  border: 2.5px solid #fdfaf2;
  box-shadow: 0 4px 10px rgba(40, 30, 20, 0.35);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s;
}
.pin-inner svg { width: 17px; height: 17px; transform: rotate(45deg); fill: #fdfaf2; }
.pin:hover .pin-inner, .pin.is-active .pin-inner { transform: rotate(-45deg) scale(1.18); }
.pin--project .pin-inner { --pc: #e0803c; }
.pin--area .pin-inner { --pc: #37507a; }
.pin--food .pin-inner { --pc: #c0563b; }
.pin--historic .pin-inner { --pc: #7b5d7d; }
.pin--parks .pin-inner { --pc: #4e7a4f; }
.pin--business .pin-inner { --pc: #2e6e6a; }
.pin--landmarks .pin-inner { --pc: #c98a2c; }
/* neighborhood-level pins hide when zoomed out */
.zoom-low .pin--minor { display: none; }

.leaflet-tooltip.bht-tip {
  background: var(--ink); color: var(--paper); border: none; border-radius: 8px;
  font-family: var(--font-sans); font-weight: 600; font-size: 0.85rem;
  padding: 5px 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.leaflet-tooltip.bht-tip::before { border-top-color: var(--ink); }

.leaflet-control-zoom a {
  background: var(--card) !important; color: var(--navy) !important;
  border-color: var(--line) !important; font-weight: 700;
}
.leaflet-bottom.leaflet-right .leaflet-control-zoom { margin-bottom: 76px; margin-right: 12px; }
.map-reset {
  position: absolute; z-index: 1000; right: 12px; bottom: 20px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  width: 44px; height: 44px; cursor: pointer; box-shadow: 0 3px 10px rgba(44,58,72,0.12);
  display: flex; align-items: center; justify-content: center;
}
.map-reset svg { width: 22px; height: 22px; fill: var(--navy); }

/* ---------------- detail panel / bottom sheet ---------------- */
.detail {
  position: absolute; z-index: 1100;
  top: 22px; right: 22px; bottom: 22px;
  width: min(400px, calc(100% - 44px));
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transform: translateX(calc(100% + 30px));
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.25, 1);
}
.detail.open { transform: translateX(0); }
.detail-head {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 18px 18px 10px; border-bottom: 1px dashed var(--line);
}
.detail-head h3 { margin: 2px 0 0; font-size: 1.25rem; color: var(--navy); flex: 1; }
.detail-close {
  border: none; background: var(--paper-deep); color: var(--ink);
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  font-size: 1.05rem; line-height: 1; flex-shrink: 0;
}
.detail-body { padding: 14px 18px 18px; overflow-y: auto; flex: 1; overscroll-behavior: contain; }
.detail-handle { display: none; }
.badge {
  display: inline-block; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 4px 10px; border-radius: 999px;
  background: var(--paper-deep); color: var(--ink-soft); margin: 0 6px 6px 0;
}
.badge--cat { background: rgba(224, 128, 60, 0.15); color: var(--amber-deep); }
.badge--type { background: rgba(55, 80, 122, 0.12); color: var(--navy-bright); }
.detail-body p { margin: 0 0 12px; }
.detail-body .why {
  background: rgba(201, 138, 44, 0.1); border-left: 3px solid var(--gold);
  border-radius: 0 10px 10px 0; padding: 10px 14px; margin: 0 0 14px;
}
.detail-body .why strong { font-family: var(--font-hand); font-size: 1.2rem; color: var(--amber-deep); display: block; }
.detail-body blockquote {
  margin: 0 0 14px; padding: 12px 16px; background: var(--paper-deep);
  border-radius: 10px; font-style: italic; color: var(--ink-soft);
}
.detail-cta { padding: 12px 18px; border-top: 1px dashed var(--line); }
.detail-cta .btn { width: 100%; text-align: center; }

/* before / after */
.ba-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.ba-pair figure { margin: 0; position: relative; }
.ba-pair img, .gallery img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px;
  border: 1px solid var(--line); background: var(--paper-deep);
}
.ba-pair figcaption {
  position: absolute; top: 8px; left: 8px;
  background: var(--ink); color: var(--paper); font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em; padding: 3px 9px; border-radius: 999px;
}
.ba-pair figure.after figcaption { background: var(--green); color: #fff; }

/* photo gallery — fills the panel width, wraps, and scrolls down with it */
.gallery {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0 0 14px;
}
.gallery img { width: 100%; }
.zoomable { cursor: zoom-in; }

/* full-size photo viewer (lightbox) */
.lightbox {
  position: fixed; inset: 0; z-index: 2000; display: none;
  align-items: center; justify-content: center;
  background: rgba(22, 17, 12, 0.92); padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox .lb-img {
  max-width: 94vw; max-height: 88vh; width: auto; height: auto;
  border-radius: 8px; box-shadow: 0 16px 50px rgba(0, 0, 0, 0.55);
  cursor: zoom-out; background: var(--paper-deep);
}
.lb-close, .lb-prev, .lb-next {
  position: absolute; border: none; cursor: pointer; color: #fff;
  background: rgba(253, 250, 242, 0.16); border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s; line-height: 1;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(253, 250, 242, 0.34); }
.lb-close { top: 18px; right: 18px; width: 46px; height: 46px; font-size: 1.3rem; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); width: 54px; height: 54px; font-size: 2.2rem; }
.lb-prev { left: 16px; }
.lb-next { right: 16px; }
@media (max-width: 860px) {
  .lb-prev, .lb-next { top: auto; bottom: 22px; transform: none; width: 48px; height: 48px; }
  .lb-prev { left: 24px; }
  .lb-next { right: 24px; }
  .lb-close { top: 14px; right: 14px; }
}
.detail-list { list-style: none; margin: 0 0 12px; padding: 0; }
.detail-list li { margin-bottom: 8px; }
.detail-list button {
  width: 100%; text-align: left; cursor: pointer;
  background: var(--paper-deep); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; font-family: var(--font-sans); font-size: 0.95rem; color: var(--ink);
}
.detail-list button strong { color: var(--navy); display: block; }
.detail-list button:hover { border-color: var(--amber); }
.no-photos { color: var(--ink-soft); font-size: 0.9rem; font-style: italic; }

/* ---------------- sections ---------------- */
.section { padding: 72px 0; }
.section-alt { background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section .kicker {
  font-family: var(--font-hand); color: var(--amber-deep); font-size: 1.5rem; display: block;
}
.section h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); color: var(--navy); letter-spacing: -0.01em; }
.section .lede { color: var(--ink-soft); max-width: 640px; margin-bottom: 34px; font-size: 1.05rem; }

.card-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: 0 4px 14px rgba(44, 58, 72, 0.06);
  display: flex; flex-direction: column;
  transition: transform 0.18s, box-shadow 0.18s;
}
.section-alt .card { background: var(--paper); }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card h3 { font-size: 1.12rem; color: var(--navy); margin-bottom: 6px; }
.card p { color: var(--ink-soft); font-size: 0.94rem; margin: 0 0 12px; flex: 1; }
.card .card-link {
  font-weight: 700; font-size: 0.92rem; color: var(--amber-deep); text-decoration: none;
  cursor: pointer; background: none; border: none; padding: 0; text-align: left; font-family: var(--font-sans);
}
.card .card-link:hover { text-decoration: underline; }
.card-thumb {
  margin: -20px -20px 14px; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden;
  aspect-ratio: 16 / 9; background: var(--paper-deep);
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* services */
.svc-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.svc {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
}
.svc svg { width: 26px; height: 26px; fill: var(--amber-deep); flex-shrink: 0; margin-top: 2px; }
.svc strong { display: block; color: var(--navy); }
.svc span { color: var(--ink-soft); font-size: 0.88rem; }

/* why us */
.why-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.why-item { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.why-item .num {
  font-family: var(--font-hand); font-size: 2rem; color: var(--amber-deep); line-height: 1;
}
.why-item h3 { font-size: 1.05rem; margin: 6px 0 4px; color: var(--navy); }
.why-item p { color: var(--ink-soft); font-size: 0.92rem; margin: 0; }

/* service area list */
.area-cols { columns: 3; column-gap: 32px; max-width: 760px; }
.area-cols li { margin-bottom: 8px; break-inside: avoid; }
.area-cols button {
  background: none; border: none; padding: 0; cursor: pointer; text-align: left;
  font-family: var(--font-sans); font-size: 1rem; color: var(--navy-bright); font-weight: 600;
}
.area-cols button:hover { color: var(--amber-deep); }

/* FAQ */
.faq { max-width: 760px; }
.faq details {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 0 20px; margin-bottom: 12px;
}
.faq summary {
  cursor: pointer; font-weight: 700; color: var(--navy); padding: 16px 0; font-size: 1.02rem;
  list-style: none; position: relative; padding-right: 30px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
  font-size: 1.4rem; color: var(--amber-deep); font-weight: 400;
}
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 16px; color: var(--ink-soft); }

/* ---------------- estimate form ---------------- */
.estimate-wrap {
  display: grid; gap: 40px; grid-template-columns: 1fr 1.2fr; align-items: start;
}
.estimate-side h2 { margin-bottom: 10px; }
.estimate-side .contact-line { display: flex; align-items: center; gap: 10px; margin: 14px 0; font-weight: 600; }
.estimate-side .contact-line svg { width: 22px; height: 22px; fill: var(--amber-deep); }
.estimate-form {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow);
}
.form-row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; margin-bottom: 14px; }
.form-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.form-row .form-field { margin-bottom: 0; }
.form-field label { font-weight: 700; font-size: 0.9rem; color: var(--navy); }
.form-field input, .form-field select, .form-field textarea {
  font-family: var(--font-sans); font-size: 1rem; color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 10px;
  padding: 11px 13px; width: 100%;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(224, 128, 60, 0.18);
}
.form-field textarea { min-height: 110px; resize: vertical; }
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
.form-msg { margin-top: 12px; font-weight: 600; }
.form-msg.ok { color: var(--green); }
.form-msg.err { color: var(--red); }

/* footer */
.site-footer {
  background: var(--navy); color: rgba(253, 250, 242, 0.85);
  padding: 40px 0 90px; font-size: 0.92rem;
}
.site-footer a { color: var(--paper); }
.site-footer .foot-grid { display: flex; gap: 24px; flex-wrap: wrap; justify-content: space-between; align-items: center; }
.site-footer img { height: 64px; }
.site-footer .credit { opacity: 0.65; font-size: 0.8rem; margin-top: 18px; }

/* sticky mobile CTA */
.sticky-cta {
  position: fixed; z-index: 1300; left: 12px; right: 12px; bottom: 12px;
  display: none; gap: 10px;
}
.sticky-cta .btn { flex: 1; text-align: center; padding: 14px; font-size: 1.02rem; }
.sticky-cta .btn-call { flex: 0 0 auto; background: var(--navy); color: #fff; display: flex; align-items: center; }

/* ---------------- mobile ---------------- */
@media (max-width: 860px) {
  .main-nav { display: none; }
  .header-phone { margin-left: auto; }
  .site-header .btn { display: none; }
  .brand span { display: none; }
  .brand img { height: 42px; }

  .map-hero { height: calc(100svh - var(--header-h)); min-height: 420px; }

  .hero-card {
    top: 12px; left: 12px; right: 12px; max-width: none;
    padding: 14px 16px 12px;
  }
  .hero-card p { font-size: 0.9rem; margin-bottom: 10px; }
  .hero-card .btn { padding: 10px 16px; font-size: 0.92rem; }

  .map-filters {
    left: 0; right: 0; bottom: 78px; padding: 0 12px;
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .map-filters::-webkit-scrollbar { display: none; }
  .chip { padding: 10px 15px; font-size: 0.9rem; }

  .map-reset { bottom: 78px; }
  .leaflet-control-zoom { display: none; } /* pinch zoom is native on touch */

  /* bottom sheet */
  .detail {
    top: auto; left: 0; right: 0; bottom: 0; width: 100%;
    max-height: 72svh; border-radius: 20px 20px 0 0;
    transform: translateY(105%);
  }
  .detail.open { transform: translateY(0); }
  .detail-handle {
    display: block; width: 44px; height: 5px; border-radius: 99px;
    background: var(--line); margin: 10px auto 0; flex-shrink: 0;
  }
  .sticky-cta { display: flex; }
  .section { padding: 52px 0; }
  .estimate-wrap { grid-template-columns: 1fr; gap: 24px; }
  .form-row { grid-template-columns: 1fr; }
  .area-cols { columns: 2; }
}
@media (max-width: 420px) { .area-cols { columns: 1; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .detail, .card, .chip, .pin-inner { transition: none; }
}
