/* Learning Materials + Certificates */
.heritage-page {
  --page-ink: #173f39;
  --page-muted: #60736d;
  --page-cream: #fbf7ed;
  --page-cream-dark: #f3ead9;
  --page-teal: #073f37;
  --page-gold: #d39a3d;
  background: var(--page-cream);
  color: var(--page-ink);
}

.heritage-page .navbar.scrolled {
  background: rgba(3, 33, 29, .97);
}

.heritage-page .navbar.scrolled .nav-links > a,
.heritage-page .navbar.scrolled .nav-more,
.heritage-page .navbar.scrolled .logo-text-en {
  color: rgba(255, 255, 255, .82);
}

.heritage-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 176px 0 108px;
  color: #fff;
  background:
    radial-gradient(circle at 78% 20%, rgba(211, 154, 61, .2), transparent 25%),
    linear-gradient(120deg, #032f29 0%, #075247 100%);
}

.heritage-hero::before,
.heritage-section.patterned::before,
.heritage-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("chain-pattern.png") center / 440px repeat;
  opacity: .07;
}

.heritage-hero .container { position: relative; }

.heritage-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 70px;
  align-items: center;
}

.heritage-eyebrow {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  color: #edc77d;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .28em;
  text-transform: uppercase;
}

.heritage-eyebrow::before {
  width: 34px;
  height: 1px;
  background: currentColor;
  content: "";
}

.heritage-hero h1 {
  max-width: 850px;
  margin: 0 0 24px;
  font-family: var(--font-display);
  font-size: clamp(3.1rem, 6.5vw, 6.4rem);
  font-weight: 500;
  line-height: .98;
  letter-spacing: -.04em;
}

.heritage-hero h1 span {
  display: block;
  color: #e5b45d;
  font-style: italic;
}

.heritage-hero-copy {
  max-width: 720px;
  color: rgba(255, 255, 255, .72);
  font-size: 1.03rem;
  line-height: 1.85;
}

.heritage-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 34px;
  color: rgba(255, 255, 255, .82);
  font-size: .78rem;
  font-weight: 600;
}

.heritage-trust span::before {
  margin-right: 8px;
  color: #e5b45d;
  content: "✦";
}

.hero-seal {
  position: relative;
  display: grid;
  width: 290px;
  height: 290px;
  place-items: center;
  justify-self: end;
  border: 1px solid rgba(229, 180, 93, .5);
  border-radius: 50%;
  background: rgba(255, 255, 255, .035);
  box-shadow: 0 0 0 24px rgba(229, 180, 93, .035), 0 32px 90px rgba(0, 0, 0, .2);
  text-align: center;
}

.hero-seal::before,
.hero-seal::after {
  position: absolute;
  border: 1px dashed rgba(229, 180, 93, .32);
  border-radius: 50%;
  content: "";
}
.hero-seal::before { inset: 18px; }
.hero-seal::after { inset: 42px; }
.hero-seal strong {
  color: #e5b45d;
  font-family: var(--font-ar);
  font-size: 3.4rem;
  line-height: 1;
}
.hero-seal span {
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, .64);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.heritage-section {
  position: relative;
  padding: 92px 0;
}
.heritage-section.patterned { isolation: isolate; background: var(--page-cream-dark); }
.heritage-section.patterned::before { opacity: .035; }

.heritage-intro {
  display: grid;
  grid-template-columns: .72fr 1fr;
  gap: 76px;
  align-items: start;
}

.section-label {
  color: #ae7728;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .25em;
  text-transform: uppercase;
}

.heritage-section h2,
.heritage-cta h2 {
  margin: 12px 0 18px;
  color: var(--page-teal);
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 4.3vw, 4.2rem);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -.025em;
}

.heritage-intro-copy {
  padding-top: 27px;
  color: var(--page-muted);
  font-size: 1rem;
  line-height: 1.9;
}
.heritage-intro-copy p + p { margin-top: 16px; }

.library-tools {
  position: sticky;
  top: 84px;
  z-index: 20;
  padding: 18px 0;
  border-top: 1px solid rgba(7, 63, 55, .1);
  border-bottom: 1px solid rgba(7, 63, 55, .1);
  background: rgba(251, 247, 237, .94);
  backdrop-filter: blur(14px);
}
.library-tools .container {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}
.library-search {
  width: min(340px, 100%);
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(7, 63, 55, .15);
  border-radius: 999px;
  background: #fffdf8;
  color: var(--page-ink);
  outline: none;
}
.library-search:focus { border-color: var(--page-gold); box-shadow: 0 0 0 4px rgba(211, 154, 61, .12); }
.filter-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-pill {
  padding: 9px 15px;
  border: 1px solid rgba(7, 63, 55, .13);
  border-radius: 999px;
  background: transparent;
  color: #42615b;
  font-size: .76rem;
  font-weight: 700;
}
.filter-pill:hover,
.filter-pill.active { border-color: var(--page-teal); background: var(--page-teal); color: #fff; }

.collection + .collection { margin-top: 74px; }
.collection-heading {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 520px);
  gap: 36px;
  align-items: end;
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(7, 63, 55, .13);
}
.collection-heading h2 { margin: 5px 0 0; font-size: clamp(2rem, 3vw, 3rem); }
.collection-heading p { color: var(--page-muted); font-size: .9rem; line-height: 1.7; }
.collection-index { color: #c58e37; font-family: var(--font-display); font-size: .9rem; }

.material-grid,
.certificate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.material-card,
.certificate-card-new {
  position: relative;
  overflow: hidden;
  padding: 30px;
  border: 1px solid rgba(7, 63, 55, .11);
  border-radius: 8px;
  background: rgba(255, 253, 248, .86);
  box-shadow: 0 18px 55px rgba(7, 63, 55, .055);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.material-card::before,
.certificate-card-new::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--page-gold);
  content: "";
  transform: scaleY(.3);
  transition: transform .25s ease;
}
.material-card:hover,
.certificate-card-new:hover { transform: translateY(-4px); border-color: rgba(211, 154, 61, .45); box-shadow: 0 25px 70px rgba(7, 63, 55, .1); }
.material-card:hover::before,
.certificate-card-new:hover::before { transform: scaleY(1); }
.material-card[hidden] { display: none; }

.material-meta,
.certificate-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.material-meta span,
.certificate-meta span {
  padding: 5px 10px;
  border-radius: 999px;
  background: #edf5f1;
  color: #356359;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.material-card h3,
.certificate-card-new h3 { margin-bottom: 4px; color: var(--page-teal); font-family: var(--font-display); font-size: 1.55rem; line-height: 1.2; }
.arabic-title { margin-bottom: 14px; color: #b37c2c; font-family: var(--font-ar); font-size: 1rem; font-weight: 700; }
.material-card > p,
.certificate-card-new > p { color: var(--page-muted); font-size: .88rem; line-height: 1.75; }
.card-note {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(7, 63, 55, .1);
  color: #45655e;
  font-size: .75rem;
  font-weight: 600;
}
.card-note::before { color: var(--page-gold); content: "✦"; }

.request-strip {
  display: flex;
  gap: 32px;
  align-items: center;
  justify-content: space-between;
  margin-top: 72px;
  padding: 38px 42px;
  border: 1px solid rgba(211, 154, 61, .26);
  border-radius: 8px;
  background: #fffaf0;
}
.request-strip h3 { color: var(--page-teal); font-family: var(--font-display); font-size: 1.8rem; }
.request-strip p { max-width: 690px; color: var(--page-muted); font-size: .86rem; }

.heritage-btn {
  display: inline-flex;
  min-height: 48px;
  padding: 12px 22px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--page-gold);
  color: #fff;
  font-size: .82rem;
  font-weight: 700;
  white-space: nowrap;
  transition: .25s ease;
}
.heritage-btn:hover { transform: translateY(-2px); background: #bf832a; }
.heritage-btn.outline { border-color: rgba(255,255,255,.35); background: transparent; color: #fff; }
.heritage-btn.outline:hover { border-color: #fff; background: rgba(255,255,255,.08); }

.certificate-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.certificate-card-new { min-height: 100%; }
.certificate-number { margin-bottom: 24px; color: #c58e37; font-family: var(--font-display); font-size: 2.2rem; line-height: 1; }
.certificate-card-new.featured { grid-column: span 2; color: #fff; background: var(--page-teal); }
.certificate-card-new.featured h3 { color: #f3c773; font-size: 2rem; }
.certificate-card-new.featured > p { color: rgba(255,255,255,.68); }
.certificate-card-new.featured .arabic-title { color: #f0c578; }
.certificate-card-new.featured .certificate-meta span { background: rgba(255,255,255,.09); color: rgba(255,255,255,.78); }
.certificate-card-new.featured .card-note { border-color: rgba(255,255,255,.13); color: rgba(255,255,255,.76); }

.process-line { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-top: 42px; }
.process-step { position: relative; padding: 25px 20px; border-top: 1px solid rgba(7,63,55,.18); }
.process-step strong { display: block; margin-bottom: 12px; color: #c58e37; font-family: var(--font-display); font-size: 1.6rem; }
.process-step h3 { margin-bottom: 8px; color: var(--page-teal); font-size: .95rem; }
.process-step p { color: var(--page-muted); font-size: .78rem; line-height: 1.65; }

.faq-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 36px; }
.faq-list details { padding: 20px 22px; border: 1px solid rgba(7,63,55,.11); border-radius: 8px; background: rgba(255,255,255,.65); }
.faq-list summary { color: var(--page-teal); cursor: pointer; font-size: .9rem; font-weight: 700; }
.faq-list p { padding-top: 12px; color: var(--page-muted); font-size: .82rem; line-height: 1.7; }

.heritage-cta {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 88px 0;
  color: #fff;
  text-align: center;
  background: var(--page-teal);
}
.heritage-cta h2 { color: #fff; }
.heritage-cta p { max-width: 720px; margin: 0 auto 28px; color: rgba(255,255,255,.68); }
.heritage-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

@media (max-width: 1050px) {
  .heritage-hero-inner { grid-template-columns: 1fr; }
  .hero-seal { display: none; }
  .certificate-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .process-line { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .heritage-hero { padding: 140px 0 76px; }
  .heritage-hero h1 { font-size: clamp(2.7rem, 13vw, 4.2rem); }
  .heritage-section { padding: 66px 0; }
  .heritage-intro,
  .material-grid,
  .certificate-grid,
  .process-line,
  .faq-list,
  .collection-heading { grid-template-columns: 1fr; }
  .certificate-card-new.featured { grid-column: auto; }
  .library-tools { position: static; }
  .library-tools .container { align-items: stretch; flex-direction: column; }
  .library-search { width: 100%; }
  .filter-pills { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .filter-pill { flex: 0 0 auto; }
  .material-card, .certificate-card-new { padding: 24px; }
  .request-strip { align-items: flex-start; flex-direction: column; padding: 28px; }
}
