/* Center and constrain Featured Publications block to match Recent Publications */
/* Wider container for less whitespace and bigger cards */
.featured-center-container {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
  text-align: left;
}
@media (max-width: 1300px) {
  .featured-center-container { max-width: 98vw; }
}
@media (max-width: 900px) {
  .featured-center-container { text-align: center; }
  .featured-center-container .row.featured-grid-row { justify-content: center !important; }
}

/* Make featured cards a bit bigger on wide screens */
.featured-card-col {
  padding-left: 18px;
  padding-right: 18px;
}
@media (max-width: 1100px) {
  .featured-card-col { padding-left: 8px; padding-right: 8px; }
}
/* Hide page buttons in Featured Publications section */
#featured_top .btn-links { display: none !important; }

/* Featured card layout: image on top, content below (grid of cards) */
#featured_top .view-card .card { display:flex; flex-direction:column; height:100%; border-radius:8px; overflow:hidden; }
#featured_top .view-card .card .card-image img, #featured_top .view-card .card img { width:100%; height:200px; object-fit:cover; display:block; }
#featured_top .view-card .card .card-body, #featured_top .view-card .card .card-content { padding:1rem; flex:1 1 auto; display:flex; flex-direction:column; }
#featured_top .view-card .card .section-subheading, #featured_top .view-card .card .pub-row-heading { color: #0b6f5b; font-size:0.78rem; text-transform:uppercase; font-weight:700; margin-bottom:0.5rem; }
#featured_top .view-card .card h3, #featured_top .view-card .card .article-title { font-size:1.05rem; margin:0 0 0.5rem 0; font-weight:700; }
#featured_top .view-card .card .card-text { color:#4e5a60; margin-top:auto; }
#featured_top .view-card .card .article-date { font-size:0.85rem; color:#6c757d; margin-top:0.75rem; }

/* Make featured cards clickable overlay and accessible */
#featured_top .card { position: relative; cursor: pointer; }
#featured_top .card a.stretched-link { position: absolute; inset: 0; z-index: 30; outline: none; text-decoration: none; }
#featured_top .card a.stretched-link:focus { box-shadow: 0 0 0 4px rgba(0,127,95,0.15), 0 0 0 1px rgba(0,127,95,0.3); }
#featured_top .card a.stretched-link::after { content: '' ; position: absolute; inset:0; }

/* Small responsive tweaks */
@media (max-width: 767px) {
  #featured_top .view-card .card .card-image img { height:140px; }
  #featured_top .view-card { padding:0 10px; }
}

/* New featured-grid layout to match the provided design */
.featured-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:2.5rem;align-items:start}
.featured-item{display:flex;flex-direction:column;position:relative;} .featured-link{position:absolute;inset:0;z-index:10;display:block;}
.featured-link:focus{outline:2px solid transparent;box-shadow:0 0 0 4px rgba(0,127,95,0.12);}
.featured-item{transition:transform .15s ease,box-shadow .15s ease;border-radius:8px}
.featured-item:hover{transform:translateY(-6px);box-shadow:0 10px 30px rgba(15,36,40,0.12)}
.featured-item .featured-link{z-index:30}
/* Prevent inner anchors from getting separate hover styles; the overlay link makes the whole card clickable */
.featured-item a:not(.featured-link){color:inherit;text-decoration:none;pointer-events:none}
.featured-item a:not(.featured-link):hover{color:inherit;text-decoration:none}
.featured-media{
  overflow:hidden;
  border-radius:8px;
  background:#ffffff;
  display:flex;
  align-items:center;
  justify-content:center;
  height:320px;
}
.featured-media img{
  max-width:100%;
  max-height:100%;
  object-fit:contain;
  display:block;
  transition:transform .25s ease;
}
.featured-item:hover .featured-media img{transform:scale(1.03)}
/* Ensure the inner content container of the featured card grows and stacks vertically.
  The generated HTML places the title and excerpt inside the second child <div> of .featured-item. */
.featured-item > div:last-child { padding:0.8rem 0; display:flex; flex-direction:column; gap:0.4rem; flex:1 1 auto }
.featured-tag{display:inline-block;text-transform:uppercase;font-size:0.7rem;color:#0b6f5b;font-weight:700;margin-bottom:0.5rem}
.featured-title{font-size:1.05rem;font-weight:700;margin:0 0 0.5rem}
/* Target the actual generated title element and reserve fixed vertical space. */
.featured-item h2.text-lg.font-semibold, .featured-item h2.article-title {
  font-size:1.05rem;
  font-weight:700;
  margin:0 0 0.5rem;
  /* Reserve vertical space but do NOT truncate the title: allow it to grow if needed. */
  line-height:1.15;
  min-height:2.3em;
}
@media (max-width: 680px) {
  .featured-item h2.text-lg.font-semibold, .featured-item h2.article-title { min-height:3.45em }
}

  /* Strong fallback: force a minimum title space so excerpts align even if JS doesn't run.
    Increase if you expect longer titles. */
  .featured-item h2.text-lg.font-semibold, .featured-item h2.article-title { min-height:3.6em !important; }
  @media (max-width: 680px) { .featured-item h2.text-lg.font-semibold, .featured-item h2.article-title { min-height:4.5em !important; } }

/* Harmonize featured typography with Recent Publications */
.section-heading h1.mb-0{font-size:2rem; font-weight:700; margin-bottom:1rem}
.text-lg.font-semibold{font-size:1.05rem; font-weight:700}
.line-clamp-3.text-sm{font-size:0.95rem; color:#55656a}
/* Ensure all featured excerpts use the same line-height and maximum height so
  the webkit line-clamp truncates after the same visible lines in each card. */
.featured-excerpt{color:#55666b;margin:0 0 0.75rem;display:-webkit-box;-webkit-line-clamp:5;-webkit-box-orient:vertical;overflow:hidden;line-height:1.25;max-height:6.25em}
/* Also target the theme's generated paragraph classes used for excerpts and their inner links
  so the ellipsis is shown reliably even when the paragraph wraps an <a>. */
.featured-item p.line-clamp-3.text-sm, .featured-item p.text-sm.line-clamp-3 { line-height:1.25; max-height:6.25em; overflow:hidden; display:-webkit-box; -webkit-line-clamp:5; -webkit-box-orient:vertical }
.featured-item p.line-clamp-3.text-sm a, .featured-item p.text-sm.line-clamp-3 a { display:-webkit-box; -webkit-line-clamp:5; -webkit-box-orient:vertical; overflow:hidden }
@media (max-width: 680px) {
  .featured-excerpt, .featured-item p.line-clamp-3.text-sm, .featured-item p.text-sm.line-clamp-3 { -webkit-line-clamp:4; max-height:5em }
  .featured-item p.line-clamp-3.text-sm a, .featured-item p.text-sm.line-clamp-3 a { -webkit-line-clamp:4; }
}
.featured-date{font-size:0.85rem;color:#6c757d}

/* Right-to-left ordering if requested: reverse the visual order while keeping DOM order for accessibility */
/* Use `.featured-grid.rtl` to enable RTL ordering (newest on right). Default remains LTR (newest on left). */
.featured-grid.rtl{direction:rtl}
.featured-grid.rtl .featured-item{direction:ltr}

/* Responsive: 2 columns on medium, 1 on small */
@media (max-width: 1100px){ .featured-grid{grid-template-columns:repeat(2,1fr);} }
@media (max-width: 680px){ .featured-grid{grid-template-columns:repeat(1,1fr);} }

/* Responsive heights for featured image box */
@media (max-width: 1100px) {
  .featured-media { height: 260px; }
}
@media (max-width: 768px) {
  .featured-media { height: 180px; }
}

/* Featured title and date typography tweaks */
.featured-card-col h2 {
  font-weight: 900; /* stronger bold for paper titles */
  font-size: 1.12rem; /* slightly larger for emphasis */
  line-height: 1.15;
}
.featured-card-col h2 a { color: inherit; font-weight: 900; }

/* Dates: smaller and more grey-ish */
.featured-card-col .mt-3.text-gray-500 time {
  font-size: 0.78rem;
  color: #6b6f75; /* softer grey */
}

/* Make sure the meta/type label remains normal weight */
.featured-card-col .mt-3 span {
  font-weight: 400; /* less prominent */
  color: #7a7f83; /* muted grey */
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}

/* Style the Featured Publications heading to be larger and title-like */
#papers .text-3xl { font-size: 2.25rem; font-weight: 800; letter-spacing: -0.02em; text-align: center; color: #0b2b2b; margin-bottom: 1rem; }
@media (max-width: 768px) { #papers .text-3xl { font-size: 1.65rem; } }

/* Remove extra whitespace caused by global sticky positioning on .section-heading h1 */
/* Lift the entire heading container up into the section background so the title sits at the top of the grey block */
#papers .section-heading { position: relative; top: -28px; z-index: 5; }
#papers .section-heading h1 { position: static !important; top: auto !important; margin-top: 0 !important; margin-bottom: 0.75rem !important; }
@media (max-width: 768px) { #papers .section-heading { top: -14px; } }

/* Pull Featured block up and increase image height for stronger visual parity with Recent */
#papers { padding-top: 8px !important; padding-bottom: 40px !important; margin-top: -56px !important; }
@media (max-width: 768px) { #papers { padding-top: 8px !important; margin-top: -28px !important; } .featured-media img{height:180px;} }

/* Compact Recent Publications block */
#recent { padding-top: 40px; padding-bottom: 40px; }
#recent .section-heading { margin-bottom: 0.75rem; }
#recent .pub-list-item { margin-bottom: 0.75rem; font-size: 0.95rem; }
#recent .pub-list-item .btn { padding: 6px 10px; font-size: 0.82rem; }
#recent .pub-list-item .article-metadata { font-size: 0.95rem; }


/* Publication page tweaks: widen article and hide Abstract / Type / Publication rows */
.pub .article-container { max-width: 900px; }
.pub .article-container > h3 { display: none; }
.pub p.pub-abstract { display: none; }
.pub .article-container .col-md-10 > .row { display: none; }
.pub .article-container .space-below { display: none; }

/* Make header image taller on publication pages */
.featured-image-wrapper{display:flex;align-items:center;justify-content:center;padding:0 0 0 0;overflow:hidden}
.pub .article-banner {
  display:block;
  width:100%;
  max-width:100%;
  height:auto; /* let height be determined by aspect ratio */
  max-height:108px; /* cap height without cropping */
  object-fit:contain; /* avoid cropping; preserve full image */
}
@media (max-width: 768px) {
  .pub .article-banner { max-height:136px; }
}

/* small gap between header image and article body */
.featured-image-wrapper { margin-bottom: 1.25rem; }

/* Desktop doubled max height */
.pub .article-banner { max-height:216px; }



/* Small UI tweaks: inner padding, recent list typography/spacing, header sizing */
/* 1) Add inner padding to featured cards */
.featured-item > div, .featured-body { padding: 12px !important; }

/* 2) Normalize font sizes and reduce vertical spacing in Recent publications */
#recent .pub-list-item { margin-bottom: 0.45rem !important; padding-bottom: 0.15rem !important; font-size: 0.95rem !important; }
#recent .pub-list-item .article-metadata { font-size: 0.9rem !important; color: #5b6670; }
#recent .section-heading { margin-bottom: 0.4rem !important; }

/* 3) Slightly increase header brand and nav link sizes (scoped to main navbar) */
header nav#navbar-main .navbar-brand { font-size: 1.65rem; line-height:1; }
header nav#navbar-main .nav-link { font-size: 1.05rem; padding: 0.45rem 0.6rem; }

