/* ==========================================================================
   Shell additions (2026-10-24), loaded on every Institute page after
   shell.css:
     - the Courses split control (the label links to /programs, the chevron
       opens the menu);
     - the Student Login button;
     - the running results strip under the navigation (includes/results-ticker.php);
     - the shared carousel (assets/js/proof-di.js, [data-carousel]).
   Tokens only. Motion stops under prefers-reduced-motion.
   ========================================================================== */

/* --- Courses: link + chevron ------------------------------------------------ */
.shell-nav-split { display: inline-flex; align-items: center; }
.shell-nav-link--split { padding-right: 0.15rem; }
.shell-nav-caret {
  display: inline-grid; place-items: center; width: 1.1rem; height: 2rem; margin-left: -0.45rem; padding: 0;
  border: 0; border-radius: 6px; background: transparent; color: inherit; cursor: pointer;
}
.shell-nav-caret:hover { background: rgb(255 255 255 / 0.08); }
.shell-nav-caret:focus-visible { outline: 2px solid var(--color-ndi-gold-400); outline-offset: 2px; }
.shell-nav-caret[aria-expanded="true"] .shell-nav-chevron { transform: rotate(180deg); }
.shell-header:not(.is-scrolled) .shell-nav-caret { color: rgb(226 233 243 / 0.86); }
.shell-header.is-scrolled .shell-nav-caret { color: var(--color-ndi-ink-700); }

/* --- Student Login ------------------------------------------------------------ */
.shell-login svg { color: currentColor; }
.shell-login { gap: 0.45rem; }

/* --- Results strip ------------------------------------------------------------ */
.shell-ticker {
  /* The header passes clicks through (pointer-events: none) except on its
     bar; the strip is interactive too. */
  pointer-events: auto;
  display: flex; align-items: stretch; gap: 0; height: 2.6rem; overflow: hidden;
  background: linear-gradient(90deg, #050f22, #08172f 40%, #0b1d38);
  border-top: 1px solid rgb(214 174 87 / 0.28); border-bottom: 1px solid rgb(214 174 87 / 0.18);
  color: #fff; font-size: 0.8rem;
  transition: height 260ms var(--ease-brand, ease), opacity 200ms ease;
}
/* Once the header floats (scrolled), the strip folds away so it never sits over the content. */
.shell-header.is-scrolled .shell-ticker { height: 0; opacity: 0; border-width: 0; pointer-events: none; visibility: hidden; }
.shell-ticker-label, .shell-ticker-all {
  flex: none; display: inline-flex; align-items: center; gap: 0.45rem; padding: 0 1rem;
  font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.7rem; text-decoration: none; white-space: nowrap;
}
.shell-ticker-label { background: var(--color-ndi-gold-500); color: var(--color-ndi-navy-950); }
.shell-ticker-all { color: var(--color-ndi-gold-300); border-left: 1px solid rgb(214 174 87 / 0.25); }
.shell-ticker-all:hover, .shell-ticker-label:hover { text-decoration: underline; text-underline-offset: 3px; }
.shell-ticker a:focus-visible { outline: 2px solid var(--color-ndi-gold-300); outline-offset: -3px; }
.shell-ticker-viewport { position: relative; flex: 1; min-width: 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); }
.shell-ticker-track { display: flex; width: max-content; height: 100%; animation: shell-ticker var(--ticker-duration, 240s) linear infinite; }
.shell-ticker-track[data-static] { animation: none; }
.shell-ticker:hover .shell-ticker-track, .shell-ticker:focus-within .shell-ticker-track { animation-play-state: paused; }
@keyframes shell-ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.shell-ticker-list { display: flex; align-items: center; height: 100%; margin: 0; padding: 0; list-style: none; }
.shell-ticker-list a { display: inline-flex; align-items: center; gap: 0.55rem; height: 100%; padding: 0 1.1rem; color: #fff; text-decoration: none; white-space: nowrap; border-right: 1px solid rgb(199 208 222 / 0.12); }
.shell-ticker-list a:hover strong { color: var(--color-ndi-gold-300); }
.shell-ticker-photo { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; flex: none; overflow: hidden; border-radius: 50%; background: var(--color-ndi-navy-700); box-shadow: 0 0 0 1.5px rgb(214 174 87 / 0.6); font-size: 0.6rem; font-weight: 800; color: var(--color-ndi-gold-300); }
.shell-ticker-photo picture { display: block; width: 100%; height: 100%; }
.shell-ticker-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.shell-ticker-text { display: inline-flex; align-items: baseline; gap: 0.45rem; }
.shell-ticker-text strong { font-weight: 700; font-size: 0.82rem; }
.shell-ticker-text span { color: var(--color-ndi-gold-300); font-weight: 600; font-size: 0.76rem; }
.shell-ticker-empty { flex: 1; display: flex; align-items: center; margin: 0; padding: 0 1rem; color: var(--color-ndi-mist); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) {
  .shell-ticker { height: 2.4rem; }
  .shell-ticker-label span, .shell-ticker-all { display: none; }
  .shell-ticker-label { padding: 0 0.7rem; }
}
@media (prefers-reduced-motion: reduce) {
  .shell-ticker-track { animation: none; }
  .shell-ticker-viewport { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .shell-ticker-list[aria-hidden="true"] { display: none; }
  .shell-ticker { transition: none; }
}

/* --- Carousel (assets/js/proof-di.js) -------------------------------------- */
.pf-carousel { position: relative; }
.pf-carousel-track {
  display: grid; grid-auto-flow: column; grid-auto-columns: var(--carousel-item, 80%); gap: 1rem;
  margin: 0; padding: 0.25rem 0 1rem; list-style: none; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.pf-carousel-track::-webkit-scrollbar { display: none; }
.pf-carousel-track > li { scroll-snap-align: start; min-width: 0; }
@media (min-width: 720px) { .pf-carousel-track { grid-auto-columns: var(--carousel-item-md, 46%); } }
@media (min-width: 1100px) { .pf-carousel-track { grid-auto-columns: var(--carousel-item-lg, 31.5%); } }
.pf-carousel-controls { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 0.75rem; }
.pf-carousel-dots { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; padding: 0; list-style: none; }
.pf-carousel-dots button { width: 0.6rem; height: 0.6rem; padding: 0; border: 0; border-radius: 999px; background: var(--color-ndi-line-strong); cursor: pointer; transition: width var(--dur-fast) ease, background var(--dur-fast) ease; }
.pf-carousel-dots button[aria-current="true"] { width: 1.6rem; background: var(--color-ndi-gold-600); }
.pf-carousel-dots button:focus-visible, .pf-carousel-btn:focus-visible { outline: 3px solid var(--color-ndi-gold-500); outline-offset: 2px; }
.pf-carousel-btns { display: flex; gap: 0.5rem; }
.pf-carousel-btn { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; border: 1.5px solid var(--color-ndi-line-strong); background: #fff; color: var(--color-ndi-ink-900); cursor: pointer; }
.pf-carousel-btn:hover:not(:disabled) { border-color: var(--color-ndi-navy-600); }
.pf-carousel-btn:disabled { opacity: 0.35; cursor: default; }
.tone-dark .pf-carousel-btn { background: transparent; color: #fff; border-color: rgb(214 174 87 / 0.6); }
.tone-dark .pf-carousel-dots button { background: rgb(199 208 222 / 0.3); }
.tone-dark .pf-carousel-dots button[aria-current="true"] { background: var(--color-ndi-gold-400); }
@media (prefers-reduced-motion: reduce) { .pf-carousel-track { scroll-behavior: auto; } }

/* --- Room for the results strip at the top of each page ----------------------
   The fixed header is the strip's height taller while the page is at the top,
   so the first section starts that much lower (as .has-utility does). */
.shell-header.has-ticker ~ main .po { padding-top: calc(4.5rem + 3.75rem + clamp(2rem, 4vw, 3.5rem)); }
.shell-header.has-ticker ~ main .dh-hero { padding-top: calc(4.5rem + 3.75rem + clamp(2.25rem, 5vw, 4.25rem)); }
@media (max-width: 767px) {
  .shell-header.has-ticker ~ main .dh-hero { padding-top: calc(4.5rem + 3.3rem + 2.5rem); }
  .shell-header.has-ticker ~ main .po { padding-top: calc(4.5rem + 3.3rem + 2rem); }
}

/* Course pages inside the Courses menu (the former Course Details menu). */
.shell-mega-courses { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.35rem; padding: 0; list-style: none; }
.shell-mega-courses a { display: inline-flex; padding: 0.4rem 0.75rem; border-radius: 999px; border: 1px solid var(--color-ndi-line); background: var(--color-ndi-panel-50); color: var(--color-ndi-ink-900); font-size: 0.82rem; font-weight: 700; text-decoration: none; }
.shell-mega-courses a:hover, .shell-mega-courses a[aria-current="page"] { border-color: var(--color-ndi-navy-600); background: #fff; }
.shell-mega-courses a:focus-visible { outline: 2px solid var(--color-ndi-gold-500); outline-offset: 2px; }

/* --- Results strip: the inset, rounded bar of the 25 Oct reference ------------
   Sits under the navigation inside the page margins, with a gold label pill
   and a "See all results" pill. Overrides the full-bleed strip above. */
.shell-ticker {
  height: 3.25rem; margin: 0.25rem clamp(0.5rem, 2.6vw, 2.75rem) 0; padding: 0.3rem;
  border: 1px solid rgb(58 166 230 / 0.4); border-radius: 14px;
  background: linear-gradient(90deg, rgb(0 20 40 / 0.86), rgb(0 26 50 / 0.78));
  box-shadow: 0 0 24px rgb(75 202 255 / 0.08), inset 0 1px 0 rgb(255 255 255 / 0.05);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.shell-ticker-label {
  gap: 0.55rem; padding: 0 1.1rem; border-radius: 10px;
  background: linear-gradient(180deg, #ffe08a, #f4c542 55%, #d9a12c); color: #00101f;
  font-size: 0.78rem; letter-spacing: 0.06em; box-shadow: 0 6px 18px -8px rgb(244 197 66 / 0.7);
}
.shell-ticker-all {
  margin-left: 0.3rem; padding: 0 0.9rem; border: 1px solid rgb(58 166 230 / 0.45); border-left-width: 1px; border-radius: 10px;
  color: #fff; font-size: 0.68rem;
}
.shell-ticker-list a { border-right-color: rgb(58 166 230 / 0.28); }
.shell-ticker-photo { width: 2.2rem; height: 2.2rem; box-shadow: 0 0 0 2px rgb(244 197 66 / 0.55); }
.shell-ticker-text strong { font-size: 0.88rem; }
.shell-ticker-text span { color: #f4c542; font-size: 0.8rem; }
@media (max-width: 640px) {
  .shell-ticker { height: 2.9rem; margin-inline: 0.5rem; }
  .shell-ticker-label { padding: 0 0.6rem; }
  .shell-ticker-label svg + span + svg { display: none; }
}

/* Header: the gold active item and the brand line of the reference. */
.shell-header:not(.is-scrolled) .shell-bar .shell-nav-link.is-active { color: #f4c542; }
.shell-header:not(.is-scrolled) .shell-wordmark-tag { color: rgb(255 255 255 / 0.82); letter-spacing: 0.04em; }
.shell-header:not(.is-scrolled) .shell-wordmark-name { letter-spacing: 0.2em; }
.shell-login { background: linear-gradient(180deg, #ffe08a, #f4c542 55%, #d9a12c) !important; color: #00101f !important; box-shadow: 0 0 0 1px rgb(255 233 166 / 0.6) inset, 0 10px 24px -10px rgb(244 197 66 / 0.7) !important; }
.shell-login svg { color: #00101f !important; }
@media (min-width: 1440px) { .shell-search { display: inline-grid; } }

/* The brand line under DEFENCE INSTITUTE, as in the reference, on wide screens. */
@media (min-width: 1280px) { .shell-wordmark-tag { display: block; margin-top: 0.15rem; } }

/* Official channels and branch labels (2026-10-29, client corrections §7–8) -- */
.shell-social { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.1rem 0 0; padding: 0; list-style: none; }
.shell-social-link {
  display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  color: #fff; background: rgb(255 255 255 / 0.08); border: 1px solid rgb(255 255 255 / 0.18);
  transition: background-color 200ms ease, transform 200ms ease, border-color 200ms ease;
}
.shell-social-link:hover, .shell-social-link:focus-visible { background: #d4a843; border-color: #d4a843; color: #0b2438; transform: translateY(-2px); }
.shell-social--drawer { justify-content: center; margin-top: 1rem; }
.shell-footer-branch { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: #d4a843; font-weight: 800; }
@media (prefers-reduced-motion: reduce) { .shell-social-link:hover { transform: none; } }
