/* ===== THEME SYSTEM ===== */
/* Dark mode (default) — CSS custom properties */
:root {
  --bg-services: #4c4a46;
  --bg-gallery: #353131;
  --bg-estimates: #353131;
  --bg-contact: #4c4a46;
  --bg-navbar: rgba(33, 37, 41, 0.88);
  --text-services: #ffffff;
  --text-gallery: #ffffff;
  --text-estimates: #ffffff;
  --text-contact: #ffffff;
  --text-navbar: #ffffff;
  --card-bg: #3a3835;
  --card-text: #ffffff;
  --card-border: #555;
  --table-bg: transparent;
  --table-color: #ffffff;
  --table-border: #555;
  --table-stripe: rgba(255,255,255,0.05);
  --form-input-bg: #1a1a1a;
  --form-input-color: #ffffff;
  --form-input-border: #555;
  --form-label-color: #ffffff;
  --body-color: #140000;
  --btn-send-bg: #1e90ff;
  --btn-send-hover: #1570cc;
  --toggle-border: rgba(255,255,255,0.4);
  --toggle-hover-bg: rgba(255,255,255,0.1);
}

/* Light mode overrides */
html.light-mode {
  --bg-services: #e8e4df;
  --bg-gallery: #f4f0eb;
  --bg-estimates: #f4f0eb;
  --bg-contact: #e8e4df;
  --bg-navbar: rgba(248, 249, 250, 0.92);
  --text-services: #1a1a1a;
  --text-gallery: #1a1a1a;
  --text-estimates: #1a1a1a;
  --text-contact: #1a1a1a;
  --text-navbar: #1a1a1a;
  --card-bg: #ffffff;
  --card-text: #1a1a1a;
  --card-border: #ddd;
  --table-bg: transparent;
  --table-color: #1a1a1a;
  --table-border: #ccc;
  --table-stripe: rgba(0,0,0,0.04);
  --form-input-bg: #ffffff;
  --form-input-color: #1a1a1a;
  --form-input-border: #ccc;
  --form-label-color: #1a1a1a;
  --body-color: #f5f5f5;
  --toggle-border: rgba(0,0,0,0.3);
  --toggle-hover-bg: rgba(0,0,0,0.05);
}

/* Body background — match dark theme so no black bars show between sections */
body {
  background-color: #1a1816 !important;
  margin: 0;
}

/* Apply variables to sections */
.services {
  background-color: var(--bg-services);
  color: var(--text-services);
}
.gallery {
  background-color: var(--bg-gallery);
  color: var(--text-gallery);
}
.estimates {
  background-color: var(--bg-estimates);
  color: var(--text-estimates);
}
.contact {
  background-color: var(--bg-contact);
  color: var(--text-contact);
}

/* Navbar — full theme support (semi-transparent so hero shows through) */
.navbar {
  background-color: var(--bg-navbar) !important;
  color: var(--text-navbar) !important;
}
.navbar .navbar-brand,
.navbar .nav-link,
.navbar .navbar-toggler {
  color: var(--text-navbar) !important;
}
/* In light mode, navbar-dark class makes hamburger white on light bg, so invert it */
html.light-mode .navbar-toggler-icon {
  filter: invert(1);
}

/* Mobile collapsed menu styling */
@media (max-width: 991px) {
  .navbar-collapse.show .nav-link,
  .navbar-collapse.collapsing .nav-link {
    color: var(--text-navbar) !important;
    font-size: 17px;
    padding: 8px 0;
  }
}

.navbar .navbar-brand:hover,
.navbar .nav-link:hover {
  opacity: 0.8;
}

/* Cards — equal height, consistent image aspect ratio */
.services .row {
  display: flex;
  align-items: stretch;
}
.services .row .col .card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.services .row .col .card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}
/* Force all service card images to the same aspect ratio (4:3) */
.services .card-img-top {
  height: 225px;
  object-fit: cover;
  object-position: center;
}
.card {
  background-color: var(--card-bg);
  color: var(--card-text);
  border-color: var(--card-border);
}
.card-title,
.card-text {
  color: var(--card-text);
}

/* Capability table — modern card-style layout */
.capability-table-wrapper {
  overflow-x: auto;
  margin: 1rem 0 2rem;
  border-radius: 12px;
  border: 1px solid var(--card-border);
}
.capability-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--table-color);
}
.capability-table thead th {
  background-color: rgba(128,128,128,0.15);
  color: var(--table-color);
  padding: 14px 18px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  text-align: center;
  border-bottom: 2px solid var(--table-border);
}
.capability-table thead th:first-child {
  text-align: left;
  border-radius: 11px 0 0 0;
}
.capability-table thead th:last-child {
  border-radius: 0 11px 0 0;
}
.capability-table tbody td {
  padding: 12px 18px;
  text-align: center;
  border-bottom: 1px solid var(--table-border);
  vertical-align: middle;
}
.capability-table tbody td:first-child {
  text-align: left;
  font-weight: 500;
}
.capability-table tbody tr:last-child td {
  border-bottom: none;
}
.capability-table tbody tr:last-child td:first-child {
  border-radius: 0 0 0 11px;
}
.capability-table tbody tr:last-child td:last-child {
  border-radius: 0 0 11px 0;
}
.capability-table tbody tr:nth-child(even) {
  background-color: var(--table-stripe);
}
.capability-table tbody tr:hover {
  background-color: rgba(128,128,128,0.12);
}
.capability-table td.yes {
  color: #4caf50;
  font-weight: 700;
  font-size: 1.15rem;
}
.capability-table td.no {
  color: var(--table-color);
  opacity: 0.25;
  font-size: 1.15rem;
}

/* Forms */
.contact label {
  color: var(--form-label-color);
}
.contact .form-control {
  background-color: var(--form-input-bg);
  color: var(--form-input-color);
  border-color: var(--form-input-border);
}
.contact .form-control::placeholder {
  color: var(--form-input-color);
  opacity: 0.6;
}
.contact .form-control:focus {
  background-color: var(--form-input-bg);
  color: var(--form-input-color);
}

/* Theme toggle — inside navbar flex flow (NOT fixed) */
#theme-toggle {
  margin-left: auto;
  align-self: center;
  background: transparent;
  border: 2px solid var(--toggle-border);
  color: var(--text-navbar);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  transition: border-color 0.3s, background-color 0.3s, transform 0.15s;
}
#theme-toggle:hover {
  background-color: var(--toggle-hover-bg);
  transform: scale(1.1);
}

/* Headings in sections */
.services h2,
.services h5,
.gallery h2,
.estimates h2,
.estimates h5,
.contact h2,
.contact h4 {
  color: inherit;
}

/* Table text overrides for explicit dark/light */

/* Hero slideshow */
.landing-section {
  position: relative;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.hero-slideshow {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 400px;
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
  z-index: 1;
}

.hero-slide.active {
  opacity: 1;
}

/* Dark overlay so text is readable */
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  z-index: 2;
}

/* Hero text content — centered with flexbox */
.hero-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 3;
}

/* Dots indicator */
.hero-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 4;
}

.hero-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: background 0.3s;
}

.hero-dots .dot.active {
  background: rgba(255, 255, 255, 0.9);
}

/* Section heading margins — replaces <BR> before/after headings */
.services h2,
.gallery h2,
.estimates h2,
.contact h2 {
  margin: 2rem 0 1.5rem;
}

/* Prevent h2 margin collapse from leaking between sections (black bars) */
.services .container,
.gallery .container,
.estimates .container,
.contact .container {
  overflow: hidden;
}

/* Scroll offset for fixed-top navbar — prevents headings from hiding behind nav */
#services,
#gallery,
#estimates,
#contact {
  scroll-margin-top: 96px;
}
/* Fallback for hash navigation */
html {
  scroll-padding-top: 96px;
}

/* Remove Bootstrap container-fluid padding on landing hero so it's truly edge-to-edge */
.landing-section.container-fluid {
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}/* ===== Service sub-pages ===== */
.service-hero {
  position: relative;
  width: 100%;
  height: 50vh;
  min-height: 280px;
  background-size: cover;
  background-position: center;
  margin-top: 96px; /* fixed-top navbar offset */
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.service-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #fff;
  max-width: 700px;
  padding: 0 1rem;
}

.service-hero-content h1 {
  font-size: 2.5rem;
  font-weight: 700;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.6);
  margin-bottom: 0.5rem;
}

.service-hero-content .lead {
  font-size: 1.15rem;
  color: #ddd;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.5);
}

.service-body {
  background-color: var(--bg-services);
  color: var(--text-services);
}

.service-body .container {
  padding: 3rem 1.5rem;
}

.service-body h2 {
  color: var(--text-services);
  margin: 2rem 0 1rem;
}

.service-body h3 {
  color: var(--text-services);
  margin: 1.5rem 0 0.75rem;
}

.service-body p {
  margin-bottom: 1rem;
  line-height: 1.7;
  font-size: 1.05rem;
}

.service-body ul {
  padding-left: 1.25rem;
  margin-bottom: 1.5rem;
}

.service-body ul li {
  margin-bottom: 0.4rem;
  line-height: 1.6;
}

.service-image-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 2rem 0;
}

.service-image-row .card {
  flex: 1 1 280px;
  min-width: 250px;
}

.service-image-row .card img {
  height: 200px;
  object-fit: cover;
  object-position: center;
}

/* Service CTA */
.service-cta {
  background-color: var(--bg-estimates);
  color: var(--text-estimates);
  padding: 3rem 1.5rem;
  text-align: center;
}

.service-cta h2 {
  color: var(--text-estimates);
  margin-bottom: 1rem;
}

.service-cta p {
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}

/* Service-related nav bar */
.service-related-bar {
  background-color: var(--bg-gallery);
  color: var(--text-gallery);
  padding: 1.5rem 0;
}

.service-related-bar h3 {
  color: var(--text-gallery);
  margin-bottom: 1rem;
}

.service-related-link {
  display: inline-block;
  margin: 0.25rem;
  padding: 0.4rem 1rem;
  border: 1px solid var(--card-border);
  border-radius: 6px;
  color: var(--card-text);
  text-decoration: none;
  transition: background-color 0.2s, border-color 0.2s;
  font-size: 0.9rem;
}

.service-related-link:hover {
  background-color: rgba(128,128,128,0.15);
  border-color: #888;
  color: var(--card-text);
}

/* ===== Service card hover animation (Fix #2) ===== */
.services .col-md-6.col-lg-4 > a {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.services .col-md-6.col-lg-4 > a:hover {
  transform: translateY(-6px);
}
.services .col-md-6.col-lg-4 > a:hover .card {
  box-shadow: 0 12px 32px rgba(0,0,0,0.35);
}

/* ===== Service tile vertical spacing (Fix #3) ===== */
.services .row .col-md-6.col-lg-4 {
  margin-bottom: 1.5rem;
}

/* ===== Estimates section bottom padding (Fix #5) ===== */
.estimates {
  padding-bottom: 2.5rem;
}

/* ===== Footer ===== */
.site-footer {
  background-color: #1a1816;
  color: #cccccc;
  padding: 3rem 0 1.5rem;
  border-top: 1px solid #333;
}
.site-footer h5 {
  color: #ffffff;
  margin-bottom: 1rem;
}
.site-footer p {
  line-height: 1.7;
}
.site-footer a {
  color: #1e90ff;
  text-decoration: none;
}
.site-footer a:hover {
  color: #4db8ff;
  text-decoration: underline;
}
.footer-links {
  list-style: none;
  padding: 0;
}
.footer-links li {
  margin-bottom: 0.5rem;
}
.footer-bottom {
  border-top: 1px solid #333;
  margin-top: 2rem;
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: #888;
}

/* ===== Navbar CTA button ===== */
.btn-quote-nav {
  background: #1e90ff;
  color: #fff !important;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  transition: background 0.3s, transform 0.15s;
}
.btn-quote-nav:hover {
  background: #1570cc;
  transform: scale(1.05);
  color: #fff !important;
}

/* Light mode footer overrides */
html.light-mode .site-footer {
  background-color: #212529;
}

/* ===== Mobile responsive fixes ===== */

/* Logo: scale down on mobile so it doesn't dominate the navbar */
@media (max-width: 991px) {
  .navbar-brand img {
    max-width: 180px !important;
    height: auto !important;
  }
  .btn-quote-nav {
    font-size: 11px !important;
    padding: 4px 10px !important;
    margin-right: 4px !important;
  }
  #theme-toggle {
    padding: 4px 8px !important;
    font-size: 1rem !important;
  }
  /* Give navbar more vertical room on mobile */
  .navbar-collapse {
    padding-top: 0.5rem;
  }
  /* Navbar brand/logo link: flex layout so items don't overlap */
  .navbar .navbar-brand {
    flex-shrink: 0;
  }
}

/* Even smaller screens (phones in portrait) */
@media (max-width: 576px) {
  .navbar-brand img {
    max-width: 140px !important;
    height: auto !important;
  }
  .btn-quote-nav {
    font-size: 10px !important;
    padding: 3px 8px !important;
    margin-right: 3px !important;
  }
  /* Make hero text smaller on very narrow screens */
  .hero-content h1.display-4 {
    font-size: 1.8rem !important;
    padding: 0 1rem;
  }
  .hero-content .lead {
    font-size: 1rem !important;
    padding: 0 1rem;
  }
  .hero-content .btn {
    font-size: 0.9rem !important;
    padding: 8px 20px !important;
  }
}
