/*
 * Header, language disclosure and mobile overlay.
 *
 * Every measurement comes from the design prototype. Logical properties are
 * used throughout so the Hebrew RTL layout needs no second stylesheet.
 */

/* ---------------------------------------------------------------- header */

.ad-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px var(--ad-space-page);
  background: var(--ad-color-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--ad-color-hairline);
}

.ad-header__logo {
  display: block;
  line-height: 0;
}

/*
 * The global img rule sets height:auto, which beats the HTML height
 * attribute and lets the 4073px-wide artwork render at intrinsic size.
 * Drive the height from a custom property the PHP sets instead.
 */
.ad-logo {
  display: block;
  height: var(--ad-logo-h, 22px);
  width: auto;
}

.ad-header__nav ul {
  display: flex;
  gap: 36px;
}

.ad-header__nav a {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  /* SC 2.5.8 target size: the 14px text alone is a small target. */
  padding-block: 12px;
}

.ad-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ---------------------------------------------------------------- buttons */

.ad-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding-inline: 18px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  border: 0;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}

.ad-btn--accent {
  background: var(--ad-color-accent);
  color: var(--ad-color-on-accent);
}

/*
 * The handoff hovers the accent button to #EAEAEA but keeps the dark text.
 * #EAEAEA text on #0EA5FF is 2.23:1, so the fill and the text swap together.
 */
.ad-btn--accent:hover,
.ad-btn--accent:focus-visible {
  background: var(--ad-color-text);
  color: var(--ad-color-bg);
}

/* -------------------------------------------------- language disclosure */

.ad-lang {
  position: relative;
}

.ad-lang__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 9px 12px;
  font-family: var(--ad-font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--ad-color-text);
  background: transparent;
  border: 1px solid var(--ad-color-border-input);
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease;
}

.ad-lang__toggle:hover,
.ad-lang__toggle[aria-expanded="true"] {
  border-color: var(--ad-color-accent);
  color: var(--ad-color-accent);
}

.ad-lang__list {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 6px);
  min-width: 132px;
  padding: 4px;
  background: var(--ad-color-panel);
  border: 1px solid var(--ad-color-border-input);
  z-index: 41;
}

/*
 * Closed only when JavaScript has taken control. Without JS the list stays
 * visible and usable, so a script failure cannot strand a visitor in one
 * language. The prototype's [data-reveal]{opacity:0} made the opposite
 * mistake and hid the entire page when JS failed.
 */
.js .ad-lang__list[hidden] {
  display: none;
}

.ad-lang__list a {
  display: block;
  padding: 10px 12px;
  min-height: 44px;
  font-family: var(--ad-font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  line-height: 24px;
  color: var(--ad-color-text-secondary);
}

.ad-lang__list a:hover {
  color: var(--ad-color-accent);
}

/* Current language marked by more than colour alone (SC 1.4.1). */
.ad-lang__list a[aria-current="true"] {
  color: var(--ad-color-accent);
}

.ad-lang__list a[aria-current="true"]::before {
  content: "\2022";
  margin-inline-end: 8px;
}

/* -------------------------------------------------------------- hamburger */

.ad-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--ad-color-border-input);
  cursor: pointer;
}

.ad-burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ad-color-text);
}

/* ------------------------------------------------------- overlay menu */

.ad-menu {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: 22px 20px 40px;
  background: var(--ad-color-bg);
}

.ad-menu[hidden] { display: none; }

.ad-menu__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ad-menu__close {
  width: 44px;
  height: 44px;
  font-size: 22px;
  color: var(--ad-color-text);
  background: transparent;
  border: 1px solid var(--ad-color-border-input);
  cursor: pointer;
}

.ad-menu__nav ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 64px;
}

.ad-menu__nav a {
  display: block;
  padding-block: 4px;
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -.03em;
}

.ad-menu__foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ad-menu__cta { min-height: 52px; }

.ad-menu__contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: var(--ad-font-mono);
  font-size: 12px;
  color: var(--ad-color-text-muted);
}

.ad-menu__contact a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ad-color-text-muted);
}

.ad-menu__contact a:hover { color: var(--ad-color-accent); }

.ad-menu__icon {
  display: inline-flex;
  color: var(--ad-color-accent);
}

/* Directional icons mirror in RTL; universal glyphs never do. */
[dir="rtl"] svg[data-dir] { transform: scaleX(-1); }

/* ------------------------------------------------------------ responsive */

@media (max-width: 640px) {
  .ad-header {
    padding-inline: var(--ad-space-page-mobile);
  }

  .ad-header__nav,
  .ad-header__cta {
    display: none;
  }

  .ad-burger { display: flex; }
}

/*
 * The sticky header would otherwise cover an anchor target, hiding the
 * element a visitor just jumped to (SC 2.4.11).
 */
:target,
[id] {
  scroll-margin-top: 96px;
}
