/* ==========================================================================
   UCD Linked Agents and Intelligence Research Group (LAIR) — site styles
   Follows the ucd.ie look and feel: UCD brand palette, navy bands, square
   corners, bold sans-serif headings, spotlight cards and a navy footer.
   Colours are tokens; UCD values are taken from the ucd.ie stylesheet.
   ========================================================================== */

:root {
  /* UCD brand palette */
  --ucd-navy: #004377;
  --ucd-darkest-blue: #04204c;
  --ucd-dark-blue: #03326c;
  --ucd-mid-blue: #0056a4;
  --ucd-blue: #0090d7;
  --ucd-light-blue: #a3ccee;
  --ucd-lightest-blue: #e4eff9;
  --ucd-yellow: #f8d500;
  --ucd-mid-green: #61b77c;
  --ucd-light-green: #9bcea4;
  --ucd-light-gold: #e0d588;
  --ucd-light-teal: #89cccc;
  --ucd-light-orange: #f9ba73;
  --ucd-black: #1b1b1a;
  --ucd-white: #fafafa;
  --ucd-dark-grey: #435761;
  --ucd-lightest-grey: #dae0e3;

  /* Semantic tokens (also used by the editor in admin/) */
  --bg: var(--ucd-white);
  --surface: #ffffff;
  --surface-2: #eef2f4;
  --text: var(--ucd-black);
  --heading: var(--ucd-darkest-blue);
  --muted: var(--ucd-dark-grey);
  --border: var(--ucd-lightest-grey);
  --primary: var(--ucd-mid-blue);
  --primary-ink: #ffffff;
  --accent: var(--ucd-mid-blue);
  --accent-soft: var(--ucd-lightest-blue);
  --link: var(--ucd-mid-blue);
  --shadow: 0 0 25px 5px rgb(0 0 0 / .08);
  --shadow-strong: 0 0 25px 5px rgb(0 0 0 / .15);

  --font-sans: "indivisible", "Figtree", Arial, sans-serif;
  --font-serif: var(--font-sans);
  --radius: 0;
  --max: 1200px;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 var(--font-sans);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

h1, h2, h3 {
  font-family: var(--font-sans);
  color: var(--heading);
  line-height: 1.15;
  font-weight: 700;
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 4.8vw, 3.4rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--ucd-darkest-blue); }

:focus-visible { outline: 3px solid var(--ucd-yellow); outline-offset: 2px; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .container { padding: 0 32px; } }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.muted { color: var(--muted); }

/* Full-bleed coloured band without horizontal overflow. */
.band, .page-head, .profile-head, .pub-head {
  box-shadow: 0 0 0 100vmax var(--band-bg, var(--ucd-darkest-blue));
  clip-path: inset(0 -100vmax);
  background: var(--band-bg, var(--ucd-darkest-blue));
}

.section { padding: 64px 0; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 28px; flex-wrap: wrap;
}
.section-head h2 { margin: 0; }
.section-head a { font-weight: 600; text-decoration: none; }
.section-head a:hover { text-decoration: underline; }

/* Navy page banner (People, Research, Publications, Join Us). */
.page-head { padding: 56px 0 48px; margin-bottom: 48px; color: #fff; }
.page-head h1 { color: #fff; margin-bottom: .3em; }
.page-head p { color: #dfe8f3; max-width: 62ch; font-size: 1.12rem; margin: 0; }

/* ---------- buttons ---------- */

.btn {
  display: inline-block; padding: 12px 24px; border-radius: 0;
  font-weight: 600; text-decoration: none; font-size: 1rem; line-height: 1.3;
  border: 2px solid var(--ucd-mid-blue);
}
.btn-primary { background: var(--ucd-mid-blue); color: #fff; }
.btn-primary:hover { background: var(--ucd-darkest-blue); border-color: var(--ucd-darkest-blue); color: #fff; }
.btn-ghost { color: var(--ucd-mid-blue); background: transparent; }
.btn-ghost:hover { background: var(--ucd-mid-blue); color: #fff; }
.btn-light { background: #fff; color: var(--ucd-darkest-blue); border-color: #fff; }
.btn-light:hover { background: var(--ucd-yellow); border-color: var(--ucd-yellow); color: var(--ucd-darkest-blue); }
.btn-outline-light { color: #fff; border-color: #fff; background: transparent; }
.btn-outline-light:hover { background: #fff; color: var(--ucd-darkest-blue); }
.btn-sm { padding: 6px 14px; font-size: .88rem; cursor: pointer; font-family: inherit; }

/* ---------- header ---------- */

#site-header { background: #fff; border-bottom: 1px solid var(--border); position: relative; z-index: 10; }

.utility-bar { position: absolute; top: 0; right: 0; display: flex; }
.utility-link {
  display: block; padding: 8px 14px; font-size: .88rem; font-weight: 600;
  color: #fff; text-decoration: none; line-height: 1.3;
}
.utility-link--blue { background: var(--ucd-mid-blue); }
.utility-link--navy { background: var(--ucd-darkest-blue); }
.utility-link:hover { color: var(--ucd-darkest-blue); background: var(--ucd-yellow); }

.header-inner {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; min-height: 104px; padding-top: 18px; padding-bottom: 18px; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 14px;
  color: var(--ucd-darkest-blue); text-decoration: none; min-width: 0;
}
.brand-logo { width: 47px; height: 68px; flex: none; }
.brand-mark { color: var(--ucd-mid-blue); display: flex; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.brand-text strong { font-size: 1.12rem; font-weight: 600; color: var(--ucd-darkest-blue); }
.brand-text small { color: var(--ucd-mid-blue); font-size: 1rem; }
.brand:hover .brand-text strong { color: var(--ucd-mid-blue); }

#site-nav ul { list-style: none; display: flex; gap: 4px 24px; margin: 0; padding: 0; flex-wrap: wrap; }
#site-nav a {
  display: block; padding: 6px 0; border-bottom: 3px solid transparent;
  color: var(--ucd-darkest-blue); text-decoration: none; font-size: 1.02rem;
}
#site-nav a:hover { color: var(--ucd-mid-blue); border-bottom-color: var(--ucd-light-blue); }
#site-nav a[aria-current="page"] { border-bottom-color: var(--ucd-yellow); font-weight: 600; }

.nav-toggle {
  display: none; background: none; border: 0; width: 48px; height: 44px;
  cursor: pointer; color: var(--ucd-darkest-blue);
}
.bars, .bars::before, .bars::after {
  display: block; width: 24px; height: 2px; background: currentColor;
  margin: 0 auto; position: relative;
}
.bars::before, .bars::after { content: ""; position: absolute; left: 0; }
.bars::before { top: -7px; }
.bars::after { top: 7px; }

@media (max-width: 960px) {
  .header-inner { align-items: center; padding-top: 44px; min-height: 0; }
  .nav-toggle { display: block; }
  #site-nav { display: none; width: 100%; }
  .nav-open #site-nav { display: block; }
  #site-nav ul { flex-direction: column; gap: 0; border-top: 1px solid var(--border); padding-top: 8px; }
  #site-nav a { padding: 10px 0; border-bottom: 1px solid var(--border); }
  #site-nav a[aria-current="page"] { border-bottom-color: var(--border); box-shadow: inset 4px 0 var(--ucd-yellow); padding-left: 12px; }
}
@media (max-width: 520px) {
  .brand-logo { width: 38px; height: 55px; }
  .brand-text strong { font-size: 1rem; }
  .brand-text small { font-size: .88rem; }
  .utility-link { padding: 7px 10px; font-size: .8rem; }
}

/* ---------- hero ---------- */

.hero {
  background: var(--ucd-darkest-blue); color: #fff; overflow: hidden;
}
.hero-inner {
  display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 32px;
  min-height: 460px;
}
@media (min-width: 900px) { .hero-inner { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); } }
.hero-text { padding: 64px 0; }
.hero .eyebrow {
  display: inline-block; font-size: .85rem; font-weight: 600; letter-spacing: .04em;
  color: var(--ucd-darkest-blue); background: var(--ucd-yellow); padding: 4px 12px; margin-bottom: 20px;
}
.hero h1 { color: #fff; max-width: 17ch; }
.hero p { max-width: 58ch; font-size: 1.12rem; color: #dfe8f3; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

/* UCD arch panel */
.hero-arch { align-self: end; display: none; }
@media (min-width: 900px) { .hero-arch { display: block; } }
.hero-arch svg { display: block; width: 100%; height: auto; margin-bottom: -1px; }

/* ---------- spotlight cards (home research themes) ---------- */

.theme-grid {
  display: grid; gap: 28px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
}
.spotlight {
  position: relative; display: flex; flex-direction: column;
  background: var(--ucd-white); box-shadow: var(--shadow-strong);
  text-decoration: none; color: var(--ucd-darkest-blue);
  border-top: 6px solid var(--ucd-darkest-blue);
  transition: transform .15s, border-color .15s;
}
.spotlight:hover { transform: translateY(-3px); border-top-color: var(--ucd-yellow); color: var(--ucd-darkest-blue); }
.spotlight-tag {
  align-self: flex-start; font-size: .92rem; font-weight: 600; line-height: 1.5;
  padding: 8px 18px; color: var(--ucd-black); background: var(--ucd-mid-green);
}
.spotlight-body { display: flex; flex-direction: column; gap: 10px; padding: 22px 24px 64px; flex: 1; }
.spotlight-title { font-size: 1.2rem; font-weight: 700; line-height: 1.3; }
.spotlight-text { color: var(--muted); font-size: .96rem; line-height: 1.55; }
.spotlight-arrow { position: absolute; left: 24px; bottom: 18px; font-size: 1.6rem; line-height: 1; transition: transform .15s; }
.spotlight:hover .spotlight-arrow { transform: translateX(6px); }

/* ---------- research page ---------- */

.research-list { display: grid; gap: 28px; padding-bottom: 64px; }
.theme-card {
  background: #fff; box-shadow: var(--shadow); padding: 32px 36px;
  border-left: 6px solid var(--ucd-mid-blue);
}
.theme-card h3 { font-size: 1.55rem; }
.theme-card p { max-width: 75ch; }
.theme-people { font-size: .96rem; }
.theme-people span { font-weight: 600; color: var(--heading); }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 14px 0 0; }
.tags li {
  font-size: .82rem; font-weight: 600; padding: 4px 12px;
  background: var(--ucd-lightest-blue); color: var(--ucd-darkest-blue);
}

/* ---------- people ---------- */

.people-grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}
.person-card {
  display: flex; gap: 18px; align-items: center;
  padding: 18px; background: #fff; box-shadow: var(--shadow);
  text-decoration: none; color: var(--text); border-bottom: 4px solid transparent;
  transition: border-color .15s, box-shadow .15s;
}
.person-card:hover { border-bottom-color: var(--ucd-yellow); box-shadow: var(--shadow-strong); color: var(--text); }
.person-card-body { display: flex; flex-direction: column; min-width: 0; }
.person-name { font-weight: 700; font-size: 1.08rem; color: var(--ucd-darkest-blue); }
.person-title { color: var(--ucd-mid-blue); font-size: .92rem; font-weight: 600; }
.person-topic { color: var(--muted); font-size: .88rem; line-height: 1.4; margin-top: 4px; }

.avatar {
  --size: 76px;
  width: var(--size); height: var(--size); flex: none;
  object-fit: cover; object-position: center top;
  display: inline-flex; align-items: flex-end; justify-content: center; overflow: hidden;
  background: var(--ucd-lightest-grey);
}
.avatar--lg { --size: 160px; }
.avatar--placeholder svg { width: 88%; height: 88%; fill: #9da9b1; }

.people-group { padding: 0 0 48px; }
.people-group:last-child { padding-bottom: 72px; }
.people-group h2 { display: flex; align-items: center; gap: 12px; }
.count {
  font-size: .85rem; font-weight: 600; color: var(--ucd-darkest-blue);
  background: var(--ucd-yellow); padding: 2px 10px;
}

/* ---------- news ---------- */

.home-split { display: grid; gap: 48px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .home-split { grid-template-columns: 2fr 1fr; } }

.news { list-style: none; padding: 0; margin: 0; }
.news li { padding: 16px 0 16px 18px; border-left: 4px solid var(--ucd-mid-green); margin-bottom: 16px; background: #fff; box-shadow: var(--shadow); padding-right: 16px; display: grid; gap: 2px; }
.news time { font-size: .82rem; font-weight: 700; color: var(--ucd-mid-blue); text-transform: uppercase; letter-spacing: .05em; }

/* ---------- profile ---------- */

.profile { padding: 0 0 72px; }
.crumbs { font-size: .92rem; color: #cfdbea; margin: 0 0 18px; }
.crumbs a { color: #fff; }
.profile-head {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 32px; align-items: center;
  padding: 36px 0 44px; margin-bottom: 44px; color: #fff;
}
.profile-head > .crumbs { grid-column: 1 / -1; margin: 0; }
@media (max-width: 600px) { .profile-head { grid-template-columns: 1fr; } }
.profile-head h1 { color: #fff; margin-bottom: 6px; }
.profile-head .person-title { font-size: 1.1rem; margin: 0 0 8px; color: var(--ucd-yellow); }
.profile-topic { color: #dfe8f3; font-size: 1.08rem; max-width: 60ch; }
.profile-head .avatar { border: 4px solid #fff; }
.profile-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.profile-links a {
  display: inline-block; font-size: .9rem; font-weight: 600; text-decoration: none;
  padding: 6px 14px; border: 2px solid #fff; color: #fff;
}
.profile-links a:hover { background: #fff; color: var(--ucd-darkest-blue); }

.profile-body { display: grid; gap: 40px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .profile-body { grid-template-columns: minmax(0, 1fr) 300px; } }
.profile-main section { margin-bottom: 36px; }
.profile-main h2 { font-size: 1.4rem; }
.profile-main p { max-width: 72ch; }
.profile-meta {
  align-self: start; background: #fff; box-shadow: var(--shadow);
  border-top: 6px solid var(--ucd-mid-blue); padding: 22px 24px;
}
.profile-meta dl { margin: 0; }
.profile-meta dt { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.profile-meta dd { margin: 2px 0 16px; overflow-wrap: anywhere; }
.profile-meta dd:last-child { margin-bottom: 0; }

ul.plain { padding-left: 1.2em; }

/* ---------- publications ---------- */

.pub-year h2 { font-size: 1.5rem; border-bottom: 3px solid var(--ucd-darkest-blue); padding-bottom: 8px; }
.pubs { list-style: none; padding: 0; margin: 0 0 36px; }
.pub { padding: 14px 0; display: grid; gap: 3px; border-bottom: 1px solid var(--border); }
.pub-title { font-weight: 700; font-size: 1.04rem; }
.pub-title a { color: var(--ucd-darkest-blue); text-decoration: none; }
.pub-title a:hover { color: var(--ucd-mid-blue); text-decoration: underline; }
.pub-authors, .pub-venue { font-size: .94rem; color: var(--muted); }
.pub-venue { font-style: italic; }
.pub-type {
  font-style: normal; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  padding: 2px 8px; background: var(--ucd-lightest-blue); color: var(--ucd-darkest-blue); margin-left: 6px;
}
.pub-authors .member { color: var(--ucd-darkest-blue); font-weight: 700; text-decoration: none; }
.pub-authors .member:hover { color: var(--ucd-mid-blue); text-decoration: underline; }
.pub-ext { font-style: normal; font-size: .82rem; font-weight: 700; margin-left: 8px; text-decoration: none; }
.pub-ext:hover { text-decoration: underline; }
#pub-list { padding-bottom: 64px; }

.pub-tools {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  margin: 0 0 36px; padding: 18px; background: #fff; box-shadow: var(--shadow);
}
.pub-tools[hidden] { display: none; }
.pub-tools input, .pub-tools select {
  font: inherit; font-size: .98rem; color: var(--text); background: #fff;
  border: 2px solid var(--ucd-lightest-grey); border-radius: 0; padding: 10px 12px;
}
.pub-tools input { flex: 1 1 280px; min-width: 0; }
.pub-tools input:focus, .pub-tools select:focus { outline: none; border-color: var(--ucd-mid-blue); }
.pub-tools .muted { font-size: .92rem; }

/* publication page */
.pub-head { padding: 36px 0 44px; margin-bottom: 44px; color: #fff; }
.pub-head h1 { color: #fff; font-size: clamp(1.7rem, 3.6vw, 2.6rem); max-width: 30ch; }
.pub-head .pub-authors { font-size: 1.05rem; margin-bottom: 4px; color: #dfe8f3; }
.pub-head .pub-authors .member { color: #fff; }
.pub-head .pub-venue { color: #cfdbea; margin-bottom: 22px; }
.pub-head .pub-type { background: var(--ucd-yellow); }
.pub-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.pub-head .btn-primary { background: #fff; color: var(--ucd-darkest-blue); border-color: #fff; }
.pub-head .btn-primary:hover { background: var(--ucd-yellow); border-color: var(--ucd-yellow); }

.contribution { background: #fff; border-left: 6px solid var(--ucd-mid-green); box-shadow: var(--shadow); padding: 20px 24px; }
.contribution h2 { font-size: .9rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ucd-dark-grey); margin-bottom: 8px; }
.contribution p { margin: 0; font-size: 1.08rem; color: var(--ucd-darkest-blue); }

.cite {
  display: flex; gap: 12px; align-items: flex-start;
  background: #fff; border: 1px solid var(--border); padding: 14px 16px;
}
.cite p { margin: 0; flex: 1; font-size: .92rem; color: var(--muted); overflow-wrap: anywhere; }
.cite pre {
  margin: 0; flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .82rem; line-height: 1.5;
  color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.bib-all { margin: 8px 0 0; font-size: .88rem; }

.pub-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--border);
}
.pub-nav a {
  display: block; padding: 16px 18px; background: #fff; box-shadow: var(--shadow);
  text-decoration: none; color: var(--ucd-darkest-blue); font-weight: 600; font-size: .95rem; line-height: 1.4;
  border-bottom: 4px solid transparent;
}
.pub-nav a:hover { border-bottom-color: var(--ucd-yellow); }
.pub-nav small { display: block; color: var(--muted); font-weight: 400; font-size: .8rem; margin-bottom: 4px; }
.pub-nav .next { text-align: right; }
@media (max-width: 600px) { .pub-nav { grid-template-columns: 1fr; } .pub-nav .next { text-align: left; } }

/* ---------- prose pages ---------- */

.prose { max-width: 75ch; padding-bottom: 72px; }
.prose h2 { margin-top: 1.4em; font-size: 1.5rem; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }

/* ---------- footer ---------- */

#site-footer { color: #fff; }
#site-footer a { color: #fff; }
#site-footer a:hover { color: var(--ucd-yellow); }

.contact-band { background: var(--ucd-navy); text-align: center; padding: 36px 0; }
.contact-band h2 { color: #fff; font-size: 1.3rem; margin-bottom: 10px; }
.contact-band p { margin: 0 0 4px; font-size: .95rem; color: #dfe8f3; }

.footer-main { background: var(--ucd-darkest-blue); padding: 48px 0 40px; font-size: .94rem; }
.footer-inner {
  display: grid; gap: 28px 48px; align-items: start;
  grid-template-columns: auto minmax(0, 1fr) auto;
}
@media (max-width: 720px) { .footer-inner { grid-template-columns: auto minmax(0, 1fr); } .footer-col { grid-column: 1 / -1; } }
.footer-logo { width: 72px; height: auto; }
.footer-about strong, .footer-col strong { display: block; font-size: 1.05rem; margin-bottom: 10px; }
.footer-about p { margin: 0 0 6px; color: #cfdbea; }
.footer-copy { margin-top: 16px !important; font-size: .85rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 6px; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.profile > h1:first-child { margin-top: 56px; }
@media (min-width: 600px) { .spotlight { min-height: 300px; } }

.noscript-note { margin: 0; padding: 12px 16px; background: var(--ucd-yellow); color: var(--ucd-darkest-blue); text-align: center; }
@media (max-width: 960px) {
  .header-inner { flex-wrap: wrap; }
  .brand { flex: 1 1 0; }
  .nav-toggle { flex: none; }
}

/* LAIR wordmark keeps its natural proportions beside the UCD crest. */
.group-logo { display: block; width: 250px; max-width: 100%; height: auto; }
.brand-text:has(.group-logo) { width: 250px; max-width: 100%; }
.brand-text:has(.group-logo) small { font-size: .85rem; }
@media (max-width: 520px) {
  .brand { gap: 8px; }
  .brand-text:has(.group-logo) { width: 170px; }
  .brand-text:has(.group-logo) small { font-size: .7rem; }
  .nav-toggle { flex: none; }
}

.theme-separator { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
