/*
 * Global header + footer for the dia-nobel.com rebuild (Elementor Theme Builder).
 *
 * Menu structure and footer copy are 1:1 with the client's live site; the
 * visual language is the LifeTec design system (floating capsule header, navy
 * footer) rather than the live site's Woodmart chrome.
 */

/* ---------------------------------------------------------------- header */

/*
 * One state only: the capsule, floating over the page from the first pixel.
 *
 * The earlier design had a full-width white strip at rest that collapsed into
 * the capsule on scroll. At rest that strip had to hold logo + 9 links + phone
 * + CTA across the full width and the elements ran into each other, so the
 * client dropped it. `fixed` rather than `sticky` because the capsule should
 * float ON the hero, not occupy a row of its own above it.
 *
 * Pages other than the homepage clear it with .dn-page-head's top padding; the
 * homepage hero is a full-bleed video band the capsule is meant to sit on.
 *
 * 🪤 If this ever goes back to `sticky`, it must stay on THIS wrapper and not on
 * #dn-header: a sticky element only sticks inside its containing block, and the
 * wrapper is exactly as tall as the header, so sticky on the inner container has
 * nowhere to stick and scrolls away.
 */
.elementor-location-header {
  position: fixed;
  /* WP exposes the admin-bar height as a custom property; 0 for visitors. */
  top: var(--wp-admin--admin-bar--height, 0px);
  inset-inline: 0;
  z-index: 90;
}

#dn-header {
  position: relative;
  padding: 12px clamp(12px, 3vw, 40px) 0;
  background: transparent;
  border-bottom: 0;
}

/*
 * The client's menu is 9 items long. At 15px/11px it overran the bar and the
 * phone number sat on top of "אודותינו" — the capsule has to hold logo + 9
 * links + phone + CTA inside 1280, so the type runs tighter here than the LP's
 * 6-item nav does.
 */
#dn-header .dn-header-bar {
  max-width: 1280px;
  margin-inline: auto;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-card);
  padding: 9px 12px 9px 9px;
  flex-wrap: nowrap;
  gap: 14px !important;
  transition: box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}

/* The only thing scrolling changes now: the capsule lifts off the page a
   little once there is content behind it. No layout shift. */
#dn-header.is-stuck .dn-header-bar {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-strong);
}

#dn-header .dn-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding-inline-start: 8px;
}

#dn-header .dn-logo img {
  display: block;
  width: 132px;
  height: auto;
}

/* The nav takes the slack so the logo stays right and the CTA stays left. */
#dn-header .dn-nav {
  flex: 1 1 auto;
  min-width: 0;
}

#dn-header .dn-nav .elementor-nav-menu {
  justify-content: center;
  flex-wrap: nowrap;
}

/* The 9 links were nearly touching at 7px. */
#dn-header .dn-nav .elementor-nav-menu > li {
  margin-inline: 2px;
}

#dn-header .dn-nav .elementor-item {
  font-size: 14px;
  font-weight: 600;
  color: var(--page-fg);
  padding: 8px 10px;
  white-space: nowrap;
  transition: color var(--dur) var(--ease);
}

#dn-header .dn-nav .elementor-item:hover,
#dn-header .dn-nav .elementor-item.elementor-item-active {
  color: var(--brand-primary);
}

/* Elementor draws its own underline/pointer; the design has none. */
#dn-header .dn-nav .e--pointer-underline .elementor-item:before,
#dn-header .dn-nav .e--pointer-underline .elementor-item:after {
  display: none;
}

#dn-header .dn-header-phone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  color: var(--brand-primary);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: gap var(--dur) var(--ease);
}

#dn-header .dn-header-phone:hover { gap: 9px; }

#dn-header .dn-header-cta {
  flex-shrink: 0;
}

#dn-header .dn-header-cta.elementor-widget-button .elementor-button {
  font-size: 15px;
  font-weight: 800;
  padding: 12px 24px;
}

#dn-header .dn-header-cta.elementor-widget-button .elementor-button-text {
  max-width: none;
  white-space: nowrap;
}

/* Phone is the first thing to go — the CTA next to it reaches the same person. */
@media (max-width: 1280px) {
  #dn-header .dn-header-phone { display: none; }
}

@media (max-width: 1140px) {
  #dn-header .dn-nav .elementor-item { font-size: 13px; padding: 8px 6px; }
  #dn-header .dn-nav .elementor-nav-menu > li { margin-inline: 0; }
  #dn-header .dn-logo img { width: 116px; }
}

/* Below the nav's natural width the row can't hold; stack and let the menu wrap. */
@media (max-width: 1024px) {
  #dn-header .dn-header-bar {
    flex-wrap: wrap;
    border-radius: var(--r-lg);
    justify-content: space-between;
  }

  #dn-header .dn-nav {
    order: 4;
    flex-basis: 100%;
  }

  #dn-header .dn-nav .elementor-nav-menu {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 600px) {
  #dn-header .dn-header-phone { display: none; }
  #dn-header .dn-header-cta.elementor-widget-button .elementor-button {
    font-size: 14px;
    padding: 10px 18px;
  }
}

/* ---------------------------------------------------------------- footer */

#dn-footer {
  background: var(--page-fg-strong);
  color: rgba(255, 255, 255, 0.72);
  padding-block: clamp(48px, 6vw, 72px) 0;
}

#dn-footer .dn-footer-top {
  display: grid !important;
  grid-template-columns: 2.1fr 1fr 1fr 1fr 1.2fr;
  gap: clamp(24px, 3vw, 44px);
  align-items: start;
}

#dn-footer .dn-footer-brand,
#dn-footer .dn-footer-col {
  width: auto !important;
  min-width: 0;
}

/* Sized to fit the brand column on one line: at 1440 the column is ~370px and
   the 45-character CTA needs ~320px at 12px. Anything larger overflowed into
   the "תכנית LifeTec" column instead of wrapping, because of the nowrap above. */
#dn-footer .dn-footer-cta.elementor-widget-button .elementor-button {
  font-size: 12px;
  font-weight: 800;
  padding: 12px 18px;
  text-align: center;
  max-width: 100%;
}

/* Narrow column: shrink the type rather than let the CTA wrap. */
#dn-footer .dn-footer-cta.elementor-widget-button .elementor-button-text {
  white-space: nowrap;
  font-size: 12px;
}

/* The brand mark is a colour SVG; the footer plate needs it in white. */
#dn-footer .dn-footer-logo {
  display: block;
  width: 170px;
  height: auto;
  margin: 24px 0 16px;
  filter: brightness(0) invert(1);
}

#dn-footer .dn-footer-contact {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#dn-footer .dn-footer-contact a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.82);
  font-size: var(--t-small);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

#dn-footer .dn-footer-contact a:hover { color: #fff; }

#dn-footer .dn-footer-h4 .elementor-heading-title {
  font-size: var(--t-h4);
  font-weight: 800;
  line-height: 1.3;
  color: #fff;
  margin-bottom: 16px;
}

#dn-footer .dn-footer-menu .elementor-nav-menu {
  gap: 4px;
}

#dn-footer .dn-footer-menu .elementor-item {
  color: rgba(255, 255, 255, 0.72);
  font-size: var(--t-small);
  font-weight: 500;
  padding: 5px 0;
  transition: color var(--dur) var(--ease);
}

#dn-footer .dn-footer-menu .elementor-item:hover,
#dn-footer .dn-footer-menu .elementor-item.elementor-item-active {
  color: #fff;
}

#dn-footer .dn-footer-menu .e--pointer-underline .elementor-item:before,
#dn-footer .dn-footer-menu .e--pointer-underline .elementor-item:after {
  display: none;
}

/* label_position:none still emits the <label>; the live footer field has none. */
#dn-footer .dn-footer-form .elementor-field-label {
  display: none;
}

#dn-footer .dn-footer-form .elementor-field-textual {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--r-sm);
  color: #fff;
  padding: 12px 14px;
  font-size: var(--t-small);
}

#dn-footer .dn-footer-form .elementor-field-textual::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

#dn-footer .dn-footer-form .elementor-field-textual:focus {
  border-color: var(--brand-light);
  outline: none;
}

#dn-footer .dn-footer-form.elementor-widget-form .elementor-button[type="submit"] {
  background: var(--brand-primary);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  border-radius: var(--r-pill);
  padding: 11px 24px;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}

#dn-footer .dn-footer-form.elementor-widget-form .elementor-button[type="submit"]:hover {
  background: var(--brand-mid);
  transform: translateY(-2px);
}

#dn-footer .dn-footer-bottom {
  margin-top: clamp(36px, 4vw, 52px);
  padding-block: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  flex-wrap: wrap;
}

#dn-footer .dn-copy {
  font-size: var(--t-micro);
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
}

@media (max-width: 1024px) {
  #dn-footer .dn-footer-top {
    grid-template-columns: 1fr 1fr;
    row-gap: 40px;
  }

  #dn-footer .dn-footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  #dn-footer .dn-footer-top { grid-template-columns: 1fr; }

  #dn-footer .dn-footer-cta.elementor-widget-button .elementor-button-text {
    white-space: normal;
  }
  #dn-footer .dn-footer-bottom { justify-content: center; text-align: center; }
}
