/* explore-all.css — the full-screen "Explore all of Emaar" directory.
   Moved out of page.css so every page can carry the same dialog: it is the
   footer's one global destination, and it used to exist only on the home
   page. Pairs with explore-all.js, which injects the markup. */

/* ——————————————— Explore all of Emaar ————————————————————————————————————
   The source's full-screen directory, opened from the footer's CTA. Nine
   categories on the left, the active category's links on the right; below
   1024px the same markup reads as an accordion, which is why the panels are
   siblings of their buttons rather than a second column in the DOM.
   ———————————————————————————————————————————————————————————————————————— */
.explore-all {
  position: fixed;
  inset: 0;
  /* Above the mobile "More" sheet (120), which is where the footer — and so
     the button that opens this — lives below 1024px. */
  z-index: var(--z-drawer-top);
  display: flex;
  flex-direction: column;
  background: var(--p-night-800);
  color: var(--em-text-on-inverse);
  opacity: 0;
  transition: opacity 0.45s ease;
}
.explore-all.is-open { opacity: 1; }
.explore-all[hidden] { display: none; }

.explore-all__top {
  flex: none;
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 26px);
  padding: clamp(18px, 3vh, 28px) clamp(20px, 4vw, 64px);
  border-bottom: 1px solid rgba(var(--em-rgb-on-inverse), 0.14);
}
.explore-all__logo {
  flex: none;
  display: flex;
  align-items: flex-start;
  font-size: 19px;
  color: var(--em-text-on-inverse);
}
/* Nothing to borrow: a page with no footer wordmark drawn yet gets the name
   set, so the dialog's top rail is never left with a hole in it. */
.explore-all__logo--text {
  font-family: var(--font-display, Georgia, "Times New Roman", serif);
  letter-spacing: 0.06em;
  line-height: 1;
}
.explore-all__logo svg { height: 1em; width: auto; display: block; }
/* The mark is borrowed from the footer, where its fill comes from a
   .site-footer rule that does not reach in here — without this the glyphs
   fall back to black and vanish into the ground. */
.explore-all__logo svg,
.explore-all__logo path { fill: currentColor; }
.explore-all__logo svg + svg { margin-left: 0.0497em; }
.explore-all__eyebrow {
  margin: 0;
  font-family: var(--font-sans), "Segoe UI", system-ui, sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--em-text-eyebrow-neutral-on-inverse);
  white-space: nowrap;
}
.explore-all__close {
  margin-left: auto;
  flex: none;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(var(--em-rgb-on-inverse), 0.3);
  border-radius: 50%;
  color: var(--em-text-on-inverse);
  cursor: pointer;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.explore-all__close:hover {
  border-color: var(--em-text-on-inverse);
  background: rgba(var(--em-rgb-on-inverse), 0.1);
}
.explore-all__close svg { width: 14px; height: 14px; display: block; }

/* The dialog carries its own ring: it is injected into thirty-odd pages, and
   several of them never styled :focus, so the browser's blue default was
   turning up on the close mark. Keyboard only — the close button is focused
   on open, and a mouse user should not see a ring for that. */
.explore-all__close:focus-visible,
.explore-all__cat:focus-visible,
.explore-all__link:focus-visible {
  outline: 2px solid var(--em-text-on-inverse);
  outline-offset: 3px;
}
.explore-all__close:focus:not(:focus-visible),
.explore-all__cat:focus:not(:focus-visible),
.explore-all__link:focus:not(:focus-visible) { outline: none; }

.explore-all__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 18px 22px 40px;
}

/* ——— The category rows ——— */
.explore-all__cat {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 17px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(var(--em-rgb-on-inverse), 0.13);
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: opacity 0.5s ease;
}
.explore-all__cat-n {
  flex: none;
  width: 22px;
  font-family: var(--font-sans), "Segoe UI", system-ui, sans-serif;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--em-text-accent-on-inverse);
}
.explore-all__cat-label {
  flex: 1;
  font-family: var(--font-display), Candara, "Trebuchet MS", sans-serif;
  font-size: 22px;
  line-height: 1.1;
  transition: transform 0.5s var(--em-ease-soft);
}
.explore-all__cat-count { display: none; }
.explore-all__cat-sign {
  flex: none;
  font-size: 17px;
  line-height: 1;
  color: rgba(var(--em-rgb-on-inverse), 0.5);
}
.explore-all__cat-sign::before { content: "+"; }
.explore-all__cat.is-active .explore-all__cat-sign::before { content: "\2212"; }

/* ——— The links ——— */
.explore-all__panel[hidden] { display: none; }
.explore-all__panel-title { display: none; }
.explore-all__links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 13px;
  padding: 2px 0 22px 36px;
}
.explore-all__link {
  font-family: var(--font-sans), "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  color: rgba(var(--em-rgb-on-inverse), 0.76);
  text-decoration: none;
  transition: transform 0.4s var(--em-ease-soft), color 0.3s ease;
}
.explore-all__link:hover { color: var(--em-text-on-inverse); }

/* ——— Touch widths: the accordion rows and links carry 44px targets ——— */
@media (max-width: 1023px) {
  .explore-all__cat { min-height: var(--em-control-min); }
  .explore-all__links { gap: 0; }
  .explore-all__link { padding-block: 0.72rem; }
}

/* ——— Pointer widths: the source's two columns. The buttons stack in column
   one and every panel spans the full height of column two, so the nine
   explicit rows below are what makes `1 / -1` reach the bottom. ——— */
@media (min-width: 1024px) {
  .explore-all__body {
    display: grid;
    grid-template-columns: 42% 1fr;
    grid-template-rows: repeat(9, max-content) 1fr;
    align-content: start;
    padding: 0;
    overflow: hidden;
  }
  .explore-all__cat {
    grid-column: 1;
    align-items: baseline;
    gap: 16px;
    padding: clamp(8px, 1.1vh, 13px) clamp(20px, 4vw, 64px);
    border-bottom: 0;
    opacity: 0.42;
  }
  .explore-all__cat:first-of-type { margin-top: clamp(22px, 4vh, 44px); }
  .explore-all__cat.is-active { opacity: 1; }
  .explore-all__cat-n { width: 24px; }
  .explore-all__cat-label {
    flex: none;
    font-size: clamp(21px, 2.3vw, 32px);
  }
  .explore-all__cat.is-active .explore-all__cat-label {
    transform: translateX(8px);
  }
  .explore-all__cat-count {
    display: block;
    margin-left: auto;
    font-family: var(--font-sans), "Segoe UI", system-ui, sans-serif;
    font-size: 11.5px;
    color: rgba(var(--em-rgb-on-inverse), 0.38);
  }
  .explore-all__cat-sign { display: none; }

  /* The divider is the panel's own left edge: the panel spans every row of
     column two, so its border draws the full-height rule the source has on
     the left column. A separate rule element would be a placed grid item and
     would push the auto-placed buttons out of column one. */
  .explore-all__panel {
    grid-column: 2;
    grid-row: 1 / -1;
    min-width: 0;
    border-left: 1px solid rgba(var(--em-rgb-on-inverse), 0.12);
    overflow-y: auto;
    padding: clamp(22px, 4vh, 44px) clamp(24px, 4vw, 60px);
  }
  .explore-all__panel-title {
    display: block;
    margin: 0 0 26px;
    font-family: var(--font-sans), "Segoe UI", system-ui, sans-serif;
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--em-text-eyebrow-neutral-on-inverse);
  }
  .explore-all__links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 13px clamp(20px, 3vw, 44px);
    padding: 0;
  }
  .explore-all__link {
    flex: 0 1 calc(50% - clamp(10px, 1.5vw, 22px));
    min-width: 190px;
    padding: 5px 0;
  }
  .explore-all__link:hover { transform: translateX(5px); }
}

@media (prefers-reduced-motion: reduce) {
  .explore-all,
  .explore-all__cat,
  .explore-all__cat-label,
  .explore-all__link { transition: none; }
}
