/* Shared language navigation and fragment targets in the English edition. */
.lang-anchor-v61 {
  position: absolute;
  width: 1px;
  height: 1px;
  scroll-margin-top: 90px;
  pointer-events: none;
}

.brand-locale-v61 {
  display: inline-flex;
  align-items: center;
  gap: clamp(5px, .65vw, 10px);
  min-width: 0;
}
.site-header > .brand-locale-v61 { grid-area: 1 / 1; }
.brand-locale-v61 :is(.brand, .error-brand) { min-width: 0; }

.lang-link-v61 {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding-inline: 7px;
  color: #242828;
  font: 600 12px/1 Barlow, Arial, sans-serif;
  letter-spacing: .035em;
  text-decoration: none;
  white-space: nowrap;
  touch-action: manipulation;
}
.lang-link-v61::before {
  position: absolute;
  z-index: -1;
  inset: 7px 0;
  border: 1px solid #d3d7d5;
  border-radius: 7px;
  background: #fff;
  content: "";
}
.lang-link-v61 img {
  display: block;
  width: 19px;
  height: 13px;
  object-fit: cover;
  border-radius: 2px;
}
@media (hover: hover) {
  .lang-link-v61:hover { color: #a91d26; }
  .lang-link-v61:hover::before { border-color: #ac7478; }
}
.lang-link-v61:focus-visible { outline: 2px solid #ad2029; outline-offset: 1px; border-radius: 7px; }

@media (max-width: 1180px) {
  :is(.site-header, .error-header, .legal-header) > .brand-locale-v61 { display: contents; }
  .site-header, .error-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: center;
    column-gap: clamp(2px, .8vw, 8px);
  }
  :is(.site-header, .error-header, .legal-header) .brand-locale-v61 > :first-child {
    grid-area: 1 / 1;
    max-width: 100%;
    justify-self: start;
  }
  :is(.site-header, .error-header, .legal-header) .lang-link-v61 {
    z-index: 2;
    grid-area: 1 / 2;
  }
  :is(.site-header, .error-header, .legal-header) > .site-search-trigger {
    grid-area: 1 / 3;
    margin: 0;
  }
  .site-header > .menu-toggle, .error-header > .error-header__contact, .legal-header > .header-cta {
    grid-area: 1 / 4;
  }
  .legal-header { grid-template-columns: auto minmax(0, 1fr) auto auto auto; column-gap: 8px; }
  .legal-header .lang-link-v61 { grid-column: 3; }
  .legal-header > .site-search-trigger { grid-column: 4; }
  .legal-header > .header-cta { grid-column: 5; }
  .legal-header__nav { grid-area: 1 / 2; }
}

@media (max-width: 900px) {
  .legal-header { grid-template-columns: minmax(0, 1fr) auto auto auto; column-gap: clamp(2px, .8vw, 8px); }
  .legal-header .lang-link-v61 { grid-column: 2; }
  .legal-header > .site-search-trigger { grid-column: 3; }
  .legal-header > .header-cta { grid-column: 4; }
}

@media (min-width: 1181px) and (max-width: 1320px) {
  .site-header .brand-locale-v61 .brand { width: 136px; }
  .site-header .brand-locale-v61 { gap: 5px; }
}

/* Region picker in the same header slot as the original language switch. */
.region-picker {
  position: relative;
  z-index: 3;
  flex: none;
  align-self: center;
  font: 600 14px/1.2 Barlow, Arial, sans-serif;
}
.region-picker > summary {
  display: inline-flex;
  list-style: none;
  cursor: pointer;
}
.region-picker > summary::-webkit-details-marker { display: none; }
.region-picker > summary::after {
  width: 5px;
  height: 5px;
  margin: -3px 2px 0 0;
  transform: rotate(45deg);
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  content: "";
}
.region-picker[open] > summary::after { transform: translateY(3px) rotate(225deg); }
.region-picker img {
  display: block;
  width: auto;
  height: 14px;
  flex: none;
  object-fit: contain;
  border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(26, 32, 31, .18);
}
.region-picker__options {
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: calc(100% + 3px);
  width: max-content;
  min-width: 144px;
  margin: 0;
  padding: 4px;
  list-style: none;
  border: 1px solid #d3d7d5;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(20, 28, 27, .13);
  color: #242828;
}
.region-picker__options > li { margin: 0; padding: 0; }
.region-picker__options :is(a, span) {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 5px 9px;
  border-radius: 6px;
  color: inherit;
  font: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.region-picker__options a:hover,
.region-picker__options a:focus-visible { background: #f1f3f1; color: #a91d26; }
.region-picker__options a:focus-visible { outline: 2px solid #ad2029; outline-offset: -2px; }
.region-picker__options [aria-current]::after {
  margin-inline-start: auto;
  color: #ad2029;
  content: "✓" / "";
}
@media (max-width: 1180px) {
  :is(.site-header, .error-header, .legal-header) .region-picker { grid-area: 1 / 2; }
  .region-picker__options { inset-inline-start: auto; inset-inline-end: 0; }
}
@media (min-width: 901px) and (max-width: 1180px) {
  .legal-header .region-picker { grid-column: 3; }
}
@media (max-width: 359px) {
  .region-picker > summary { gap: 4px; padding-inline: 5px; }
}

/* The native language menu is the last control in wide headers. */
@media (min-width: 1181px) {
  :is(.site-header, .legal-header) {
    grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  }

  :is(.site-header, .legal-header) > .region-picker {
    grid-area: 1 / 5;
  }

  .error-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
  }

  .error-header > .site-search-trigger { grid-area: 1 / 2; }
  .error-header > .error-header__contact { grid-area: 1 / 3; }
  .error-header > .region-picker { grid-area: 1 / 4; }

  /* The Arabic list reads RTL but the trigger is physically on the right. */
  .region-picker__options {
    left: auto;
    right: 0;
  }
}
