/* ═══════════════════════════════════════
   MAIN.CSS - Integrity Roofing and Construction
   Global styles: reset, variables, buttons, top bar, nav, footer
═══════════════════════════════════════ */

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

:root {
  --navy: #10094C;           /* Top bar, large section backgrounds, nav links, button hover text */
  --red: #ED1B24;            /* Section headings, button text, button borders */
  --white: #FFFFFF;          /* Main backgrounds, text on navy, button fill */
  --black: #000000;          /* Body text */
  --near-black: #141414;     /* Main H1 */
  --light-gray: #F0F0F0;     /* Small panel backgrounds */
  --page-gray: #EEEEEE;      /* Body background behind the content */
  --warm-dark-gray: #463939; /* Minor text (default button label) */
  --royal-blue: #002970;     /* Button icons */
  --text: #1C1C1C;           /* Body text and lists */

  --font-head: 'Montserrat', Arial, sans-serif; /* Headings, buttons */
  --font-body: 'Lora', Georgia, serif;          /* Body text and lists */
  --font-logo: 'Big Shoulders Display', 'Montserrat', Arial, sans-serif; /* Logo-style display type */

  --container: 1200px;
  --gutter: 2rem;
  --section-pad: 5rem 0;
  --topbar-height: 40px;
  --nav-height: 84px;
  --border: 2px solid var(--navy);
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--white);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

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

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

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

ul { margin: 0; padding: 0; }

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}

h1 {
  font-weight: 800;
  font-size: clamp(1.8rem, 5vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--navy);
  text-wrap: balance;
}

h2 {
  font-size: clamp(1.8rem, 3.6vw, 2.75rem);
  color: var(--red);
  text-wrap: balance;
}
/* Two-tone headings: wrap the second line in .h2-dark to make it black.
   .h2-line keeps a phrase on one line on desktop. */
h2 .h2-dark { color: var(--black); }
@media (min-width: 861px) {
  h2 .h2-line { white-space: nowrap; }
}

h3 {
  font-size: 1.2rem;
  color: var(--navy);
}

strong, b { font-weight: 700; }

.eyebrow {
  display: block;
  font-family: var(--font-head);
  font-size: 1.23rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 0.6rem;
}

.lead {
  font-size: 1.1rem;
  line-height: 1.7;
}

/* ── LAYOUT ── */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

section { padding: var(--section-pad); }

.section-head {
  max-width: 760px;
  margin: 0 auto 2.5rem;
  text-align: center;
}
.section-head p { margin-top: 1rem; font-size: 1.2rem; }

.section-cta {
  margin-top: 2.5rem;
  text-align: center;
}

/* ── BUTTONS ──
   Every button is a solid fill with a 2px border. Hover swaps to another
   solid root color, no opacity and no fades. */
.btn {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  line-height: 1.2;
  background: var(--red);
  color: var(--white);
  border: 2px solid var(--red);
  border-radius: 4px;
  padding: 0.85rem 1.6rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover,
.btn:focus-visible {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

/* White fill, red text and border. Hover text goes navy per the brand sheet. */
.btn-outline {
  background: var(--white);
  color: var(--red);
  border-color: var(--red);
}
.btn-outline:hover,
.btn-outline:focus-visible {
  background: var(--white);
  color: var(--navy);
  border-color: var(--navy);
}

/* For use on navy backgrounds. */
.btn-light {
  background: var(--white);
  color: var(--navy);
  border-color: var(--white);
}
.btn-light:hover,
.btn-light:focus-visible {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}

/* Larger button for a section's main call to action. */
.btn-lg {
  font-size: 1.15rem;
  padding: 1.1rem 2.4rem;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

/* ── TOP BAR ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 220;
  background: var(--navy);
  color: var(--white);
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 600;
  height: var(--topbar-height);
  white-space: nowrap;
  overflow: hidden;
}
.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 100%;
}
.topbar a {
  color: var(--white);
  text-decoration: none;
}
.topbar a:hover { text-decoration: underline; }
.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.topbar svg {
  width: 15px;
  height: 15px;
  stroke: var(--white);
  fill: none;
  stroke-width: 2;
  vertical-align: -2px;
  margin-right: 0.35rem;
}

/* ── NAV ── */
.nav {
  position: sticky;
  top: var(--topbar-height);
  z-index: 200;
  height: var(--nav-height);
  background: var(--white);
  border-bottom: 3px solid var(--navy);
}
.nav-inner {
  position: relative;
  z-index: 205;
  max-width: var(--container);
  height: 100%;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 var(--gutter);
  background: var(--white);
}

.nav-logo {
  position: relative;
  z-index: 201;
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo-img { height: 56px; width: auto; display: block; }

/* ── Links (desktop) ── */
.nav-links {
  flex: 1;
  display: flex;
  align-items: center;
}
.nav-links-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.25rem, 1vw, 0.75rem);
}
.nav-link {
  position: relative;
  display: inline-block;
  color: var(--navy);
  text-decoration: none;
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.5rem 0.65rem;
  transition: color 0.2s;
  white-space: nowrap;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0.65rem; right: 100%;
  bottom: 0;
  height: 3px;
  background: var(--red);
  transition: right 0.25s ease;
}
.nav-link:hover,
.nav-link.active { color: var(--red); }
.nav-link:hover::after,
.nav-link.active::after { right: 0.65rem; }

/* Dropdown */
.nav-item {
  position: relative;
}
/* Desktop: stretch the item to the full nav height so the dropdown opens
   below the nav bar and clears the Contact Us button. */
@media (min-width: 1081px) {
  .nav-links,
  .nav-links-center { align-self: stretch; }
  .nav-item {
    align-self: stretch;
    display: flex;
    align-items: center;
  }
}
.nav-item > .nav-link {
  padding-right: 1.5rem;
}
.nav-item > .nav-link::before {
  content: "";
  position: absolute;
  right: 0.55rem;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
}
.nav-dropdown {
  list-style: none;
  position: absolute;
  top: 100%;
  left: -10px;
  width: 620px;
  background: var(--white);
  border: var(--border);
  border-top: 3px solid var(--red);
  border-radius: 0 0 6px 6px;
  padding: 0.85rem;
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  z-index: 210;
}
.nav-item:hover > .nav-dropdown,
.nav-item:focus-within > .nav-dropdown,
.nav-item.open > .nav-dropdown { display: grid; }
.nav-dropdown a {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  height: 100%;
  padding: 0.85rem 0.95rem;
  border: 2px solid var(--page-gray);
  border-left: 4px solid var(--red);
  border-radius: 4px;
  color: var(--navy);
  text-decoration: none;
}
.nav-dropdown-title {
  font-family: var(--font-head);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
}
.nav-dropdown-desc {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--warm-dark-gray);
}
.nav-dropdown a:hover,
.nav-dropdown a:focus-visible,
.nav-dropdown a.active {
  background: var(--navy);
  border-color: var(--navy);
  border-left-color: var(--red);
  color: var(--white);
}
.nav-dropdown a:hover .nav-dropdown-desc,
.nav-dropdown a:focus-visible .nav-dropdown-desc,
.nav-dropdown a.active .nav-dropdown-desc { color: var(--white); }

.nav-cta {
  flex-shrink: 0;
  background: var(--red);
  color: var(--white);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.7rem 1.4rem;
  border: 2px solid var(--red);
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
  margin-left: 1rem;
  white-space: nowrap;
}
.nav-cta:hover,
.nav-cta:focus-visible {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

/* ── Hamburger ── */
.nav-toggle {
  position: relative;
  z-index: 210;
  display: none;
  width: 46px; height: 46px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  background: var(--white);
  border: 2px solid var(--navy);
  border-radius: 6px;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 3px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ── Mobile nav ── */
@media (max-width: 1080px) {
  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    inset: calc(var(--topbar-height) + var(--nav-height)) 0 auto 0;
    flex: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--white);
    border-bottom: 3px solid var(--navy);
    padding: 0.5rem var(--gutter) 1.4rem;
    transform: translateY(-12px);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.25s ease, visibility 0.25s;
    max-height: calc(100vh - var(--topbar-height) - var(--nav-height));
    overflow-y: auto;
    z-index: 199;
  }
  .nav-links.open {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
  }
  .nav-links-center { display: contents; }

  .nav-link {
    display: block;
    padding: 0.95rem 0.2rem;
    border-bottom: 1px solid var(--page-gray);
    font-size: 1.05rem;
    white-space: normal;
  }
  /* On touch screens a tapped link keeps its hover and focus state, which left
     "Services" red after its submenu was closed. In the mobile menu a link is
     red only for the current page or while its submenu is open. */
  .nav-link:hover,
  .nav-link:focus { color: var(--navy); }
  .nav-link.active,
  .nav-item.open > .nav-link { color: var(--red); }
  .nav-link::after { display: none; }

  .nav-item > .nav-link { padding-right: 2rem; }
  .nav-item > .nav-link::before { right: 0.5rem; }
  .nav-item.open > .nav-link::before { transform: translateY(-30%) rotate(-135deg); }
  .nav-item:hover > .nav-dropdown,
  .nav-item:focus-within > .nav-dropdown { display: none; }
  .nav-item.open > .nav-dropdown { display: grid; }
  .nav-dropdown {
    position: static;
    transform: none;
    width: auto;
    grid-template-columns: 1fr;
    border: 0;
    border-radius: 0;
    background: var(--white);
    margin: 0 0 0.5rem;
    padding: 0.5rem 0;
    gap: 0.5rem;
  }

  .nav-cta {
    margin: 1rem 0 0;
    text-align: center;
    font-size: 1rem;
    padding: 0.9rem 1.5rem;
  }
}

/* ── FOOTER ── */
footer {
  background: var(--navy);
  color: var(--white);
  padding: 4rem 0 2rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.3fr 0.85fr 1.1fr 1.25fr;
  gap: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 2px solid var(--white);
  margin-bottom: 1.5rem;
}
.footer-logo {
  display: inline-block;
  background: var(--white);
  border: 2px solid var(--white);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
}
.footer-logo img { height: 52px; width: auto; }
.footer-tagline {
  font-size: 0.95rem;
  line-height: 1.7;
  max-width: 320px;
  margin-bottom: 1.25rem;
}
.footer-finance {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--white);
  border: 2px solid var(--white);
  border-radius: 4px;
  padding: 0.6rem 0.9rem;
  color: var(--navy);
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 0.2s;
}
.footer-finance:hover,
.footer-finance:focus-visible { border-color: var(--red); color: var(--red); }
.footer-finance img { height: 20px; width: auto; }

.footer-heading {
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--white);
  border-bottom: 2px solid var(--red);
  display: inline-block;
  padding-bottom: 0.35rem;
  margin: 0 0 1.1rem;
}
.footer-nav { list-style: none; }
.footer-nav li { margin-bottom: 0.55rem; }
.footer-nav a {
  color: var(--white);
  text-decoration: none;
  font-size: 0.95rem;
}
.footer-nav a:hover { text-decoration: underline; }

.footer-contact-item {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
  line-height: 1.5;
}
.footer-contact-item a { color: var(--white); text-decoration: none; }
.footer-contact-item a:hover { text-decoration: underline; }
.footer-contact-item svg {
  width: 18px; height: 18px;
  stroke: var(--red);
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
  margin-top: 3px;
}

.footer-hours {
  list-style: none;
  font-size: 0.95rem;
}
.footer-hours li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--white);
}
.footer-hours li:last-child { border-bottom: 0; }
.footer-hours span:first-child { font-family: var(--font-head); font-weight: 600; white-space: nowrap; }
.footer-hours span:last-child { text-align: right; white-space: nowrap; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.6rem;
  font-size: 0.8rem;
  text-align: center;
}
.footer-bottom a {
  color: var(--white);
  text-decoration: underline;
}
.footer-bottom a:hover { color: var(--red); }

/* ── ACCESSIBILITY ── */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--red);
  color: var(--white);
  padding: 0.75rem 1rem;
  z-index: 999;
  font-family: var(--font-head);
  font-weight: 700;
}
.skip-link:focus { left: 1rem; top: 1rem; }

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

/* ══════════════════════
   TABLET (≤ 1100px)
══════════════════════ */
@media (max-width: 1100px) {
  :root { --section-pad: 4.5rem 0; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
}

/* ══════════════════════
   MOBILE (≤ 768px)
══════════════════════ */
@media (max-width: 768px) {
  :root { --section-pad: 3.5rem 0; --gutter: 1.25rem; --nav-height: 72px; }

  /* Paragraphs read left-aligned on phones, even in centred sections. */
  p { text-align: left; }

  .nav-logo-img { height: 46px; }

  .topbar { font-size: 0.9rem; }
  .topbar-right { display: none; }
  .topbar-left { width: 100%; justify-content: center; }

  /* Larger text on phones for readability. */
  body { font-size: 1.0625rem; }
  .btn { font-size: 1.05rem; padding: 0.95rem 1.5rem; }
  .btn-lg { font-size: 1.2rem; }
  .nav-link { font-size: 1.15rem; }
  .nav-dropdown-title { font-size: 1.15rem; }
  .nav-dropdown-desc { font-size: 1rem; }
  .nav-cta { font-size: 1.1rem; }
  .footer-tagline,
  .footer-nav a,
  .footer-contact-item,
  .footer-hours { font-size: 1.05rem; }
  .footer-heading { font-size: 0.95rem; }
  .footer-finance { font-size: 0.95rem; }
  .footer-bottom { font-size: 0.9rem; }

  footer { padding: 3rem 0 1.5rem; }
  .footer-inner { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; gap: 0.3rem; }
  .footer-bottom .sep { display: none; }
}

@media (max-width: 480px) {
  .nav-logo-img { height: 40px; }
  .btn { width: 100%; }
}
