/* Academic Website Styles - Inspired by verso.lean-lang.org */

:root {
  --primary-color: #2c3e50;
  --accent-color: #3498db;
  --text-color: #333;
  --bg-color: #ffffff;
  --light-bg: #f8f9fa;
  --border-color: #dee2e6;
  --link-color: #3498db;
  --link-hover: #2980b9;

  /* Text color variations */
  --text-muted: #666;           /* Muted gray for secondary text */
  --text-light: #555;           /* Light gray for tertiary text */

  /* Academic level colors */
  --level-bsc-color: #27ae60;   /* Green for BSc level */
  --level-msc-color: #8e44ad;   /* Purple for MSc level */
  --level-phd-color: #e74c3c;   /* Red for PhD level (future use) */

  /* Accent color with alpha - for backgrounds */
  --accent-alpha-10: rgba(52, 152, 219, 0.1);  /* 10% opacity accent */

  /* Note: Gradient alpha colors (cannot use variables in rgba gradients yet)
     BSc gradient: rgba(39, 174, 96, 0.05) - matches --level-bsc-color
     MSc gradient: rgba(142, 68, 173, 0.05) - matches --level-msc-color
     Keep these in sync when changing level colors */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Navigation */
.main-nav {
  background-color: var(--primary-color);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

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

.nav-icons {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.main-nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

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

.icon-link {
  font-size: 0.85rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  transition: all 0.3s;
}

.icon-link:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-1px);
}

/* Main Content */
.content {
  min-height: 70vh;
}

/* Typography */
h1 {
  color: var(--primary-color);
  font-size: 2.5rem;
  margin: 1.5rem 0 1rem;
  border-bottom: 3px solid var(--accent-color);
  padding-bottom: 0.5rem;
}

h2 {
  color: var(--primary-color);
  font-size: 2rem;
  margin: 1.5rem 0 0.75rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.3rem;
}

h3 {
  color: var(--primary-color);
  font-size: 1.5rem;
  margin: 1.25rem 0 0.5rem;
}

p {
  margin: 0.75rem 0;
}

/* Links */
a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* Images */
img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1rem 0;
  display: block;        /* Prevents inline spacing issues */
}

/* Profile image on home page */
img[alt="Profile Photo"] {
  max-width: 500px;
  float: right;
  margin-left: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Lists */
ul, ol {
  margin: 0.75rem 0;
  padding-left: 2rem;
}

li {
  margin: 0.5rem 0;
}

/* Publications */
.publication-category {
  margin: 2rem 0;
}

.publication-list {
  margin: 1rem 0;
}

.publication {
  background-color: var(--light-bg);
  padding: 1rem;
  margin: 0.75rem 0;
  border-left: 4px solid var(--accent-color);
  border-radius: 4px;
}

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

.publication em {
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  margin-top: 3rem;
  padding: 1.5rem 0;
  border-top: 2px solid var(--border-color);
  text-align: center;
  color: var(--text-muted);
}

.site-footer a {
  color: var(--link-color);
}

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

pre {
  background-color: var(--light-bg);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1rem 0;
}

/* Responsive design */
@media (max-width: 768px) {
  .main-nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links, .nav-icons {
    width: 100%;
    justify-content: center;
  }

  .nav-icons {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 0.5rem;
  }

  body {
    padding: 10px;
  }

  .main-nav {
    flex-direction: column;
    gap: 0.75rem;
  }

  img[alt="Profile Photo"] {
    float: none;
    display: block;
    margin: 1rem auto;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }
}

/* Call-to-action buttons section (inspired by verso.lean-lang.org) */
.get-started {
  background: var(--primary-color);
  color: white;
  padding: 3rem 2rem;
  text-align: center;
  border-radius: 1rem;
  margin: 3rem 0;
}

.get-started > p:first-child > strong {
  font-size: 2rem;
  font-weight: 700;
  color: white;
  display: block;
  margin-bottom: 1rem;
}

.get-started > p:nth-child(2) {
  color: rgba(255, 255, 255, 0.9);
  max-width: 650px;
  margin: 0.5rem auto 0;
  line-height: 1.7;
  font-size: 1.05rem;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border-radius: 0.5rem;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s;
  border: none;
}

.cta-btn p {
  margin: 0;
  padding: 0;
}

.cta-btn.primary {
  background: white;
  color: var(--primary-color);
}

.cta-btn.primary:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cta-btn.secondary {
  border: 2px solid white;
  background: transparent;
  color: white;
}

.cta-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

/* Three-column pillars layout (inspired by verso.lean-lang.org) */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding: 3rem 0;
  margin: 2rem 0;
}

.pillar {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem;
  background: var(--light-bg);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.pillar > :last-child {
  margin-top: auto;
}

.pillar > p:first-child {
  margin-bottom: 0.75rem;
}

.pillar > p:first-child > strong {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-color);
  display: block;
  margin-bottom: 0.5rem;
}

.pillar > p:nth-child(2) {
  color: var(--text-color);
  line-height: 1.7;
  margin: 0;
}

/* Responsive: Stack on mobile */
@media (max-width: 768px) {
  .pillars {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }

  .cta-btn {
    width: 100%;
    max-width: 300px;
  }

  .get-started {
    padding: 2rem 1.5rem;
  }

  .get-started > p:first-child > strong {
    font-size: 1.5rem;
  }
}

/* Build cards layout (inspired by verso.lean-lang.org "What Can You Build?") */
.builds {
  margin: 3rem 0;
  padding: 2rem;
  background: var(--light-bg);
  border-radius: 1rem;
  border: 1px solid var(--border-color);
}

.builds > p:first-child > strong {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-color);
  display: block;
  margin-bottom: 1rem;
}

.builds > p:nth-child(2) {
  color: var(--text-color);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.build-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.build-card {
  padding: 1.25rem;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  transition: all 0.3s;
  border-top: 3px solid var(--border-color);
}

/* BSc level courses - green top border */
.build-card.bsc {
  border-top-color: var(--level-bsc-color);
  background: linear-gradient(to bottom, rgba(39, 174, 96, 0.05) 0%, white 30%);
}

/* MSc level courses - purple top border */
.build-card.msc {
  border-top-color: var(--level-msc-color);
  background: linear-gradient(to bottom, rgba(142, 68, 173, 0.05) 0%, white 30%);
}

.build-card:hover {
  border-color: var(--accent-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* Maintain colored top border on hover */
.build-card.bsc:hover {
  border-top-color: var(--level-bsc-color);
}

.build-card.msc:hover {
  border-top-color: var(--level-msc-color);
}

.build-card > p:first-child {
  text-align: center;
}

.build-card > p:first-child > strong {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-color);
  display: block;
  margin-bottom: 0.5rem;
}

.build-card > p {
  text-align: center;
}

.build-card > p:nth-child(2) {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
}

/* Lecture note card icons */
.build-card img {
  display: block;
  margin: 1rem auto;
  max-width: 90%;
  max-height: 90%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
}

/* Responsive: Ensure at least 2 columns on tablet, 1 on mobile */
@media (max-width: 768px) {
  .build-cards {
    grid-template-columns: 1fr;
  }

  .builds {
    padding: 1.5rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .build-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Print styles */
@media print {
  .main-nav, .site-footer {
    display: none;
  }

  body {
    max-width: 100%;
  }
}

/* Clickable lecture notes cards */

/* Publication Cards */
.publication-card {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.publication-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: var(--accent-color);
}

/* First paragraph is the title with links */
.publication-card > p:first-child {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--primary-color);
}

.publication-card > p:first-child strong {
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;  /* Wrap long titles */
  word-break: break-word;     /* Break long titles */
}

.publication-card > p:first-child a {
  color: var(--accent-color);
  text-decoration: none;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  background: var(--accent-alpha-10);
  transition: background 0.2s, color 0.2s;
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
}

.publication-card > p:first-child a:hover {
  background: var(--accent-color);
  color: white;
}

/* Second paragraph is authors */
.publication-card > p:nth-child(2) {
  margin-bottom: 0.5rem;
  color: var(--text-light);
  font-size: 0.95rem;
}

/* Third paragraph is venue */
.publication-card > p:nth-child(3) {
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Responsive adjustments for publications */
@media (max-width: 768px) {
  .publication-card > p:first-child {
    flex-direction: column;
    align-items: flex-start;
  }

  .publication-card {
    padding: 1rem;
  }
}
.clickable-card {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.clickable-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.clickable-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.clickable-card a:hover {
  text-decoration: none;
}

/* Publication Cards */
.publication-card {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.publication-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: var(--accent-color);
}

/* Publication header - title and links on same row */
.pub-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.pub-title {
  flex: 1;
  min-width: 0; /* Allow text wrapping */
}

.pub-title p {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--primary-color);
}

.pub-links {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
  align-items: center;
}

.pub-links p {
  margin: 0;
  font-size: 0.9rem;
}

.pub-links a {
  color: var(--accent-color);
  text-decoration: none;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  background: var(--accent-alpha-10);
  transition: background 0.2s, color 0.2s;
  font-weight: 500;
}

.pub-links a:hover {
  background: var(--accent-color);
  color: white;
}

/* Authors line */
.pub-authors {
  margin-bottom: 0.5rem;
}

.pub-authors p {
  margin: 0;
  color: var(--text-light);
  font-size: 0.95rem;
}

/* Venue and date line */
.pub-venue {
  margin-bottom: 0;
}

.pub-venue p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
}

/* Responsive adjustments for publications */
@media (max-width: 768px) {
  .pub-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .pub-links {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .publication-card {
    padding: 1rem;
  }
}

/* Pillar images */
.pillar img {
  display: block;
  margin: 1.5rem auto 0;
  max-width: 90%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.pillar img:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: box-shadow 0.2s;
}

/* Event Cards */
.event-card {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2.5rem;
  transition: box-shadow 0.3s, border-color 0.3s;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

.event-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  border-color: var(--accent-color);
}

/* Left column - poster image */
.event-left {
  flex-shrink: 0;
  width: 280px;
}

.event-left img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: box-shadow 0.3s, transform 0.3s;
  display: block;
}

.event-left img:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

/* Right column - event details */
.event-right {
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;  /* Wrap long words at arbitrary points */
  word-break: break-word;     /* Break long words to prevent overflow */
}

.event-right p {
  margin: 0 0 1rem 0;
  line-height: 1.7;
  color: var(--text-color);
}

/* Event title (first paragraph with strong) */
.event-right > p:first-child {
  margin-bottom: 0.5rem;
}

.event-right > p:first-child strong {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1.3;
}

/* Date paragraph (second paragraph) */
.event-right > p:nth-child(2) {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-style: italic;
  margin-bottom: 1rem;
}

/* Event website link */
.event-right a {
  display: inline-block;
  color: white;
  background: var(--accent-color);
  text-decoration: none;
  padding: 0.6rem 1.5rem;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.2s;
}

.event-right a:hover {
  background: var(--link-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
  text-decoration: none;
}

/* Responsive: Stack on mobile */
@media (max-width: 768px) {
  .event-card {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
  }

  .event-left {
    width: 100%;         /* Force full width */
    max-width: 400px;    /* But cap it */
    margin: 0 auto;      /* Center it */
  }

  .event-left img {
    width: 100%;         /* Image fills container */
  }

  .event-right > p:first-child strong {
    font-size: 1.5rem;
  }
}

/* Link Cards */
.link-card {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: box-shadow 0.3s, border-color 0.3s;
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: center;
}

.link-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: var(--accent-color);
}

/* Left column - small thumbnail */
.link-left {
  flex-shrink: 0;
  width: 80px;
}

.link-left img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
  transition: transform 0.2s;
}

.link-left a:hover img {
  transform: scale(1.05);
}

/* Right column - link details */
.link-right {
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;  /* Wrap long words */
  word-break: break-word;     /* Break long words */
}

.link-right p {
  margin: 0 0 0.5rem 0;
  line-height: 1.6;
  color: var(--text-color);
}

/* Link name (first paragraph with strong) */
.link-right > p:first-child {
  margin-bottom: 0.5rem;
}

.link-right > p:first-child strong {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary-color);
}

.link-right > p:first-child a {
  text-decoration: none;
  color: var(--primary-color);
  transition: color 0.2s;
}

.link-right > p:first-child a:hover {
  color: var(--accent-color);
  text-decoration: none;
}

/* Description paragraph */
.link-right > p:nth-child(2) {
  margin: 0;
  color: var(--text-light);
  font-size: 0.95rem;
}

/* Force URL wrapping in all card content */
.event-right a,
.link-right a,
.publication-card a {
  overflow-wrap: break-word;
  word-break: break-all;      /* More aggressive: break URLs anywhere */
  hyphens: none;              /* Don't add hyphens to URLs */
}

/* Responsive: Adjust layout on mobile */
@media (max-width: 768px) {
  .link-card {
    grid-template-columns: 60px 1fr;
    gap: 1rem;
    padding: 1rem;
  }

  .link-left {
    width: 60px;
  }

  .link-right > p:first-child strong {
    font-size: 1.1rem;
  }
}
