/* ===========================================================
   Custom styles for Boyi Li's homepage
   Built to match the Beautiful Jekyll theme palette
   =========================================================== */

:root {
  --accent: #b5194f;        /* homepage accent (magenta) */
  --accent-soft: #f7e4ec;   /* light tint of the accent */
  --ink: #404040;           /* main text colour (theme text-col) */
  --muted: #7a7a7a;         /* secondary text */
  --line: #e6e6e6;          /* hairline borders */
  --card-bg: #ffffff;       /* card background */
  --radius: 12px;
}

/* -----------------------------------------------------------
   1. Reduce left / right page margins (wider content area)
   -----------------------------------------------------------
   The base layout wraps content in `.container-md` with a
   `col-xl-8 offset-xl-2` column. We widen the container and
   let the inner column span the full width so the side
   margins shrink while staying centred and readable.        */
main.container-md {
  max-width: 1080px;
}

@media (min-width: 992px) {
  main.container-md > .row > [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
    margin-left: 0;
  }
}

/* -----------------------------------------------------------
   2. Links — themed accent with smooth hover
   ----------------------------------------------------------- */
a {
  text-decoration: none;
  transition: color 0.18s ease;
}
a,
a:visited {
  color: var(--accent);
}
a:hover {
  text-decoration: underline;
  color: #8c123d;
}

/* -----------------------------------------------------------
   3. Section headings
   ----------------------------------------------------------- */
h2[id] {
  margin-top: 1.6rem;
  margin-bottom: 1rem;
  padding-left: 0.7rem;
  border-left: 4px solid var(--accent);
  font-weight: 700;
  letter-spacing: 0.2px;
}

/* -----------------------------------------------------------
   4. Section divider (replaces the inline grey <hr>)
   ----------------------------------------------------------- */
hr:not(.small) {
  height: 1px !important;
  border: 0 !important;
  background: linear-gradient(
    to right,
    transparent,
    var(--line) 15%,
    var(--line) 85%,
    transparent
  ) !important;
  margin: 2rem 0 !important;
}

/* -----------------------------------------------------------
   5. Publication list & cards
   ----------------------------------------------------------- */
.paper-list {
  list-style: none;
  padding-left: 0;
  margin-top: 0.5rem;
}

.paper-item {
  display: flex;
  align-items: stretch;
  gap: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  transform-origin: center;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s ease, border-color 0.28s ease;
}

.paper-item:hover {
  transform: scale(1.045);
  box-shadow: 0 16px 34px rgba(181, 25, 79, 0.18);
  border-color: var(--accent);
}

.paper-thumb {
  flex: 0 0 220px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-radius: 8px;
}

.paper-thumb img {
  width: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.paper-content {
  flex: 1;
  font-size: 16px;
  line-height: 1.55;
}

/* Venue badge — the trailing <strong> inside a card */
.paper-content > strong:last-child {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
}

.paper-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

/* Paper action links rendered as buttons: Paper / Code / Website */
.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 4px;
}

.paper-links a,
.paper-links a:visited {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--accent);
  background: #fff;
  border: 1.5px solid var(--accent);
  border-radius: 8px;            /* 圆角矩形 */
  overflow: hidden;
  text-decoration: none;
  z-index: 0;
  transition: color 0.25s ease, box-shadow 0.25s ease,
    transform 0.15s ease;
}

/* Sliding fill that animates in on hover */
.paper-links a::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s ease;
  z-index: -1;
}

.paper-links a i {
  font-size: 13px;
  transition: transform 0.25s ease;
}

.paper-links a:hover {
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(181, 25, 79, 0.28);
  transform: translateY(-2px);
}

.paper-links a:hover::before {
  transform: scaleX(1);
}

.paper-links a:hover i {
  transform: scale(1.15);
}

.paper-links a:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(181, 25, 79, 0.25);
}

/* -----------------------------------------------------------
   6. News list — aligned date column
   ----------------------------------------------------------- */
.news-list {
  list-style: none;
  padding-left: 0;
}

.news-list li {
  display: flex;
  gap: 12px;
  margin-bottom: 0.7rem;
  line-height: 1.55;
}

.news-date {
  flex: 0 0 5.5em;      /* fixed-width column so all dates align */
  text-align: right;
  white-space: nowrap;
  color: var(--accent);
  font-weight: 600;
}

.news-body {
  flex: 1;
}

@media (max-width: 576px) {
  .news-date {
    flex-basis: 4.8em;
  }
}

/* -----------------------------------------------------------
   7. Responsive — stack cards on small screens
   ----------------------------------------------------------- */
@media (max-width: 576px) {
  .paper-item {
    flex-direction: column;
    gap: 14px;
  }
  .paper-thumb {
    flex: 0 0 auto;
    width: 100%;
  }
}

/* -----------------------------------------------------------
   8. Smooth anchor scrolling
   ----------------------------------------------------------- */
html {
  scroll-behavior: smooth;
}

/* -----------------------------------------------------------
   9. Heading — animated accent bar on hover
   ----------------------------------------------------------- */
h2[id] {
  transition: border-left-width 0.2s ease, padding-left 0.2s ease;
}
h2[id]:hover {
  border-left-width: 8px;
  padding-left: 0.85rem;
}

/* -----------------------------------------------------------
   10. Content lists — themed bullet markers
   (about / research interests / service; not paper or news)
   ----------------------------------------------------------- */
main ul:not(.paper-list):not(.news-list) {
  list-style: none;
  padding-left: 1.3em;
}
main ul:not(.paper-list):not(.news-list) > li {
  position: relative;
}
main ul:not(.paper-list):not(.news-list) > li::before {
  content: "\25B8";        /* small right-pointing triangle */
  position: absolute;
  left: -1.2em;
  color: var(--accent);
  font-size: 0.85em;
  top: 0.12em;
  transition: transform 0.18s ease;
}
main ul:not(.paper-list):not(.news-list) > li:hover::before {
  transform: translateX(3px);
}

/* -----------------------------------------------------------
   11. Resume button
   ----------------------------------------------------------- */
.resume-btn,
.resume-btn:visited {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 8px 20px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(181, 25, 79, 0.22);
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    background 0.18s ease;
}
.resume-btn:hover {
  color: #fff;
  text-decoration: none;
  background: #8c123d;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(181, 25, 79, 0.32);
}
.resume-btn:active {
  transform: translateY(0);
}
.resume-btn i {
  transition: transform 0.25s ease;
}
.resume-btn:hover i {
  transform: scale(1.15) rotate(-6deg);
}

/* -----------------------------------------------------------
   12. News rows — subtle hover highlight
   ----------------------------------------------------------- */
.news-list li {
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.2s ease, transform 0.2s ease;
}
.news-list li:hover {
  background: var(--accent-soft);
  transform: translateX(4px);
}

/* -----------------------------------------------------------
   13. Navbar avatar — playful hover
   ----------------------------------------------------------- */
.avatar-img {
  transition: transform 0.3s ease;
}
.avatar-img:hover {
  transform: scale(1.08) rotate(5deg);
}

/* -----------------------------------------------------------
   14. Entrance animations (respect reduced-motion)
   ----------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes fadeUp {
    from {
      opacity: 0;
      transform: translateY(16px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  h2[id],
  .paper-list > li {
    animation: fadeUp 0.6s ease both;
  }

  /* Stagger the publication cards as they appear
     (the <br> separators occupy the even child positions) */
  .paper-list > li:nth-child(1) {
    animation-delay: 0.05s;
  }
  .paper-list > li:nth-child(3) {
    animation-delay: 0.12s;
  }
  .paper-list > li:nth-child(5) {
    animation-delay: 0.19s;
  }
}
