/* SCCF News Hub Styles */

/* News Hero Section */
.news-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  color: white;
  padding: 8rem 2rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-top: 0;
}

.news-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(6, 182, 212, 0.2) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.15) 0%, transparent 50%);
  pointer-events: none;
}

.news-hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 2;
  background: linear-gradient(135deg, #ffffff 0%, #e0f2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.news-hero .hero-subtitle {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: #cbd5e1;
  max-width: 700px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
  line-height: 1.6;
}

/* Featured News Section */
.featured-news-section {
  padding: 4rem 0;
  background: var(--background-secondary);
}

.featured-news {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.featured-news-card {
  background: white;
  border-radius: var(--border-radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  transition: var(--transition);
  border: 1px solid var(--border);
  max-width: 900px;
  margin: 0 auto;
  height: 350px;
  cursor: pointer;
}

.featured-news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.featured-news-image {
  position: relative;
  overflow: hidden;
  height: 350px;
}

.featured-news-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.featured-news-card:hover .featured-news-image img {
  transform: scale(1.05);
}

.featured-badge {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  background: var(--gradient-accent);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 25px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.featured-news-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  height: 350px;
}

.news-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.news-category {
  background: var(--gradient-primary);
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.news-date {
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.news-date::before {
  content: '📅';
  font-size: 1rem;
}

.featured-news-content h2 {
  font-size: clamp(1.5rem, 3vw, 1.8rem);
  color: var(--primary);
  margin-bottom: 1rem;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.featured-news-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.read-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--secondary);
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.read-more-btn::after {
  content: '→';
  font-size: 1.2rem;
  transition: var(--transition);
}

.read-more-btn:hover {
  color: var(--accent);
  transform: translateX(5px);
}

.read-more-btn:hover::after {
  transform: translateX(5px);
}

/* News Section */
.news-section {
  padding: 4rem 0;
  background: white;
}

/* News Filters */
.news-filters {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text-secondary);
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--gradient-primary);
  color: white;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* News Grid */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 350px), 1fr));
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.news-card {
  background: white;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.news-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.news-card-image {
  position: relative;
  overflow: hidden;
  height: 220px;
  background: var(--background-secondary);
}

.news-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.news-card:hover .news-card-image img {
  transform: scale(1.1);
}

.news-card-category {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: var(--gradient-accent);
  color: white;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
}

.news-card-content {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.news-card-date {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.news-card-date::before {
  content: '📅';
  font-size: 0.9rem;
}

.news-card-content h3 {
  color: var(--primary);
  font-size: 1.3rem;
  margin-bottom: 1rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-excerpt {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.news-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.news-card-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.news-card-author::before {
  content: '✍️';
  font-size: 1rem;
}

.news-card-link {
  color: var(--secondary);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: var(--transition);
}

.news-card-link:hover {
  color: var(--accent);
}

/* Load More Container */
.load-more-container {
  text-align: center;
  margin-top: 3rem;
}

#load-more-btn {
  padding: 1rem 3rem;
  font-size: 1rem;
}

#load-more-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Newsletter Section */
.newsletter-section {
  padding: 5rem 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  position: relative;
  overflow: hidden;
}

.newsletter-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 30% 50%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 70% 50%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.newsletter-box {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-xl);
  padding: 4rem 3rem;
  text-align: center;
  position: relative;
  z-index: 2;
  max-width: 700px;
  margin: 0 auto;
}

.newsletter-box h2 {
  color: white;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
}

.newsletter-box p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.2rem;
  margin-bottom: 2.5rem;
}

.newsletter-form {
  display: flex;
  gap: 1rem;
  max-width: 550px;
  margin: 0 auto;
}

.newsletter-form input {
  flex: 1;
  padding: 1rem 1.5rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--border-radius);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 1rem;
  transition: var(--transition);
}

.newsletter-form input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.newsletter-form input:focus {
  outline: none;
  border-color: var(--secondary-light);
  background: rgba(255, 255, 255, 0.15);
}

.newsletter-form button {
  padding: 1rem 2rem;
  white-space: nowrap;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-secondary);
}

.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.empty-state p {
  font-size: 1.1rem;
}

/* Loading State */
.loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
}

.loading::after {
  content: '...';
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

/* Responsive Design */
@media (max-width: 1024px) {
  .featured-news-card {
    grid-template-columns: 1fr;
  }
  
  .featured-news-image {
    min-height: 300px;
  }
  
  .featured-news-content {
    padding: 2.5rem;
  }
}

@media (max-width: 768px) {
  .news-hero {
    padding: 6rem 1rem 3rem;
  }
  
  .featured-news-section {
    padding: 2rem 1rem;
  }
  
  /* Fix featured card for mobile - stack vertically */
  .featured-news-card {
    grid-template-columns: 1fr;
    height: auto;
    max-width: 100%;
    margin: 0;
  }
  
  .featured-news-image {
    min-height: 200px;
    height: 200px;
  }
  
  .featured-news-content {
    padding: 1.5rem;
    height: auto;
    min-height: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }
  
  .news-meta {
    margin-bottom: 1rem;
    gap: 1rem;
  }
  
  .news-category {
    padding: 0.3rem 0.8rem;
    font-size: 0.7rem;
  }
  
  .news-date {
    font-size: 0.85rem;
  }
  
  .featured-news-content h2 {
    font-size: 1.25rem;
    line-height: 1.3;
    -webkit-line-clamp: 2;
    margin-bottom: 0.75rem;
  }
  
  .featured-news-content p {
    font-size: 0.9rem;
    line-height: 1.5;
    -webkit-line-clamp: 3;
    margin-bottom: 1rem;
  }
  
  .read-more-btn {
    margin-top: auto;
    font-size: 0.9rem;
  }
  
  .featured-badge {
    top: 1rem;
    left: 1rem;
    padding: 0.4rem 0.8rem;
    font-size: 0.7rem;
  }
  
  .news-section {
    padding: 3rem 0;
  }
  
  .news-filters {
    gap: 0.5rem;
    margin-bottom: 2rem;
  }
  
  .filter-btn {
    padding: 0.6rem 1rem;
    font-size: 0.75rem;
  }
  
  .news-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .newsletter-box {
    padding: 3rem 2rem;
  }
  
  .newsletter-form {
    flex-direction: column;
  }
  
  .newsletter-form button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .news-hero {
    padding: 5rem 1rem 2rem;
  }
  
  .news-hero h1 {
    font-size: 2rem;
  }
  
  .news-hero .hero-subtitle {
    font-size: 1rem;
  }
  
  .featured-news-section {
    padding: 1.5rem 0.5rem;
  }
  
  .featured-news-card {
    border-radius: 12px;
  }
  
  .featured-news-image {
    min-height: 180px;
    height: 180px;
  }
  
  .featured-news-content {
    padding: 1.25rem;
  }
  
  .news-meta {
    margin-bottom: 0.75rem;
    gap: 0.75rem;
  }
  
  .featured-news-content h2 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
  }
  
  .featured-news-content p {
    font-size: 0.85rem;
    line-height: 1.4;
    -webkit-line-clamp: 2;
    margin-bottom: 0.75rem;
  }
  
  .read-more-btn {
    font-size: 0.85rem;
  }
  
  .news-card-content {
    padding: 1.5rem;
  }
  
  .newsletter-box {
    padding: 2rem 1.5rem;
  }
  
  .newsletter-box h2 {
    font-size: 1.5rem;
  }
  
  .newsletter-box p {
    font-size: 1rem;
  }
}

/* News Card Hidden State for Filtering */
.news-card.hidden {
  display: none;
}

/* Fade-in Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.news-card,
.featured-news-card {
  animation: fadeInUp 0.6s ease-out;
}

.news-card:nth-child(1) { animation-delay: 0.05s; }
.news-card:nth-child(2) { animation-delay: 0.1s; }
.news-card:nth-child(3) { animation-delay: 0.15s; }

/* News Detail Modal */
.news-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.news-modal.active {
  opacity: 1;
}

.news-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
}

.news-modal-content {
  position: relative;
  background: white;
  border-radius: var(--border-radius-xl);
  max-width: 900px;
  max-height: 90vh;
  width: 90%;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transform: translateY(50px);
  transition: transform 0.3s ease;
}

.news-modal.active .news-modal-content {
  transform: translateY(0);
}

.news-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: var(--transition);
}

.news-modal-close:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

.news-modal-header {
  position: relative;
  height: 400px;
  overflow: hidden;
}

.news-modal-header img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-modal-body {
  padding: 3rem;
}

.news-modal-body h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  color: var(--primary);
  margin: 1.5rem 0;
  line-height: 1.2;
}

.news-author-info {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}

.news-full-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.news-full-content br {
  display: block;
  content: "";
  margin-top: 1rem;
}

/* News Image Gallery in Modal */
.news-image-gallery {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 2px solid var(--border);
}

.news-image-gallery h3 {
  font-size: 1.5rem;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.news-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.news-gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius);
  background: var(--background-secondary);
  aspect-ratio: 4/3;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  cursor: pointer;
}

.news-gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.news-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.news-gallery-item:hover img {
  transform: scale(1.1);
}

@media (max-width: 768px) {
  .news-modal-content {
    width: 95%;
    max-height: 95vh;
  }
  
  .news-modal-header {
    height: 250px;
  }
  
  .news-modal-body {
    padding: 2rem 1.5rem;
  }
  
  .news-modal-body h1 {
    font-size: 1.5rem;
  }
  
  .news-full-content {
    font-size: 1rem;
  }
  
  .news-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }
}
.news-card:nth-child(4) { animation-delay: 0.2s; }
.news-card:nth-child(5) { animation-delay: 0.25s; }
.news-card:nth-child(6) { animation-delay: 0.3s; }

/* Loader Component (converted from React styled-components) */
.loader-wrapper {
  display: grid;
  place-items: center;
  min-height: 200px;
}

.loader {
  --size: 250px;
  --duration: 2s;
  --logo-color: var(--secondary);
  /* Theme-aligned soft glass gradient using secondary (teal) and accent (green) */
  --background: linear-gradient(
    0deg,
    rgba(6, 182, 212, 0.18) 0%,
    rgba(16, 185, 129, 0.18) 100%
  );
  height: var(--size);
  aspect-ratio: 1;
  position: relative;
}

.loader .box {
  position: absolute;
  background: rgba(100, 100, 100, 0.15);
  background: var(--background);
  border-radius: 50%;
  border-top: 1px solid rgba(6, 182, 212, 0.9); /* teal border */
  box-shadow: rgba(0, 0, 0, 0.3) 0px 10px 10px -0px;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  animation: ripple var(--duration) infinite ease-in-out;
}

.loader .box:nth-child(1) {
  inset: 40%;
  z-index: 99;
}

.loader .box:nth-child(2) {
  inset: 30%;
  z-index: 98;
  border-color: rgba(6, 182, 212, 0.7);
  animation-delay: 0.2s;
}

.loader .box:nth-child(3) {
  inset: 20%;
  z-index: 97;
  border-color: rgba(16, 185, 129, 0.6); /* green accent */
  animation-delay: 0.4s;
}

.loader .box:nth-child(4) {
  inset: 10%;
  z-index: 96;
  border-color: rgba(16, 185, 129, 0.45);
  animation-delay: 0.6s;
}

.loader .box:nth-child(5) {
  inset: 0%;
  z-index: 95;
  border-color: rgba(6, 182, 212, 0.35);
  animation-delay: 0.8s;
}

.loader .logo {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 30%;
}

.loader .logo .svg {
  width: 100%;
  /* External SVG via <img> cannot be fill-animated reliably; use a subtle pulse */
  animation: logo-pulse var(--duration) infinite ease-in-out;
}

@keyframes ripple {
  0% {
    transform: scale(1);
    box-shadow: rgba(0, 0, 0, 0.3) 0px 10px 10px -0px;
  }
  50% {
    transform: scale(1.3);
    box-shadow: rgba(0, 0, 0, 0.3) 0px 30px 20px -0px;
  }
  100% {
    transform: scale(1);
    box-shadow: rgba(0, 0, 0, 0.3) 0px 10px 10px -0px;
  }
}

@keyframes logo-pulse {
  0% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 0.9; }
}
