/*
 * Shared stylesheet for the research website.  The design intentionally
 * mirrors the aesthetic of the provided landing page: soft gradients,
 * translucent cards, muted typography and a responsive layout.  CSS
 * variables are used to support light and dark mode automatically via
 * the user's OS settings (prefers-color-scheme).
 */

/* Colour palette and sizing variables.  These values are pulled
 * directly from the landing page to ensure consistency.  Additional
 * variables for layout and navigation are added below.  When light
 * mode is active the variables are overridden accordingly.
 */
:root {
  --bg: #0b1220;
  --card: rgba(255,255,255,0.08);
  --card-border: rgba(255,255,255,0.16);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.70);
  --shadow: 0 14px 34px rgba(0,0,0,0.35);
  --radius: 16px;
  --accent: rgba(110,170,255,0.85);
  --accent-muted: rgba(110,170,255,0.20);
  --accent-border: rgba(110,170,255,0.30);
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f8fb;
    --card: rgba(255,255,255,0.9);
    --card-border: rgba(10,20,40,0.12);
    --text: rgba(10,20,40,0.92);
    --muted: rgba(10,20,40,0.70);
    --shadow: 0 14px 34px rgba(10,20,40,0.10);
    --accent: rgba(110,170,255,0.85);
    --accent-muted: rgba(110,170,255,0.20);
    --accent-border: rgba(110,170,255,0.30);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background:
    radial-gradient(900px 600px at 15% 10%, rgba(110,170,255,0.30), transparent 60%),
    radial-gradient(800px 520px at 85% 25%, rgba(255,170,120,0.25), transparent 55%),
    radial-gradient(900px 600px at 50% 90%, rgba(140,255,200,0.18), transparent 60%),
    var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}
a:focus {
  outline: 3px solid rgba(110,170,255,0.55);
  outline-offset: 3px;
  border-radius: 10px;
}

/* Container to constrain width and provide horizontal padding */
.wrap {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 48px 20px 28px;
  flex: 1;
}

/* Navigation header */
.site-header {
  margin-bottom: 32px;
}
.nav {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 15px;
}
.nav-link {
  position: relative;
  padding: 6px 4px;
  border-radius: 8px;
  transition: background 140ms ease;
  color: var(--text);
}
.nav-link:hover {
  background: rgba(110,170,255,0.12);
}
.nav-link.active {
  background: rgba(110,170,255,0.20);
  border: 1px solid rgba(110,170,255,0.30);
}

/* Hero section */
.hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;          /* shorter than 40px */
  padding: 16px 18px 18px;      /* adds a compact card feel */
  border-radius: var(--radius);
}
.hero-main {
  flex: 1 1 260px;
  min-width: 0;
}
.hero-title {
  margin: 0;
  font-size: clamp(28px, 4.5vw, 40px);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.hero-subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16px;
  max-width: 62ch;
}
/* Context line (“Part of the Photonics & Nanotechnology Group…”) */
.hero-context {
  margin-top: 10px;
  font-size: 13px;
  font-style: italic;
  letter-spacing: 0.01em;
  color: var(--muted);
  max-width: 60ch;
}
/* Contact info (name + email) */
.hero-contact {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}
/* CV button row */
.hero-actions {
  margin-top: 14px;
}
/* Right column: avatar + logo */
.hero-branding {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}
/* Keep hero compact on mobile */
@media (max-width: 760px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 14px 16px 16px;
  }

  .hero-branding {
    align-items: flex-start;
  }
}
.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--accent-muted);
  border: 1px solid var(--accent-border);
  transition: background 140ms ease, border-color 140ms ease;
}
.button:hover {
  background: rgba(110,170,255,0.28);
  border-color: rgba(110,170,255,0.45);
}

/* Section headings */
section > h2 {
  margin: 0 0 16px;
  font-size: 24px;
  letter-spacing: -0.01em;
}

/* Card base style reused across news, team, funding, software, opportunities */
.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px 16px;
  position: relative;
  overflow: hidden;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: rgba(110,170,255,0.42);
}
.card::after {
  content: "";
  position: absolute;
  inset: -40px -80px auto auto;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.18), transparent 60%);
  transform: rotate(10deg);
  pointer-events: none;
}

.card-title {
  margin: 0 0 8px;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.card-subtitle {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  max-width: 70ch;
}

/* News-specific */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.news-date {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

/* Media‑object layout for news items: compact thumbnail on the left */
.news-card .news-card-inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
/* Wrapper to constrain thumbnail size */
.news-thumb-wrapper {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.12);
}
.news-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.news-content {
  flex: 1 1 auto;
  min-width: 0;
}
@media (max-width: 600px) {
  /* On very narrow screens you may prefer a vertical layout; adjust as needed */
  .news-card .news-card-inner {
    gap: 10px;
  }
}

.show-more {
  margin-top: 20px;
  align-self: flex-start;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--accent-muted);
  border: 1px solid var(--accent-border);
  transition: background 140ms ease, border-color 140ms ease;
  color: var(--text);
}
.show-more:hover {
  background: rgba(110,170,255,0.28);
  border-color: rgba(110,170,255,0.45);
}

/* Team page */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
}
.team-card-name {
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 18px;
}
.team-card-role {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 6px;
}
.team-card-topic {
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
}
.team-card-links {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}


/* Avatar layout for team members */
.team-card-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}
.team-card-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
/* Make former-member avatars smaller than current ones */
.former-item .team-card-avatar {
  width: 40px;
  height: 40px;
}
.team-card-text {
  flex: 1 1 auto;
  min-width: 0;
}

/* Former team list */
.former-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}
.former-item {
  padding: 12px 14px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  transition: transform 140ms ease, border-color 140ms ease;
}
.former-item:hover {
  transform: translateY(-2px);
  border-color: rgba(110,170,255,0.42);
}
.former-name {
  font-weight: 600;
  margin-bottom: 2px;
}
.former-details {
  color: var(--muted);
  font-size: 14px;
}

/* Funding page */
.funding-section {
  margin-bottom: 32px;
}
.funding-entry {
  margin-bottom: 16px;
}
.funding-entry .card-title {
  font-size: 18px;
}
.funding-funder {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}
.funding-years {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}

/* Funding entry header: funder name and optional logo */
.funding-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.funding-logo {
  max-height: 32px;
  max-width: 80px;
  object-fit: contain;
}

/* Opportunities page */
.opportunity-card {
  margin-bottom: 18px;
}
.opportunity-link {
  display: inline-block;
  margin-top: 10px;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--accent-muted);
  border: 1px solid var(--accent-border);
  transition: background 140ms ease, border-color 140ms ease;
}
.opportunity-link:hover {
  background: rgba(110,170,255,0.28);
  border-color: rgba(110,170,255,0.45);
}

/* Software card header: optional logo and title */
.software-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.software-logo {
  max-height: 32px;
  max-width: 64px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Software & data page */
.software-card {
  margin-bottom: 18px;
}
.software-meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.software-meta span {
  padding: 4px 6px;
  border-radius: 8px;
  background: rgba(110,170,255,0.15);
  border: 1px solid rgba(110,170,255,0.25);
  font-size: 12px;
}

/* Responsive adjustments */
@media (max-width: 760px) {
  .nav {
    gap: 16px;
  }
  .hero-title {
    font-size: clamp(24px, 6vw, 36px);
  }
}


/* --- Custom additions for refactored site --- */
/* Navigation buttons styling: always visible as rounded rectangles */
.nav-link {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(110,170,255,0.12);
  border: 1px solid rgba(110,170,255,0.25);
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}
.nav-link:hover {
  background: rgba(110,170,255,0.20);
}
.nav-link.active {
  background: rgba(110,170,255,0.28);
  border-color: rgba(110,170,255,0.45);
}

/* Hero banner styling for the home page: full‑width atmosphere */
.home-hero {
  position: relative;
  background: linear-gradient(rgba(0,0,0,0.75), rgba(0,0,0,0.75)), url('../images/banner/hero_banner.png');
  background-size: cover;
  background-position: center;
  border-radius: var(--radius);
  padding: 48px 28px;
  overflow: hidden;
}
@media (prefers-color-scheme: light) {
  .home-hero {
    background: linear-gradient(rgba(255,255,255,0.75), rgba(255,255,255,0.75)), url('../images/banner/hero_banner.png');
  }
}

/* Hero branding: PI photo and KCL logo */
.hero-branding {
  margin-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.hero-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--card-border);
}
.hero-logo {
  height: 56px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* Section gap helper for vertical rhythm */
.section-gap {
  height: 24px;
  width: 100%;
}

/* Small links styling in footer */
.small-links {
  margin-top: 8px;
  font-size: 13px;
}
.small-links a {
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,0.25);
  text-underline-offset: 3px;
  color: var(--muted);
}
.small-links a:hover {
  text-decoration-color: rgba(255,255,255,0.4);
}
@media (prefers-color-scheme: light) {
  .small-links a {
    text-decoration-color: rgba(10,20,40,0.25);
    color: var(--muted);
  }
  .small-links a:hover {
    text-decoration-color: rgba(10,20,40,0.4);
  }
}
