/* ==========================================================
   Edina Community Foundation – Header & Navigation
   Drop-downs open directly under their parent link.
   ========================================================== */

:root {
  --ecf-green: #3d7c57;        /* header background            */
  --ecf-green-dark: #2c6243;   /* darker end of the gradient   */
  --ecf-green-light: #4f9469;  /* lighter end of the gradient  */
  --ecf-mint: #d9fbe8;         /* menu button background       */
  --ecf-mint-hover: #b8f0d0;   /* button hover                 */
  --ecf-ink: #1d2b24;          /* text + borders               */
  --ecf-logo: #1f2f27;         /* logo text / icon             */
  --ecf-radius: 28px;          /* header corner rounding       */
  --ecf-btn-radius: 999px;     /* menu buttons are pill-shaped */
  --ecf-soft-shadow: 0 2px 6px rgba(16, 40, 28, .25);   /* soft shadow under buttons */
  --ecf-font-nav: "Helvetica Neue", Arial, sans-serif;
  --ecf-font-logo: Georgia, "Times New Roman", serif;
}

/* ---------- Header bar ---------- */
.ecf-header {
  box-sizing: border-box;
  width: auto;                 /* fills the screen width, minus the margin */
  margin: 8px;                 /* small gap so the rounded corners show */
  padding: 14px 24px 14px 6px;
  min-height: 134px;
  background-color: var(--ecf-green);
  /* Background design, top layer first:
     1. flowing contour lines, like a map of the creek and lakes
     2. soft light glow behind the menu
     3. green gradient */
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 200' preserveAspectRatio='none'%3E%3Cpath d='M0 150 C260 100 520 190 780 140 S1220 80 1440 125 V200 H0Z' fill='%23ffffff' fill-opacity='.06'/%3E%3Cpath d='M0 180 C300 145 600 200 860 170 S1260 130 1440 160 V200 H0Z' fill='%23ffffff' fill-opacity='.06'/%3E%3Cg fill='none' stroke='%23d9fbe8' stroke-opacity='.16' stroke-width='1.3'%3E%3Cpath vector-effect='non-scaling-stroke' d='M0 34 C240 4 480 74 720 44 S1200 -6 1440 34'/%3E%3Cpath vector-effect='non-scaling-stroke' d='M0 58 C240 28 480 98 720 68 S1200 18 1440 58'/%3E%3Cpath vector-effect='non-scaling-stroke' d='M0 82 C240 52 480 122 720 92 S1200 42 1440 82'/%3E%3Cpath vector-effect='non-scaling-stroke' d='M0 106 C240 76 480 146 720 116 S1200 66 1440 106'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(ellipse 45% 90% at 85% 0%, rgba(217, 251, 232, .20), transparent 70%),
    linear-gradient(115deg, var(--ecf-green-dark) 0%, var(--ecf-green) 45%, var(--ecf-green-light) 100%);
  background-size: 100% 100%, auto, auto;
  background-repeat: no-repeat;
  border-radius: var(--ecf-radius);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  position: relative;
  z-index: 1000;               /* keeps drop-downs above page content */
}
.ecf-header *,
.ecf-header *::before,
.ecf-header *::after { box-sizing: border-box; }

/* ---------- Logo ---------- */
.ecf-logo {
  display: flex;
  align-items: flex-end;       /* name sits at the bottom of the logo */
  gap: 12px;
  text-decoration: none;
  color: #fff;
  font-family: var(--ecf-font-logo);
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: -0.2px;
  white-space: nowrap;         /* keep the name on one line */
}
.ecf-logo svg { width: 34px; height: 62px; flex-shrink: 0; }
.ecf-logo img { width: 160px; height: 160px; object-fit: contain; flex-shrink: 0; border-radius: 20px; }   /* logo size */
.ecf-logo span { display: block; }
/* With the big logo, the name runs along the bottom under the menu,
   so it takes no width and the menu gets the full row */
.ecf-logo:has(img) span { width: 0; overflow: visible; }

/* ---------- Navigation ---------- */
.ecf-nav { margin-top: 38px; }

.ecf-menu,
.ecf-submenu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ecf-menu {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ecf-menu > li { position: relative; }   /* anchor for drop-down */

/* Button-style links */
.ecf-menu a,
.ecf-menu .ecf-parent {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 15px;
  font-family: var(--ecf-font-nav);
  font-size: 16px;
  color: var(--ecf-ink);
  text-decoration: none;
  /* light-to-mint gradient with a shine along the top edge */
  background: linear-gradient(180deg, #f6fff9 0%, #d3f8e2 50%, #aeeccb 100%);
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: var(--ecf-btn-radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), var(--ecf-soft-shadow);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, transform .1s ease, box-shadow .1s ease;
}
.ecf-menu .ecf-parent { font: inherit; font-family: var(--ecf-font-nav); font-size: 16px; }

.ecf-menu a:hover,
.ecf-menu .ecf-parent:hover,
.ecf-menu a:focus-visible,
.ecf-menu .ecf-parent:focus-visible {
  /* brighter, sunnier gradient and a small lift on hover */
  background: linear-gradient(180deg, #fffde6 0%, #d8f9a8 50%, #8fe0b0 100%);
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 6px 14px rgba(16, 40, 28, .3);
  outline: none;
}
.ecf-menu a:active,
.ecf-menu .ecf-parent:active {
  transform: translateY(0);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 1px 2px rgba(16, 40, 28, .25);
}

/* Current page */
.ecf-menu a[aria-current="page"] { background: linear-gradient(180deg, #fff 0%, #fff 55%, #e6fbef 100%); font-weight: 600; }

/* Chevron */
.ecf-chevron {
  width: 10px; height: 10px;
  transition: transform .2s ease;
}

/* ---------- Drop-down (directly under parent) ---------- */
.ecf-submenu {
  position: absolute;
  top: calc(100% + 8px);       /* small gap under the parent button   */
  left: 0;                     /* aligned to parent's left edge       */
  min-width: 100%;
  width: max-content;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  background: var(--ecf-green);
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 22px;
  box-shadow: 0 10px 24px rgba(16, 40, 28, .3);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
/* Invisible bridge so the menu doesn't close crossing the gap */
.ecf-submenu::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: -10px; height: 10px;
}
.ecf-submenu a,
.ecf-submenu a:hover,
.ecf-submenu a:focus-visible { box-shadow: none; width: 100%; transform: none; }

/* Show on hover, keyboard focus, or tap (open class from JS) */
.ecf-has-sub:hover > .ecf-submenu,
.ecf-has-sub:focus-within > .ecf-submenu,
.ecf-has-sub.is-open > .ecf-submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.ecf-has-sub:hover .ecf-chevron,
.ecf-has-sub:focus-within .ecf-chevron,
.ecf-has-sub.is-open .ecf-chevron { transform: rotate(180deg); }

/* Keep the last drop-down from running off the right edge */
.ecf-menu > li.ecf-align-right > .ecf-submenu { left: auto; right: 0; }

/* ---------- Mobile toggle ---------- */
.ecf-toggle {
  display: none;
  margin-top: 30px;
  width: 48px; height: 44px;
  background: linear-gradient(180deg, #f6fff9 0%, #d3f8e2 50%, #aeeccb 100%);
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), var(--ecf-soft-shadow);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.ecf-toggle span,
.ecf-toggle span::before,
.ecf-toggle span::after {
  display: block;
  width: 22px; height: 2px;
  background: var(--ecf-ink);
  position: relative;
  content: "";
}
.ecf-toggle span::before { position: absolute; top: -7px; }
.ecf-toggle span::after  { position: absolute; top: 7px; }

@media (max-width: 860px) {
  .ecf-header {
    flex-wrap: wrap;
    padding: 12px 16px;
    min-height: auto;
    border-radius: 20px;
  }
  /* Smaller logo and name so they fit on a phone */
  .ecf-logo { font-size: 22px; white-space: normal; min-width: 0; flex: 1; }
  .ecf-logo img { width: 80px; height: 80px; border-radius: 10px; }
  .ecf-logo:has(img) span { width: auto; }
  .ecf-toggle { display: flex; }
  .ecf-nav {
    display: none;
    width: 100%;
    margin-top: 8px;
  }
  .ecf-header.nav-open .ecf-nav { display: block; }

  .ecf-menu { flex-direction: column; gap: 6px; }
  .ecf-menu a,
  .ecf-menu .ecf-parent { width: 100%; justify-content: space-between; }

  /* On mobile, drop-downs expand inline instead of floating */
  .ecf-submenu {
    position: static;
    width: 100%;
    margin-top: 6px;
    box-shadow: none;
    display: none;
    opacity: 1; visibility: visible; transform: none;
  }
  .ecf-submenu::before { display: none; }
  .ecf-has-sub:hover > .ecf-submenu { display: none; }   /* no hover on touch */
  .ecf-has-sub.is-open > .ecf-submenu { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
  .ecf-header * { transition: none !important; }
}
