/* Bubba's Site Prep & Paving — Custom CSS */
/* Tailwind CDN handles utilities; this file handles custom/animation styles */

/* ─── Base ─────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }
body { font-family: 'Source Sans 3', sans-serif; color: #1A1A1A; }

/* ─── Skip Link (Accessibility) ───────────────────────────── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  background: #C41230;
  color: #fff;
  padding: 0.5rem 1rem;
  font-weight: 600;
  border-radius: 0 0 4px 4px;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ─── Navigation ───────────────────────────────────────────── */
#main-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: #1F1F1F;
  transition: box-shadow 0.3s ease;
}
#main-nav.scrolled { box-shadow: 0 2px 20px rgba(0,0,0,0.4); }

body { padding-top: 76px; }

/* Desktop dropdown */
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: #1A1A1A;
  border-top: 3px solid #C41230;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
}
.nav-dropdown.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.nav-dropdown a {
  display: block;
  padding: 0.6rem 1.25rem;
  color: #F3F3F3;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(196,18,48,0.15);
  transition: background 0.15s, color 0.15s;
}
.nav-dropdown a:last-child { border-bottom: none; }
.nav-dropdown a:hover { background: #1F1F1F; color: #C41230; }

/* Mobile menu */
#mobile-menu {
  display: none;
  background: #1A1A1A;
  border-top: 1px solid rgba(196,18,48,0.2);
}
#mobile-menu.open { display: block; }
#mobile-menu a {
  display: block;
  padding: 0.75rem 1.5rem;
  color: #F3F3F3;
  border-bottom: 1px solid rgba(196,18,48,0.1);
  font-size: 0.95rem;
}
#mobile-menu a:hover { color: #C41230; }
#mobile-menu .mobile-submenu { padding-left: 1rem; background: #111111; }
#mobile-menu .mobile-submenu a { font-size: 0.875rem; color: #BBBBBB; }

/* Nav active link */
.nav-link-active { color: #C41230 !important; }
.nav-link-active::after {
  content: '';
  display: block;
  height: 2px;
  background: #C41230;
  margin-top: 2px;
  border-radius: 1px;
}

/* ─── Hero ──────────────────────────────────────────────────── */
.hero-section {
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(31, 31, 31, 0.78);
}
.hero-content { position: relative; z-index: 1; }

/* Page hero (service pages, inner pages) */
.page-hero {
  min-height: 280px;
  display: flex;
  align-items: center;
  position: relative;
  background-size: cover;
  background-position: center;
}
@media (min-width: 768px) { .page-hero { min-height: 340px; } }

/* ─── Cards ─────────────────────────────────────────────────── */
.service-card {
  background: #fff;
  border: 1px solid rgba(196,18,48,0.25);
  border-top: 4px solid #C41230;
  border-radius: 6px;
  padding: 1.75rem;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.service-card:hover {
  box-shadow: 0 12px 32px rgba(31,31,31,0.15);
  transform: translateY(-3px);
}

/* ─── Buttons ───────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #C41230;
  color: #ffffff;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.75rem 1.75rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease;
  line-height: 1.2;
}
.btn-primary:hover { background: #8B0000; color: #fff; transform: translateY(-1px); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  color: #C41230;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.72rem 1.75rem;
  border-radius: 4px;
  border: 2px solid #C41230;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
  line-height: 1.2;
}
.btn-secondary:hover { background: #C41230; color: #ffffff; }

.btn-white {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #fff;
  color: #1F1F1F;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.75rem 1.75rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
  line-height: 1.2;
}
.btn-white:hover { background: #F3F3F3; color: #1F1F1F; }

.btn-ghost-white {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  color: #fff;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.72rem 1.75rem;
  border-radius: 4px;
  border: 2px solid rgba(255,255,255,0.7);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
  line-height: 1.2;
}
.btn-ghost-white:hover { background: rgba(255,255,255,0.15); border-color: #fff; }

/* ─── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  color: #1F1F1F;
  margin-bottom: 0.35rem;
  letter-spacing: 0.03em;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid #BBBBBB;
  border-radius: 4px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.95rem;
  color: #1A1A1A;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: #C41230;
  box-shadow: 0 0 0 3px rgba(196,18,48,0.2);
}
.form-textarea { resize: vertical; min-height: 120px; }
.form-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%231F1F1F'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 1.1rem; padding-right: 2.5rem; }
.form-error { display: none; color: #c0392b; font-size: 0.8rem; margin-top: 0.3rem; }
.form-error.show { display: block; }
.form-input.error, .form-select.error, .form-textarea.error { border-color: #c0392b; }
.form-input.valid, .form-select.valid, .form-textarea.valid { border-color: #27ae60; }
.honeypot { display: none !important; visibility: hidden !important; }
.alert-error {
  display: none;
  background: #fff0f0;
  border: 1px solid #ffcdd2;
  color: #c0392b;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-error.show { display: block; }

/* ─── Gallery ───────────────────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
@media (min-width: 640px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .gallery-grid { grid-template-columns: repeat(4, 1fr); gap: 1rem; } }

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  cursor: pointer;
  aspect-ratio: 4/3;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}
.gallery-item:hover img { transform: scale(1.06); }
.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: rgba(31,31,31,0);
  display: flex;
  align-items: flex-end;
  padding: 0.75rem;
  transition: background 0.3s ease;
}
.gallery-item:hover .gallery-item-overlay { background: rgba(31,31,31,0.65); }
.gallery-caption {
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.gallery-item:hover .gallery-caption { opacity: 1; transform: translateY(0); }
.gallery-zoom-icon {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(196,18,48,0.9);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.gallery-item:hover .gallery-zoom-icon { opacity: 1; }

.gallery-item.filtered-out {
  display: none;
}

/* Gallery overlay (used in gallery.html) */
.gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(31,31,31,0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}
.gallery-trigger:hover .gallery-overlay,
.gallery-item:hover .gallery-overlay { background: rgba(31,31,31,0.55); }

/* Filter buttons */
.filter-btn {
  padding: 0.5rem 1.1rem;
  border-radius: 4px;
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  font-size: 0.875rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  border: 2px solid #C41230;
  color: #1F1F1F;
  background: transparent;
  transition: all 0.2s ease;
}
.filter-btn:hover, .filter-btn.active {
  background: #C41230;
  color: #ffffff;
}

/* ─── Lightbox ──────────────────────────────────────────────── */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(26,26,26,0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
#lightbox.open {
  opacity: 1;
  pointer-events: auto;
}
#lightbox-img {
  max-width: calc(100vw - 120px);
  max-height: calc(100vh - 120px);
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 48px rgba(0,0,0,0.6);
  user-select: none;
  -webkit-user-drag: none;
}
#lightbox-caption {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: #F3F3F3;
  font-size: 0.875rem;
  text-align: center;
  max-width: 480px;
  padding: 0.4rem 1rem;
  background: rgba(31,31,31,0.85);
  border-radius: 4px;
}
#lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  color: #F3F3F3;
  background: rgba(31,31,31,0.8);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  transition: background 0.2s;
}
#lightbox-close:hover { background: #C41230; color: #fff; }
#lightbox-prev, #lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(31,31,31,0.8);
  color: #F3F3F3;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: background 0.2s;
}
#lightbox-prev { left: 1.25rem; }
#lightbox-next { right: 1.25rem; }
#lightbox-prev:hover, #lightbox-next:hover { background: #C41230; color: #fff; }
#lightbox-counter {
  position: absolute;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: #BBBBBB;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
}
@media (max-width: 640px) {
  #lightbox-img { max-width: 100vw; max-height: calc(100vh - 80px); border-radius: 0; }
  #lightbox-prev { left: 0.5rem; }
  #lightbox-next { right: 0.5rem; }
}

/* ─── Trust Bar ─────────────────────────────────────────────── */
.trust-bar {
  background: #C41230;
  padding: 0.85rem 1rem;
}
.trust-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Oswald', sans-serif;
  font-weight: 500;
  font-size: 0.875rem;
  color: #ffffff;
  letter-spacing: 0.02em;
}

/* ─── Stats ─────────────────────────────────────────────────── */
.stat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #E8A030;
  color: #1A1A1A;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

/* ─── Section Headings ──────────────────────────────────────── */
.section-label {
  display: inline-block;
  font-family: 'Oswald', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #8B0000;
  margin-bottom: 0.5rem;
}

/* ─── Breadcrumb ────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: rgba(243,243,243,0.7);
}
.breadcrumb a { color: rgba(243,243,243,0.8); text-decoration: none; }
.breadcrumb a:hover { color: #C41230; }
.breadcrumb-sep { font-size: 0.7rem; }

/* ─── Since Badge ───────────────────────────────────────────── */
.since-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: #E8A030;
  color: #1A1A1A;
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  box-shadow: 0 4px 16px rgba(232,160,48,0.35);
}
.since-badge .year { font-size: 1.5rem; }
.since-badge .label { font-size: 0.55rem; letter-spacing: 0.1em; text-transform: uppercase; }

/* ─── Footer ────────────────────────────────────────────────── */
footer a:hover { color: #C41230 !important; }

/* ─── Accessibility & Focus ─────────────────────────────────── */
:focus-visible { outline: 3px solid #C41230; outline-offset: 2px; }
a:focus-visible, button:focus-visible { outline: 3px solid #C41230; outline-offset: 2px; border-radius: 2px; }

/* ─── Reduced Motion ────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── Print ─────────────────────────────────────────────────── */
@media print {
  #main-nav, footer, .cta-section, .trust-bar { display: none !important; }
  body { padding-top: 0 !important; }
}

/* ─── Spinner ───────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Utility: line clamp ───────────────────────────────────── */
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
