/* --- Global proportional font scaling --- */
html {
  font-size: 92%;
}

/* --- Slightly wider content column --- */
:root {
  --main-width: 880px;   /* default ~720–800px depending on version */
  --accent: #2f5fa7;
}

.main {
  max-width: var(--main-width);
}

/* --- Home info --- */
.home-info-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  column-gap: 2rem;
  align-items: start;
}

.home-info-left {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.home-info-image {
  width: 200px;
  height: auto;
  border-radius: 50%;
  border: 1px solid #000;
  display: block;
  margin-bottom: 0.75rem;
}

.home-info-social {
  display: flex;
  justify-content: center;
}

.home-info-right .entry-content {
  margin: 0;
}

/* Spazio sotto il titolo */
.home-info .entry-header {
  margin-bottom: 0.5rem;
}

/* Centrare verticalmente la bio */
.home-info-layout {
  align-items: center;
}

/* Testo giustificato */
.home-info-right .entry-content {
  text-align: justify;
}

/* --- News list rendering (Home + /news/) --- */
.news-entry {
  position: relative;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
}

.news-row {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr) auto;
  column-gap: 0.75rem;
  align-items: start;
}

.news-date {
  grid-column: 1;
  font-variant-numeric: tabular-nums;
  color: var(--secondary);
  white-space: nowrap;
}

.news-text {
  grid-column: 2;
  min-width: 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

.news-tag {
  grid-column: 3;
  justify-self: end;
  align-self: start;
  padding: 3px 8px;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 999px;
  white-space: nowrap;
  color: #000;
  border: 1px solid transparent;
}

.news-date {
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  color: var(--secondary);
  white-space: nowrap;
}

.news-tag-paper {
  background: #fbb4ae;
  border-color: #e41a1c;
}

.news-tag-project {
  background: #e5d8bd;
  border-color: #b38d3d;
}

.news-tag-award {
  background: #decbe4;
  border-color: #984ea3;
}

.news-tag-talk {
  background: #ccebc5;
  border-color: #4daf4a;
}

.news-tag-dataset {
  background: #b3cde3;
  border-color: #1f78b4;
}

.news-tag-code {
  background: #fed9a6;
  border-color: #ff7f00;
}

.news-tag-event {
  background: #fddaec;
  border-color: #f781bf;
}

.news-tag-lab {
  background: #fff2ae;
  border-color: #ffd92f;
}

.news-tag-news {
  background: #eeeeee;
  border-color: #424242;
}

.news-link {
  position: absolute;
  inset: 0;
}

/* =========================
   Publications
   ========================= */

.pub-intro {
  margin-bottom: 1.5rem;
  color: var(--secondary);
  font-size: 0.95rem;
}

.pub-year {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-size: 1.4rem;
  font-weight: 600;
}

.pub-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.pub-item {
  line-height: 1.45;
}

.pub-title {
  font-weight: 600;
}

.pub-authors {
  font-size: 0.95rem;
  color: var(--secondary);
}

.pub-venue {
  font-size: 0.9rem;
}

.pub-type {
  font-size: 0.75rem;
  padding: 2px 6px;
  margin-left: 6px;
  border-radius: 6px;
  background: var(--tertiary);
  color: var(--primary);
}

.pub-cite {
  font-size: 0.98rem;
}

.pub-title {
  font-weight: 650;
}

.pub-me {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.pub-links {
  margin-top: 0.35rem;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.pub-link {
  font-size: 0.85rem;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--tertiary);
  color: var(--primary);
  text-decoration: none;
  border: 0;
  cursor: pointer;
}

.pub-link:hover {
  filter: brightness(0.95);
}

.pub-link i {
  margin-right: 6px;
  vertical-align: -1px;
}

/* In press: no background highlight (keep layout consistent) */
.pub-item-inpress {
  /* intentionally empty; class retained for possible future styling */
}

.pub-inpress {
  font-weight: 400;
  color: #9aa0a6; /* light gray */
}

.pub-bib-copied {
  background-color: #22c55e !important;
  border-color: #16a34a !important;
  color: #ffffff !important;
}

/* Publication type badges */
.pub-type {
  margin-left: 8px;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--tertiary);
  color: var(--primary);
}

/* Color coding */
.pub-type-preprint { background: #e0e0e0; color: #111; } /* gray */
.pub-type-journal { background: #dbeafe; color: #0b2a4a; }
.pub-type-conference { background: #dcfce7; color: #0b3a1c; }
.pub-type-workshop { background: #ffedd5; color: #4a2400; }
.pub-type-other { background: var(--tertiary); color: var(--primary); }

/* Projects page */
.projects-intro {
  margin-bottom: 2rem;
}

.project-card {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin: 2rem 0;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--entry);
}

.project-main-logo {
  flex: 0 0 180px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 1.5rem;
}

.project-main-logo img {
  max-width: 180px;
  max-height: 120px;
  width: auto;
  height: auto;
  object-fit: contain;
}

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

.project-title {
  margin: 0 0 0.4rem 0;
  font-size: 1.35rem;
  line-height: 1.3;
}

.project-meta {
  font-size: 0.95rem;
  color: var(--secondary);
  margin-bottom: 0.6rem;
}

.project-links {
  margin-bottom: 0.8rem;
}

.project-description {
  margin-bottom: 1rem;
}

.project-funding {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  margin-top: 0.5rem;
}

.project-funding img {
  max-height: 42px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
}

@media (max-width: 768px) {
  .project-card {
    flex-direction: column;
  }

  .project-main-logo {
    flex: none;
    justify-content: flex-start;
  }

  .project-main-logo img {
    max-width: 160px;
    max-height: 100px;
  }
}

/* Stacked logos for projects like ERC + project logo */
.project-main-logo-stacked {
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.project-main-logo-stacked img {
  width: 180px;
  max-width: 180px;
  height: auto;
}

.project-stacked-funder-logo {
  opacity: 0.9;
}

.project-funding-wide {
  width: 100%;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  justify-content: space-between;
}

.project-funding-wide img {
  max-height: 48px;
  max-width: 30%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.project-card-with-footer {
  flex-direction: column;
  gap: 1rem;
}

.project-card-with-footer .project-card-top {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.project-card-with-footer .project-funding-wide {
  width: 100%;
  margin-top: 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  justify-content: space-between;
}

.project-card-with-footer .project-funding-wide img {
  max-height: 48px;
  max-width: 30%;
  width: auto;
  height: auto;
  object-fit: contain;
}

@media (max-width: 768px) {
  .project-card-with-footer .project-card-top {
    flex-direction: column;
  }
}

/* Lab members */

.lab-members {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-top: 1rem;
}

.lab-member {
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--entry);
  line-height: 1.45;
}

.lab-member a {
  font-size: 1.15rem;
  font-weight: 600;
  text-decoration: none;
}

.lab-member a:hover {
  text-decoration: underline;
}

.lab-member br + br {
  display: none;
}

.lab-member {
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  background: var(--entry);
  line-height: 1.5;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.lab-member:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.lab-member a {
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
}

.lab-member a:hover {
  text-decoration: underline;
}

/* Global accent color */
a {
  color: var(--accent);
}

a:hover {
  color: var(--accent);
}

/* Standardize intro/base text across main sections */
.pub-intro,
.projects-intro,
.lab-intro {
  font-size: 0.95rem;
  color: var(--secondary);
}

/* Use the same accent for lab member cards */
.lab-member {
  border-left-color: var(--accent);
}

/* Normalize text size inside project and lab cards */
.project-body,
.lab-member {
  font-size: 0.95rem;
}

/* Keep project titles slightly larger */
.project-title {
  font-size: 1.15rem;
}

/* Keep member names slightly emphasized */
.lab-member a {
  font-size: 1.05rem;
}

/* Standardize link style across the site */
a {
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Override PaperMod link underline behavior */
.post-content a {
  text-decoration: none;
}

.post-content a:hover {
  text-decoration: underline;
}

/* Remove PaperMod link underline (box-shadow based) */
.post-content a {
  box-shadow: none;
}

/* Match lab member role/program color with project metadata */
.lab-member {
  color: inherit;
}

.lab-member a + br + text,
.lab-member a + br {
  color: var(--secondary);
}

/* Lab member metadata (role/program) */
.lab-member-meta {
  color: var(--secondary);
  margin-top: 0.15rem;
}

/* Topics line */
.lab-member-topics {
  margin-top: 0.15rem;
}

/* Normalize CV page body text with cards */
.cv-content {
  font-size: 0.95rem;
}

.cv-content ul {
  font-size: 0.95rem;
}

/* CV button styled like publication action buttons */
.cv-button {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.18rem 0.5rem;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--entry);
  color: var(--accent);
  text-decoration: none;
}

.cv-button:hover {
  background: var(--accent);
  color: white;
  text-decoration: none;
}

/* Larger CV button */
.projects-intro .pub-link {
  font-size: 1rem;
  padding: 0.35rem 0.65rem;
}

.projects-intro .pub-link i {
  font-size: 1.05rem;
}
