/* Core Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
  font-family: 'Segoe UI', sans-serif;
  background-color: #f5f4f1;
  color: #4b3b2b;
  line-height: 1.6;
  position: relative;
  z-index: 0;
}

body {
  padding-top: 70px; /* adjust to match navbar height */
}

/* Header */
header {
  text-align: center;
  padding: 1em 1em;
  background-color: #d8cfc2;
  position: relative;
  z-index: 2;
}

.logo {
  width: 100px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.tagline {
  font-style: italic;
  margin-top: 0.5em;
  color: #5e4a3a;
  font-size: 1rem;
}

/* Main Content */
main {
  display: block;
  min-height: auto;
  padding: 2em 1em;
  position: relative;
  z-index: 1;
}

section {
  display: block;
  margin-bottom: 2em;
}

/* Universal Heading Styling */
h1, h2, h3 {
  font-family: inherit;
  color: #4b3b2b;
  line-height: 1.25;
}

/* Intro Styling */
.intro {
  margin-bottom: 2em;
  padding: 1em;
  background-color: #ece7e1;
  border-radius: 6px;
}

.intro h2 {
  margin-bottom: 0.5em;
  font-size: 1.5rem;
}

.intro p {
  color: #3a3123;
  line-height: 1.6;
}

/* Services (Homepage snippet) */
.services ul {
  list-style: none;
  padding-left: 0;
  margin: 1em 0;
}

.services li::before {
  content: "🛠️ ";
  margin-right: 0.5em;
}

/* Call-to-Action */
.cta {
  text-align: center;
  margin: 3em auto;
  padding: 1em;
  position: relative;
  z-index: 1;
}

.cta p {
  margin-bottom: 1em;
  font-size: 1.1rem;
}

/* Shared Button Styles */
.button,
.contact-form button,
.btn {
  background-color: #8b6e52;
  color: #fff;
  padding: 0.8em 1.5em;
  font-size: 1rem;
  text-decoration: none;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease-in-out;
  display: inline-block;
}

.button:hover,
.contact-form button:hover,
.btn:hover {
  background-color: #a78c6f;
}

.button:focus,
.contact-form button:focus,
.btn:focus {
  outline: 2px solid #8b6e52;
  outline-offset: 2px;
}

/* Modular Flow Utility */
.button-flow {
  display: inline-block;
  margin: 1em 0;
}

/* Contact Page */
.contact-info ul {
  list-style: none;
  padding-left: 0;
  margin: 1em 0;
}

.contact-form form {
  display: flex;
  flex-direction: column;
  gap: 1em;
  max-width: 600px;
  margin: 0 auto;
  padding: 1em;
  background-color: #ece7e1;
  border-radius: 6px;
}

.contact-form label {
  font-weight: bold;
  margin-bottom: 0.3em;
}

.contact-form input,
.contact-form textarea {
  padding: 0.5em;
  font-size: 1em;
  border: 1px solid #b5a794;
  border-radius: 4px;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: #8b6e52;
  outline: none;
  box-shadow: 0 0 0 2px rgba(139, 110, 82, 0.2);
}

.invalid {
  border-color: #c00;
  box-shadow: 0 0 0 2px rgba(200, 0, 0, 0.2);
}

/* Navbar */
.navbar {
  background-color: #d8cfc2;
  padding: 0.5em 1em;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 10;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.navbar.scrolled {
  background-color: rgba(216, 207, 194, 0.8);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
}

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

/* Desktop Nav Links */
.nav-links {
  list-style: none;
  display: flex;
  gap: 1em;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: #4b3b2b;
  font-weight: bold;
  padding: 0.3em 0.5em;
  border-radius: 4px;
  transition: background-color 0.3s ease-in-out;
}

.nav-links a:hover,
.nav-links a.active,
.nav-links a:focus {
  background-color: #8b6e52;
  color: white;
  outline: none;
}

/* Hamburger Menu Button */
.hamburger {
  display: none;
  font-size: 2em;
  background: none;
  border: none;
  color: #4b3b2b;
  cursor: pointer;
}

/* Overlay */
.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 9;
}

.nav-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .hamburger {
    display: block;
    margin-left: auto;
    transition: transform 0.3s ease;
  }

  .hamburger.rotated {
    transform: rotate(-90deg);
  }

  .nav-links {
    position: absolute;
    top: 100%;
    right: 0;
    flex-direction: column;
    align-items: flex-end;
    background-color: #d8cfc2;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 0 0 6px 6px;
    width: 100%;
    max-height: 0;
    opacity: 0;
    transform: translateY(-10px);
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
    z-index: 9;
  }

  .nav-links.show {
    max-height: 500px;
    opacity: 1;
    transform: translateY(0);
  }

  .nav-links li {
    padding: 0.5em 1em;
    text-align: right;
  }

  body.no-scroll {
    overflow: hidden;
  }
}

/* Footer */
footer {
  text-align: center;
  padding: 1em;
  background-color: #d8cfc2;
  font-size: 0.9rem;
  color: #4b3b2b;
  position: relative;
  z-index: 1;
}

/* Scroll-to-Top Button */
#scrollToTop {
  position: fixed;
  bottom: 2em;
  right: 2em;
  padding: 0.75em;
  background-color: #8b6e52;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  opacity: 0;
  z-index: 999;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  transition: opacity 0.4s ease, transform 0.3s ease;
}

#scrollToTop svg {
  display: block;
  width: 1.5em;
  height: 1.5em;
}

#scrollToTop:hover {
  background-color: #a78c6f;
  transform: scale(1.1);
}

#scrollToTop.visible {
  display: block;
  opacity: 1;
}

/* Error Pages */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2em;
  background: linear-gradient(135deg, #f5f4f1, #d8cfc2 60%, #ece7e1 100%);
}

.error-container {
  max-width: 600px;
  background: rgba(248, 243, 235, 0.98);
  border: 1px solid #b5a794;
  border-radius: 8px;
  padding: 2em;
  text-align: center;
  box-shadow: 0 4px 16px rgba(139, 110, 82, 0.18);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.error-container:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 24px rgba(139, 110, 82, 0.28);
}

.error-logo {
  max-width: 120px;
  margin-bottom: 1.25em;
  filter: drop-shadow(0 2px 8px rgba(139, 110, 82, 0.4));
}

.error-container h2 {
  font-size: 2rem;
  margin-bottom: 0.75em;
}

.error-container p {
  font-size: 1.1rem;
  color: #3a3123;
  margin-bottom: 1.25em;
  line-height: 1.6;
}

/* Responsive Error Page Adjustments */
@media (max-width: 500px) {
  .error-container {
    padding: 1.5em;
  }

  .error-container h2 {
    font-size: 1.6rem;
  }

  .error-container p {
    font-size: 1rem;
  }
}

/* Optional: Dark Mode Stub */
@media (prefers-color-scheme: dark) {
  body {
    background-color: #1e1e1e;
    color: #eee;
  }

  .error-container {
    background: rgba(50, 50, 50, 0.9);
    border-color: #666;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
  }

  .error-logo {
    filter: brightness(1.2);
  }
}
