.news-wrapper {
  
}

.news-card {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.2s;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
  position: relative;
}

.news-card:hover {
  transform: translateY(-5px);
  cursor: pointer;
}

.news-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.news-card-content {
  padding: 15px;
}

.news-card-title {
  font-size: 1.5em;
  margin-bottom: 10px;
}

.news-card-excerpt {
  font-size: 1em;
  color: #555;
}

.news-container {
  margin: 6rem 2rem;
  max-width: 1180px;
}

.news-title {
  font-size: 2.25rem;
  line-height: 1.05;
  margin: 0 0 0.5rem 0;
  font-weight: 800;
}

.news-sub {
  margin: 0;
  color: #848b99;
  font-size: 1.125rem;
  margin-bottom: 1.5rem;
}

.news-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  padding-bottom: 2rem;
}

.news-media {
  height: 12rem;
  aspect-ratio: 2 / 1;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.news-media-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 14px;
  background: linear-gradient(90deg, var(--gradient-color-1), var(--gradient-color-2));
  transition: opacity 0.4s ease, filter 0.4s ease, transform 0.4s ease;
}

.news-card:hover .news-see-full {
  opacity: 0.85;
}

.news-card:hover .news-media-img {
  filter: brightness(75%);
}

.news-body {
  height: 100%;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.news-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 3;
}

.news-meta-info {
  margin-top: auto;
  display: flex;
  align-items: center;
}

.news-tag {
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: linear-gradient(125deg, #eb9aff, var(--main-color));
}

.news-tag p {
  color: white;
}

.news-see-full {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  opacity: 0;
  font-family: 'Rubik';
  font-weight: 600;
  font-size: 1.25rem;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.news-date {
  font-size: 0.9rem;
  color: var(--third-main);
  margin: auto 0 0 auto;
}

.news-heading {
  font-size: 1.125rem;
  margin: 0;
  font-weight: 800;
  color: white;
}

.news-excerpt {
  margin: 0;
  color: var(--second-main);
}

.news-popup-container {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 8;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(1px) brightness(66%);
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, backdrop-filter 0.4s ease, background 0.4s ease, visibility 0.4s ease;
  pointer-events: none;
}

.news-popup-container.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.news-popup {
  border: 1px solid rgba(255, 255, 255, 0.1); 
  background: var(--bg-card-drk);
  border-radius: 2rem;
  backdrop-filter: blur(8px);
  position: relative;
  box-sizing: border-box;
  width: 90vw;
  max-width: 1024px;
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* Internet Explorer and Edge */
  transform: translateY(20px) scale(0.95);
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.news-popup-container.active .news-popup {
  transform: translateY(0) scale(1);
}

.news-popup::-webkit-scrollbar {
  display: none;
}

.news-popup-close {
  position: sticky;
  top: 1rem;
  right: 1rem;
  z-index: 16;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--bg-card-drk-snd);
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  margin-left: auto;
  margin-top: -3rem;
}

.news-popup-close:hover {
  background: var(--bg-card-drk);
}

.news-popup-close img {
  width: 1.5rem;
  height: 1.5rem;
}

.news-popup-img {
  aspect-ratio: 2 / 1;
  position: relative;
  overflow: hidden;
  border-radius: inherit;
}

.news-popup-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: linear-gradient(90deg, var(--gradient-color-1), var(--gradient-color-2));
}

.news-popup-title {
  padding: 0.75rem 0 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin: 0 0 0.5rem 0;
}

.news-popup-date-container {
  display: flex;
  align-items: center;  
  gap: 0.5rem;
  color: var(--second-main);
}

.news-popup-content {
  padding: 1.5rem;
}

.news-popup-buttons {
  padding: 0 1.5rem 1.5rem 1.5rem;
  width: 100%;
}

/* Custom styling for news content */
.news-popup-content code {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  color: white;
}

.news-popup-content pre {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
}

.news-popup-content pre code {
  background: none;
  padding: 0;
  color: #e2e8f0;
  font-size: 0.875rem;
  line-height: 1.5;
}

.news-popup-content img {
  border-radius: 8px;
  max-width: 100%;
  height: auto;
  margin: 0.5rem 0;
}

.news-popup-content a {
  color: #3b82f6;
  text-decoration: underline;
}

.news-popup-content a:hover {
  color: #60a5fa;
}

.share-knp {
  max-width: 9rem;
  background: linear-gradient(90deg, var(--gradient-color-1), var(--gradient-color-2));
  color: white;
  border-radius: 10rem;
  padding: 0.125rem;
  font-weight: 600;
  cursor: pointer;
}

.share-knp-text {
  display: flex;
  justify-content: center;
  align-items: center ;
  background-color: var(--dark-bg);
  text-align: center;
  border-radius: 10rem;
  padding: 0.875rem 2.8125rem;
  transition: all .2s;
  overflow: hidden;
}

.share-knp-text img {
  width: 1rem;
  margin-right: 0.25rem;
}

.share-knp-text:hover {
  background: var(--hover-button);
}

.share-knp-text {
  padding: 0.45rem 0.8rem 0.45rem 0.8rem;
}

@media (min-width:768px) {
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width:1024px) {
  .news-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}


.news-error-section {
  display: flex;
  text-align: center;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  padding: 2rem;
}

.news-error-code {
  font-family: 'Rubik', sans-serif;
  font-weight: 700;
  font-size: 8rem;
  margin: 0 auto;
  width: max-content;
  height: 8.5rem;
  background: linear-gradient(90deg, var(--gradient-color-1), var(--gradient-color-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.news-error-message {
  font-family: 'Inter', sans-serif;
  font-size: 2rem;
  font-weight: 500;
  color: white;
  margin: 0;
}

.news-error-message.sml {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  color: #d8d3ff;
  margin: 0.5rem 0 1.5rem 0;
  max-width: 30rem;
  line-height: 1.5;
}

.knp-news {
  display: block;
  width: max-content;
  background: linear-gradient(90deg, var(--gradient-color-1), var(--gradient-color-2));
  color: white;
  border-radius: 10rem;
  padding: 0.125rem;
  font-weight: 600;
  cursor: pointer;
}

.knp-news-text {
  background-color: var(--dark-bg);
  text-align: center;
  border-radius: 10rem;
  padding: 0.715rem 1.85rem;
  transition: all .2s;
  overflow: hidden;
  user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
}

.knp-news-text:hover {
  background: var(--hover-button);
}


@media (max-width:680px) {
  .news-container {
    margin: 6rem 2rem 11rem;
  }
}