/* =========================================================
   Student Projects Showcase — showcase.css
   Academic journal-style layout
   ========================================================= */

/* --- Custom Properties --- */
:root {
  --sps-accent:        #1a56db;
  --sps-accent-light:  #dbeafe;
  --sps-accent-hover:  #1e40af;
  --sps-text-primary:  #0f172a;
  --sps-text-secondary:#475569;
  --sps-text-muted:    #94a3b8;
  --sps-border:        #e2e8f0;
  --sps-surface:       #ffffff;
  --sps-surface-alt:   #f8fafc;
  --sps-badge-bg:      #eff6ff;
  --sps-badge-text:    #1d4ed8;
  --sps-shadow-sm:     0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.05);
  --sps-shadow-md:     0 4px 16px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.05);
  --sps-shadow-hover:  0 8px 28px rgba(0,0,0,.12), 0 3px 10px rgba(0,0,0,.07);
  --sps-radius:        10px;
  --sps-font-sans:     'Georgia', 'Times New Roman', serif; /* academic feel */
  --sps-font-ui:       -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sps-transition:    all .22s cubic-bezier(.4,0,.2,1);
}

/* --- Container --- */
.sps-showcase {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
  font-family: var(--sps-font-ui);
}

/* --- Article List --- */
.sps-article-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* --- Card --- */
.sps-article-card {
  display: grid;
  grid-template-columns: var(--sps-img-col, 200px) 1fr;
  gap: 0;
  align-items: start;
  background: var(--sps-surface);
  border-bottom: 1px solid var(--sps-border);
  padding: 24px 0;
  transition: none;
  position: relative;
  /* overflow visible so content is not clipped */
}

.sps-article-card:first-child {
  border-top: 1px solid var(--sps-border);
}

.sps-article-card:hover {
  background: var(--sps-surface);
}


/* --- LEFT: Visual / Graphical Abstract --- */
.sps-card-visual {
  width: 100%;
  min-width: 0;
  padding: 0 16px 0 0;
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

.sps-abstract-link {
  display: block;
  width: 100%;
  min-width: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--sps-shadow-sm);
  border: none;
  transition: transform .22s ease, box-shadow .22s ease;
  background: #f1f5f9;
  box-sizing: border-box;
  cursor: zoom-in;
}

.sps-abstract-link:hover {
  transform: translateY(-3px);
  box-shadow: var(--sps-shadow-md);
}

.sps-abstract-img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
  transition: transform .3s ease;
}

.sps-abstract-link:hover .sps-abstract-img {
  transform: scale(1.03);
}

.sps-abstract-label {
  display: block;
  text-align: center;
  font-size: 10px;
  font-family: var(--sps-font-ui);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--sps-text-muted);
  padding: 5px 8px;
  background: var(--sps-surface-alt);
  border-top: 1px solid var(--sps-border);
}

.sps-abstract-placeholder {
  width: 100%;
  height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--sps-surface-alt);
  border: 1px dashed var(--sps-border);
  border-radius: 8px;
  color: var(--sps-text-muted);
  font-size: 11px;
  text-align: center;
  padding: 12px;
  box-sizing: border-box;
}

.sps-abstract-placeholder svg {
  width: 48px;
  height: 48px;
  opacity: .8;
}

/* --- RIGHT: Content --- */
.sps-card-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

/* Category badges */
.sps-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sps-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  background: var(--sps-badge-bg);
  color: var(--sps-badge-text);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid #bfdbfe;
  transition: var(--sps-transition);
}

.sps-badge:hover {
  background: var(--sps-accent);
  color: #fff;
  border-color: var(--sps-accent);
}

/* Title */
.sps-project-title {
  margin: 0;
  font-family: var(--sps-font-sans);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--sps-text-primary);
}

.sps-project-title {
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 3px;
}

/* Student names */
.sps-students {
  margin: 0;
  font-size: 13.5px;
  color: var(--sps-text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.5;
}

.sps-students-icon {
  flex-shrink: 0;
  font-size: 14px;
  margin-top: 1px;
}


/* --- Custom text lines (authors, tag, custom) --- */
.sps-item-authors {
  margin: 0;
  font-size: 13.5px;
  color: var(--sps-text-secondary);
  line-height: 1.5;
}

.sps-item-tag {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--sps-text-secondary);
  line-height: 1.5;
}

.sps-item-custom {
  margin: 0;
  font-size: 13px;
  color: var(--sps-text-muted);
  line-height: 1.5;
}

/* Abstract text */
.sps-abstract-text {
  font-family: var(--sps-font-sans);
  font-size: 14px;
  color: var(--sps-text-secondary);
  line-height: 1.65;
  /* Clamp to ~3 lines */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sps-abstract-text p {
  margin: 0;
}

/* Keywords */
.sps-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

.sps-keyword {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: #f0fdf4;
  color: #166534;
  font-size: 11px;
  border: 1px solid #bbf7d0;
  font-family: var(--sps-font-ui);
}

/* Meta row */
.sps-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--sps-text-muted);
  font-family: var(--sps-font-ui);
  margin-top: 2px;
}

.sps-meta-type {
  font-weight: 700;
  color: var(--sps-text-secondary);
}

.sps-meta-sep {
  color: var(--sps-border);
  user-select: none;
}

.sps-meta-date { }

.sps-meta-article {
  font-weight: 600;
  color: var(--sps-text-secondary);
}

.sps-meta-supervisor {
  font-style: italic;
}

/* Read more */
.sps-read-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--sps-accent);
  text-decoration: none;
  letter-spacing: .02em;
  align-self: flex-start;
  transition: var(--sps-transition);
}

.sps-read-more svg {
  transition: transform .2s ease;
}

.sps-read-more:hover {
  color: var(--sps-accent-hover);
}

.sps-read-more:hover svg {
  transform: translateX(3px);
}

/* No projects message */
.sps-no-projects {
  padding: 40px;
  text-align: center;
  color: var(--sps-text-muted);
  font-style: italic;
  border: 1px dashed var(--sps-border);
  border-radius: var(--sps-radius);
}

/* =========================================================
   Responsive — SLIM HORIZONTAL CARD on all screen sizes
   Image stays left, text stays right. Just scales down.
   ========================================================= */

/* ── Tablet (≤ 900px) ─────────────────────────────────── */
@media ( max-width: 900px ) {
  .sps-article-card {
    grid-template-columns: 140px 1fr !important;
    padding: 18px 0;
  }

  .sps-card-visual {
    padding: 0 16px 0 0;
  }

  .sps-abstract-link {
    width: 128px !important;
  }

  .sps-abstract-img {
    height: 110px !important;
  }

  .sps-abstract-placeholder {
    width: 128px !important;
    height: 110px;
  }

  .sps-project-title {
    font-size: 15px;
  }

  .sps-abstract-text {
    font-size: 13px;
    -webkit-line-clamp: 2;
  }

  .sps-card-content {
    gap: 7px;
  }
}

/* ── Mobile (≤ 540px) ─────────────────────────────────── */
@media ( max-width: 540px ) {
  .sps-article-card {
    grid-template-columns: 100px 1fr !important;
    padding: 14px 0;
  }

  .sps-card-visual {
    padding: 0 12px 0 0;
  }

  .sps-abstract-link {
    width: 92px !important;
  }

  .sps-abstract-img {
    height: 90px !important;
  }

  .sps-abstract-placeholder {
    width: 92px !important;
    height: 90px;
  }

  .sps-abstract-placeholder svg {
    width: 36px;
    height: 36px;
  }

  .sps-abstract-placeholder span {
    display: none;
  }

  .sps-project-title {
    font-size: 13px;
    line-height: 1.3;
  }

  .sps-abstract-text {
    font-size: 12px;
    -webkit-line-clamp: 2;
  }

  .sps-students {
    font-size: 11px;
  }

  .sps-meta-row {
    font-size: 11px;
    flex-wrap: wrap;
    gap: 3px;
  }

  .sps-keywords {
    display: none; /* too cramped on tiny screens */
  }

  .sps-card-content {
    gap: 5px;
  }

  .sps-read-more {
    font-size: 11px;
  }

  .sps-categories {
    display: none; /* save space */
  }
}

  .sps-students {
    font-size: 12.5px;
  }
}

/* =========================================================
   Dark-mode support
   ========================================================= */
@media ( prefers-color-scheme: dark ) {
  :root {
    --sps-text-primary:   #f1f5f9;
    --sps-text-secondary: #94a3b8;
    --sps-text-muted:     #64748b;
    --sps-border:         #1e293b;
    --sps-surface:        #0f172a;
    --sps-surface-alt:    #1e293b;
    --sps-badge-bg:       #1e3a5f;
    --sps-badge-text:     #93c5fd;
  }

  .sps-keyword {
    background: #052e16;
    color: #86efac;
    border-color: #166534;
  }
}

/* =========================================================
   SINGLE PROJECT PAGE  (matches Optech / AI-CoE theme)
   ========================================================= */

/* Google Font: Sora (matches theme) */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700&display=swap');

.sps-sp-page {
  font-family: 'Sora', sans-serif;
  color: #585B6F;
}

/* ── Hero ─────────────────────────────────────────────── */
.sps-sp-hero-wrap {
  padding: 130px 0 0;
}
.sps-sp-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 12px;
}
.sps-sp-hero-img {
  display: block;
  width: 100%;
  height: 690px;
  object-fit: contain;
  border-radius: 18px;
}
.sps-sp-hero-placeholder {
  width: 100%;
  height: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #f8fafc;
  border-radius: 18px;
  border: 1px dashed #e2e8f0;
  color: #94a3b8;
  font-size: 14px;
}
.sps-sp-hero-placeholder svg { width: 120px; opacity: .6; }

/* ── Body wrapper ─────────────────────────────────────── */
.sps-sp-body-wrap {
  padding: 52px 0 100px;
}
.sps-sp-body-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 12px;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0;
}

/* ── Main column (66%) ────────────────────────────────── */
.sps-sp-main {
  width: 66%;
  flex-shrink: 0;
  padding-right: 0;
}

/* Back link */
.sps-sp-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sps-accent, #2B4DFF);
  text-decoration: none;
  margin-bottom: 20px;
  transition: opacity .2s;
}
.sps-sp-back:hover { opacity: .75; }

/* Category badges */
.sps-sp-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

/* Page title */
.sps-sp-title {
  font-family: 'Sora', sans-serif;
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 700;
  color: #0A165E;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

/* Student names */
.sps-sp-students-line {
  font-size: 15px;
  color: #585B6F;
  margin: 0 0 28px;
  font-style: italic;
}

/* Section headings (h3) */
.sps-sp-h3 {
  font-family: 'Sora', sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: #0A165E;
  line-height: 1.26;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}

/* Body text */
.sps-sp-text {
  font-family: 'Sora', sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: #585B6F;
  line-height: 30px;
  margin-bottom: 20px;
}
.sps-sp-text p { margin: 0; }

/* Post content (rich editor body — headings, lists, images) */
.sps-sp-content-body {
  font-family: 'Sora', sans-serif;
  font-size: 16px;
  color: #585B6F;
  line-height: 30px;
}
.sps-sp-content-body h3 {
  font-family: 'Sora', sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: #0A165E;
  line-height: 1.26;
  letter-spacing: -0.02em;
  margin: 21px 0 16px;
}
.sps-sp-content-body h5 {
  font-family: 'Sora', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #0A165E;
  margin: 20px 0 10px;
}
.sps-sp-content-body p {
  margin: 0 0 16px;
  color: #585B6F;
}
.sps-sp-content-body ul,
.sps-sp-content-body ol {
  margin: 0 0 20px 20px;
  color: #585B6F;
}
.sps-sp-content-body li { margin-bottom: 6px; }
.sps-sp-content-body img {
  border-radius: 18px;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 24px 0;
}
/* Two-column image grid (matches theme's side-by-side images) */
.sps-sp-content-body .wp-block-columns,
.sps-sp-content-body .gallery {
  display: flex;
  gap: 24px;
  margin: 24px 0;
}
.sps-sp-content-body .wp-block-column img { border-radius: 18px; }

/* Keywords */
.sps-sp-kw-wrap {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid #e2e8f0;
}
.sps-sp-kw-label {
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #0A165E;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0 0 12px;
}

/* ── Sidebar (34%) ────────────────────────────────────── */
.sps-sp-sidebar {
  width: 34%;
  flex-shrink: 0;
  margin-left: 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 100px;
}

/* Card 1: Project Details — bg #F5F6F7, radius 18px, pad 30px */
.sps-sp-details-card {
  background: #F5F6F7;
  border-radius: 18px;
  padding: 30px;
}
.sps-sp-details-heading {
  font-family: 'Sora', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: #0A165E;
  line-height: 30px;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
}
.sps-sp-details-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.sps-sp-detail-row {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 10px 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 15px;
  line-height: 1.5;
}
.sps-sp-detail-row:last-child { border-bottom: none; }
.sps-sp-detail-row strong {
  width: 105px;
  flex-shrink: 0;
  font-weight: 600;
  color: #0A165E;
  font-family: 'Sora', sans-serif;
  font-size: 14px;
}
.sps-sp-detail-row span {
  color: #585B6F;
  font-size: 14px;
  font-family: 'Sora', sans-serif;
}

/* Card 2: CTA dark card (matches theme's contact widget) */
.sps-sp-cta-card {
  background: #0A165E;
  border-radius: 18px;
  padding: 40px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
}
.sps-sp-cta-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  background: rgba(255,255,255,.1);
  border-radius: 18px;
  color: #fff;
  margin-bottom: 0;
}
.sps-sp-cta-heading {
  font-family: 'Sora', sans-serif;
  font-size: 28px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 15px 0 10px;
}
.sps-sp-cta-text {
  font-family: 'Sora', sans-serif;
  font-size: 15px;
  color: #CED0DF;
  line-height: 26px;
  margin: 0 0 22px;
}
.sps-sp-cta-btn {
  display: inline-block;
  background: var(--sps-accent, #2B4DFF);
  color: #fff;
  font-family: 'Sora', sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 8px;
  text-decoration: none;
  transition: opacity .2s, transform .2s;
}
.sps-sp-cta-btn:hover {
  opacity: .9;
  transform: translateY(-1px);
  color: #fff;
}

/* ── Responsive ───────────────────────────────────────── */
@media ( max-width: 1024px ) {
  .sps-sp-hero-img { height: 380px; }
  .sps-sp-hero-wrap { padding-top: 80px; }
  .sps-sp-body-wrap { padding: 40px 0 80px; }
}

@media ( max-width: 768px ) {
  .sps-sp-body-inner {
    flex-direction: column;
  }
  .sps-sp-main {
    width: 100%;
    padding-right: 0;
  }
  .sps-sp-sidebar {
    width: 100%;
    margin-left: 0;
    position: static;
    margin-top: 40px;
  }
  .sps-sp-hero-img { height: 220px; border-radius: 14px; }
  .sps-sp-hero-wrap { padding-top: 70px; }
  .sps-sp-title { font-size: 26px; }
  .sps-sp-h3 { font-size: 20px; }
  .sps-sp-body-wrap { padding: 30px 0 70px; }
}

/* =========================================================
   LIGHTBOX
   ========================================================= */
#sps-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.88);
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

#sps-lightbox.sps-lb-active {
  display: flex;
}

.sps-lb-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 90vh;
}

.sps-lb-img {
  display: block;
  max-width: 90vw;
  max-height: 80vh;
  width: auto;
  height: auto;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}

.sps-lb-caption {
  margin: 12px 0 0;
  color: #ccc;
  font-size: 13px;
  text-align: center;
  max-width: 600px;
  line-height: 1.5;
}

.sps-lb-close {
  position: absolute;
  top: -44px;
  right: 0;
  background: rgba(255,255,255,.1);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: background .2s ease;
  padding: 0;
}

.sps-lb-close:hover {
  background: rgba(255,255,255,.25);
}

/* Trigger cursor */
.sps-lightbox-trigger {
  cursor: zoom-in !important;
}
