/* News Section CSS - Based on Next.js Original */
.news-section {
  position: relative;
  padding: 1rem 0 2rem 0;
  width: 100%;
  min-height: 80vh;
  box-sizing: border-box;
  background-color: #12161f;
}

.news-section::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background-image: url('/images/F1_Background.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.news-section::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: linear-gradient(
    90deg,
    rgba(18, 22, 31, 0.8) 0%,
    rgba(18, 22, 31, 0.4) 50%,
    rgba(18, 22, 31, 0.8) 100%
  );
}

.news-container {
  position: relative;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1rem;
  box-sizing: border-box;
  z-index: 2;
}

.title-section {
  margin-bottom: 1rem;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.title-section img {
  max-width: 100%;
  height: auto;
  max-height: 120px;
  display: block;
  margin: 0 auto;
}

.main-content {
  display: flex;
  gap: 2rem;
  width: 100%;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 400px;
  box-sizing: border-box;
  transition: min-height 0.3s ease-in-out;
}

.left-column {
  flex: 7;
  min-width: 0;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  position: relative;
}

.right-column {
  flex: 5;
  min-width: 0;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* News Hero Styles */
.news-hero {
  width: 100%;
  height: 100%;
  min-height: 400px;
  position: relative;
}

.hero-content {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 400px;
  border-radius: 8px;
  overflow: hidden;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  padding: 2rem;
  color: white;
}

.category-label {
  background: #dc2626;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
}

.hero-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 0.5rem 0;
  line-height: 1.3;
}

.hero-excerpt {
  font-size: 0.9rem;
  margin: 0.5rem 0;
  opacity: 0.9;
  line-height: 1.4;
}

.hero-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  margin: 0.5rem 0;
  opacity: 0.8;
}

.hero-link {
  display: inline-block;
  background: #dc2626;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  margin-top: 0.5rem;
  transition: background 0.3s ease;
}

.hero-link:hover {
  background: #b91c1c;
}

/* Empty state in hero content */
.hero-content .empty-state {
  min-height: 400px;
  height: 100%;
}

/* News Sidebar Styles */
.news-sidebar {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 400px; /* Prevent layout shift */
}

.tab-navigation {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 1rem;
  flex-shrink: 0; /* Prevent navigation from moving */
  position: relative; /* Maintain position */
}

.tab-button {
  background: none;
  border: none;
  color: white;
  padding: 0.5rem 0;
  margin-right: 1rem;
  cursor: pointer;
  position: relative;
  font-size: 0.875rem;
  text-transform: uppercase;
  transition: color 0.2s;
}

.tab-button:hover {
  color: #dc2626;
}

.tab-button.active {
  color: #dc2626;
}

.tab-button.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #dc2626;
}

.news-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
  min-height: 280px; /* Use min-height to maintain space */
  max-height: 360px; /* Cap the maximum height - enough for 4 items */
  overflow-y: auto; /* Allow scrolling if content exceeds */
  transition: opacity 0.2s ease-in-out;
  position: relative;
}

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

.news-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 0.75rem;
  transition: all 0.3s ease;
  display: flex;
  gap: 0.75rem;
}

.news-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.card-thumbnail {
  width: 80px;
  height: 60px;
  flex-shrink: 0;
}

.card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.card-content .category-label {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
}

.card-title {
  font-size: 0.9rem;
  font-weight: bold;
  margin: 0;
  line-height: 1.3;
  color: white;
}

.publish-date {
  font-size: 0.75rem;
  opacity: 0.7;
  color: white;
}

.view-more-button {
  align-self: flex-end;
  margin-top: 1rem;
  color: #dc2626;
  text-decoration: none;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.view-more-button:hover {
  color: #9b3216;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 280px; /* Match news-list height to prevent layout shift */
  text-align: center;
  padding: 2rem 1rem;
  box-sizing: border-box;
  flex: 1; /* Fill available space */
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.empty-message {
  font-size: 1.125rem;
  font-weight: 600;
  color: white;
  margin: 0 0 0.5rem 0;
}

.empty-subtext {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
}

/* Visually Hidden */
.visually-hidden-h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .news-container {
    padding: 0 0.75rem;
  }
  
  .main-content {
    gap: 1.75rem;
    min-height: 380px;
  }
  
  .left-column {
    min-height: 380px;
  }
  
  .right-column {
    min-height: 380px;
  }
  
  .news-hero {
    min-height: 380px;
  }
  
  .hero-content {
    min-height: 380px;
  }
  
  .hero-content .empty-state {
    min-height: 380px;
  }
  
  .title-section {
    margin-bottom: 1.75rem;
  }
  
  .news-list {
    min-height: 260px;
    max-height: 340px;
    gap: 0.625rem;
  }
  
  .empty-state {
    min-height: 260px;
    padding: 1.75rem 1rem;
  }
  
  .empty-icon {
    font-size: 2.75rem;
  }
  
  .empty-message {
    font-size: 1.0625rem;
  }
}

@media (max-width: 1024px) {
  .news-section {
    padding: 3.5rem 0 1.5rem 0;
    min-height: 75vh;
  }
  
  .news-container {
    padding: 0 0.75rem;
  }
  
  .main-content {
    gap: 1.5rem;
    min-height: 350px;
  }
  
  .left-column {
    flex: 65;
    min-height: 350px;
  }
  
  .right-column {
    flex: 35;
    min-height: 350px;
  }
  
  .news-hero {
    min-height: 350px;
  }
  
  .hero-content {
    min-height: 350px;
  }
  
  .hero-content .empty-state {
    min-height: 350px;
  }
  
  .title-section {
    margin-bottom: 1.5rem;
  }
  
  .title-section img {
    max-height: 100px;
    display: block;
    margin: 0 auto;
  }
  
  .news-list {
    min-height: 240px;
    max-height: 320px;
    gap: 0.5rem;
  }
  
  .empty-state {
    min-height: 240px;
    padding: 1.5rem 1rem;
  }
  
  .empty-icon {
    font-size: 2.5rem;
  }
  
  .empty-message {
    font-size: 1rem;
  }
}

@media (max-width: 900px) {
  .news-section {
    padding: 3rem 0 1rem 0;
    min-height: 70vh;
  }
  
  .news-container {
    padding: 0 0.625rem;
  }
  
  .main-content {
    gap: 1.25rem;
    min-height: 320px;
  }
  
  .left-column {
    flex: 6;
    min-height: 320px;
  }
  
  .right-column {
    flex: 4;
    min-height: 320px;
  }
  
  .news-hero {
    min-height: 320px;
  }
  
  .hero-content {
    min-height: 320px;
  }
  
  .hero-content .empty-state {
    min-height: 320px;
  }
  
  .title-section {
    margin-bottom: 1.25rem;
  }
  
  .title-section img {
    max-height: 90px;
    display: block;
    margin: 0 auto;
  }
  
  .news-list {
    min-height: 220px;
    max-height: 300px;
    gap: 0.5rem;
  }
  
  .empty-state {
    min-height: 220px;
    padding: 1.25rem 0.75rem;
  }
  
  .empty-icon {
    font-size: 2.25rem;
  }
  
  .empty-message {
    font-size: 0.9375rem;
  }
}

@media (max-width: 768px) {
  .news-section {
    padding: 2.5rem 0 1rem 0;
    min-height: 65vh;
  }
  
  .news-container {
    padding: 0 1rem;
  }
  
  .main-content {
    flex-direction: column;
    gap: 1rem;
    min-height: auto;
  }
  
  .left-column {
    flex: none;
    width: 100%;
    min-height: 300px;
  }
  
  .right-column {
    flex: none;
    width: 100%;
    min-height: 340px;
  }
  
  .news-hero {
    min-height: 300px;
  }
  
  .hero-content {
    min-height: 300px;
  }
  
  .hero-content .empty-state {
    min-height: 300px;
  }
  
  .title-section {
    margin-bottom: 1rem;
  }
  
  .title-section img {
    max-height: 80px;
    display: block;
    margin: 0 auto;
  }
  
  .tab-navigation {
    margin: 0 1rem 1rem 1rem; /* Add horizontal margins for mobile */
  }
  
  .tab-button {
    font-size: 0.75rem;
    margin-right: 0.75rem;
    padding: 0.4rem 0;
  }
  
  .news-list {
    min-height: 280px;
    max-height: 360px;
    gap: 0.5rem;
    margin: 0.75rem 0;
  }
  
  .empty-state {
    min-height: 280px;
    padding: 1rem 0.75rem;
  }
  
  .empty-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
  }
  
  .empty-message {
    font-size: 0.875rem;
  }
  
  .empty-subtext {
    font-size: 0.8125rem;
  }
}

@media (max-width: 640px) {
  .news-section {
    padding: 3.5rem 0;
    min-height: 75vh;
  }
  
  .news-container {
    padding: 0 0.75rem;
  }
  
  .main-content {
    gap: 1.25rem;
    min-height: 55vh;
  }
  
  .left-column {
    min-height: 350px;
  }
  
  .right-column {
    min-height: 340px;
  }
  
  .news-hero {
    min-height: 350px;
  }
  
  .hero-content {
    min-height: 350px;
  }
  
  .hero-content .empty-state {
    min-height: 350px;
  }
  
  .tab-navigation {
    margin: 0 0.75rem 1rem 0.75rem; /* Reduced margins for smaller screens */
  }
  
  .news-list {
    min-height: 240px;
    max-height: 340px;
    gap: 0.375rem;
    margin: 0.5rem 0;
  }
  
  .view-more-button {
    font-size: 0.8125rem;
    margin-top: 0.625rem;
  }
  
  .empty-state {
    min-height: 240px;
    padding: 0.875rem 0.5rem;
  }
}

@media (max-width: 480px) {
  .news-section {
    padding: 2rem 0 0.5rem 0;
    min-height: 60vh;
  }
  
  .news-container {
    padding: 0 0.75rem;
  }
  
  .main-content {
    gap: 0.75rem;
    min-height: auto;
  }
  
  .left-column {
    min-height: 280px;
  }
  
  .right-column {
    min-height: 320px;
  }
  
  .news-hero {
    min-height: 280px;
  }
  
  .hero-content {
    min-height: 280px;
  }
  
  .hero-content .empty-state {
    min-height: 280px;
  }
  
  .title-section {
    margin-bottom: 0.75rem;
  }
  
  .title-section img {
    max-height: 70px;
    display: block;
    margin: 0 auto;
  }
  
  .tab-navigation {
    margin: 0 0.75rem 1rem 0.75rem; /* Keep consistent spacing */
  }
  
  .tab-button {
    font-size: 0.7rem;
    margin-right: 0.5rem;
    padding: 0.35rem 0;
  }
  
  .news-list {
    min-height: 220px;
    max-height: 320px;
    gap: 0.375rem;
  }
  
  .view-more-button {
    font-size: 0.75rem;
    margin-top: 0.5rem;
  }
  
  .empty-state {
    min-height: 220px;
    padding: 0.75rem 0.5rem;
  }
  
  .empty-icon {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
  }
  
  .empty-message {
    font-size: 0.8125rem;
  }
  
  .empty-subtext {
    font-size: 0.75rem;
  }
}

@media (max-width: 360px) {
  .news-section {
    padding: 1.5rem 0 0.25rem 0;
    min-height: 55vh;
  }
  
  .news-container {
    padding: 0 0.5rem;
  }
  
  .main-content {
    gap: 0.5rem;
    min-height: auto;
  }
  
  .left-column {
    min-height: 260px;
  }
  
  .right-column {
    min-height: 300px;
  }
  
  .news-hero {
    min-height: 260px;
  }
  
  .hero-content {
    min-height: 260px;
  }
  
  .hero-content .empty-state {
    min-height: 260px;
  }
  
  .title-section {
    margin-bottom: 0.5rem;
  }
  
  .title-section img {
    max-height: 60px;
    display: block;
    margin: 0 auto;
  }
  
  .tab-navigation {
    margin: 0 0.5rem 1rem 0.5rem; /* Minimum margins for very small screens */
  }
  
  .tab-button {
    font-size: 0.65rem;
    margin-right: 0.4rem;
  }
  
  .news-list {
    min-height: 200px;
    max-height: 300px;
    gap: 0.25rem;
  }
  
  .view-more-button {
    font-size: 0.6875rem;
    margin-top: 0.375rem;
  }
  
  .empty-state {
    min-height: 200px;
    padding: 0.625rem 0.25rem;
  }
  
  .empty-icon {
    font-size: 1.5rem;
    margin-bottom: 0.375rem;
  }
  
  .empty-message {
    font-size: 0.75rem;
  }
  
  .empty-subtext {
    font-size: 0.6875rem;
  }
}