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

/* Hide default theme title on Graduate Research single */
.single-graduate_research .page-header,
.single-graduate_research .page-title,
.single-graduate_research .entry-title,
.single-graduate_research #sub-header,
.single-graduate_research .elementor-page-title {
  display: none !important;
}

/* Heading overrides inside our layout (fight theme sizes) */
.single-graduate_research .gr-single-page h1,
.single-graduate_research .gr-single-page h2,
.single-graduate_research .gr-single-page h3,
.single-graduate_research .gr-single-page h4 {
  font-family: inherit;
  line-height: 1.4;
}

.single-graduate_research .gr-title-main {
  font-size: 1.7rem !important;
  line-height: 1.35 !important;
  font-weight: 800;
  color: var(--gr-primary);
}

.single-graduate_research .gr-section-title {
  font-size: 1rem !important;
  font-weight: 700;
  color: var(--gr-primary);
}

/* Base wrapper */
.gr-single-page {
  width: 100%;
  min-height: 100vh;
  padding: 32px 0 60px;
  background: var(--gr-page-bg);
  color: var(--gr-text-main);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

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

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

.gr-back-link:hover {
  color: var(--gr-primary);
}

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

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

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

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

.gr-left {
  padding: 24px 24px 26px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

/* Left top */
.gr-article-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--gr-text-muted);
}

.gr-title-main {
  margin: 4px 0 4px;
  line-height: 1.35;
}

.gr-title-ar {
  font-size: 1rem;
  font-weight: 500;
  color: var(--gr-text-muted);
  margin: 0 0 6px;
}

.gr-student-line {
  margin: 0 0 4px;
  font-size: 0.9rem;
  color: var(--gr-text-muted);
}

.gr-program-line {
  margin: 0;
  font-size: 0.86rem;
  color: var(--gr-text-main);
  font-weight: 500;
}

.gr-lang-pill-main {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  margin-top: 6px;
  color: var(--gr-text-muted);
}

.gr-lang-pill-main span {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--gr-chip-bg);
  border: 1px solid var(--gr-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gr-text-main);
}

/* Abstract / keywords */
.gr-section-title {
  margin: 10px 0 4px;
}

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

.gr-keywords-block {
  margin-top: 5px;
}

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

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

/* RIGHT DETAILS */
.gr-right-heading {
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  opacity: 0.9;
}

.gr-details-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px 20px;
  font-size: 0.86rem;
  margin-top: 8px;
}

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

.gr-detail-value {
  font-weight: 600;
  word-break: break-word;
}

/* BUTTONS COLUMN */
.gr-buttons-column {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  /* <- make flex items stretch full width */
}


/* Unified base styles for both buttons
   (same width / shape / typography) */
body.single-graduate_research .gr-right .gr-buttons-column .gr-btn-primary,
body.single-graduate_research .gr-right .gr-buttons-column .gr-btn-secondary {
  display: flex;
  width: 100%;
  /* <- force equal width */
  box-sizing: border-box;
  justify-content: center;
  align-items: center;
  border-radius: 999px;
  border: none;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

/* Make sure inner spans follow color and no underline */
body.single-graduate_research .gr-right .gr-buttons-column .gr-btn-primary span,
body.single-graduate_research .gr-right .gr-buttons-column .gr-btn-secondary span {
  color: inherit;
  text-decoration: none;
}

/* PRIMARY – View Research PDF */
body.single-graduate_research .gr-right .gr-buttons-column .gr-btn-primary {
  background: linear-gradient(120deg, var(--gr-accent), #ffb200);
  color: #1b1b1b;
  /* dark text on bright yellow */
}

body.single-graduate_research .gr-right .gr-buttons-column .gr-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
  background: linear-gradient(120deg, #ffd45f, var(--gr-accent));
}

/* SECONDARY – View external page */
body.single-graduate_research .gr-right .gr-buttons-column .gr-btn-secondary {
  background: rgba(255, 255, 255, 0.96);
  color: var(--gr-primary);
  border: 1px solid #ffffff;
}

body.single-graduate_research .gr-right .gr-buttons-column .gr-btn-secondary:hover {
  background: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.22);
}

/* Right footnote + ID */
.gr-right-footnote {
  font-size: 0.78rem;
  opacity: 0.85;
}

.gr-article-id {
  margin-top: 6px;
  font-size: 0.8rem;
  opacity: 0.9;
}

/* RELATED RESEARCH - Premium Design */
.gr-related {
  max-width: 1140px;
  margin: 40px auto 0;
  padding: 0 16px 40px;
}

.gr-related-title {
  margin: 0 0 20px;
  font-size: 1.4rem !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gr-primary);
  position: relative;
  padding-bottom: 12px;
}

.gr-related-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--gr-accent), var(--gr-primary));
  border-radius: 2px;
}

html[dir="rtl"] .gr-related-title::after,
body.rtl .gr-related-title::after {
  left: auto;
  right: 0;
}

.gr-related-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

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

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

.gr-related-card {
  border-radius: 16px;
  border: 1px solid rgba(205, 212, 251, 0.8);
  background: linear-gradient(145deg, #ffffff 0%, #f8f9ff 100%);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  overflow: hidden;
}

.gr-related-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gr-primary), var(--gr-accent));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.gr-related-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  border-color: var(--gr-primary);
}

.gr-related-card:hover::before {
  opacity: 1;
}

.gr-related-name {
  margin: 0;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  font-family: inherit !important;
  line-height: 1.35 !important;
  color: var(--gr-text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.gr-related-name a:hover {
  color: var(--gr-primary);
  text-decoration: none;
}

.gr-related-meta {
  margin: 0;
  color: var(--gr-text-muted);
  font-size: 0.72rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gr-related-meta::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--gr-accent);
  border-radius: 50%;
  flex-shrink: 0;
}

/* PDF MODAL */
.gr-pdf-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

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

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

.gr-pdf-dialog {
  position: relative;
  max-width: 900px;
  width: 90%;
  height: 75vh;
  margin: 12vh auto 0;
  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;
}

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

.gr-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);
}

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

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

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

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

/* RTL Keyword Support */
html[dir="rtl"] .gr-keyword-pill,
html[lang="ar"] .gr-keyword-pill,
body.rtl .gr-keyword-pill {
  direction: rtl;
  unicode-bidi: isolate;
}