/* ==========================================================
   Calvert Specialty Contracting — mobile-first stylesheet
   Brand: navy + red pulled from the CSC logo
   ========================================================== */

:root {
  --navy: #0d1b2a;
  --navy-light: #1b2a41;
  --slate: #415a77;
  --red: #c8102e;
  --red-dark: #a30d26;
  --off-white: #f5f7fa;
  --white: #ffffff;
  --text: #22303e;
  --text-light: #5c6b7a;
  --header-h: 64px;
}

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

html {
  scroll-behavior: smooth;
  /* anchor targets land below the sticky header */
  scroll-padding-top: var(--header-h);
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---------- Layout helpers ---------- */

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.container-narrow {
  max-width: 720px;
}

.section {
  padding: 3.5rem 0;
}

.section-alt {
  background: var(--off-white);
}

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

h2 {
  font-size: 1.75rem;
  color: var(--navy);
  text-align: center;
  margin-bottom: 0.75rem;
}

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

.section-intro {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 2rem;
}

.section-dark .section-intro {
  color: #c9d4e0;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s ease;
}

.btn-primary {
  background: var(--red);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--red-dark);
}

.btn-lg {
  font-size: 1.125rem;
  padding: 0.9rem 2rem;
}

.btn-nav {
  background: var(--red);
  color: var(--white);
  padding: 0.5rem 1rem;
}

.btn-nav:hover {
  background: var(--red-dark);
}

/* ---------- Header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #000;
  border-bottom: 3px solid var(--red);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand img {
  width: 160px;
  height: auto;
}

/* Hamburger button */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle-bar {
  display: block;
  height: 3px;
  width: 100%;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Hamburger → X when open */
.nav-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.nav-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile menu: hidden by default, dropdown when open */
.site-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--navy);
  flex-direction: column;
  padding: 0.5rem 1.25rem 1.25rem;
  gap: 0.25rem;
  border-bottom: 3px solid var(--red);
}

.nav-open .site-nav {
  display: flex;
}

.site-nav a {
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.site-nav a.btn-nav {
  border-bottom: none;
  margin-top: 0.75rem;
  text-align: center;
}

/* ---------- Hero ---------- */

.hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-light) 55%, var(--slate) 100%);
  color: var(--white);
  text-align: center;
  padding: 4.5rem 0;
}

.hero h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.tagline {
  font-size: 1.1rem;
  color: #d7dfe8;
  max-width: 560px;
  margin: 0 auto 2rem;
}

.hero-license {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: #aebbc9;
  letter-spacing: 0.03em;
}

/* ---------- Services ---------- */

.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.card {
  background: var(--white);
  border: 1px solid #e3e8ee;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(13, 27, 42, 0.06);
}

.card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.card-body {
  padding: 1.25rem;
}

.card h3 {
  color: var(--navy);
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.card p {
  color: var(--text-light);
  font-size: 0.95rem;
}

.services-note {
  margin-top: 1.75rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-light);
}

/* ---------- Gallery ---------- */

/* auto-fit so the grid stays balanced at any photo count.
   dense packing backfills the gaps left by .wide / .tall tiles. */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  grid-auto-flow: dense;
  gap: 0.75rem;
}

.gallery-grid img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 6px;
}

/* Wide/panorama shots lose over half their width in a square tile.
   Add class="wide" to let one span two columns instead. */
.gallery-grid img.wide {
  grid-column: span 2;
  aspect-ratio: 2 / 1;
}

/* Tall phone photos lose just as much the other way. Add class="tall".
   On a two-column phone grid a row-spanning tile strands an empty
   slot beside it, so go full width here and switch to the row span
   once there are three columns to pack into. */
.gallery-grid img.tall {
  grid-column: 1 / -1;
  aspect-ratio: 3 / 4;
}

/* ---------- Before & After ---------- */

.ba-heading {
  text-align: center;
  color: var(--navy);
  font-size: 1.35rem;
  margin: 3rem 0 1.5rem;
}

.ba-sets {
  display: grid;
  gap: 2rem;
}

.ba-pair {
  margin: 0;
}

/* side by side always — comparison is the whole point */
.ba-shots {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.ba-shot {
  position: relative;
}

.ba-shot img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
}

/* Phone photos come out tall. Forcing those into a 4:3 tile crops away
   most of the shot, so add class="ba-pair ba-pair--portrait" on the
   <figure> when that pair's photos are portrait. */
.ba-pair--portrait .ba-shot img {
  aspect-ratio: 2 / 3;
}

.ba-tag {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--white);
}

.ba-tag-before {
  background: rgba(13, 27, 42, 0.85);
}

.ba-tag-after {
  background: var(--red);
}

.ba-pair figcaption {
  margin-top: 0.6rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-light);
}

/* ---------- FAQ ---------- */

.faq-list {
  display: grid;
  gap: 1.5rem;
}

.faq-item {
  border-left: 4px solid var(--red);
  padding-left: 1rem;
}

.faq-item h3 {
  color: var(--navy);
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}

.faq-item p {
  color: var(--text-light);
}

.faq-item a {
  color: var(--navy);
  font-weight: 600;
}

/* ---------- Contact ---------- */

.contact-content {
  text-align: center;
}

.contact-methods {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 2rem 0;
}

.contact-item {
  display: block;
  background: var(--navy-light);
  border: 1px solid var(--slate);
  border-radius: 8px;
  padding: 1.25rem;
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.contact-item:hover {
  border-color: var(--red);
}

.contact-icon {
  width: 32px;
  height: 32px;
  margin: 0 auto 0.6rem;
  color: var(--red);
}

.contact-item:hover .contact-icon {
  color: var(--white);
}

.contact-label {
  display: block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #aebbc9;
  margin-bottom: 0.25rem;
}

.contact-value {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--white);
  word-break: break-word;
}

.service-area {
  color: #c9d4e0;
  margin-bottom: 1rem;
}

.license-line {
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.03em;
}

/* ---------- Footer ---------- */

.site-footer {
  background: #000;
  color: #9aa7b4;
  text-align: center;
  font-size: 0.875rem;
  padding: 1.75rem 0;
}

.site-footer p + p {
  margin-top: 0.35rem;
}

/* ==========================================================
   Tablet and up
   ========================================================== */

@media (min-width: 700px) {
  h2 {
    font-size: 2rem;
  }

  .hero {
    padding: 6.5rem 0;
  }

  .hero h1 {
    font-size: 2.75rem;
  }

  .tagline {
    font-size: 1.25rem;
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .gallery-grid img.tall {
    grid-column: auto;
    grid-row: span 2;
    aspect-ratio: 1 / 2;
  }

  .ba-sets {
    grid-template-columns: 1fr 1fr;
    gap: 2rem 1.5rem;
  }

  .ba-heading {
    font-size: 1.5rem;
  }

  .contact-methods {
    flex-direction: row;
    justify-content: center;
  }

  .contact-item {
    min-width: 260px;
  }

  /* Desktop nav: inline links, no hamburger */
  .nav-toggle {
    display: none;
  }

  .site-nav {
    display: flex;
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
    background: none;
    padding: 0;
    border-bottom: none;
  }

  .site-nav a {
    padding: 0;
    border-bottom: none;
  }

  .site-nav a:not(.btn-nav):hover {
    color: var(--red);
  }

  .site-nav a.btn-nav {
    margin-top: 0;
  }

  .brand img {
    width: 200px;
  }
}

/* ==========================================================
   Desktop
   ========================================================== */

@media (min-width: 1000px) {
  .card-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
