/* LODISNA — "Areas of operation of our fleet".
 *
 * The section is the one from the ORIS build, ported whole: same composition
 * (panel left over an oversized map bled off the right edge), same six figures,
 * same 108 port markers, same orange call to action.
 *
 * Two deliberate differences from the original:
 *   - the type is LODISNA's own Type1 / Type2, not the source's Montserrat and
 *     JetBrains Mono, so the section reads as part of this site
 *   - the section sits on #011C4D, the navy this site paints its own full-width
 *     sections and body text in (measured off the rendered page), because the
 *     scroll transition has to land on THIS site's colour
 *
 * Everything is scoped under .lds-geo. This theme styles bare tags by name
 * (h2, p, span, a), so an unscoped rule would reach into the rest of the page.
 */

.lds-geo {
  --lds-navy: #011C4D;
  --lds-paper: #F2F2F2;
  --lds-accent: #ff471d;
  --lds-white: #FFFFFF;
  --lds-steel-300: #B7C2CE;
  --lds-steel-400: #8896A6;
  --lds-line: rgba(255, 255, 255, 0.08);
  --lds-line-strong: rgba(255, 255, 255, 0.16);
  --lds-chrome: rgba(1, 28, 77, 0.8);
  /* Driven by geo.js as the section scrolls: 1 = fully white, 0 = fully navy. */
  --lds-veil: 1;

  position: relative;
  isolation: isolate;
  overflow: hidden;
  overflow: clip;
  background: var(--lds-navy);
  min-height: 1080px;
  padding: 0;
  /* The theme styles bare <section> as `display: flex; justify-content: left`.
   * Inherited, that made the overlay a flex ITEM sized to its content — measured
   * 624px wide in English and 562px in Arabic inside a 1440px section — so the
   * panel sat hard left in both languages and `justify-content: left`, being a
   * physical value, ignored the Arabic direction entirely. As a block, the
   * overlay fills the width and its own flex layout decides the side. */
  display: block;
}

/* ---- the map, oversized and bled off the right edge -------------------- */
/* This is what puts the basemap under the panel and still shows the Aegean and
 * the Black Sea past the right edge, exactly as the original does. */
.lds-geo__map {
  position: absolute;
  top: -8%;
  right: -22%;
  width: 130%;
  height: 116%;
  z-index: 0;
}
/* Mirrored for Arabic: the panel moves to the right, so the map bleeds left. */
html[dir="rtl"] .lds-geo__map { right: auto; left: -22%; }

.lds-geo__map .mapboxgl-canvas { outline: none; }
.lds-geo__map .mapboxgl-ctrl-bottom-left,
.lds-geo__map .mapboxgl-ctrl-bottom-right,
.lds-geo__map .mapboxgl-ctrl-top-right { display: none !important; }

/* ---- the white veil that burns off as the section scrolls -------------- */
/* One opaque layer over everything. At the top of the section it is solid paper
 * white and the map is invisible; by the middle it has gone. Opacity is the only
 * animated property, so this stays on the compositor and never forces layout
 * while the page is being scrolled. */
.lds-geo__veil {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: var(--lds-paper);
  opacity: var(--lds-veil);
  pointer-events: none;
  will-change: opacity;
}

/* ---- the panel --------------------------------------------------------- */
.lds-geo__overlay {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  pointer-events: none;
  min-height: 660px;
}

.lds-geo__panel {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
  max-width: clamp(360px, 43.75vw, 560px);
  padding: clamp(64px, 7vw, 112px) 32px clamp(64px, 7vw, 112px) 32px;
  position: relative;
  align-items: flex-start;
}
html[dir="rtl"] .lds-geo__panel { text-align: right; }

/* A wash behind the copy, fading out across the map.
 *
 * In English the panel sits over the Atlantic, which the basemap paints in the
 * dark water colour, so the copy is legible with nothing behind it — and this
 * wash is effectively invisible there. Mirrored for Arabic the panel lands over
 * Turkey and the Black Sea instead, which is light land carrying a dense cluster
 * of port pins, and the figures became hard to read against it. Same rule both
 * ways, so the two languages stay one design. */
.lds-geo__panel::before {
  content: "";
  position: absolute;
  /* Deliberately taller than the panel. Bounded to the panel's own box it ended
   * mid-map and its lower edge read as a straight line ruled across the basemap.
   * The section is `overflow: clip`, so the overspill is cut at the section
   * boundary and no edge is ever visible. */
  top: -50%;
  bottom: -50%;
  left: -32px;
  width: 175%;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(90deg,
    rgba(1, 28, 77, 0.94) 0%,
    rgba(1, 28, 77, 0.86) 42%,
    rgba(1, 28, 77, 0.00) 100%);
}
html[dir="rtl"] .lds-geo__panel::before {
  left: auto;
  right: -32px;
  background: linear-gradient(270deg,
    rgba(1, 28, 77, 0.94) 0%,
    rgba(1, 28, 77, 0.86) 42%,
    rgba(1, 28, 77, 0.00) 100%);
}
/* Only the interactive parts take pointer events; the rest of the overlay lets
 * drags through to the map beneath it. */
.lds-geo__panel a,
.lds-geo__panel button { pointer-events: auto; }

.lds-geo__eyebrow {
  display: block;
  font-family: Type2, "Segoe UI", Arial, sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--lds-steel-400);
}
.lds-geo__num { color: var(--lds-steel-300); margin-right: 14px; }
html[dir="rtl"] .lds-geo__eyebrow {
  letter-spacing: normal;
  text-transform: none;
  font-family: "Cairo", Type2, sans-serif;
  font-size: 13px;
}
html[dir="rtl"] .lds-geo__num { margin-right: 0; margin-left: 14px; }

.lds-geo__title {
  margin: 0;
  font-family: Type1, "Segoe UI", Arial, sans-serif;
  font-weight: 200;
  font-size: clamp(24px, 3.2vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--lds-white);
}
html[dir="rtl"] .lds-geo__title {
  font-family: "Cairo", Type1, "Segoe UI", Tahoma, Arial, sans-serif;
  letter-spacing: normal;
  line-height: 1.35;
}

/* ---- the six figures --------------------------------------------------- */
.lds-geo__regions--numbers {
  display: inline-grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px 24px;
}
.lds-geo__region {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 115px;
  padding: 0;
  border-bottom: none;
  font-family: Type2, "Segoe UI", Arial, sans-serif;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lds-steel-400);
  line-height: 1.45;
}
html[dir="rtl"] .lds-geo__region {
  text-align: right;
  letter-spacing: normal;
  text-transform: none;
  font-family: "Cairo", Type2, sans-serif;
  font-size: 11.5px;
  max-width: 150px;
}
.lds-geo__region strong {
  font-family: Type1, "Segoe UI", Arial, sans-serif;
  font-weight: 300;
  font-size: 30px;
  letter-spacing: -0.02em;
  color: var(--lds-white);
  font-variant-numeric: tabular-nums;
  /* A percentage is a left-to-right run; left to the paragraph direction the
   * Arabic build painted "50,4%" with the sign at the wrong end. */
  direction: ltr;
  unicode-bidi: isolate;
}

/* ---- call to action ---------------------------------------------------- */
.lds-geo__btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 16px 30px;
  border-radius: 999px;
  background: var(--lds-accent);
  color: var(--lds-white);
  font-family: Type2, "Segoe UI", Arial, sans-serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 220ms ease, color 220ms ease;
}
.lds-geo__btn:hover { background: var(--lds-white); color: #102339; }
html[dir="rtl"] .lds-geo__btn {
  letter-spacing: normal;
  text-transform: none;
  flex-direction: row-reverse;
  font-family: "Cairo", Type2, sans-serif;
  font-size: 13px;
}
/* The arrow is drawn rather than typed, so it mirrors cleanly and needs no glyph. */
.lds-geo__arrow {
  width: 18px;
  height: 1px;
  background: currentColor;
  position: relative;
  display: inline-block;
  transition: transform 220ms ease;
}
.lds-geo__arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: -3px;
  width: 7px;
  height: 7px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: rotate(45deg);
}
.lds-geo__btn:hover .lds-geo__arrow { transform: translateX(4px); }
html[dir="rtl"] .lds-geo__arrow { transform: scaleX(-1); }
html[dir="rtl"] .lds-geo__btn:hover .lds-geo__arrow { transform: scaleX(-1) translateX(4px); }

/* ---- map chrome -------------------------------------------------------- */
.lds-geo__controls {
  position: absolute;
  bottom: 50px;
  right: 24px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 0;
  opacity: calc(1 - var(--lds-veil));
  transition: opacity 200ms linear;
}
html[dir="rtl"] .lds-geo__controls { right: auto; left: 24px; }
.lds-geo__ctrl {
  width: 36px;
  height: 36px;
  background: var(--lds-chrome);
  backdrop-filter: blur(8px);
  border: 1px solid var(--lds-line-strong);
  display: grid;
  place-items: center;
  font-family: Type2, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: var(--lds-white);
  cursor: pointer;
  transition: background 200ms;
}
.lds-geo__ctrl:hover { background: #102339; }
.lds-geo__ctrl--sm { font-size: 11px; }
.lds-geo__ctrl + .lds-geo__ctrl { border-top: 0; }

.lds-geo__attribution {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 5;
  font-family: Type2, "Segoe UI", Arial, sans-serif;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lds-steel-400);
  padding: 5px 10px;
  background: rgba(1, 28, 77, 0.75);
  border: 1px solid var(--lds-line);
  opacity: calc(1 - var(--lds-veil));
}
html[dir="rtl"] .lds-geo__attribution { right: auto; left: 12px; direction: ltr; }
.lds-geo__attribution a { color: inherit; text-decoration: none; }
.lds-geo__attribution a:hover { color: var(--lds-white); }

/* ---- port marker popups ------------------------------------------------ */
.geo-popup .mapboxgl-popup-content {
  background: rgba(1, 28, 77, 0.88);
  border: 1px solid var(--lds-line-strong);
  border-radius: 0;
  padding: 5px 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.geo-popup .mapboxgl-popup-tip { display: none; }
.lds-geo__pin-label-text {
  font-family: Type2, "Segoe UI", Arial, sans-serif;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #FFFFFF;
  white-space: nowrap;
}

/* ---- the fixed header, while this section is behind it ----------------- */
/* The theme's header is transparent and re-coloured per position: white over the
 * hero, navy everywhere else. Navy on this section's navy leaves the wordmark
 * and the nav effectively invisible. geo.js adds this class only while the
 * section is actually behind the header AND has finished turning dark, so no
 * other part of the page is affected for a single frame. */
html.lds-geo-under header,
html.lds-geo-under header * { color: #FFFFFF !important; }
html.lds-geo-under header svg,
html.lds-geo-under header svg * { fill: #FFFFFF !important; }
/* The burger is drawn as bars, which take a background rather than a colour. */
html.lds-geo-under header [class*="bar"],
html.lds-geo-under header [class*="burger"] > span,
html.lds-geo-under header [class*="burger"] > div { background-color: #FFFFFF !important; }

/* ---- phone ------------------------------------------------------------- */
/* The map stops being a background and becomes a square block under the copy,
 * so nothing is read over a busy part of the basemap on a small screen. */
@media (max-width: 899px) {
  .lds-geo {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .lds-geo__overlay { min-height: 0; }
  .lds-geo__map,
  html[dir="rtl"] .lds-geo__map {
    order: 2;
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    bottom: auto;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }
  .lds-geo__panel {
    max-width: 100%;
    padding: clamp(48px, 11vw, 72px) 20px clamp(28px, 6vw, 40px);
    gap: 24px;
  }
  /* On a phone the panel is a block above the map, on solid navy — there is no
   * basemap behind the copy to wash out, and the gradient would only bleed over
   * the map below it. */
  .lds-geo__panel::before { display: none; }
  .lds-geo__regions--numbers { gap: 16px 18px; }
  .lds-geo__region { max-width: none; }
  .lds-geo__region strong { font-size: 24px; }
  /* Anchored to the bottom of the square map rather than the section, so the
   * chrome cannot land under the site's fixed header. */
  .lds-geo__controls { bottom: 52px; right: 14px; flex-direction: row; }
  html[dir="rtl"] .lds-geo__controls { right: auto; left: 14px; }
  .lds-geo__ctrl + .lds-geo__ctrl { border-top: 1px solid var(--lds-line-strong); border-left: 0; }
  .lds-geo__attribution { bottom: 10px; right: 10px; font-size: 9px; }
  html[dir="rtl"] .lds-geo__attribution { right: auto; left: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .lds-geo__btn,
  .lds-geo__arrow,
  .lds-geo__ctrl { transition: none; }
}
