/* ============================================================
   custom.css — Visual improvements for hongyeehh.github.io
   ============================================================ */

/* --------------------------------------------------
   1. Typography: Inter font + improved readability
   -------------------------------------------------- */
body,
.page__content,
.author__name,
.author__bio,
.nav__list,
.masthead__menu-item {
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.page__content {
  font-size: 1em;
  line-height: 1.75;
  max-width: 850px;
}

.page__content p {
  margin-bottom: 1.2em;
  letter-spacing: 0.01em;
}

h1, h2, h3, h4 {
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* --------------------------------------------------
   2. Section headers with icon 
   -------------------------------------------------- */
.page__content h2 {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin-top: 2em;
  margin-bottom: 0.8em;
  padding-bottom: 0.2em;
  border-bottom: 2px solid #eaeaea;
  padding-right: 1em;
  font-size: 1.15em;
  font-weight: 600;
  color: #333;
  letter-spacing: 0.01em;
}

/* Clearfix for inline-flex h2 so next element drops below */
.page__content h2::after {
  content: "";
  display: block;
  clear: both;
}

[data-theme="dark"] .page__content h2 {
  border-bottom-color: #333;
  color: #e0e0e0;
}

/* --------------------------------------------------
   3. Timeline-style news list
   -------------------------------------------------- */
.news-timeline {
  list-style: none;
  padding: 0;
  margin: 0.5em 0 1em 0;
  position: relative;
}

.news-timeline::before {
  content: '';
  position: absolute;
  left: 68px; /* shifted right to accommodate wider date */
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, #5b9bd5, #e0e0e0);
  border-radius: 2px;
}

[data-theme="dark"] .news-timeline::before {
  background: linear-gradient(to bottom, #8ab4f8, #444);
}

.news-timeline li {
  display: flex;
  align-items: flex-start;
  gap: 1em;
  margin-bottom: 0.85em;
  position: relative;
}

.news-timeline .news-date {
  flex-shrink: 0;
  width: 60px; /* increased width for larger font */
  font-size: 0.9em; /* increased from 0.75em */
  font-weight: 600;
  color: #5b9bd5;
  text-align: right;
  padding-top: 0.15em;
  line-height: 1.4;
}

[data-theme="dark"] .news-timeline .news-date {
  color: #8ab4f8;
}

.news-timeline .news-dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #5b9bd5;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #5b9bd5;
  margin-top: 0.35em;
  position: relative;
  z-index: 1;
}

[data-theme="dark"] .news-timeline .news-dot {
  background: #8ab4f8;
  border-color: #1a1a1a;
  box-shadow: 0 0 0 1px #8ab4f8;
}

.news-timeline .news-dot.news-dot--highlight {
  background: #e8a020;
  box-shadow: 0 0 0 1px #e8a020;
}

[data-theme="dark"] .news-timeline .news-dot.news-dot--highlight {
  background: #f5c842;
  box-shadow: 0 0 0 1px #f5c842;
}

.news-timeline .news-text {
  flex: 1;
  font-size: 1em; /* increased from 0.88em */
  line-height: 1.5;
  color: #333;
  padding-top: 0.05em;
}

[data-theme="dark"] .news-timeline .news-text {
  color: #ccc;
}

.news-timeline .news-text a {
  color: #5b9bd5;
}

[data-theme="dark"] .news-timeline .news-text a {
  color: #8ab4f8;
}

/* --------------------------------------------------
   4. Collapsible news: "show more" button
   -------------------------------------------------- */
.news-timeline li.news-hidden {
  display: none;
}

.news-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  margin-top: 0.4em;
  margin-left: 80px;
  padding: 0.3em 0.8em;
  font-size: 0.82em;
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  color: #5b9bd5;
  background: transparent;
  border: 1px solid #5b9bd5;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.news-toggle-btn:hover {
  background: #5b9bd5;
  color: #fff;
}

[data-theme="dark"] .news-toggle-btn {
  color: #8ab4f8;
  border-color: #8ab4f8;
}

[data-theme="dark"] .news-toggle-btn:hover {
  background: #8ab4f8;
  color: #1a1a1a;
}

/* --------------------------------------------------
   5. Featured publications note
   -------------------------------------------------- */
.pub-section-note {
  font-size: 0.82em;
  color: #888;
  margin-bottom: 1em;
  font-style: italic;
}

[data-theme="dark"] .pub-section-note {
  color: #aaa;
}

/* --------------------------------------------------
   6. General spacing improvements
   -------------------------------------------------- */
.page__content ul {
  line-height: 1.7;
}

.notice--info {
  border-radius: 8px;
  font-size: 0.92em;
}

[data-theme="dark"] .notice--info {
  background-color: #1c2e47 !important;
  color: #e2e8f0;
}

[data-theme="dark"] .notice--info a {
  color: #8ab4f8 !important;
}

/* --------------------------------------------------
   7. Typography & Publication Cards Alignment
   -------------------------------------------------- */

/* Unify content links to match the Timeline News blue */
.page__content a:not(.btn) {
  color: #5b9bd5 !important;
  text-decoration: none;
  transition: all 0.2s ease;
}

.page__content a:not(.btn):hover {
  text-decoration: underline;
}

[data-theme="dark"] .page__content a:not(.btn) {
  color: #8ab4f8 !important;
}

/* Publication card layout reset & interactive hover */
.publication {
  gap: 1.5rem;
  margin-bottom: 1.5rem !important; /* Tighten to account for padding */
  align-items: flex-start !important;
  padding: 1.25rem;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.publication:hover {
  background: #f6fafe;
  border-color: #e2e8f0;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

[data-theme="dark"] .publication:hover {
  background: #182233;
  border-color: #2d3748;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.publication--text-only {
  padding: 0.5rem 0.8rem !important;
  margin-bottom: 0.5rem !important;
}

/* Thumbnail framing */
.publication__image {
  margin-right: 0 !important;
  flex: 0 0 200px !important;
}

.publication__image img {
  width: 100%;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.05);
}

[data-theme="dark"] .publication__image img {
  border-color: rgba(255,255,255,0.05);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* Info section gap and alignments */
.publication__info {
  gap: 0.2rem;
  justify-content: flex-start;
  padding-top: 0.2rem;
}

/* Override squished margins and global line height */
.page__content .publication p {
  margin-bottom: 0 !important;
  line-height: 1.4 !important;
}

.publication__title {
  font-size: 1.25em;
  font-weight: 700;
  color: #111 !important;
  line-height: 1.25 !important;
  margin-bottom: 0.15rem !important;
}

[data-theme="dark"] .publication__title {
  color: #fff !important;
}

.publication__authors {
  font-size: 0.95em;
  color: #555;
}

.publication__authors strong {
  color: #2b6cb0;
  font-weight: 700;
}

[data-theme="dark"] .publication__authors {
  color: #bbb;
}

[data-theme="dark"] .publication__authors strong {
  color: #90cdf4;
}

.publication__description {
  font-size: 0.9em;
  color: #666;
  font-style: italic;
}

[data-theme="dark"] .publication__description {
  color: #999;
}

/* Beautiful action buttons instead of plain text links */
.publication__links {
  display: flex;
  gap: 0.8rem;
  margin-top: 0.6rem !important;
  flex-wrap: wrap;
}

.publication__links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  background: #f1f5f9;
  color: #475569 !important;
  border-radius: 6px;
  font-size: 0.9em;
  font-weight: 600;
  text-decoration: none !important;
  transition: all 0.2s;
  border: 1px solid #e2e8f0;
}

.publication__links a:hover {
  background: #5b9bd5;
  color: #fff !important;
  border-color: #5b9bd5;
  transform: translateY(-1px);
}

[data-theme="dark"] .publication__links a {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .publication__links a:hover {
  background: #8ab4f8;
  color: #0f172a !important;
  border-color: #8ab4f8;
}
