/* ==========================================================================
   Marketing go-live — "Leave a Message" fab + panel, WhatsApp fab, navbar
   phone number. Generated from marketing-go-live.md + marketing-go-live-config.yaml.

   Site adaptations (vs. the template):
   - Generic .btn / .btn-primary / .btn-outline rules dropped — css/styles.css
     already defines them (same green), and the submit button uses those.
   - .form-group scoped under .contact-modal.
   - Neutral / type / shape tokens scoped to the popup components so they
     don't override the site's own :root tokens (e.g. --radius-sm).
   - Phone link sits inside the site's existing .site-header.
   ========================================================================== */

/* ==========================================================================
   THEME — change --main-color to match the site's brand color.
   Everything else derives from it.
   ========================================================================== */
:root {
  --main-color: #3d6b3d;        /* site brand green (--color-green-dark) */
  --main-contrast: #ffffff;      /* text/icon color drawn ON TOP of --main-color */

  /* Fallback shades (used only if the browser lacks color-mix()) */
  --main-color-dark: #325832;
  --main-color-light: #ecf0ec;
}

@supports (color: color-mix(in srgb, red, red)) {
  :root {
    --main-color-dark: color-mix(in srgb, var(--main-color) 82%, black);
    --main-color-light: color-mix(in srgb, var(--main-color) 12%, white);
  }
}

.contact-fab,
.contact-modal,
.whatsapp-fab,
.site-navbar-phone {
  /* Neutrals — mapped to the site's palette */
  --black: var(--color-text, #2c2c2c);
  --white: var(--color-white, #ffffff);
  --grey-100: var(--color-bg-alt, #f2f4f1);
  --grey-300: var(--color-border, #e0e4de);
  --grey-600: var(--color-text-muted, #636363);

  /* Type — the site uses Inter throughout */
  --font-sans: var(--font-base, 'Inter', system-ui, -apple-system, sans-serif);
  --font-serif: var(--font-base, 'Inter', system-ui, -apple-system, sans-serif);

  /* Shape */
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.14);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.28);
}

/* ==========================================================================
   Leave a Message — floating action button
   ========================================================================== */
.contact-fab {
  position: fixed;
  right: 24px;
  bottom: 0px;
  z-index: 1200;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--main-color);
  color: var(--main-contrast);
  border: none;
  border-top-left-radius: 25px;
  border-top-right-radius: 25px;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.contact-fab:hover { background: var(--main-color-dark);}
.contact-fab svg { flex: 0 0 auto; }

@media (max-width: 560px) {
  .contact-fab {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 65px;
    font-size: 0.85rem;
  }
  .contact-fab:hover { transform: translateX(-50%); }
}

/* ==========================================================================
   Leave a Message — modal panel
   ========================================================================== */
.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 1300; /* stays above the WhatsApp fab */
}

.contact-modal[hidden] { display: none; }

.contact-modal-backdrop {
  position: fixed;
  inset: 0;
  background: transparent; /* click-outside-to-close catcher, no dimming */
}

.contact-modal-dialog {
  position: fixed;
  right: 24px;
  bottom: 60px; /* sits just above the fab */
  width: min(380px, calc(100vw - 48px));
  max-height: min(560px, calc(100vh - 140px));
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 28px 26px;
  overflow-y: auto;
  box-sizing: border-box;
  transform-origin: bottom right;
  transform: translateY(12px) scale(0.96);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.contact-modal.is-open .contact-modal-dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

@media (max-width: 560px) {
  .contact-modal-dialog {
    right: 12px;
    left: 12px;
    bottom: 76px;
    width: auto;
    padding: 22px 20px;
  }
}

.contact-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--grey-100);
  color: var(--black);
  border-radius: 50%;
  cursor: pointer;
}
.contact-modal-close:hover { background: var(--grey-300); }

.contact-modal-dialog h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 400;
  margin: 0 0 8px;
  padding-right: 30px;
  color: var(--black);
}

.contact-modal-intro {
  color: var(--grey-600);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0 0 24px;
}

.contact-modal .form-group { margin-bottom: 14px; }

.contact-modal .form-group input,
.contact-modal .form-group textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 12px 14px;
  border: 1px solid var(--grey-300);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--black);
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.contact-modal .form-group input:focus,
.contact-modal .form-group textarea:focus {
  outline: none;
  border-color: var(--main-color);
  box-shadow: 0 0 0 3px var(--main-color-light);
}
.contact-modal .form-group textarea { min-height: 110px; resize: vertical; }

.contact-modal-submit { width: 100%; margin-top: 6px; justify-content: center; text-align: center; }

/* ==========================================================================
   WhatsApp — floating action button
   ========================================================================== */
.whatsapp-fab {
  position: fixed;
  right: 24px;
  bottom: 64px; /* stacked directly above the "Leave a Message" fab */
  z-index: 1200;
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #25d366;
  color: #ffffff;
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.whatsapp-fab:hover { background: #ffffff; color: #25d366; }
.whatsapp-fab svg { width: 30px; height: 30px; flex: 0 0 auto; }

@media (max-width: 560px) {
  .whatsapp-fab {
    right: 16px;
    bottom: 45px;
    width: 45px;
    height: 45px;
  }
  .whatsapp-fab svg { width: 26px; height: 26px; }
}

/* ==========================================================================
   Navbar phone number — inside the site's existing .site-header
   ========================================================================== */
.site-navbar-phone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--main-color);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.site-navbar-phone:hover { color: var(--main-color-dark); }
.site-navbar-phone svg { flex: 0 0 auto; }

/* Desktop: logo on the left, nav + phone grouped on the right */
@media (min-width: 641px) {
  .header-inner > .site-nav { margin-left: auto; }
}

/* Tablet: tighten the nav so logo + nav + phone fit on one line */
@media (min-width: 641px) and (max-width: 900px) {
  .header-inner > .site-nav ul { gap: var(--space-md, 1.5rem); }
}

/* Narrow tablet: not enough room for the full number beside the nav — show the
   phone icon only (still a tap-to-call link; the number stays readable to
   screen readers). */
@media (min-width: 641px) and (max-width: 820px) {
  .site-navbar-phone-number {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}

/* Mobile: the site's nav collapses into its own hamburger; the phone number
   stays in the top bar, between the logo and the toggle. */
@media (max-width: 640px) {
  .header-inner > .site-navbar-phone { order: 1; margin-left: auto; }
  .header-inner > .nav-toggle { order: 2; }
}

@media (max-width: 380px) {
  .header-inner { gap: 0.75rem; }
  .site-navbar-phone { font-size: 0.85rem; gap: 6px; }
}
