/* 01-section-block-notice.html */
/* Background: brand deep blue, same as the footer. */

        /* Fixed brand colour fading into secondary, safe in dark theme. */
        /* Ticker gradient: gold spark, brand navy, then secondary. */
        #block-notice {
          background-color: rgb(var(--pro-brand-deep-rgb)) !important;
          background-image: linear-gradient(90deg,
            var(--bs-gold) 0%,
            rgb(var(--pro-brand-deep-rgb)) 26%,
            rgb(var(--pro-brand-deep-rgb)) 55%,
            var(--bs-secondary) 100%);
        }

        /* Ticker: pure CSS auto-scroll, paused on hover and reduced motion. */

        #block-notice .ticker-track {
          display: flex;
          align-items: center;
          width: max-content;
          gap: 2rem;
          animation: ticker-notice 45s linear infinite;
        }
        #block-notice:hover .ticker-track,
        #block-notice:focus-within .ticker-track {
          animation-play-state: paused;
        }

        @keyframes ticker-notice {
          from { transform: translateX(0); }
          to   { transform: translateX(-50%); }
        }

        @media (min-width: 768px) {
          #block-notice .ticker-track { gap: 3rem; }
        }

        @media (prefers-reduced-motion: reduce) {
          #block-notice .ticker-track { animation: none; }
        }

        /* Notice rows turn gold on hover. */
        #block-notice .ticker-item {
          transition: color .4s ease-in-out;
        }
        #block-notice .ticker-item:hover {
          color: var(--bs-gold) !important;
        }

        /* Mask fades the text out at both edges. */
        #block-notice .ticker-viewport {
          -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 2rem, #000 calc(100% - 2rem), transparent 100%);
                  mask-image: linear-gradient(90deg, transparent 0, #000 2rem, #000 calc(100% - 2rem), transparent 100%);
        }

/* 03-section-block-banner.html */
/* Slider heading: lighter weight, wraps naturally without line breaks. */
        #block-banner .heading-main h2 {
          font-weight: 600;
        }
        /* Keep the h1 title styled like .heading-row h2. */
        #block-banner .heading-main h1 {
          text-transform: uppercase;
          font-weight: 600;
          letter-spacing: .075rem;
          font-size: 1.5rem;
        }

        #block-banner .swiper-slide {
          min-height: 15rem;
        }
        /* Accessibility zoom: banner grows to fit enlarged text. */
        @media (min-width: 992px) {
          html.a11y-zoom-115 #block-banner .swiper-slide,
          html.a11y-zoom-130 #block-banner .swiper-slide {
            aspect-ratio: auto;
            min-height: calc(100vw * 400 / 1600);
          }
        }
        @media (min-width: 992px) {
          #block-banner .swiper-slide {
            aspect-ratio: 1600 / 400;   /* Original banner aspect ratio, shown uncropped. */
            min-height: 0;
          }
        }
        #block-banner .banner-img {
          position: absolute;
          inset: 0;
          width: 100%;
          height: 100%;
          object-fit: cover;
        }

        /* Swiper controls: white, gold when active or hovered. */
        #block-banner .swiper-pagination-bullet {
          background: rgba(255, 255, 255, .7);
          opacity: 1;
        }
        #block-banner .swiper-pagination-bullet-active {
          background: var(--bs-gold);
        }
        #block-banner .swiper-button-prev,
        #block-banner .swiper-button-next {
          color: #fff;
          transition: color .4s ease-in-out;
        }
        #block-banner .swiper-button-prev:hover,
        #block-banner .swiper-button-next:hover {
          color: var(--bs-gold);
        }
        #block-banner .swiper-button-prev::after,
        #block-banner .swiper-button-next::after {
          font-size: 1.5rem;
        }

/* 05-section-block-posts6.html */
/* posts-v6: spacing and dividers between list items. */

        #block-posts6 .col-second .col-item {
          padding-block: 1rem;
        }
        #block-posts6 .col-second .col-item:first-child {
          padding-top: 0;
        }
        #block-posts6 .col-second .col-item:last-child {
          padding-bottom: 0;
        }
        #block-posts6 .col-second .col-item:not(:last-child) {
          border-bottom: var(--bs-border-width) solid var(--bs-border-color);
        }
        /* Featured posts 64%, latest list 36% from lg up. */
        @media (min-width: 992px) {
          #block-posts6 > .container > .row > .col-first { width: 64%; }
          #block-posts6 > .container > .row > .col-second { width: 36%; }
        }

/* 06-between-.html */
/* Divider: two fading lines around a centre mark. */
      .pro-divider .divider-line { height: 1px; background: linear-gradient(90deg, rgba(var(--bs-primary-rgb), 0) 0%, rgba(var(--bs-primary-rgb), .28) 100%); }
      .pro-divider .divider-line:last-child { background: linear-gradient(90deg, rgba(var(--bs-primary-rgb), .28) 0%, rgba(var(--bs-primary-rgb), 0) 100%); }
      /* Divider mark: gold ring around a brand blue dot. */
      .pro-divider .divider-mark {
        width: 2rem;
        height: 2rem;
        border-color: var(--bs-gold) !important;
      }
      .pro-divider .divider-dot {
        width: .75rem;
        height: .75rem;
        background-color: var(--bs-primary);
      }

/* 07-section-block-posts1.html */
/* Subsidiary badge: white text on brand blue. */
        #block-posts1 .item-badge {
          --bs-badge-color: #fff;
          background-color: rgb(var(--pro-brand-deep-rgb));
          color: #fff;
        }

/* 09-section-block-links.html */
/* Background: brand blue gradient. */

        #block-links {
          background-image: linear-gradient(180deg, #2f7cb8 0%, rgb(var(--pro-brand-deep-rgb)) 100%);
        }

        /* Hover: darken the image and turn the title gold. */
        #block-links .card-item .item-image img {
          transition: filter .4s ease-in-out;
        }
        #block-links .card-item:hover .item-image img {
          filter: brightness(.6);
        }
        #block-links .card-item:hover .item-title,
        #block-links .card-item:hover .item-title > a {
          /* Colour the title itself so the line-clamp ellipsis matches. */
          color: var(--bs-gold) !important;
        }

        /* xl and up: six posts in one row. */
        /* Accessibility zoom: fewer cards per row so titles fit. */
        @media (min-width: 1200px) {
          html.a11y-zoom-130 #block-links .col-first { width: 25%; }
          html.a11y-zoom-130 #block-links .col-second { width: 75%; }
        }

/* 13-section-block-stats.html */
/* Light background; the pattern comes from the body texture. */

        /* Feature columns: borderless gradient tiles. */

        /* Lottie icons: fixed size, no background or border. */
        /* Tile background: soft gradient overriding the item-var-2 grey. */
        #block-stats .feature-item {
          background-image: linear-gradient(135deg, rgba(var(--bs-body-color-rgb), .07) 0%, rgba(var(--bs-body-color-rgb), 0) 75%);
        }

        #block-stats .stat-icon {
          width: 5rem;
          height: 5rem;
          flex-shrink: 0;
          /* Scale the artwork up, since the JSON files have built-in padding. */
          transform: scale(1.5);
        }
        #block-stats .stat-icon svg {
          display: block;
          width: 100%;
          height: 100%;
        }

        /* Direction titles: uniform size, uppercase. */
        #block-stats .item-title {
          font-size: 1rem;
          text-transform: uppercase;
          line-height: 1.35;
        }

        /* Stat row. */

        /* Stat number: the main message of the block, larger and bold. */
        #block-stats .item-desc {
          font-size: 1.5rem !important;
          width: fit-content;
          font-weight: 700;
          /* Number: solid brand blue. */
          color: var(--bs-primary);
        }
        @media (min-width: 768px) {
          #block-stats .item-desc {
            font-size: 1.75rem !important;
          }
        }

/* 14-between-.html */
/* Play button: centred on the image with a ripple. */

        .play-btn {
          position: absolute;
          top: 50%;
          left: 50%;
          transform: translate(-50%, -50%);
          width: 3.25rem;
          height: 3.25rem;
          display: flex;
          align-items: center;
          justify-content: center;
          border-radius: 50rem;
          background: rgba(255, 255, 255, .92);
          color: rgb(var(--pro-brand-deep-rgb));
          font-size: 1rem;
          z-index: 2;
          pointer-events: none;
          transition: background-color .4s ease-in-out, color .4s ease-in-out, transform .4s ease-in-out;
        }
        .play-btn::before,
        .play-btn::after {
          content: "";
          position: absolute;
          inset: 0;
          border-radius: 50rem;
          animation: play-ripple 2.2s ease-out infinite;
        }
        .play-btn::after {
          animation-delay: 1.1s;
        }
        @keyframes play-ripple {
          0%   { box-shadow: 0 0 0 0 rgba(255, 255, 255, .45); }
          70%  { box-shadow: 0 0 0 1.25rem rgba(255, 255, 255, 0); }
          100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
        }
        .item-element:hover .play-btn {
          background: var(--bs-gold);
          color: #fff;
          transform: translate(-50%, -50%) scale(1.08);
        }
        @media (prefers-reduced-motion: reduce) {
          .play-btn::before,
          .play-btn::after { animation: none; }
        }

/* 15-section-block-explains.html */
/* Accessibility zoom: wider title column so long words fit. */
        @media (min-width: 992px) and (max-width: 1199.98px) {
          html.a11y-zoom-130 #block-explains .col-first { width: 33.3333%; }
          html.a11y-zoom-130 #block-explains .col-second { width: 66.6667%; }
        }

/* 19-section-block-orgs.html */
#block-orgs .items-wrapper {
          width: max-content;
          animation: marquee-orgs 60s linear infinite;
        }
        #block-orgs .items-wrapper:hover {
          animation-play-state: paused;
        }
        /* Second row runs the opposite way. */
        #block-orgs .items-wrapper:nth-child(even) {
          animation-direction: reverse;
        }

        /* Marquee items keep a fixed width inside the flex row. */
        #block-orgs .feature-item {
          width: 16rem;
          flex-shrink: 0;
        }
        @media (min-width: 768px) {
          #block-orgs .feature-item {
            width: 20rem;
          }
        }

        @keyframes marquee-orgs {
          to {
            transform: translateX(-50%);
          }
        }

        /* Fade both edges with a mask, works on any background. */
        #block-orgs .marquee-track {
          position: relative;
          -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 4rem, #000 calc(100% - 4rem), transparent 100%);
                  mask-image: linear-gradient(90deg, transparent 0, #000 4rem, #000 calc(100% - 4rem), transparent 100%);
        }
        @media (min-width: 992px) {
          #block-orgs .marquee-track {
            -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 9rem, #000 calc(100% - 9rem), transparent 100%);
                    mask-image: linear-gradient(90deg, transparent 0, #000 9rem, #000 calc(100% - 9rem), transparent 100%);
          }
        }

/* 22-between-.html */
#mongol-bichig {
          /* Above page content and footer, below the CTA and header. */
          z-index: 1010;
          /* Same edge offset as the quick-links CTA. */
          margin-left: calc((var(--pro-edge) - 2.75rem) / 2);
        }
        /* Shown only from 1600px, where the edge has enough room. */
        @media (min-width: 1600px) {
          #mongol-bichig {
            display: flex !important;
          }
        }
        /* Small emblem, about the width of the script. */
        #mongol-bichig .bichig-emblem {
          width: 2rem;
        }
        #mongol-bichig .bichig-art {
          height: min(40vh, 18rem);
          opacity: .9;
        }

/* 23-section-block-quick.html */
/* Below the header so its dropdowns stay on top. */
        #block-quick {
          z-index: 1020;
          /* Centred in the page edge gap. */
          margin-right: 1rem;
        }
        @media (min-width: 1200px) {
          #block-quick {
            margin-right: calc((var(--pro-edge) - 2.75rem) / 2);
          }
        }

        /* Phone: smaller column bottom-right, above the accessibility icon. */
        @media (max-width: 767.98px) {
          #block-quick {
            top: auto !important;
            bottom: calc(2.5rem + 1rem);
            transform: none !important;
            /* Align with the centre of the accessibility icon below. */
            margin-right: calc(var(--bs-gutter-x, 1.5rem) * .5 + .25rem);
          }
          #block-quick ul {
            gap: .375rem !important;
          }
          #block-quick .cta-item > span:last-child {
            width: 2rem !important;
            height: 2rem !important;
            font-size: .75rem;
          }
        }

        #block-quick .cta-item {
          /* White tile with brand blue icon. */
          background-color: var(--bs-white);
          color: rgb(var(--pro-brand-deep-rgb));
          border-radius: 50rem;   /* Circle when collapsed, pill when expanded. */
          box-shadow: var(--bs-box-shadow);
          transition: background-color .4s ease-in-out;
          /* Stop pills stretching when the section widens on hover. */
          width: max-content;
        }
        /* Force the X logo black so it shows on the white tile. */
        #block-quick .fa-x-twitter {
          color: var(--bs-black);
        }

        /* Expanded state: brand primary background, white logos. */
        #block-quick .cta-item:hover,
        #block-quick .cta-item:focus-visible {
          /* Fixed brand colour, since --bs-primary lightens in dark theme. */
          background-color: rgb(var(--pro-brand-deep-rgb));
          color: var(--bs-white);
        }
        #block-quick .cta-item:hover i,
        #block-quick .cta-item:focus-visible i {
          color: var(--bs-white);   /* Override social brand colours. */
        }

        /* Label stays collapsed and slides open on hover. */
        #block-quick .cta-label {
          max-width: 0;
          overflow: hidden;
          white-space: nowrap;
          transition: max-width .4s ease-in-out, padding-inline-start .4s ease-in-out;
          padding-inline-start: 0;
        }
        #block-quick .cta-item:hover .cta-label,
        #block-quick .cta-item:focus-visible .cta-label {
          max-width: 14rem;
          padding-inline-start: 1.5rem;   /* Left padding when expanded. */
        }

        @media (prefers-reduced-motion: reduce) {
          #block-quick .cta-label { transition: none; }
        }

/* posts-v6 on phones: featured date and title below the image. */
@media (max-width: 767.98px) {
  #block-posts6 .post-item.item-var-3 {
    gap: .5rem;
    overflow: visible;
    border-radius: 0 !important;
  }
  #block-posts6 .post-item.item-var-3 .item-image {
    border-radius: 12px;
    overflow: hidden;
  }
  #block-posts6 .post-item.item-var-3 .item-overlay {
    display: none;
  }
  #block-posts6 .post-item.item-var-3 .item-details {
    position: static;
    padding: 0;
  }
  #block-posts6 .post-item.item-var-3 .item-title a {
    color: rgb(33, 37, 41) !important;
  }
  #block-posts6 .post-item.item-var-3 .item-details small {
    color: rgba(33, 37, 41, .7) !important;
  }
}
