/* NIJ LEADS Special Issue - NPI Styled */

/* Import NPI Fonts */
@import url('https://fonts.googleapis.com/css2?family=Titillium+Web:wght@400;600;700&family=Open+Sans:wght@300;400;600;700&display=swap');

/* NPI Color Palette */
:root {
  --npi-primary-blue: #003594;
  --npi-dark-blue: #002855;
  --npi-accent-green: #46b652;
  --npi-light-blue: #C2D9ED;
  --npi-border-blue: rgba(0, 40, 85, 0.1);
  --npi-white: #FFFFFF;
  --npi-off-white: #F8F9FA;
  --npi-light-gray: #E9ECEF;
  --npi-text-dark: #3a3a3a;
  --npi-text-light: #545454;
}

/* Smooth Scroll Behavior */
html {
  scroll-behavior: smooth;
}

/* Global Typography */
body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--npi-text-dark);
  line-height: 1.6;
  font-size: 16px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Titillium Web', sans-serif;
  font-weight: 600;
  color: var(--npi-primary-blue);
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

h2 {
  font-size: 2rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  animation: fadeInUp 0.6s ease-out;
}

h3 {
  font-size: 1.5rem;
  margin-top: 1.5rem;
  font-size: 1.125rem;
}

h4 {
  font-size: 1.125rem;
  margin-top: 1.25rem;
}

/* Links */
a {
  color: var(--npi-primary-blue);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--npi-accent-green);
  text-decoration: underline;
}

/* Navbar Styling */
.navbar {
  background: var(--npi-primary-blue);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Navbar logo styling */
.navbar-brand img.navbar-logo {
  height: 45px;
  width: auto;
  border-radius: 6px;
  padding: 2px;
  background: rgba(255, 255, 255, 0.9);
}

/* Hide navbar title text, keep only logo */
.navbar-brand .navbar-title {
  display: none !important;
}

.navbar-brand, .navbar-nav .nav-link {
  color: var(--npi-white) !important;
  font-family: 'Titillium Web', sans-serif;
  font-weight: 600;
}

.navbar-nav .nav-link:hover {
  color: var(--npi-accent-green) !important;
}

/* Hide page title and subtitle (shown in hero instead) */
#title-block-header {
  display: none !important;
}

.quarto-title-block {
  display: none !important;
}

/* Main Content Area */
.content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 20px;
  position: relative;
}

/* Full-width layout: constrain card content to readable width */
.page-full .article-card,
.page-full .video-card {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

/* Subtle dot pattern background */
body {
  background-image:
    radial-gradient(circle, rgba(0, 53, 148, 0.03) 1px, transparent 1px);
  background-size: 20px 20px;
  background-attachment: fixed;
}

/* Partner Logos Section - Top of Page */
.partner-logos-top {
  background: var(--npi-white);
  border-bottom: 3px solid var(--npi-primary-blue);
  padding: 1.5rem 1rem;
  margin: -2rem -20px 0 -20px;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  animation: fadeInUp 0.5s ease-out;
}

.logo-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4rem;
  flex-wrap: wrap;
}

.partner-logo {
  height: 100px;
  width: auto;
  object-fit: contain;
  transition: all 0.3s ease;
}

.partner-logo:hover {
  opacity: 0.8;
}

/* Hero Section - Full Width with Background Image */
.hero-section {
  position: relative;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-bottom: 3rem;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  color: var(--npi-white);
  padding: 4rem 2rem;
  text-align: center;
  overflow: hidden;
}

/* Gradient overlay on hero image */
.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0, 53, 148, 0.7), rgba(0, 40, 85, 0.85));
  z-index: 1;
}

/* Subtle texture overlay on hero */
.hero-section::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 10px,
      rgba(255, 255, 255, 0.02) 10px,
      rgba(255, 255, 255, 0.02) 20px
    );
  z-index: 1;
  pointer-events: none;
}

/* Hero content wrapper */
.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1000px;
  margin: 0 auto;
  animation: fadeInUp 0.8s ease-out;
}

.hero-section h1 {
  color: var(--npi-white);
  margin-bottom: 1rem;
  font-size: 2.75rem;
  font-weight: 700;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  line-height: 1.2;
}

.hero-subtitle {
  color: var(--npi-white);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  line-height: 1.4;
  font-family: 'Titillium Web', sans-serif;
}

.hero-description {
  color: var(--npi-white);
  font-size: 1.125rem;
  font-weight: 400;
  margin-bottom: 0;
  opacity: 0.95;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  line-height: 1.5;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

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

/* Respect reduced motion preferences (WCAG 2.3.3) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* Skip Navigation Link (Section 508 / WCAG 2.4.1) */
.skip-nav {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--npi-primary-blue);
  color: var(--npi-white);
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  font-family: 'Titillium Web', sans-serif;
  z-index: 9999;
  text-decoration: none;
  border-radius: 0 0 4px 0;
}

.skip-nav:focus {
  top: 0;
  outline: 3px solid var(--npi-accent-green);
  outline-offset: 2px;
}

/* Article Card Links - Entire card is clickable */
.article-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  margin-bottom: 1.25rem;
  animation: fadeInUp 0.6s ease-out backwards;
}

.article-card-link:hover {
  text-decoration: none;
}

/* Staggered animation delays for cards */
.article-card-link:nth-child(1) { animation-delay: 0.1s; }
.article-card-link:nth-child(2) { animation-delay: 0.2s; }
.article-card-link:nth-child(3) { animation-delay: 0.3s; }
.article-card-link:nth-child(4) { animation-delay: 0.4s; }
.article-card-link:nth-child(5) { animation-delay: 0.5s; }
.article-card-link:nth-child(6) { animation-delay: 0.6s; }
.article-card-link:nth-child(7) { animation-delay: 0.7s; }
.article-card-link:nth-child(8) { animation-delay: 0.8s; }
.article-card-link:nth-child(9) { animation-delay: 0.9s; }
.article-card-link:nth-child(10) { animation-delay: 1.0s; }

/* Article Cards - Minimal Style */
.article-card {
  background: var(--npi-off-white);
  border: 1px solid var(--npi-border-blue);
  border-left: 4px solid var(--npi-primary-blue);
  border-radius: 0;
  padding: 1.25rem;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.article-card-link:hover .article-card {
  box-shadow: 0 4px 12px rgba(0, 53, 148, 0.15);
  border-left-color: var(--npi-accent-green);
  background: var(--npi-white);
  transform: translateY(-2px);
}

.article-card h3 {
  margin-top: 0;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.article-card h3 a {
  color: var(--npi-primary-blue);
  text-decoration: none;
}

.article-card h3 a:hover {
  color: var(--npi-accent-green);
}

.article-card .authors {
  color: var(--npi-text-light);
  font-style: italic;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.article-card p {
  line-height: 1.5;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.article-card p:last-of-type {
  margin-bottom: 0;
}

.article-card .abstract {
  margin-bottom: 1rem;
  line-height: 1.7;
}

.article-card .keywords {
  font-size: 0.9rem;
  color: var(--npi-text-light);
  margin-bottom: 0.5rem;
}

.article-card .keywords strong {
  color: var(--npi-primary-blue);
  font-weight: 600;
}

/* Read More Links */
.article-card a[href*="article-"] {
  color: var(--npi-primary-blue);
  font-weight: 600;
  text-decoration: none;
}

.article-card a[href*="article-"]:hover {
  color: var(--npi-accent-green);
  text-decoration: underline;
}

.article-card a[href*="article-"]:after {
  content: " »";
}

/* Navigation Cards (Homepage Grid) */
.nav-card {
  background: var(--npi-off-white);
  border: 1px solid var(--npi-border-blue);
  border-radius: 0;
  padding: 2rem;
  margin-bottom: 1.5rem;
  text-align: center;
  transition: box-shadow 0.3s ease;
}

.nav-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-card h3 {
  color: var(--npi-primary-blue);
  margin-top: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.nav-card a {
  color: var(--npi-primary-blue);
  font-weight: 600;
  text-decoration: none;
}

.nav-card a:hover {
  color: var(--npi-accent-green);
  text-decoration: underline;
}

.nav-card a:after {
  content: " »";
}

/* Video Containers */
.quarto-video {
  margin: 1.5rem 0;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--npi-border-blue);
}

video {
  border: 1px solid var(--npi-border-blue);
  border-radius: 0;
}

.video-card {
  background: var(--npi-white);
  border: 1px solid var(--npi-border-blue);
  border-radius: 0;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.video-card h3,
.video-card h4 {
  margin-top: 0;
  color: var(--npi-primary-blue);
  font-weight: 600;
}

.video-card .presenter {
  color: var(--npi-text-light);
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

/* Consistent video frame sizing - all videos same size */
.video-card iframe {
  width: 100% !important;
  height: 380px !important;
  max-width: 680px;
  margin: 1rem auto;
  border: 2px solid var(--npi-light-blue);
  display: block;
}

/* PDF Viewer Container */
.pdf-container {
  margin: 2rem 0;
  border: 1px solid var(--npi-border-blue);
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Grid Layout for Article Showcase */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

/* Callout Boxes */
.callout-note {
  border-left: 4px solid var(--npi-primary-blue);
  background-color: rgba(0, 53, 148, 0.05);
  border-radius: 0;
}

.callout-tip {
  border-left: 4px solid var(--npi-accent-green);
  background-color: rgba(70, 182, 82, 0.05);
  border-radius: 0;
}

.callout-important {
  border-left: 4px solid var(--npi-primary-blue);
  background-color: rgba(0, 53, 148, 0.05);
  border-radius: 0;
}

/* Footer */
.page-footer {
  background: var(--npi-primary-blue);
  color: var(--npi-white);
  padding: 1.5rem 1rem;
  margin-top: 3rem;
  text-align: center;
  font-size: 0.9rem;
}

.page-footer a {
  color: var(--npi-white);
  text-decoration: underline;
}

.page-footer a:hover {
  color: var(--npi-accent-green);
}

/* Badges */
.badge {
  display: inline-block;
  background: var(--npi-accent-green);
  color: var(--npi-white);
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.5rem;
  font-family: 'Titillium Web', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.badge-video {
  background: var(--npi-accent-green);
}

.article-card-link:hover .badge {
  transform: scale(1.05);
  box-shadow: 0 2px 4px rgba(70, 182, 82, 0.3);
}

/* Horizontal Rules */
hr {
  border: none;
  border-top: 1px solid var(--npi-border-blue);
  margin: 2.5rem 0;
}

/* DOI Links */
a[href^="https://doi.org"] {
  color: var(--npi-primary-blue);
  font-family: 'Open Sans', sans-serif;
  font-size: 0.9em;
  font-weight: 600;
}

a[href^="https://doi.org"]:hover {
  color: var(--npi-accent-green);
}

/* Citation Box */
.citation-box {
  background: var(--npi-off-white);
  border: 1px solid var(--npi-border-blue);
  border-radius: 0;
  padding: 1.5rem;
  margin: 2rem 0;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.95rem;
}

.citation-box h4 {
  margin-top: 0;
  color: var(--npi-primary-blue);
  font-weight: 600;
}

/* About Section */
.about-npi {
  background: var(--npi-off-white);
  border: 1px solid var(--npi-border-blue);
  border-radius: 0;
  padding: 1.5rem;
  margin: 2rem 0;
  position: relative;
  overflow: hidden;
}

.about-npi::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at top right, rgba(70, 182, 82, 0.03) 0%, transparent 50%);
  pointer-events: none;
}

.about-npi h3 {
  margin-top: 0;
  color: var(--npi-primary-blue);
  font-weight: 600;
  position: relative;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-section {
    min-height: 350px;
    padding: 3rem 1.5rem;
  }

  .hero-section h1 {
    font-size: 1.875rem;
    margin-bottom: 0.75rem;
  }

  .hero-subtitle {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
  }

  .hero-description {
    font-size: 1rem;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .content {
    padding: 2rem 15px;
  }

  .partner-logos-top {
    padding: 1rem;
    margin: -2rem -15px 0 -15px;
  }

  .logo-container {
    gap: 2rem;
  }

  .partner-logo {
    height: 70px;
  }

  .video-card iframe {
    height: 240px !important;
  }
}

/* Table of Contents Styling */
.toc-title {
  color: var(--npi-primary-blue);
  font-family: 'Titillium Web', sans-serif;
  font-weight: 600;
}

#TOC .active {
  color: var(--npi-accent-green);
  border-left: 3px solid var(--npi-accent-green);
  font-weight: 600;
}

/* Section Headers */
h2 {
  border-bottom: 1px solid var(--npi-border-blue);
  padding-bottom: 0.5rem;
}

/* Research Articles Section - Subtle background variation */
#research-articles {
  position: relative;
  padding: 2rem 0;
  margin: 0 -20px;
  padding-left: 20px;
  padding-right: 20px;
}

#research-articles::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    linear-gradient(135deg, transparent 0%, rgba(0, 53, 148, 0.01) 50%, transparent 100%);
  pointer-events: none;
  z-index: -1;
}

/* Clean, minimal styling */
* {
  box-sizing: border-box;
}

/* Remove excessive decorative elements */
.nav-card,
.article-card {
  box-shadow: none;
}

.nav-card:hover,
.article-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Tighten Research Articles header spacing on homepage */
#research-articles {
  margin-top: -1rem;
  margin-bottom: -0.5rem;
  padding-bottom: 0;
}

/* Download button */
.btn-download {
  display: inline-block;
  background: var(--npi-primary-blue);
  color: var(--npi-white) !important;
  padding: 0.6rem 1.25rem;
  font-family: 'Titillium Web', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none !important;
  margin: 0.75rem 0 0.5rem 0;
  border-left: none;
  transition: background 0.2s ease;
}

.btn-download:hover {
  background: var(--npi-dark-blue);
  color: var(--npi-white) !important;
  text-decoration: none !important;
}

/* Video thumbnails on cards */
.video-card-thumb {
  float: right;
  width: 220px;
  margin: 0 0 1rem 1.5rem;
  border: 2px solid var(--npi-light-blue);
  display: block;
}

.article-card-thumb {
  float: right;
  width: 150px;
  height: 84px;
  object-fit: cover;
  margin: 0 0 0.75rem 1rem;
  border: 2px solid var(--npi-light-blue);
  display: block;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.article-card-thumb:hover {
  opacity: 1;
}

@media (max-width: 768px) {
  .video-card-thumb {
    float: none;
    width: 100%;
    max-width: 100%;
    margin: 0 0 1rem 0;
  }

  .article-card-thumb {
    float: none;
    width: 100%;
    max-width: 240px;
    margin: 0 0 1rem 0;
  }
}

/* Print Styles */
@media print {
  .navbar, .page-footer, .toc-actions {
    display: none;
  }

  .content {
    max-width: 100%;
  }
}
