/**
 * Personal Website Styles
 * A clean, minimal design with dark mode support
 */

/* ========================================================================
   CSS VARIABLES & THEME CONFIGURATION
   ======================================================================== */

:root {
  /* Layout */
  --maxw: 1100px;
  --gap: 18px;
  --col-gap: 24px;
  --padding-horizontal: 40px;
  --header-offset: 92px;
  
  /* Component sizing */
  --left-column-width: 180px;
  --pub-thumb-width: 180px;
  --pub-thumb-height: 180px;
  --pub-thumb-radius: 6px;
  
  /* Typography */
  font-family: Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.7;
}

/* Light theme (default) */
html[data-theme="light"] {
  --bg-color: #fff;
  --text-color: #0a0a0a;
  --muted-color: #666;
  --border-color: #e0e0e0;
  --hover-bg: #ffe4cc;
  --link-color: #ff9966;
  --input-bg: #fff;
}

/* Dark theme */
html[data-theme="dark"] {
  --bg-color: #1a1a1a;
  --text-color: #e0e0e0;
  --muted-color: #a0a0a0;
  --border-color: #333;
  --hover-bg: #6a4c93;
  --link-color: #9370db;
  --input-bg: #2a2a2a;
}


/* ========================================================================
   BASE STYLES
   ======================================================================== */

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text-color);
  background-color: var(--bg-color);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.7;
  font-size: 17px;
}

a {
  color: inherit;
}


/* ========================================================================
   HEADER & NAVIGATION
   ======================================================================== */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--maxw);
  margin: 70px auto;
  padding: 0 var(--padding-horizontal);
  gap: var(--gap);
  position: sticky;
  top: 0;
  background-color: var(--bg-color);
  z-index: 1000;
}

.name {
  font-size: 32px;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-color);
}

.name-link {
  text-decoration: none;
  color: inherit;
}

.nav-links {
  display: flex;
  gap: 14px;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted-color);
  font-size: 14px;
}

.nav-links a:hover {
  color: var(--text-color);
}

/* Theme toggle button */
.theme-toggle {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
  min-width: 44px;
  min-height: 44px;
}

html[data-theme="light"] .theme-toggle:hover {
  background-color: #f0f0f0;
}

html[data-theme="dark"] .theme-toggle:hover {
  background-color: #333;
}


/* ========================================================================
   PROFILE SECTION
   ======================================================================== */

.profile-section {
  max-width: var(--maxw);
  margin: 40px auto;
  padding: 0 var(--padding-horizontal);
}

.profile-container {
  display: flex;
  gap: var(--col-gap);
  align-items: flex-start;
}

/* Left sidebar with image, role, and social links */
.profile-sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  width: var(--left-column-width);
}

.profile-image {
  flex-shrink: 0;
  position: relative;
}

.profile-image img {
  width: var(--left-column-width);
  height: var(--left-column-width);
  border-radius: 50%;
  object-fit: cover;
}

.nationality-flags {
  font-size: 14px;
  text-align: center;
  margin-top: 0.5px;
  margin-bottom: -8px;
  opacity: 0.9;
}

.profile-role {
  text-align: center;
  width: 100%;
}

.role-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-color);
}

.role-affiliation {
  margin: 4px 0 0 0;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted-color);
}

/* Social links */
.profile-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  width: 100%;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  background-color: var(--input-bg);
  text-decoration: none;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.social-link:hover {
  background-color: var(--hover-bg);
  transform: scale(1.1);
}

.social-icon {
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.social-icon-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

/* Profile bio text */
.profile-text {
  flex: 1;
  padding: 16px 0;
}

.profile-text p {
  margin: 0 0 16px 0;
  color: var(--muted-color);
  line-height: 1.6;
}

.profile-text p:last-child {
  margin-bottom: 0;
}

.profile-text a {
  color: var(--link-color);
  text-decoration: underline;
}

.profile-text a:hover {
  color: var(--text-color);
}


/* ========================================================================
   TIMELINE SECTION
   ======================================================================== */

.timeline-section {
  max-width: var(--maxw);
  margin: 40px auto;
  padding: 0 var(--padding-horizontal);
  scroll-margin-top: var(--header-offset);
}

.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 32px;
  position: relative;
  padding-left: 130px;
}

/* Vertical connecting line */
.timeline-container::before {
  content: '';
  position: absolute;
  left: 110px;
  top: 8px;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  position: relative;
  transition: all 0.2s ease;
  cursor: pointer;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-color);
}

.timeline-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Timeline dot indicator */
.timeline-dot {
  position: absolute;
  left: -23px;
  top: 0px;
  width: 8px;
  height: 8px;
  background: var(--border-color);
  border-radius: 50%;
  z-index: 1;
  box-shadow: 0 0 0 3px var(--bg-color);
  transition: all 0.2s ease;
}

/* Year label */
.timeline-year {
  position: absolute;
  left: -130px;
  top: -4px;
  width: 100px;
  text-align: right;
  padding-right: 10px;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted-color);
  line-height: 1.2;
  transition: all 0.2s ease;
}

/* Organization logo */
.timeline-logo-link {
  display: block;
  text-decoration: none;
}

.timeline-logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
  flex-shrink: 0;
  transition: all 0.2s ease;
  padding: 8px;
  border-radius: 8px;
}

/* Timeline content area */
.timeline-content {
  flex: 1;
  padding: 8px 12px;
  margin-left: -12px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.timeline-description {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: var(--text-color);
  line-height: 1.5;
}

.timeline-description:last-child {
  margin-bottom: 0;
}

.timeline-description a {
  color: var(--link-color);
  text-decoration: underline;
}

.timeline-description a:hover {
  color: var(--text-color);
}

/* Timeline hover effects */
.timeline-item:hover .timeline-dot {
  background: var(--text-color);
  transform: scale(1.3);
}

.timeline-item:hover .timeline-year {
  color: var(--text-color);
}

.timeline-item:hover .timeline-content {
  background-color: var(--hover-bg);
}

.timeline-item:hover .timeline-logo {
  background-color: var(--hover-bg);
}


/* ========================================================================
   MEDIA / HIGHLIGHTS SECTION
   ======================================================================== */

.media-section {
  max-width: var(--maxw);
  margin: 40px auto;
  padding: 0 var(--padding-horizontal);
  scroll-margin-top: var(--header-offset);
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.media-item {
  display: flex;
  flex-direction: column;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  transition: all 0.2s ease;
  background-color: var(--bg-color);
}

.media-item:hover {
  background-color: var(--hover-bg);
  transform: translateY(-2px);
}

/* Video thumbnail with 16:9 aspect ratio */
.media-thumbnail {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  overflow: hidden;
  background: #000;
}

.media-thumbnail iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.media-info {
  padding: 16px;
}

.media-info h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-color);
}

.media-info p {
  margin: 0;
  font-size: 13px;
  color: var(--muted-color);
  line-height: 1.4;
}


/* ========================================================================
   PUBLICATIONS SECTION
   ======================================================================== */

.publications {
  max-width: var(--maxw);
  margin: 40px auto;
  padding: 0 var(--padding-horizontal);
}

.publications-note {
  text-align: center;
  margin-top: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--muted-color);
  font-style: italic;
}

.publications-note a {
  color: var(--link-color);
  text-decoration: none;
}

.publications-note a:hover {
  text-decoration: underline;
}

.publication {
  display: flex;
  gap: var(--col-gap);
  padding: 16px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  transition: background-color 0.2s ease;
  cursor: pointer;
  margin-bottom: 18px;
  background-color: var(--input-bg);
}

.publication:hover {
  background-color: var(--hover-bg);
}

.pub-image {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--left-column-width);
  height: var(--pub-thumb-height);
}

.pub-image img {
  width: 100%;
  height: 100%;
  border-radius: var(--pub-thumb-radius);
  object-fit: contain;
  display: block;
}

.pub-description {
  flex: 1;
}

.pub-description h2 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-color);
}

.pub-description p {
  margin: 4px 0;
  font-size: 13px;
  color: var(--muted-color);
}

.pub-conference {
  color: var(--link-color);
}

/* Publication action buttons */
.pub-buttons {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.pub-button {
  display: inline-block;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-color);
  background-color: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.pub-button:hover {
  background-color: var(--hover-bg);
  border-color: var(--text-color);
  transform: translateY(-1px);
}


/* ========================================================================
   BLOG SECTION
   ======================================================================== */

.blog-section {
  max-width: var(--maxw);
  margin: 40px auto;
  padding: 0 var(--padding-horizontal);
}

.blog-post {
  display: flex;
  gap: var(--col-gap);
  padding: 16px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  transition: background-color 0.2s ease;
  cursor: pointer;
  margin-bottom: 18px;
  background-color: var(--input-bg);
}

.blog-post:hover {
  background-color: var(--hover-bg);
}

.blog-image {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--left-column-width);
  height: var(--pub-thumb-height);
}

.blog-image img {
  width: 100%;
  height: 100%;
  border-radius: var(--pub-thumb-radius);
  object-fit: cover;
  display: block;
}

.blog-description {
  flex: 1;
}

.blog-description h2 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-color);
}

.blog-description p {
  margin: 4px 0;
  font-size: 13px;
  color: var(--muted-color);
}

.blog-date {
  font-weight: 600;
  color: var(--text-color) !important;
  font-size: 12px !important;
}


/* ========================================================================
   SECTION HEADERS
   ======================================================================== */

header,
.section-header {
  max-width: var(--maxw);
  margin: 50px auto 14px auto;
  padding: 0 var(--padding-horizontal);
  text-align: center;
}

header h1,
.section-header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-color);
}

#publications-heading,
#media-heading,
#blog-heading {
  scroll-margin-top: var(--header-offset);
}


/* ========================================================================
   FOOTER
   ======================================================================== */

footer {
  max-width: var(--maxw);
  margin: 60px auto 0 auto;
  padding: 0 var(--padding-horizontal) 40px var(--padding-horizontal);
  font-size: 13px;
  color: var(--muted-color);
  border-top: 1px solid var(--border-color);
  text-align: center;
}


/* ========================================================================
   RESPONSIVE DESIGN
   ======================================================================== */

@media (max-width: 720px) {
  /* Layout adjustments */
  :root {
    --padding-horizontal: 20px;
    --gap: 12px;
    --col-gap: 16px;
  }
  
  /* Text justification for better readability */
  .profile-text p,
  .pub-description p,
  .blog-description p,
  .timeline-description {
    text-align: justify;
  }
  
  /* Header - make name smaller and stack better */
  .header {
    margin: 30px auto 20px auto;
    padding: 12px var(--padding-horizontal);
    flex-wrap: wrap;
    gap: 12px;
  }
  
  .name {
    font-size: 24px;
  }
  
  .nav-links {
    gap: 10px;
  }
  
  /* Profile section */
  .profile-section {
    margin: 20px auto;
  }
  
  .profile-container {
    flex-direction: column;
    align-items: center;
  }
  
  .profile-sidebar {
    width: auto;
  }
  
  .profile-image img {
    width: 140px;
    height: 140px;
  }
  
  .profile-text {
    padding: 12px 0;
  }
  
  /* Timeline improvements */
  .timeline-section {
    margin: 30px auto;
  }
  
  .timeline-container {
    padding-left: 0;
  }
  
  .timeline-container::before {
    display: none;
  }
  
  .timeline-item {
    flex-direction: column;
    padding-bottom: 24px;
    gap: 12px;
  }
  
  .timeline-year {
    position: static;
    width: 100%;
    text-align: left;
    padding-right: 0;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
  }
  
  .timeline-dot {
    display: none;
  }
  
  .timeline-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto;
  }
  
  .timeline-logo-link {
    display: flex;
    justify-content: center;
  }
  
  .timeline-content {
    margin-left: 0;
    padding: 8px 0;
  }
  
  .timeline-description {
    font-size: 15px;
  }
  
  /* Publications - image on top, text below */
  .publications {
    margin: 30px auto;
  }
  
  .publication {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  
  .pub-image {
    width: 100%;
    max-width: 280px;
    height: auto;
    aspect-ratio: 1;
  }
  
  .pub-description {
    width: 100%;
  }
  
  .pub-description h2 {
    font-size: 18px;
    text-align: center;
    margin-bottom: 12px;
  }
  
  .pub-description p {
    font-size: 14px;
  }
  
  .pub-buttons {
    justify-content: center;
  }
  
  /* Blog section - image on top, text below */
  .blog-section {
    margin: 30px auto;
  }
  
  .blog-post {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  
  .blog-image {
    width: 100%;
    max-width: 280px;
    height: auto;
    aspect-ratio: 1;
  }
  
  .blog-description {
    width: 100%;
  }
  
  .blog-description h2 {
    font-size: 18px;
    text-align: center;
    margin-bottom: 12px;
  }
  
  .blog-description p {
    font-size: 14px;
  }
  
  /* Media section improvements */
  .media-section {
    margin: 30px auto;
  }
  
  .media-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .media-info h3 {
    font-size: 17px;
  }
  
  .media-info p {
    font-size: 14px;
  }
  
  /* Section headers */
  .section-header {
    margin: 40px auto 20px auto;
  }
  
  .section-header h1 {
    font-size: 24px;
  }
  
  /* Footer */
  footer {
    margin-top: 40px;
    padding-bottom: 30px;
    font-size: 12px;
  }
  
  /* Disable hover effects on mobile */
  .timeline-item:hover .timeline-dot,
  .timeline-item:hover .timeline-year,
  .timeline-item:hover .timeline-content,
  .timeline-item:hover .timeline-logo {
    background-color: inherit;
    transform: none;
  }
  
  .publication:hover,
  .blog-post:hover,
  .media-item:hover {
    background-color: var(--input-bg);
    transform: none;
  }
}
