/* =========================
   GLOBAL STYLES
========================= */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", sans-serif;
  line-height: 1.6;
  color: #222;
  background-color: #f8f8f8;
  overflow-x: hidden;
}

/* =========================
   MEDIA
========================= */

img,
picture {
  max-width: 100%;
  display: block;
}

/* =========================
   CONTAINER
========================= */

.container {
  width: min(92%, 1200px);
  margin: 0 auto;
  padding: 4rem 0;
}

/* =========================
   TYPOGRAPHY
========================= */

h1,
h2,
h3 {
  font-family: "Figtree", sans-serif;
  font-weight: 700;
  color: #111;
  line-height: 1.2;
}

h1 {
  font-size: 1.1rem;
}

h2 {
  font-size: clamp(2rem, 4vw, 2.6rem);
  margin-bottom: 2rem;
  text-align: center;
}

h3 {
  font-size: 1.3rem;
}

p {
  margin-bottom: 1rem;
  color: #444;
}

ul {
  padding-left: 1.25rem;
}

/* =========================
   LINKS
========================= */

a {
  text-decoration: none;
  color: inherit;
}

/* =========================
   HEADER
========================= */

header {
  background-color: rgba(17, 17, 17, 0.96);
  backdrop-filter: blur(6px);

  color: white;

  position: fixed;
  top: 0;
  left: 0;

  width: 100%;

  z-index: 1000;

  transition:
    transform 0.35s ease,
    background-color 0.3s ease;
}

header.hide-header {
  transform: translateY(-100%);
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;

  gap: 1rem;

  padding: 0.9rem 1rem;
}

.logo-link {
  flex-shrink: 0;
}

header h1 {
  color: white;
  font-size: 1rem;
  line-height: 1.3;
  max-width: 350px;
}

/* =========================
   NAVIGATION
========================= */

nav ul {
  display: flex;
  align-items: center;
  justify-content: center;

  flex-wrap: wrap;

  gap: 0.8rem;

  list-style: none;
  padding-left: 0;
}

nav a {
  color: white;

  font-size: 0.92rem;
  font-weight: 500;

  padding: 0.45rem 0.7rem;

  border-radius: 6px;

  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

nav a:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #d62828;
}

/* =========================
   HERO SECTION
========================= */

#hero {
  background:
    linear-gradient(
      rgba(0, 0, 0, 0.55),
      rgba(0, 0, 0, 0.55)
    ),
    url("images/hero.jpeg") center/cover no-repeat;

  min-height: 90vh;

  display: flex;
  align-items: center;
  justify-content: center;

  text-align: center;

  padding:
    8rem
    1.5rem
    4rem;
}

.hero-content {
  max-width: 760px;
  color: white;
}

.hero-content h2 {
  color: white;
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  margin-bottom: 1rem;
}

.hero-content p {
  color: #f0f0f0;
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

/* =========================
   BUTTONS
========================= */

.btn,
.service-btn,
.fs-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 12px 24px;

  background-color: #b22222;
  color: white;

  border: none;
  border-radius: 8px;

  font-size: 0.95rem;
  font-weight: 600;

  cursor: pointer;

  transition:
    background-color 0.3s ease,
    transform 0.2s ease;
}

.btn:hover,
.service-btn:hover,
.fs-button:hover {
  background-color: #8b1a1a;
  transform: translateY(-2px);
}

/* =========================
   SERVICES SECTION
========================= */

.services {
  display: grid;

  grid-template-columns:
    repeat(auto-fit, minmax(280px, 1fr));

  gap: 2rem;
}

.service {
  background: white;

  border-radius: 14px;

  overflow: hidden;

  display: flex;
  flex-direction: column;

  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.08);

  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.service:hover {
  transform: translateY(-5px);

  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.12);
}

.service img {
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.service h3 {
  padding: 1.25rem 1.25rem 0.5rem;
}

.service p {
  padding: 0 1.25rem 1.25rem;
  flex-grow: 1;
}

.service-btn {
  margin:
    0
    1.25rem
    1.5rem;
}

/* =========================
   ABOUT SECTION
========================= */

#about {
  text-align: center;
}

#about img {
  width: 100%;
  max-width: 420px;
  height: auto;

  margin:
    0 auto
    2rem;

  border-radius: 14px;

  object-fit: contain;

  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.08);
}

.about-content {
  max-width: 850px;
  margin: 0 auto;
}

/* =========================
   CONTACT SECTION
========================= */

#contact {
  max-width: 1000px;
}

/* =========================
   FORM
========================= */

form {
  background: white;

  padding: 2rem;

  border-radius: 16px;

  max-width: 900px;

  margin: 0 auto;

  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.08);
}

/* =========================
   FORM GRID
========================= */

.fs-layout__2-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

/* =========================
   FIELDSETS
========================= */

fieldset {
  border: 1px solid #e5e5e5;

  border-radius: 12px;

  padding: 1.2rem;

  background: #fafafa;

  min-width: 0;
}

legend {
  padding: 0 0.35rem;

  font-size: 1rem;
  font-weight: 600;

  color: #111;
}

/* FULL WIDTH */

.fs-layout__2-column fieldset:nth-child(4),
.fs-layout__2-column fieldset:nth-child(5),
.fs-button-group {
  grid-column: 1 / -1;
}

/* =========================
   FIELD GROUPS
========================= */

.fs-field {
  width: 100%;
  min-width: 0;
}

.fs-label {
  display: block;

  margin-bottom: 0.4rem;

  font-size: 0.92rem;
  font-weight: 500;

  color: #222;
}

/* =========================
   ADDRESS GRID
========================= */

fieldset:nth-child(2) {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 1rem;
}

fieldset:nth-child(2) legend,
fieldset:nth-child(2) .fs-field:first-of-type {
  grid-column: 1 / -1;
}

/* =========================
   CONTACT GRID
========================= */

fieldset:nth-child(3) {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 1rem;
}

fieldset:nth-child(3) legend {
  grid-column: 1 / -1;
}

/* =========================
   SERVICES GRID
========================= */

fieldset:nth-child(5) {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 1rem;
}

fieldset:nth-child(5) legend {
  grid-column: 1 / -1;
}

fieldset:nth-child(5) .fs-field:last-child {
  grid-column: 1 / -1;
}

/* =========================
   INPUTS
========================= */

.fs-input,
.fs-select,
.fs-textarea {
  width: 100%;
  min-width: 0;

  padding: 12px 14px;

  border: 1px solid #ccc;
  border-radius: 8px;

  background: white;

  font-size: 0.95rem;
  font-family: inherit;

  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease;
}

.fs-input:focus,
.fs-select:focus,
.fs-textarea:focus {
  outline: none;

  border-color: #b22222;

  box-shadow:
    0 0 0 3px rgba(178, 34, 34, 0.12);
}

.fs-textarea {
  min-height: 140px;
  resize: vertical;
}

/* =========================
   BUTTON GROUP
========================= */

.fs-button-group {
  text-align: center;
  margin-top: 1rem;
}

/* =========================
   CONTACT CTA
========================= */

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

.contact-options {
  display: none;

  margin-top: 1.5rem;

  justify-content: center;
  align-items: center;

  flex-wrap: wrap;

  gap: 1rem;
}

.contact-options.show {
  display: flex;
}

/* =========================
   FOOTER
========================= */

footer {
  background-color: #111;
  color: white;

  text-align: center;

  padding: 3rem 1rem;
}

footer nav ul {
  margin-bottom: 1.5rem;
}

footer p {
  margin-bottom: 1rem;
  color: #ddd;
}

footer a {
  color: white;
}

footer a:hover {
  color: #d62828;
}

/* =========================
   SERVICE PAGE HEROES
========================= */

.service-page-hero,
.intermediate-service-hero,
.replacement-service-hero {
  min-height: 60vh;

  display: flex;
  align-items: center;
  justify-content: center;

  text-align: center;
}

.service-page-hero {
  background:
    linear-gradient(
      rgba(0, 0, 0, 0.55),
      rgba(0, 0, 0, 0.55)
    ),
    url("images/basic-repair.jpeg")
    center/cover no-repeat;
}

.intermediate-service-hero {
  background:
    linear-gradient(
      rgba(0, 0, 0, 0.55),
      rgba(0, 0, 0, 0.55)
    ),
    url("images/intermediate-solutions.jpeg")
    center/cover no-repeat;
}

.replacement-service-hero {
  background:
    linear-gradient(
      rgba(0, 0, 0, 0.55),
      rgba(0, 0, 0, 0.55)
    ),
    url("images/roof-replacement.jpeg")
    center/cover no-repeat;
}

.hero-overlay {
  width: 100%;
  padding: 4rem 1rem;
}

.service-page-hero h2,
.intermediate-service-hero h2,
.replacement-service-hero h2 {
  color: white;
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 1rem;
}

.service-page-hero p,
.intermediate-service-hero p,
.replacement-service-hero p {
  color: white;

  font-size: 1.1rem;

  max-width: 760px;

  margin: 0 auto;
}

.service-page-content {
  max-width: 900px;
}

/* UPDATED MAIN SERVICE PAGE IMAGE */

.service-page-image {
  width: 100%;
  max-width: 550px;

  height: auto;

  display: block;

  margin: 0 auto 2rem;

  border-radius: 14px;

  object-fit: cover;

  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.12);
}

.service-list {
  margin:
    1.5rem
    0
    2rem
    1.5rem;
}

.service-list li {
  margin-bottom: 0.75rem;
}

.service-cta {
  margin-top: 3rem;

  padding: 2rem;

  background: white;

  border-radius: 14px;

  text-align: center;

  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.08);
}

/* =========================
   TABLET
========================= */

@media (max-width: 768px) {

  header .container {
    flex-direction: column;
    gap: 0.75rem;
  }

  header h1 {
    text-align: center;
    max-width: 100%;
  }

  .hero-content h2 {
    font-size: 2.5rem;
  }

  .service img {
    height: 210px;
  }

  .fs-layout__2-column {
    grid-template-columns: 1fr;
  }

  fieldset:nth-child(2),
  fieldset:nth-child(3),
  fieldset:nth-child(5) {
    grid-template-columns: 1fr;
  }

  fieldset:nth-child(5) .fs-field:last-child {
    grid-column: auto;
  }

  form {
    padding: 1.5rem;
  }

  fieldset {
    padding: 1rem;
  }

  .service-page-image {
    max-width: 100%;
  }
}

/* =========================
   MOBILE
========================= */

@media (max-width: 480px) {

  .container {
    width: 94%;
  }

  nav ul {
    gap: 0.45rem;
  }

  nav a {
    font-size: 0.82rem;
    padding: 0.35rem 0.5rem;
  }

  .hero-content h2 {
    font-size: 2rem;
  }

  .hero-content p {
    font-size: 1rem;
  }

  .btn,
  .service-btn,
  .fs-button {
    width: 100%;
  }

  form {
    padding: 1rem;
  }

  .service img {
    height: 190px;
  }
}
