/* ==========================================================================
   Contact page
   Index: form card · info card · map card · Leaflet skin
   The hero, page track (.container--mid), pill (.badge--neutral), submit (.btn--gradient)
   and glass icon tiles come from the shared components.
   Mobile-first; the two-column layout starts at 60rem (960px).
   ========================================================================== */

/* ---- Hero ---------------------------------------------------------------- */

/* ---- Main layout: form (wider) + info card ----------------------------- */
/* the two cards slide in from the sides: clip them so the page never scrolls sideways */
.contact-main {
  overflow-x: clip;
  padding-block-end: var(--sp-10);
}
.contact-layout {
  display: grid;
  gap: var(--sp-6);
  align-items: start;
}

/* ---- Form card --------------------------------------------------------- */
.contact-form-card {
  padding: var(--sp-5);
  border-radius: var(--r-16);
  box-shadow: var(--sh-sm);
}
.contact-form__actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding-block-start: var(--sp-1);
}
.contact-form__submit { font-size: var(--fs-14); }   /* the design's 14px label at the 48px button size */
.contact-form__note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  font-size: var(--fs-11);
  font-weight: 700;
  line-height: 1.45;
  color: var(--text);
}
.contact-form__note .icon {
  font-size: .8125rem;
  color: var(--burgundy-deep);
}
.contact-form__status-icon {
  margin-block-start: .1875rem;
  font-size: 1rem;
}

/* ---- Info card (navy) -------------------------------------------------- */
.info-card {
  position: relative;
  isolation: isolate;
  overflow: clip;
  padding: var(--sp-8) var(--sp-5);
  color: var(--text-on-dark);
  background: var(--navy);
  border: 1px solid var(--line-on-dark);
  border-radius: var(--r-16);
  box-shadow: var(--sh-lg);
}
/* two soft glows: a white one in the top corner, an amber one in the opposite bottom corner */
.info-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(12rem 12rem at 0 0, color-mix(in srgb, var(--text-on-dark) 10%, transparent), transparent 72%),
    radial-gradient(16rem 16rem at 100% 100%, color-mix(in srgb, var(--amber) 24%, transparent), transparent 72%);
}
.info-card__title {
  position: relative;
  width: fit-content;
  margin-inline: auto;
  margin-block-end: var(--sp-6);
  padding-block-end: var(--sp-2);
  font-size: var(--fs-20);
  font-weight: 700;
  line-height: 1.5;
}
.info-card__title::after {
  content: "";
  position: absolute;
  inset-block-end: 0;
  inset-inline-start: 0;
  width: var(--sp-10);
  height: 3px;
  border-radius: var(--r-full);
  background: var(--amber);
}

.info-card__address { font-style: normal; }
.info-card__list {
  display: grid;
  gap: var(--sp-4);
}
/* each row keeps room at its start for the icon tile, which sits inside the <dt> */
.info-card__row {
  position: relative;
  min-height: 2.75rem;
  padding-block-start: var(--sp-1);
  padding-inline-start: calc(2.75rem + var(--sp-2));
}
.info-card__label {
  font-size: var(--fs-11);
  font-weight: 700;
  line-height: 1.45;
  color: var(--on-dark-60);
}
.info-card__value {
  font-size: var(--fs-14);
  line-height: 1.6;
  color: var(--on-dark-95);
  overflow-wrap: anywhere;
}
.info-card__icon {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
}

.info-card__link {
  font-weight: 500;
  text-decoration: underline transparent;
  text-underline-offset: .25em;
  transition: color var(--t-fast) var(--ease), text-decoration-color var(--t-fast) var(--ease);
}
@media (hover: hover) {
  .info-card__link:hover {
    color: var(--amber);
    text-decoration-color: currentColor;
  }
}
.info-card__link:focus-visible {
  box-shadow: var(--focus-on-dark);
  border-radius: var(--r-4);
}

.info-card__follow {
  display: flex;
  flex-direction: column;
  gap: .625rem;
  margin-block-start: var(--sp-4);
  padding-block-start: var(--sp-6);
  border-block-start: 1px solid var(--line-on-dark);
}
.info-card__follow-label {
  font-size: var(--fs-11);
  font-weight: 700;
  line-height: 1.45;
  color: var(--on-dark-70);
}
.info-card__social {
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.info-card__social .social__link:focus-visible {
  box-shadow: var(--focus-on-dark);
  border-radius: var(--r-12);
}
/* the shared social icons carry their own padding (40px art-board); this one is a bare 17px glyph */
.info-card__social .info-card__glyph {
  width: 1.0625rem;
  height: 1.0625rem;
}

/* ---- Map card ---------------------------------------------------------- */
.contact-map { padding-block-end: calc(var(--sp-10) + var(--section-y)); }
.map-card {
  --surface-95: color-mix(in srgb, var(--surface) 95%, transparent);
  --burgundy-halo: color-mix(in srgb, var(--burgundy) 20%, transparent);
  position: relative;
  isolation: isolate;   /* Leaflet's z-indexes stay under the sticky header */
  overflow: hidden;
  height: 20rem;
  background: var(--tint-cool);
  border: 1px solid var(--line-rose);
  border-radius: var(--r-16);
  box-shadow: var(--sh-md);
}
.map-card:has(.map-card__canvas:focus-visible) { box-shadow: var(--focus); }
.map-card__canvas {
  width: 100%;
  height: 100%;
}

/* corner label, always on top of the map */
.map-card__place {
  position: absolute;
  inset-block-start: var(--sp-4);
  inset-inline-start: var(--sp-4);
  z-index: 1001;
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  padding: .375rem .875rem;
  font-size: var(--fs-12);
  font-weight: 700;
  line-height: 1.5;
  color: var(--ink);
  background: var(--surface-95);
  border: 1px solid var(--line-rose);
  border-radius: var(--r-12);
  box-shadow: var(--sh-sm);
  pointer-events: none;
}
.map-card__place .icon {
  font-size: .9375rem;
  color: var(--burgundy);
}

/* place name pill — used in the fallback and as the marker's label on the live map */
.map-label {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  font-family: var(--font);
  font-size: var(--fs-12);
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink);
  white-space: nowrap;
  background: var(--surface-95);
  border: 1px solid var(--line-rose);
  border-radius: var(--r-full);
  box-shadow: var(--sh-lg);
}
.map-label::before {
  content: "";
  flex: none;
  width: .625rem;
  height: .625rem;
  border-radius: 50%;
  background: var(--burgundy);
}

/* brand pin: burgundy disc with a soft halo and a white pin glyph */
.map-pin {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  color: var(--text-on-dark);
  background: var(--burgundy);
  box-shadow: 0 0 0 4px var(--burgundy-halo), var(--sh-md);
}
.map-pin .icon { font-size: 1.125rem; }

/* fallback: shown until the live map is ready, and again if Leaflet or the tiles fail */
.map-card__fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  padding: var(--sp-12) var(--sp-4) var(--sp-4);
  background: linear-gradient(135deg, var(--sand), var(--sand-strong));
}
.map-card__link {
  margin-block-start: var(--sp-4);
  border-color: var(--line-rose);
}

/* ---- Leaflet skin -------------------------------------------------------
   leaflet.css is loaded after this file, so every override is scoped with
   ".map-card__canvas.leaflet-container" to out-rank the library's selectors.
   Leaflet places its controls with physical left/right/top/bottom, hence the
   physical margins on the zoom control. */
/* Leaflet positions panes, tooltips and controls assuming LTR; the Arabic labels switch back to RTL */
.map-card__canvas.leaflet-container {
  direction: ltr;
  font-family: var(--font);
  font-size: var(--fs-12);
  background: var(--tint-cool);
}
.map-card__canvas.leaflet-container .map-label,
.map-card__canvas.leaflet-container .leaflet-control-attribution { direction: rtl; }
.map-card__canvas.leaflet-container:focus-visible { box-shadow: none; }

.map-card__canvas.leaflet-container .leaflet-control-zoom {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-4) var(--sp-4);
  padding: var(--sp-1);
  background: var(--surface-95);
  border: 1px solid var(--line-rose);
  border-radius: var(--r-12);
  box-shadow: var(--sh-sm);
}
.map-card__canvas.leaflet-container .leaflet-control-zoom a {
  position: relative;
  width: 2rem;
  height: 2rem;
  line-height: 2rem;
  font-size: var(--fs-18);
  font-weight: 500;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: var(--r-8);
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.map-card__canvas.leaflet-container .leaflet-control-zoom-out::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-start: calc(var(--sp-1) * -1 - .5px);
  height: 1px;
  background: var(--line);
}
@media (hover: hover) {
  .map-card__canvas.leaflet-container .leaflet-control-zoom a:hover {
    color: var(--burgundy-deep);
    background: var(--burgundy-soft);
  }
}
.map-card__canvas.leaflet-container .leaflet-control-zoom a:focus-visible { box-shadow: var(--focus); }
.map-card__canvas.leaflet-container .leaflet-control-zoom a.leaflet-disabled {
  color: var(--text-muted);
  background: transparent;
  opacity: .5;
}

.map-card__canvas.leaflet-container .leaflet-control-attribution {
  font-size: var(--fs-11);
  color: var(--text);
  background: var(--surface-95);
  border-start-start-radius: var(--r-8);
}
.map-card__canvas.leaflet-container .leaflet-control-attribution a { color: var(--navy); }

/* marker + its permanent label (the label markup is .map-label, the Leaflet wrapper is reset) */
.map-card__canvas.leaflet-container .map-marker {
  background: none;
  border: 0;
}
.map-card__canvas.leaflet-container .map-marker:focus-visible { box-shadow: none; }
.map-card__canvas.leaflet-container .map-marker:focus-visible .map-pin { box-shadow: var(--focus); }
.map-card__canvas.leaflet-container .map-tooltip {
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  opacity: 1;
}
.map-card__canvas.leaflet-container .map-tooltip::before { content: none; }

/* popup */
.map-card__canvas.leaflet-container .map-popup .leaflet-popup-content-wrapper {
  border-radius: var(--r-12);
  box-shadow: var(--sh-lg);
  color: var(--text);
}
.map-card__canvas.leaflet-container .map-popup .leaflet-popup-content {
  margin: var(--sp-4) var(--sp-5);
  direction: rtl;
  text-align: start;
  font-size: var(--fs-12);
  line-height: 1.5;
}
.map-popup__name {
  display: block;
  font-size: var(--fs-14);
  font-weight: 700;
  color: var(--ink);
}
.map-popup__address {
  display: block;
  color: var(--text-muted);
}
.map-card__canvas.leaflet-container .map-popup__link {
  display: inline-flex;
  align-items: center;
  gap: .375rem;
  margin-block-start: var(--sp-2);
  font-weight: 700;
  color: var(--burgundy);
  text-decoration: underline;
  text-underline-offset: .25em;
}

/* ---- ≥ 640px: roomier cards; info rows in two columns while the layout is still stacked */
@media (min-width: 40rem) {
  .contact-form-card { padding: var(--sp-10); }
  .info-card { padding: var(--sp-10); }
  .info-card__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--sp-6);
  }
  .info-card__social { gap: var(--sp-1); }
  .map-label { font-size: var(--fs-14); }
}

/* ---- ≥ 768px: map at the design height */
@media (min-width: 48rem) {
  .map-card { height: 24rem; }
}

/* ---- ≥ 960px: form and info card side by side (660 : 464 in the design) */
@media (min-width: 60rem) {
  .contact-layout { grid-template-columns: minmax(0, 660fr) minmax(0, 464fr); }
  .info-card__list { grid-template-columns: minmax(0, 1fr); }
}

/* ---- English (LTR) fixes ---------------------------------------------
   The shared sprite has only a left-pointing arrow (the RTL "forward"); in LTR it is mirrored. */
[dir="ltr"] .icon:not(.icon--back):has(> use[href="#i-arrow-left"]) { scale: -1 1; }
/* Leaflet labels follow the page direction (the Arabic page switches them to RTL above) */
[dir="ltr"] .map-card__canvas.leaflet-container .map-label,
[dir="ltr"] .map-card__canvas.leaflet-container .leaflet-control-attribution { direction: ltr; }
