/* ============================================================
   Intelligent Modelling - Custom Styles
   Supplements Bootstrap 5 with project-specific design
   ============================================================ */

/* --- Root variables for consistent theming --- */
:root {
  --brand-navy: #1b2a4a;
  --brand-navy-light: #263d6b;
  --brand-gold: #c9a84c;
  --brand-gold-light: #e8d18f;
  --brand-cream: #faf8f2;
  --brand-grey: #5a6a7e;
  --brand-light-grey: #e9ecf0;
  --brand-white: #ffffff;
  --brand-text: #2d3748;
  --brand-text-muted: #6b7c93;
  --font-heading: 'Merriweather', Georgia, 'Times New Roman', serif;
  --font-body: 'Source Sans 3', 'Segoe UI', Tahoma, sans-serif;
}

/* --- Base typography --- */
body {
  font-family: var(--font-body);
  color: var(--brand-text);
  line-height: 1.72;
  background-color: var(--brand-cream);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--brand-navy);
  font-weight: 700;
}

h1 { font-size: 2.15rem; margin-bottom: 1rem; }
h2 { font-size: 1.65rem; margin-bottom: 0.85rem; }
h3 { font-size: 1.3rem; margin-bottom: 0.7rem; }

p {
  margin-bottom: 1.15rem;
  color: var(--brand-text);
}

a {
  color: var(--brand-navy-light);
  text-decoration: underline;
  text-decoration-color: var(--brand-gold);
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

a:hover {
  color: var(--brand-gold);
  text-decoration-color: var(--brand-gold);
}

/* --- Top navigation bar --- */
.site-header {
  background-color: var(--brand-navy);
  border-bottom: 3px solid var(--brand-gold);
  padding: 0;
}

.site-header .navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--brand-white);
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
  padding: 0.75rem 0;
}

.site-header .navbar-brand:hover {
  color: var(--brand-gold-light);
}

.site-header .navbar-brand img {
  height: 38px;
  width: auto;
}

.site-header .nav-link {
  color: rgba(255,255,255,0.85);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.9rem 0.8rem;
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease;
  border-bottom: 2px solid transparent;
}

.site-header .nav-link:hover,
.site-header .nav-link:focus {
  color: var(--brand-gold-light);
  background-color: rgba(255,255,255,0.06);
}

.site-header .nav-link.active {
  color: var(--brand-gold);
  border-bottom-color: var(--brand-gold);
}

.navbar-toggler {
  border-color: rgba(255,255,255,0.3);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* --- Hero / profile banner on homepage --- */
.profile-banner {
  background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-navy-light) 100%);
  color: var(--brand-white);
  padding: 3.5rem 0 3rem;
}

.profile-banner h1 {
  color: var(--brand-white);
  font-size: 2.4rem;
  margin-bottom: 0.5rem;
}

.profile-banner .subtitle {
  color: var(--brand-gold-light);
  font-family: var(--font-body);
  font-size: 1.12rem;
  font-weight: 400;
  margin-bottom: 1.2rem;
}

.profile-banner .location-info {
  color: rgba(255,255,255,0.7);
  font-size: 0.95rem;
}

.profile-banner .location-info svg {
  margin-right: 0.3rem;
  vertical-align: -2px;
}

/* --- Section styling for main content areas --- */
.content-section {
  padding: 3rem 0;
}

.content-section.alt-bg {
  background-color: var(--brand-white);
}

.section-heading {
  position: relative;
  padding-bottom: 0.75rem;
  margin-bottom: 1.75rem;
}

.section-heading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background-color: var(--brand-gold);
  border-radius: 2px;
}

.section-heading.centered::after {
  left: 50%;
  transform: translateX(-50%);
}

/* --- Research area cards --- */
.research-card {
  background: var(--brand-white);
  border: 1px solid var(--brand-light-grey);
  border-radius: 6px;
  padding: 1.5rem;
  height: 100%;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.research-card:hover {
  box-shadow: 0 6px 20px rgba(27,42,74,0.1);
  transform: translateY(-2px);
}

.research-card .card-icon {
  width: 48px;
  height: 48px;
  background-color: var(--brand-navy);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: var(--brand-gold);
  font-size: 1.3rem;
}

.research-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.6rem;
}

.research-card p {
  font-size: 0.92rem;
  color: var(--brand-text-muted);
  margin-bottom: 0;
}

/* --- News / blogroll cards on homepage --- */
.news-card {
  background: var(--brand-white);
  border: 1px solid var(--brand-light-grey);
  border-radius: 6px;
  padding: 1.6rem;
  height: 100%;
  transition: box-shadow 0.25s ease;
}

.news-card:hover {
  box-shadow: 0 4px 16px rgba(27,42,74,0.08);
}

.news-card .card-date,
.news-date {
  font-size: 0.82rem;
  color: var(--brand-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.55rem;
  display: block;
}

.news-card h3 {
  font-size: 1.12rem;
  margin-bottom: 0.65rem;
}

.news-card h3 a {
  color: var(--brand-navy);
  text-decoration: none;
}

.news-card h3 a:hover {
  color: var(--brand-gold);
  text-decoration: underline;
  text-decoration-color: var(--brand-gold);
}

.news-card p {
  font-size: 0.93rem;
  color: var(--brand-text-muted);
  line-height: 1.65;
}

.news-card p a {
  color: var(--brand-navy-light);
}

.news-card .card-excerpt {
  font-size: 0.93rem;
  color: var(--brand-text-muted);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.news-card .card-excerpt a {
  color: var(--brand-navy-light);
}

.news-card .read-more-link {
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--brand-navy-light);
}

.news-card .read-more-link:hover {
  color: var(--brand-gold);
}

.news-card .read-more-link::after {
  content: ' \2192';
}

/* --- News index listing items --- */
.news-listing-item h2 {
  font-size: 1.35rem;
  margin-bottom: 0.6rem;
}

.news-listing-item h2 a {
  color: var(--brand-navy);
  text-decoration: none;
}

.news-listing-item h2 a:hover {
  color: var(--brand-gold);
  text-decoration: underline;
}

.news-listing-item p a {
  color: var(--brand-navy-light);
}

/* --- News roll (homepage blogroll, up to 10 items) --- */
.news-roll {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.news-roll-item {
  padding: 1.8rem 0;
  border-bottom: 1px solid var(--brand-light-grey);
}

.news-roll-item:first-child {
  padding-top: 0;
}

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

.news-roll-item h3 {
  font-size: 1.2rem;
  margin-bottom: 0.6rem;
}

.news-roll-item h3 a {
  color: var(--brand-navy);
  text-decoration: none;
}

.news-roll-item h3 a:hover {
  color: var(--brand-gold);
  text-decoration: underline;
  text-decoration-color: var(--brand-gold);
}

.news-roll-item p {
  font-size: 0.94rem;
  color: var(--brand-text-muted);
  line-height: 1.68;
  margin-bottom: 0.6rem;
}

.news-roll-item p a {
  color: var(--brand-navy-light);
}

.news-roll-item .read-more-link {
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--brand-navy-light);
}

.news-roll-item .read-more-link:hover {
  color: var(--brand-gold);
}

/* --- Achievements / quick stats --- */
.stat-item {
  text-align: center;
  padding: 1.5rem;
}

.stat-item .stat-number {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--brand-gold);
  line-height: 1.2;
}

.stat-item .stat-label {
  font-size: 0.88rem;
  color: var(--brand-text-muted);
  margin-top: 0.3rem;
}

/* --- Selected publications highlight --- */
.publication-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--brand-light-grey);
}

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

.publication-item .pub-title {
  font-weight: 600;
  color: var(--brand-navy);
  margin-bottom: 0.3rem;
}

.publication-item .pub-meta {
  font-size: 0.88rem;
  color: var(--brand-text-muted);
}

/* --- Footer styling --- */
.site-footer {
  background-color: var(--brand-navy);
  color: rgba(255,255,255,0.7);
  padding: 2.5rem 0 1.5rem;
  font-size: 0.9rem;
}

.site-footer h5 {
  color: var(--brand-gold-light);
  font-size: 1rem;
  font-family: var(--font-body);
  font-weight: 600;
  margin-bottom: 1rem;
}

.site-footer a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  text-decoration-color: transparent;
}

.site-footer a:hover {
  color: var(--brand-gold-light);
}

.site-footer .footer-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer .footer-nav-list li {
  margin-bottom: 0.45rem;
}

.site-footer .footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  margin-top: 2rem;
  padding-top: 1.2rem;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
}

/* --- Cookie consent bar --- */
.cookie-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--brand-navy);
  color: rgba(255,255,255,0.9);
  padding: 1rem 1.5rem;
  z-index: 9999;
  display: none;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.2);
}

.cookie-bar.visible {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.cookie-bar p {
  margin: 0;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.85);
  flex: 1;
  min-width: 250px;
}

.cookie-bar .btn-accept {
  background-color: var(--brand-gold);
  color: var(--brand-navy);
  border: none;
  padding: 0.45rem 1.3rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  white-space: nowrap;
}

.cookie-bar .btn-accept:hover {
  background-color: var(--brand-gold-light);
}

.cookie-bar .btn-decline {
  background: transparent;
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 0.45rem 1rem;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.cookie-bar .btn-decline:hover {
  color: rgba(255,255,255,0.9);
  border-color: rgba(255,255,255,0.6);
}

/* --- Page header for inner pages --- */
.page-header {
  background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-navy-light) 100%);
  color: var(--brand-white);
  padding: 2.5rem 0;
}

.page-header h1 {
  color: var(--brand-white);
  font-size: 2rem;
  margin-bottom: 0.4rem;
}

.page-header .breadcrumb-text {
  color: rgba(255,255,255,0.6);
  font-size: 0.88rem;
}

.page-header .breadcrumb-text a {
  color: var(--brand-gold-light);
  text-decoration: none;
}

.page-header .breadcrumb-text a:hover {
  text-decoration: underline;
}

/* --- Utility classes --- */
.gold-accent {
  color: var(--brand-gold);
}

.section-intro {
  font-size: 1.08rem;
  color: var(--brand-text-muted);
  max-width: 720px;
  margin-bottom: 2rem;
}

/* --- Responsive tweaks --- */
@media (max-width: 991.98px) {
  .site-header .nav-link {
    padding: 0.6rem 0.8rem;
    border-bottom: none;
  }

  .site-header .nav-link.active {
    background-color: rgba(255,255,255,0.08);
    border-bottom: none;
  }

  .profile-banner {
    padding: 2.5rem 0 2rem;
    text-align: center;
  }

  .profile-banner h1 {
    font-size: 1.9rem;
  }

  .stat-item {
    padding: 1rem 0.5rem;
  }

  .stat-item .stat-number {
    font-size: 1.8rem;
  }
}

@media (max-width: 575.98px) {
  .profile-banner h1 {
    font-size: 1.55rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  .news-card {
    padding: 1.2rem;
  }

  .content-section {
    padding: 2rem 0;
  }
}
