/* ============================================================
   Swope Investments — shared stylesheet
   ============================================================ */
:root {
  --navy: #1e3a8a;
  --navy-2: #274ec5;
  --ink: #222;
  --bg: #fafafa;
}

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

body {
  font-family: "Montserrat", sans-serif;
  color: var(--ink);
  background-color: var(--bg);
  overflow-x: hidden;
}

/* ---------- ACCESSIBILITY ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  background: var(--navy);
  color: #fff;
  padding: 0.7rem 1.2rem;
  border-radius: 0 0 8px 0;
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.gallery img:focus-visible,
.siteplan img:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 2px;
}
#main:focus { outline: none; }

/* ---------- HEADER ---------- */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.2rem 1.5rem;
  background: rgba(255, 255, 255, 0.95);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(6px);
  height: 60px;
}

.logo {
  background: white;
  border-radius: 20px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
  padding: 18px 20px 6px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo img {
  height: 90px;
  width: auto;
  border-radius: 14px;
  transition: transform 0.3s, filter 0.3s;
}

@media (hover: hover) and (pointer: fine) {
  .logo:hover img { transform: scale(1.05); filter: brightness(1.05); }
}

/* Hamburger toggle — hidden on desktop, shown on mobile */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 9px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--navy);
  border-radius: 2px;
}

nav ul { list-style: none; display: flex; gap: 1.2rem; align-items: center; }

nav a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.95rem;
  transition: 0.3s;
  position: relative;
}

nav a::after {
  content: "";
  position: absolute;
  width: 0%;
  height: 2px;
  bottom: -4px;
  left: 0;
  background: var(--navy);
  transition: 0.3s;
}

@media (hover: hover) and (pointer: fine) {
  nav a:hover { color: var(--navy); transform: scale(1.05); }
  nav a:hover::after { width: 100%; }
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  height: 70vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
  overflow: hidden;
}

.hero.hero-short { height: 45vh; }

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.25) 25%, rgba(0,0,0,0.65) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 3;
  color: #fff;
  padding: 2rem 2.5rem;
  max-width: 900px;
  opacity: 0;
  animation: fadeInUp 1s ease-out forwards;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-content h1 {
  font-size: 3.2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  line-height: 1.15;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6), 0 4px 10px rgba(0,0,0,0.5);
}

.hero-content p {
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.4px;
  margin-bottom: 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 0 2px 6px rgba(0,0,0,0.8);
}

/* ---------- BUTTONS ---------- */
.btn-primary,
.bio-btn,
.back-btn,
.download-btn,
form button {
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  color: #fff;
  padding: 0.9rem 1.8rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-family: inherit;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  display: inline-block;
  transition: transform 0.4s, box-shadow 0.4s;
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover,
  .bio-btn:hover,
  .back-btn:hover,
  .download-btn:hover,
  form button:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 20px rgba(30, 58, 138, 0.4);
  }
}

.back-btn { margin-top: 2rem; padding: 0.6rem 1.4rem; font-size: 0.9rem; }
.bio-btn { padding: 0.6rem 1.3rem; }

/* ---------- SECTIONS ---------- */
section { padding: 5rem 10%; }

.section-title {
  text-align: center;
  font-size: 2.2rem;
  margin-bottom: 3rem;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ---------- HOME: SERVICES ---------- */
.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2.5rem;
  text-align: center;
}

.service {
  background: white;
  padding: 2.5rem;
  border-radius: 12px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.06);
  transition: opacity 0.9s ease-out, transform 0.9s ease-out;
  opacity: 0;
  transform: translateY(40px);
}

.service.visible { opacity: 1; transform: translateY(0); }
.service h3 { color: var(--navy); margin-bottom: 1rem; font-size: 1.3rem; }

.about-link-container {
  text-align: center;
  margin-top: 3.5rem;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s ease-out, transform 0.9s ease-out;
}
.about-link-container.visible { opacity: 1; transform: translateY(0); }

#contact-cta {
  background: linear-gradient(180deg, #f8f9ff, #eef2ff);
  text-align: center;
  padding: 6rem 10%;
  border-top: 2px solid #d6e0ff;
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 1s ease-out, transform 1s ease-out;
}
#contact-cta.visible { opacity: 1; transform: translateY(0); }
#contact-cta h2 {
  color: var(--navy);
  font-size: 2.4rem;
  margin-bottom: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}
#contact-cta p {
  color: #444;
  font-size: 1.1rem;
  margin-bottom: 2rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

/* ---------- ABOUT ---------- */
.about-content {
  max-width: 900px;
  margin: 0 auto 4rem;
  font-size: 1.1rem;
  line-height: 1.7;
  color: #333;
  background: white;
  padding: 2rem 2.5rem;
  border-radius: 12px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s ease-out, transform 1s ease-out;
}
.about-content.visible { opacity: 1; transform: translateY(0); }
.about-content p + p { margin-top: 1.2rem; }

.team {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 1rem;
  text-align: center;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s ease-out, transform 1s ease-out;
}
.team.visible { opacity: 1; transform: translateY(0); }

.team-member {
  background: #fff;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s, box-shadow 0.3s;
}
@media (hover: hover) and (pointer: fine) {
  .team-member:hover { transform: translateY(-6px); box-shadow: 0 10px 18px rgba(0,0,0,0.15); }
}
.team-member img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
}
.team-member h3 { color: var(--navy); margin-bottom: 0.5rem; }
.team-member p { font-size: 0.95rem; color: #555; margin-bottom: 1rem; }

.bio-popup {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  justify-content: center;
  align-items: center;
  z-index: 2000;
}
.bio-content {
  background: #fff;
  padding: 2rem 2.5rem;
  max-width: 600px;
  margin: 1rem;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}
.bio-content h2 { color: var(--navy); margin-bottom: 1rem; }
.bio-content img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
}
.close-btn { float: right; font-size: 1.8rem; cursor: pointer; color: #333; background: none; border: none; line-height: 1; padding: 0; font-family: inherit; }

/* ---------- PROJECTS ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.project-card {
  position: relative;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
@media (hover: hover) and (pointer: fine) {
  .project-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(30,58,138,0.25); }
}
.project-card img { width: 100%; height: 240px; object-fit: cover; display: block; }
.project-card .content { padding: 1.5rem; }
.project-card h3 { color: var(--navy); margin-bottom: 0.5rem; }
.project-card .btn-primary { margin-top: 1rem; padding: 0.6rem 1.2rem; font-size: 0.9rem; }

/* Completed projects shown as static info cards (no detail page) */
.project-card.completed-static { cursor: default; }
@media (hover: hover) and (pointer: fine) {
  .project-card.completed-static:hover {
    transform: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }
}
.badge-completed {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  background: rgba(30, 58, 138, 0.92);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
}

#map {
  height: 500px;
  border-radius: 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  margin-top: 3rem;
  /* Contain Leaflet's internal layers (z-index up to 1000) in their own
     stacking context so the map scrolls UNDER the sticky header (z-index 10)
     instead of over the nav bar. */
  position: relative;
  z-index: 0;
}

/* ---------- PROJECT DETAIL PAGES ---------- */
.detail-content {
  max-width: 900px;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.75;
  color: #333;
  background: white;
  padding: 2rem 2.5rem;
  border-radius: 12px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
}
.detail-content p + p { margin-top: 1.2rem; }
.detail-content ul { margin-left: 1.4rem; line-height: 2; }
.detail-content + .section-title { margin-top: 4rem; }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}
.gallery img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transition: transform 0.3s;
  display: block;
}
@media (hover: hover) and (pointer: fine) {
  .gallery img:hover { transform: scale(1.03); }
}
.gallery img { cursor: zoom-in; }

/* ---------- LIGHTBOX (fullscreen gallery) ---------- */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 3000;
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
  padding: 2rem;
}
.lightbox-overlay.open { display: flex; }
.lightbox-overlay img {
  max-width: 95vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  cursor: zoom-in;
  transform-origin: center center;
  transition: transform 0.18s ease-out;
  will-change: transform;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}
.lightbox-overlay img.panning { transition: none; }
.lightbox-overlay:not(.zoomed) img { animation: lightboxIn 0.25s ease-out; }
@keyframes lightboxIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
.lightbox-hint {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.45);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  pointer-events: none;
  z-index: 3001;
}
.lightbox-close {
  position: fixed;
  top: 18px;
  right: 26px;
  font-size: 2.6rem;
  line-height: 1;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  z-index: 3001;
}

/* ---------- SINGLE SITE PLAN (full image, uncropped) ---------- */
.siteplan { max-width: 1000px; margin: 0 auto; text-align: center; }
.siteplan img {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  cursor: zoom-in;
  display: inline-block;
  transition: transform 0.3s;
}
@media (hover: hover) and (pointer: fine) {
  .siteplan img:hover { transform: scale(1.02); }
}

.pdf-showcase { max-width: 900px; margin: 0 auto; text-align: center; }

/* Clickable brochure cover (first page of the PDF) */
.brochure-cover {
  display: inline-block;
  position: relative;
  max-width: 420px;
  width: 100%;
  margin: 0 auto 1.5rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s, box-shadow 0.3s;
}
.brochure-cover img {
  display: block;
  width: 100%;
  height: auto;
}
@media (hover: hover) and (pointer: fine) {
  .brochure-cover:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
  }
}
.brochure-cover-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.7rem 1rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0));
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
}
.brochure-cover:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 2px;
}

.pdf-viewer {
  width: 100%;
  height: 620px;
  border: none;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  margin-bottom: 1.5rem;
}

.back-row { text-align: center; }

/* ---------- CONTACT ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
}

.contact-box {
  background: white;
  padding: 2.5rem;
  border-radius: 14px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}
.contact-box h3 { color: var(--navy); font-size: 1.3rem; margin-bottom: 1rem; }
.contact-box p { color: #444; line-height: 1.7; margin-bottom: 0.5rem; }
.contact-box a { color: var(--navy); font-weight: 600; text-decoration: none; }
@media (hover: hover) and (pointer: fine) {
  .contact-box a:hover { text-decoration: underline; }
}
.contact-box .btn-primary { margin: 0.4rem 0.2rem; color: #fff; white-space: nowrap; }
@media (hover: hover) and (pointer: fine) {
  .contact-box a.btn-primary:hover { text-decoration: none; }
}

form { display: flex; flex-direction: column; gap: 1rem; }
input, textarea {
  padding: 0.8rem 1rem;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-family: "Montserrat", sans-serif;
  font-size: 1rem;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 6px rgba(30, 58, 138, 0.2);
}

/* ---------- FOOTER ---------- */
footer {
  background: var(--navy);
  color: white;
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.95rem;
}

/* ---------- TABLET ---------- */
@media (max-width: 1024px) and (min-width: 769px) {
  section { padding: 4rem 5%; }
  #contact-cta { padding: 5rem 5%; }
  .hero-content h1 { font-size: 2.6rem; }
}

/* ---------- MOBILE ---------- */
@media (max-width: 768px) {
  header { flex-wrap: wrap; height: auto; padding: 0.4rem 1rem; }
  .logo { padding: 12px 14px 6px; }
  .logo img { height: 56px; }

  .nav-toggle { display: flex; }

  nav#primary-nav { order: 3; flex-basis: 100%; }
  nav#primary-nav ul {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    padding: 0.4rem 0 0.6rem;
  }
  nav#primary-nav.open ul { display: flex; }
  nav#primary-nav li { width: 100%; text-align: center; }
  nav#primary-nav a { display: block; padding: 0.75rem 0; font-size: 1rem; }
  nav#primary-nav a::after { display: none; }

  .hero { min-height: 60vh; height: auto; background-attachment: scroll; }
  .hero.hero-short { min-height: 40vh; height: auto; }
  .hero-content { padding: 2rem 1.25rem; }
  .hero-content h1 { font-size: 1.7rem; letter-spacing: 1px; }
  .hero-content p { font-size: 1.05rem; margin-bottom: 1.5rem; }

  section { padding: 3rem 7%; }
  .services { grid-template-columns: 1fr; }
  .service { padding: 1.8rem; }

  #contact-cta { padding: 4rem 7%; }
  #contact-cta h2 { font-size: 1.8rem; }
  #contact-cta p { font-size: 1rem; line-height: 1.6; }

  .pdf-viewer { height: 50vh; }

  /* Keep long words/links from forcing horizontal scroll on small screens */
  .detail-content, .about-content, .contact-box { overflow-wrap: break-word; }
}

/* ---------- REDUCED MOTION / NO-JS SAFETY ----------
   If the visitor prefers reduced motion, show reveal content immediately
   instead of relying on the scroll animation. */
@media (prefers-reduced-motion: reduce) {
  .service,
  .about-link-container,
  #contact-cta,
  .about-content,
  .team {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
