/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #2c3e50;
  --accent-color: #3498db;
  --text-color: #333;
  --light-gray: #ecf0f1;
  --border-color: #bdc3c7;
  --code-bg: #f8f9fa;
  --max-width: 900px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  font-size: 16px;
}

.wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background-color: var(--primary-color);
  color: white;
  padding: 1.5rem 0;
  margin-bottom: 3rem;
}

.site-title-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
}

.phd-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: white;
  background-color: rgba(255, 255, 255, 0.15);
  padding: 0.3rem 0.6rem;
  border-radius: 12px;
  opacity: 0.9;
  text-decoration: none;
  transition: opacity 0.2s;
}

.phd-status-badge:hover {
  opacity: 1;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #f39c12;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

.site-nav {
  float: right;
  margin-top: 0.25rem;
}

.site-nav a {
  color: white;
  text-decoration: none;
  margin-left: 2rem;
  font-weight: 500;
}

.site-nav a:hover {
  color: var(--light-gray);
}

.site-nav .nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 2rem;
  padding: 0;
  vertical-align: middle;
}

.site-nav .nav-icon img {
  width: 22px;
  height: 22px;
  filter: brightness(0) invert(1);
  transition: opacity 0.2s;
  display: block;
  opacity: 0.5;
}

.site-nav .nav-icon:hover img {
  opacity: 1;
}

/* Main content */
.page-content {
  min-height: calc(100vh - 300px);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--primary-color);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

p {
  margin-bottom: 1rem;
}

a {
  color: var(--accent-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Code blocks */
code {
  background-color: var(--code-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
}

pre {
  background-color: var(--code-bg);
  padding: 1rem;
  border-radius: 5px;
  overflow-x: auto;
  margin-bottom: 1rem;
}

pre code {
  background-color: transparent;
  padding: 0;
}

/* Lists */
ul, ol {
  margin-bottom: 1rem;
  margin-left: 2rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Post styles */
.post-header {
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 1rem;
}

.post-title {
  margin-top: 0;
}

.post-meta {
  color: #7f8c8d;
  font-size: 0.9rem;
  font-style: italic;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.post-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background-color: var(--accent-color);
  color: white;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 12px;
  font-style: normal;
}

.post-tag[data-tag="michigan-state-university"] {
  background-color: #18453B;
}

.post-tag[data-tag="casework"] {
  background-color: #2c3e50;
}

.post-tag[data-tag="colorado-state-university"] {
  background-color: #1E4D2B;
}

.post-tag[data-tag="research"] {
  background-color: #C8C372;
}

.post-tag[data-tag="personal"] {
  background-color: #7f8c8d;
}

.post-content {
  line-height: 1.8;
}

.post-date {
  color: #7f8c8d;
  font-size: 0.9rem;
  margin-right: 1rem;
}

/* Blog list */
.blog li {
  list-style: none;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

/* Plot containers */
.plot-container {
  margin: 2rem 0;
  padding: 1rem;
  background-color: white;
  border: 1px solid var(--border-color);
  border-radius: 5px;
}

.plot-caption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #7f8c8d;
  font-style: italic;
  text-align: center;
}

/* Tabs for interactive plots */
.tabs {
  width: 100%;
  margin: -0.5rem -0.5rem 0 -0.5rem; /* Negative margin to offset plot-container padding */
}

.tab-buttons {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-color);
  flex-wrap: wrap;
  margin: 0;
  padding: 0 0.5rem;
}

.tab-button {
  background-color: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  color: #7f8c8d;
  transition: all 0.2s ease;
  margin-bottom: -2px;
}

.tab-button:hover {
  color: var(--accent-color);
  background-color: var(--light-gray);
}

.tab-button.active {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
  font-weight: 600;
}

.tab-content {
  min-height: 450px;
  padding: 1rem 0.5rem 0 0.5rem;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background-color: var(--light-gray);
  font-weight: 700;
}

/* Footer */
.site-footer {
  background-color: var(--light-gray);
  padding: 2rem 0;
  margin-top: 4rem;
  text-align: center;
  font-size: 0.9rem;
  color: #7f8c8d;
}

/* Responsive */
@media (max-width: 768px) {
  .site-title-wrapper {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .phd-status-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
  }

  .site-nav {
    float: none;
    margin-top: 1rem;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
}

/* Italics for species names */
.species {
  font-style: italic;
}

/* Italicize species names in Observable Plot axes */
svg g[aria-label="y-axis tick label"] text,
svg g[aria-label="y-axis tick"] text {
  font-style: italic;
}

/* Center Observable Plot legends */
.plot-container > svg {
  display: block;
  margin: 0 auto;
}

/* Target legend container if it exists as a separate element */
.plot-container [aria-label*="legend"] {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

/* Make axis labels larger and bolder */
svg g[aria-label="x-axis label"] text,
svg g[aria-label="y-axis label"] text {
  font-size: 14px !important;
  font-weight: 700 !important;
}
/* CV Page Styles */

/* Contact bar */
.cv-contact-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  background-color: var(--light-gray);
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.cv-contact-bar a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
}

.cv-contact-bar a:hover {
  text-decoration: underline;
}

.cv-name {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  margin-top: 1rem;
}

.cv-email {
  text-align: center;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.cv-email a {
  color: var(--accent-color);
  text-decoration: none;
}

.cv-email a:hover {
  text-decoration: underline;
}

.cv-last-updated {
  text-align: center;
  color: #7f8c8d;
  font-size: 0.85rem;
  font-style: italic;
  margin-bottom: 2rem;
}

/* Section headings */
.page-content h2 {
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-color);
  color: var(--primary-color);
  font-size: 1.5rem;
}

.page-content h2:first-of-type {
  margin-top: 2rem;
}

/* Education entries */
.cv-entry {
  margin-bottom: 2rem;
  padding: 1.25rem;
  background-color: #f8f9fa;
  border-left: 4px solid var(--accent-color);
  border-radius: 4px;
}

.cv-entry[data-institution="ohio-state"] {
  border-left-color: #BB0000;
}

.cv-entry[data-institution="michigan-state"] {
  border-left-color: #18453B;
}

.cv-entry[data-institution="colorado-state"] {
  border-left-color: #1E4D2B;
}

.cv-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}

.cv-entry-header strong {
  font-size: 1.1rem;
  color: var(--primary-color);
}

.cv-year {
  color: #7f8c8d;
  font-weight: 500;
  font-size: 0.9rem;
}

.cv-institution {
  color: #555;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.cv-details {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #666;
}

/* Publications */
.cv-publication {
  margin-bottom: 1.25rem;
  padding-left: 1rem;
  border-left: 3px solid var(--light-gray);
}

.cv-pub-authors {
  font-weight: 500;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.cv-pub-details {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #666;
}

.cv-pub-year {
  color: var(--accent-color);
  font-weight: 600;
  margin-right: 0.5rem;
}

.cv-pub-title {
  color: #333;
}

/* Presentations */
.cv-presentation {
  margin-bottom: 1.25rem;
  padding-left: 1rem;
  border-left: 3px solid var(--light-gray);
}

.cv-pres-title {
  font-weight: 500;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.cv-pres-venue {
  font-size: 0.9rem;
  color: #666;
}

.cv-pres-year {
  color: var(--accent-color);
  font-weight: 600;
  margin-left: 0.5rem;
}

/* Skills grid */
.cv-skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.cv-skill-category {
  background-color: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid var(--accent-color);
}

.cv-skill-category h3 {
  color: var(--primary-color);
  font-size: 1.1rem;
  margin: 0 0 1.25rem 0;
  font-weight: 600;
}

.cv-skill-category ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cv-skill-category li {
  padding: 0.4rem 0.8rem;
  color: #555;
  font-size: 0.85rem;
  background-color: white;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
}

/* Awards grid */
.cv-awards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.cv-award {
  background-color: #f8f9fa;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  border-left: 4px solid var(--accent-color);
}

.cv-award-title {
  font-weight: 500;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.cv-award-year {
  color: #7f8c8d;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Home Page Recent Posts Section */
.recent-posts-section {
  margin-top: 1rem;
  padding-top: 0.5rem;
}

.recent-posts-section h2 {
  text-align: center;
  color: var(--primary-color);
  margin-bottom: 2rem;
  font-size: 2rem;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.post-card {
  background-color: #f8f9fa;
  border-radius: 6px;
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.post-card-header {
  margin-bottom: 1rem;
}

.post-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  line-height: 1.4;
}

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

.post-card h3 a:hover {
  color: var(--accent-color);
}

.post-card time {
  font-size: 0.85rem;
  color: #7f8c8d;
  font-weight: 500;
}

.post-card-excerpt {
  color: #555;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.post-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.post-tag-small {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background-color: var(--accent-color);
  color: white;
  font-size: 0.7rem;
  font-weight: 500;
  border-radius: 10px;
  font-style: normal;
}

.post-tag-small[data-tag="michigan-state-university"] {
  background-color: #18453B;
}

.post-tag-small[data-tag="casework"] {
  background-color: #2c3e50;
}

.post-tag-small[data-tag="colorado-state-university"] {
  background-color: #1E4D2B;
}

.post-tag-small[data-tag="research"] {
  background-color: #C8C372;
}

.post-tag-small[data-tag="personal"] {
  background-color: #7f8c8d;
}

.view-all-posts {
  text-align: center;
  margin-top: 2.5rem;
}

.view-all-button {
  display: inline-block;
  padding: 0.75rem 2rem;
  background-color: var(--primary-color);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  transition: background-color 0.2s, transform 0.2s;
}

.view-all-button:hover {
  background-color: #34495e;
  transform: translateY(-2px);
}

/* Home Page Layout */
.home-layout {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.home-intro h3 {
  margin-top: 0;
}

/* Academic Network Widget */
#academic-network {
  padding: 0.75rem;
  height: fit-content;
  position: sticky;
  top: 2rem;
}

#academic-network svg {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 768px) {
  .home-layout {
    grid-template-columns: 1fr;
  }

  #academic-network {
    position: static;
    max-width: 400px;
    margin: 0 auto;
  }
}

/* Gallery Page Styles */
.page:has(.gallery-sections) .page-header {
  display: none;
}

/* Back to Top Button */
#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 45px;
  height: 45px;
  background-color: #2c3e50;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, transform 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

#back-to-top img {
  width: 18px;
  height: 18px;
  filter: brightness(0) invert(1);
}

#back-to-top.show {
  opacity: 0.3;
  visibility: visible;
}

#back-to-top:hover {
  opacity: 1;
  transform: translateY(-2px);
}

/* CV Page - Hide title */
.page:has(.cv-name) .page-header {
  display: none;
}

.gallery-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin: 2rem 0;
}

.gallery-section h2 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.3rem;
  text-align: center;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  cursor: pointer;
  aspect-ratio: 1;
  background-color: #f8f9fa;
  transition: transform 0.2s, box-shadow 0.2s;
}

.gallery-item:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.4s ease-in;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.gallery-item img.loaded {
  opacity: 1;
  image-rendering: auto;
}

.img-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f0f0f0 25%, #e0e0e0 25%, #e0e0e0 50%, #f0f0f0 50%, #f0f0f0 75%, #e0e0e0 75%, #e0e0e0);
  background-size: 20px 20px;
  animation: placeholderShimmer 1.5s infinite linear;
}

@keyframes placeholderShimmer {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 20px 20px;
  }
}

/* Lightbox Modal */
.lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  justify-content: center;
  align-items: center;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-close {
  position: absolute;
  top: 15px;
  right: 25px;
  color: white;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
  user-select: none;
}

.lightbox-close:hover {
  color: #bbb;
}

@media (max-width: 768px) {
  .gallery-sections {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .lightbox-close {
    top: 10px;
    right: 15px;
    font-size: 24px;
  }
}
