:root {
  --gp-primary: #1e407a;
  --gp-accent: #ffc53a;
  --gp-soft: #cdd4fb;
  --gp-chip-bg: #b7d8ef;
  --gp-text-main: #292929;
  --gp-text-muted: #545454;
  --gp-border-soft: #cdd4fb;
  --gp-page-bg: #ffffff;
  --gp-card-bg: #ffffff;
  --gp-radius-lg: 22px;
  --gp-radius-md: 14px;
  --gp-shadow-soft: 0 22px 55px rgba(15, 23, 42, 0.14);
}

/* Kill theme header on this CPT */
.single-graduation_project .page-header,
.single-graduation_project .entry-header,
.single-graduation_project .entry-title {
  display: none !important;
}

/* Heading overrides inside our layout */
.single-graduation_project .gp-single-page h1,
.single-graduation_project .gp-single-page h2,
.single-graduation_project .gp-single-page h3,
.single-graduation_project .gp-single-page h4 {
  font-family: inherit;
  line-height: 1.4;
}

/* Base body styles, scoped to this CPT only */
body.single-graduation_project {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--gp-page-bg);
  color: var(--gp-text-main);
}

.gp-single-page {
  width: 100%;
  min-height: 100vh;
  padding: 32px 0 60px;
}

.gp-container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Back link */
.gp-back-link {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--gp-text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
}

.gp-back-link span:first-child {
  font-size: 1rem;
  line-height: 1;
}

margin-bottom: 18px;
}

/* RTL: Flip the back arrow */
html[dir="rtl"] .gp-back-link,
html[lang="ar"] .gp-back-link,
body.rtl .gp-back-link {
  flex-direction: row-reverse;
}

html[dir="rtl"] .gp-back-link span:first-child,
html[lang="ar"] .gp-back-link span:first-child,
body.rtl .gp-back-link span:first-child {
  transform: scaleX(-1);
}

/* Main layout */
.gp-single-main {
  background: #f7f7fc;
  border-radius: 30px;
  box-shadow: var(--gp-shadow-soft);
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.4fr);
  overflow: hidden;
}

@media (max-width: 960px) {
  .gp-single-main {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* LEFT COLUMN */
.gp-single-left {
  padding: 24px 24px 26px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gp-project-cover {
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  background: #e5e7eb;
  max-height: 280px;
}

.gp-project-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gp-project-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gp-text-muted);
  margin-bottom: 2px;
}

.gp-project-title {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--gp-primary);
  line-height: 1.3;
}

.gp-project-title-ar {
  margin-top: 4px;
  font-size: 1rem;
  color: var(--gp-text-muted);
  font-weight: 500;
}

.gp-meta-line {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--gp-text-muted);
}

.gp-meta-line span+span::before {
  content: "•";
  margin: 0 5px;
  color: #d1d5db;
}

.gp-language-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--gp-chip-bg);
  border: 1px solid var(--gp-border-soft);
  color: var(--gp-text-main);
}

.gp-section-title {
  margin: 12px 0 6px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--gp-primary);
}

.gp-abstract-text {
  font-size: 0.92rem;
  line-height: 1.9;
  color: var(--gp-text-muted);
  margin: 0 0 10px;
}

.gp-keywords-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.gp-keyword-pill {
  font-size: 0.78rem;
  padding: 4px 9px;
  border-radius: 999px;
  background: #fff7e5;
  border: 1px solid #ffe0a3;
  color: #92400e;
  white-space: nowrap;
}

/* RIGHT COLUMN */
.gp-single-right {
  padding: 26px 24px 26px;
  background: linear-gradient(135deg, var(--gp-primary), #16345f);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.gp-right-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gp-right-heading {
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  opacity: 0.9;
}

.gp-details-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px 18px;
  font-size: 0.86rem;
}

.gp-detail-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  opacity: 0.75;
  margin-bottom: 2px;
}

.gp-detail-value {
  font-weight: 600;
}

/* Buttons */
.gp-buttons-column {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  /* Match Graduate Research */
}

.gp-btn-primary,
.gp-btn-secondary {
  border-radius: 999px;
  border: none;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  /* Full width stretch */
  justify-content: center;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
  width: 100%;
  box-sizing: border-box;
}

/* Primary: PDF button */
.gp-btn-primary {
  background: linear-gradient(120deg, var(--gp-accent), #ffb200);
  color: #292929;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.gp-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.3);
  background: linear-gradient(120deg, #ffd45f, var(--gp-accent));
}

/* Secondary: external link */
.gp-btn-secondary {
  background: rgba(255, 255, 255, 0.14);
  color: #f9fafb;
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.gp-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.gp-project-id {
  margin-top: 12px;
  font-size: 0.8rem;
  opacity: 0.85;
}

.gp-right-footnote {
  font-size: 0.78rem;
  opacity: 0.8;
}

/* RELATED PROJECTS */
.gp-related {
  max-width: 1140px;
  margin: 26px auto 0;
  padding: 0 16px;
}

.gp-related-title {
  margin: 0 0 10px;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--gp-text-muted);
}

.gp-related-viewport {
  overflow: hidden;
}

.gp-related-strip {
  display: flex;
  transition: transform 0.5s ease;
  will-change: transform;
}

.gp-related-slide {
  flex: 0 0 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding-bottom: 6px;
}

@media (max-width: 900px) {
  .gp-related-slide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .gp-related-slide {
    grid-template-columns: minmax(0, 1fr);
  }
}

.gp-related-card {
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  font-size: 0.8rem;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

/* Related Projects Section */
.gp-related {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 1px solid var(--gp-border-soft);
}

.gp-related-title {
  margin: 0 0 24px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gp-text-heading);
}

/* 4-Column Grid (Standardized) */
.gp-related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 1200px) {
  .gp-related-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 992px) {
  .gp-related-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .gp-related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .gp-related-grid {
    grid-template-columns: 1fr;
  }
}

.gp-related-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: var(--gp-radius-md);
  border: 1px solid var(--gp-border-soft);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
}

.gp-related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  border-color: rgba(183, 150, 85, 0.3);
}

.gp-related-img {
  position: relative;
  width: 100%;
  padding-top: 60%;
  /* Aspect ratio */
  overflow: hidden;
  background: #f0f2f5;
}

.gp-related-img img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gp-related-card:hover .gp-related-img img {
  transform: scale(1.05);
}

.gp-related-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.gp-related-name {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--gp-text-heading);
}

.gp-related-name a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

.gp-related-name a:hover {
  color: var(--gp-primary);
}

.gp-related-meta {
  margin-top: auto;
  font-size: 0.75rem;
  color: var(--gp-text-muted);
}

/* RTL Support for Back Link */
html[dir="rtl"] .gp-back-link i,
body.rtl .gp-back-link i {
  transform: scaleX(-1);
  margin-right: -4px;
  margin-left: 4px;
}

/* PDF MODAL */
.gp-pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  /* Max z-index to resolve overlap */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.gp-pdf-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.gp-pdf-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(6px);
}

.gp-pdf-dialog {
  position: relative;
  max-width: 900px;
  width: 90%;
  height: 75vh;
  margin: 12vh auto 0;
  /* Match Graduate Research spacing */
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 26px 60px rgba(15, 23, 42, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(24px) scale(0.97);
  transition: transform 0.25s ease;
}

.gp-pdf-modal.is-open .gp-pdf-dialog {
  transform: translateY(0) scale(1);
}

.gp-pdf-header {
  padding: 10px 18px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, #e5e7ff, #ffffff);
}

.gp-pdf-title {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #111827;
}

.gp-pdf-close {
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  color: #6b7280;
  line-height: 1;
}

.gp-pdf-body {
  flex: 1;
  background: #f3f4f6;
}

.gp-pdf-frame {
  width: 100%;
  height: 100%;
  border: none;
}

/* ===========================
   Title + headings overrides
   =========================== */

/* Fix title color / remove any theme background */
.single-graduation_project .gp-project-title {
  background: transparent !important;
  color: var(--gp-primary) !important;
  padding: 0 !important;
  margin: 0 0 4px;
}

/* Force heading scale inside this layout – ignore theme huge sizes */
.single-graduation_project .gp-single-page h1 {
  font-size: 1.7rem !important;
  font-weight: 800 !important;
  line-height: 1.3 !important;
}

.single-graduation_project .gp-single-page h2 {
  font-size: 1rem !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
}

.single-graduation_project .gp-single-page h3 {
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
}

.single-graduation_project .gp-single-page h4 {
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
}

/* ===========================
   CTAs – same design + size
   =========================== */

.single-graduation_project .gp-btn-primary,
.single-graduation_project .gp-btn-secondary {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px !important;
  border-radius: 999px !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  line-height: 1.2;
  min-height: 40px;
  cursor: pointer;
  text-decoration: none !important;
  box-sizing: border-box;
}

/* Keep primary as gold CTA */
.single-graduation_project .gp-btn-primary {
  background: linear-gradient(120deg, var(--gp-accent), #ffb200);
  color: #292929;
  border: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.single-graduation_project .gp-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.3);
  background: linear-gradient(120deg, #ffd45f, var(--gp-accent));
}

/* Make external link button visually same style/size */
.single-graduation_project .gp-btn-secondary {
  background: #ffffff;
  color: var(--gp-primary);
  border: 1px solid var(--gp-primary);
  box-shadow: 0 10px 24px rgba(14, 32, 70, 0.15);
}

.single-graduation_project .gp-btn-secondary:hover {
  background: var(--gp-primary);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(14, 32, 70, 0.25);
}

/* Make sure inner spans/icons inherit color and not theme link styles */
.single-graduation_project .gp-btn-primary span,
.single-graduation_project .gp-btn-secondary span {
  color: inherit !important;
}