/* Component styles */
.one {
  width: 160px;
  height: 160px;
  position: relative;
}

.two {
  width: 160px;
  height: 160px;
  position: absolute;
  transition: opacity .2s ease-in-out;
  -moz-transition: opacity .2s ease-in-out;
  -webkit-transition: opacity .2s ease-in-out;
}

.fade {
  transition: opacity .2s ease-in-out;
  -moz-transition: opacity .2s ease-in-out;
  -webkit-transition: opacity .2s ease-in-out;
}

span.highlight {
  background-color: #ffffd0;
}

/* Better spacing for publication entries */
tr {
  margin-bottom: 16px;
}

/* Table styles */
.content-table {
  width: 100%;
  border: 0px;
  border-spacing: 0px;
  border-collapse: separate;
  margin-right: auto;
  margin-left: auto;
}

/* Remove padding from content table cells to align with headings */
.content-table td {
  padding: 0 !important;
  vertical-align: middle !important;
}

/* Specific override for inline styles in content tables */
.content-table td[style*="padding"] {
  padding: 0 !important;
  vertical-align: middle !important;
}

.experience-table {
  width: 100%;
  align: center;
  border: 0;
  cellpadding: 10;
}

.experience-table td {
  padding-left: 20px;
  padding-right: 20px;
  width: 20%;
  vertical-align: middle;
}

.experience-table td:last-child {
  width: 90%;
  valign: center;
}

/* Image styles */
.profile-image {
  width: 100% !important;
  max-width: 250px !important;
  height: auto !important;
  padding: 10px !important;
  box-sizing: border-box;
  border-radius: 12px !important; /* Approximately 5% of 250px max-width */
}

/* Introduction section flexbox layout */
.introduction-container {
  display: flex;
  align-items: flex-start;
  gap: 30px;
  /* margin-top: 20px; */
  flex-wrap: nowrap; /* Prevent wrapping */
}

.introduction-image {
  flex: 0 0 250px; /* Fixed width to prevent wrapping */
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* Shared text content styling */
.text-content {
  margin-top: 20px;
  max-width: 800px;
  line-height: 1.6;
}

/* Introduction text needs flex properties */
.introduction-container .text-content {
  flex: 1;
  min-width: 0; /* Allows text to shrink */
}

/* Responsive behavior for introduction */
@media (max-width: 768px) {
  .introduction-container {
    flex-direction: column;
    gap: 20px;
  }
  
  .introduction-image {
    align-self: center;
  }
}

.institution-logo {
  width: 80%;
}

/* Make publication images responsive */
.content-table img {
  max-width: 100%;
  width: 100%;
  height: auto;
  padding: 10px;
  align: center;
  box-sizing: border-box;
  display: block;
  margin: 0 auto;
}

/* Override fixed widths in publications */
.content-table img[width] {
  width: 100% !important;
  max-width: 100%;
}

/* Make image column responsive */
.content-table td:first-child {
  width: 20% !important;
  max-width: 200px;
  min-width: 120px;
}

/* Ensure text column takes remaining space */
.content-table td:last-child {
  width: auto;
}

.portfolio-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
}

.portfolio-table th,
.portfolio-table td {
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  text-align: left;
}

.portfolio-table thead {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.portfolio-table tbody tr:nth-child(even) {
  background: var(--bg-secondary);
}

/* Experience section: two columns on wide screens */
@media (min-width: 1200px) {
  #section-experience .experience-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
  }
  #section-experience .experience-col table {
    width: 100% !important;
  }
}

/* Music section: larger image on left, text on right */
.music-container {
  /* display: flex; */
  display: block;
  /* align-items: flex-start; */
  gap: 40px;
  margin-top: 20px;
}

/* Clearfix so the container encloses the float */
.music-container::after {
  content: "";
  display: block;
  clear: both;
}

/* .music-image {
  flex: 0 0 50%;
  float: left;
  display: flex;
  justify-content: center;
  align-items: flex-start;
} */

.music-image {
  float: left;
  width: 50%;
  margin: 0 24px 16px 0;
  /* space to the right/bottom for text */
  box-sizing: border-box;
}

/* .music-image .profile-image {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  padding: 0 !important;
  box-sizing: border-box;
} */

.music-image .profile-image {
  width: 100%;
  height: auto;
  display: block;
  max-width: 100% !important;
  border-radius: 12px;
  padding: 0;
  /* no inner padding so 50% stays clean */
}

/* .music-text {
  flex: 1;
  min-width: 0;
  margin-top: 0;
} */
.music-text {
  /* no special layout needed; paragraphs will flow around the float */
  min-width: 0;
}

/* Responsive behavior for music section */
/* @media (max-width: 768px) {
  .music-container {
    flex-direction: column;
    gap: 20px;
  }
  
  .music-image {
    align-self: center;
    flex: 0 0 auto;
  }
  
  .music-image .profile-image {
    max-width: 250px !important;
  }
} */

/* Responsive: stack on narrow screens */
@media (max-width: 768px) {
  .music-image {
    float: none;
    width: 100%;
    margin: 0 0 16px 0;
    /* image on top, text below */
  }
}

/* Blog styles */
.blog-list {
  margin-top: 20px;
}

.blog-entry {
  padding: 24px 0;
  border-bottom: 1px solid var(--border-color);
}

.blog-entry:first-child {
  padding-top: 0;
}

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

.blog-meta {
  margin-bottom: 8px;
}

.blog-date {
  color: var(--text-secondary);
  font-size: 14px;
}

.blog-title {
  margin: 0 0 12px 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
}

.blog-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.blog-excerpt {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 12px 0;
}

.blog-read-more {
  color: var(--accent-color);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.blog-read-more:hover {
  color: var(--accent-hover);
}

.blog-loading {
  color: var(--text-secondary);
}

/* Language toggle */
.blog-lang-toggle {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  margin-bottom: 8px;
}

.lang-btn {
  padding: 8px 20px;
  border: 2px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-btn:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.lang-btn.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
}

/* Individual blog post view */
.blog-post-view {
  margin: 20px auto 0 auto;
  max-width: 820px;
}

.blog-back-link {
  color: var(--accent-color);
  text-decoration: none;
  font-size: 14px;
  display: inline-block;
  margin-bottom: 20px;
  transition: color 0.2s ease;
}

.blog-back-link:hover {
  color: var(--accent-hover);
}

.blog-post-title {
  margin: 0 0 8px 0;
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
}

.blog-post-date {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

.blog-post-content {
  line-height: 1.8;
  color: var(--text-primary);
  max-width: 780px;
  margin: 0 auto;
}

.blog-post-content p {
  margin: 0 0 1.5em 0;
  text-align: justify;
  text-justify: inter-ideograph;
}

.blog-post-content p:last-child {
  margin-bottom: 0;
}

/* Blog post standalone styling */
.blog-post {
  max-width: 780px;
  margin: 0 auto;
  line-height: 1.8;
}

.blog-post h2 {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 24px 0;
  color: var(--text-primary);
}

.blog-post p {
  margin: 0 0 1.5em 0;
  text-align: justify;
  text-justify: inter-ideograph;
}

.blog-post p:last-child {
  margin-bottom: 0;
}

/* Blog images */
.blog-image {
  display: block;
  max-width: 320px;
  height: auto;
  margin: 0 auto 24px auto;
}

/* Footnotes */
.footnote-ref {
  font-size: 0.85em;
  vertical-align: super;
  line-height: 0;
  text-decoration: none;
  color: var(--accent-color);
  padding: 0 2px;
  transition: color 0.2s ease;
}

.footnote-ref:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.footnotes {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.footnotes-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px 0;
  color: var(--text-primary);
}

.footnotes ol {
  margin: 0;
  padding-left: 24px;
}

.footnotes li {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.footnotes li:last-child {
  margin-bottom: 0;
}

.footnotes li:target {
  background-color: var(--bg-secondary);
  padding: 4px 8px;
  margin-left: -8px;
  border-radius: 4px;
}

.footnote-backref {
  font-size: 12px;
  text-decoration: none;
  color: var(--accent-color);
  margin-left: 4px;
}

.footnote-backref:hover {
  color: var(--accent-hover);
}

/* Blog video/media embeds */
.blog-video {
  margin: 32px 0;
  text-align: center;
}

.blog-video iframe {
  width: 100%;
  max-width: 640px;
  height: 400px;
  border: none;
}

.blog-video figcaption {
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-secondary);
  font-style: italic;
}

/* Blog content elements */
.blog-post ul,
.blog-post ol {
  margin: 0 0 1.5em 0;
  padding-left: 24px;
}

.blog-post li {
  margin-bottom: 8px;
  line-height: 1.6;
}

.blog-post strong {
  font-weight: 600;
}

/* Blog figures/images */
.blog-figure {
  margin: 24px 0;
  text-align: center;
}

.blog-figure img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.blog-figure figcaption {
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-secondary);
  font-style: italic;
}

/* Blog tables */
.blog-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
}

.blog-table th,
.blog-table td {
  padding: 12px;
  text-align: left;
  border: 1px solid var(--border-color);
}

.blog-table th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-primary);
}

.blog-table td {
  color: var(--text-primary);
}

.blog-table tr:nth-child(even) td {
  background: var(--bg-secondary);
}

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

.blog-table a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

@media (min-width: 768px) {
  .blog-video iframe {
    max-width: 720px;
    height: 450px;
  }
}
