body,
html {
  height: 100%;
  width: 100%;
  font-family: hyundaisanshead-Medium, sans-serif;
  color: #003469;
  overflow-x: hidden;
  box-sizing: border-box;
  margin: 0 !important;
  padding: 0 !important;
}

main {
  margin-top: 61px;
  margin-bottom: 60px;
}

@media (min-width: 950px) {
  main {
    margin-top: 0;
  }
}

.banner {
  width: 100%;
  overflow: hidden;
}

.banner-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  margin-left: auto;
  margin-right: auto;
  aspect-ratio: 1280/520;
}

.container {
  max-width: 90vw;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

h1 {
  text-align: center;
  color: #003469;
  font-size: 3rem;
  line-height: 3.5rem;
  font-family: HyundaiHeadMedium, sans-serif;
}

h2 {
  margin-top: 20px;
  font-size: 24px;
  color: #333;
}

p {
  font-family: HyundaiTextReg, sans-serif;
}

.sub-heading {
  font-family: HyundaiSansHead-Light, sans-serif;
  font-weight: 600;
  font-size: 2.5rem;
  text-align: center;
  color: #003469;
  line-height: 3.5rem;
  margin: 2rem 0 1rem;
  position: relative;
  padding-bottom: 0.75rem;
}

.sub-heading::before {
  content: "";
  width: 7.9rem;
  height: 3px;
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  background: #003469;
}

.sub-description {
  font-size: 1.25rem;
  font-weight: 600;
  max-width: 1200px;
  text-align: center;
  color: #333;
  margin-inline: auto;
}

.description {
  margin-block: 2rem;
  color: #333;
  font-size: 1.25rem;
}

/* --- NEWS HUB LAYOUT --- */
.news-hub {
  margin-top: 2rem;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2.5rem 1.5rem;
  margin-block: 5rem;
}

@media (min-width: 1440px) {
  .news-grid {
    grid-template-columns:repeat(3, minmax(320px, 1fr));
    margin-inline: 5rem;
  }
}

/* --- ARTICLE CARDS --- */
.news-card {
  border: 1px solid #dbdbdb;
  display: flex;
  flex-direction: column;
  background-color: transparent;
}

.news-link {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  outline: none;
}

.news-link:focus .news-thumb {
  transform: scale(1.05);
  box-shadow: 0 0 0 3px #003469;
}

.news-link:hover {
  text-decoration: none;
}

.news-image-wrapper {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  position: relative;
  background-color: #f4f4f4;
}

.news-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  height: auto;
  display: block;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Image zoom effect on hover (Standard modern automotive styling) */
.news-link:hover .news-thumb,
.news-link:focus .news-thumb {
  transform: scale(1.05);
}

.news-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Pushes the "Read More" link to the bottom */
}

.news-category {
  font-family: HyundaiSansHead-Light, sans-serif;
  color: #333;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.news-title {
  font-family: HyundaiHeadMedium, sans-serif;
  font-size: 1.375rem;
  color: #003469;
  line-height: 1.3;
  margin: 0 0 0.5rem 0;
  transition: color 0.3s ease;
  white-space: pre-wrap;
}

.news-link:hover .news-title {
  color: #0052a6; /* Slightly lighter blue on hover */
}

.news-date {
  font-family: HyundaiTextReg, sans-serif;
  font-size: 0.875rem;
  color: #666;
}

.news-excerpt {
  font-size: 1rem;
  line-height: 1.6;
  color: #333;
  /* Truncate to 3 lines if it gets too long */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-more {
  font-family: HyundaiHeadMedium, sans-serif;
  font-size: 1rem;
  color: #003469;
  margin-top: auto;
  position: relative;
  display: inline-block;
  align-self: flex-start;
}

.read-more::after {
  content: "→";
  margin-left: 5px;
  transition: margin-left 0.3s ease;
}

.news-link:hover .read-more::after {
  margin-left: 10px; /* Arrow slides right on hover */
}

/* --- PAGINATION BUTTON --- */
.pagination-controls {
  text-align: center;
  margin-block: 4rem;
}

#load-more-btn {
  background-color: transparent;
  color: #003469;
  border: 2px solid #003469;
  padding: 1rem 3rem;
  font-family: HyundaiHeadMedium, sans-serif;
  font-size: 1rem;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
}

#load-more-btn:hover {
  background-color: #003469;
  color: #ffffff;
}

@media (max-width: 767px) {
  h1 {
    font-size: 2.5rem;
    line-height: 3rem;
    padding-bottom: 0;
    padding-right: 0;
  }
  .sub-heading {
    font-size: 2rem;
    line-height: 2rem;
  }
  .sub-description {
    font-size: 1.125rem;
    line-height: 1.68rem;
  }
  .description {
    font-size: 1.125rem;
    line-height: 1.68rem;
  }

  .banner-image {
    aspect-ratio: 18/9;
  }
}

/* --- ARTICLE DETAIL PAGE --- */

/* Narrower container for reading legibility */
.article-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 5vw; /* Failsafe padding for mobile */
}

.article-header {
  text-align: center;
  margin-bottom: 2rem;
}

.category-badge {
  display: inline-block;
  background-color: #003469;
  color: #fff;
  padding: 0.25rem 1rem;
  font-size: 0.875rem;
  font-family: HyundaiHeadMedium, sans-serif;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

#article-title {
  font-size: 2.5rem;
  line-height: 1.2;
  margin-bottom: 1rem;
  text-align: left; /* Optional: adjust if you prefer centered detail headers */
}

#article-date {
  display: block;
  font-family: HyundaiTextReg, sans-serif;
  color: #666;
  text-align: left;
}

.hero-image-container img {
  width: 100%;
  height: auto;
  aspect-ratio: 21/9; /* Wider, cinematic aspect ratio for hero images */
  object-fit: cover;
  margin-bottom: 3rem;
}

.article-body {
  font-family: HyundaiTextReg, sans-serif;
  font-size: 1.125rem;
  line-height: 1.8;
  color: #333;
}

.article-body h2 {
  font-family: HyundaiHeadMedium, sans-serif;
  color: #003469;
  font-size: 1.75rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.article-body p {
  margin-bottom: 1.5rem;
}

.article-body img {
  max-width: 100%;
  height: auto;
  margin: 2rem 0;
}

.back-link {
  margin-top: 4rem;
  border-top: 1px solid #ccc;
  padding-top: 2rem;
}

.back-link a {
  font-family: HyundaiHeadMedium, sans-serif;
  color: #003469;
  text-decoration: none;
  font-size: 1.125rem;
}

.back-link a:hover {
  text-decoration: underline;
}

/* Mobile Adjustments for Article */
@media (max-width: 767px) {
  #article-title {
    font-size: 2rem;
  }
  .article-body {
    font-size: 1rem;
    line-height: 1.6;
  }
  .hero-image-container img {
    aspect-ratio: 16/9;
  }
}
