/* =============================================================================
   Politics and Data Research Group
   -----------------------------------------------------------------------------
   Restrained, typographic layout: hairline rules rather than boxes.
   Loaded after ember.scss, so it may override the Bootstrap/litera theme.
   ========================================================================== */

:root {
  /* Neutrals */
  --tp-bg:          #FAFAFC;
  --tp-ink:         #1B1E27;
  --tp-surface:     #E7E8EC;
  --tp-body:        #33363F;
  --tp-muted:       #6B6F7A;
  --tp-rule:        #E7E8EC;
  --tp-rule-soft:   #EFEFF2;

  /* Primary accent */
  --tp-green:        #3D8B7A;
  --tp-green-bright: #4FC79B;

  /* Alternate accents */
  --tp-indigo:        #4C5FD9;
  --tp-indigo-bright:  #6C7CE8;
  --tp-blue-dark:      #03326C;
  --tp-blue:           #0056A4;
  --tp-blue-bright:    #3B87C9;
  --tp-violet:         #7C5CBF;
  --tp-gold:           #E0A83E;
  --tp-ucd-green:      #03884A;
}

/* The header band is full-bleed via 100vw, so clip any sideways overflow.
   `clip` rather than `hidden`, which would break the sticky navbar. */
html {
  overflow-x: clip;
}


/* =Typography
-----------------------------------------------------------------------------*/

body {
  font-size: 0.94em;
  line-height: 1.68;
  color: var(--tp-body);
  background-color: var(--tp-bg);
}

h1, h2, h3, h4, h5 {
  color: var(--tp-ink);
  letter-spacing: -0.01em;
}

/* Section headings, with a short accent rule underneath. */
h1 {
  font-size: 1.72em;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  margin-top: 3.4em;
  margin-bottom: 1.7em;
  padding: 0;
}

h1::after {
  content: "";
  display: block;
  width: 3rem;
  height: 3px;
  margin: 0.75rem auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--tp-green), var(--tp-green-bright));
}

h2 {
  font-size: 1.32em;
  font-weight: 700;
  text-align: center;
  margin-top: 2.2em;
  margin-bottom: 3rem;
}

h3 {
  font-size: 1em;
  font-weight: 400;
  margin-top: 0;
  margin-bottom: 0.3em;
}

h6 {
  font-size: 0.8em;
}

/* The navbar is pinned, so give anchor targets room to breathe. */
h1, h2, h3, [id] {
  scroll-margin-top: 5.5rem;
}

/* Hyperlinks carry an underline as well as a colour change, so they stay
   distinguishable from body text for readers who can't rely on colour alone. */
a {
  color: var(--tp-blue);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--tp-blue) 40%, transparent);
  text-underline-offset: 0.16em;
  text-decoration-thickness: 1px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover {
  color: var(--tp-ucd-green);
  text-decoration-color: currentColor;
}

/* Chrome links (nav, footer, icon buttons, resource-link rows) already carry
   their own affordance, so they stay underline-free. */
.navbar a,
.nav-footer a,
.team-links a,
.pub-links a,
a.pub-link,
.abstract-link,
.centre-name a,
.centre-logo-link {
  text-decoration: none;
}

hr {
  border: 0;
  height: 1px;
  background: var(--tp-rule);
  margin: 4ex auto;
  max-width: 100%;
}

blockquote {
  color: var(--tp-body);
  background: none;
  border-left: 3px solid var(--tp-green-bright);
  margin: 1.5em 0;
  padding: 0.3em 0 0.3em 1.1em;
  font-style: normal;
  font-size: 95%;
}

blockquote p {
  color: var(--tp-body);
  display: inline;
}

.table {
  --bs-table-bg: transparent !important;
}

td, th {
  background-color: transparent !important;
}

table th,
table td {
  border-bottom: 0 !important;
  padding: 0.2em 0.2em;
}

ul {
  list-style: square;
}

dd {
  margin-left: 2em;
}


/* =Header band
-----------------------------------------------------------------------------*/

/* Let the band sit flush under the navbar: Quarto pads the content column
   (via an #id selector, hence the id here) and emits an empty title header. */
#quarto-content > main.content {
  margin-top: 0;
  padding-top: 0;
}

#title-block-header.quarto-title-block:empty {
  display: none;
  margin: 0;
  padding: 0;
}

/* Pages that fall back to Quarto's default title block (e.g. Terms) instead
   of the .hero band still need breathing room under the fixed navbar. */
#title-block-header.quarto-title-block:not(:empty) {
  margin-top: 3.25rem;
}

.hero {
  margin-top: 0;
  margin-bottom: 3rem;
  padding: 3.25rem 1.5rem 3rem;
  text-align: center;
  color: var(--tp-ink);
  border-bottom: 1px solid var(--tp-rule);
}

.hero > * {
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
}

.hero h1 {
  color: var(--tp-ink);
  font-size: 2.6em;
  margin: 0 auto 0.6em;
  text-wrap: balance;
}

.hero h1::after {
  display: none;
}

.hero-eyebrow {
  margin-bottom: 1.1rem;
  font-size: 0.74em;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tp-muted);
}

.hero-tagline {
  margin-bottom: 0;
  font-size: 1.1em;
  line-height: 1.55;
  color: var(--tp-body);
  text-wrap: pretty;
}

/* Shallower band for the interior pages. */
.hero-compact {
  padding-top: 2.6rem;
  padding-bottom: 2.4rem;
}

.hero-compact h1 {
  font-size: 1.95em;
  margin-bottom: 0.4em;
}

.hero-compact h1:last-child {
  margin-bottom: 0;
}

.hero-compact .hero-tagline {
  font-size: 1.02em;
}

/* Logo lockup: an inline SVG mark (checkmark doubling as a line-chart trace)
   beside the wordmark, so the brand doesn't depend on a static image asset.
   This is a <header role="heading" aria-level="1"> rather than a real <h1> --
   Quarto promotes a document's first <h1> into its own title-block-header,
   which was hoisting the whole logo out of the .network-header band. It's
   <header>, not <div>, because Pandoc's "native divs" re-parse a raw <div>'s
   contents as Markdown, which was wrapping the two inner <span>s in an
   auto-inserted <p> and breaking the flex layout below; <header> (like the
   old <h1>) is passed through as untouched raw HTML instead. Since it isn't
   a real h1 it no longer inherits sizing from the site's "h1"/".hero h1"
   rules, so font-size/margin/letter-spacing are set explicitly here instead. */
.hero-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  text-align: left;
  font-size: 2.6em;
  margin: 0 0 0.6em;
  letter-spacing: -0.01em;
}

.hero-mark {
  flex: none;
  display: block;
  width: 4.5rem;
  height: 4.5rem;
}

.hero-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-wordmark {
  display: flex;
  flex-direction: column;
}

.brand-title {
  display: block;
  font-size: 1em;
  font-weight: 800;
  line-height: 1.1;
  color: var(--tp-ucd-green);
}

.brand-subtitle {
  display: block;
  font-size: 0.72em;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.02em;
  margin-top: 0;
  color: var(--tp-ucd-green);
}


/* =Intro
-----------------------------------------------------------------------------*/

.tp-prose {
  max-width: 44rem;
  margin: 0 auto;
}

.tp-prose p {
  margin-bottom: 1.15em;
}


/* =Team
-----------------------------------------------------------------------------*/

/* A fixed column count keeps the photos aligned across both team sections. */
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem 2.25rem;
}

.team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.team-photo {
  width: 160px;
  height: 160px;
  border-radius: 8px;
  object-fit: cover;
  object-position: center top;
  margin-bottom: 0.95rem;
}

.team-name {
  font-size: 1.04em;
  font-weight: 700;
  color: var(--tp-ink);
  margin-bottom: 0.2rem;
}

.team-role {
  font-size: 0.92em;
  font-weight: 600;
  color: var(--tp-muted);
  margin-bottom: 0.15rem;
}

.team-affil {
  font-size: 0.88em;
  line-height: 1.5;
  color: var(--tp-body);
}

.team-note {
  margin-top: 0.4rem;
  font-size: 0.81em;
  line-height: 1.5;
  color: var(--tp-muted);
}

.team-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
  margin-top: 0.85rem;
  font-size: 1.02em;
}

/* Same colour as every other hyperlink on the site, so the social icons
   (and the glyphs inside them, which inherit currentColor) read as links. */
.team-links a {
  color: var(--tp-blue);
}

.team-links a:hover {
  color: var(--tp-ucd-green);
}

/* Pandoc wraps loose inline content in <p>; let the links become flex items. */
.team-links p,
.pub-links p {
  display: contents;
}

.team-grid-alumni .team-photo {
  filter: saturate(0.8);
}


/* =Associated research centres
-----------------------------------------------------------------------------*/

.centre-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem 2.25rem;
  margin-top: 2.75rem;
}

.centre-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Fixed-size white box; same height and width for placeholders and real <img class="centre-logo"> alike. */
.centre-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  height: 150px;
  margin-bottom: 0.9rem;
  border: 1px solid var(--tp-rule);
  border-radius: 6px;
  background: #fff;
  font-size: 0.72em;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #b3aca3;
}

img.centre-logo {
  padding: 0.85rem;
  object-fit: contain;
}

/* The logo doubles as a link to the centre's own site: lift it slightly and
   pick out the border on hover/focus so that's obvious before the click. */
.centre-logo-link {
  display: block;
  width: 100%;
}

.centre-logo-link .centre-logo {
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.centre-logo-link:hover .centre-logo,
.centre-logo-link:focus-visible .centre-logo {
  transform: translateY(-3px);
  border-color: var(--tp-blue);
  box-shadow: 0 8px 16px rgba(27, 30, 39, 0.12);
}

.centre-logo-link:focus-visible {
  outline: 2px solid var(--tp-blue);
  outline-offset: 3px;
  border-radius: 6px;
}

.centre-name {
  font-size: 1.01em;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.centre-desc {
  font-size: 0.86em;
  line-height: 1.5;
  color: var(--tp-muted);
}


/* =Publications
-----------------------------------------------------------------------------*/

.pub-intro {
  max-width: 44rem;
  margin: -1em auto 2.2em;
  font-size: 0.95em;
  color: var(--tp-muted);
}

.pub {
  display: grid;
  grid-template-columns: 3.3rem 1fr;
  gap: 0 1.2rem;
  padding: 0.75rem 0;
}

.pub-year {
  font-size: 1em;
  font-weight: 700;
  color: var(--tp-ucd-green);
  font-variant-numeric: tabular-nums;
}

.pub-main > p {
  font-size: 1em;
  margin-bottom: 0.5em;
}

.pub-main > p:last-child {
  margin-bottom: 0;
}

.pub-main em {
  color: var(--tp-ink);
}

/* Resource links: plain, small, icon-led. */
.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.05rem;
  font-size: 0.82em;
}

.pub-links a,
a.pub-link {
  color: var(--tp-blue);
  white-space: nowrap;
}

.pub-links a:hover,
a.pub-link:hover {
  color: var(--tp-ucd-green);
}

@media (max-width: 620px) {
  /* Keep the year beside the citation (same first line) instead of
     stacking it on its own row above the text -- just narrow the column. */
  .pub {
    grid-template-columns: 2.6rem 1fr;
    gap: 0 0.85rem;
  }

  .pub-year {
    font-size: 0.92em;
  }
}


/* =Abstract disclosure
-----------------------------------------------------------------------------*/

details > summary {
  list-style: none;
}

details > summary::-webkit-details-marker {
  display: none;
}

details.collapsible > summary {
  cursor: pointer;
  display: inline-block;
}

.abstract-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.83em;
  color: var(--tp-blue);
}

.abstract-link:hover {
  color: var(--tp-ucd-green);
}

.abstract-link i {
  font-size: 0.85em;
  transition: transform 0.18s ease;
}

details.collapsible[open] > summary .abstract-link i {
  transform: rotate(90deg);
}

.collapsible .content-text {
  color: var(--tp-body);
  font-size: 0.88em;
  line-height: 1.62;
  border-left: 2px solid var(--tp-rule);
  padding: 0 0 0 1rem;
  margin: 0.7rem 0 0;
  text-align: left;
}


/* =Research projects
-----------------------------------------------------------------------------*/

.project {
  padding-bottom: 2.2rem;
  margin-bottom: 2.2rem;
  border-bottom: 1px solid var(--tp-rule-soft);
}

.project:last-of-type {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}

/* Quarto wraps headings in <section>, so these must be descendant selectors. */
.project h2 {
  margin-top: 0;
  margin-bottom: 1.6rem;
  font-size: 1.2em;
  line-height: 1.3;
  text-align: left;
  color: var(--tp-ink);
}

.project h3 {
  margin-top: 1.6rem;
  margin-bottom: 0.6rem;
  font-size: 0.78em;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--tp-muted);
}

.plabel {
  margin-right: 0.3rem;
  font-size: 0.75em;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--tp-muted);
}

/* The Researchers/Funding lines read as one metadata block, so they sit close
   together; the description paragraph that follows gets the normal spacing. */
.project p:has(.plabel) {
  margin-bottom: 0.3rem;
}

.project p:has(.plabel) + p:not(:has(.plabel)) {
  margin-top: 0.9rem;
}

.project ul {
  padding-left: 1.15rem;
  margin-bottom: 0;
}

.project li {
  margin-bottom: 0.8rem;
}

.project li:last-child {
  margin-bottom: 0;
}

.project li .pub-links {
  margin-top: 0.2rem;
}


/* =Navbar and footer
-----------------------------------------------------------------------------*/

nav,
.footer {
  font-size: 100%;
}

.navbar-brand {
  font-size: 18px;
  font-weight: 700;
}

a.nav-link,
a.navbar-brand {
  border-bottom: 0;
}

.navbar .navbar-nav .nav-link {
  font-size: 0.94em;
  /* Bootstrap's navbar-dark default (~55% white) reads too dim against this
     background; brighten it so the nav items are comfortably legible. */
  color: rgba(255, 255, 255, 0.88);
}

.navbar .navbar-nav .nav-link:hover {
  color: #ffffff;
}

.navbar-toggler-icon {
  font-size: 0.7em;
}

.nav-footer {
  border-top: 0;
  font-size: 0.85em;
}

.nav-footer a {
  color: rgba(255, 255, 255, 0.85);
}

.nav-footer a:hover {
  color: #fff;
}


/* =Code
-----------------------------------------------------------------------------*/

pre,
code,
kbd,
samp,
var,
output {
  font-size: 90%;
  font-style: normal;
  font-family: 'Source Code Pro', "Lucida Console", "Courier New", monospace;
}


/* =Misc carry-overs
-----------------------------------------------------------------------------*/

.image-left {
  float: left;
  margin: 0 1em 1em 0;
}

.fa-ul > li {
  margin: 0.5em;
}

.figure-caption {
  color: var(--tp-muted);
  padding-left: 20px;
  font-size: 0.85em;
}

.video-player {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding-top: 56.25%; /* 16:9 aspect ratio */
}

.youtube-player {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 100%;
}


/* =Responsive
-----------------------------------------------------------------------------*/

@media (max-width: 900px) {
  .team-grid,
  .centre-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .hero {
    padding: 2.6rem 1.15rem 2.4rem;
  }

  .hero h1,
  .hero-brand {
    font-size: 2em;
  }

  .hero-mark {
    width: 3.5rem;
    height: 3.5rem;
  }

  .hero-tagline {
    font-size: 1.1em;
  }

  h1 {
    font-size: 1.48em;
    margin-top: 2.6em;
  }

  .team-grid {
    gap: 2rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .team-grid,
  .centre-grid {
    grid-template-columns: 1fr;
  }

  .hero-brand {
    flex-direction: column;
    text-align: center;
  }

  .hero-wordmark {
    align-items: center;
  }
}


/* =Motion preferences
-----------------------------------------------------------------------------*/

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
