/**
 * The shell: Jannah's header, menu and footer, in this site's colours.
 *
 * components.css does not name parent-theme elements. These rules do, because
 * the masthead and the footer are the parent's markup and the identity still
 * has to reach them. Tokens only; no sizes copied from the prototype.
 */

#theme-header,
#theme-header .logo-row,
#theme-header #main-nav,
#theme-header #main-nav.main-nav-dark-skin {
  background: var(--ai-nav-bg);
  --main-nav-background: var(--ai-nav-bg);
  --main-nav-secondry-background: rgba(255, 255, 255, 0.06);
  --main-nav-primary-color: var(--ai-brand);
  --main-nav-contrast-primary-color: var(--ai-on-brand);
  --main-nav-text-color: var(--ai-nav-text-on);
  --main-nav-secondry-text-color: var(--ai-nav-text);
  --main-nav-main-border-color: transparent;
}

/* The logo row and the menu are one masthead. Without this inset the
 * wordmark's last mark sits on the window edge and gets clipped. */
#theme-header {
  padding-inline: clamp(1rem, 3vw, 1.5rem);
  box-sizing: border-box;
}

/* A short brand rule under the bar, in place of the parent's deep shadow. */
#theme-header.has-shadow {
  box-shadow: 0 3px 0 var(--ai-brand);
}

/* v0.3.0: gradient masthead + shadow once the page moves (polish.js). */
#theme-header {
  background: linear-gradient(160deg, var(--ai-nav-bg) 0%, #0a1250 70%, #101d6e 100%);
}

#theme-header.is-scrolled {
  box-shadow: 0 3px 0 var(--ai-brand), 0 18px 38px -18px rgb(6 12 70 / 55%);
}

#theme-header #main-nav .menu > li > a {
  position: relative;
}

#theme-header #main-nav .menu > li > a::after {
  content: "";
  position: absolute;
  inset-inline: 0.75rem;
  inset-block-end: 0.35rem;
  block-size: 2px;
  border-radius: 999px;
  background: var(--ai-gold-on-navy, #e6c98a);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 220ms ease-out;
}

#theme-header #main-nav .menu > li > a:hover::after,
#theme-header #main-nav .menu > li > a:focus-visible::after,
#theme-header #main-nav .menu > li.tie-current-menu > a::after,
#theme-header #main-nav .menu > li.current-menu-item > a::after {
  transform: scaleX(1);
}

@media (prefers-reduced-motion: reduce) {
  #theme-header #main-nav .menu > li > a::after,
  #theme-header #main-nav .menu-sub-content,
  #main-nav .mea-mega {
    transition: none;
  }

  #theme-header #main-nav .menu-sub-content,
  #main-nav .mea-mega {
    transform: none;
  }
}

#theme-header #main-nav {
  border-width: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#theme-header #logo .tie-logo-picture {
  display: none;
}

#theme-header #logo .ai-logo {
  max-width: min(16rem, 70vw);
}

#theme-header #logo.text-logo .ai-account-link,
#theme-header .ai-account-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin-inline-start: 0.5rem;
  padding: 0.3rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  color: var(--ai-nav-text-on);
  font-size: 0.85rem;
  line-height: 1.2;
  text-decoration: none;
}

#theme-header .ai-account-link:hover,
#theme-header .ai-account-link:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

/* The one filled control on the masthead: gold on navy, navy text. */
#theme-header #logo.text-logo .ai-subscribe-link,
#theme-header .ai-subscribe-link {
  gap: 0.4rem;
  border-color: var(--ai-gold-on-navy);
  background: var(--ai-gold-on-navy);
  color: var(--ai-nav-bg);
  font-weight: var(--ai-fw-bold);
}

#theme-header .ai-subscribe-link::before {
  content: '';
  inline-size: 1rem;
  block-size: 1rem;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3.5 6.5l8.5 6.5 8.5-6.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3.5 6.5l8.5 6.5 8.5-6.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

#theme-header .ai-subscribe-link:hover,
#theme-header .ai-subscribe-link:focus-visible {
  background: #fff;
  border-color: #fff;
  color: var(--ai-nav-bg);
}

#theme-header .ai-subscribe-link__short {
  display: none;
}

@media (max-width: 480px) {
  #theme-header .ai-subscribe-link__long {
    display: none;
  }

  #theme-header .ai-subscribe-link__short {
    display: inline;
  }

  #theme-header .ai-account-link--register {
    display: none;
  }
}

#theme-header .ai-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  margin-inline-start: 0.5rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: transparent;
  color: var(--ai-nav-text-on);
  cursor: pointer;
}

#theme-header .ai-theme-toggle:hover,
#theme-header .ai-theme-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.1);
}

#theme-header .ai-theme-toggle:focus-visible {
  outline: 2px solid var(--ai-on-brand);
  outline-offset: 2px;
}

#theme-header .ai-theme-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
}

#theme-header .ai-theme-toggle .ai-theme-toggle__icon--sun,
#theme-header .ai-theme-toggle .ai-theme-toggle__label--day {
  display: none;
}

html[data-theme='dark'] #theme-header .ai-theme-toggle .ai-theme-toggle__icon--moon,
html[data-theme='dark'] #theme-header .ai-theme-toggle .ai-theme-toggle__label--night {
  display: none;
}

html[data-theme='dark'] #theme-header .ai-theme-toggle .ai-theme-toggle__icon--sun {
  display: block;
}

html[data-theme='dark'] #theme-header .ai-theme-toggle .ai-theme-toggle__label--day {
  display: inline;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme='light']) #theme-header .ai-theme-toggle .ai-theme-toggle__icon--moon,
  html:not([data-theme='light']) #theme-header .ai-theme-toggle .ai-theme-toggle__label--night {
    display: none;
  }

  html:not([data-theme='light']) #theme-header .ai-theme-toggle .ai-theme-toggle__icon--sun {
    display: block;
  }

  html:not([data-theme='light']) #theme-header .ai-theme-toggle .ai-theme-toggle__label--day {
    display: inline;
  }
}

@media (max-width: 991px) {
  #theme-header .ai-theme-toggle {
    width: 2.75rem;
    height: 2.75rem;
  }
}

@media print {
  .ai-theme-toggle {
    display: none;
  }
}

/*
 * Identity row: the wordmark stays at the start, account actions sit at the
 * end. The parent's 40px logo margins made this row taller than the menu.
 */
#theme-header .logo-wrapper,
#theme-header .logo-container {
  float: none;
  box-sizing: border-box;
}

#theme-header #logo {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  float: none;
  /* Trimmed from 0.85rem: the logo row carried too much dead air above and
   * below the wordmark, which stacked onto the nav row below it. */
  margin: 0.4rem 0;
  text-align: start;
}

#theme-header #logo > a:first-child {
  margin-inline-end: auto;
}

@media (max-width: 991px) {
  /* Jannah clears the header fill on small screens, which exposed the page
   * through the masthead padding. */
  #tie-wrapper header#theme-header {
    background: var(--ai-nav-bg) !important;
  }

  #theme-header .logo-container,
  #theme-header.mobile-header-default .logo-container {
    background: var(--ai-nav-bg);
    box-shadow: none;
  }

  #theme-header #logo > a:first-child {
    min-width: 0;
    margin-inline-end: 0.75rem;
  }

  #theme-header #logo .ai-logo,
  #theme-header #logo .ai-logo svg {
    max-width: 100%;
    height: 1.65rem;
  }

  #theme-header .ai-account-link {
    flex: 0 0 auto;
    padding: 0.25rem 0.7rem;
  }
}

@media (min-width: 992px) {
  #theme-header .logo-wrapper,
  #theme-header .logo-container,
  #theme-header #logo {
    width: 100%;
  }

  #theme-header #main-nav {
    line-height: 48px;
  }

  #theme-header #menu-components-wrap {
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.25rem;
  }

  #theme-header .main-menu-wrap,
  #theme-header #main-nav-menu {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
  }

  #theme-header .header-menu .menu {
    align-items: center;
    width: 100%;
  }

  #theme-header #main-nav .menu > li > a {
    padding: 0 0.65rem;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 48px;
  }

  /* Contact closes the sections. The gap before it is the separator. */
  #theme-header #main-nav .menu > li.ai-nav-contact {
    display: flex;
    align-items: center;
    margin-inline-start: auto;
  }

  #theme-header #main-nav .menu > li.ai-nav-contact > a {
    margin-inline-start: 0.85rem;
    padding: 0.35rem 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 999px;
    line-height: 1.2;
    box-shadow: none;
  }

  #theme-header #main-nav .menu > li.ai-nav-contact > a:hover,
  #theme-header #main-nav .menu > li.ai-nav-contact > a:focus-visible,
  #theme-header #main-nav .menu > li.ai-nav-contact.current-menu-item > a,
  #theme-header #main-nav .menu > li.ai-nav-contact.tie-current-menu > a {
    background: var(--ai-brand);
    border-color: transparent;
    color: var(--ai-on-brand);
    box-shadow: none;
  }

  #theme-header .components {
    align-self: center;
    flex: 0 0 auto;
  }

  #theme-header .components .search-bar form {
    line-height: 34px;
  }

  #theme-header .components #search-input {
    color: var(--ai-nav-text-on);
  }

  #theme-header .components #search-input::placeholder {
    color: var(--ai-nav-text);
  }
}

/* Live suggestions inside Jannah's search popup (dark overlay). */
.tie-popup-search-wrap .mea-suggest,
.live-search-parent .mea-suggest {
  color: #14182b;
  z-index: 130;
  text-align: start;
}

.tie-popup-search-form,
.live-search-parent {
  position: relative;
}

.tie-popup-search-wrap .mea-suggest a:hover,
.tie-popup-search-wrap .mea-suggest a:focus-visible,
.tie-popup-search-wrap .mea-suggest [aria-selected="true"] a {
  background: #eef1f6;
}

#theme-header #logo .ai-logo svg {
  height: var(--ai-logo-h);
  width: auto;
  max-width: var(--ai-logo-w);
}

@media (min-width: 992px) {
  #theme-header #logo .ai-logo svg {
    height: var(--ai-logo-h);
  }
}

@media (max-width: 991px) {
  #theme-header .ai-account-link {
    min-height: 44px;
  }
}

/* Jannah's default menu paints the current item as a solid brand block.
 * On this bar that block reads as a button, not as the page you are on. */
#theme-header #main-nav.menu-style-solid-bg .menu > li > a,
#theme-header #main-nav.menu-style-solid-bg .menu > li.tie-current-menu > a,
#theme-header #main-nav.menu-style-solid-bg .menu > li:hover > a,
#theme-header #main-nav.menu-style-default .menu > li.tie-current-menu {
  background-color: transparent;
  border-bottom-width: 0;
  margin-bottom: 0;
}

#theme-header #main-nav.menu-style-default .menu > li.tie-current-menu > a:after {
  content: none;
}

#theme-header #main-nav .menu > li.tie-current-menu > a,
#theme-header #main-nav .menu > li.current-menu-item > a {
  box-shadow: inset 0 -3px 0 var(--ai-brand);
}

#theme-header #main-nav .menu > li.ai-nav-contact > a:hover,
#theme-header #main-nav .menu > li.ai-nav-contact > a:focus-visible,
#theme-header #main-nav .menu > li.ai-nav-contact.current-menu-item > a,
#theme-header #main-nav .menu > li.ai-nav-contact.tie-current-menu > a,
#theme-header #main-nav.menu-style-solid-bg .menu > li.ai-nav-contact:hover > a {
  background-color: var(--ai-brand);
  border-color: transparent;
  color: var(--ai-on-brand);
  box-shadow: none;
}

#main-nav .main-menu > ul > li > a,
#theme-header #main-nav .components > li > a {
  color: var(--ai-nav-text-on);
}

#main-nav .main-menu > ul > li > a:hover,
#main-nav .main-menu > ul > li > a:focus-visible,
#main-nav .main-menu > ul > li.current-menu-item > a,
#main-nav .main-menu > ul > li.current-menu-ancestor > a {
  color: var(--ai-on-brand);
}

/* -------------------------------------------------------------------
 *  Flyout menus — a Windows 11 "acrylic" treatment, shared by the plain
 *  dropdown (.menu-sub-content) and the hub mega panel (.mea-mega).
 *
 *  The parent paints .menu-sub-content with the navy nav background; here
 *  it becomes a translucent light sheet that blurs the page behind it,
 *  with soft rounded corners, a diffuse shadow, and rounded hover pills.
 *  It is anchored to the inline-start (the right edge in RTL) of its
 *  trigger so it opens from the right and never spills off-page.
 * ------------------------------------------------------------------- */
#theme-header #main-nav .menu > li.menu-item-has-children {
  position: relative;
}

/*
 * Parent items carry a dropdown caret. The parent theme draws it with an icon
 * font (tiefonticon) in ::before, absolutely placed over the label so it lands
 * inside the word. We drop that glyph and draw our own chevron beside the name:
 * a bordered square rotated to a downward caret, at the inline-end edge, with
 * room reserved by padding so it never overlaps the text. It flips up when the
 * flyout is open.
 */
#theme-header #main-nav .menu > li.menu-item-has-children > a {
  padding-inline-end: 1.35rem;
}

#theme-header #main-nav .menu > li.menu-item-has-children > a::before {
  content: "";
  font-family: inherit;
  position: absolute;
  top: 50%;
  inset-inline-start: auto;
  inset-inline-end: 0.5rem;
  width: 0.4rem;
  height: 0.4rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-inline-end: 1.5px solid currentColor;
  border-block-end: 1.5px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
  transition: transform 160ms ease;
}

#theme-header #main-nav .menu > li.menu-item-has-children:hover > a::before,
#theme-header #main-nav .menu > li.menu-item-has-children:focus-within > a::before {
  transform: translateY(-30%) rotate(-135deg);
}

@media (prefers-reduced-motion: reduce) {
  #theme-header #main-nav .menu > li.menu-item-has-children > a::before {
    transition: none;
  }
}

#theme-header #main-nav .menu-sub-content {
  box-sizing: border-box;
  position: absolute;
  /*
   * Touches the trigger row (no gap). An empty strip between the item and its
   * flyout sits outside the <li> and drops :hover while the pointer crosses it,
   * closing the menu before it can be reached. The acrylic shadow gives the
   * float; the air gap is not worth a broken menu.
   */
  top: 100%;
  inset-inline-start: 0;
  min-width: 14rem;
  width: max-content;
  max-width: min(22rem, calc(100vw - 2rem));
  padding: 0.3rem;
  border: 1px solid var(--ai-flyout-border, var(--ai-border));
  border-radius: 12px;
  /* Opaque sheet. A translucent blur let the story photo show through, so the
   * list looked as if it had dropped behind the page. */
  background: var(--ai-flyout-bg, var(--ai-bg));
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow:
    0 20px 48px -16px rgba(4, 8, 69, 0.3),
    0 4px 12px -6px rgba(4, 8, 69, 0.18);
  line-height: 1.45;
  /* Animate in from a hair above the trigger. */
  visibility: hidden;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition:
    opacity 160ms ease,
    transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 180ms;
}

#theme-header #main-nav .menu > li:hover > .menu-sub-content,
#theme-header #main-nav .menu > li:focus-within > .menu-sub-content {
  visibility: visible;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  z-index: 5;
  transition-delay: 0s;
}

#theme-header #main-nav .menu-sub-content > li {
  display: block;
  float: none;
  width: 100%;
}

#theme-header #main-nav .menu-sub-content a {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin: 1px 0;
  border-radius: 8px;
  color: var(--ai-text);
  line-height: 1.45;
  padding: 0.5rem 0.75rem;
  font-size: 0.92rem;
  font-weight: 600;
  white-space: normal;
  transition: background-color 120ms ease, color 120ms ease;
}

#theme-header #main-nav .menu-sub-content li:hover > a,
#theme-header #main-nav .menu-sub-content li.current-menu-item > a,
#theme-header #main-nav .menu-sub-content a:hover,
#theme-header #main-nav .menu-sub-content a:focus-visible {
  color: var(--ai-brand);
  background: color-mix(in srgb, var(--ai-brand) 10%, transparent);
}

/* الرصد الدوري reads like every other section: a plain label that inherits the
   shared dropdown caret. The dot pill is gone. Its groups stay inner menus: the
   country list opens beside the row, and «الأكثر متابعة» leads them. */

/* The open section gets the same brand underline an active item carries, so it
   is obvious which menu is expanded - the only cue that sets it apart. */
#theme-header #main-nav .menu > li.ai-nav-monitor:hover > a,
#theme-header #main-nav .menu > li.ai-nav-monitor:focus-within > a {
  box-shadow: inset 0 -3px 0 var(--ai-brand);
}

@media (min-width: 992px) {
  #theme-header #main-nav .menu > li.ai-nav-monitor {
    position: relative;
  }

  #theme-header #main-nav .ai-nav-monitor:hover > .menu-sub-content,
  #theme-header #main-nav .ai-nav-monitor:focus-within > .menu-sub-content {
    display: block;
  }

  #theme-header #main-nav .ai-nav-monitor > .menu-sub-content {
    inset-inline-start: auto;
    inset-inline-end: 0;
    min-width: 15.5rem;
    width: max-content;
    max-width: 18rem;
    padding: 0.4rem;
    overflow: visible;
  }

  #theme-header #main-nav .ai-nav-monitor > .menu-sub-content > li {
    position: relative;
    overflow: visible;
  }

  #theme-header #main-nav .ai-nav-monitor > .menu-sub-content > li > a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.6rem;
    font-weight: 700;
  }

  #theme-header #main-nav .ai-nav-monitor > .menu-sub-content > li.menu-item-has-children > a:before {
    content: none;
  }

  #theme-header #main-nav .ai-nav-monitor > .menu-sub-content > li.menu-item-has-children > a:after {
    content: "‹";
    margin-inline-start: auto;
    color: color-mix(in srgb, var(--ai-text) 55%, transparent);
    font-weight: 500;
  }

  #theme-header #main-nav .ai-nav-monitor > .menu-sub-content > li.ai-nav-followed > a {
    color: var(--ai-brand);
    background: color-mix(in srgb, var(--ai-brand) 12%, transparent);
  }

  #theme-header #main-nav .ai-nav-monitor > .menu-sub-content > li.ai-nav-group > a {
    border-inline-start: 3px solid var(--ai-brand);
  }

  #theme-header #main-nav .ai-nav-monitor > .menu-sub-content > li.ai-nav-intl {
    margin-top: 0.3rem;
    padding-top: 0.3rem;
    border-top: 1px solid color-mix(in srgb, var(--ai-border) 80%, transparent);
  }

  #theme-header #main-nav .ai-nav-monitor > .menu-sub-content > li:hover > a,
  #theme-header #main-nav .ai-nav-monitor > .menu-sub-content > li:focus-within > a {
    background: color-mix(in srgb, var(--ai-brand) 16%, transparent);
    color: var(--ai-brand);
  }

  #theme-header #main-nav .ai-nav-monitor .menu-sub-content .menu-sub-content {
    top: -0.2rem;
    inset-inline-start: auto;
    inset-inline-end: calc(100% - 0.45rem);
    z-index: 3;
    min-width: 13.5rem;
    width: max-content;
    max-width: 16rem;
    max-height: min(70vh, 26rem);
    overflow: auto;
    border-inline-start: 3px solid var(--ai-brand);
  }

  #theme-header #main-nav .ai-nav-monitor > .menu-sub-content > li:hover > .menu-sub-content,
  #theme-header #main-nav .ai-nav-monitor > .menu-sub-content > li:focus-within > .menu-sub-content {
    display: block;
    visibility: visible;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    transition-delay: 0s;
  }

  #theme-header #main-nav .ai-nav-monitor .ai-nav-note > a {
    font-weight: 500;
    color: color-mix(in srgb, var(--ai-text) 70%, transparent);
  }
}

/* Jannah paints the page white. The tokens already switch; the shell has to follow. */
#tie-wrapper,
.background-overlay,
.container-wrapper {
  background: var(--ai-bg);
  color: var(--ai-text-body);
}

#tie-wrapper {
  --base-color: var(--ai-text);
}

.container-wrapper {
  border-color: var(--ai-border);
}

#footer.site-footer {
  background: linear-gradient(180deg, #0a1250 0%, var(--ai-nav-bg) 45%);
  color: var(--ai-nav-text);
  border-block-start: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--ai-brand), #e6c98a, var(--ai-brand)) 1;
}

#footer .ai-site-links a {
  transition: color var(--ai-duration-fast, 120ms) ease-out, padding-inline-start var(--ai-duration-fast, 120ms) ease-out;
}

#footer .ai-site-links a:hover,
#footer .ai-site-links a:focus-visible {
  padding-inline-start: 0.3rem;
}

#footer .copyright-text {
  color: var(--ai-nav-text);
}

/* Primary nav already covers the sections; hide any leftover footer copy. */
#footer .footer-menu {
  display: none !important;
}

#footer #site-info {
  padding-block: 1.25rem 0.75rem;
}

#footer .ai-site-links {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem 1.5rem;
  max-width: none;
  margin: 0 auto 0.75rem;
  text-align: start;
  font-size: 0.875rem;
  line-height: 1.45;
}

#footer .ai-site-links h2 {
  margin: 0 0 0.25rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ai-nav-text);
  opacity: 0.85;
}

#footer .ai-site-links ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

#footer .ai-site-links li + li {
  margin-block-start: 0.15rem;
}

#footer .ai-site-links a {
  color: var(--ai-nav-text);
  text-decoration: none;
}

#footer .ai-site-links a:hover,
#footer .ai-site-links a:focus-visible {
  color: var(--ai-on-brand);
}

#footer .ai-channels {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin: 0 0 0.5rem;
  padding: 0;
  list-style: none;
}

@media (max-width: 991px) {
  #footer .ai-site-links {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  #footer .ai-site-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1rem;
  }
}

#footer .ai-channels a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
}

#footer .ai-channels a:hover,
#footer .ai-channels a:focus-visible {
  transform: translateY(-3px);
}

#footer .ai-channels svg {
  display: block;
  width: 2rem;
  height: 2rem;
  overflow: visible;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.35)) drop-shadow(0 3px 4px rgba(0, 0, 0, 0.4));
}

#footer .ai-channels a:hover svg,
#footer .ai-channels a:focus-visible svg {
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.35)) drop-shadow(0 5px 6px rgba(0, 0, 0, 0.45));
}

/* Anchor the mega to the menu row (not to its own item) so every hub opens
 * as one cohesive, right-aligned acrylic sheet that always stays on-screen. */
#main-nav #main-nav-menu > .menu {
  position: relative;
}

#main-nav .menu > li.mea-hub-item {
  position: static;
}

#main-nav .mea-mega {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  position: absolute;
  z-index: 40;
  /* Touches the nav row: a gap drops :hover before the panel is reached, and
     its own overflow:auto would clip any bridge pseudo-element anyway. */
  top: 100%;
  inset-inline-start: 0;
  width: min(58rem, calc(100vw - 2rem));
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.15rem 1.25rem;
  color: var(--ai-text);
  border: 1px solid var(--ai-flyout-border, var(--ai-border));
  border-radius: 14px;
  background: var(--ai-flyout-bg, var(--ai-bg));
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow:
    0 24px 60px -18px rgba(4, 8, 69, 0.34),
    0 6px 16px -8px rgba(4, 8, 69, 0.2);
  visibility: hidden;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition:
    opacity 170ms ease,
    transform 200ms cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0s linear 200ms;
}

#main-nav .mea-hub-item:hover > .mea-mega,
#main-nav .mea-hub-item:focus-within > .mea-mega {
  visibility: visible;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition-delay: 0s;
}

#main-nav .mea-mega__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(11rem, 0.8fr);
  gap: 1rem 1.5rem;
  align-items: start;
}

#main-nav .mea-mega__places {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.85rem 1.75rem;
}

#main-nav .mea-mega .mea-hub__places {
  flex: 0 0 auto;
  min-width: 7.5rem;
}

#main-nav .mea-mega h2,
#main-nav .mea-mega h3 {
  margin: 0 0 0.35rem;
  padding: 0 0 0.3rem;
  border-bottom: 1px solid rgba(4, 8, 69, 0.12);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ai-gold);
}

#main-nav .mea-mega ul {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

#main-nav .mea-mega .mea-hub__places a {
  display: block;
  margin-inline: -0.4rem;
  padding: 0.22rem 0.4rem;
  border-radius: 7px;
  color: var(--ai-text);
  font-size: 0.92rem;
  line-height: 1.45;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 120ms ease, color 120ms ease;
}

#main-nav .mea-mega .mea-hub__places a:hover,
#main-nav .mea-mega .mea-hub__places a:focus {
  color: var(--ai-brand);
  background: color-mix(in srgb, var(--ai-brand) 10%, transparent);
}

#main-nav .mea-mega__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(4, 8, 69, 0.1);
}

#main-nav .mea-mega__col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

#main-nav .mea-mega .mea-hub__stories {
  flex: 1 1 auto;
  min-width: 12rem;
  margin: 0;
}

#main-nav .mea-mega .mea-hub__stories h2 {
  margin: 0 0 0.15rem;
  padding: 0;
  border: 0;
}

#main-nav .mea-mega .mea-hub__stories a {
  display: -webkit-box;
  overflow: hidden;
  margin-inline: -0.4rem;
  padding: 0.2rem 0.4rem;
  border-radius: 7px;
  color: var(--ai-text);
  font-size: 0.84rem;
  line-height: 1.45;
  text-decoration: none;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  transition: background-color 120ms ease, color 120ms ease;
}

#main-nav .mea-mega .mea-hub__stories a:hover,
#main-nav .mea-mega .mea-hub__stories a:focus {
  color: var(--ai-brand);
  background: color-mix(in srgb, var(--ai-brand) 10%, transparent);
}

#main-nav .mea-mega__all {
  flex: 0 0 auto;
  margin-inline-start: auto;
  color: var(--ai-brand);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}

#main-nav .mea-mega__all:hover,
#main-nav .mea-mega__all:focus {
  color: var(--ai-brand-hover);
}

#main-nav .mea-mega .mea-hub__empty {
  margin: 0;
  font-size: 0.85rem;
}

.mea-mobile-nav {
  display: none;
}

@media (max-width: 991px) {
  #main-nav .mea-mega,
  #main-nav .mea-hub-item:hover > .mea-mega,
  #main-nav .mea-hub-item:focus-within > .mea-mega {
    display: none !important;
  }

  .mea-mobile-nav {
    display: flex;
    flex-wrap: wrap;
    box-sizing: border-box;
    width: 100%;
    gap: 0.35rem 0.85rem;
    padding: 0.6rem 1rem;
    background: var(--ai-nav-bg);
  }

  .mea-mobile-nav a {
    color: var(--ai-nav-text-on);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

.ai-consent {
  position: sticky;
  bottom: 0;
  z-index: 40;
  display: grid;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--ai-nav-bg, #060c46);
  color: var(--ai-nav-text-on, #fff);
}

.ai-consent a {
  color: inherit;
}

.ai-consent form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
