/*
  MUJAHED SOLID FOUNDATIONS LTD
  Construction Website Styles (Responsive, Clean, Modern)
  - Uses CSS variables for palette
  - Sticky navigation & smooth scrolling
  - Flexbox & Grid for layout
  - Mobile-first responsive media queries
*/

:root {
  --color-bg: #0b0b0d;
  --color-text: #f5f7fa;
  --color-muted: #cdd3df;
  --color-primary: #f7c600; /* Yellow */
  --color-primary-dark: #d6aa00;
  --color-accent: #111113; /* Deep black */
  --color-card: #141419;

  --max-width: 1100px;
  --radius: 12px;
  --shadow: 0 10px 25px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

img { max-width: 100%; display: block; }
.container { width: 90%; max-width: var(--max-width); margin: 0 auto; }
.section { padding: 80px 0; }
.section-alt { background: #0e0e12; }
.section-header { text-align: center; margin-bottom: 32px; }
.section-header h2 {
  font-family: "Montserrat", sans-serif;
  font-size: clamp(1.75rem, 2.5vw, 2.2rem);
  margin: 0 0 8px;
}
.section-header p { color: var(--color-muted); margin: 0; }

/* Header / Nav */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(17,17,19,0.8);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(247, 198, 0, 0.2);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}
.nav .logo { white-space: nowrap; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--color-text); text-decoration: none; }
.logo-mark {
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  background: var(--color-primary);
  color: #111;
  font-weight: 800;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.logo-text { font-weight: 700; letter-spacing: 0.2px; }

.nav-links { display: flex; gap: 18px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--color-text); text-decoration: none; font-weight: 600; display: block; padding: 8px 0; }
.nav-links a:hover, .nav-links a:focus { color: var(--color-primary); outline: none; }

/* Focus styles for accessibility */
a:focus, button:focus, input:focus, textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.nav-toggle {
  display: none;
  width: 44px; height: 44px; /* Larger touch target */
  background: transparent; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px; cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.nav-toggle .bar { display: block; width: 22px; height: 2px; background: #fff; margin: 4px auto; }

/* Hamburger animation */
.nav-toggle .bar:nth-child(2) { transition: opacity 0.3s ease; }
.nav-toggle.open .bar:nth-child(2) { opacity: 0; }
.nav-toggle .bar:nth-child(1) { transition: transform 0.3s ease; }
.nav-toggle.open .bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle .bar:nth-child(3) { transition: transform 0.3s ease; }
.nav-toggle.open .bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Hero */
.hero {
  position: relative;
  min-height: 68vh;
  display: grid;
  place-items: center;
  /* Construction-themed background from Unsplash: cranes and structure */
  background: url('https://images.unsplash.com/photo-1581091215367-59ab5f00d147?q=80&w=1920&auto=format&fit=crop') center/cover no-repeat;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.55), rgba(0,0,0,0.75));
}
.hero-content { position: relative; text-align: center; }
.hero-title {
  font-family: "Montserrat", sans-serif; font-weight: 800;
  font-size: clamp(2rem, 4vw, 3.5rem);
  margin: 0 0 12px;
}
.hero-subtitle { color: var(--color-muted); max-width: 780px; margin: 0 auto 22px; }
.hero-ctas { display: inline-flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* Improved mobile navigation */
.nav-toggle:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Buttons */
.btn { display: inline-block; padding: 12px 18px; border-radius: 10px; text-decoration: none; font-weight: 700; transition: transform 0.2s ease, box-shadow 0.2s ease; text-align: center; }

/* Touch target size for mobile */
@media (max-width: 576px) {
  .btn {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
.btn-primary { background: var(--color-primary); color: #111; box-shadow: var(--shadow); }
.btn-primary:hover { transform: translateY(-2px); background: var(--color-primary-dark); }
.btn-outline { border: 2px solid var(--color-primary); color: var(--color-text); }
.btn-outline:hover { transform: translateY(-2px); background: rgba(247, 198, 0, 0.1); }

/* About */
.about-grid {
  display: grid; gap: 24px;
  grid-template-columns: 1.3fr 1fr;
}
.about-text p { color: var(--color-muted); }
.about-columns { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; margin-top: 18px; }
.about-columns h3 { margin: 0 0 8px; font-family: "Montserrat"; }
.about-highlights { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.about-highlights li { display: flex; gap: 12px; background: var(--color-card); padding: 14px; border-radius: var(--radius); }
.highlight-icon { font-size: 1.4rem; }

/* Services */
.services-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(3, 1fr);
}
.service-card { background: var(--color-card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform 0.2s ease, box-shadow 0.2s ease; display: flex; flex-direction: column; }
.service-card img { width: 100%; height: 180px; object-fit: cover; }
.service-card h3 { margin: 12px 12px 0; font-family: "Montserrat"; }
.service-card p { margin: 8px 12px 16px; color: var(--color-muted); flex-grow: 1; }
.service-card:hover { transform: translateY(-6px); box-shadow: 0 18px 30px rgba(0,0,0,0.45); }

/* Equal height cards */
.service-card { height: 100%; }

/* Gallery */
.gallery-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(3, 1fr);
}
.gallery-item { border-radius: var(--radius); overflow: hidden; position: relative; }
.gallery-item img { width: 100%; height: 240px; object-fit: cover; filter: saturate(1.1) contrast(1.05); transition: transform 0.4s ease; }
.gallery-item::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,0.15); transition: background 0.3s ease; }
.gallery-item:hover img { transform: scale(1.05); }
.gallery-item:hover::after { background: rgba(0,0,0,0.05); }

/* Why */
.why-grid { display: grid; gap: 18px; grid-template-columns: repeat(5, 1fr); }
.why-card { background: var(--color-card); padding: 18px; border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; }
.why-icon { font-size: 1.6rem; display: inline-block; margin-bottom: 8px; }

/* Contact */
.contact-grid { display: grid; gap: 24px; grid-template-columns: 1fr 1fr; align-items: start; }
.contact-info .contact-list { list-style: none; margin: 0 0 16px; padding: 0; }
.contact-info .contact-list li { margin: 6px 0; }
.map iframe { width: 100%; height: 260px; border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }

.contact-form { background: var(--color-card); padding: 18px; border-radius: var(--radius); box-shadow: var(--shadow); }
.form-row { display: grid; gap: 8px; margin-bottom: 12px; }
.form-row label { font-weight: 600; }
.form-row input, .form-row textarea {
  background: #0f0f13; border: 1px solid #2a2a31; color: var(--color-text);
  border-radius: 10px; padding: 12px; font: inherit;
  width: 100%; /* Full width for mobile */
}
.form-row input:focus, .form-row textarea:focus { outline: 2px solid rgba(247,198,0,0.4); border-color: rgba(247,198,0,0.4); }
.error { color: #ff6b6b; font-size: 0.9rem; min-height: 18px; }
.form-status { color: var(--color-muted); margin-top: 8px; }

/* Improve spacing on small screens */
.contact-form .btn { width: 100%; }

/* Form improvements for mobile */
@media (max-width: 768px) {
  .form-row input, .form-row textarea {
    min-height: 44px; /* Minimum touch target size */
  }
}

/* Footer */
.footer { background: var(--color-accent); padding: 28px 0 18px; border-top: 1px solid rgba(247,198,0,0.2); }
.footer-grid { display: grid; gap: 18px; grid-template-columns: 1.2fr 1fr 1fr; align-items: start; }
.footer-links { list-style: none; margin: 8px 0 0; padding: 0; }
.footer-links a { color: var(--color-muted); text-decoration: none; }
.footer-links a:hover { color: var(--color-primary); }
.footer-bottom { text-align: center; margin-top: 14px; color: var(--color-muted); }
.footer-bottom a { color: var(--color-muted); text-decoration: none; }
.footer-bottom a:hover { color: var(--color-primary); }
.reg { color: var(--color-muted); margin-top: 8px; }

/* Responsive */
/* Large desktops */
@media (min-width: 1200px) {
  .container { max-width: 1200px; }
  .services-grid { grid-template-columns: repeat(3, 1fr); }
  .why-grid { grid-template-columns: repeat(5, 1fr); }
}

/* Medium devices (tablets, landscape iPads) */
@media (max-width: 1024px) and (min-width: 769px) {
  .container { width: 92%; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .why-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-title { font-size: clamp(2rem, 3.5vw, 3rem); }
}

/* Small devices (portrait tablets and large phones) */
@media (max-width: 768px) and (min-width: 577px) {
  .nav-toggle { display: inline-block; }
  .nav-links { position: absolute; right: 5%; top: 64px; background: var(--color-accent); border: 1px solid #222; border-radius: 12px; padding: 12px; display: none; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
  .nav-links.open { display: flex; }

  .about-grid { grid-template-columns: 1fr; }
  .about-columns { grid-template-columns: 1fr 1fr; }
  .services-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }

  .section { padding: 64px 0; }
  .hero { min-height: 65vh; }
  .logo-text { display: none; } /* Keep compact header on small screens */
}

/* Extra small devices (phones) */
@media (max-width: 576px) {
  .nav-toggle { display: inline-block; }
  .nav-links { position: absolute; right: 5%; top: 64px; background: var(--color-accent); border: 1px solid #222; border-radius: 12px; padding: 12px; display: none; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
  .nav-links.open { display: flex; }

  .about-grid { grid-template-columns: 1fr; }
  .about-columns { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .why-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }

  .section { padding: 56px 0; }
  .hero { min-height: 60vh; }
  .logo-text { display: none; } /* Keep compact header on small screens */
  .hero-title { font-size: clamp(1.5rem, 8vw, 2.2rem); }
  .hero-subtitle { font-size: 0.95rem; }
  .btn { padding: 10px 14px; width: 100%; }
  .hero-ctas { flex-direction: column; gap: 10px; }
  .section-header h2 { font-size: clamp(1.5rem, 5vw, 2rem); }
}

/* Utility: visually hidden for accessible-only content */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Utility */
.hidden { display: none !important; }
