/* Banner */
.news-banner-archive {
    position: relative;
    width: 100%;
    height: 800px; /* adjust as needed */
    overflow: hidden;
}

.news-banner-archive picture,
.news-banner-archive img.news-banner-image {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 120%; /* slightly taller for parallax movement */
    object-fit: cover;
    will-change: transform;
}

.news-banner-archive h1 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 3rem;
    text-align: center;
    margin: 0;
    z-index: 2;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.5);
}

/* Parallax scroll effect */
body:not(.admin-bar) .news-banner-archive {
    perspective: 1px;
}

/* article list content */
.goodlife-archive-wrapper{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 158px;
    padding:  80px 0;
    margin: 0 160px;
}

.good-life-content h5{
    max-height: 90px;
    height: 100%;
    color: #001845;
}

.article-header p{
    font-family: var(--font-henry);
    font-size: 24px;
    font-weight: 300;
}

.good-life-news-list{
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.good-life-item{
    display: flex;
    flex-direction: column;
    gap: 23px;
    max-width: 400px;
    width: 100%;
}

.good-life-thumb {
    width: 400px;
    height: 400px;
    border-radius: 8px;
    overflow: hidden; /* ensures the image doesn't overflow the box */
}

.good-life-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: left center; /* shifts image to show left side */
    border-radius: 8px;
    transition: transform 0.5s ease;
}

.good-life-thumb img:hover {
    transform: scale(1.05);
    transition: transform 0.5s ease;
}

.date{
    font-family: var(--font-henry);
    font-size: 16px;
    font-style: normal;
    font-weight: 300;
    line-height: normal;
    margin: 10px 0;
}

.subtitle{
    margin-bottom: 31px;
    width: 100%;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    line-clamp: 2; /* limit to 2 lines */
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4; /* adjust if needed to match your design */
    max-height: calc(1.4em * 2);
}

.news-btn-archive {
  position: relative;
  font-size: 16px;
  text-decoration: none;
  color: #2b2b2b;
  padding: 12px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* SVG overlay */
.news-btn-archive svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Border stroke */
.news-btn-archive rect {
  fill: none;
  stroke: #001845;
  stroke-width: 2px;
  /* Rounded corners */
  rx: 8;
  ry: 8;
  /* perimeter = (100 + 40) * 2 = 280 */
  stroke-dasharray: 280;
  stroke-dashoffset: 280;
  transition: stroke-dashoffset 1s linear;
}

/* Hover animation */
.news-btn-archive:hover rect {
  stroke-dashoffset: 0;
}

.load-more-btn {
    width: 140px;
    height: 40px;
    border-radius: 5px;
    background-color: #CA9C57;
    color: #ffffff;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: background 0.5s ease-in-out;
}

/* ---------- TABLET (≤1024px) ---------- */
@media (max-width: 1024px) {
    .news-banner-archive {
        height: 600px;
    }

    .goodlife-archive-wrapper {
        gap: 120px;
        margin: 0 60px;
        padding: 60px 0;
    }

    .article-header p {
        font-size: 20px;
    }

    .good-life-news-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .good-life-item {
        max-width: 100%;
        gap: 18px;
    }

    .good-life-content {
        font-size: 20px;
    }

    .good-life-thumb {
        height: 420px;
    }

    .date {
        font-size: 14px;
        margin-bottom: 10px;
    }

    .subtitle {
        font-size: 18px;
        line-height: 1.3;
        margin-bottom: 24px;
    }

    .news-btn {
        font-size: 14px;
    }
}

/* ---------- MOBILE (≤768px) ---------- */
@media (max-width: 768px) {
    .news-banner-archive {
        height: 320px;
    }

    .news-banner-archive picture,
    .news-banner-archive img.news-banner-image {
        height: 100%; /* remove extra parallax height on mobile */
        transform: translateX(-50%);
    }

  .news-banner-archive h1 {
    font-size: 1.8rem;
    line-height: 1.3;
    padding: 0 16px;
  }

    .goodlife-archive-wrapper {
        gap: 80px;
        margin: 0 20px;
        padding: 40px 0;
    }

    .article-header p {
        font-size: 18px;
        text-align: center;
    }

    .good-life-news-list {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .good-life-item {
        width: 100%;
        gap: 16px;
    }

    .good-life-content {
        font-size: 18px;
    }

    .good-life-thumb {
        height: 300px;
    }

    .date {
        font-size: 12px;
        margin-bottom: 8px;
    }

    .subtitle {
        font-size: 16px;
        line-height: 1.3;
        margin-bottom: 20px;
    }

    .news-btn {
        font-size: 14px;
        width: 100%;
        text-align: center;
    }
}

