/* ==========================================================================
   Homeo Care Clinic — Stylesheet
   Step 1: Base tokens + Header (topbar, logo, nav, mega-menu)
   ========================================================================== */

:root {
  /* Brand colors — client-approved palette */
  --color-primary: #70b12e; /* Primary Green — buttons, headings, highlights, icons, active states */
  --color-primary-dark: #4f8f24; /* Dark Green — hover states, footer accents, strong emphasis */
  --color-accent: #018bda; /* Primary Blue — secondary buttons, links, icons, healthcare accents */
  --color-accent-dark: #0172b0; /* Darkened Primary Blue for hover states (derived, not in palette) */
  --color-text: #02646f; /* Dark Navy — main text, navigation, important headings */
  --color-text-light: #5f6368; /* Body Gray — paragraphs and secondary text */
  --color-bg: #ffffff;
  --color-bg-alt: #f1f9e9; /* Light Green — section backgrounds, cards, subtle highlights */
  --color-bg-info: #eaf7fc; /* Light Blue — soft backgrounds, information cards */
  --color-border: #dde8df; /* Border Gray — borders, dividers, form fields */

  /* Typography — Poppins for structure, Nunito Sans for body content */
  --font-heading:
    "Poppins", sans-serif; /* H1–H3, nav, buttons, numbers/statistics */
  --font-body:
    "Nunito Sans", sans-serif; /* paragraphs, descriptions, form labels, FAQ, small text */
  --font-base: var(--font-body);

  --container-width: 1350px;
  --header-height: 84px;
  --topbar-height: 40px;
}

/* ---------- Reset / base ---------- */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--color-text);
  text-decoration: none;
}

a:hover {
  color: var(--color-primary-dark);
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 0.75em 1em;
  z-index: 1000;
}

.skip-link:focus {
  left: 0;
}

/* ---------- Accessibility helper ---------- */
.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;
}

/* ---------- Header main row: logo, call/address/hours, language ---------- */
.header-main {
  background: #fff;
  position: relative;
}

.header-main__inner {
  max-width: var(--container-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.25rem 1.25rem;
  flex-wrap: wrap;
}

.site-logo img {
  height: 70px;
  width: auto;
}

.header-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex: 1;
  flex-wrap: wrap;
}

.header-info__item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-left: 2rem;
  border-left: 1px solid var(--color-border);
}

.header-info__item:first-child {
  padding-left: 0;
  border-left: none;
}

.header-info__icon {
  flex-shrink: 0;
}

.header-info__icon svg {
  width: 22px;
  height: 22px;
  fill: var(--color-accent);
  color: var(--color-accent);
}

.header-info__label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-text-light);
  font-size: 0.75rem;
  margin-bottom: 0.15rem;
}

.header-info__text p {
  margin: 0;
  font-size: 1rem;
  color: var(--color-text);
  line-height: 1.4;
}

.header-info__text a {
  color: var(--color-primary-dark);
  font-weight: 700;
}

.header-info__text a:hover {
  color: var(--color-accent);
}

.lang-select {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-text);
  cursor: pointer;
  white-space: nowrap;
}

.lang-select img {
  width: 24px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
}

.lang-select .chevron-icon {
  width: 14px;
  height: 14px;
}

/* Mobile nav toggle button */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  background: var(--color-text);
  border-radius: 2px;
}

/* ---------- Primary nav bar (Dark Navy per approved palette's
   "navigation" role — replaces the old teal from the reference design) ---------- */
.primary-nav-bar {
  background: var(--color-text);
  position: relative;
  z-index: 100;
}

.primary-nav-bar__inner {
  max-width: var(--container-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  position: relative;
}

.primary-nav .menu {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.primary-nav .menu > li {
  position: relative;
}

.primary-nav .menu > li > a {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 1rem 0.85rem;
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
  position: relative;
}

.primary-nav .menu > li > a:hover,
.primary-nav .menu > li:focus-within > a {
  color: var(--color-bg-alt);
}

.primary-nav .menu > li.is-active > a::after {
  content: "";
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0;
  height: 3px;
  background: var(--color-primary);
  border-radius: 2px 2px 0 0;
}

.chevron-icon {
  width: 12px;
  height: 12px;
  margin-left: 1px;
}

/* Mega menu panels — hidden by default, shown on hover/focus for desktop */
.mega-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid var(--color-border);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  padding: 1.5rem;
  min-width: 480px;
  z-index: 200;
}

.has-mega:hover .mega-panel,
.has-mega:focus-within .mega-panel {
  display: flex;
  gap: 2rem;
}

.mega-panel--simple {
  display: none;
  min-width: 320px;
}

.has-mega:hover .mega-panel--simple,
.has-mega:focus-within .mega-panel--simple {
  display: block;
}

.mega-panel--3col {
  min-width: 620px;
}

.mega-panel--wide {
  min-width: 680px;
}

.mega-col h3 {
  font-size: 0.85rem;
  text-transform: none;
  color: var(--color-primary);
  margin: 0 0 0.6rem;
}

.mega-col ul li {
  margin-bottom: 0.4rem;
}

.mega-col ul li a {
  font-size: 0.875rem;
  color: var(--color-text-light);
}

.mega-col ul li a:hover {
  color: var(--color-primary);
}

.mega-col--intro {
  max-width: 220px;
  border-right: 1px solid var(--color-border);
  padding-right: 1.5rem;
}

.mega-col--intro p {
  font-size: 0.8125rem;
  color: var(--color-text-light);
}

/* ---------- Search (toggle button + dropdown panel) ---------- */
.search-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.search-toggle svg {
  width: 19px;
  height: 19px;
}

.search-toggle:hover {
  color: var(--color-bg-alt);
}

.site-search {
  position: absolute;
  top: 100%;
  right: 1.25rem;
  background: #fff;
  border: 1px solid var(--color-border);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  padding: 1rem;
  width: 380px;
  z-index: 300;
}

.site-search[hidden] {
  display: none;
}

.site-search__form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.site-search__form input[type="search"] {
  flex: 1;
  padding: 0.6em 0.8em;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.9rem;
}

.site-search__form input[type="search"]:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

.site-search__form button[type="submit"] {
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0 0.9em;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 0.35em;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
}

.site-search__form button[type="submit"] svg {
  width: 15px;
  height: 15px;
}

.site-search__form button[type="submit"] span {
  display: none;
}

.site-search__close {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text-light);
  padding: 0 0.2em;
  flex-shrink: 0;
}

.site-search__close:hover {
  color: var(--color-text);
}

.site-search__results {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
  max-height: 340px;
  overflow-y: auto;
}

.site-search__results[hidden] {
  display: none;
}

.site-search__result {
  display: block;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--color-border);
}

.site-search__result:last-child {
  border-bottom: none;
}

.site-search__result-type {
  display: inline-block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-accent);
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.site-search__result-title {
  display: block;
  font-size: 0.9rem;
  color: var(--color-text);
  font-weight: 600;
}

.site-search__result-title:hover {
  color: var(--color-primary);
}

.site-search__empty {
  font-size: 0.85rem;
  color: var(--color-text-light);
  padding: 0.5rem 0;
}

/* ---------- Buttons (used across header + rest of site) ---------- */
.btn {
  display: inline-block;
  padding: 0.75em 1.75em;
  border-radius: 4px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  border: 2px solid transparent;
  cursor: pointer;
}

.btn--primary {
  background: var(--color-accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--color-accent-dark);
  color: #fff;
}

.btn--secondary {
  background: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn--secondary:hover {
  background: var(--color-primary);
  color: #fff;
}

/* ---------- Responsive: collapse header nav under ~960px ---------- */
@media (max-width: 960px) {
  .header-info {
    display: none;
  }

  .lang-select span {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .site-logo img {
    height: 52px;
  }

  .header-main__inner {
    padding: 0.75rem 1rem;
  }

  .primary-nav-bar__inner {
    padding: 0 1rem;
  }

  .primary-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-text);
    max-height: 80vh;
    overflow-y: auto;
    z-index: 250;
  }

  .primary-nav.is-open {
    display: block;
  }

  .primary-nav .menu {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-nav .menu > li > a {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    justify-content: space-between;
  }

  .primary-nav .menu > li.is-active > a {
    color: var(--color-primary);
  }

  .primary-nav .menu > li.is-active > a::after {
    display: none;
  }

  .mega-panel,
  .mega-panel--3col,
  .mega-panel--wide,
  .mega-panel--simple {
    position: static;
    display: none;
    box-shadow: none;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    min-width: 0;
    width: 100%;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem 1.25rem;
  }

  .has-mega.is-open .mega-panel,
  .has-mega.is-open .mega-panel--simple {
    display: flex;
  }

  .mega-col h3 {
    color: var(--color-bg-alt);
  }

  .mega-col ul li a {
    color: rgba(255, 255, 255, 0.85);
  }

  .mega-col--intro {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding-right: 0;
    padding-bottom: 1rem;
    max-width: none;
  }

  .mega-col--intro p {
    color: rgba(255, 255, 255, 0.75);
  }

  .site-search {
    position: fixed;
    top: auto;
    right: 0;
    left: 0;
    bottom: 0;
    width: auto;
    border-radius: 12px 12px 0 0;
  }
}

@media (max-width: 600px) {
  .site-logo img {
    height: 44px;
  }

  .header-main__inner {
    gap: 0.75rem;
  }
}
