/* Base layout */
.page {
  position: relative;
  width: 100%;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.media-container {
  width: 100%;
  background: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
}

.media-content {
  width: 100%;
  max-width: 1920px;
  padding: 80px 5%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Tabs */
.media-tabs {
  display: flex;
  gap: 20px;
  margin-bottom: 60px;
}

.tab-item {
  border-radius: 19px;
  height: 38px;
  min-width: 116px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.3s;
}

.tab-item.active {
  background-color: #3d9d3d;
  border-color: #3d9d3d;
}

.tab-item:not(.active) {
  border-color: #545454;
}

.tab-text {
  font-size: 16px;
  font-family: MicrosoftYaHei;
  white-space: nowrap;
}

.tab-item.active .tab-text {
  color: #ffffff;
}

.tab-item:not(.active) .tab-text {
  color: #000000;
}

/* Grid Layout */
.media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 1600px;
  margin-bottom: 60px;
}

/* Media Item Container */
.media-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

/* Media Cover (Image or Background Image) */
.media-cover {
  width: 100%;
  aspect-ratio: 528 / 375; /* Keep original proportion */
  box-sizing: border-box;
  background-color: #E9E7E6; /* Default gray background */
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  display: flex;
  padding: 27px 28px;
}

.card-tag {
  background-color: #000000;
  border-radius: 15px;
  padding: 5px 15px;
  display: inline-flex;
  align-self: flex-start;
}

.tag-text {
  color: #ffffff;
  font-size: clamp(14px, 1.5vw, 21px);
  font-family: MicrosoftYaHei;
}

/* Media Text Section */
.media-text {
  width: 100%;
  aspect-ratio: 528 / 255;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 29px 25px 23px;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  box-sizing: border-box;
}

.card-category {
  font-size: 17px;
  font-family: MicrosoftYaHei;
}

.card-title {
  font-size: clamp(18px, 2vw, 28px);
  font-family: MicrosoftYaHei;
  line-height: 1.4;
  margin: 15px 0;
  flex-grow: 1;
}

.card-date {
  font-size: 18px;
  font-family: AcuminConcept-SemiCondensed;
}

/* Specific Text Card Styles */
.card-light {
  background-color: #D0D0D0;
  color: #545454;
  transition: background-color 0.3s, color 0.3s;
}

.media-item:hover .card-light {
  background-color: #3D9D3D;
  color: #ffffff;
}

/* Discover More Button */
.btn-discover-more {
  color: #ababab;
  font-size: 21px;
  font-family: MicrosoftYaHei;
  cursor: pointer;
  align-self: center;
  margin-top: 20px;
}

/* Media Queries for Responsive Design */
@media (max-width: 1024px) {
  .media-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .media-content {
    padding: 50px 5%;
  }

  .media-tabs {
    flex-direction: row;
    gap: 10px;
    width: 100%;
    justify-content: center;
  }

  .tab-item {
    min-width: auto;
    flex: 1;
    max-width: 150px;
  }

  .media-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .btn-discover-more {
    align-self: center;
  }
}
