/* =============================================
   HOME PAGE
   ============================================= */

.home-about {
  padding: 2rem 0;
}

/* Quarto wraps the img in a <p> — collapse wrapper, float the img */
.home-about > p:first-child {
  margin: 0;
  line-height: 0;
}

.home-photo {
  float: left;
  width: 280px;
  height: 280px;
  max-width: 280px;
  object-fit: cover;
  border-radius: 0.5rem;
  border: 1px solid var(--bs-border-color);
  margin: 0 1.5rem 1rem 0;
}

/* Right-align the social buttons paragraph (last <p> in .home-about) */
.home-about > p:last-of-type {
  text-align: right;
}

@media (max-width: 576px) {
  .home-about > p:first-child {
    text-align: center;
  }
  .home-photo {
    float: none;
    width: 140px;
    height: 140px;
    max-width: 140px;
    margin: 0 auto 1rem auto;
  }
  .home-about > p:last-of-type {
    text-align: center;
  }
}

/* =============================================
   RESEARCH CARDS
   ============================================= */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

.research-card {
  border: 1px solid var(--bs-border-color);
  border-radius: 0.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--bs-body-bg);
  transition: box-shadow 0.2s ease;
}

.research-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.research-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.research-card p,
.research-card section p {
  font-size: 0.92rem;
  line-height: 1.65;
  margin-bottom: 0;
  text-align: left;
  color: var(--bs-secondary-color, var(--bs-secondary));
}

.research-card section p:last-child {
  text-align: center;
  margin-top: 0.75rem;
}

/* =============================================
   RESEARCH CARDS — CLICKABLE LINKS
   ============================================= */

.research-card {
  cursor: pointer;
}

.research-card h3 a {
  color: var(--bs-primary);
  text-decoration: none;
}

.research-card h3 a:hover {
  text-decoration: underline;
}

/* Quarto wraps the img in a <p> — collapse it and use it for centering */
.research-card > p:first-child {
  margin: -1.25rem -1.5rem 1rem -1.5rem;
  line-height: 0;
  text-align: center;
}

.research-card .card-img-top {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 0.5rem 0.5rem 0 0;
}

/* =============================================
   NEWS / BLOG LIST ON HOME
   ============================================= */

#listing-recent-posts .card-img {
  object-fit: contain;
  background-color: var(--bs-body-bg);
}

.news-list p {
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

/* =============================================
   SOFTWARE PAGE
   ============================================= */

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0.5rem;
}

.software-card {
  cursor: default;
}

.software-card .card-img-top {
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--bs-tertiary-bg);
}

.tool-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.75rem 0 0.25rem;
}

.tool-citation {
  font-size: 0.8rem;
  color: var(--bs-secondary-color);
  border-top: 1px solid var(--bs-border-color);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
  line-height: 1.5;
}

/* =============================================
   PUBLICATIONS PAGE
   ============================================= */

.oa-button-wrap {
  margin-top: 0.5em;
  text-indent: 0;
}

.oa-button {
  display: inline-block;
  box-sizing: border-box;
  padding: 0.3em 1em;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.4;
  border-radius: 4px;
  border: 1.5px solid var(--bs-primary);
  background-color: transparent;
  color: var(--bs-primary) !important;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.02em;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.oa-button:hover {
  background-color: #2780e3;
  color: #fff !important;
}

/* =============================================
   PUBLICATION LISTINGS (programme pages)
   ============================================= */

.pub-list ul {
  list-style: none;
  padding: 0;
  margin: 0 0 2em;
}

.pub-list li.pub-item {
  margin-bottom: 2.5em;
  padding-left: 0.75em;
  border-left: 5px solid rgba(var(--bs-primary-rgb), 0.2);
}

/* Blog-style row: thumbnail + text side by side */
.pub-row {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}

.pub-thumbnail {
  flex-shrink: 0;
  width: 120px;
}

.pub-thumbnail img {
  width: 100%;
  height: auto;
  border-radius: 0.35rem;
  border: 1px solid var(--bs-border-color);
  object-fit: cover;
}

.pub-body {
  flex: 1;
  min-width: 0;
}

/* Stack on small screens */
@media (max-width: 576px) {
  .pub-row {
    flex-direction: column;
    gap: 0.75rem;
  }
  .pub-thumbnail {
    width: 80px;
  }
}

.pub-content p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
}

.pub-description {
  margin-top: 0.4em !important;
  color: var(--bs-secondary);
  font-size: 0.88rem !important;
  font-style: italic;
}

/* Category badges — clickable, uppercase */
.pub-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  margin: 0.5em 0 0.35em;
  padding-left: 0;
}

.pub-category {
  font-size: 0.7em;
  text-transform: uppercase;
  padding: 0.2em 0.6em;
}

.pub-category a {
  color: var(--bs-secondary);
  text-decoration: none;
}

.pub-category a:hover {
  color: var(--bs-primary);
}

/* Links bar — colored background strip like Heiss */
.pub-links-bar {
  margin-top: 0.6em;
  background-color: rgba(var(--bs-primary-rgb), 0.08);
  border-radius: 0.25rem;
  display: flex;
  flex-wrap: wrap;
}

.pub-link {
  display: inline-block;
  white-space: nowrap;
  padding: 0.45em 1em;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bs-primary);
  text-decoration: none;
}

.pub-link:hover {
  color: var(--bs-body-color);
  background-color: rgba(var(--bs-primary-rgb), 0.15);
}

.pub-link i {
  margin-right: 0.25em;
}

/* Funding metadata (listing-funding.ejs) */
.pub-funding-meta {
  font-size: 0.9rem !important;
  line-height: 1.8 !important;
  color: var(--bs-secondary);
}

.pub-funding-meta i {
  width: 1.2em;
  text-align: center;
  margin-right: 0.3em;
  color: var(--bs-primary);
}

/* News listing (listing-news.ejs) */
.news-meta {
  font-size: 0.85rem;
  color: var(--bs-secondary);
  margin-bottom: 0.3rem;
}

.news-meta i {
  margin-right: 0.3em;
  color: var(--bs-primary);
}

/* Programme overview: image floats left, text wraps around it */
.programme-overview {
  margin-bottom: 2rem;
}

/* Quarto wraps the img in a <p> — remove its margin and float it */
.programme-overview > p:has(.programme-overview-img) {
  float: left;
  margin: 0 1.5rem 1rem 0;
}

.programme-overview-img {
  width: 200px;
  height: auto;
  border-radius: 0.5rem;
  border: 1px solid var(--bs-border-color);
}

/* Let the text div flow naturally around the float */
.programme-overview-text {
  overflow: visible;
}

@media (max-width: 640px) {
  .programme-overview > p:has(.programme-overview-img) {
    float: none;
    margin: 0 0 1rem 0;
    text-align: center;
  }
  .programme-overview-img {
    width: 140px;
  }
}

.figure-square {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.figure-banner {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
}

/* =============================================
   GENERAL TYPOGRAPHY
   ============================================= */

/* Slightly increase body line-height for readability */
body {
  line-height: 1.7;
}

/* Remove default underline on links; show on hover */
a {
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Make the navbar brand/title a bit bolder */
.navbar-brand {
  font-weight: 600;
}
