/* =============================================================================================
   Header layout: main menu bar
   - The bar keeps its own 51px slot (.tt-nav-wrap) so the page never jumps when it sticks.
   - Desktop: one row only; spacing tightens on narrower laptop screens instead of wrapping.
   ============================================================================================= */
.tt-nav-wrap { position: relative; z-index: 1000; min-height: 51px; background: #fff; border-bottom: 1px solid #e7e7e7; }
.tt-main-nav { position: relative; width: 100% !important; float: none !important; background: #fff; }
.tt-main-nav.tt-stuck { position: fixed; top: 0; left: 0; right: 0; z-index: 1030; box-shadow: 0 2px 10px rgba(0, 0, 0, .08); animation: tt-slide-down .2s ease-out; }
/* opacity only: a transform here would trap the fixed mobile drawer inside the bar while animating */
@keyframes tt-slide-down { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .tt-main-nav.tt-stuck { animation: none; } }

@media (min-width: 992px) {
  .tt-main-nav > .container { display: flex !important; align-items: stretch; flex-wrap: nowrap; }
  .tt-main-nav .navbar-header { display: none; }
  .tt-main-nav .dropdown-toggle::after { content: none !important; }
  .tt-main-nav .navbar-collapse { flex: 1 0 auto; display: flex !important; }
  .tt-main-nav ul.nav.navbar-nav { display: flex; flex-wrap: nowrap; float: none; white-space: nowrap; }
  .tt-main-nav ul.nav > li { float: none; display: flex; align-items: center; padding-top: 0 !important; padding-bottom: 0 !important; }
  .tt-main-nav ul.nav > li > a { display: flex; align-items: center; gap: 4px; height: 51px; }
  .tt-main-nav .attr-nav { flex: 0 0 auto; float: none; display: flex; align-items: stretch; margin: 0 0 0 auto; }
  .tt-main-nav .attr-nav > ul { display: flex; align-items: stretch; margin: 0 !important; }
  .tt-main-nav .attr-nav > ul > li { float: none; display: flex; align-items: center; white-space: nowrap; }
}
@media (min-width: 1400px) {
  nav.navbar.bootsnav.tt-main-nav ul.nav > li > a { padding: 0 13px !important; }
  .tt-main-nav .attr-nav { padding-left: 10px; }
}
/* Laptops: same items, tighter spacing */
@media (min-width: 992px) and (max-width: 1399.98px) {
  nav.navbar.bootsnav.tt-main-nav ul.nav > li > a { padding: 0 10px !important; font-size: 14px; }
  .tt-main-nav .attr-nav > ul > li > a { padding: 0 10px; font-size: 14px; }
}
@media (min-width: 992px) and (max-width: 1199.98px) {
  /* .tt-nav-wrap: must outrank MainMenu.vue's scoped "padding: 5px 15px !important" (same specificity, loads later) */
  .tt-nav-wrap nav.navbar.bootsnav.tt-main-nav ul.nav > li > a { padding: 0 10px !important; font-size: 13px; gap: 2px; }
  .tt-main-nav ul.nav > li > a .fa-chevron-down { font-size: .6rem !important; }
  .tt-main-nav .attr-nav > ul > li > a { padding: 0 8px; font-size: 13px; }
  .tt-main-nav .attr-nav > ul > li.search > button { padding: 0 10px; }
}
/* Mobile bar: [menu]  centred logo  [search] - two identical 44px buttons, logo exactly centred */
@media (max-width: 991.98px) {
  .tt-nav-wrap { min-height: 56px; }
  .tt-main-nav > .container {
    position: relative;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    height: 56px !important;
    padding: 0 8px !important;
  }
  .tt-main-nav .navbar-header { display: flex; align-items: center; float: none; margin: 0; }

  .tt-main-nav .navbar-toggler.tt-burger-btn,
  .tt-main-nav .attr-nav > ul > li.search > button {
    position: static !important;
    top: auto !important;
    float: none !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 12px;
    background: transparent !important;
    color: #1b1c26 !important;
    transition: background-color .15s;
  }
  .tt-main-nav .navbar-toggler.tt-burger-btn:hover,
  .tt-main-nav .navbar-toggler.tt-burger-btn:focus-visible,
  .tt-main-nav .attr-nav > ul > li.search > button:hover,
  .tt-main-nav .attr-nav > ul > li.search > button:focus-visible { background: #eef2f7 !important; }
  .tt-main-nav .attr-nav > ul > li.search .mobile-icon { font-size: 19px !important; }

  /* Logo in the exact centre of the bar, whatever the button widths */
  .tt-main-nav .tt-mobile-logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    margin: 0 !important;
    background: none !important;
  }
  .tt-main-nav .tt-mobile-logo img.logo { height: 34px !important; width: auto; max-width: 52vw; padding: 0 !important; object-fit: contain; }

  .tt-main-nav .attr-nav { float: none; margin: 0; display: flex; align-items: center; }
  .tt-main-nav .attr-nav > ul { display: flex; align-items: center; margin: 0 !important; padding: 0; }
  .tt-main-nav .attr-nav > ul > li { float: none; display: flex; align-items: center; border: 0 !important; }
  .tt-main-nav.tt-stuck { box-shadow: 0 2px 12px rgba(0, 0, 0, .1); }
}

/* Three-line menu icon that turns into an X while the drawer is open */
.tt-burger { position: relative; display: block; width: 22px; height: 16px; }
.tt-burger > span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2.5px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .25s ease, opacity .2s ease, top .25s ease;
}
.tt-burger > span:nth-child(1) { top: 0; }
.tt-burger > span:nth-child(2) { top: 6.75px; width: 70%; }
.tt-burger > span:nth-child(3) { top: 13.5px; }
.is-open .tt-burger > span:nth-child(1) { top: 6.75px; transform: rotate(45deg); }
.is-open .tt-burger > span:nth-child(2) { opacity: 0; }
.is-open .tt-burger > span:nth-child(3) { top: 6.75px; transform: rotate(-45deg); }
@media (prefers-reduced-motion: reduce) { .tt-burger > span { transition: none; } }

.skin-dark .tt-main-nav .navbar-toggler.tt-burger-btn,
.skin-dark .tt-main-nav .attr-nav > ul > li.search > button { color: #e5e7eb !important; }
@media (max-width: 991.98px) {
  .skin-dark .tt-main-nav .navbar-toggler.tt-burger-btn:hover,
  .skin-dark .tt-main-nav .attr-nav > ul > li.search > button:hover { background: #262931 !important; }
}

.skin-dark .tt-nav-wrap { background: #141414; border-color: #2b2d35; }
.skin-dark nav.navbar.bootsnav.tt-main-nav { background-color: #141414; }

/* =============================================================================================
   Accessibility (Lighthouse)
   ============================================================================================= */
/* "Read more" sits inside a paragraph: underline it so it is not distinguished by colour alone */
a.theme-color.inline, a.tt-read-more { text-decoration: underline; text-underline-offset: 2px; }
a.theme-color.inline:hover, a.tt-read-more:hover { text-decoration-thickness: 2px; }

/* Footer links (About us, Corporate Member, …) wrap on phones: give each a 32px tap area with spacing */
.sub-footer .footer-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 6px; padding-left: 0; }
@media (max-width: 767px) { .sub-footer .footer-nav { justify-content: center; } }
.sub-footer .footer-nav li { display: block; margin: 0; padding: 0 !important; }
.sub-footer .footer-nav li a { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 8px !important; }

/* =============================================================================================
   Mobile menu drawer (< 992px), opened by MainMenu (menuOpen). Slides with transform (GPU, no
   layout work per frame) instead of animating "left"; Bootstrap's collapse plugin is not used, so
   nothing fights the slide any more.
   ============================================================================================= */
@media (max-width: 991.98px) {
  nav.navbar.bootsnav.navbar-mobile.tt-main-nav .navbar-collapse,
  nav.navbar.bootsnav.navbar-mobile.tt-main-nav .navbar-collapse.show {
    position: fixed !important;
    top: 0;
    bottom: 0;
    left: 0 !important;
    width: min(300px, 86vw);
    height: 100% !important;
    max-height: none;
    display: block !important;
    z-index: 1060;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 24px;
    box-shadow: 4px 0 24px rgba(0, 0, 0, .25);
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform .28s cubic-bezier(.22, .8, .24, 1), visibility 0s linear .28s;
    will-change: transform;
  }
  nav.navbar.bootsnav.navbar-mobile.tt-main-nav .navbar-collapse.show {
    transform: none;
    visibility: visible;
    transition: transform .28s cubic-bezier(.22, .8, .24, 1), visibility 0s;
  }
  nav.navbar.bootsnav.navbar-mobile.tt-main-nav ul.nav { width: 100%; margin: 0; padding-left: 12px; }
  .tt-main-nav .tt-drawer-close { min-width: 44px; min-height: 44px; font-size: 20px; }
}
.tt-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1055;
  background: rgba(15, 18, 25, .5);
  -webkit-tap-highlight-color: transparent;
}
.tt-fade-enter-active, .tt-fade-leave-active { transition: opacity .28s ease; }
.tt-fade-enter, .tt-fade-leave-to { opacity: 0; }
/* page behind the open drawer stays put */
html.tt-no-scroll, html.tt-no-scroll body { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  nav.navbar.bootsnav.navbar-mobile.tt-main-nav .navbar-collapse,
  nav.navbar.bootsnav.navbar-mobile.tt-main-nav .navbar-collapse.show,
  .tt-fade-enter-active, .tt-fade-leave-active { transition: none; }
}

/* =============================================================================================
   Vue carousels (vue-owl-carousel): its root <div> has no class and no position, so the round
   arrows (top: 50%, absolute) were placed against a far-away ancestor - e.g. in the middle of the
   News & Analysis block, where clicking them moved an off-screen carousel. Anchor them to their
   own carousel.
   ============================================================================================= */
div:has(> [id^="carousel_prev_"]),
div:has(> [id^="carousel_next_"]) { position: relative; }

/* style.css sets overflow-x: hidden on BOTH html and body. That turns <body> into its own scroll
   container that never scrolls, so position: sticky never works anywhere on the site (e.g. the
   e-magazine year bar, the FAQ sidebar). "clip" still prevents sideways scrolling without creating
   a scroll container. Older browsers without "clip" keep the previous behaviour. */
@supports (overflow: clip) {
  html, body { overflow-x: clip; }
}

/* =============================================================================================
   Home hero (Slider.vue): same 10px gutter as the section grid below it (.row-m + .col-p), so the
   slider's columns line up with Daily Updates / the right sidebar. Desktop: 8 + 4 columns with the
   two side cards filling the hero height. Tablet: hero full width, side cards in two columns.
   ============================================================================================= */
@media (min-width: 768px) {
  .slider-inner > .container > .row.thm-margin,
  .slider-inner .slider-right-post.thm-margin { margin: 0 -5px !important; }
  .slider-inner > .container > .row > .thm-padding,
  .slider-inner .slider-right-post > .thm-padding { padding: 0 5px !important; }
  .slider-inner .post-height-2 { margin: 0 0 10px; }
}
@media (min-width: 992px) {
  .slider-inner .post-height-2,
  .slider-inner .slider-right-post .news-image img { height: 187.5px; }
  .slider-inner .slider-right-post > .thm-padding:last-child .post-height-2 { margin-bottom: 0; }
}
@media (min-width: 768px) and (max-width: 991.98px) {
  .slider-inner .slider-right-post.thm-margin { margin: 10px -5px 0 !important; }
  .slider-inner .post-height-1,
  .slider-inner .post-height-1 .news-image img { height: 360px; }
  .slider-inner .post-height-2,
  .slider-inner .slider-right-post .news-image img { height: 190px; }
  .slider-inner .post-height-2 { margin-bottom: 0; }
}

/* Latest Videos (Video.vue): playlist items were 350px + 2rem margins inside a 350px panel and ran
   past the right edge of the section. Fit them inside the panel. */
.RYPP .RYPP-playlist .video-item { width: auto; max-width: none; margin: 0 16px 16px; }
@media (min-width: 768px) { .slider-inner { margin-bottom: 20px; } }

/* Mobile/tablet menu bar: the burger and search glyphs line up with the page content edges below
   (the 44px buttons centre a 22px / 19px glyph, so each button sits 11px / 12.5px outside the edge). */
@media (max-width: 991.98px) {
  .tt-main-nav .navbar-header { padding: 0 !important; }
  .tt-main-nav .attr-nav { position: static !important; right: auto !important; }
}
@media (min-width: 768px) and (max-width: 991.98px) {
  .tt-main-nav > .container { padding: 0 2.5px 0 4px !important; }
}
@media (max-width: 767.98px) {
  .tt-main-nav > .container { padding: 0 !important; }
  .tt-main-nav .navbar-toggler.tt-burger-btn { margin-left: -1px !important; }
  .tt-main-nav .attr-nav > ul > li.search > button { margin-right: -2.5px !important; }
}
