/* MSB Properties & Construction — builtbymsb.com */

:root {
  --brick: #9a4a2e;
  --brick-dark: #7e3a23;
  --charcoal: #333c42;
  --charcoal-deep: #272e33;
  --tan: #c2b091;
  --tan-light: #ded3bc;
  --cream: #faf6ef;
  --white: #ffffff;
  --text: #333c42;
  --text-soft: #55606a;
  --heading-font: "Bitter", Georgia, "Times New Roman", serif;
  --body-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--body-font);
  color: var(--text);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1, h2, h3 { font-family: var(--heading-font); line-height: 1.2; color: var(--charcoal); }

h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin-bottom: 0.5rem; }

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

a { color: var(--brick); }

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

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 700;
  font-family: var(--body-font);
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: 6px;
  padding: 0.7rem 1.4rem;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn--primary {
  background: var(--brick);
  color: var(--white);
}
.btn--primary:hover { background: var(--brick-dark); }

.btn--outline {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}
.btn--outline:hover { background: rgba(255, 255, 255, 0.15); }

.btn--phone {
  background: var(--charcoal);
  color: var(--white);
  padding: 0.55rem 1rem;
  white-space: nowrap;
}
.btn--phone:hover { background: var(--charcoal-deep); }

.btn--messenger {
  background: var(--charcoal);
  color: var(--white);
}
.btn--messenger:hover { background: var(--charcoal-deep); }

/* ---------- Storm banner ---------- */

.storm-banner {
  background: var(--brick);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.5rem 2.5rem 0.5rem 1rem;
  position: relative;
  font-size: 0.95rem;
}

.storm-banner__text { text-align: center; }

.storm-banner__call {
  display: inline-block;
  color: var(--brick);
  background: var(--white);
  font-weight: 700;
  text-decoration: none;
  border-radius: 4px;
  padding: 0.1rem 0.7rem;
  margin-left: 0.5rem;
  white-space: nowrap;
}
.storm-banner__call:hover { background: var(--tan-light); }

.storm-banner__close {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
}
.storm-banner__close:hover { color: var(--tan-light); }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--cream);
  border-bottom: 1px solid var(--tan);
  box-shadow: 0 1px 6px rgba(51, 60, 66, 0.08);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

.site-header__brand { flex-shrink: 0; }

.site-header__logo {
  width: 150px;
  height: auto;
}

.site-nav { margin-left: auto; }

.site-nav__toggle {
  display: none;
  background: none;
  border: none;
  color: var(--charcoal);
  cursor: pointer;
  padding: 0.4rem;
}

.site-nav__menu {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.site-nav__menu a {
  color: var(--charcoal);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
}
.site-nav__menu a:hover { color: var(--brick); }

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

.hero {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

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

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(39, 46, 51, 0.85) 0%,
    rgba(39, 46, 51, 0.65) 55%,
    rgba(39, 46, 51, 0.35) 100%
  );
}

.hero__content {
  position: relative;
  z-index: 1;
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.hero h1 {
  color: var(--white);
  font-size: clamp(1.9rem, 5vw, 3rem);
  max-width: 18ch;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.hero__sub {
  color: var(--tan-light);
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  max-width: 48ch;
  margin: 1rem 0 1.75rem;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ---------- Trust strip ---------- */

.trust-strip {
  background: var(--charcoal);
  color: var(--tan-light);
}

.trust-strip__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 0;
  padding: 0.75rem 0;
  font-weight: 600;
  font-size: 0.95rem;
}

.trust-strip__list li { display: flex; align-items: center; }

.trust-strip__list li + li::before {
  content: "\2022";
  color: var(--brick);
  margin: 0 0.9rem;
  font-size: 1.2rem;
}

/* ---------- Sections ---------- */

.section { padding: 3.5rem 0; }

.section--alt { background: #f1eadd; }

.section__lead {
  color: var(--text-soft);
  max-width: 60ch;
  margin-bottom: 2rem;
}

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

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.service-card {
  background: var(--white);
  border: 1px solid var(--tan-light);
  border-top: 4px solid var(--brick);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.service-card__icon {
  width: 48px;
  height: 48px;
  color: var(--brick);
  margin-bottom: 0.9rem;
}
.service-card__icon svg { width: 100%; height: 100%; }

.service-card h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }

.service-card p { color: var(--text-soft); font-size: 0.97rem; flex-grow: 1; }

.service-card__link {
  margin-top: 1rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--brick);
  font-size: 0.95rem;
}
.service-card__link:hover { text-decoration: underline; }

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

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.gallery__item {
  border: none;
  padding: 0;
  background: var(--tan-light);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
}

.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

/* Portrait shots: keep the subject in the 4:3 crop */
.gallery__item--focus-chimney img { object-position: center 62%; }
.gallery__item--focus-ridge img { object-position: center 42%; }
.gallery__item--focus-deck img { object-position: center 45%; }

.gallery__item:hover img,
.gallery__item:focus-visible img { transform: scale(1.05); }

/* Center a lone tile in the last row on the 3-column layout */
@media (min-width: 901px) {
  .gallery__item:last-child:nth-child(3n + 1) { grid-column: 2; }
}

/* Tablet and below: 2 even columns */
@media (max-width: 900px) {
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
}

/* ---------- Lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  height: 100vh;
  height: 100dvh;
  background: rgba(10, 12, 14, 0.98);
}

.lightbox[hidden] { display: none; }

.lightbox__figure {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3.75rem 1rem 0.75rem;
}

.lightbox__img {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 1200px;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox__meta {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 3.5rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
  text-align: center;
  color: var(--tan-light);
  font-size: 0.92rem;
  line-height: 1.4;
}

.lightbox__counter {
  color: var(--white);
  font-weight: 700;
  white-space: nowrap;
}

.lightbox__close,
.lightbox__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  cursor: pointer;
  z-index: 2;
  transition: background-color 0.15s ease;
}

.lightbox__close:hover,
.lightbox__nav:hover { background: rgba(255, 255, 255, 0.25); }

.lightbox__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__nav--prev { left: 0.75rem; }
.lightbox__nav--next { right: 0.75rem; }

/* On small screens, tuck the arrows into the bottom corners
   next to the caption so they never cover the photo subject */
@media (max-width: 720px) {
  .lightbox__nav {
    top: auto;
    transform: none;
    bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
  }
  .lightbox__figure { padding: 3.75rem 0.75rem 0.5rem; }
  .lightbox__meta {
    align-items: center;
    min-height: 48px;
    padding-top: 0.5rem;
  }
}

/* ---------- About ---------- */

.about {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

.about__text p { margin-bottom: 1rem; }

.about__closing { font-weight: 700; color: var(--brick); }

.about__photo img {
  border-radius: 8px;
  border: 1px solid var(--tan);
}

.about__photo figcaption {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-top: 0.5rem;
}

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

.section--contact {
  background: var(--charcoal);
}

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

.section__lead--contact { color: var(--tan-light); }

.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 2.5rem;
  align-items: start;
}

.contact-aside { color: var(--tan-light); }

.contact-aside h3 {
  color: var(--white);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.contact-aside__phone {
  display: inline-block;
  font-family: var(--heading-font);
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  margin-bottom: 0.75rem;
}
.contact-aside__phone:hover { color: var(--tan); }

.contact-aside p { margin-bottom: 1.25rem; }

.contact-aside .btn--messenger {
  background: var(--brick);
}
.contact-aside .btn--messenger:hover { background: var(--brick-dark); }

.contact-aside__area { font-size: 0.9rem; margin-top: 1.25rem; }

.quote-form {
  background: var(--white);
  border-radius: 8px;
  padding: 1.75rem;
  border-top: 4px solid var(--brick);
}

.quote-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.quote-form__field { margin-bottom: 1rem; }

.quote-form label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.3rem;
  color: var(--charcoal);
}

.req { color: var(--brick); }

.quote-form input,
.quote-form select,
.quote-form textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--cream);
  border: 1px solid var(--tan);
  border-radius: 5px;
  padding: 0.6rem 0.7rem;
}

.quote-form input:focus,
.quote-form select:focus,
.quote-form textarea:focus {
  outline: 3px solid rgba(154, 74, 46, 0.35);
  border-color: var(--brick);
}

.quote-form textarea { resize: vertical; }

.quote-form__submit {
  width: 100%;
  font-size: 1.05rem;
  padding: 0.85rem;
}

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

.site-footer {
  background: var(--charcoal-deep);
  color: var(--tan-light);
  padding: 2.5rem 0 0;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
}

.site-footer__name {
  font-family: var(--heading-font);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.25rem;
}

.site-footer__brand p { font-size: 0.92rem; }

.site-footer__contact {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-start;
}

.site-footer__phone {
  font-family: var(--heading-font);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
}
.site-footer__phone:hover { color: var(--tan); }

.site-footer__contact a { color: var(--tan-light); }
.site-footer__contact a:hover { color: var(--white); }

.site-footer__legal {
  border-top: 1px solid rgba(194, 176, 145, 0.25);
  padding-top: 1rem;
  padding-bottom: 1.25rem;
  font-size: 0.85rem;
}

/* ---------- Floating messenger + mobile bar ---------- */

.float-messenger {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 60;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--brick);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(39, 46, 51, 0.35);
  transition: background-color 0.15s ease;
}
.float-messenger:hover { background: var(--brick-dark); }

.mobile-bar { display: none; }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .about { grid-template-columns: 1fr; }
  .contact-layout { grid-template-columns: 1fr; gap: 2rem; }
}

@media (max-width: 720px) {
  .site-nav__toggle { display: block; }

  .site-nav__menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--tan);
    flex-direction: column;
    gap: 0;
    box-shadow: 0 8px 16px rgba(51, 60, 66, 0.12);
  }

  .site-nav__menu.is-open { display: flex; }

  .site-nav__menu a {
    display: block;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--tan-light);
  }

  .site-header__phone { margin-left: auto; }
  .site-nav { margin-left: 0; order: 3; }
  .site-header__inner { flex-wrap: nowrap; position: relative; }

  .hero { min-height: 440px; }

  .storm-banner { font-size: 0.88rem; text-align: center; }

  .quote-form__row { grid-template-columns: 1fr; gap: 0; }

  /* Sticky bottom call bar replaces the floating bubble */
  .float-messenger { display: none; }

  .mobile-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    box-shadow: 0 -2px 10px rgba(39, 46, 51, 0.25);
  }

  .mobile-bar a {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.85rem 0.5rem;
    padding-bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    color: var(--white);
  }

  .mobile-bar__call { background: var(--brick); flex: 1.4; }
  .mobile-bar__call:hover { background: var(--brick-dark); }
  .mobile-bar__msg { background: var(--charcoal); }
  .mobile-bar__msg:hover { background: var(--charcoal-deep); }

  /* keep the bar from covering content, especially form inputs */
  body { padding-bottom: 64px; }
}

@media (max-width: 420px) {
  .site-header__logo { width: 120px; }
  .btn--phone { font-size: 0.85rem; padding: 0.5rem 0.7rem; }
  .trust-strip__list { font-size: 0.85rem; }
  .trust-strip__list li + li::before { margin: 0 0.5rem; }
}

.services-note {
  margin-top: 1.5rem;
  color: var(--text-soft);
  font-size: 1rem;
}
.services-note a {
  color: var(--brick);
  font-weight: 700;
  text-decoration: none;
}
.services-note a:hover { text-decoration: underline; }
