/* ==========================================================
   Featured Publications — Fabi Fregonesi
   ========================================================== */

/* ===== Wrapper / Container ===== */
.featured-pubs {
  margin: 2rem auto 4rem;
  max-width: min(1200px, 94vw);
}

/* ===== Filters ===== */
.featured-filters {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin: 0 0 1rem;
}

.featured-filters button {
  border: 1px solid rgba(0, 0, 0, .15);
  background: #fff;
  font: inherit;
  padding: .5rem .75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}

.featured-filters button.is-active,
.featured-filters button:hover {
  border-color: rgba(0, 0, 0, .35);
}

/* ===== Grid Layout ===== */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* 2 cards per row on desktop */
  gap: 18px;
}

/* Responsive: 1 card per row on smaller screens */
@media (max-width: 900px) {
  .featured-grid {
    grid-template-columns: 1fr;
  }
}

/* Ensure Elementor wrappers behave as grid items */
.featured-grid > * {
  margin: 0;
  width: 100%;
}

/* ===== Card ===== */
.featured-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
  transition: box-shadow .25s ease, transform .25s ease;
}

@media (max-width: 700px) {
  .featured-card {
    grid-template-columns: 1fr;
  }
}

/* ===== Cover ===== */
.featured-card .cover {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: #f3f3f3;
}

.featured-card .cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: translateZ(0);
}

/* ===== Badges ===== */
.badge {
  position: absolute;
  left: 10px;
  top: 10px;
  background: #111;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  padding: .35rem .5rem;
  border-radius: 6px;
}

.badge.year {
  top: auto;
  bottom: 10px;
  background: #0a6efd;
}

.badge.role {
  background: #111;
}

/* ===== Meta ===== */
.featured-card .meta .title {
  margin: 0 0 .25rem;
  font-weight: 700;
  font-size: clamp(1rem, .95rem + .3vw, 1.15rem);
}

.featured-card .pub-line {
  margin: 0 0 .5rem;
  color: #555;
}

.featured-card .details {
  margin: 0 0 .5rem;
  color: #333;
}

.featured-card .excerpt {
  margin: 0 0 .75rem;
  color: #333;
}

/* ===== Buttons ===== */
.featured-card .actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .5rem;
}

.featured-card .btn {
  display: inline-block;
  padding: .5rem .75rem;
  border-radius: 8px;
  text-decoration: none;
  background: #111;
  color: #fff;
  transition: background .2s ease, color .2s ease;
}

.featured-card .btn:hover {
  background: #0a6efd;
}

.featured-card .btn.ghost {
  background: transparent;
  color: #111;
  border: 1px solid #111;
}

.featured-card .btn.ghost:hover {
  background: #111;
  color: #fff;
}

/* ===== Tags ===== */
.featured-card .tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.featured-card .tags li {
  background: #f1f1f1;
  color: #333;
  padding: .25rem .5rem;
  border-radius: 999px;
  font-size: 12px;
}

/* ===== Hover Effects ===== */
@media (hover: hover) {
  .featured-card:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
    transform: translateY(-2px);
  }
}

/* ===== Dark Section Support ===== */
.dark-section .featured-card {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .1);
}

.dark-section .featured-card .btn.ghost {
  color: #fff;
  border-color: #fff;
}

.dark-section .featured-filters button {
  background: rgba(255, 255, 255, .06);
  color: #fff;
  border-color: rgba(255, 255, 255, .25);
}

.dark-section .featured-card .excerpt,
.dark-section .featured-card .details,
.dark-section .featured-card .pub-line,
.dark-section .featured-card .tags li {
  color: #f1f1f1;
}

.dark-section .featured-card .tags li {
  background: rgba(255, 255, 255, .1);
}
