/**
 * Urdu (RTL) presentation layer
 * Loaded after style.css on all Urdu portal pages.
 * Keeps the brand palette and components, swaps typography and direction.
 */

:root {
  --font-urdu: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', 'Noto Naskh Arabic', serif;
}

/* ---------------------------------------------------------------- base type */
html[lang="ur"] body {
  font-family: var(--font-urdu);
  font-size: 1rem;
  line-height: 2.15;
  letter-spacing: 0;
  text-align: right;
}

html[lang="ur"] h1,
html[lang="ur"] h2,
html[lang="ur"] h3,
html[lang="ur"] h4,
html[lang="ur"] h5,
html[lang="ur"] h6,
html[lang="ur"] .brand-name,
html[lang="ur"] .footer-heading,
html[lang="ur"] .nav-link-custom,
html[lang="ur"] .btn,
html[lang="ur"] .dropdown-item {
  font-family: var(--font-urdu);
  letter-spacing: 0;
  text-transform: none;
}

html[lang="ur"] .hero-title {
  line-height: 1.9;
  font-size: clamp(1.55rem, 3.2vw, 2.5rem);
}

html[lang="ur"] .section-title {
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  line-height: 2;
}

html[lang="ur"] .lead {
  line-height: 2.1;
  font-size: 1.05rem;
}

html[lang="ur"] .section-label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.9rem;
}

html[lang="ur"] .card-title-editorial {
  font-size: 1.12rem;
  line-height: 2;
}

/* Latin strings (email addresses, URLs, English labels) stay upright */
.latin,
.latin * {
  font-family: var(--font-sans);
  direction: ltr;
  unicode-bidi: isolate;
  overflow-wrap: anywhere;
}

/* Long Latin strings inside flex rows must be allowed to shrink */
.islamic-card .d-flex > div,
.footer-contact-item > div {
  min-width: 0;
}

/* ------------------------------------------------------- RTL corrections */
html[lang="ur"] .footer-heading::after {
  left: auto;
  right: 0;
}

html[lang="ur"] .footer-links-list a:hover {
  transform: translateX(-3px);
}

html[lang="ur"] .footer-links-list a i,
html[lang="ur"] .dropdown-item i.bi-chevron-right {
  transform: scaleX(-1);
}

html[lang="ur"] .back-to-top-btn {
  right: auto;
  left: 24px;
}

html[lang="ur"] .audio-track-item:hover {
  transform: translateX(-4px);
}

html[lang="ur"] .navbar-brand {
  padding-top: 0.15rem;
  padding-bottom: 0.15rem;
}

html[lang="ur"] .brand-title-wrap .brand-name {
  font-size: 1.08rem;
  line-height: 1.7;
}

html[lang="ur"] .brand-title-wrap .brand-subtitle {
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.72rem;
  line-height: 1.7;
}

/* ------------------------------------------------------------- page blocks */
.urdu-hero {
  background: linear-gradient(135deg, var(--primary-deep) 0%, var(--primary) 55%, var(--secondary) 100%);
  border-bottom: 3px solid var(--gold);
  padding: 3.5rem 0;
}

.urdu-verse {
  font-family: var(--font-arabic);
  font-size: 1.35rem;
  line-height: 2.2;
  color: var(--gold-light);
  direction: rtl;
}

/* Link cards used across the Urdu portal */
.urdu-tile {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  height: 100%;
  padding: 1.35rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
  text-decoration: none;
  color: var(--text-body);
  transition: var(--transition-smooth);
}

.urdu-tile:hover,
.urdu-tile:focus {
  border-color: var(--gold);
  box-shadow: var(--shadow-card);
  transform: translateY(-3px);
  color: var(--text-main);
}

.urdu-tile-icon {
  width: 46px;
  height: 46px;
  min-width: 46px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--gold-light);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: 1px solid var(--gold);
}

.urdu-tile-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary-dark);
  margin: 0 0 0.15rem;
  line-height: 1.9;
}

.urdu-tile-text {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.95;
  margin: 0;
}

/* Photo tiles (legacy thumbnails kept for continuity) */
.urdu-photo-card {
  display: block;
  height: 100%;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-decoration: none;
  box-shadow: var(--shadow-subtle);
  transition: var(--transition-smooth);
}

.urdu-photo-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-card);
  transform: translateY(-3px);
}

.urdu-photo-card img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  background: var(--cream);
  display: block;
  border-bottom: 1px solid var(--border-color);
}

.urdu-photo-card .urdu-photo-body {
  padding: 0.9rem 1.1rem 1.1rem;
}

.urdu-photo-card .urdu-photo-title {
  margin: 0;
  font-weight: 700;
  color: var(--primary-dark);
  font-size: 1rem;
  line-height: 1.9;
}

/* Khanqah / scholar list rows */
.urdu-scholar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-right: 3px solid var(--gold);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-main);
  transition: var(--transition-smooth);
}

.urdu-scholar-row:hover {
  background: var(--gold-subtle);
  border-color: var(--gold);
  color: var(--primary-dark);
}

.urdu-scholar-row .urdu-scholar-name {
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.9;
}

.urdu-scholar-row .urdu-scholar-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (max-width: 575.98px) {
  html[lang="ur"] body {
    font-size: 0.95rem;
  }

  .urdu-tile {
    padding: 1.1rem;
  }
}
