/* =============================================================
   Computational Mechanics Lab — Main Stylesheet
   Primary colour: #226E93  |  Font: Lato
   ============================================================= */

/* --- Variables -------------------------------------------- */
:root {
  --cml-blue:       #226E93;
  --cml-blue-dark:  #1a5470;
  --cml-blue-light: #e8f3f8;
  --cml-text:       #333333;
  --cml-muted:      #666666;
  --cml-border:     #dee2e6;
  --cml-bg:         #ffffff;
  --cml-bg-alt:     #f8f9fa;
}

/* --- Base ------------------------------------------------- */
* { box-sizing: border-box; }

html {
  font-size: 17px;
}

body {
  font-family: 'Lato', sans-serif;
  font-weight: 400;
  line-height: 1.65;
  color: var(--cml-text);
  background: var(--cml-bg);
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  color: var(--cml-blue-dark);
  margin-bottom: 0.5rem;
}

a {
  color: var(--cml-blue);
  text-decoration: none;
}
a:hover {
  color: var(--cml-blue-dark);
  text-decoration: underline;
}

p { margin-bottom: 0.85rem; }

hr {
  border: none;
  border-top: 1px solid var(--cml-border);
  margin: 1rem 0;
}

/* --- Main container --------------------------------------- */
.main-container {
  padding-top: 1.5rem;
  padding-bottom: 3rem;
  min-height: calc(100vh - 120px);
}

/* --- Navbar ----------------------------------------------- */
#main-nav {
  background-color: var(--cml-blue);
  padding: 0.6rem 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.navbar-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  padding: 0;
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
}

.brand-sub {
  font-size: 0.72rem;
  font-weight: 300;
  color: rgba(255,255,255,0.82);
  letter-spacing: 0.02em;
}

.nav-link {
  color: rgba(255,255,255,0.88) !important;
  font-size: 0.88rem;
  font-weight: 400;
  padding: 0.45rem 0.85rem !important;
  letter-spacing: 0.03em;
  transition: color 0.15s;
}

.nav-link:hover,
.nav-link.active {
  color: #fff !important;
  font-weight: 700;
}

/* --- Page titles ------------------------------------------ */
.page-title {
  color: var(--cml-blue);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.title-rule {
  border-top: 3px solid var(--cml-blue);
  margin-top: 0.25rem;
  margin-bottom: 1.25rem;
}

/* --- Hero banner ------------------------------------------ */
.hero-banner {
  background: linear-gradient(135deg, var(--cml-blue-dark) 0%, var(--cml-blue) 60%, #2e8fb5 100%);
  border-radius: 8px;
  padding: 2.5rem 2rem 2rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.hero-banner::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  pointer-events: none;
}

.hero-text h1 {
  font-size: 1.65rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 0.15rem;
  line-height: 1.2;
}

.hero-sub {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.06em;
  font-weight: 300;
  margin-bottom: 0.9rem;
}

.hero-tagline {
  font-size: 1rem;
  color: rgba(255,255,255,0.92);
  margin-bottom: 1.2rem;
}

.hero-tagline strong { color: #fff; }

.btn-hero-primary {
  background: #fff;
  color: var(--cml-blue-dark);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.45rem 1.1rem;
  border-radius: 4px;
  margin-right: 0.5rem;
  text-decoration: none;
  border: 2px solid #fff;
  transition: background 0.15s, color 0.15s;
}

.btn-hero-primary:hover {
  background: var(--cml-blue-light);
  color: var(--cml-blue-dark);
  text-decoration: none;
}

.btn-hero-outline {
  background: transparent;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.45rem 1.1rem;
  border-radius: 4px;
  border: 2px solid rgba(255,255,255,0.7);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.btn-hero-outline:hover {
  border-color: #fff;
  background: rgba(255,255,255,0.1);
  color: #fff;
  text-decoration: none;
}

/* --- Homepage lead text ----------------------------------- */
.home-lead {
  color: var(--cml-text);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cml-blue);
  margin-bottom: 0.6rem;
}

/* --- Research pillar cards on homepage -------------------- */
.pillar-link {
  display: block;
  text-decoration: none;
  height: 100%;
}

.pillar-link:hover { text-decoration: none; }

.pillar-card {
  border: 1px solid var(--cml-border);
  border-radius: 8px;
  overflow: hidden;
  height: 100%;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
  background: #fff;
}

.pillar-card:hover {
  box-shadow: 0 6px 18px rgba(34,110,147,0.18);
  border-color: var(--cml-blue);
  transform: translateY(-2px);
}

.pillar-img {
  height: 150px;
  background-size: cover;
  background-position: center;
  background-color: var(--cml-blue);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pillar-img-overlay {
  position: absolute;
  inset: 0;
  /* Subtle dark vignette at bottom only — lets image colours show through */
  background: linear-gradient(to bottom,
    rgba(0,0,0,0.05) 0%,
    rgba(0,0,0,0.28) 100%);
}

.pillar-img-icon {
  position: relative;
  z-index: 1;
  font-size: 2.6rem;
  color: rgba(255,255,255,0.92);
  text-shadow: 0 2px 10px rgba(0,0,0,0.45);
}

.pillar-body {
  padding: 0.8rem 1rem;
}

.pillar-card h5 {
  font-size: 1.05rem;
  color: var(--cml-blue-dark);
  margin-bottom: 0.3rem;
}

.pillar-card p {
  color: var(--cml-muted);
  margin: 0;
  line-height: 1.5;
}

/* --- Application area tags -------------------------------- */
.app-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* --- Recruiting callout ----------------------------------- */
.recruit-banner {
  background: var(--cml-blue-light);
  border-left: 4px solid var(--cml-blue);
  border-radius: 4px;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-recruit {
  background: var(--cml-blue);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.35rem 0.9rem;
  border-radius: 4px;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s;
}

.btn-recruit:hover {
  background: var(--cml-blue-dark);
  color: #fff;
  text-decoration: none;
}

/* --- News sidebar ----------------------------------------- */
.sidebar-heading {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cml-blue);
  border-bottom: 2px solid var(--cml-blue);
  padding-bottom: 0.3rem;
  margin-bottom: 0.75rem;
}

.news-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.news-item {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
  font-size: 0.83rem;
  line-height: 1.4;
}

.news-date {
  flex-shrink: 0;
  color: var(--cml-blue);
  font-weight: 700;
  font-size: 0.78rem;
  min-width: 58px;
  padding-top: 0.05rem;
}

.news-text {
  color: var(--cml-text);
}

.news-more {
  font-size: 0.8rem;
  margin-top: 0.5rem;
  margin-bottom: 0;
}

/* --- Funding logos sidebar -------------------------------- */
.funding-logos {
  border-top: 1px solid var(--cml-border);
  padding-top: 1rem;
}

/* Use logo images when available, text badge otherwise */
.funder-logo-wrap img {
  max-height: 36px;
  max-width: 80px;
  object-fit: contain;
  filter: grayscale(20%);
  transition: filter 0.2s;
}

.funder-logo-wrap img:hover { filter: grayscale(0%); }

.funder-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--cml-border);
  border-radius: 3px;
  color: var(--cml-muted);
  background: var(--cml-bg-alt);
  letter-spacing: 0.02em;
}

.funder-logo-wrap a:hover .funder-badge {
  border-color: var(--cml-blue);
  color: var(--cml-blue);
  text-decoration: none;
}

/* --- Research page ---------------------------------------- */
.research-area {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--cml-border);
}

.research-area:last-child { border-bottom: none; }

.research-area h3 {
  color: var(--cml-blue);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.research-area img {
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.application-tag {
  display: inline-block;
  background: var(--cml-blue-light);
  color: var(--cml-blue-dark);
  border-radius: 3px;
  padding: 0.2rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 700;
  margin: 0.15rem 0.15rem 0.15rem 0;
}

/* --- Team page -------------------------------------------- */
.team-member {
  margin-bottom: 1.8rem;
}

.team-photo-wrap {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--cml-blue-light);
  flex-shrink: 0;
}

.team-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-photo-placeholder {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: var(--cml-blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--cml-blue);
  font-size: 2.2rem;
}

.team-info h5 {
  margin-bottom: 0.1rem;
  color: var(--cml-blue-dark);
}

.team-info .role {
  font-weight: 700;
  color: var(--cml-blue);
  margin-bottom: 0.25rem;
}

.team-info p {
  color: var(--cml-muted);
  margin-bottom: 0.25rem;
}

.team-section-header {
  color: var(--cml-blue);
  font-size: 1.05rem;
  border-bottom: 2px solid var(--cml-blue-light);
  padding-bottom: 0.3rem;
  margin: 1.5rem 0 1rem;
}

/* --- Publications ----------------------------------------- */
.pub-year-header {
  color: var(--cml-blue);
  font-size: 1rem;
  font-weight: 700;
  border-left: 4px solid var(--cml-blue);
  padding-left: 0.6rem;
  margin: 1rem 0 0.4rem;
}

.pub-item {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px dashed var(--cml-border);
  line-height: 1.5;
}

.pub-item:last-child { border-bottom: none; }

.pub-number {
  flex-shrink: 0;
  color: var(--cml-blue);
  font-weight: 700;
  min-width: 24px;
  padding-top: 0.1rem;
}

.pub-content .pub-title {
  font-weight: 700;
  color: var(--cml-text);
}

.pub-content .pub-authors {
  color: var(--cml-muted);
}

.pub-content .pub-journal {
  font-style: italic;
  color: var(--cml-muted);
}

.pub-content .pub-links a {
  font-size: 0.78rem;
  margin-right: 0.5rem;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--cml-blue);
  border-radius: 3px;
  color: var(--cml-blue);
  white-space: nowrap;
}

.pub-content .pub-links a:hover {
  background: var(--cml-blue);
  color: #fff;
  text-decoration: none;
}

.pub-link-btn {
  font-size: 0.78rem;
  margin-left: 0.3rem;
  padding: 0.1rem 0.4rem;
  border: 1px solid var(--cml-blue);
  border-radius: 3px;
  color: var(--cml-blue);
  white-space: nowrap;
  text-decoration: none !important;
}

.pub-link-btn:hover {
  background: var(--cml-blue);
  color: #fff !important;
}

.pub-highlight .pub-title::after {
  content: " ★";
  color: #e6ac00;
  font-size: 0.85em;
}

/* --- All news page ---------------------------------------- */
.news-full-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed var(--cml-border);
}

.news-full-date {
  flex-shrink: 0;
  font-weight: 700;
  color: var(--cml-blue);
  min-width: 80px;
}

/* --- Vacancies -------------------------------------------- */
.vacancy-card {
  background: var(--cml-blue-light);
  border-left: 4px solid var(--cml-blue);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.vacancy-card h4 {
  margin-bottom: 0.5rem;
}

.vacancy-card p, .vacancy-card ul, .vacancy-card li { margin-bottom: 0.4rem; }

/* --- Contact page ----------------------------------------- */
.contact-card {
  background: var(--cml-bg-alt);
  border-radius: 6px;
  padding: 1.5rem;
  border: 1px solid var(--cml-border);
}

.contact-card h4 { color: var(--cml-blue); }

.contact-map {
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--cml-border);
}

/* --- Footer ----------------------------------------------- */
.site-footer {
  background: #1e3a4a;
  color: rgba(255,255,255,0.8);
  font-size: 0.83rem;
}

.site-footer h5 {
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.footer-links { margin: 0; }

.footer-links li { margin-bottom: 0.25rem; }

.footer-links a {
  color: rgba(255,255,255,0.72);
  font-size: 0.82rem;
}

.footer-links a:hover {
  color: #fff;
  text-decoration: none;
}

.footer-hr { border-color: rgba(255,255,255,0.15); }

.footer-credit {
  color: rgba(255,255,255,0.5);
}

.footer-credit a {
  color: rgba(255,255,255,0.65);
}

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

/* --- Utility ---------------------------------------------- */
.text-blue    { color: var(--cml-blue) !important; }
.bg-blue-light { background: var(--cml-blue-light) !important; }

/* --- Homepage headings ------------------------------------ */
.home-welcome {
  font-size: 1.5rem;
  color: var(--cml-blue-dark);
  font-weight: 700;
  margin-bottom: 0.1rem;
}

.home-affiliation {
  color: var(--cml-muted);
  font-weight: 400;
  letter-spacing: 0.04em;
  margin-bottom: 1rem;
}

/* --- Team links ------------------------------------------- */
.team-links a {
  color: var(--cml-blue);
  margin-right: 0.75rem;
}

.team-links a:hover { color: var(--cml-blue-dark); text-decoration: none; }

/* --- Tables ----------------------------------------------- */
table {
  font-size: inherit;
}

table th {
  color: var(--cml-blue-dark);
  border-bottom: 2px solid var(--cml-blue-light) !important;
}

/* --- Application tag links -------------------------------- */
a.application-tag {
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

a.application-tag:hover {
  background: var(--cml-blue);
  color: #fff;
  text-decoration: none;
}

/* --- Applications overview cards ------------------------- */
.app-card-link {
  display: block;
  height: 100%;
  text-decoration: none;
}

.app-card-link:hover { text-decoration: none; }

.app-card {
  border: 1px solid var(--cml-border);
  border-radius: 8px;
  overflow: hidden;
  height: 100%;
  transition: box-shadow 0.2s, transform 0.2s;
  background: #fff;
}

.app-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  transform: translateY(-3px);
}

.app-card-icon {
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  color: rgba(255,255,255,0.9);
}

.app-card-body {
  padding: 1rem 1.1rem 1.2rem;
}

.app-card-body h4 {
  font-size: 1rem;
  color: var(--cml-blue-dark);
  margin-bottom: 0.25rem;
}

.app-card-body p {
  color: var(--cml-muted);
  margin-bottom: 0.3rem;
  line-height: 1.5;
}

.app-theme-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  background: var(--cml-blue-light);
  color: var(--cml-blue-dark);
  margin-bottom: 0.5rem;
}

.app-theme-badge-light {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.6rem;
  border-radius: 3px;
  background: rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.92);
  border: 1px solid rgba(255,255,255,0.35);
}

.app-card-cta {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--cml-blue);
}

/* --- Method chips ----------------------------------------- */
.method-chip {
  background: var(--cml-bg-alt);
  border: 1px solid var(--cml-border);
  border-radius: 6px;
  padding: 0.55rem 0.85rem;
  color: var(--cml-text);
}

/* --- Application sub-page hero --------------------------- */
.app-hero {
  border-radius: 8px;
  padding: 1.5rem 1.75rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  color: #fff;
  margin-bottom: 0.5rem;
}

.app-hero-icon {
  font-size: 2.5rem;
  color: rgba(255,255,255,0.85);
  flex-shrink: 0;
}

.app-hero-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.3rem;
}

/* --- Application page image placeholders ----------------- */
.app-img-placeholder {
  border: 2px dashed;
  border-radius: 8px;
  height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 2rem;
}

.app-img-placeholder span {
  font-size: 0.75rem;
  color: var(--cml-muted);
  font-style: italic;
}

/* --- Publication reference line -------------------------- */
.pub-ref {
  font-size: 0.83rem;
  color: var(--cml-muted);
  background: var(--cml-bg-alt);
  border-left: 3px solid var(--cml-blue);
  padding: 0.5rem 0.75rem;
  border-radius: 0 4px 4px 0;
}

/* --- Breadcrumb ------------------------------------------ */
.app-breadcrumb {
  font-size: 0.82rem;
  background: none;
  padding: 0;
}

.app-breadcrumb .breadcrumb-item a {
  color: var(--cml-blue);
}

.app-breadcrumb .breadcrumb-item.active {
  color: var(--cml-muted);
}

/* --- Prev/next nav --------------------------------------- */
.app-nav-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn-app-back, .btn-app-next {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--cml-blue);
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--cml-blue);
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.btn-app-back:hover, .btn-app-next:hover {
  background: var(--cml-blue);
  color: #fff;
  text-decoration: none;
}

/* --- Navbar dropdown styling ----------------------------- */
.dropdown-menu-dark .dropdown-item small {
  display: block;
  line-height: 1.2;
}

.dropdown-menu-dark .dropdown-item {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

/* --- Blog ------------------------------------------------- */
.blog-card {
  border-bottom: 1px dashed var(--cml-border);
  padding: 1.25rem 0;
}
.blog-card:last-child { border-bottom: none; }

.blog-card-meta {
  font-size: 0.82rem;
  color: var(--cml-muted);
  margin-bottom: 0.4rem;
}

.blog-card-date { color: var(--cml-blue); font-weight: 600; }

.blog-card-title {
  font-size: 1.15rem;
  margin-bottom: 0.4rem;
}
.blog-card-title a { color: var(--cml-blue-dark); text-decoration: none; }
.blog-card-title a:hover { color: var(--cml-blue); text-decoration: underline; }

.blog-card-excerpt { color: var(--cml-muted); margin-bottom: 0.5rem; }

.blog-read-more {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--cml-blue);
  text-decoration: none;
}
.blog-read-more:hover { color: var(--cml-blue-dark); text-decoration: underline; }

/* Post meta line */
.post-meta { color: var(--cml-muted); font-size: 0.88rem; }
.post-date, .post-author { color: var(--cml-blue); font-weight: 600; }

/* Post tags */
.post-tag {
  display: inline-block;
  background: var(--cml-blue-light);
  color: var(--cml-blue-dark);
  border-radius: 3px;
  padding: 0.1rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  margin-right: 0.25rem;
  text-transform: lowercase;
}

/* Post body */
.post-body h2, .post-body h3 { margin-top: 1.5rem; }
.post-body img { max-width: 100%; border-radius: 4px; margin: 1rem 0; }

/* Sidebar post list */
.blog-post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.blog-post-list-item {
  border-bottom: 1px dashed var(--cml-border);
  padding: 0.45rem 0;
  font-size: 0.88rem;
}
.blog-post-list-item:last-child { border-bottom: none; }
.blog-post-list-item a { color: var(--cml-text); text-decoration: none; }
.blog-post-list-item a:hover { color: var(--cml-blue); }
.blog-post-list-item.active a { color: var(--cml-blue); font-weight: 700; }
.blog-post-list-date {
  display: block;
  font-size: 0.75rem;
  color: var(--cml-muted);
}

/* --- Responsive ------------------------------------------- */
@media (max-width: 767px) {
  .brand-name { font-size: 0.9rem; }
  .main-container { padding-top: 1rem; }

  .team-photo-wrap,
  .team-photo-placeholder { width: 80px; height: 80px; font-size: 1.6rem; }

  .pub-item { flex-direction: column; gap: 0.2rem; }
  .pub-number { min-width: auto; }
}
