/* ============================================================
   Hole In One Golf Carts & Mobile Repair — style.css
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* === Design tokens ========================================= */
:root {
  --bg-primary:    #F7F8F4;
  --bg-secondary:  #FFFFFF;
  --bg-alt:        #EAF1E6;   /* alternating section band */
  --text-primary:  #16241A;
  --text-secondary:#4B5A4F;
  --accent:        #1B533B;   /* logo green */
  --accent-dark:   #133D2B;
  --accent-light:  #DCEFE1;
  --star:          #C4922E;   /* logo gold */
  --border:        #D4DCD2;
  --shadow:        rgba(0, 0, 0, 0.06);
  --radius:        8px;
  --radius-sm:     6px;
  --max:           1040px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary:    #0F1712;
    --bg-secondary:  #18231C;
    --bg-alt:        #142019;
    --text-primary:  #EEF3EE;
    --text-secondary:#A3B3A7;
    --accent:        #3FA564;
    --accent-dark:   #2F8A50;
    --accent-light:  #1D3526;
    --border:        #2A3A30;
    --shadow:        rgba(0, 0, 0, 0.3);
  }
}

/* === Base ================================================== */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 110px; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.55;
  min-height: 100dvh;
  padding-bottom: calc(76px + env(safe-area-inset-bottom)); /* room for mobile CTA bar */
}

a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; }

/* === Header & nav ========================================== */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 52px;
  padding: 0 16px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--accent);
  font-weight: 800;
  font-size: 1.05rem;
  min-height: 44px;
}
.brand small {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.site-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 0 12px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 52px;
  z-index: 99;
  scrollbar-width: none;
}
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  transition: color 0.15s ease;
}
.site-nav a:hover { color: var(--accent); }

/* === Buttons =============================================== */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--accent);
}
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}
.btn-secondary:hover { background: var(--accent-light); }
.btn-primary:active, .btn-secondary:active { transform: scale(0.98); }
.btn-lg { padding: 14px 24px; font-size: 1.05rem; }
.btn-call { padding: 8px 14px; font-size: 0.92rem; }

a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* === Hero ================================================== */
.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 36px 20px 28px;
  display: grid;
  gap: 24px;
  align-items: center;
}
.eyebrow {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.hero h1 {
  font-size: clamp(1.9rem, 6vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.lead {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 34em;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}
.hero-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 8px 24px var(--shadow);
}
.rating {
  margin-top: 18px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}
.stars { color: var(--star); letter-spacing: 2px; margin-right: 4px; }

/* === Sections ============================================== */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px 20px;
}
.section-alt {
  max-width: none;
  background: var(--bg-alt);
}
.section-alt > * {
  max-width: calc(var(--max) - 40px);
  margin-left: auto;
  margin-right: auto;
}
.section h2 {
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.section-lead {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.card-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 1px 3px var(--shadow);
}
.card h3 {
  font-size: 1.08rem;
  margin-bottom: 6px;
  color: var(--accent);
}
.card p { color: var(--text-secondary); }

/* Why list */
.why-list {
  list-style: none;
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.why-list li {
  padding-left: 30px;
  position: relative;
  color: var(--text-secondary);
}
.why-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.why-list strong { color: var(--text-primary); }

.owner-quote {
  margin-top: 24px;
  padding: 16px 18px;
  border-left: 4px solid var(--accent);
  background: var(--bg-secondary);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 1.1rem;
  font-style: italic;
}
.owner-quote cite {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 0.9rem;
  font-style: normal;
  font-weight: 700;
  color: var(--text-secondary);
}
.owner-quote cite img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }

/* About: intro copy + owner photo */
.about-grid { display: grid; gap: 20px; align-items: center; }
.owner-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: 0 1px 3px var(--shadow);
}
.owner-card img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.owner-card figcaption { color: var(--text-secondary); font-size: 0.95rem; }
.owner-card strong { display: block; color: var(--text-primary); font-size: 1.1rem; }

.contact-person { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.contact-person img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.contact-person h3 { margin-bottom: 0; }

/* Reviews */
.review blockquote {
  font-size: 1rem;
  color: var(--text-primary);
}
.review figcaption {
  margin-top: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Hours & contact */
.contact-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}
.hours { width: 100%; border-collapse: collapse; }
.hours th, .hours td {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-weight: 500;
}
.hours td { text-align: right; font-weight: 700; }
.hours tr:last-child th, .hours tr:last-child td { border-bottom: none; }
.hours tr.today th, .hours tr.today td { color: var(--accent); }

.open-status {
  margin-top: 12px;
  font-weight: 700;
}
.open-status.is-open { color: var(--accent); }
.open-status.is-closed { color: var(--text-secondary); }

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

/* === Footer ================================================ */
.site-footer {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

/* === Mobile sticky CTA ===================================== */
.mobile-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 8px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 8px var(--shadow);
  z-index: 100;
}
.mobile-cta .btn-primary,
.mobile-cta .btn-secondary { min-height: 48px; }

/* === Utilities ============================================= */
.text-secondary { color: var(--text-secondary); }
.center { text-align: center; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }

/* === About prose ========================================== */
.prose { margin-top: 12px; }
.prose p { max-width: 42em; }
.prose p { color: var(--text-secondary); font-size: 1.05rem; }
.prose p + p { margin-top: 12px; }

/* === Photo strip =========================================== */
.photo-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 72%;
  gap: 10px;
  margin-top: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
}
.photo-strip img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  height: auto;
  align-self: start;          /* don't stretch to the tallest photo */
  border-radius: var(--radius);
  scroll-snap-align: start;
}

/* === Service area ========================================== */
.area-groups, .expand-groups { display: grid; gap: 10px; margin-top: 8px; align-items: start; }
.custom-strip { margin-top: 0; margin-bottom: 20px; }
.brands { margin-top: 28px; }
.brands h3 { font-size: 1rem; margin-bottom: 8px; }
.brands .chips li { font-weight: 700; }

/* Hero perks: quick reasons to call */
.perks { list-style: none; display: grid; gap: 6px; margin-top: 18px; }
.perks li { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.perks li::before {
  content: "✓";
  flex: 0 0 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  display: grid;
  place-items: center;
}
.expand-group {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 14px;
}
.expand-group summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  cursor: pointer;
  list-style: none;
}
.expand-group summary::-webkit-details-marker { display: none; }
.expand-group h3 { font-size: 1rem; }
/* Town count doubles as the expand button */
.expand-count {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 2px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.expand-count::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.15s ease;
}
.expand-group summary:hover .expand-count { background: var(--accent-light); }
.expand-group[open] .expand-count { background: var(--accent); color: #fff; }
.expand-group[open] .expand-count::after { transform: translateY(2px) rotate(-135deg); }
.expand-group summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm); }
.expand-group .chips { padding-bottom: 14px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
}
.area-note { border-left: 4px solid var(--star); }

/* === Listings (carts for sale) ============================= */
.listing { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.listing-cover-wrap { position: relative; background: var(--bg-alt); }
.listing-cover {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.listing-nophoto {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  font-weight: 600;
}
.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  background: var(--accent);
}
.badge-pending { background: #B7791F; }
.badge-sold { background: #7A1F1F; }
.listing-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.listing-body h3 { margin-bottom: 0; }
.price { font-size: 1.35rem; font-weight: 800; color: var(--text-primary) !important; }
.specs { font-size: 0.92rem; }
.listing-more summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 700;
  color: var(--accent);
}
.listing-more .desc { white-space: pre-line; margin-top: 6px; }
.gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 80%;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}
.gallery a { scroll-snap-align: start; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm); display: block; }
.listing .contact-actions { margin-top: auto; padding-top: 8px; }
.listing.is-sold .listing-cover { filter: grayscale(0.6); }
.listings-empty { grid-column: 1 / -1; }

.footer-logo { display: block; width: 220px; height: auto; margin: 0 auto 12px; }
.login-logo { display: block; width: 200px; height: auto; margin: 0 auto 16px; }
.brand img { width: 40px; height: 40px; }

/* Review source buttons (Google, Nextdoor) */
.review-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* Leave-a-review call to action */
.review-cta {
  margin: 28px auto 0;
  max-width: 560px;
  text-align: center;
  padding: 24px 20px;
  border: 2px solid var(--star);
}
.review-cta-stars { display: block; color: var(--star); font-size: 1.6rem; letter-spacing: 4px; margin-bottom: 6px; }
.review-cta h3 { font-size: 1.3rem; color: var(--text-primary); }
.review-cta p { margin: 8px 0 16px; }
.review-cta .btn-primary { width: 100%; max-width: 320px; }

.rating a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; }
.rating a:hover strong { text-decoration: underline; }

.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 20px; }
.footer-review { color: var(--accent); font-weight: 700; }

.footer-link { color: var(--text-secondary); display: inline-flex; align-items: center; min-height: 44px; }

/* === Admin (owner page) ==================================== */
.admin { padding-bottom: 0; }
.admin-main { max-width: 640px; margin: 0 auto; padding: 20px 16px 40px; }
.admin-main h1 { font-size: 1.5rem; margin-bottom: 6px; }
.admin-login { max-width: 380px; margin: 40px auto; }

label { display: block; font-weight: 600; font-size: 0.92rem; margin: 12px 0 4px; }
input, select, textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  font: inherit;
  font-size: 1rem;           /* 16px stops iOS from zooming on focus */
  color: var(--text-primary);
  min-height: 44px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: var(--accent);
}
fieldset { border: 1px solid var(--border); margin-bottom: 14px; }
legend { font-weight: 800; color: var(--accent); padding: 0 6px; }
.hint { font-size: 0.88rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-error { color: #B42318; font-weight: 600; margin-top: 10px; }
button { font: inherit; }
.btn-block { width: 100%; }
.btn-danger {
  min-height: 44px;
  margin-top: 24px;
  background: transparent;
  color: #B42318;
  border: 2px solid currentColor;
  border-radius: var(--radius-sm);
  font-weight: 700;
  cursor: pointer;
}

.admin-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.admin-list { display: grid; gap: 10px; }
.admin-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  width: 100%;
  text-align: left;
  color: var(--text-primary);
  cursor: pointer;
}
.admin-item img, .admin-thumb-empty {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  color: var(--text-secondary);
}
.admin-item-text { display: flex; flex-direction: column; min-width: 0; }
.admin-item-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-item-text span { color: var(--text-secondary); font-size: 0.9rem; }
.admin-item-edit { color: var(--accent); font-weight: 700; }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.photo-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-alt);
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile.is-cover { outline: 3px solid var(--accent); outline-offset: -3px; }
.photo-tile.is-uploading { display: grid; place-items: center; font-size: 0.82rem; color: var(--text-secondary); }
.photo-btn {
  position: absolute;
  top: 0;
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.05rem;
  cursor: pointer;
}
.photo-remove { right: 0; border-bottom-left-radius: var(--radius-sm); }
.photo-star { left: 0; border-bottom-right-radius: var(--radius-sm); color: var(--star); }
.photo-cover-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: center;
  padding: 2px;
}
.photo-add { cursor: pointer; }

.admin-actions {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 10px;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
}

/* === Tablet & up =========================================== */
@media (min-width: 720px) {
  body { padding-bottom: 0; }
  .mobile-cta { display: none; }
  .site-nav { justify-content: center; }
  .hero { grid-template-columns: 1.1fr 1fr; padding: 64px 20px 48px; }
  .photo-strip { grid-auto-columns: calc((100% - 30px) / 4); overflow: visible; }
  .area-groups, .expand-groups { grid-template-columns: 1fr 1fr; }
  .about-grid { grid-template-columns: 1fr 240px; gap: 48px; }
  .owner-card { flex-direction: column; text-align: center; padding: 24px 20px; }
  .owner-card img { width: 160px; height: 160px; }
  .section { padding: 56px 20px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr 1fr; }
  .why-list { grid-template-columns: 1fr 1fr; gap: 16px 28px; }
}

@media (min-width: 980px) {
  #services .card-grid, .why-grid, .listings { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 380px) {
  .brand small { display: none; }
}
