/* ========================================================================== */
/* UVEC shared stylesheet                                                     */
/* Only selectors used by the current static HTML pages are kept here.        */
/* ========================================================================== */

/* -------------------------------------------------------------------------- */
/* Design tokens: brand colors, surfaces, spacing, and motion.                */
/* -------------------------------------------------------------------------- */
:root {
  --ink: #3d3d3d;
  --ink-deep: #232323;
  --blue: #054bad;
  --blue-deep: #005493;
  --gold: #f5aa1c;
  --card-solid: #ffffff;
  --hairline: rgba(61, 61, 61, 0.14);
  --muted: #6b7280;
  --r-bar: 22px;
  --r-pill: 15px;
  --shadow-bar: 0 10px 34px rgba(12, 34, 60, 0.20);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --gutter: clamp(14px, 3vw, 28px);
}

/* -------------------------------------------------------------------------- */
/* Global document defaults                                                   */
/* -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  /* Flex layout keeps the footer at the bottom on pages with little content. */
  min-height: 100vh; /* Fallback for browsers that don't support svh*/
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  margin: 0;
  color: var(--ink);
  background: #0f2233;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1 0 auto; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover { color: var(--blue-deep); }
img { max-width: 100%; height: auto; display: block; }

/* Keep keyboard focus visible against light and dark surfaces. */
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

/* -------------------------------------------------------------------------- */
/* Skip link and decorative background                                        */
/* -------------------------------------------------------------------------- */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 12px 18px;
  border-radius: 0 0 12px 0;
  background: #fff;
  color: var(--ink-deep);
  font-weight: 600;
}

.skip:focus { left: 0; }

.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: url("../img/Backgrounds/parliament_bg_rescaled.webp");
  background-position: center 58%;
  background-size: cover;
  background-repeat: no-repeat;
}

.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(8, 30, 52, 0.32) 0%,
    rgba(8, 30, 52, 0.06) 26%,
    rgba(8, 30, 52, 0.10) 62%,
    rgba(8, 30, 52, 0.44) 100%);
}

@media (max-width: 900px) {
  .bg { background-image: url("../img/Backgrounds/parliament_bg_rescaled.webp"); }
}

/* -------------------------------------------------------------------------- */
/* Shared content width                                                       */
/* -------------------------------------------------------------------------- */
.wrap {
  width: min(1240px, 100% - (var(--gutter) * 2));
  margin-inline: auto;
}

/* -------------------------------------------------------------------------- */
/* Header and navigation                                                      */
/* -------------------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 0;
}

.topbar .bar {
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--r-bar);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-bar);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
}

.brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 8px 18px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  background: var(--card-solid);
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.brand:hover {
  box-shadow: 0 6px 18px rgba(12, 34, 60, 0.16);
  transform: translateY(-1px);
}

.brand img { width: 132px; }

.nav {
  display: flex;
  align-items: stretch;
  flex: 1 1 auto;
  justify-content: flex-end;
  gap: 10px;
}

.navlink {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  background: var(--card-solid);
  color: var(--ink-deep);
  font-family: "Outfit", ui-sans-serif, system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  transition: background 0.2s var(--ease), color 0.2s var(--ease),
    border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.navlink small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0;
  transition: color 0.2s var(--ease);
}

.navlink:hover,
.navlink:focus-visible {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  transform: translateY(-2px);
}

.navlink:hover small,
.navlink:focus-visible small { color: rgba(255, 255, 255, 0.82); }

.navlink[aria-current="page"] {
  border-color: var(--ink-deep);
  background: var(--ink-deep);
  color: #fff;
}

.navlink[aria-current="page"] small { color: rgba(255, 255, 255, 0.72); }

@media (max-width: 1080px) {
  .navlink { padding: 9px 10px; font-size: 0.82rem; }
  .navlink small { font-size: 0.7rem; }
  .brand img { width: 112px; }
}

/* Menu toggle: only shown when the header collapses on narrow windows. */
.navtoggle { display: none; }

@media (max-width: 880px) {
  .topbar .bar { flex-wrap: wrap; align-items: center; cursor: pointer; }
  .brand { padding: 6px 14px; }
  .nav { display: none; flex-basis: 100%; flex-direction: column; gap: 8px; cursor: auto; }
  .topbar.is-open .nav { display: flex; }
  .navlink { flex: 0 0 auto; text-align: left; }

  .navtoggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-left: auto;
    padding: 0;
    border: 1px solid var(--hairline);
    border-radius: var(--r-pill);
    background: var(--card-solid);
    cursor: pointer;
  }

  /* Three-line icon that morphs into an X when open. */
  .navtoggle-icon,
  .navtoggle-icon::before,
  .navtoggle-icon::after {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: var(--ink-deep);
    transition: transform 0.2s var(--ease), background 0.2s var(--ease);
  }

  .navtoggle-icon { position: relative; }
  .navtoggle-icon::before,
  .navtoggle-icon::after { content: ""; position: absolute; left: 0; }
  .navtoggle-icon::before { top: -6px; }
  .navtoggle-icon::after { top: 6px; }

  .topbar.is-open .navtoggle-icon { background: transparent; }
  .topbar.is-open .navtoggle-icon::before { transform: translateY(6px) rotate(45deg); }
  .topbar.is-open .navtoggle-icon::after { transform: translateY(-6px) rotate(-45deg); }
}

/* -------------------------------------------------------------------------- */
/* Social footer                                                              */
/* -------------------------------------------------------------------------- */
.socialbar { padding: 0 0 var(--gutter); }

.social {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--r-bar);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-bar);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
}

.social a {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  background: var(--card-solid);
  color: var(--ink-deep);
  font-family: "Outfit", sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
    background 0.2s var(--ease);
}

.social a:hover {
  background: #f8fafc;
  box-shadow: 0 8px 20px rgba(12, 34, 60, 0.16);
  transform: translateY(-2px);
}

.social a img {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  object-fit: contain;
}
.social .label { display: none; }

@media (min-width: 820px) {
  .social .label { display: inline; }
}

@media (max-width: 460px) {
  .social { flex-wrap: wrap; }
  .social a { flex: 1 1 27%; }
}

.linktree-mark {
  font-family: "Outfit", sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Centered copyright line below the social links. */
.colophon {
  display: flex;
  justify-content: center;
  padding: 16px 6px 2px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.8rem;
  text-align: center;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

.colophon p { margin: 0; }

/* -------------------------------------------------------------------------- */
/* Content sections with semi-transparent cards                              */
/* -------------------------------------------------------------------------- */
.content-section {
  scroll-margin-top: 100px;
  padding: 60px var(--gutter);
}

.content-card {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center !important;
  border-radius: 20px;
  /* last option in background is the transparency setting*/
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 32px rgba(12, 34, 60, 0.15);
}

.content-card > h2,
.content-card > p {
  width: 100%;
  text-align: center !important;
}

.content-card h2 {
  margin: 0 0 20px;
  color: var(--blue);
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  font-weight: 700;
}

.content-card p {
  width: 100%;
  color: var(--ink);
  font-size: 1.05rem;
}

.content-card iframe {
  display: block;
  width: min(600px, 100%);
  max-width: 100%;
  margin: 0 auto 1em !important;
}

.sponsor-carousel {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 28px 0;
  padding: 18px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
}

.sponsor-viewport {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

/* --sponsor-count is set by sponsor.js to the number of unique logos.
   The track holds two copies, so it is (count * 2 / visible) viewports wide. */
.sponsor-track {
  --sponsor-count: 4;
  --sponsor-visible: 3;
  display: flex;
  width: calc(var(--sponsor-count) * 2 / var(--sponsor-visible) * 100%);
  will-change: transform;
}

.sponsor-carousel.is-ready .sponsor-track {
  animation: sponsor-scroll 32s linear infinite;
}

/* Sliding by exactly half the track lands on the duplicated copy. */
@keyframes sponsor-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.sponsor-slide {
  display: grid;
  flex: 0 0 calc(100% / (var(--sponsor-count) * 2));
  min-height: 120px;
  place-items: center;
  padding: 8px 5px;
}

.sponsor-slide img {
  width: min(100%, 260px);
  height: 104px;
  object-fit: contain;
}

.innovation-centre-logo { border-radius: 12px; }

@media (max-width: 600px) {
  .content-section { padding: 16px var(--gutter); }
  /* Tighter shadow so it doesn't smear across the smaller gap between cards. */
  .content-card { padding: 28px; box-shadow: 0 4px 12px rgba(12, 34, 60, 0.15); }
  .content-card h2 { font-size: 1.5rem; }
  .sponsor-carousel { padding: 12px; }
  .sponsor-track { --sponsor-visible: 2; }
  .sponsor-slide { min-height: 104px; padding-inline: 8px; }
  .sponsor-slide img { height: 88px; }
}

/* Honor reduced-motion preferences for the animated interactions in use. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
  .sponsor-track { animation: none; }
}
