/* ==================================================
   YFP – Latest Science Index (News Grid)
   ================================================== */

body.yfp-style-latest-science-index {
  --yfp-max: 1100px;
  --yfp-border: #e5e7eb;
  --yfp-muted: #64748b;
  --yfp-text: #0f172a;
  --yfp-accent: #0ea5e9;
  color: var(--yfp-text);
}

body.yfp-style-latest-science-index .container {
  max-width: var(--yfp-max);
  margin-inline: auto;
  padding-inline: 1rem;
}

/* HERO */
body.yfp-style-latest-science-index .yfp-hero {
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--yfp-border);
}
body.yfp-style-latest-science-index .yfp-hero__overlay {
  background: linear-gradient(to bottom, rgba(0,0,0,.35), rgba(0,0,0,.20));
}
body.yfp-style-latest-science-index .yfp-hero__inner {
  padding: 38px 0 30px;
  text-align: center;
}
body.yfp-style-latest-science-index .yfp-hero__title {
  margin: 0 0 14px;
  color: #fff;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.02em;
}

/* Hero search */
body.yfp-style-latest-science-index .yfp-lssearch {
  display: inline-block;
  width: min(620px, 100%);
}
body.yfp-style-latest-science-index .yfp-lssearch__field {
  display: flex;
  align-items: center;
  height: 44px;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--yfp-border);
}
body.yfp-style-latest-science-index .yfp-lssearch__input {
  flex: 1;
  border: 0;
  height: 100%;
  padding: 0 0.9rem;
  font: inherit;
  outline: none;
}
body.yfp-style-latest-science-index .yfp-lssearch__button {
  width: 48px;
  height: 100%;
  border: 0;
  background: #9ca3af;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
body.yfp-style-latest-science-index .yfp-lssearch__button:hover { background: #6b7280; }
body.yfp-style-latest-science-index .yfp-lssearch__button svg { display:block; }

/* Intro */
body.yfp-style-latest-science-index .yfp-intro {
  padding: 16px 0 6px;
}
body.yfp-style-latest-science-index .yfp-intro__line {
  margin: 0;
  color: #334155;
  line-height: 1.55;
  font-size: 1.05rem;
}

/* Sections */
body.yfp-style-latest-science-index .yfp-section {
  padding: 14px 0 28px;
}
body.yfp-style-latest-science-index .yfp-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
body.yfp-style-latest-science-index .yfp-section__title {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

/* Grid */
body.yfp-style-latest-science-index .yfp-grid {
  display: grid;
  gap: 1rem;
}
body.yfp-style-latest-science-index .yfp-grid--featured {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
body.yfp-style-latest-science-index .yfp-grid--main {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Card */
body.yfp-style-latest-science-index .yfp-card {
  border: 1px solid var(--yfp-border);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  display: grid;
}
body.yfp-style-latest-science-index .yfp-card__media {
  display: block;
}
body.yfp-style-latest-science-index .yfp-card__img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
}
body.yfp-style-latest-science-index .yfp-card__img--placeholder {
  background: #f1f5f9;
  height: 170px;
  border-bottom: 1px dashed var(--yfp-border);
}
body.yfp-style-latest-science-index .yfp-card__body {
  padding: .85rem .9rem .9rem;
  display: grid;
  gap: .45rem;
}
body.yfp-style-latest-science-index .yfp-card__title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
}
body.yfp-style-latest-science-index .yfp-card__title a {
  color: inherit;
  text-decoration: none;
  font-weight: 760;
}
body.yfp-style-latest-science-index .yfp-card__title a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}
body.yfp-style-latest-science-index .yfp-card__summary {
  margin: 0;
  color: #334155;
  line-height: 1.45;
  font-size: .95rem;

  /* keep cards even-height-ish */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
body.yfp-style-latest-science-index .yfp-card__meta {
  color: var(--yfp-muted);
  font-weight: 650;
  font-size: .9rem;
}
body.yfp-style-latest-science-index .yfp-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .1rem;
}
body.yfp-style-latest-science-index .yfp-tag {
  display: inline-flex;
  align-items: center;
  padding: .18rem .5rem;
  border: 1px solid var(--yfp-border);
  border-radius: 999px;
  font-size: .82rem;
  color: #334155;
  background: #fff;
}

/* Pagination (same vibe as your other index pages) */
body.yfp-style-latest-science-index .yfp-pagination {
  margin-top: 1.25rem;
}
body.yfp-style-latest-science-index .yfp-pagination ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
body.yfp-style-latest-science-index .yfp-pagination a,
body.yfp-style-latest-science-index .yfp-pagination span {
  display: inline-block;
  border: 1px solid var(--yfp-border);
  border-radius: 10px;
  padding: .45rem .7rem;
  text-decoration: none;
  color: inherit;
  background: #fff;
}
body.yfp-style-latest-science-index .yfp-pagination .current {
  background: #f1f5f9;
  font-weight: 760;
}
body.yfp-style-latest-science-index .yfp-pagination a:hover { background:#f8fafc; }

body.yfp-style-latest-science-index .yfp-empty {
  padding: 1rem;
  border: 1px solid var(--yfp-border);
  border-radius: 14px;
  background: #fff;
}

/* Responsive: 2-up tablet, 1-up mobile */
@media (max-width: 980px) {
  body.yfp-style-latest-science-index .yfp-grid--featured,
  body.yfp-style-latest-science-index .yfp-grid--main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  body.yfp-style-latest-science-index .yfp-grid--featured,
  body.yfp-style-latest-science-index .yfp-grid--main {
    grid-template-columns: 1fr;
  }
  body.yfp-style-latest-science-index .yfp-card__img,
  body.yfp-style-latest-science-index .yfp-card__img--placeholder {
    height: 210px;
  }
}
