/**
 * ATC Homepage
 * Lightweight homepage-only refinements.
 * Version 1.7.2: premium blog/latest-post cards.
 */

/* ==========================================================
   HOMEPAGE BLOG / LATEST POSTS
   Scoped to the front-page body class so no archive or post
   layout is affected.
========================================================== */

.atc-homepage .news {
  background: #f7f8f6;
}

.atc-homepage .news > .container > p {
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
  color: #5f685f;
  line-height: 1.65;
}

.atc-homepage .news > .container > .flex {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 24px;
}

.atc-homepage .news .news-item {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  min-width: 0;
  width: auto !important;
  margin-bottom: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #e5e9e3;
  border-radius: 18px;
  box-shadow: 0 8px 26px rgba(24, 40, 24, 0.06);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.atc-homepage .news .news-item:hover {
  transform: translateY(-4px);
  border-color: #dce3d8;
  box-shadow: 0 14px 32px rgba(24, 40, 24, 0.10);
}

.atc-homepage .news .news-item > .wrapper {
  width: 100%;
  border-radius: 0;
  overflow: hidden;
  background: #e9ede7;
}

.atc-homepage .news .news-item-img {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #e9ede7;
  aspect-ratio: 16 / 10;
}

.atc-homepage .news .news-item-img img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 10 !important;
  object-fit: cover;
  object-position: center;
  transition: transform 0.35s ease;
}

.atc-homepage .news .news-item:hover .news-item-img img {
  transform: scale(1.025);
}

.atc-homepage .news .news-item-link {
  z-index: 2;
}

.atc-homepage .news .news-item-category {
  position: absolute !important;
  z-index: 3;
  left: 16px;
  right: auto;
  bottom: 16px;
  top: auto;
  display: inline-flex;
  align-items: center;
  max-width: calc(100% - 32px);
  padding: 7px 11px;
  background: rgba(247, 251, 242, 0.96);
  color: #4e7429 !important;
  border: 1px solid rgba(88, 125, 48, 0.14);
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(22, 35, 20, 0.08);
  font-size: 11px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.atc-homepage .news .news-item-category a,
.atc-homepage .news .news-item-category .cat-links,
.atc-homepage .news .news-item-category .cat-links a {
  color: #4e7429 !important;
  text-decoration: none;
}

.atc-homepage .news .news-item-title {
  display: flex;
  flex: 1 1 auto;
  align-items: flex-start;
  width: 100%;
  margin: 0 !important;
  padding: 20px 21px 24px;
  background: #ffffff;
}

.atc-homepage .news .news-item-title h3 {
  display: -webkit-box;
  width: 100%;
  margin: 0;
  overflow: hidden;
  color: #171b17 !important;
  font-size: clamp(1.3rem, 1.7vw, 1.72rem) !important;
  line-height: 1.28 !important;
  font-weight: 600;
  letter-spacing: -0.018em;
  text-align: left;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

/* Keep the existing View All link, but make it visually consistent. */
.atc-homepage .news > .container > .text-center.mt-12 a {
  border: 1px solid #5f8f37 !important;
  border-radius: 999px;
  background: #5f8f37 !important;
  color: #ffffff !important;
  box-shadow: none;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.atc-homepage .news > .container > .text-center.mt-12 a:hover,
.atc-homepage .news > .container > .text-center.mt-12 a:focus-visible {
  background: #ffffff !important;
  color: #4e7429 !important;
  transform: translateY(-1px);
}

@media (max-width: 900px) {
  .atc-homepage .news > .container > .flex {
    flex-wrap: wrap;
    gap: 20px;
  }

  .atc-homepage .news .news-item {
    flex: 1 1 calc(50% - 10px);
  }
}

@media (max-width: 620px) {
  .atc-homepage .news > .container > .flex {
    display: block;
  }

  .atc-homepage .news .news-item {
    width: 100% !important;
    margin-bottom: 20px !important;
    border-radius: 16px;
  }

  .atc-homepage .news .news-item:last-child {
    margin-bottom: 0 !important;
  }

  .atc-homepage .news .news-item-title {
    padding: 18px 18px 21px;
  }

  .atc-homepage .news .news-item-title h3 {
    font-size: 1.35rem !important;
    line-height: 1.3 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .atc-homepage .news .news-item,
  .atc-homepage .news .news-item-img img,
  .atc-homepage .news > .container > .text-center.mt-12 a {
    transition: none;
  }

  .atc-homepage .news .news-item:hover,
  .atc-homepage .news .news-item:hover .news-item-img img {
    transform: none;
  }
}
