/*
 * ============================================================
 * NEWS SECTION  —  news.css
 * ============================================================
 * Homepage "From The Field" section.
 *
 * Layout:  A2 grid — featured card (left, 2/3) + two side
 *          cards stacked (right, 1/3).
 *
 * Image zoom on hover is handled here via CSS transition.
 * Card lift on hover (box-shadow + translateY) also here.
 *
 * To show more posts     →  update 'posts_per_page' in section-news.php
 * To change card corners →  --rg-radius-card in variables.css
 * ============================================================
 */

.news-section {
  background: var(--rg-bg);
  padding: 52px 0;
}

.news-inner {
  max-width: var(--rg-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Section heading row ----------------------------------- */
.news-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.news-label {
  font-family: var(--rg-font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rg-muted);
  white-space: nowrap;
}

.news-rule {
  flex: 1;
  height: 0.5px;
  background: rgba(0, 0, 0, 0.12);
}

.news-all {
  font-family: var(--rg-font-body);
  font-size: 10px;
  font-weight: 600;
  color: var(--rg-green-lime);
  text-decoration: none;
  white-space: nowrap;
}

.news-all:hover { text-decoration: underline; }

/* --- A2 grid ----------------------------------------------- */
.news-a2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
}

/* --- Base card --------------------------------------------- */
.news-card {
  background: var(--rg-card);
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--rg-radius-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition:
    box-shadow 0.3s ease,
    transform  0.3s ease;
}

.news-card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.10);
  transform: translateY(-2px);
}

/* --- Image wrap (zoom on hover) ---------------------------- */
.news-card__img-wrap {
  overflow: hidden;   /* clips the scaled image */
  flex-shrink: 0;
}

.news-card--featured .news-card__img-wrap { height: 220px; }
.news-card--side     .news-card__img-wrap { height:  80px; }

.news-card__img-wrap img,
.news-card__img-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* The zoom */
.news-card:hover .news-card__img-wrap img,
.news-card:hover .news-card__img-fallback {
  transform: scale(1.06);
}

/* --- Card body --------------------------------------------- */
.news-card__body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.news-card--side .news-card__body {
  padding: 10px 12px;
  gap: 4px;
}

/* Category tag pill */
.news-tag {
  font-family: var(--rg-font-body);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rg-invert);
  background: var(--rg-green-lime);
  border-radius: 99px;
  padding: 2px 9px;
  align-self: flex-start;
  display: inline-block;
}

/* Post title */
.news-card__title {
  font-family: var(--rg-font-display);
  font-weight: 400;
  line-height: 1.3;
  color: var(--rg-charcoal);
  margin: 0;
}

.news-card--featured .news-card__title { font-size: 18px; }
.news-card--side     .news-card__title { font-size: 13px; }

.news-card__title a {
  color: inherit;
  text-decoration: none;
}

.news-card__title a:hover { color: var(--rg-green-dark); }

/* Excerpt (featured card only) */
.news-card__exc {
  font-family: var(--rg-font-body);
  font-size: 13px;
  color: var(--rg-body);
  line-height: 1.6;
  margin: 0;
}

/* Date + reading time */
.news-card__meta {
  font-family: var(--rg-font-body);
  font-size: 10px;
  color: var(--rg-muted);
  margin-top: auto;
  padding-top: 4px;
}

/* --- Side cards stacked ------------------------------------ */
.news-sides {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* --- Mobile ------------------------------------------------ */
@media (max-width: 640px) {
  .news-a2   { grid-template-columns: 1fr; }
  .news-sides{ display: contents; }
  .news-card--featured .news-card__img-wrap { height: 180px; }
}


/* --- Post card image (img tag, not background) ------------ */
/*
 * post-card.php now outputs an <img> tag inside .post-img.
 * This ensures it fills the card exactly like a background would.
 */
.post-img {
  overflow: hidden;
  flex-shrink: 0;
}

.post-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.post-card:hover .post-img img {
  transform: scale(1.06);
}

/* Gradient fallback fills the same space */
.post-img-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* ============================================================
 * NEWS – Row 2 tile grid (posts 4–6) & View All button
 * ============================================================ */

.news-tile-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.news-card--tile .news-card__img-wrap { height: 160px; }

.news-card--tile .news-card__title { font-size: 15px; }

.news-card--tile .news-card__exc {
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* View All button row */
.news-view-all-wrap {
  text-align: center;
  margin-top: 36px;
  padding-bottom: 8px;
}

/* Mobile */
@media (max-width: 640px) {
  .news-tile-row { grid-template-columns: 1fr; }
}

/* ── NEWS LISTING (home.php) ─────────────────────────────────
   Page 1 leads with the newest post as a large feature card
   (reuses .latest-post-card from the homepage), then older
   posts stack in this compact list. */
.news-feature { margin-bottom: 48px; }

.news-list-heading {
  font-family: var(--rg-font-display);
  font-size: 22px;
  font-weight: 400;
  color: var(--rg-charcoal);
  margin: 0 0 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 40px;
}

.news-list-item {
  display: flex;
  gap: 22px;
  background: var(--rg-card);
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--rg-radius-card);
  overflow: hidden;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.news-list-item:hover {
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

.news-list-thumb {
  flex: 0 0 190px;
  min-height: 132px;
  background-size: cover;
  background-position: center;
  display: block;
}

.news-list-body {
  padding: 18px 22px 18px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.news-list-title {
  font-family: var(--rg-font-display);
  font-size: 19px;
  font-weight: 400;
  line-height: 1.25;
  margin: 0;
}
.news-list-title a { color: var(--rg-charcoal); text-decoration: none; }
.news-list-title a:hover { color: var(--rg-green-lime); }

.news-list-exc {
  font-family: var(--rg-font-body);
  font-size: 13.5px;
  color: var(--rg-body);
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-list-meta {
  font-family: var(--rg-font-body);
  font-size: 12px;
  color: var(--rg-muted);
  margin-top: auto;
}

@media (max-width: 640px) {
  .news-list-item { flex-direction: column; gap: 0; }
  .news-list-thumb { flex-basis: auto; width: 100%; height: 160px; }
  .news-list-body { padding: 16px 18px 18px; }
}
