/* ==========================================================================
   The service bar (Views/Shared/_ServiceBar.cshtml, IA-PLAN section 7)
   A slim deep-green row above the header with every Islamic Portal service; the one the visitor is on is a pill.
   It is quiet on purpose: small type, soft ink, no shadow, so the main header stays the star. It scrolls away with
   the page (the header below it stays sticky, so fitHeader and the anchors' scroll offsets are unchanged).
   Phones: a sideways strip with short names and faded edges. Light and dark, RTL (logical properties), Teen Academy.
   The Learning Hub (LH1): the same bar above Learn's own bar in the Learn shell, which has none of the site's base.
   ========================================================================== */

.ip-svc {
  --svc-h: 34px;
  --svc-bg: #0b3024;
  --svc-bg-2: #0f3f2f;
  --svc-ink: rgba(229, 243, 236, .76);
  --svc-ink-hover: #ffffff;
  --svc-hover: rgba(255, 255, 255, .08);
  --svc-rule: rgba(255, 255, 255, .14);
  --svc-pill: linear-gradient(180deg, #ffffff 0%, #f1f7f3 100%);
  --svc-pill-ink: #0d3b29;
  --svc-pill-icon: #1f7a63;
  --svc-pill-ring: 0 0 0 1px rgba(255, 255, 255, .5) inset, 0 3px 10px -4px rgba(0, 0, 0, .45);
  --svc-focus: #e6b85c;
  --svc-menu-bg: var(--ip-surface, #ffffff);
  --svc-menu-ink: var(--ip-ink, #1c1c1c);
  --svc-menu-muted: var(--ip-muted, #5f6673);
  --svc-menu-line: var(--ip-line, #ebe8df);
  --svc-menu-hover: #f3f8f5;
  --svc-tile: #eaf6ef;
  --svc-tile-ink: #1f7a63;
  --svc-soon-bg: #fff4dc;
  --svc-soon-ink: #8a6414;
  position: relative;
  z-index: 1031; /* above the sticky header (1030), so the menus drop over it */
  background:
    radial-gradient(120% 220% at 0% 0%, rgba(46, 184, 114, .22) 0%, transparent 45%),
    radial-gradient(90% 200% at 100% 100%, rgba(230, 184, 92, .16) 0%, transparent 50%),
    linear-gradient(90deg, var(--svc-bg) 0%, var(--svc-bg-2) 100%);
  color: var(--svc-ink);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .005em;
}
/* The site's eight-point star lattice, barely there. */
.ip-svc::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--ip-pattern-light, none);
  background-size: 72px 72px;
  opacity: .55;
  pointer-events: none;
}
/* A hairline of the brand gradient where the bar meets the header. */
.ip-svc::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(46, 184, 114, 0) 0%, rgba(46, 184, 114, .55) 30%, rgba(230, 184, 92, .55) 70%, rgba(230, 184, 92, 0) 100%);
  pointer-events: none;
}

[data-theme="dark"] .ip-svc,
body.dark .ip-svc {
  --svc-bg: #02090b;
  --svc-bg-2: #061210;
  --svc-ink: rgba(214, 228, 222, .7);
  --svc-hover: rgba(255, 255, 255, .06);
  --svc-rule: rgba(255, 255, 255, .1);
  --svc-pill: linear-gradient(180deg, rgba(46, 184, 114, .24) 0%, rgba(46, 184, 114, .14) 100%);
  --svc-pill-ink: #d4f7e4;
  --svc-pill-icon: #5fd49a;
  --svc-pill-ring: 0 0 0 1px rgba(95, 212, 154, .38) inset;
  --svc-menu-hover: rgba(46, 184, 114, .08);
  --svc-tile: rgba(46, 184, 114, .14);
  --svc-tile-ink: #5fd49a;
  --svc-soon-bg: rgba(230, 184, 92, .14);
  --svc-soon-ink: #ecc879;
}

.ip-svc__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--svc-h);
}
/* Centred on every site. On phones the strip fills the row and scrolls, so the items centre with auto margins: they
   collapse to 0 when the strip overflows, and the first item stays reachable (justify-content would cut it off). */
.ip-svc__item:first-child {
  margin-inline-start: auto;
}
.ip-svc__item:last-child {
  margin-inline-end: auto;
}

.ip-svc__list {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ip-svc__item {
  display: flex;
  flex: none;
  align-items: center;
}
/* Learning sites first, then the products for masjids, businesses and homes: a hairline between the two families. */
.ip-svc__item--masjid {
  margin-inline-start: 6px;
  padding-inline-start: 8px;
  border-inline-start: 1px solid var(--svc-rule);
}

.ip-svc__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding-inline: 10px;
  border-radius: 999px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--ip-motion-fast, 150ms) ease, background-color var(--ip-motion-fast, 150ms) ease;
}
.ip-svc__link:hover {
  color: var(--svc-ink-hover);
  background: var(--svc-hover);
}
/* An inset ring: the strip clips anything drawn outside its items. */
.ip-svc__link:focus-visible {
  outline: none;
  color: var(--svc-ink-hover);
  box-shadow: 0 0 0 2px var(--svc-focus) inset;
}

.ip-svc__icon {
  flex: none;
  width: 15px;
  height: 15px;
  opacity: .9;
}
.ip-svc__short {
  display: none;
}
.ip-svc__chev {
  flex: none;
  width: 11px;
  height: 11px;
  margin-inline-start: -1px;
  opacity: .75;
  transition: transform var(--ip-motion-base, 200ms) var(--ip-ease-out, ease);
}
/* A menu's link ends in its chevron, which brings its own space: a little less padding after it keeps the row short. */
.ip-svc__link[aria-controls] {
  padding-inline-end: 6px;
}
.ip-svc__link[aria-expanded="true"] .ip-svc__chev {
  transform: rotate(180deg);
}

.ip-svc__item.is-current .ip-svc__link {
  color: var(--svc-pill-ink);
  background: var(--svc-pill);
  box-shadow: var(--svc-pill-ring);
  font-weight: 650;
}
.ip-svc__item.is-current .ip-svc__icon {
  color: var(--svc-pill-icon);
  opacity: 1;
}
.ip-svc__item.is-current .ip-svc__link:focus-visible {
  box-shadow: var(--svc-pill-ring), 0 0 0 2px var(--svc-focus) inset;
}

/* "Coming soon" on the bar itself, for the items in ServiceBar:ComingSoon (production only): a small gold tag with a
   softly pulsing dot, readable without opening the menu. */
.ip-svc__badge {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 4px;
  height: 16px;
  margin-inline-start: 2px;
  padding-inline: 6px 7px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(240, 201, 120, .26) 0%, rgba(230, 184, 92, .12) 100%);
  box-shadow: 0 0 0 1px rgba(230, 184, 92, .5) inset;
  color: #f3d58f;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .04em;
  line-height: 1;
  text-transform: uppercase;
}
.ip-svc__badge::before {
  content: "";
  flex: none;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: ip-svc-soon 2.4s ease-out infinite;
}
@keyframes ip-svc-soon {
  0% {
    box-shadow: 0 0 0 0 rgba(243, 213, 143, .6);
  }
  70%,
  100% {
    box-shadow: 0 0 0 5px rgba(243, 213, 143, 0);
  }
}
.ip-svc__badge-short {
  display: none;
}
.ip-svc__item.is-current .ip-svc__badge {
  background: var(--svc-soon-bg);
  box-shadow: 0 0 0 1px rgba(138, 100, 20, .22) inset;
  color: var(--svc-soon-ink);
}

/* ---------- The menus (For Masjid, For Businesses, For Household) ---------- */

.ip-svc__menu {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-start: var(--svc-menu-x, 12px);
  width: min(380px, calc(100vw - 24px));
  padding: 6px;
  border: 1px solid var(--svc-menu-line);
  border-radius: 16px;
  background: var(--svc-menu-bg);
  color: var(--svc-menu-ink);
  box-shadow: 0 2px 6px rgba(16, 24, 20, .06), 0 24px 48px -16px rgba(16, 24, 20, .32);
  font-size: 14px;
  line-height: 1.35;
  letter-spacing: 0;
  animation: ip-svc-drop var(--ip-motion-panel, 300ms) var(--ip-ease-out, ease) both;
}
[data-theme="dark"] .ip-svc__menu,
body.dark .ip-svc__menu {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .04), 0 28px 56px -18px rgba(0, 0, 0, .8);
}
.ip-svc__menu[hidden] {
  display: none;
}
@keyframes ip-svc-drop {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.ip-svc__menu-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ip-svc__menu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
}
.ip-svc__menu-link:hover,
.ip-svc__menu-link:focus-visible {
  background: var(--svc-menu-hover);
  color: inherit;
}
.ip-svc__menu-link:focus-visible,
.ip-svc__menu-all:focus-visible {
  outline: 2px solid var(--ip-focus, #1f7a63);
  outline-offset: -2px;
}

.ip-svc__menu-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--svc-tile);
  color: var(--svc-tile-ink);
}
.ip-svc__menu-svg {
  width: 21px;
  height: 21px;
}

.ip-svc__menu-text {
  display: grid;
  flex: 1 1 auto;
  gap: 2px;
  min-width: 0;
}
.ip-svc__menu-title {
  font-weight: 650;
}
.ip-svc__menu-line {
  color: var(--svc-menu-muted);
  font-size: 12.5px;
}

.ip-svc__soon {
  flex: none;
  align-self: flex-start;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--svc-soon-bg);
  color: var(--svc-soon-ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
}

.ip-svc__menu-all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  padding: 10px 12px;
  border-top: 1px solid var(--svc-menu-line);
  border-radius: 0 0 12px 12px;
  color: var(--ip-link, #1a6e58);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}
.ip-svc__menu-all:hover {
  color: var(--ip-link, #1a6e58);
  background: var(--svc-menu-hover);
}
.ip-svc__go {
  flex: none;
  width: 16px;
  height: 16px;
}
[dir="rtl"] .ip-svc__go {
  transform: scaleX(-1);
}

/* ---------- The Teen Academy: the academy's night sky and aurora (and the teens' Learning Hub, ip-svc--teen) ---------- */

.tn .ip-svc,
.ip-svc.ip-svc--teen {
  --svc-bg: #05040c;
  --svc-bg-2: #0b0918;
  --svc-ink: rgba(226, 222, 250, .72);
  --svc-rule: rgba(196, 186, 255, .16);
  --svc-pill: linear-gradient(100deg, rgba(25, 217, 154, .22), rgba(79, 141, 255, .2) 55%, rgba(168, 107, 255, .22));
  --svc-pill-ink: #f3f1ff;
  --svc-pill-icon: #7cf3c8;
  --svc-pill-ring: 0 0 0 1px rgba(124, 243, 200, .38) inset;
  --svc-focus: #8fb0ff;
  --svc-menu-bg: var(--tn-surface, #121022);
  --svc-menu-ink: var(--tn-ink, #f3f1ff);
  --svc-menu-muted: var(--tn-muted, #a29dbf);
  --svc-menu-line: var(--tn-line, rgba(196, 186, 255, .1));
  --svc-menu-hover: rgba(124, 243, 200, .07);
  --svc-tile: rgba(25, 217, 154, .14);
  --svc-tile-ink: #7cf3c8;
  --svc-soon-bg: rgba(255, 201, 77, .14);
  --svc-soon-ink: #ffc94d;
  background:
    radial-gradient(80% 240% at 0% 0%, rgba(25, 217, 154, .14) 0%, transparent 50%),
    radial-gradient(80% 240% at 100% 100%, rgba(168, 107, 255, .16) 0%, transparent 55%),
    linear-gradient(90deg, var(--svc-bg), var(--svc-bg-2));
}
.tn .ip-svc::before,
.ip-svc--teen::before {
  display: none;
}
/* Lined up with the academy's header. */
.tn .ip-svc__inner {
  max-width: 1440px;
  padding-inline: clamp(12px, 2.4vw, 32px);
}
.tn .ip-svc::after,
.ip-svc--teen::after {
  background: linear-gradient(90deg, rgba(25, 217, 154, 0), rgba(25, 217, 154, .5) 30%, rgba(79, 141, 255, .5) 60%, rgba(168, 107, 255, 0));
}
.tn .ip-svc__menu-all,
.tn .ip-svc__menu-all:hover,
.ip-svc--teen .ip-svc__menu-all,
.ip-svc--teen .ip-svc__menu-all:hover {
  color: var(--tn-brand, #2fe0a5);
}
/* A lesson played full screen keeps nothing above it. */
.tn--play .ip-svc {
  display: none;
}

/* ---------- The Learning Hub: the bar above Learn's own in the Learn shell (LH1) ---------- */
/* The shell loads none of the website's base (Bootstrap, tokens, fonts), so the bar brings what it needs: Learn's own
   sans (the plans page keeps the site's), the box model, a row as wide as Learn's bar, and its menus' colours. It scrolls
   away like on the website, so Learn's sticky bar still sticks at the top; --ln-above tells Learn how much sits above
   its bar at the top of the page (its offline note and its phone menu allow for it). */
.ln-shell:has(> .ip-svc) {
  --ln-above: 34px;
}
.ln-shell .ip-svc {
  font-family: "Learn Sans", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.ln-shell.ip-body .ip-svc {
  font-family: inherit;
}
.ln-shell .ip-svc *,
.ln-shell .ip-svc *::before,
.ln-shell .ip-svc *::after {
  box-sizing: border-box;
}
.ln-shell .ip-svc__inner {
  max-width: 1480px;
  margin-inline: auto;
  padding-inline: 20px;
}
.ln-shell .ip-svc:not(.ip-svc--teen) {
  --svc-menu-bg: #ffffff;
  --svc-menu-ink: #1f2430;
  --svc-menu-muted: #5f6673;
  --svc-menu-line: #ebe8df;
}
html[data-theme="dark"] .ln-shell .ip-svc:not(.ip-svc--teen) {
  --svc-menu-bg: #161b26;
  --svc-menu-ink: #eef0f5;
  --svc-menu-muted: #a3aab8;
  --svc-menu-line: rgba(255, 255, 255, .1);
  --svc-menu-hover: rgba(46, 184, 114, .1);
}
html[data-theme="dark"] .ln-shell .ip-svc:not(.ip-svc--teen) .ip-svc__menu-all {
  color: #5fd49a;
}

/* Keyboard users skip past the bar to the page (the shell's first link, shown only when it has focus). */
.ln-shell-skip {
  position: absolute;
  z-index: 1100;
  top: 6px;
  inset-inline-start: 12px;
  padding: 10px 16px;
  border-radius: 999px;
  background: #0b3024;
  color: #ffffff;
  font: 600 14px/1.2 "Learn Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--ip-motion-fast, 150ms) ease;
}
.ln-shell-skip:focus {
  transform: none;
  outline: 3px solid #e6b85c;
  outline-offset: 2px;
}

/* ---------- Narrower screens ---------- */

/* The bar's "Coming soon" tags say "Soon" below 1400 px, so the row still fits. */
@media (max-width: 1399.98px) {
  .ip-svc__badge-full {
    display: none;
  }
  .ip-svc__badge-short {
    display: inline;
  }
}

@media (max-width: 991.98px) {
  .ip-svc__full {
    display: none;
  }
  .ip-svc__short {
    display: inline;
  }
}

/* Wherever the row is wider than the screen (phones, long languages, the "Coming soon" tags), the strip scrolls
   sideways (the page never does) and its edges fade where there is more. When it fits, nothing changes. */
.ip-svc__list {
  margin-block: -4px; /* room for the pill's shadow inside the scroller */
  padding-block: 4px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.ip-svc__list::-webkit-scrollbar {
  display: none;
}
.ip-svc__list.has-after {
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent);
}
.ip-svc__list.has-before {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 36px);
  mask-image: linear-gradient(90deg, transparent, #000 36px);
}
.ip-svc__list.has-before.has-after {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 36px, #000 calc(100% - 36px), transparent);
}
[dir="rtl"] .ip-svc__list.has-after:not(.has-before) {
  -webkit-mask-image: linear-gradient(-90deg, #000 calc(100% - 36px), transparent);
  mask-image: linear-gradient(-90deg, #000 calc(100% - 36px), transparent);
}
[dir="rtl"] .ip-svc__list.has-before:not(.has-after) {
  -webkit-mask-image: linear-gradient(-90deg, transparent, #000 36px);
  mask-image: linear-gradient(-90deg, transparent, #000 36px);
}


/* Phones: the strip fills the row. */
@media (max-width: 767.98px) {
  .ip-svc__inner,
  .tn .ip-svc__inner,
  .ln-shell .ip-svc__inner {
    padding-inline: 0;
  }
  .ip-svc__list {
    flex: 1 1 auto;
    padding-inline: 8px;
  }
  .ip-svc__link {
    padding-inline: 9px;
  }
  .ip-svc__link[aria-controls] {
    padding-inline-end: 5px;
  }
  .ip-svc__item--masjid {
    margin-inline-start: 4px;
    padding-inline-start: 6px;
  }
  /* The menu spans the screen under the bar. */
  .ip-svc__menu {
    inset-inline: 8px;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ip-svc__link,
  .ip-svc__chev,
  .ln-shell-skip {
    transition: none;
  }
  .ip-svc__menu,
  .ip-svc__badge::before {
    animation: none;
  }
}

@media print {
  .ip-svc {
    display: none !important;
  }
}
