@layer reset, tokens, base, layout, components, utilities, responsive;

@import url("tokens.css") layer(tokens);
@import url("base.css") layer(base);
@import url("layout.css") layer(layout);
@import url("components.css?v=3") layer(components);
@import url("utilities.css") layer(utilities);
@import url("responsive.css?v=3") layer(responsive);

/* Contact alignment and spacing */
.site-footer .footer-contact,
footer .footer-contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.site-footer .footer-contact > *,
footer .footer-contact > * {
  margin: 0;
  line-height: 1.55;
}

.site-footer .footer-contact a,
footer .footer-contact a {
  display: block;
}

/* Contact page: keep contact details cleanly aligned with consistent spacing */
.contact-page .contact-details,
.contact-page .contact-info,
.contact-page .contact-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-page .contact-details > *,
.contact-page .contact-info > *,
.contact-page .contact-list > * {
  margin: 0;
  line-height: 1.55;
}


/* All Pakistan Ahle Hadees Federation department closing CTA additions */
.department-cta{width:min(1160px,calc(100% - 48px));margin:0 auto 86px;min-height:180px;position:relative;overflow:hidden;display:grid;grid-template-columns:220px 1fr auto;align-items:center;gap:30px;border-radius:22px;background:#103f36;color:#fff;box-shadow:0 20px 48px rgba(4,50,42,.16)}
.department-cta .department-cta-image{height:100%;min-height:180px;overflow:hidden;display:flex;align-items:center;justify-content:center;background:linear-gradient(145deg,#f3eee5,#fbf6ee)}
.department-cta .department-cta-image img{width:100%;height:100%;object-fit:contain;display:block;padding:24px}
.department-cta .department-cta-copy{padding:28px 0}
.department-cta .department-cta-copy .department-cta-eyebrow{color:#e59680;margin:0 0 9px;text-transform:uppercase;letter-spacing:.16em;font-weight:800;font-size:.82rem}
.department-cta h2{margin:0;font:600 clamp(1.8rem,3vw,2.65rem)/1.08 var(--display);letter-spacing:-.03em;color:#fff}
.department-cta .department-cta-copy>p:last-child{margin:10px 0 0;max-width:580px;color:rgba(255,255,255,.75);font-size:14px;line-height:1.65}
.department-cta .department-cta-actions{padding:28px 30px 28px 0;display:flex;gap:10px;flex-wrap:wrap}
.department-cta .department-cta-actions a{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:12px 17px;border-radius:10px;text-decoration:none;font-weight:700;font-size:13px}
.department-cta .department-cta-actions .light{background:#fff;color:var(--forest)}
.department-cta .department-cta-actions .accent{background:#df8a72;color:#fff}
.health-cta .health-cta-image img{object-fit:contain;padding:24px;background:linear-gradient(145deg,#f3eee5,#fbf6ee)}
@media (max-width:980px){.department-cta{grid-template-columns:170px 1fr}.department-cta .department-cta-actions{grid-column:1/-1;padding:0 24px 24px}}
@media (max-width:700px){.department-cta{width:calc(100% - 36px);grid-template-columns:1fr;margin-bottom:58px}.department-cta .department-cta-image{min-height:190px}.department-cta .department-cta-copy{padding:25px 24px 0}.department-cta .department-cta-actions{padding:18px 24px 25px}}

/* Homepage Ulema slider integrated into the existing About/Who section */
.who-ulema-block{
  position:relative;
  z-index:2;
  width:100%;
  margin:0 0 clamp(108px,10vw,138px);
  padding-top:clamp(38px,5vw,62px);
  overflow:hidden;
}
.who-ulema-block .ulema-slider-shell{
  width:min(var(--content-max),calc(100% - 48px));
  margin:0 auto;
}
.who-ulema-block .ulema-slider-intro{
  max-width:760px;
  margin:0 auto clamp(28px,3.5vw,38px);
  text-align:center;
}
.who-ulema-block .ulema-slider-title{
  margin:0;
  color:var(--forest);
  font:600 clamp(2rem,3.2vw,3rem)/1.08 var(--display);
  letter-spacing:-.035em;
  text-wrap:balance;
}
.who-ulema-block .ulema-slider{
  position:relative;
}
.who-ulema-block .ulema-slider-viewport{
  position:relative;
  overflow:hidden;
  padding:2px 0 6px;
  -webkit-mask-image:linear-gradient(to right,transparent 0,#000 3%,#000 97%,transparent 100%);
  mask-image:linear-gradient(to right,transparent 0,#000 3%,#000 97%,transparent 100%);
}
.who-ulema-block .ulema-slider-track{
  display:flex;
  flex-direction:row;
  direction:ltr;
  gap:20px;
  width:max-content;
  will-change:transform;
}
.who-ulema-block .ulema-slider-set{direction:ltr;}
.who-ulema-block .ulema-slider-set{
  display:flex;
  align-items:stretch;
  gap:20px;
  flex:none;
}
.who-ulema-block .ulema-card{
  position:relative;
  direction:ltr;
  display:block;
  flex:0 0 calc((min(1180px,calc(100vw - 48px)) - 60px) / 4);
  width:calc((min(1180px,calc(100vw - 48px)) - 60px) / 4);
  min-width:240px;
  text-decoration:none;
  color:inherit;
}
.who-ulema-block .ulema-card-media{
  position:relative;
  height:clamp(270px,25vw,360px);
  overflow:hidden;
  border-radius:18px;
  background:#0c2f28;
  box-shadow:0 14px 30px rgba(23,59,50,.13);
  isolation:isolate;
}
.who-ulema-block .ulema-card-media::after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(to top,rgba(4,18,14,.9) 0%,rgba(4,18,14,.32) 34%,rgba(4,18,14,0) 64%);
  z-index:1;
}
.who-ulema-block .ulema-card-media img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
  filter:grayscale(1);
  transform:scale(1.01);
  transition:filter 320ms ease,transform 500ms cubic-bezier(.2,.75,.25,1);
}
.who-ulema-block .ulema-card-arrow{
  position:absolute;
  top:13px;
  right:16px;
  z-index:3;
  color:var(--white);
  font-size:1.8rem;
  line-height:1;
  text-shadow:0 2px 12px rgba(0,0,0,.28);
  transition:transform 260ms cubic-bezier(.2,.75,.25,1);
}
.who-ulema-block .ulema-card-overlay{
  position:absolute;
  right:0;
  bottom:0;
  left:0;
  z-index:2;
  padding:15px 17px 17px;
}
.who-ulema-block .ulema-card-name,.who-ulema-block .ulema-card-role{
  display:block;
}
.who-ulema-block .ulema-card-name{
  color:var(--white);
  font:600 1rem/1.2 var(--body);
}
.who-ulema-block .ulema-card-role{
  margin-top:4px;
  color:rgba(255,253,248,.72);
  font-size:.84rem;
  line-height:1.4;
}
.who-ulema-block .ulema-card:hover .ulema-card-media img,.who-ulema-block .ulema-card:focus-visible .ulema-card-media img{
  filter:grayscale(0);
  transform:scale(1.035);
}
.who-ulema-block .ulema-card:hover .ulema-card-arrow,.who-ulema-block .ulema-card:focus-visible .ulema-card-arrow{
  transform:translate(3px,-4px) rotate(-44deg);
  text-shadow:0 3px 14px rgba(0,0,0,.35);
}
.who-ulema-block .ulema-card:focus-visible{
  outline:3px solid rgba(201,120,103,.72);
  outline-offset:5px;
}
html[dir="rtl"] .who-ulema-block .ulema-card{direction:rtl;}
html[dir="rtl"] .who-ulema-block .ulema-card-arrow{
  right:auto;
  left:16px;
  transform:scaleX(-1);
}
html[dir="rtl"] .who-ulema-block .ulema-card:hover .ulema-card-arrow,
html[dir="rtl"] .who-ulema-block .ulema-card:focus-visible .ulema-card-arrow{
  transform:translate(-3px,-4px) rotate(44deg) scaleX(-1);
}

/* The Ulema slider now belongs to the existing About/Who section, so the
   existing two-column About layout is kept intact in its own wrapper. */
.who-section{
  display:block;
  min-height:auto;
  padding:0 clamp(24px,7vw,120px) clamp(82px,10vw,120px);
}
.who-content-grid{
  position:relative;
  z-index:2;
  margin-top:clamp(76px,7vw,104px);
  display:grid;
  grid-template-columns:minmax(0,.88fr) minmax(470px,1.12fr);
  align-items:center;
  gap:clamp(54px,8vw,130px);
}
@media(max-width:1050px){
  .who-ulema-block{margin-bottom:96px;}
  .who-ulema-block .ulema-card{
    flex-basis:calc((min(100vw - 48px,860px) - 36px) / 2);
    width:calc((min(100vw - 48px,860px) - 36px) / 2);
  }
  .who-ulema-block .ulema-card-media{height:clamp(270px,38vw,330px);}
  .who-content-grid{grid-template-columns:1fr;gap:48px;margin-top:72px;}
  .who-copy{max-width:760px;}
  .network-column{width:min(100%,560px);justify-self:center;}
}
@media(max-width:780px){
  .who-section{padding:0 22px 72px;}
  .who-content-grid{margin-top:58px;}
  .who-ulema-block{margin-bottom:80px;padding-top:34px;}
  .who-ulema-block .ulema-slider-shell{width:calc(100% - 2px);}
  .who-ulema-block .ulema-slider-intro{margin-bottom:24px;}
  .who-ulema-block .ulema-slider-title{font-size:clamp(1.65rem,7vw,2.2rem);}
  .who-ulema-block .ulema-slider-set{gap:14px;}
  .who-ulema-block .ulema-slider-track{gap:14px;}
  .who-ulema-block .ulema-card{
    flex-basis:calc((100vw - 46px) * .78);
    width:calc((100vw - 46px) * .78);
    min-width:0;
  }
  .who-ulema-block .ulema-card-media{height:clamp(290px,88vw,360px);border-radius:16px;}
}
@media(prefers-reduced-motion:reduce){
  .who-ulema-block .ulema-card-media img,.who-ulema-block .ulema-card-arrow{transition:none;}
}

/* Full-width statement directly beneath the homepage priority strip */
/* Full-width statement directly beneath the homepage priority strip */

.platform-intro {
  width: 100%;
  padding: 18px 0 20px;
  background: var(--ivory);
  text-align: center;
}

.platform-intro-inner {
  width: 100%;
  min-height: 72px;
  margin: 0;
  padding: 0 clamp(18px, 3vw, 42px);
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid rgba(18, 55, 47, .12);
  border-bottom: 1px solid rgba(18, 55, 47, .12);
  box-sizing: border-box;
}

.platform-intro p {
  width: 100%;
  margin: 0;
  color: var(--forest-deep);
  font: 600 clamp(2rem, 2.5vw, 2rem) / 1.25 var(--body);
  letter-spacing: .07em;
  white-space: nowrap;
}
@media(max-width:900px){
  .platform-intro p{
    white-space:normal;
    font-size:clamp(.95rem,2.6vw,1.35rem);
    letter-spacing:.045em;
  }
}
@media(max-width:600px){
  .platform-intro{padding:14px 0 16px;}
  .platform-intro-inner{min-height:58px; padding-inline:14px;}
  .platform-intro p{letter-spacing:.025em;}
}


/* Shared semantic hooks for department-page structure.
   Existing classes remain the source of visual styling; these attributes only
   provide a consistent DOM contract for future maintenance and Laravel/Blade conversion. */
[data-department-section="hero"] { position: relative; }
[data-department-section="overview"],
[data-department-section="focus"],
[data-department-section="programs"],
[data-department-section="cta"] { position: relative; }

/* Ulema page: editorial profile layout matching the existing About page language */
.ulema-page {
  color: var(--forest);
  background: var(--paper);
}

.ulema-page .site-header {
  color: var(--color-white);
  background: rgba(9, 40, 33, .38);
  border-color: rgba(255,255,255,.2);
  box-shadow: 0 14px 34px rgba(5, 24, 19, .2);
}

.ulema-hero {
  min-height: clamp(320px, 36vh, 400px);
  padding-top: calc(var(--header-clearance) + clamp(52px, 6vw, 78px));
  padding-bottom: clamp(48px, 5.5vw, 72px);
  display: grid;
  place-items: center;
  text-align: center;
  color: #fffaf3;
  background:
    linear-gradient(90deg, rgba(5, 30, 24, .78) 0%, rgba(5, 30, 24, .52) 45%, rgba(5, 30, 24, .18) 100%),
    linear-gradient(0deg, rgba(5, 30, 24, .34), rgba(5, 30, 24, .06)),
    url("../assets/membership/membership-hero-landscape.webp") center 48% / cover no-repeat;
}

.ulema-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 76% 28%, rgba(230, 160, 145, .2), transparent 26%),
    radial-gradient(rgba(255, 250, 243, .13) .65px, transparent .7px);
  background-size: auto, 18px 18px;
  mask-image: linear-gradient(90deg, black, rgba(0, 0, 0, .65) 70%, transparent 100%);
  pointer-events: none;
}

.ulema-hero .about-hero-inner {
  position: relative;
  z-index: 1;
}

.ulema-hero h1 {
  color: #fffaf3;
  text-shadow: 0 18px 34px rgba(0, 0, 0, .28);
}

.ulema-hero p:last-child {
  color: #e6a091;
  text-shadow: 0 12px 26px rgba(0, 0, 0, .24);
}

.ulema-profiles-section {
  position: relative;
  overflow: hidden;
  padding: clamp(74px, 8vw, 118px) max(clamp(24px, 7vw, 120px), calc((100vw - var(--container-max)) / 2)) clamp(88px, 9vw, 132px);
  background: var(--paper);
}

.ulema-profiles-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(18,55,47,.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18,55,47,.032) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: linear-gradient(90deg, transparent, black 22%, black 78%, transparent);
  pointer-events: none;
}

.ulema-profiles-intro,
.ulema-profiles-list {
  position: relative;
  z-index: 1;
}

.ulema-profiles-intro {
  max-width: 840px;
  margin: 0 auto clamp(42px, 5vw, 64px);
  text-align: center;
}


.ulema-profiles-intro h2 {
  margin: 0;
  color: var(--forest-deep);
  font: 600 clamp(2.9rem, 4.55vw, 5.05rem)/.98 var(--display);
  letter-spacing: -.052em;
  text-wrap: balance;
}

.ulema-profiles-list {
  width: min(var(--content-max), 100%);
  margin: 0 auto;
}

.ulema-profile {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(390px, .8fr);
  align-items: center;
  gap: clamp(48px, 8vw, 116px);
  padding: clamp(72px, 8vw, 116px) 0;
  border-top: 1px solid rgba(18,55,47,.10);
  scroll-margin-top: 110px;
}

.ulema-profile:first-child {
  border-top: 0;
  padding-top: 12px;
}

.ulema-profile-reverse {
  grid-template-columns: minmax(390px, .8fr) minmax(0, .95fr);
}

.ulema-profile-copy {
  min-width: 0;
}

.ulema-profile-copy .section-eyebrow {
  margin-bottom: 14px;
  color: var(--clay);
}

.ulema-profile-copy h2 {
  max-width: 720px;
  margin: 0;
  color: var(--forest-deep);
  font: 600 clamp(2.8rem, 4.3vw, 5rem)/.97 var(--display);
  letter-spacing: -.05em;
  text-wrap: balance;
}

.ulema-designation {
  margin: 20px 0 0;
  color: var(--clay);
  font: 700 clamp(1.25rem, 1.85vw, 1.72rem)/1.24 var(--body);
  letter-spacing: -.018em;
}

.ulema-profile-body {
  max-width: 700px;
  margin-top: 26px;
  color: #5e7069;
  font-size: clamp(.92rem, 1vw, 1.03rem);
  line-height: 1.82;
}

.ulema-profile-body p {
  margin: 0;
}

.ulema-profile-body p + p {
  margin-top: 18px;
  color: var(--forest);
}

.ulema-profile-image {
  position: relative;
  height: clamp(300px, 32vw, 420px);
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(18,55,47,.13);
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(18,55,47,.86), rgba(18,55,47,.64));
  box-shadow: 0 28px 70px rgba(9,40,33,.15);
}

.ulema-profile-image::before {
  content: "";
  position: absolute;
  inset: 22px;
  z-index: 2;
  border: 1px solid rgba(255,250,243,.18);
  pointer-events: none;
}

.ulema-profile-image::after {
  content: "";
  position: absolute;
  width: 72%;
  aspect-ratio: 1;
  top: -24%;
  right: -18%;
  z-index: 2;
  border: 1px solid rgba(255,250,243,.18);
  border-radius: 50%;
  pointer-events: none;
}

.ulema-profile-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: saturate(1.02) contrast(1.02);
}

.ulema-image-index {
  position: absolute;
  left: clamp(24px, 3vw, 38px);
  bottom: clamp(20px, 2.6vw, 32px);
  z-index: 3;
  color: rgba(255,250,243,.72);
  font: 600 .68rem/1 var(--body);
  letter-spacing: .17em;
}

.ulema-profile.is-targeted {
  padding-inline: 18px;
  margin-inline: -18px;
  border-radius: 4px;
  background: rgba(226, 215, 194, .28);
  transition: background .3s ease;
}

html[dir="rtl"] .ulema-profile-copy .section-eyebrow {
  justify-content: flex-start;
}

@media (max-width: 1050px) {
  .ulema-profile,
  .ulema-profile-reverse {
    grid-template-columns: 1fr;
    gap: 42px;
  }

  .ulema-profile-image {
    height: clamp(300px, 50vw, 390px);
    min-height: 0;
  }

  .ulema-profile-reverse .ulema-profile-image {
    order: 1;
  }

  .ulema-profile-reverse .ulema-profile-copy {
    order: 2;
  }
}

@media (max-width: 780px) {
  .ulema-hero {
    min-height: auto;
    padding: calc(var(--header-clearance) + 48px) 22px 56px;
  }

  .ulema-profiles-section {
    padding: 72px 22px 88px;
  }

  .ulema-profiles-intro {
    margin-bottom: 40px;
  }

  .ulema-profiles-intro h2 {
    font-size: clamp(2.5rem, 11vw, 4.1rem);
  }


  .ulema-profile,
  .ulema-profile-reverse {
    gap: 30px;
    padding: 62px 0;
    scroll-margin-top: 94px;
  }

  .ulema-profile:first-child {
    padding-top: 0;
  }

  .ulema-profile-copy h2 {
    font-size: clamp(2.45rem, 10.7vw, 4rem);
  }

  .ulema-designation {
    margin-top: 16px;
    font-size: clamp(1.15rem, 5.2vw, 1.45rem);
  }

  .ulema-profile-body {
    margin-top: 20px;
    font-size: .94rem;
  }

  .ulema-profile-image {
    height: clamp(260px, 62vw, 340px);
    min-height: 0;
  }

  .ulema-profile.is-targeted {
    padding-inline: 10px;
    margin-inline: -10px;
  }
}

@media (max-width: 520px) {
  .ulema-hero {
    min-height: auto;
    padding: calc(var(--header-clearance) + 42px) 20px 50px;
  }

  .ulema-profiles-section {
    padding: 64px 20px 78px;
  }

  .ulema-profile,
  .ulema-profile-reverse {
    gap: 26px;
    padding: 54px 0;
  }

  .ulema-profile-copy h2 {
    font-size: clamp(2.2rem, 11.2vw, 3.3rem);
  }

  .ulema-profile-image {
    height: 270px;
    min-height: 0;
  }

  .ulema-profile-image::before {
    inset: 16px;
  }
}

/* History of Ahle Hadees page: continuous editorial timeline */
.history-page .history-hero {
  min-height: clamp(320px, 36vh, 400px);
  color: #fffaf3;
  background:
    linear-gradient(90deg, rgba(5, 30, 24, .82) 0%, rgba(5, 30, 24, .58) 42%, rgba(5, 30, 24, .18) 100%),
    linear-gradient(0deg, rgba(5, 30, 24, .38), rgba(5, 30, 24, .08)),
    url("../assets/about/about-hero-scenery.webp") center 54% / cover no-repeat;
}
.history-page .history-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 76% 28%, rgba(230, 160, 145, .18), transparent 26%),
    radial-gradient(rgba(255, 250, 243, .11) .65px, transparent .7px);
  background-size: auto, 18px 18px;
  mask-image: linear-gradient(90deg, black, rgba(0, 0, 0, .65) 70%, transparent 100%);
  pointer-events: none;
}
.history-page .history-hero h1 {
  color: #fffaf3;
  text-shadow: 0 18px 34px rgba(0, 0, 0, .28);
}
.history-page .history-hero p:last-child {
  color: #e6a091;
  text-shadow: 0 12px 26px rgba(0, 0, 0, .24);
}

.history-timeline-section {
  position: relative;
  overflow: hidden;
  padding: clamp(78px, 8vw, 118px) 24px clamp(90px, 9vw, 126px);
  background:
    radial-gradient(circle at 12% 15%, rgba(27, 78, 67, .055), transparent 26%),
    radial-gradient(circle at 88% 76%, rgba(200, 110, 77, .06), transparent 28%),
    repeating-linear-gradient(0deg, rgba(34, 58, 51, .018) 0, rgba(34, 58, 51, .018) 1px, transparent 1px, transparent 7px),
    #f4f0e8;
}
.history-timeline-wrap {
  width: min(1160px, 100%);
  margin: 0 auto;
}
.history-intro-head {
  width: min(720px, 100%);
  margin: 0 auto clamp(64px, 7vw, 92px);
  text-align: center;
}
.history-intro-head .section-eyebrow {
  justify-content: center;
}
.history-intro-head h2 {
  margin: 16px 0 0;
  color: var(--forest-deep);
  font: 500 clamp(2.8rem, 5vw, 4.8rem)/.98 var(--display);
  letter-spacing: -.055em;
  text-wrap: balance;
}
.history-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(54px, 7vw, 84px);
}
.history-timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  transform: translateX(-50%) scaleY(var(--history-line-scale, 1));
  transform-origin: top center;
  background: linear-gradient(to bottom, transparent, rgba(17, 59, 49, .26) 8%, rgba(17, 59, 49, .26) 92%, transparent);
}
.history-timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr);
  align-items: center;
  min-height: 220px;
}
.history-timeline-item::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%) scale(var(--history-marker-scale, 1));
  transform-origin: center;
  border: 5px solid #f4f0e8;
  border-radius: 50%;
  background: var(--clay);
  box-shadow: 0 0 0 1px rgba(17, 59, 49, .18), 0 7px 16px rgba(17, 59, 49, .12);
  z-index: 3;
}
.history-timeline-card {
  position: relative;
  width: min(100%, 480px);
  padding: clamp(28px, 3.2vw, 40px);
  border: 1px solid rgba(17, 59, 49, .10);
  border-radius: 4px;
  background: rgba(255, 252, 246, .78);
  box-shadow: 0 20px 50px rgba(17, 59, 49, .07);
  backdrop-filter: blur(2px);
}
.history-timeline-left .history-timeline-card { grid-column: 1; justify-self: end; }
.history-timeline-left .history-timeline-spacer { grid-column: 3; }
.history-timeline-right .history-timeline-spacer { grid-column: 1; }
.history-timeline-right .history-timeline-card { grid-column: 3; justify-self: start; }
.history-timeline-number {
  display: inline-block;
  margin-bottom: 12px;
  color: rgba(17, 59, 49, .44);
  font: 700 .72rem/1 var(--body);
  letter-spacing: .18em;
}
.history-timeline-card h3 {
  margin: 0;
  color: var(--forest-deep);
  font: 600 clamp(1.65rem, 2.5vw, 2.35rem)/1.08 var(--display);
  letter-spacing: -.035em;
}
.history-timeline-card p {
  margin: 16px 0 0;
  color: #53645d;
  font: 400 1rem/1.85 var(--body);
}

html[data-language="ur"] .history-timeline-section,
html[data-language="ar"] .history-timeline-section {
  font-family: var(--body);
}
html[data-language="ur"] .history-intro-head,
html[data-language="ar"] .history-intro-head {
  text-align: center;
}
html[data-language="ur"] .history-timeline-card,
html[data-language="ar"] .history-timeline-card {
  text-align: right;
}

@media (max-width: 820px) {
  .history-timeline-section {
    padding-inline: 20px;
  }
  .history-timeline::before {
    left: 18px;
    transform: scaleY(var(--history-line-scale, 1));
    transform-origin: top center;
  }
  .history-timeline-item,
  .history-timeline-left,
  .history-timeline-right {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    min-height: 0;
  }
  .history-timeline-item::after {
    left: 18px;
    top: 34px;
    transform: translate(-50%, 0);
  }
  .history-timeline-card,
  .history-timeline-left .history-timeline-card,
  .history-timeline-right .history-timeline-card {
    grid-column: 2;
    grid-row: 1;
    justify-self: stretch;
    width: 100%;
  }
  .history-timeline-spacer {
    display: none;
  }
  .history-timeline-card {
    padding: 26px 24px 28px;
  }
}

@media (max-width: 520px) {
  .history-page .history-hero {
    min-height: auto;
    padding: calc(var(--header-clearance) + 42px) 20px 50px;
  }
  .history-intro-head {
    margin-bottom: 52px;
  }
  .history-timeline-card h3 {
    font-size: clamp(1.55rem, 8vw, 2.05rem);
  }
  .history-timeline-card p {
    font-size: .95rem;
    line-height: 1.78;
  }
}

/* Infinite Ulema marquee is driven by requestAnimationFrame in script.js.
   Keeping the track animation-free here prevents RTL/reduced-motion CSS rules
   from cancelling the loop or creating a blank frame at the clone boundary. */

/* Physical left/right fade overlays so the edge fade remains visible in RTL. */
.who-ulema-block .ulema-slider-viewport{
  -webkit-mask-image:none;
  mask-image:none;
}
.who-ulema-block .ulema-slider-viewport::before,
.who-ulema-block .ulema-slider-viewport::after{
  content:"";
  position:absolute;
  top:0;
  bottom:0;
  width:42px;
  z-index:4;
  pointer-events:none;
}
.who-ulema-block .ulema-slider-viewport::before{
  left:0;
  background:linear-gradient(to right, rgba(247,244,237,.34), rgba(247,244,237,0));
}
.who-ulema-block .ulema-slider-viewport::after{
  right:0;
  background:linear-gradient(to left, rgba(247,244,237,.34), rgba(247,244,237,0));
}

@media(max-width:600px){
  .who-ulema-block .ulema-slider-viewport::before,
  .who-ulema-block .ulema-slider-viewport::after{width:28px;}
}



/* Ulema slider RTL fix (Urdu/Arabic): the viewport must stay LTR, otherwise
   in dir="rtl" the wider track anchors to the right edge and translating it
   left only reveals blank space, so the marquee looks stopped. */
.who-ulema-block .ulema-slider,
.who-ulema-block .ulema-slider-viewport,
html[dir="rtl"] .who-ulema-block .ulema-slider,
html[dir="rtl"] .who-ulema-block .ulema-slider-viewport{
  direction:ltr;
}
.who-ulema-block .ulema-slider-track{
  animation:none !important;
  margin-left:0;
  margin-right:auto;
}

/* Urdu desktop hero: right-aligned, larger and more spacious, while staying
   fully above the green priority strip (sizes scale with viewport height). */
@media (min-width:1051px){
  [data-language="ur"] .story-hero .hero-copy{
    top:clamp(190px,24vh,270px);
    transform:none;
    max-height:none;
    display:flex;
    flex-direction:column;
    align-items:flex-end;
    direction:rtl;
    text-align:right;
  }
  [data-language="ur"] .story-hero .hero-copy .identity{
    align-self:stretch;
    width:100%;
    max-width:100%;
    margin:0 0 14px;
    text-align:right;
    direction:rtl;
    font-size:clamp(1.3rem,min(1.9vw,3.6vh),1.75rem);
    line-height:1.6;
    letter-spacing:0;
    white-space:normal;
  }
  [data-language="ur"] .story-hero .hero-copy h1{
    align-self:stretch;
    width:100%;
    text-align:right;
    font-size:clamp(2.2rem,min(4vw,7.2vh),3.8rem);
    line-height:1.42;
  }
  [data-language="ur"] .story-hero .hero-copy .line{padding-bottom:.04em;}
  [data-language="ur"] .story-hero .hero-copy .intro{
    align-self:stretch;
    width:100%;
    max-width:720px;
    margin:14px 0 0 auto;
    text-align:right;
    font-size:clamp(1.05rem,min(1.45vw,2.8vh),1.3rem);
    line-height:1.95 !important;
  }
  [data-language="ur"] .story-hero .hero-actions{
    margin-top:24px;
    gap:16px;
    align-self:flex-end;
  }
  [data-language="ur"] .story-hero .hero-actions .button{
    min-height:56px !important;
    padding:10px 30px !important;
    font-size:clamp(1.05rem,1.3vw,1.2rem);
  }
}
/* Short desktop windows: scale down a little so nothing enters the strip. */
@media (min-width:1051px) and (max-height:720px){
  [data-language="ur"] .story-hero .hero-copy{top:clamp(165px,21vh,195px);}
  [data-language="ur"] .story-hero .hero-copy h1{font-size:clamp(2rem,min(3.5vw,6.4vh),3.2rem);line-height:1.36;}
  [data-language="ur"] .story-hero .hero-copy .intro{line-height:1.8 !important;margin-top:8px;}
  [data-language="ur"] .story-hero .hero-actions{margin-top:16px;}
  [data-language="ur"] .story-hero .hero-actions .button{min-height:50px !important;}
}
