/* css styles */

/* Construction Banner */
.construction-banner {
  background-color: #fff3cd;
  border-bottom: 3px solid #ffc107;
  padding: 1rem 0;
  margin: 0;
  width: 100%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.construction-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  color: #856404;
  text-align: center;
  line-height: 1.5;
}

.construction-banner a {
  color: #2c5aa0;
  text-decoration: underline;
  font-weight: 500;
}

.construction-banner a:hover {
  color: #1e4080;
}

a {
  color: #2c5aa0;
  text-decoration: none;
}

a:hover {
  color: #1e4080;
  text-decoration: underline;
}

/* Header styling - match navbar primary color (Sandstone blue) */
h1, h2, h3, h4, h5, h6 {
  color: #325d88;
}

/* Section headers (h2) - Enhanced visual separation */
h2 {
  color: #325d88;
  border-bottom: 2px solid #325d88;
  padding-bottom: 0.4rem;
  margin-top: 2.5rem;
  margin-bottom: 1.2rem;
  font-weight: 600;
}

/* First h2 on page - less top margin */
h2:first-of-type {
  margin-top: 1.5rem;
}

/* Ensure Bootstrap grid works properly in Quarto */
.container-fluid {
  width: 100%;
  padding-right: 15px;
  padding-left: 15px;
  margin-right: auto;
  margin-left: auto;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -15px;
  margin-left: -15px;
}

/* Column classes for responsive layout */
.profile-photo {
  padding-right: 15px;
  padding-left: 15px;
  text-align: center;
  margin-bottom: 1.5rem;
}

.profile-bio {
  padding-right: 15px;
  padding-left: 15px;
}

/* Responsive breakpoints */
@media (min-width: 992px) {
  .profile-photo {
    flex: 0 0 25%;
    max-width: 25%;
    margin-bottom: 0;
  }
  
  .profile-bio {
    flex: 0 0 75%;
    max-width: 75%;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .profile-photo {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    margin-bottom: 0;
  }
  
  .profile-bio {
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
  }
}

@media (max-width: 767.98px) {
  .profile-photo {
    flex: 0 0 100%;
    max-width: 100%;
  }
  
  .profile-bio {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* CV Styling */
.cv-section {
  margin-bottom: 1.5rem;
}

.cv-entry {
  display: grid;
  grid-template-columns: 150px 1fr;
  grid-template-areas: 
    "dates title"
    "dates location"
    "dates description";
  gap: 0.15rem 1.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e9ecef;
}

.cv-entry:last-child {
  border-bottom: none;
}

.cv-dates {
  grid-area: dates;
  font-weight: 600;
  color: #495057;
  font-size: 0.9rem;
  line-height: 1.2;
}

.cv-title {
  grid-area: title;
  font-weight: 700;
  color: #495057;
  margin-bottom: 0.1rem;
  font-size: 1.1rem;
  line-height: 1.3;
}

.cv-location {
  grid-area: location;
  color: #6c757d;
  font-style: italic;
  margin-bottom: 0.2rem;
  font-size: 0.95rem;
  line-height: 1.2;
}

.cv-description {
  grid-area: description;
  color: #495057;
  line-height: 1.4;
}

/* Responsive CV layout */
@media (max-width: 768px) {
  .cv-entry {
    grid-template-columns: 1fr;
    grid-template-areas: 
      "dates"
      "title"
      "location"
      "description";
    gap: 0.3rem;
  }
  
  .cv-dates {
    font-size: 0.85rem;
    margin-bottom: 0.15rem;
  }
  
  .cv-section {
    margin-bottom: 1.25rem;
  }
}

/* Publications page - card layout */
.pub-card {
  padding: 0.9rem 1rem;
  border: 1px solid #e6e9ee;
  border-left: 4px solid #325d88;
  border-radius: 6px;
  background-color: #fafbfc;
  margin: 1rem 0;
  position: relative; /* enable corner-aligned year */
}

.pub-title {
  font-weight: 700;
  color: #325d88;
  margin-bottom: 0.25rem;
  padding-right: 3.5rem; /* reserve space so the absolute year doesn't overlap */
}

.pub-authors {
  color: #495057;
  font-style: italic;
  margin-bottom: 0.35rem;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-bottom: 0;
}

.pub-links a {
  color: #2c5aa0;
  font-weight: 500;
}

@media (max-width: 768px) {
  .pub-card { padding: 0.8rem 0.9rem; }
  .pub-links { gap: 0.5rem 0.75rem; }
}

/* Publication year - subtle, fixed at top-right corner of the card */
.pub-year {
  color: #6c757d;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  position: absolute;
  top: 0.9rem;
  right: 1rem;
}

@media (max-width: 576px) {
  .pub-title { padding-right: 3rem; }
  .pub-year { top: 0.8rem; right: 0.75rem; }
}

/* Software Grid Layout - Compact Card Design */
.software-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.software-card {
  padding: 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background-color: #fafafa;
  transition: all 0.2s ease;
  line-height: 1.5;
}

.software-card:hover {
  border-color: #325d88;
  box-shadow: 0 2px 8px rgba(50, 93, 136, 0.1);
  background-color: #ffffff;
}

.software-card strong {
  color: #325d88;
  font-size: 1.05rem;
  display: block;
  margin-bottom: 0.3rem;
}

.software-card p {
  margin-bottom: 0;
}

.software-links-inline {
  margin-top: 0.8rem;
}

.software-links-inline a {
  margin-right: 0.5rem;
}

.software-card a {
  color: #2c5aa0;
  text-decoration: none;
}

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

.software-card img {
  height: 18px;
  margin-top: 0.4rem;
  margin-right: 0.3rem;
}

.software-card-wide {
  grid-column: 1 / -1;
}

/* Info Banner */
.info-banner {
  background-color: #f0f4f8;
  border-left: 3px solid #325d88;
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
  border-radius: 4px;
  color: #495057;
  font-size: 0.95rem;
}

.info-banner a {
  color: #2c5aa0;
  font-weight: 500;
}

.info-banner .fa-circle-info {
  color: #325d88;
  margin-right: 0.5rem;
}

/* Responsive adjustments for software grid */
@media (max-width: 768px) {
  .software-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .software-card {
    padding: 0.875rem;
  }
}

/* Floating TOC Button (mobile only) */
.floating-toc-button {
  display: none;
  position: fixed;
  bottom: 2rem;
  right: 1.5rem;
  width: 3.5rem;
  height: 3.5rem;
  background-color: #325d88;
  color: white;
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  z-index: 999;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

@media (max-width: 768px) {
  .floating-toc-button {
    display: flex;
  }
}

.floating-toc-button:hover {
  background-color: #2c5aa0;
  transform: scale(1.05);
}

.floating-toc-button:active {
  transform: scale(0.95);
}

/* Floating TOC Overlay */
.floating-toc-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

@media (max-width: 768px) {
  .floating-toc-overlay {
    display: block;
  }
}

.floating-toc-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.floating-toc-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: white;
  border-radius: 1rem 1rem 0 0;
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.floating-toc-overlay.visible .floating-toc-content {
  transform: translateY(0);
}

.floating-toc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem 0.75rem;
  border-bottom: 2px solid #e9ecef;
  position: sticky;
  top: 0;
  background-color: white;
  z-index: 1;
}

.floating-toc-header h3 {
  margin: 0;
  color: #325d88;
  font-size: 1.25rem;
}

.floating-toc-close {
  background: none;
  border: none;
  font-size: 2rem;
  color: #6c757d;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floating-toc-close:hover {
  color: #495057;
}

.floating-toc-nav {
  padding: 1rem 1.5rem 1.5rem;
}

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

.floating-toc-list li {
  margin: 0.5rem 0;
}

.floating-toc-list a {
  display: block;
  color: #495057;
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.floating-toc-list a:hover {
  background-color: #f0f4f8;
  color: #2c5aa0;
}

.floating-toc-list .toc-level-1 {
  font-weight: 600;
  font-size: 1.05rem;
}

.floating-toc-list .toc-level-2 {
  padding-left: 1rem;
  font-size: 0.95rem;
}

.floating-toc-list .toc-level-3 {
  padding-left: 2rem;
  font-size: 0.9rem;
}

.floating-toc-list .toc-level-4 {
  padding-left: 3rem;
  font-size: 0.85rem;
}