/* ==========================================================================
   Björn Michele — Personal Academic Website
   style.css — All styling in one file, well-organized by section
   Colors: primary green #28a745, accent teal #24C2CB
   Font: Inter (Google Fonts)
   Max content width: 880px
   ========================================================================== */

/* ---------- Reset & Base ---------- */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', sans-serif;
  color: #1a1a1a;
  background: #ffffff;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: #28a745;
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: #1e7e34;
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---------- Layout Container ---------- */

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Profile Section ---------- */

.profile {
  text-align: center;
  padding: 3rem 0 1.5rem;
}

.profile-photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
  border: 3px solid #e9ecef;
}

.profile-name {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: #1a1a1a;
}

.profile-role {
  font-size: 1.1rem;
  color: #555;
  margin-bottom: 0.15rem;
}

.profile-org {
  font-size: 1rem;
  color: #777;
  margin-bottom: 1rem;
}

/* ---------- Social Icons ---------- */

.social-icons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  margin: 0.5rem 0 1.5rem;
  flex-wrap: wrap;
}

.social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #555;
  transition: color 0.2s ease, background 0.2s ease;
}
.social-icons a:hover {
  color: #24C2CB;
  text-decoration: none;
}

.social-icons svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* ---------- About / Bio Section ---------- */

.about {
  padding: 1rem 0 2rem;
}

.about p {
  text-align: justify;
  margin-bottom: 0.9rem;
}

.research-interests {
  text-align: center;
  font-weight: 600;
  margin-top: 1rem;
  color: #333;
}

/* ---------- News Section ---------- */

.news {
  padding: 2rem 0;
}

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

.news-item {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
}
.news-item:last-child {
  border-bottom: none;
}

.news-date {
  flex-shrink: 0;
  width: 5.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #28a745;
}

.news-text {
  font-size: 0.92rem;
  color: #333;
}
.news-text a {
  font-weight: 500;
}

/* ---------- Section Headers ---------- */

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #28a745;
}

/* ---------- Publications Section ---------- */

.publications {
  padding: 2rem 0;
}

.pub-filters {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.pub-filter-btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.35rem 1rem;
  border: 1.5px solid #ccc;
  border-radius: 20px;
  background: #fff;
  color: #555;
  cursor: pointer;
  transition: all 0.2s ease;
}
.pub-filter-btn:hover {
  border-color: #28a745;
  color: #28a745;
}
.pub-filter-btn.active {
  background: #28a745;
  border-color: #28a745;
  color: #fff;
}

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

.pub-card {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1rem;
  border-radius: 8px;
  background: #fafafa;
  border: 1px solid #eee;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.pub-card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border-color: #ddd;
}

.pub-thumb {
  flex-shrink: 0;
  width: 120px;
  height: 90px;
  border-radius: 6px;
  object-fit: contain;
  background: #f5f5f5;
}

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

.pub-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.3rem;
}
.pub-title a {
  color: #1a1a1a;
}
.pub-title a:hover {
  color: #28a745;
}

.pub-authors {
  font-size: 0.88rem;
  color: #555;
  margin-bottom: 0.25rem;
}
.pub-authors a {
  color: #555;
  text-decoration: none;
  border-bottom: 1px dotted #aaa;
}
.pub-authors a:hover {
  color: #28a745;
  border-bottom-color: #28a745;
}
.pub-authors .me {
  font-weight: 700;
  color: #1a1a1a;
}

.pub-venue {
  font-size: 0.85rem;
  color: #28a745;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.pub-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pub-links a {
  display: inline-block;
  font-size: 0.78rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  background: #28a745;
  color: #fff;
  font-weight: 500;
  transition: background 0.2s ease;
}
.pub-links a:hover {
  background: #1e7e34;
  text-decoration: none;
}

/* ---------- Experience & Education (Timeline) ---------- */

.experience, .education, .awards {
  padding: 2rem 0;
}

.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: #e0e0e0;
}

.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #28a745;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #28a745;
  z-index: 1;
}

.timeline-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
}

.timeline-org {
  font-size: 0.92rem;
  color: #28a745;
  font-weight: 500;
}
.timeline-org a {
  color: #28a745;
}
.timeline-org a:hover {
  color: #1e7e34;
}

.timeline-meta {
  font-size: 0.85rem;
  color: #888;
  margin: 0.15rem 0;
}

.timeline-desc {
  font-size: 0.88rem;
  color: #555;
  margin-top: 0.25rem;
}

/* ---------- Awards Section ---------- */

.award-item {
  margin-bottom: 1.25rem;
}

.award-title {
  font-size: 1rem;
  font-weight: 600;
}
.award-title a {
  color: #1a1a1a;
}
.award-title a:hover {
  color: #28a745;
}

.award-dates {
  font-size: 0.85rem;
  color: #888;
}

/* ---------- Footer ---------- */

.site-footer {
  text-align: center;
  padding: 2rem 0;
  margin-top: 2rem;
  border-top: 1px solid #eee;
  font-size: 0.85rem;
  color: #999;
}

/* ---------- Paper Detail Page ---------- */

.paper-page {
  padding: 2rem 0 3rem;
}

.paper-back {
  display: inline-block;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  color: #28a745;
  font-weight: 500;
}
.paper-back:hover {
  color: #1e7e34;
}

.paper-header-image {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  background: #f0f0f0;
}

.paper-header-caption {
  font-size: 0.85rem;
  color: #888;
  text-align: center;
  margin-bottom: 2rem;
  font-style: italic;
}

.paper-detail-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
  color: #1a1a1a;
}

.paper-detail-authors {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 0.3rem;
}
.paper-detail-authors a {
  color: #555;
  text-decoration: none;
  border-bottom: 1px dotted #aaa;
}
.paper-detail-authors a:hover {
  color: #28a745;
  border-bottom-color: #28a745;
}
.paper-detail-authors .me {
  font-weight: 700;
  color: #1a1a1a;
}

.paper-detail-venue {
  font-size: 0.95rem;
  color: #28a745;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.paper-detail-links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.paper-detail-links a {
  display: inline-block;
  font-size: 0.85rem;
  padding: 0.35rem 0.9rem;
  border-radius: 4px;
  background: #28a745;
  color: #fff;
  font-weight: 500;
  transition: background 0.2s ease;
}
.paper-detail-links a:hover {
  background: #1e7e34;
  text-decoration: none;
}

.paper-abstract {
  text-align: justify;
  margin-bottom: 2rem;
  line-height: 1.8;
}

.paper-abstract h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #1a1a1a;
}

.paper-figure {
  margin: 2rem 0;
  text-align: center;
}

.paper-figure img {
  max-width: 100%;
  border-radius: 6px;
  margin: 0 auto;
}

.paper-figure figcaption {
  font-size: 0.85rem;
  color: #888;
  margin-top: 0.5rem;
  font-style: italic;
}

/* ---------- Responsive Design ---------- */

/* ---------- BibTeX Modal ---------- */

.bibtex-modal[hidden] {
  display: none;
}
.bibtex-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: bibtex-fade-in 0.15s ease;
}

@keyframes bibtex-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.bibtex-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.bibtex-modal-card {
  position: relative;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bibtex-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid #eee;
}

.bibtex-modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a1a;
}

.bibtex-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #888;
  cursor: pointer;
  padding: 0 0.25rem;
  transition: color 0.2s ease;
}
.bibtex-modal-close:hover {
  color: #1a1a1a;
}

.bibtex-modal-code {
  margin: 0;
  padding: 1rem 1.25rem;
  overflow: auto;
  flex: 1;
  background: #f8f9fa;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  color: #333;
}

.bibtex-modal-copy {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  margin: 0.75rem 1.25rem;
  border: none;
  border-radius: 6px;
  background: #28a745;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease;
  align-self: flex-end;
}
.bibtex-modal-copy:hover {
  background: #1e7e34;
}

/* Cite button in pub-links (same style as other link buttons) */
.pub-links .cite-btn {
  display: inline-block;
  font-size: 0.78rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  background: #28a745;
  color: #fff;
  font-weight: 500;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.2s ease;
}
.pub-links .cite-btn:hover {
  background: #1e7e34;
}

/* Cite button on paper detail pages */
.paper-detail-links .cite-btn {
  display: inline-block;
  font-size: 0.85rem;
  padding: 0.35rem 0.9rem;
  border-radius: 4px;
  background: #28a745;
  color: #fff;
  font-weight: 500;
  border: none;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.2s ease;
}
.paper-detail-links .cite-btn:hover {
  background: #1e7e34;
}

/* ---------- Responsive Design ---------- */

@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  .container {
    padding: 0 1rem;
  }

  .profile {
    padding: 2rem 0 1rem;
  }

  .profile-name {
    font-size: 1.6rem;
  }

  .pub-card {
    flex-direction: column;
    gap: 0.75rem;
  }

  .pub-thumb {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    border-radius: 6px;
  }

  .section-title {
    font-size: 1.35rem;
  }

  .paper-detail-title {
    font-size: 1.25rem;
  }

  .timeline {
    padding-left: 1.5rem;
  }

  .timeline-item::before {
    left: -1.5rem;
    width: 12px;
    height: 12px;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .profile-photo {
    width: 120px;
    height: 120px;
  }

  .social-icons {
    gap: 0.3rem;
  }

  .social-icons a {
    width: 36px;
    height: 36px;
  }

  .social-icons svg {
    width: 20px;
    height: 20px;
  }

  .pub-links a {
    font-size: 0.75rem;
    padding: 0.18rem 0.5rem;
  }

  .news-item {
    flex-direction: column;
    gap: 0.15rem;
  }

  .news-date {
    width: auto;
  }
}
