/* base */
*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --text: #1a1a1a;
  --text-muted: #555;
  --bg: #fafafa;
  --accent: #2c5282;
  --border: #e2e2e2;
  --font-serif: 'Source Serif 4', Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

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

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

a:hover {
  text-decoration: underline;
}

/* nav */
.header {
  margin-bottom: 3rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.nav a {
  font-size: 0.9rem;
  color: var(--text-muted);
}

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

/* sections */
.section {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.section:last-of-type {
  border-bottom: none;
}

h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
}

h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  color: var(--text);
}

.affiliation {
  color: var(--text-muted);
  margin: 0 0 1.5rem 0;
  font-size: 1rem;
}

/* about */
.about-content {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.about-text {
  flex: 1;
}

.about-text p {
  margin: 0 0 1rem 0;
}

.about-photo {
  flex-shrink: 0;
}

.about-photo img {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 4px;
}

/* publications */
.scholar-link {
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

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

.publication {
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.pub-authors {
  color: var(--text);
}

.pub-year {
  color: var(--text-muted);
}

.pub-title {
  font-style: italic;
}

.pub-venue {
  color: var(--text-muted);
}

.pub-link {
  font-size: 0.85rem;
  margin-left: 0.5rem;
  padding: 0.1rem 0.4rem;
  background: var(--border);
  border-radius: 3px;
}

.pub-link:hover {
  background: var(--accent);
  color: white;
  text-decoration: none;
}

/* contact */
.contact-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
}

.contact-list li {
  margin-bottom: 0.75rem;
}

.contact-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.contact-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.contact-list a:hover .contact-icon {
  color: var(--accent);
}

.cv-link {
  margin-top: 1rem;
}

/* articles */
.posts-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.post-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid #d9e1e8;
  border-radius: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.post-item:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.post-item a {
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.post-item a:hover {
  color: var(--accent);
  text-decoration: none;
}

.post-item time {
  color: var(--text-muted);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.posts-more {
  margin-top: 1rem;
  margin-bottom: 0;
}

.posts-more a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.posts-more a:hover {
  color: var(--accent);
}

.article-header {
  margin-bottom: 2rem;
}

.article-header h1 {
  margin-bottom: 0.5rem;
}

.article-date {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.article-content {
  line-height: 1.7;
}

.article-content h2 {
  margin-top: 2rem;
}

.article-content img {
  max-width: 100%;
  height: auto;
  margin: 1.5rem 0;
}

.article-content blockquote {
  border-left: 3px solid var(--border);
  margin: 1.5rem 0;
  padding-left: 1rem;
  color: var(--text-muted);
}

.article-content code {
  background: var(--border);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.9em;
}

.article-content pre {
  background: #f5f5f5;
  padding: 1rem;
  overflow-x: auto;
  border-radius: 4px;
}

.article-content pre code {
  background: none;
  padding: 0;
}

.article-footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* iframe embeds */
.iframe-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  margin: 1.5rem 0;
  background: #f5f5f5;
  border-radius: 4px;
  overflow: hidden;
}

.iframe-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* footer */
.footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer p {
  margin: 0;
}

/* linkedin cards - full width stacked */
.linkedin-posts-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.linkedin-card-full {
  display: flex;
  gap: 1rem;
  background: #fff;
  border: 1px solid #d9e1e8;
  border-radius: 8px;
  padding: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.linkedin-card-full:hover {
  border-color: #0a66c2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  text-decoration: none;
}

.linkedin-thumb {
  width: 100px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.linkedin-content {
  flex: 1;
  min-width: 0;
}

.linkedin-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.linkedin-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #0a66c2;
}

.linkedin-source {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.linkedin-title {
  display: block;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 0.25rem;
}

.linkedin-excerpt {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.linkedin-more {
  margin-top: 1rem;
  margin-bottom: 0;
}

.linkedin-more a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.linkedin-more a:hover {
  color: var(--accent);
}

/* inline linkedin card (for blog posts) */
.linkedin-card-inline {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #f3f6f8;
  border-radius: 8px;
}

.linkedin-card-inline .linkedin-title {
  font-weight: normal;
  color: var(--text);
}

/* responsive */
@media (max-width: 600px) {
  .container {
    padding: 1.5rem 1rem;
  }
  
  .about-content {
    flex-direction: column-reverse;
  }
  
  .about-photo img {
    width: 100px;
    height: 100px;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  .nav {
    gap: 1rem;
  }
  
  .linkedin-thumb {
    width: 80px;
    height: 48px;
  }
}
