/* === Custom "More News" Button === */
.btn-primary {
  background-color: #0056b3;      /* main color */
  border: none;
  color: #fff;
  border-radius: 30px;            /* makes it pill-shaped */
  padding: 10px 22px;
  font-weight: 600;
  letter-spacing: 0.5px;
  transition: all 0.25s ease-in-out;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Hover effect */
.btn-primary:hover {
  background-color: #007bff;      /* lighter blue on hover */
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Optional: focus style (for accessibility) */
.btn-primary:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0,123,255,0.4);
}


/* === News Table Styling === */
#all-news {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 12px;
  font-size: 1rem;
}

#all-news tbody tr {
  background-color: #f9fafb;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#all-news tbody tr:hover {
  background-color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#all-news td {
  padding: 15px 20px;
  vertical-align: top;
}

/* Date column */
#all-news td:first-child {
  color: #0d6efd; /* Bootstrap blue */
  font-weight: 700;
  text-align: right;
  width: 120px;
  border-right: 2px solid #e3e6ea;
}

/* News text column */
#all-news td:last-child {
  padding-left: 25px;
  line-height: 1.5;
}

/* Links inside news */
#all-news a {
  color: #0d6efd;
  text-decoration: none;
  border-bottom: 1px dashed rgba(13,110,253,0.4);
  transition: color 0.2s ease, border-color 0.2s ease;
}

#all-news a:hover {
  color: #084298;
  border-bottom-color: rgba(13,110,253,0.8);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  #all-news td:first-child {
    display: block;
    text-align: left;
    border-right: none;
    margin-bottom: 5px;
  }

  #all-news td:last-child {
    display: block;
    padding-left: 0;
  }

  #all-news tbody tr {
    box-shadow: none;
    border-left: 4px solid #0d6efd;
    padding-left: 10px;
    background-color: #ffffff;
  }
}

.news-wrapper {
  max-width: 900px;
  width: 90%;
  background-color: #ffffff;
  padding: 40px 30px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Table alignment */
#all-news {
  margin: 0 auto;
  border-collapse: separate;
  border-spacing: 0 12px;
  text-align: left;
}

#all-news td {
  vertical-align: top;
}

/* Mobile tweaks */
@media (max-width: 768px) {
  .news-wrapper {
    width: 95%;
    padding: 25px 15px;
    box-shadow: none;
  }
}

/* === Homepage: compact two-column news preview === */
.home-news-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Each row acts like a card with a fixed date column */
.home-news-row {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: #fff;
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  transition: transform .15s ease, box-shadow .15s ease;
}

/* Hover lift */
.home-news-row:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

/* Left date column */
.home-news-date {
  flex: 0 0 110px;          /* fixed width on larger screens */
  max-width: 110px;
  text-align: right;
  font-weight: 700;
  color: #0d6efd;           /* bootstrap blue */
  padding-top: 3px;
  white-space: nowrap;
}

/* Content column */
.home-news-content {
  flex: 1 1 auto;
  color: #333;
  line-height: 1.45;
}

/* Links inside */
.home-news-content a {
  color: #0d6efd;
  text-decoration: none;
  border-bottom: 1px dashed rgba(13,110,253,0.28);
}
.home-news-content a:hover {
  color: #084298;
  border-bottom-color: rgba(13,110,253,0.7);
}

/* Make it responsive: stack on small screens */
@media (max-width: 768px) {
  .home-news-row {
    flex-direction: column;
    padding: 10px 12px;
  }

  .home-news-date {
    text-align: left;
    flex: none;
    max-width: none;
    margin-bottom: 6px;
  }
}

.projects-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.project-card {
  background: #fff;
  padding: 20px 25px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: transform .2s ease, box-shadow .2s ease;
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.project-card h3 a {
  color: #0d6efd;
  text-decoration: none;
}

.project-card h3 a:hover {
  color: #084298;
}

.page-content {
  background-color: #fff;
  padding: 30px 40px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  line-height: 1.6;
}

@media (max-width: 900px) {
  .page-content {
    padding: 20px;
  }
}

/* === Publications Preview Cards === */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.pub-card {
  background-color: #ffffff;
  border-left: 4px solid #0d6efd;
  border-radius: 8px;
  padding: 15px 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pub-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.pub-year {
  font-weight: 700;
  color: #0d6efd;
  margin-bottom: 6px;
  min-width: 70px;
}

.pub-content {
  color: #333;
  line-height: 1.5;
}

.pub-card a {
  color: #0d6efd;
  text-decoration: none;
  border-bottom: 1px dashed rgba(13,110,253,0.3);
}
.pub-card a:hover {
  color: #084298;
  border-bottom-color: rgba(13,110,253,0.8);
}

* === Shared News/Publication Table Styling === */
.news-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 12px;
  font-size: 1rem;
}

.news-table tbody tr {
  background-color: #f9fafb;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.news-table tbody tr:hover {
  background-color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.news-table td {
  padding: 15px 20px;
  vertical-align: top;
}

/* Date / Year column */
.news-table td:first-child {
  color: #0d6efd;
  font-weight: 700;
  text-align: right;
  width: 120px;
  border-right: 2px solid #e3e6ea;
}

/* Text column */
.news-table td:last-child {
  padding-left: 25px;
  line-height: 1.5;
}

/* Links */
.news-table a {
  color: #0d6efd;
  text-decoration: none;
  border-bottom: 1px dashed rgba(13,110,253,0.4);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.news-table a:hover {
  color: #084298;
  border-bottom-color: rgba(13,110,253,0.8);
}

/* Responsive */
@media (max-width: 768px) {
  .news-table td:first-child {
    display: block;
    text-align: left;
    border-right: none;
    margin-bottom: 5px;
  }
  .news-table td:last-child {
    display: block;
    padding-left: 0;
  }
  .news-table tbody tr {
    box-shadow: none;
    border-left: 4px solid #0d6efd;
    padding-left: 10px;
    background-color: #ffffff;
  }
}
#all-publications tbody tr {
  background-color: #f9fafb;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
}

#all-publications tbody tr:hover {
  background-color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

#all-publications td {
  padding: 12px 20px;
  vertical-align: top;
}

#all-publications td:first-child {
  font-weight: 700;
  color: #0d6efd;
  width: 100px;
  text-align: right;
  border-right: 2px solid #e9ecef;
  padding-right: 15px;
}

#all-publications td:last-child {
  padding-left: 25px;
}

@media (max-width: 768px) {
  #all-publications td:first-child,
  #all-news td:first-child {
    display: block;
    text-align: left;
    border-right: none;
    padding-bottom: 4px;
  }

  #all-publications td:last-child,
  #all-news td:last-child {
    display: block;
    padding-left: 0;
  }

  #all-publications tbody tr,
  #all-news tbody tr {
    border-left: 4px solid #0d6efd;
    padding-left: 10px;
    box-shadow: none;
    border-radius: 0;
  }
}


/* === Publication venue badges === */
/* Usage: <tr data-venue="conference|journal|preprint|workshop">         */
/* Badge text and color are CSS-only — the attribute is the single source */
#all-publications tr[data-venue] td:first-child::after {
  display: block;
  margin-top: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 2px 7px;
  width: fit-content;
}

#all-publications tr[data-venue="conference"] td:first-child::after {
  content: "Conf.";
  background: #EBF4FB;
  color: #0072B2;
}

#all-publications tr[data-venue="journal"] td:first-child::after {
  content: "Journal";
  background: #E6F4EF;
  color: #00724A;
}

#all-publications tr[data-venue="preprint"] td:first-child::after {
  content: "Preprint";
  background: #F4F1EB;
  color: #7A5C00;
}

#all-publications tr[data-venue="workshop"] td:first-child::after {
  content: "Workshop";
  background: #F0EBF4;
  color: #6B3FA0;
}

/* === Colorblind-safe accent palette (Okabe & Ito 2008) === */
/* Distinguishable under protanopia, deuteranopia, and tritanopia.      */
/* Usage in posts: <span class="c1">text</span>                         */
:root {
  --c1: #0072B2;  /* blue      */
  --c2: #D55E00;  /* vermillion */
  --c3: #009E73;  /* teal      */
}

.c1 { color: var(--c1); }
.c2 { color: var(--c2); }
.c3 { color: var(--c3); }

/* === Blog Post: two-column layout (TOC sidebar + content) === */
.post-wrapper {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

/* ── TOC sidebar ── */
.post-toc {
  flex: 0 0 200px;
  position: sticky;
  top: 2rem;
}

.toc-inner {
  background: #fff;
  border-radius: 10px;
  padding: 18px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  font-size: 0.83rem;
}

.toc-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #aaa;
  margin: 0 0 0.6rem 0;
  padding-left: 8px;
}

.toc-inner ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-inner li a {
  display: block;
  padding: 3px 8px;
  color: #666;
  text-decoration: none;
  border-left: 2px solid transparent;
  line-height: 1.4;
  transition: color 0.15s, border-color 0.15s;
}

.toc-inner li a:hover,
.toc-inner li a.active {
  color: #0072B2;
  border-left-color: #0072B2;
}

.toc-inner li.toc-h3 a {
  padding-left: 20px;
  font-size: 0.8rem;
  color: #888;
}

.toc-inner li.toc-h3 a:hover,
.toc-inner li.toc-h3 a.active {
  color: #0072B2;
}

/* ── Post body card ── */
.post-body {
  flex: 1;
  min-width: 0;
  background: #fff;
  padding: 52px 56px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Post header ── */
.post-title {
  font-size: 2.1rem;
  font-weight: 700;
  color: #111;
  margin-bottom: 0.3rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.post-meta {
  color: #aaa;
  font-size: 0.83rem;
  margin-bottom: 1.5rem;
  letter-spacing: 0.01em;
}

.post-meta-sep {
  margin: 0 0.4em;
  color: #ddd;
}

.post-tldr {
  background: #f0f7ff;
  border-left: 3px solid #0072B2;
  border-radius: 0 8px 8px 0;
  padding: 0.8rem 1.1rem;
  margin-bottom: 2.25rem;
  color: #3a3a3a;
  font-size: 0.94rem;
  line-height: 1.65;
}

.post-tldr-label {
  font-weight: 700;
  color: #0072B2;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 0.3rem;
}

.post-summary {
  background: #f0faf6;
  border-left: 3px solid var(--c3);
  border-radius: 0 8px 8px 0;
  padding: 0.9rem 1.2rem;
  margin: 1.5rem 0;
  color: #2f3a37;
  font-size: 0.94rem;
  line-height: 1.65;
}

.post-summary-label {
  font-weight: 700;
  color: var(--c3);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 0.4rem;
}

.post-summary p:last-child,
.post-summary ul:last-child,
.post-summary ol:last-child {
  margin-bottom: 0;
}

.post-divider {
  border: none;
  border-top: 1px solid #eef0f3;
  margin-bottom: 2rem;
}

/* ── Post prose ── */
.post-content {
  font-size: 1.0625rem;   /* 17px at default 16px root */
  color: #222;
}

.post-content p {
  line-height: 1.85;
  margin-bottom: 1.5rem;
}

.post-title,
.post-content h2,
.post-content h3,
.post-content h4 {
  text-transform: none;
}

.post-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111;
  margin-top: 2.75rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.015em;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #eef0f3;
}

.post-content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #222;
  margin-top: 2.1rem;
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.post-content code {
  background: #f4f6f8;
  border-radius: 4px;
  padding: 0.15em 0.45em;
  font-size: 0.84em;
  color: #c7254e;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

.post-content blockquote {
  border-left: 3px solid #0072B2;
  padding: 0.6rem 1.1rem;
  margin: 1.75rem 0;
  background: #f8fbff;
  border-radius: 0 8px 8px 0;
  color: #555;
  font-style: italic;
}

.post-content blockquote p { margin-bottom: 0; }

.post-content img {
  max-width: 600px;
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin: 2rem auto;
  display: block;
}

.post-content ul,
.post-content ol {
  padding-left: 1.6rem;
  margin-bottom: 1.5rem;
  color: #222;
}

.post-content li {
  line-height: 1.75;
  margin-bottom: 0.45rem;
}

.post-content a {
  color: #0055cc;
  text-decoration: none;
  border-bottom: 1px solid rgba(0,85,204,0.25);
  transition: border-color 0.15s ease;
}
.post-content a:hover {
  border-bottom-color: rgba(0,85,204,0.7);
}

/* ── Code blocks: bar with language label + copy button ── */
.post-content .highlighter-rouge {
  position: relative;
  margin-bottom: 1.5rem;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  overflow: hidden;
}

/* Reset inline code style inside code blocks */
.post-content .highlighter-rouge code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: 0.87em;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

.post-content .highlighter-rouge pre {
  margin: 0;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  background: #f6f8fa;
}

.code-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #eef0f3;
  padding: 4px 12px;
  border-bottom: 1px solid #e1e4e8;
}

.code-lang {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: lowercase;
  letter-spacing: 0.03em;
  color: #888;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

.code-copy {
  font-size: 0.72rem;
  color: #888;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
}
.code-copy:hover { color: #0072B2; background: #e0eef8; }

/* ── Post footer ── */
.post-footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid #e9ecef;
  font-size: 0.9rem;
  color: #999;
}
.post-footer a { color: #0d6efd; text-decoration: none; }
.post-footer a:hover { color: #084298; }

/* ── Responsive: hide TOC on narrow screens ── */
@media (max-width: 860px) {
  .post-toc { display: none; }
  .post-body { padding: 28px 20px; }
  .post-title { font-size: 1.5rem; }
}

/* === Blog Index: tag filter chips === */
.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tag-chip {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid #d0d7de;
  background: #fff;
  color: #555;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  letter-spacing: 0.02em;
}

.tag-chip:hover {
  border-color: #0072B2;
  color: #0072B2;
}

.tag-chip.active {
  background: #0072B2;
  border-color: #0072B2;
  color: #fff;
}

/* === Blog Index List === */
.blog-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.blog-list-item {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 12px 18px;
  background: #f9fafb;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.blog-list-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.09);
  background: #fff;
}

.blog-list-date {
  flex: 0 0 110px;
  text-align: right;
  font-weight: 700;
  color: #0d6efd;
  font-size: 0.88rem;
  white-space: nowrap;
  padding-top: 2px;
}

.blog-list-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.blog-list-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}

.blog-list-tldr {
  font-size: 0.83rem;
  color: #777;
  line-height: 1.5;
}

.blog-list-readtime {
  font-size: 0.75rem;
  color: #bbb;
  letter-spacing: 0.02em;
}

.blog-list-link {
  color: #1a1a2e;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}

.blog-list-link:hover {
  color: #0d6efd;
  border-bottom-color: rgba(13,110,253,0.45);
}

/* Small inline tags on each post row */
.blog-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.blog-post-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
  background: #eef0f3;
  color: #888;
  letter-spacing: 0.02em;
}

@media (max-width: 600px) {
  .blog-list-item {
    flex-direction: column;
    gap: 4px;
  }

  .blog-list-date {
    text-align: left;
    flex: none;
    padding-top: 0;
  }
}

/* === Mobile view === */
@media (max-width: 768px) {
  /* turn each row into a block for spacing */
  #all-news tr {
    display: block;
    margin-bottom: 10px;
  }

  /* remove *all* borders that may linger */
  #all-news td,
  #all-news td:first-child {
    border: none !important;     /* 🚫 absolutely no border */
  }

  /* show both cells inline on one line */
  #all-news td:first-child,
  #all-news td:last-child {
    display: inline;
    padding: 0;
    text-align: left;
    width: auto;
  }

  /* add " | " separator between date and text */
  #all-news td:first-child::after {
    content: " | ";
    color: #999;
    margin: 0 4px;
  }

  /* tidy up spacing */
  #all-news td {
    background: none;
    box-shadow: none;
  }
}
