/**
 * News & Articles Section - Identical to Reference
 * ref/rsmelati_layout structure
 */

.news-article-section {
  background-color: #f9fafb;
  padding: 32px 16px;
}

@media (min-width: 768px) {
  .news-article-section {
    padding: 64px 16px;
  }
}

.news-article-section .container {
  max-width: 1280px;
  margin: 0 auto;
}

/* Grid Layout: 2/3 for news, 1/3 for brochure */
.news-brochure-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

@media (min-width: 1024px) {
  .news-brochure-grid {
    grid-template-columns: 2fr 1fr;
    gap: 32px;
  }
}

/* News Column */
.news-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  overflow: hidden;
}

@media (min-width: 768px) {
  .news-column {
    gap: 24px;
  }
}

/* News Header */
.news-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

@media (min-width: 768px) {
  .news-header {
    margin-bottom: 16px;
  }
}

.news-header h2 {
  font-size: 24px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
}

@media (min-width: 768px) {
  .news-header h2 {
    font-size: 32px;
  }
}

.view-all-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #008c45;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.view-all-link:hover {
  text-decoration: underline;
  gap: 12px;
}

/* Mobile View All Link Container */
.view-all-link-mobile {
  display: none;
}

/* Desktop: Show in header, hide mobile container */
@media (min-width: 768px) {
  .news-header .view-all-link {
    display: flex;
  }
  
  .view-all-link-mobile {
    display: none !important;
  }
}

/* Mobile: Hide in header, show in mobile container */
@media (max-width: 767px) {

  .news-article-section {
    padding: 32px 0;
  }
  
  .news-article-section .container {
    padding-left: 16px !important;
    padding-right: 16px !important;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
  }
  
  .news-brochure-grid {
    overflow-x: hidden;
    max-width: 100%;
    width: 100%;
  }
  
  .news-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .news-header .view-all-link {
    display: none !important;
  }
  
  .view-all-link-mobile {
    display: block !important;
  }
  
  .view-all-link-mobile .view-all-link {
    display: inline-flex;
  }
  
  .featured-article,
  .regular-article {
    max-width: 100%;
    overflow: hidden;
  }
  
  .featured-image-wrapper,
  .article-thumbnail {
    max-width: 100%;
  }
  
  .featured-image-wrapper img,
  .article-thumbnail img {
    max-width: 100%;
    width: 100%;
    height: auto;
  }
  
  .article-title,
  .article-title-small,
  .article-excerpt,
  .article-excerpt-small {
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
  }
}

/* Featured Article */
.featured-article {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  margin-bottom: 16px;
  max-width: 100%;
}

@media (min-width: 768px) {
  .featured-article {
    margin-bottom: 24px;
  }
}

.featured-article:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.article-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.featured-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

@media (min-width: 768px) {
  .featured-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.featured-image-wrapper {
  position: relative;
  height: 192px;
  overflow: hidden;
}

@media (min-width: 768px) {
  .featured-image-wrapper {
    height: auto;
  }
}

.featured-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.featured-article:hover .featured-image-wrapper img {
  transform: scale(1.1);
}

.featured-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #ef4444;
  color: white;
  padding: 4px 8px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
}

@media (min-width: 768px) {
  .featured-badge {
    top: 16px;
    left: 16px;
    padding: 4px 12px;
    font-size: 14px;
  }
}

.featured-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (min-width: 768px) {
  .featured-content {
    padding: 24px;
  }
}

.article-category {
  display: inline-block;
  background: #008c45;
  color: white;
  padding: 4px 8px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 8px;
  width: fit-content;
}

@media (min-width: 768px) {
  .article-category {
    padding: 4px 12px;
    font-size: 14px;
    margin-bottom: 12px;
  }
}

.article-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 8px 0;
  line-height: 1.4;
  transition: color 0.3s ease;
}

@media (min-width: 768px) {
  .article-title {
    font-size: 24px;
    margin-bottom: 12px;
  }
}

.featured-article:hover .article-title {
  color: #008c45;
}

.article-excerpt {
  font-size: 14px;
  color: #4b5563;
  line-height: 1.6;
  margin: 0 0 12px 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (min-width: 768px) {
  .article-excerpt {
    margin-bottom: 16px;
  }
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .article-meta {
    gap: 16px;
    margin-bottom: 16px;
  }
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #6b7280;
}

.meta-item svg {
  flex-shrink: 0;
}

.meta-item span {
  line-clamp: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.read-more-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #008c45;
  font-size: 14px;
  font-weight: 500;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  width: fit-content;
  transition: all 0.3s ease;
}

@media (min-width: 768px) {
  .read-more-btn {
    font-size: 16px;
  }
}

.featured-article:hover .read-more-btn {
  text-decoration: underline;
  gap: 8px;
}

/* Regular Articles */
.regular-articles {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 100%;
}

@media (min-width: 768px) {
  .regular-articles {
    gap: 16px;
  }
}

.regular-article {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.regular-article:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.article-horizontal {
  display: flex;
  gap: 12px;
  padding: 12px;
  max-width: 100%;
  overflow: hidden;
}

@media (min-width: 768px) {
  .article-horizontal {
    gap: 16px;
    padding: 16px;
  }
}

.article-thumbnail {
  position: relative;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
}

@media (min-width: 768px) {
  .article-thumbnail {
    width: 128px;
    height: 128px;
  }
}

.article-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.regular-article:hover .article-thumbnail img {
  transform: scale(1.1);
}

.article-content-horizontal {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}

@media (min-width: 768px) {
  .article-content-horizontal {
    gap: 8px;
  }
}

.article-category-small {
  display: inline-block;
  background: #008c45;
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  width: fit-content;
}

@media (min-width: 768px) {
  .article-category-small {
    padding: 4px 8px;
    font-size: 12px;
  }
}

.article-title-small {
  font-size: 14px;
  font-weight: 500;
  color: #1a1a1a;
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.3s ease;
}

@media (min-width: 768px) {
  .article-title-small {
    font-size: 16px;
  }
}

.regular-article:hover .article-title-small {
  color: #008c45;
}

.article-excerpt-small {
  font-size: 12px;
  color: #4b5563;
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (min-width: 768px) {
  .article-excerpt-small {
    font-size: 14px;
  }
}

.article-meta-small {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #6b7280;
  flex-wrap: wrap;
}

.meta-separator {
  opacity: 0.5;
}

.meta-author {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: none;
}

@media (min-width: 768px) {
  .meta-author {
    display: inline;
  }
}

/* Mobile View All Button */
.mobile-view-all {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px auto 0;
  color: #008c45;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

@media (min-width: 768px) {
  .mobile-view-all {
    display: none;
  }
}

.mobile-view-all:hover {
  text-decoration: underline;
  gap: 12px;
}

@media (min-width: 768px) {
  .mobile-view-all {
    margin-top: 24px;
  }
}
