/* ==========================================================================
   1. CORE VARIABLES, RESETS & GLOBALS
   ========================================================================== */
html {
  scroll-behavior: smooth; /* This enables the fluid, elegant scrolling animation across the site */
}

:root {
  --primary-green: #1b3d2f;
  --light-bg: #f9f6f0;
  /* Warm beige brand background */
  --accent-sage: #e1ecd7;
  --brown-accent: #784f37;
  --text-dark: #2d312e;
  --text-muted: #555c57;
  --white: #ffffff;
  --font-main: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

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

body {
  font-family: var(--font-main);
  color: var(--text-dark);
  background-color: var(--white);
  line-height: 1.6;
}

/* --- Global Typography Elements --- */
h1,
h2,
h3 {
  color: var(--primary-green);
  font-weight: 700;
}

h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  /* max-width: 650px; */
  margin-bottom: 3rem;
}

.rounded-img {
  border-radius: 24px;
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* --- Universal Buttons & Links --- */
button {
  cursor: pointer;
  border: none;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-enquire {
  background-color: var(--brown-accent);
  color: var(--white);
  padding: 12px 28px;
  border-radius: 25px;
  font-size: 0.95rem;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--brown-accent);
  color: var(--brown-accent);
  padding: 14px 24px;
  border-radius: 20px;
  width: fit-content;
}

/* --- Universal Filled Button Update --- */
.btn-filled {
  background-color: var(--brown-accent);
  color: var(--white);
  padding: 14px 32px; /* Generous side padding, clean vertical spacing */
  font-size: 0.95rem; /* Professional, sophisticated text sizing */
  border-radius: 25px;
  width: fit-content; /* CRITICAL: Prevents the button from stretching full-width */
  display: inline-block; /* Ensures it respects width and padding parameters cleanly */
  text-align: center;
}

.underline-link {
  color: var(--brown-accent);
  text-decoration: underline;
  font-weight: 500;
}

/* --- Brand Logo Compound Asset --- */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 1.8rem;
}

.logo-text {
  font-size: 0.9rem;
  line-height: 1.1;
  color: var(--primary-green);
}

/* ==========================================================================
   2. SITE MAIN LAYOUT SECTIONS
   ========================================================================== */
/* --- Navigation Header Bar --- */
.navbar {
  display: flex;
  justify-content: space-between; /* Pushes logo left, button right */
  align-items: center;
  padding: 20px 8%;
  background-color: var(--light-bg);
  position: relative;
}

/* Forces the dynamic menu container to stay perfectly centered on desktop layouts */
.nav-links {
  display: flex;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  margin: 0 20px;
  font-weight: 500;
  white-space: nowrap; /* Prevents text elements from breaking lines */
}

.nav-links a.active {
  color: var(--primary-green);
  border-bottom: 2px solid var(--primary-green);
  padding-bottom: 4px;
}

/* --- Hero Intro Banner Area --- */
.hero-section {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  padding: 40px 8% 80px 8%;
  background-color: var(--white);
  gap: 40px;
}

.hero-content h1 {
  font-size: 4rem;
  line-height: 1.1;
}

/* --- Our Care Services Grid (BEIGE) --- */
.services-section {
  background-color: var(--light-bg);
  padding: 100px 8%;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.service-card {
  background: var(--white); /* Changed to white so it contrasts beautifully against the beige background */
  border-radius: 24px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  border: 1px solid rgba(120, 79, 55, 0.05); /* Soft, subtle accent border matching your brand tone */
  box-shadow: 0 10px 30px rgba(27, 61, 47, 0.02); /* Very gentle lift so you can clearly see the card outline */
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

/* Optional elegant hover effect to make the cards feel interactive */
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(27, 61, 47, 0.05);
}
.service-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 20px;
}

.service-card h3 {
  font-size: 1.4rem;
  margin-top: 5px;
}

.service-card p {
  color: var(--text-muted);
  flex-grow: 1;
  font-size: 0.95rem;
}

/* --- Our Qualified Staff Split Section (WHITE) --- */
.staff-section {
  background-color: var(--white);
  padding: 100px 8%;
}

.staff-section-content {
  max-width: 1400px;
  margin: 0 auto;
}

.staff-section-content h2 {
  font-size: 2.5rem;
  margin-bottom: 50px;
}

.staff-container {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 80px;
}

.staff-text p {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.staff-image {
  width: 100%;
  max-width: 420px;
  justify-self: center;
}

.staff-image img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
}

/* --- Real Stories Section (BEIGE + PROGRAMMATIC STAGGER) --- */
.stories-section {
  background-color: var(--light-bg);
  padding: 100px 8%;
}

.stories-container {
  max-width: 1400px;
  margin: 0 auto;
}

.stories-container h2 {
  font-size: 2.5rem;
  margin-bottom: 50px;
}

.stories-wrapper {
  display: flex;
  flex-direction: column;
  gap: 100px;
}

/* Base structural layout parameters: Text Left, Image Right */
.story-block {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 60px;
  align-items: center;
}

/* Automated Even-Row Alternator Inversion */
.story-block:nth-child(even) {
  grid-template-columns: 0.8fr 1.2fr;
}

.story-block:nth-child(even) .story-text-side {
  order: 2;
}

.story-block:nth-child(even) .story-image-side {
  order: 1;
}

.testimonial-card {
  background-color: var(--white);
  border-radius: 24px;
  padding: 45px;
  border: 1px solid rgba(120, 79, 55, 0.08);
}

.testimonial-card blockquote {
  font-size: 2rem;
  font-weight: 700;
  color: var(--brown-accent);
  line-height: 1.35;
  margin-bottom: 25px;
  letter-spacing: -0.5px;
}

.testimonial-card cite {
  font-style: normal;
  font-weight: 700;
  color: var(--primary-green);
  font-size: 1.1rem;
}

.testimonial-card cite span {
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.story-image-side {
  width: 100%;
  max-width: 420px;
  justify-self: center;
}

.story-image-side img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
}

/* --- Guidance & Resources (WHITE) --- */
.resources-section {
  background-color: var(--white);
  padding: 100px 8%;
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}

.resource-column h3 {
  font-size: 1.25rem;
  margin-bottom: 15px;
}

.resource-column p {
  color: var(--text-muted);
  margin-bottom: 20px;
  font-size: 0.95rem;
}

/* ==========================================================================
   3. FOOTER ARRANGEMENTS
   ========================================================================== */

/* contact us section  */
.cta-footer-split {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr; /* Keeps the compact image layout */
  background-color: var(--accent-sage);
  align-items: center; /* Keeps the smaller image vertically centered next to the form */
  overflow: hidden;
}

.cta-footer-split .cta-image {
  width: 100%;
  height: auto; /* REMOVED 100%: Let the height scale naturally with the width */
  display: block;
  padding: 40px; /* Optional: adds a nice border of breathing room around it so it feels smaller */
}

.cta-footer-split .cta-image img {
  width: 100%;
  height: auto; /* Forces the image to respect its native width-to-height ratio */
  object-fit: contain; /* Prevents ANY cropping, showing the full image exactly as it was shot */
  border-radius: 16px; /* Optional: gives the smaller image elegant rounded corners */
}

.cta-content {
  padding: 40px 8%; /* Tailored inner spacing so the form elements look balanced */
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.cta-content h2 {
  font-size: 3.2rem;
  line-height: 1.15;
}

.cta-content p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.cta-content address {
  font-style: normal;
  color: var(--primary-green);
  line-height: 1.4;
}

/* footer section */
/* --- Base Standard Footer (BEIGE) --- */
.base-footer {
  background-color: var(--light-bg);
  padding: 60px 8% 30px 8%;
}

.footer-container {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 60px;
  position: relative;
}

.footer-brand p {
  margin-top: 20px;
  color: var(--text-muted);
  max-width: 350px;
}

.footer-contact h3 {
  font-size: 1rem;
  letter-spacing: 1px;
  margin-bottom: 15px;
}

.footer-contact p {
  color: var(--text-muted);
  margin-bottom: 8px;
}

.footer-contact a {
  color: var(--text-muted);
  text-decoration: none;
}

.social-icons {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.social-icons a {
  color: var(--white);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

/* Social Network Color Assignments */
.social-icons a:nth-child(1) {
  background-color: #1877f2;
}

.social-icons a:nth-child(2) {
  background-color: #e1306c;
}

.social-icons a:nth-child(3) {
  background-color: #ff0000;
}

.social-icons a:nth-child(4) {
  background-color: #000000;
}

.social-icons a:nth-child(5) {
  background-color: #0077b5;
}

.social-icons a:nth-child(6) {
  background-color: #000000;
}

.footer-copyright {
  grid-column: span 2;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding-top: 20px;
  text-align: right;
  color: var(--text-muted);
  font-size: 0.9rem;
}
/* ==========================================================================
   4. NATIVE INTERACTIVE MODAL OVERLAY (FIXED WHITE SPACE)
   ========================================================================== */
.modal-overlay {
  border: none;
  background-color: transparent;
  padding: 0;
  margin: auto; /* Clean centering fallback asset for native dialogs */

  /* CRITICAL FIX: Hide from layout calculations entirely when closed */
  display: none;
}

/* Re-establish flex centering ONLY when the native [open] attribute is present */
.modal-overlay[open] {
  display: flex !important;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
}

/* Native backdrop styling built into the browser browser engine */
.modal-overlay::backdrop {
  background: rgba(27, 61, 47, 0.8);
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* Smooth fade-in for the native backdrop when open attribute matches true */
.modal-overlay[open]::backdrop {
  opacity: 1;
}

/* THE MODAL CARD DESIGN LAYER */
.modal-card {
  background-color: #faf8f5;
  padding: 40px;
  border-radius: 24px;
  width: 90%;
  max-width: 500px;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(120, 79, 55, 0.1);

  /* Hardware accelerated starting transitions animations */
  opacity: 0;
  transform: translateY(-20px);
  transition:
    opacity 0.2s cubic-bezier(0.05, 0.7, 0.1, 1),
    transform 0.2s cubic-bezier(0.05, 0.7, 0.1, 1);
  will-change: transform, opacity;
}

/* NATIVE OPEN TARGET STIMULUS */
.modal-overlay[open] .modal-card {
  opacity: 1;
  transform: translateY(0);
}

/* TYPOGRAPHY & INTERACTIVES */
.modal-close {
  position: absolute;
  top: 20px;
  right: 25px;
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-card h2 {
  font-size: 1.8rem;
  margin-bottom: 5px;
}

.modal-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 25px;
  line-height: 1.4;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.form-group label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary-green);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 12px 16px;
  border: 1px solid rgba(27, 61, 47, 0.2);
  border-radius: 12px;
  background-color: var(--white);
  font-family: var(--font-main);
  font-size: 0.95rem;
  color: var(--text-dark);
  outline: none;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--brown-accent);
}

.form-submit-btn {
  width: 100%;
  margin-top: 10px;
}

/* ==========================================================================
   5. RESPONSIVE HOOKS & MEDIA QUERIES (Unified Bottom)
   ========================================================================== */

@media (max-width: 992px) {
  .hero-section,
  .staff-container,
  .cta-footer-split,
  .footer-container {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-content h1 {
    font-size: 2.8rem;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .resources-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cta-content {
    padding: 60px 8%;
  }

  .footer-copyright {
    grid-column: span 1;
    text-align: left;
  }

  /* Responsive Resets for Constrained Image Wrappers */
  .staff-image,
  .story-image-side {
    max-width: 100%;
  }

  /* Staggered Story Block Phone Formats */
  .story-block,
  .story-block:nth-child(even) {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .story-block:nth-child(even) .story-text-side {
    order: 1;
  }

  .story-block:nth-child(even) .story-image-side {
    order: 2;
  }

  .staff-image img,
  .story-image-side img {
    height: 300px;
  }

  .testimonial-card {
    padding: 30px;
  }

  .testimonial-card blockquote {
    font-size: 1.5rem;
  }
}

@media (max-width: 600px) {
  .navbar {
    flex-direction: column;
    gap: 15px;
  }

  .services-grid,
  .resources-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   5. RESPONSIVE HOOKS & MEDIA QUERIES (Unified Bottom)
   ========================================================================== */

/* CRITICAL DESKTOP FIX: Permanently hide the mobile toggle button on desktop views */
.hamburger-btn {
  display: none !important;
}

/* ==========================================================================
   MOBILE NAVIGATION OVERRIDES (Below 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .navbar {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    flex-direction: row !important;
    gap: 0;
    z-index: 1000;
  }

  /* CRITICAL MOBILE FIX: Bring back the button only on mobile viewports */
  .hamburger-btn {
    display: inline-block !important;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-green);
    padding: 5px;
    cursor: pointer;
    order: 3; /* Places toggle button far right */
  }
}
  
/* ==========================================================================
   MOBILE NAVIGATION OVERRIDES (Below 768px)
   ========================================================================== */

.hamburger-btn {
  display: none;
}

@media (max-width: 768px) {
  .navbar {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    flex-direction: row !important;
    gap: 0;
    z-index: 1000;
  }

  /* Expose the interactive hamburger toggle button on smaller screens */
  .hamburger-btn {
    display: inline-block;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-green);
    padding: 5px;
    cursor: pointer;
    order: 3; /* Places toggle button far right */
  }

  /* Scale button settings context down for phone views */
  .btn-enquire {
    padding: 8px 18px;
    font-size: 0.85rem;
    border-radius: 20px;
    order: 2; /* Positions button nicely between logo and hamburger */
    margin-left: auto;
    margin-right: 15px;
  }

  /* Reset layout configurations for mobile drop-down drawer */
  .nav-links {
    display: none !important; 
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--white);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.08);
    border-top: 1px solid rgba(27, 61, 47, 0.08);
    flex-direction: column;
    padding: 10px 0;
    gap: 0;
    z-index: 999;
    
    /* Clear desktop centered coordinates */
    transform: none;
  }

  /* Revealed when active class parameter is injected by js script layer */
  .nav-links.open {
    display: flex !important;
  }

  /* Text layout elements inside mobile link cards */
  .nav-links a {
    width: 100%;
    text-align: center;
    padding: 16px 0;
    margin: 0;
    font-size: 1.05rem;
    color: var(--text-dark);
    border-bottom: 1px solid rgba(27, 61, 47, 0.04);
  }

  .nav-links a:last-child {
    border-bottom: none;
  }

  .nav-links a:hover,
  .nav-links a.active {
    background-color: var(--light-bg);
    color: var(--primary-green);
    border-bottom: 1px solid rgba(27, 61, 47, 0.04);
  }

  .services-grid,
  .resources-grid {
    grid-template-columns: 1fr;
  }
}

/* Clear the old default 600px flex-direction layout override */
@media (max-width: 600px) {
  .navbar {
    flex-direction: row !important;
  }
}