:root {
  --gr-primary: #1e407a;
  /* Accent 1 */
  --gr-accent: #ffc53a;
  /* Accent 2 */
  --gr-soft: #cdd4fb;
  /* Accent 3 */
  --gr-chip-bg: #b7d8ef;
  /* Accent 7 */
  --gr-text-main: #292929;
  --gr-text-muted: #545454;
  --gr-border-soft: #cdd4fb;
  --gr-page-bg: #fbfbfb;
  --gr-card-bg: #ffffff;
  --gr-radius-lg: 20px;
  --gr-radius-md: 14px;
  --gr-shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.12);
}

/* NEW HERO SECTION - Full Bleed */
.gr-hero-wrapper {
  position: relative !important;
  /* Full bleed trick: stretch beyond parent padding */
  width: 100vw !important;
  max-width: none !important;
  margin-left: calc(50% - 50vw) !important;
  margin-top: 0 !important;
  left: 0;
  height: 450px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: flex-end;
  margin-bottom: 3rem;
  /* Fallback color while image loads */
  background-color: var(--gr-primary);
}

/* Override parent container clipping for full-width hero */
.limit-wrapper,
.vamtam-box-outer-padding {
  overflow: visible !important;
}

.gr-hero-overlay-box {
  background: var(--gr-primary);
  color: #ffffff;
  padding: 2.5rem 3rem;
  width: 90%;
  max-width: 600px;
  margin-left: 10%;
  margin-bottom: -3rem;
  /* Overlap the content below */
  position: relative;
  z-index: 10;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
  .gr-hero-wrapper {
    height: 300px;
  }

  .gr-hero-overlay-box {
    width: 95%;
    margin-left: 2.5%;
    margin-bottom: -2rem;
    padding: 1.5rem 2rem;
  }
}

.gr-hero-title {
  margin: 0 0 0.75rem;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #ffffff !important;
}

.gr-hero-subtitle {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  opacity: 0.9;
  font-weight: 400;
}

/* RTL Support for Hero Section */
html[dir="rtl"] .gr-hero-overlay-box,
html[lang="ar"] .gr-hero-overlay-box,
body.rtl .gr-hero-overlay-box {
  margin-left: 0;
  margin-right: 10%;
  text-align: right;
}

html[dir="rtl"] .gr-hero-title,
html[lang="ar"] .gr-hero-title,
body.rtl .gr-hero-title {
  text-align: right;
  direction: rtl;
}

html[dir="rtl"] .gr-hero-subtitle,
html[lang="ar"] .gr-hero-subtitle,
body.rtl .gr-hero-subtitle {
  text-align: right;
  direction: rtl;
}

@media (max-width: 768px) {

  html[dir="rtl"] .gr-hero-overlay-box,
  html[lang="ar"] .gr-hero-overlay-box,
  body.rtl .gr-hero-overlay-box {
    margin-left: 0;
    margin-right: 2.5%;
  }
}

/* RTL Support for Hero Wrapper - Full bleed fix */
html[dir="rtl"] .gr-hero-wrapper,
html[lang="ar"] .gr-hero-wrapper,
body.rtl .gr-hero-wrapper {
  margin-left: 0 !important;
  margin-right: calc(50% - 50vw) !important;
  right: 0;
  left: auto;
}

/* Hide default theme archive header on this CPT */
.post-type-archive-graduate_research .page-header,
.post-type-archive-graduate_research .page-title,
.post-type-archive-graduate_research .entry-title,
.post-type-archive-graduate_research #sub-header,
.post-type-archive-graduate_research .elementor-page-title {
  display: none !important;
}

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

.post-type-archive-graduate_research .gr-title {
  font-size: 2rem !important;
  font-weight: 800;
  letter-spacing: 0.06em;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--gr-page-bg);
  color: var(--gr-text-main);
}

.gr-archive-page {
  width: 100%;
  min-height: 100vh;
  padding: 40px 0 60px;
}

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

/* HEADER */
.gr-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 26px;
}

.gr-header-main {
  max-width: 650px;
}

.gr-title {
  margin: 0;
  color: var(--gr-primary);
  text-transform: uppercase;
}

.gr-subtitle {
  margin: 8px 0 0;
  font-size: 0.95rem;
  color: var(--gr-text-muted);
  line-height: 1.7;
}

.gr-stat-card {
  min-width: 220px;
  padding: 14px 18px;
  border-radius: var(--gr-radius-md);
  background: linear-gradient(135deg, var(--gr-primary), #164885);
  color: #ffffff;
  box-shadow: 0 16px 40px rgba(6, 30, 72, 0.45);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gr-stat-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}

.gr-stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.1;
}

.gr-stat-note {
  font-size: 0.8rem;
  opacity: 0.9;
}

@media (max-width: 900px) {
  .gr-header {
    flex-direction: column;
  }

  .gr-stat-card {
    align-self: stretch;
  }
}

/* ========================================
   4. SMART FILTERS - PREMIUM PILL STYLE
   ======================================== */
.gr-smart-filters {
  margin-bottom: 50px;
}

/* Controls Wrapper */
.gr-controls-wrapper {
  background: #ffffff;
  border: 1px solid var(--gr-border-soft);
  border-radius: var(--gr-radius-lg);
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-end;
  box-shadow: var(--gr-shadow-soft);
}

.gr-control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 220px;
  flex: 1;
}

.gr-group-search {
  min-width: 280px;
  flex: 1.5;
}

.gr-control-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 800;
  color: var(--gr-primary);
  margin-bottom: 6px;
  display: block;
  padding-left: 10px;
  border-left: 3px solid var(--gr-accent);
  line-height: 1;
}

html[dir="rtl"] .gr-control-label {
  padding-left: 0;
  padding-right: 10px;
  border-left: none;
  border-right: 3px solid var(--gr-accent);
}

.gr-select,
.gr-input {
  width: 100%;
  padding: 12px 18px;
  border-radius: 10px;
  border: 2px solid var(--gr-border-soft);
  background: var(--gr-page-bg);
  font-size: 0.95rem;
  color: var(--gr-text-main);
  transition: all 0.2s ease;
  box-sizing: border-box;
  font-weight: 500;
}

.gr-select:focus,
.gr-input:focus {
  outline: none;
  border-color: var(--gr-primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 122, 0.15);
}

/* GRID + CARDS */
.gr-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

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

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

.gr-card {
  background: var(--gr-card-bg);
  border-radius: var(--gr-radius-lg);
  box-shadow: var(--gr-shadow-soft);
  border: 1px solid rgba(205, 212, 251, 0.7);
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gr-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.18);
}

.gr-card-topline {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  font-size: 0.76rem;
  color: var(--gr-text-muted);
}

.gr-card-label {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
  font-size: 0.76rem;
}

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

.gr-card-title {
  margin: 2px 0 2px;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--gr-primary);
}

.gr-card-title a {
  color: inherit;
  text-decoration: none;
}

.gr-card-title a:hover {
  text-decoration: underline;
}

.gr-card-student {
  margin: 0;
  font-size: 0.8rem;
  color: var(--gr-text-muted);
}

.gr-card-meta {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--gr-text-main);
  font-weight: 500;
}

.gr-card-abstract {
  margin: 6px 0 6px;
  font-size: 0.82rem;
  color: var(--gr-text-muted);
  line-height: 1.6;
  min-height: 40px;
}

.gr-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 4px;
}

.gr-tag {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--gr-chip-bg);
  border: 1px solid rgba(205, 212, 251, 0.9);
  font-size: 0.7rem;
  color: var(--gr-text-main);
}

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

.gr-keyword {
  padding: 3px 7px;
  border-radius: 999px;
  background: #fff7e5;
  border: 1px solid #ffe0a3;
  font-size: 0.7rem;
  color: #92400e;
}

.gr-card-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  font-size: 0.76rem;
}

.gr-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* BUTTONS */
.gr-btn {
  padding: 5px 10px;
  border-radius: 999px;
  border: none;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease,
    box-shadow 0.15s ease, transform 0.15s ease;
}

.gr-btn span {
  color: inherit;
}

/* primary: dark blue – white text */
.gr-btn-primary {
  background: linear-gradient(120deg, var(--gr-primary), #16345f);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(14, 32, 70, 0.25);
}

.gr-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(14, 32, 70, 0.35);
}

/* ghost: white pill with blue text */
.gr-btn-ghost {
  background: #ffffff;
  color: var(--gr-primary);
  border: 1px solid var(--gr-primary);
}

.gr-btn-ghost:hover {
  background: var(--gr-primary);
  color: #ffffff;
}

.gr-card-id {
  color: var(--gr-text-muted);
}

.gr-empty {
  margin-top: 18px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--gr-text-muted);
}

/* Force card title size on Graduate Research archive */
.post-type-archive-graduate_research .gr-card-title {
  font-size: 0.95rem !important;
  line-height: 1.35 !important;
  margin: 2px 0 4px;
  font-weight: 700;
  color: var(--gr-primary);
}

/* Make sure the link inside uses the same size (override theme link styles) */
.post-type-archive-graduate_research .gr-card-title a {
  font-size: inherit !important;
  line-height: inherit !important;
  font-weight: inherit !important;
  text-decoration: none;
}

/* ===========================
   Graduate Research – Archive buttons
   Make "Details" text clearly visible
   =========================== */

/* Force white text on the primary button */
.post-type-archive-graduate_research a.gr-btn-primary {
  color: #ffffff !important;
  text-decoration: none !important;
}

/* Ensure inner spans follow the same color (override theme span/link rules) */
.post-type-archive-graduate_research a.gr-btn-primary span {
  color: inherit !important;
}

/* Optional: keep hover nice but still readable */
.post-type-archive-graduate_research a.gr-btn-primary:hover {
  color: #ffffff !important;
}