/* ============================================================
   Patton's Collision Center — Custom Styles
   Built on Tailwind CSS (CDN). This file handles overrides,
   animations, and component-level styles that Tailwind
   utility classes alone don't cover.
   ============================================================ */

/* --- CSS Custom Properties --------------------------------- */
/* Palette aligned with sister brands (Patton Warehousing, Watsontown
   Trucking, Patton Logistics). Shared navy & blue tones; gold accent
   is unique to Patton's Collision Center. */
:root {
  --navy:       #111C4E;   /* shared primary across all Patton brands */
  --navy-dark:  #0C1336;   /* shared dark background */
  --navy-light: #22389C;   /* shared secondary blue */
  --gold:       #C8A84E;   /* Collision Center accent (unique) */
  --gold-light: #DBBF6A;
  --gold-dark:  #A8892E;
  --white:      #FFFFFF;
  --gray-50:    #F9FAFB;
  --gray-100:   #F3F4F6;
  --gray-200:   #E5E7EB;
  --gray-300:   #D1D5DB;
  --gray-500:   #6B7280;
  --gray-700:   #374151;
  --gray-900:   #111827;
  --red:        #B91C1C;
}

/* --- Base -------------------------------------------------- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Montserrat', 'Calibri', 'Open Sans', system-ui, sans-serif;
  font-weight: 300;
  color: var(--gray-700);
  overflow-x: hidden;
}

/* --- Typography -------------------------------------------- */
.font-heading {
  font-family: 'Playfair Display', 'Georgia', serif;
}

.font-script {
  font-family: 'Dancing Script', cursive;
}

/* --- Brand Bar (top secondary nav — shared across all Patton sites) --- */
.brand-bar {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.8rem;
  font-weight: 600;
}

.brand-bar a {
  color: #4d4e4e;
  text-decoration: none;
  transition: color 0.2s ease;
}

.brand-bar a:hover {
  color: var(--navy);
}

/* "P" logo circles — matches the sister brand sites exactly */
.brand-bar .brand-link {
  position: relative;
  display: inline-block;
  padding-left: 36px;
  text-align: center;
  line-height: 1;
  color: #4d4e4e;
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

.brand-bar .brand-link:hover {
  color: var(--gold-dark);
}

.brand-bar .brand-link .brand-icon {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  height: 29px;
  width: 29px;
  background-color: #111c4e;
  border: 2px solid #111c4e;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.35s ease, background-color 0.35s ease;
}

.brand-bar .brand-link .brand-icon svg {
  width: 14px;
  height: 14px;
  fill: #fff;
  transition: fill 0.35s ease;
}

.brand-bar .brand-link:hover .brand-icon {
  background-color: #fff;
  color: #111c4e;
}

.brand-bar .brand-link:hover .brand-icon svg {
  fill: #111c4e;
}

/* --- Tertiary Utility Bar ---------------------------------- */
.utility-bar {
  background: var(--navy);
  height: 40px;
  font-size: 0.8rem;
  font-weight: 600;
}

.utility-bar a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: color 0.2s ease;
}

.utility-bar a:hover {
  color: var(--gold);
}

/* --- Header / Navigation ----------------------------------- */
.site-header {
  background: var(--white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: box-shadow 0.3s ease;
}

.site-header.scrolled {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.nav-link {
  position: relative;
  font-weight: 600;
  color: var(--navy);
  padding: 0.5rem 0;
  transition: color 0.2s ease;
  font-size: 1rem;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width 0.3s ease;
}

.nav-link:hover {
  color: var(--gold-dark);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link.active {
  color: var(--gold-dark);
}

/* Mobile menu */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  opacity: 0;
}

.mobile-menu.open {
  max-height: 400px;
  opacity: 1;
}

/* --- Hero Section ------------------------------------------ */
.hero {
  position: relative;
  background: var(--navy);
  overflow: hidden;
  min-height: 500px;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(27, 42, 74, 0.85) 0%,
    rgba(27, 42, 74, 0.65) 50%,
    rgba(27, 42, 74, 0.85) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* --- Section Styles ---------------------------------------- */
.section-divider {
  width: 60px;
  height: 3px;
  background: var(--gold);
  margin: 1rem auto;
}

.section-navy {
  background: var(--navy);
  color: var(--white);
}

.section-navy-dark {
  background: var(--navy-dark);
  color: var(--white);
}

.section-gray {
  background: var(--gray-50);
}

/* --- Feature Cards ----------------------------------------- */
.feature-card {
  background: var(--white);
  border-radius: 0;
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--gray-200);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.feature-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(27, 42, 74, 0.06);
  border-radius: 50%;
  color: var(--navy);
  font-size: 1.5rem;
  transition: background 0.3s ease, color 0.3s ease;
}

.feature-card:hover .feature-icon {
  background: var(--navy);
  color: var(--gold);
}

/* --- Info Cards (three-column highlight) ------------------- */
.info-card {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--white);
}

.info-card .card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(27, 42, 74, 0.75);
  z-index: 1;
  transition: background 0.3s ease;
}

.info-card:hover .card-overlay {
  background: rgba(27, 42, 74, 0.85);
}

.info-card .card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.5s ease;
}

.info-card:hover .card-bg {
  transform: scale(1.05);
}

.info-card .card-content {
  position: relative;
  z-index: 2;
}

/* --- Buttons ----------------------------------------------- */
.btn-primary {
  display: inline-block;
  background: var(--gold);
  color: var(--navy);
  font-weight: 600;
  padding: 0.75rem 2rem;
  border-radius: 0;
  transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--gold-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(200, 168, 78, 0.3);
}

.btn-outline {
  display: inline-block;
  border: 2px solid var(--gold);
  color: var(--gold);
  font-weight: 600;
  padding: 0.75rem 2rem;
  border-radius: 0;
  background: transparent;
  transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease;
  text-decoration: none;
  cursor: pointer;
}

.btn-outline:hover {
  background: var(--gold);
  color: var(--navy);
  transform: translateY(-1px);
}

.btn-navy {
  display: inline-block;
  background: var(--navy);
  color: var(--white);
  font-weight: 600;
  padding: 0.75rem 2rem;
  border-radius: 0;
  transition: background 0.3s ease, transform 0.2s ease;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.btn-navy:hover {
  background: var(--navy-light);
  transform: translateY(-1px);
}

/* --- Footer ------------------------------------------------ */
.site-footer {
  background: var(--navy-dark);
  color: var(--gray-300);
}

.site-footer a {
  color: var(--gray-300);
  transition: color 0.2s ease;
}

.site-footer a:hover {
  color: var(--gold);
}

.footer-heading {
  color: var(--white);
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

/* --- Animations -------------------------------------------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

.animate-fade-in {
  animation: fadeIn 0.5s ease forwards;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* Intersection Observer — initially hidden */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Contact Form ------------------------------------------ */
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.375rem;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: var(--white);
}

.form-input:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(27, 42, 74, 0.15);
}

.form-label {
  display: block;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

/* --- Timeline (About page) --------------------------------- */
.timeline-item {
  position: relative;
  padding-left: 2rem;
  padding-bottom: 2rem;
  border-left: 2px solid var(--gold);
}

.timeline-item:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--white);
}

/* --- Stat Counter ------------------------------------------ */
.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
}

/* --- Logo Wall --------------------------------------------- */
.logo-wall img {
  max-height: 60px;
  width: auto;
  filter: grayscale(100%);
  opacity: 0.6;
  transition: filter 0.3s ease, opacity 0.3s ease;
}

.logo-wall img:hover {
  filter: grayscale(0%);
  opacity: 1;
}

/* --- Responsive Tweaks ------------------------------------- */
@media (max-width: 768px) {
  .hero {
    min-height: 400px;
  }

  .stat-number {
    font-size: 2rem;
  }

  .info-card {
    min-height: 220px;
  }
}

@media (max-width: 480px) {
  .hero {
    min-height: 350px;
  }
}

/* --- Utilities --------------------------------------------- */
.text-navy   { color: var(--navy); }
.text-gold   { color: var(--gold); }
.bg-navy     { background-color: var(--navy); }
.bg-navy-dark{ background-color: var(--navy-dark); }
.bg-gold     { background-color: var(--gold); }
.border-gold { border-color: var(--gold); }

/* Google Maps embed responsive */
.map-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 0;
}

.map-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* --- Portfolio Cards --------------------------------------- */
.portfolio-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  color: inherit;
}

.portfolio-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.portfolio-card-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--navy-dark);
}

.portfolio-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portfolio-card-body {
  padding: 1.25rem;
}

.portfolio-badge {
  display: inline-block;
  background: rgba(17, 28, 78, 0.08);
  color: var(--navy);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --- Filter Chips ------------------------------------------ */
.filter-chip {
  padding: 0.5rem 1.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: 2px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-chip:hover {
  border-color: var(--navy);
  color: var(--navy);
}

.filter-chip.active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

/* --- Before / After Slider --------------------------------- */
.ba-slider {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3;
  cursor: ew-resize;
  -webkit-user-select: none;
  user-select: none;
  touch-action: pan-y;
}

.ba-slider img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.ba-before-img {
  z-index: 2;
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}

.ba-after-img {
  z-index: 1;
}

.ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  transform: translateX(-50%);
  width: 4px;
  background: white;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.ba-handle-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  color: var(--navy);
  font-size: 0.875rem;
  flex-shrink: 0;
}

.ba-label {
  position: absolute;
  top: 10px;
  z-index: 4;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}

.ba-label-before { left: 10px; }
.ba-label-after { right: 10px; }

.ba-slider-full {
  max-height: 600px;
}

/* --- Process Gallery (horizontal scroll) ------------------- */
.process-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.process-thumb {
  height: 220px;
  width: auto;
  object-fit: cover;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}

.process-thumb:hover { opacity: 0.8; }

/* --- Finished Gallery -------------------------------------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.gallery-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.gallery-thumb:hover { opacity: 0.8; }

/* --- Lightbox ---------------------------------------------- */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  color: white;
  font-size: 2.5rem;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
}
