/*
 * NeuroSapiens — Publications page
 * Clean stylesheet for the current WordPress HTML:
 *
 *   <div class="kp-wp-reset kp-publications-page">
 *   ...
 *   <aside class="nsp_journal_reel" data-nsp-journal-reel>
 *
 * Keep this file as CSS only. Do not place <style>, <link>, or HTML tags here.
 */

/* ==========================================================
   1. WORDPRESS PAGE-WIDTH RESET
   ========================================================== */

.entry-content,
.wp-site-blocks,
.wp-block-post-content,
.wp-block-group,
.wp-block-columns,
.site,
.site-content,
.content-area,
#primary,
#main {
  width: 100% !important;
  max-width: none !important;
}

.entry-content,
.wp-block-post-content,
.wp-site-blocks,
.site-content,
.content-area {
  margin-right: 0 !important;
  margin-left: 0 !important;
  padding-right: 0 !important;
  padding-left: 0 !important;
}


/* ==========================================================
   2. PAGE FOUNDATION
   ========================================================== */

{
  --nsp-ink: #0f172a;
  --nsp-text: #334155;
  --nsp-muted: #64748b;
  --nsp-line: rgba(100, 116, 139, 0.16);
  --nsp-card: #ffffff;
  --nsp-orange: #f97316;
  --nsp-green: #16a34a;
  --nsp-violet: #7c3aed;
  --nsp-hero: #cfe0ef;

  width: 100vw !important;
  max-width: 100vw !important;
  margin-right: calc(50% - 50vw) !important;
  margin-left: calc(50% - 50vw) !important;
  padding: 0 !important;
  overflow-x: clip;
  isolation: isolate;

  background: transparent;
  color: var(--nsp-ink);

  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Inter,
    Arial,
    sans-serif;
  line-height: 1.6;
}


* {
  margin: 0;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}


/* ==========================================================
   3. PUBLICATIONS HERO
   ========================================================== */

.hero-grid {
     display: grid;
     grid-template-columns:
       minmax(0, 1.85fr)
       minmax(340px, 0.85fr);
     gap: clamp(30px, 3.2vw, 48px);
     align-items: center;
   
     padding-bottom: 26px;
     border-bottom: 1px solid var(--nsp-line);
   }
   
   .hero-grid > * {
     min-width: 0;
   }

.subtitle{
  font-size: 1.4rem;
  font-weight: 400;
}

/* ==========================================================
   4. JOURNAL REEL
   ========================================================== */

.nsp_journal_reel {
     --nsp-journal-item-height: 50px;
     --nsp-journal-item-gap: 8px;
   
     width: 100%;
     max-width: none;
   
     /* Fixed compact box */
     height: 250px;
     min-height: 0;
     max-height: 250px;
   
     margin: 0;
     padding: 14px 16px;
   
     display: flex;
     flex-direction: column;
   
     overflow: hidden;
   
     border: 1px solid rgba(41, 61, 89, 0.22);
     border-radius: 16px;
   
     background:
       linear-gradient(
         145deg,
         rgba(255, 255, 255, 0.95),
         rgba(246, 249, 253, 0.84)
       );
   
     box-shadow:
       0 14px 36px rgba(39, 64, 96, 0.08),
       inset 0 1px 0 rgba(255, 255, 255, 0.9);
   }
   
   
   /* Header */
   
   .nsp_journal_reel__header {
     min-height: 38px;
     margin-bottom: 8px;
   
     display: flex;
     flex: 0 0 auto;
     align-items: flex-start;
     justify-content: space-between;
     gap: 12px;
   }
   
   .nsp_journal_reel__eyebrow {
     display: block;
     margin-bottom: 1px;
     color: #687892;
     font-size: 0.61rem;
     font-weight: 750;
     line-height: 1.1;
     letter-spacing: 0.14em;
     text-transform: uppercase;
   }
   
   .eyebrow {
     letter-spacing: .22em;
     text-transform: uppercase;
     font-size: .78rem;
     font-weight: 800;
     color: var(--muted);
     margin-bottom: 12px;
   }
   
   .nsp_journal_reel__header h2 {
     margin: 0;
   
     color: #172136;
   
     font-size: 1.08rem;
     font-weight: 760;
     line-height: 1.1;
     letter-spacing: -0.025em;
   }
   
   
   /* Pause/play button */
   
   .nsp_journal_reel__toggle {
     width: 32px;
     height: 32px;
     padding: 0;
   
     display: inline-grid;
     place-items: center;
     flex: 0 0 auto;
   
     border: 0;
     border-radius: 50%;
   
     background: #0b61c9;
     color: #ffffff;
   
     font: inherit;
     font-size: 0.68rem;
     font-weight: 800;
   
     cursor: pointer;
   }
   
   .nsp_journal_reel__toggle:hover,
   .nsp_journal_reel__toggle:focus-visible {
     background: #094fa4;
   }
   
   
   /* Visible scrolling window */
   
   .nsp_journal_reel__viewport {
     position: relative;
   
     min-height: 0;
     flex: 1 1 auto;
   
     overflow: hidden;
     outline: none;
   
     -webkit-mask-image:
       linear-gradient(
         to bottom,
         transparent 0,
         #000 5%,
         #000 95%,
         transparent 100%
       );
   
     mask-image:
       linear-gradient(
         to bottom,
         transparent 0,
         #000 5%,
         #000 95%,
         transparent 100%
       );
   }
   
   
   /* Moving list */
   
   .nsp_journal_reel__track {
     display: flex;
     flex-direction: column;
     gap: var(--nsp-journal-item-gap);
   
     transform: translate3d(0, 0, 0);
     will-change: transform;
   }
   
   
   /* Individual journal card */
   
   .nsp_journal_reel__item {
     width: 100%;
     height: var(--nsp-journal-item-height);
     min-height: var(--nsp-journal-item-height);
     padding: 7px 12px;
   
     display: flex;
     align-items: center;
     justify-content: center;
   
     overflow: hidden;
   
     border: 1px solid rgba(71, 95, 129, 0.13);
     border-radius: 10px;
   
     background: rgba(255, 255, 255, 0.82);
     color: #1c2a42;
     text-decoration: none;
   }
   
   .nsp_journal_reel__item:hover,
   .nsp_journal_reel__item:focus-visible {
     border-color: rgba(45, 91, 158, 0.3);
     background: #ffffff;
     text-decoration: none;
   }
   
   
   /* Journal logo */
   
   .nsp_journal_reel__item img {
     display: block;
   
     width: auto;
     height: auto;
     max-width: 88%;
     max-height: 36px;
     margin: 0 auto;
   
     object-fit: contain;
   }
   
   
   /* Text fallback */
   
   .nsp_journal_reel__fallback {
     display: none;
   
     max-width: 100%;
   
     color: #243754;
   
     text-align: center;
     font-family: Georgia, "Times New Roman", serif;
     font-size: 0.84rem;
     font-weight: 700;
   }
   
   /* Responsive */
   
   @media (max-width: 900px) {
     .hero-grid {
       grid-template-columns: 1fr;
     }
   
     .nsp_journal_reel {
       width: 100%;
       height: 250px;
       max-height: 250px;
     }
   }


/* ==========================================================
   5. HERO METRICS
   ========================================================== */

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0 18px;
}

.stat {
  padding: 18px;

  border: 1px solid var(--nsp-line);
  border-radius: 18px;

  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.stat .value {
  font-size: 2rem;
  font-weight: 900;
}

.stat .label {
  color: var(--nsp-muted);

  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}


/* ==========================================================
   6. SEARCH AND FILTER TOOLBAR
   ========================================================== */

.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;

  margin-bottom: 22px;
  padding: 14px 0;

  border-top: 1px solid rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid var(--nsp-line);

  background: rgba(248, 250, 252, 0.88);
  backdrop-filter: blur(16px);
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.search {
  flex: 1 1 280px;
  padding: 11px 16px;

  border: 1px solid var(--nsp-line);
  border-radius: 999px;
  outline: none;

  background: #ffffff;

  font: inherit;
  font-size: 0.95rem;
}

.search:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-btn {
  padding: 9px 13px;

  border: 1px solid var(--nsp-line);
  border-radius: 999px;

  background: #ffffff;
  color: var(--nsp-text);

  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;

  cursor: pointer;
}

.filter-btn:hover,
.filter-btn.active {
  border-color: var(--nsp-ink);
  background: var(--nsp-ink);
  color: #ffffff;
}


/* ==========================================================
   7. PUBLICATION LIST
   ========================================================== */

.section-title {
  margin: 18px 0 14px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.section-title h2 {
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.update-note {
  color: var(--nsp-muted);
  font-size: 0.86rem;
}

.publications {
  padding-bottom: 60px;
}

.publication {
  position: relative;

  margin-bottom: 18px;
  padding: 30px;
  overflow: hidden;

  border: 1px solid rgba(226, 232, 240, 0.85);

  background: var(--nsp-card);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.055);

  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.publication:hover {
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: 0 18px 55px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.pub-labels {
  margin-bottom: 15px;

  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;

  color: var(--nsp-muted);

  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.pub-labels .oa {
  color: var(--nsp-orange);
}

.pub-labels .peer {
  color: var(--nsp-violet);
}

.pub-title {
  max-width: 940px;
  margin-bottom: 16px;

  color: #020617;

  font-size: clamp(1.18rem, 1.5vw, 2rem);
  font-weight: 950;
  line-height: 1.22;
  letter-spacing: -0.045em;
}

.authors {
  margin-bottom: 8px;

  color: #111827;

  font-size: 1.03rem;
}

.me {
  padding: 0 2px;

  background:
    linear-gradient(
      transparent 58%,
      rgba(249, 115, 22, 0.22) 58%
    );
  color: #020617;

  font-weight: 950;
}

.journal {
  margin-bottom: 10px;

  color: var(--nsp-text);

  font-size: 1rem;
}

.doi-line {
  margin-bottom: 12px;

  color: var(--nsp-muted);

  font-size: 0.95rem;
  font-weight: 700;
}

.abstract {
  max-width: 890px;

  color: var(--nsp-muted);

  font-size: 1rem;
}

.publication-metrics {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 28px;
  margin-top: 26px;
}

.impact-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
}

.metric-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.altmetric-box,
.dimensions-box {
  min-height: 70px;

  display: flex;
  align-items: center;
  justify-content: center;
}

.pill {
  padding: 6px 11px;

  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 999px;

  background: #f1f5f9;
  color: var(--nsp-text);

  font-size: 0.78rem;
  font-weight: 850;
}

.pill.cite {
  background: #ecfdf5;
  color: #166534;
}

.pill.alt {
  background: #fff1f2;
  color: #9f1239;
}

.pill.topic {
  background: #eff6ff;
  color: #1d4ed8;
}

.pill.year {
  background: #faf5ff;
  color: #6d28d9;
}

.no-results {
  display: none;
  padding: 30px;

  border: 1px dashed var(--nsp-line);
  border-radius: 18px;

  background: #ffffff;
  color: var(--nsp-muted);

  text-align: center;
  font-weight: 700;
}


/* ==========================================================
   8. FOOTER
   ========================================================== */

.footer {
  padding: 28px 0 50px;

  border-top: 1px solid var(--nsp-line);

  color: var(--nsp-muted);

  font-size: 0.9rem;
}


/* ==========================================================
   9. RESPONSIVE RULES
   ========================================================== */

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-links {
    justify-content: flex-start;
  }

  .nsp_journal_reel {
    min-height: 300px;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .publication {
    padding: 24px;
  }

  .publication-metrics {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .metric-row {
    justify-content: flex-start;
  }

  .impact-badges {
    margin-top: 8px;
  }
}

@media (max-width: 600px) {
  .nsp_journal_reel {
    min-height: 280px;
    padding: 15px;
  }

  .section-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}

@media (max-width: 520px) {
  .container {
    width: min(calc(100% - 22px), 1180px);
  }

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

  .pub-labels {
    font-size: 0.68rem;
    letter-spacing: 0.13em;
  }

  .filter-btn {
    padding: 8px 10px;
    font-size: 0.78rem;
  }

  .publication {
    padding: 20px;
  }
}


/* ==========================================================
   10. ACCESSIBILITY
   ========================================================== */

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