/* Frontend Layout Styles */

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
}

/* Header Styles */
header.sticky {
  position: sticky !important;
  top: 0 !important;
  z-index: 50 !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

header {
  transition: all 0.3s ease-in-out;
}

.sticky-header {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.8) !important;
}

#main-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 50 !important;
  width: 100% !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  background-color: white !important;
  border-bottom: 4px solid #2563eb !important;
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
}

header#main-header {
  visibility: visible !important;
  opacity: 1 !important;
}

/* Main Content */
main#main-content {
  scroll-margin-top: 100px;
}

/* Navigation */
.nav-active {
  color: #2563eb !important;
  background-color: #eff6ff !important;
}

.mobile-menu {
  margin-top: 0 !important;
  position: fixed !important;
  top: 100% !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 40 !important;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

/* Sections */
section[id^='section-'],
section {
  scroll-margin-top: 120px;
}

h1[id],
h2[id],
h3[id],
h4[id],
h5[id],
h6[id] {
  scroll-margin-top: 120px;
}

/* Hero Section */
.hero-gradient {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #fff 100%),
    linear-gradient(90deg, #eff6ff 0%, #dbeafe 100%);
}

/* Section Title */
.section-title {
  position: relative;
  padding-bottom: 0.75rem;
  margin-bottom: 1.5rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 4px;
  background-color: #2563eb;
  border-radius: 2px;
}

/* Text Utilities */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* News Card */
.news-card:hover .news-image {
  transform: scale(1.05);
}

/* Animations */
@keyframes infinite-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-100%);
  }
}

.animate-infinite-scroll {
  animation: infinite-scroll 40s linear infinite;
}

.scroller:hover .animate-infinite-scroll {
  animation-play-state: paused;
}

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sr-only.focus\:not-sr-only:focus {
  position: absolute;
  width: auto;
  height: auto;
  padding: 0.5rem 1rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
  z-index: 100;
  color: white;
  background-color: #1d4ed8;
  text-decoration: none;
  top: 0;
  left: 0;
  border-radius: 0 0 0.375rem 0;
}

/* Focus States */
:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.focus\:ring-2:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
}

/* Skip Links */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #1d4ed8;
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  z-index: 1000;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
