/* ========== Root, Reset, Base ========== */
:root {
  --brand: #004b2f;
  --brand-200: #617b2b;
  --ink: #333;
  --paper: #fff;
  --muted: #f7f3e9;
  --card: #f8f8f8;
  --header-h: 100px;         /* default; updated by JS if present */
}

* { box-sizing: border-box; }

html, body { height: 100%; overflow-x: hidden; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  font-family: 'Work Sans', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  padding-top: var(--header-h); /* push content below fixed header */
}
img { max-width: 100%; height: auto; display: block; }

/* Better heading anchoring when linked */
h1, h2, h3, section[id] { scroll-margin-top: calc(var(--header-h) + 16px); }

/* Motion accessibility */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ========== Header ========== */
header {
  position: fixed; inset: 0 0 auto 0;
  background: var(--brand);
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px;
  z-index: 1000;
}
header .logo img { height: 60px; max-height: 70px; cursor: pointer; padding-right: 10px; }
header .text-container {
  flex: 1 1 auto; padding-left: 20px; display: flex; flex-direction: column; justify-content: center; text-align: left;
}
header .text-container h1,
header .text-container p,
header .contact a { color: #fff; margin: 0; }

/* Top-right cluster */
.contact-wrapper { display: flex; align-items: center; gap: 20px; }

/* Contact bar participates in layout on all viewports by default */
.contact-info {
  font-size: 1rem; color: #fff; display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.contact-info a { color: #fff; text-decoration: none; font-weight: 600; }
.separator { color: #fff; }

/* Hamburger */
.hamburger { width: 30px; height: 25px; position: relative; cursor: pointer; margin-top: 5px; }
.hamburger span { background: #fff; display: block; height: 4px; margin: 5px 0; border-radius: 2px; }

/* ========== Slide-out Menu ========== */
.side-menu {
  position: fixed; top: 0; right: -300px; width: 250px; height: 100vh;
  background: var(--muted); color: var(--ink);
  padding: 20px; transition: right 0.3s ease-in-out; z-index: 2000;
}
.side-menu.active { right: 0; }
.side-menu a {
  display: block; color: var(--brand); text-decoration: none; margin: 10px 0; font-weight: 600;
}
.side-menu a:hover { color: var(--ink); }
body.menu-open { overflow: hidden; }

/* ========== Main, Hero, Buttons ========== */
main { margin: 0; padding: 0; }

/* Hero carousel */
.hero { position: relative; width: 100vw; height: 100vh; overflow: hidden; }
.carousel-track {
  display: flex; width: 300vw; height: 100%;
  animation: slideCarousel 18s infinite linear; will-change: transform; backface-visibility: hidden; transform-style: preserve-3d;
}
.slide { flex: 0 0 100vw; height: 100vh; object-fit: cover; }
@keyframes slideCarousel {
  0% { transform: translateX(0); }
  33.33% { transform: translateX(0); }
  44.44% { transform: translateX(-100vw); }
  77.77% { transform: translateX(-100vw); }
  88.88% { transform: translateX(-200vw); }
  100% { transform: translateX(-200vw); }
}

.hero-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  background: rgba(0,0,0,0.3); color: #fff; pointer-events: none; z-index: 10;
}
.hero-overlay .logo-fade {
  opacity: 0; animation: logoFadeIn 2s ease-in-out forwards; animation-delay: 1s;
  max-width: 300px; margin-top: 40px; filter: opacity(85%); pointer-events: none;
}
.hero-overlay h2 { margin-top: 10px; opacity: 0; animation: textFadeIn 2s ease-in-out forwards; animation-delay: 2.5s; }
@keyframes logoFadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes textFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.scroll-button {
  background: var(--brand); color: #fff; border: 0; font-size: 1.1rem;
  padding: 15px 30px; margin-top: 30px; border-radius: 50px; cursor: pointer; transition: background-color 0.3s ease;
  pointer-events: auto; font-family: 'Work Sans', inherit;
}
.scroll-button:hover { background: var(--brand-200); }

/* Content blocks */
.main-content { padding: 60px 20px; background: #fff; text-align: center; }
.flashy-text { font-size: 2rem; font-weight: 700; color: var(--ink); animation: flashFade 3s ease-in-out infinite alternate; }
@keyframes flashFade { from { opacity: 0.2; transform: scale(0.98); } to { opacity: 1; transform: scale(1.05); } }

/* ========== Grids and Sections ========== */
.intro-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: center; margin-bottom: 40px; text-align: left;
}
.intro-grid img { width: 100%; border-radius: 8px; }
.intro-text h2 { font-size: 2rem; margin: 0 0 10px; }
.intro-text p { font-size: 1.1rem; line-height: 1.6; margin: 0; }

.full-width-text { text-align: center; margin-bottom: 40px; }
.full-width-text h3 { font-size: 1.6rem; color: var(--brand); margin: 0; }

.grid-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-bottom: 40px;
}
.grid-item {
  text-align: center; padding: 20px; background: var(--card); border-radius: 10px;
}
.grid-item img {
  width: 100%; max-height: 160px; object-fit: cover; border-radius: 6px; margin-bottom: 15px;
}
.grid-item h4 { font-size: 1.2rem; margin: 10px 0 5px; }
.grid-item p { font-size: 0.95rem; margin: 0 0 15px; }

.cta-button {
  display: inline-block; padding: 12px 24px; font-size: 1rem;
  background: var(--brand); color: #fff; border: 0; border-radius: 50px; text-decoration: none; transition: background-color 0.3s ease;
}
.cta-button:hover { background: var(--brand-200); }

/* ========== Footer ========== */
footer {
  background: var(--brand); color: #fff; text-align: center; padding: 20px; margin: 0;
}
footer a { color: #fff; text-decoration: none; }
footer img { width: 24px; margin-top: 10px; }

/* ========== Responsive ========== */
@media (max-width: 1024px) {
  header .text-container { padding-left: 12px; }
}

@media (max-width: 768px) {

  header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 15px 20px;
  }

  header .logo img {
    height: 55px;
    margin-bottom: 10px;
  }

  header .text-container {
    padding-left: 0;
    margin-bottom: 10px;
    text-align: center;
  }

  /* Contact info becomes a small centred block */
  .contact-wrapper {
    width: 100%;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
  }

  .contact-info {
    background: #ffffff;
    color: var(--brand);
    padding: 6px 12px;
    width: auto;
    border-radius: 6px;
  }
  .contact-info a,
  .contact-info .separator {
    color: var(--brand);
  }

  /* Keep the hamburger in the top-right */
  .hamburger {
    position: absolute;
    top: 20px;
    right: 25px;
  }

  .hero {
    height: 70vh;
  }
  .slide {
    height: 70vh;
  }

  .main-content {
    padding-top: 20px;
  }
}

/* ========== Utilities (optional) ========== */
.hidden { display: none !important; }
.center { text-align: center; }

/* Force treatment cards to stack on all phones */
@media (max-width: 900px) {
  .grid-row {
    grid-template-columns: 1fr !important;
  }
}