:root {
  --alf-font: Karla, "Segoe UI", Tahoma, sans-serif;
  --alf-green: #77b122;
  --alf-green-dark: #5f8f18;
  --alf-ink: #0f1112;
  --alf-muted: #6c757d;
  --alf-soft: #f6f8f2;
  --alf-line: #e5ebd8;
}

/* Text logo — Farmie-style two-tone wordmark */
.alf-text-logo {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  font-family: var(--alf-font);
  font-weight: 800;
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
  letter-spacing: 0.02em;
  line-height: 1.15;
  text-transform: none;
  text-decoration: none !important;
}

.alf-text-logo .alf-logo-primary {
  color: var(--alf-green);
}

.alf-text-logo .alf-logo-secondary {
  color: var(--alf-ink);
}

body.locale-ur .alf-text-logo,
body.locale-ur .alf-text-logo .alf-logo-primary,
body.locale-ur .alf-text-logo .alf-logo-secondary {
  font-family: "Noto Nastaliq Urdu", "Segoe UI", Tahoma, sans-serif;
  letter-spacing: 0;
}

body.locale-ur .alf-text-logo {
  gap: 0.35rem;
}

.alf-text-logo--footer {
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
}

.alf-text-logo--footer .alf-logo-secondary {
  color: #ffffff;
}

.nav-brand.alf-text-logo {
  max-width: min(100%, 280px);
}

@media (max-width: 991px) {
  .nav-brand.alf-text-logo {
    font-size: 1.1rem;
    max-width: 200px;
  }
}

body { font-family: var(--alf-font); }
.preloader { pointer-events: none; }

/* Keep content visible if AOS fails */
[data-aos] { opacity: 1 !important; transform: none !important; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 9999;
  background: #fff;
  padding: .5rem;
}

/* ===== Portal stats (Farmie-aligned) ===== */
.alf-stats-area {
  position: relative;
  background: var(--alf-soft);
  padding: 80px 0 70px;
  overflow: hidden;
}

.alf-stats-area::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 20%, rgba(119, 177, 34, 0.12), transparent 42%),
    radial-gradient(circle at 88% 80%, rgba(119, 177, 34, 0.1), transparent 40%);
  pointer-events: none;
}

.alf-stats-area .section-heading { margin-bottom: 40px; }

.alf-stat-tile {
  position: relative;
  background: #fff;
  border: 1px solid var(--alf-line);
  border-top: 3px solid var(--alf-green);
  padding: 28px 22px 24px;
  height: 100%;
  transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
}

.alf-stat-tile:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 35px rgba(15, 17, 18, 0.08);
  border-color: rgba(119, 177, 34, 0.45);
}

.alf-stat-tile .icon-wrap {
  width: 58px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(119, 177, 34, 0.12);
  color: var(--alf-green);
  font-size: 1.35rem;
  margin-bottom: 18px;
}

.alf-stat-tile .stat-value {
  font-size: clamp(2rem, 3.2vw, 2.75rem);
  font-weight: 700;
  color: var(--alf-ink);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}

.alf-stat-tile .stat-label {
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--alf-muted);
  font-weight: 700;
  margin: 0;
}

.alf-stat-tile .stat-accent {
  position: absolute;
  right: 16px;
  bottom: 14px;
  width: 36px;
  height: 3px;
  background: var(--alf-green);
  opacity: .55;
}

/* Department cards — cleaner metric chips */
.alf-dept-card {
  background: #fff;
  border: 1px solid var(--alf-line);
  border-left: 4px solid var(--alf-green);
  padding: 28px 24px;
  height: 100%;
  transition: box-shadow .3s ease, transform .3s ease;
}

.alf-dept-card:hover {
  box-shadow: 0 14px 28px rgba(15, 17, 18, 0.07);
  transform: translateY(-4px);
}

.alf-dept-card h4 {
  color: var(--alf-ink);
  margin-bottom: 12px;
}

.alf-metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0 20px;
}

.alf-metric-chip {
  background: var(--alf-soft);
  border: 1px solid var(--alf-line);
  padding: 10px 12px;
}

.alf-metric-chip .val {
  display: block;
  font-weight: 700;
  color: var(--alf-green-dark);
  font-size: 1.05rem;
  line-height: 1.2;
}

.alf-metric-chip .lbl {
  display: block;
  font-size: 11px;
  color: var(--alf-muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-top: 2px;
}

.scheme-badge-proposed {
  background: #e9a825;
  color: #fff;
  padding: .2rem .55rem;
  font-size: .75rem;
}

.scheme-badge-running {
  background: var(--alf-green);
  color: #fff;
  padding: .2rem .55rem;
  font-size: .75rem;
}

.upload-dropzone {
  border: 2px dashed #b7c99a;
  padding: 1.25rem;
  text-align: center;
  background: var(--alf-soft);
}

.upload-dropzone.dragover {
  background: #eef6e0;
  border-color: var(--alf-green);
}

/* ===== CM Proposed schemes ===== */
.alf-proposed-area {
  background: #fff;
  border-top: 1px solid var(--alf-line);
  border-bottom: 1px solid var(--alf-line);
}

.alf-proposed-card {
  background: #fff;
  border: 1px solid var(--alf-line);
  display: flex;
  flex-direction: column;
  transition: transform .3s ease, box-shadow .3s ease;
}

.alf-proposed-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 32px rgba(15, 17, 18, 0.08);
}

.alf-proposed-media {
  position: relative;
  height: 170px;
  background-size: cover;
  background-position: center;
}

.alf-proposed-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 17, 18, 0.55), rgba(15, 17, 18, 0.05));
}

.alf-proposed-tag {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 1;
  background: #e9a825;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: 6px 10px;
}

.alf-proposed-body { padding: 22px 20px 20px; flex: 1; display: flex; flex-direction: column; }

.alf-proposed-dept {
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--alf-green-dark);
  font-weight: 700;
  margin: 0;
}

.alf-proposed-budget {
  font-size: 13px;
  color: var(--alf-ink);
}

.alf-proposed-empty {
  border: 1px dashed var(--alf-line);
  background: var(--alf-soft);
  padding: 2rem;
}

@media (max-width: 767px) {
  .alf-stats-area { padding: 55px 0 45px; }
  .alf-metric-grid { grid-template-columns: 1fr; }
}

/* ===== Chief Minister message (home) — side by side ===== */
.alf-cm-message-area {
  --alf-cm-deep: #1f5c28;
  --alf-cm-mid: #3d8c2e;
  --alf-cm-mint: #e8f3df;
  position: relative;
  padding: 72px 0 80px;
  background:
    linear-gradient(180deg, #ffffff 0%, var(--alf-cm-mint) 42%, #ffffff 100%);
  border-top: 1px solid var(--alf-line);
  border-bottom: 1px solid var(--alf-line);
  overflow: hidden;
}

.alf-cm-message-area::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% 20%, rgba(61, 140, 46, 0.12), transparent 45%),
    radial-gradient(ellipse at 85% 80%, rgba(31, 92, 40, 0.08), transparent 48%);
  pointer-events: none;
}

.alf-cm-message-area .container {
  position: relative;
  z-index: 1;
}

.alf-cm-split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 28px;
  align-items: stretch;
}

.alf-cm-heading {
  margin-bottom: 0;
}

.alf-cm-heading p {
  color: var(--alf-cm-mid);
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-size: 13px;
}

.alf-cm-heading h2 {
  font-size: clamp(1.45rem, 2.2vw, 1.9rem);
  margin-bottom: 0;
}

.alf-cm-heading h2,
.alf-cm-heading h2 span {
  color: var(--alf-cm-deep);
}

.alf-cm-banner {
  margin: 0;
  height: 100%;
  min-height: 320px;
  background: #fff;
  border: 1px solid rgba(31, 92, 40, 0.18);
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 16px 36px rgba(31, 92, 40, 0.1),
    0 2px 0 var(--alf-cm-mid);
  display: flex;
  align-items: center;
  justify-content: center;
}

.alf-cm-banner__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  background: linear-gradient(180deg, #f4faef 0%, #fff 100%);
}

.alf-cm-panel {
  background: #fff;
  border: 1px solid rgba(31, 92, 40, 0.16);
  border-radius: 16px;
  padding: 28px 30px 26px;
  box-shadow: 0 10px 28px rgba(15, 17, 18, 0.06);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}

.alf-cm-panel::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--alf-cm-mid), var(--alf-cm-deep));
}

html[dir="rtl"] .alf-cm-panel::before {
  left: auto;
  right: 0;
}

html[dir="rtl"] .alf-cm-split {
  direction: rtl;
}

.alf-cm-quote {
  margin: 0;
  padding: 0 0 0 12px;
  flex: 1;
}

html[dir="rtl"] .alf-cm-quote {
  padding: 0 12px 0 0;
}

.alf-cm-quote p {
  margin: 0;
  color: #243028;
  font-size: 1.02rem;
  line-height: 1.8;
}

.alf-cm-signoff {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px dashed rgba(31, 92, 40, 0.25);
  color: var(--alf-cm-deep);
  font-weight: 700;
  font-size: 0.95rem;
}

@media (max-width: 991px) {
  .alf-cm-split {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .alf-cm-banner {
    min-height: 0;
    max-height: none;
  }

  .alf-cm-banner__img {
    height: auto;
    max-height: 420px;
  }
}

@media (max-width: 767px) {
  .alf-cm-message-area { padding: 48px 0 56px; }
  .alf-cm-banner { border-radius: 12px; }
  .alf-cm-panel { padding: 22px 18px 18px; border-radius: 12px; }
  .alf-cm-panel::before { top: 14px; bottom: 14px; }
  .alf-cm-quote p { font-size: 0.98rem; }
  .alf-cm-banner__img { max-height: 300px; }
}

/* ===== Language switcher + Urdu RTL ===== */
.top-header-content {
  height: auto !important;
  min-height: 44px;
  padding: 8px 0;
}

.top-header-content .alf-top-welcome,
.top-header-content .alf-top-actions {
  flex: 1 1 auto !important;
  max-width: none !important;
  width: auto !important;
}

.top-header-content .alf-top-actions {
  flex: 0 1 auto !important;
}

.alf-lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid #cfd5d8;
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 17, 18, 0.06);
  margin-inline-end: .35rem;
}

.alf-lang-btn {
  display: inline-block;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #334155 !important;
  text-decoration: none !important;
  line-height: 1.4;
  background: transparent;
  white-space: nowrap;
}

.alf-lang-btn:hover,
.alf-lang-btn:focus {
  color: #77b122 !important;
  background: #f4f8ec;
}

.alf-lang-btn.is-active {
  background: #77b122 !important;
  color: #fff !important;
}

.top-header-content .top-header-meta .alf-lang-switch a {
  margin-right: 0 !important;
  color: #334155;
  font-weight: 700;
}

.top-header-content .top-header-meta .alf-lang-switch a.is-active {
  color: #fff !important;
}

.classynav ul li.alf-nav-lang > a {
  color: #77b122 !important;
  font-weight: 700;
}

.classynav ul li a.alf-lang-active {
  color: #77b122 !important;
  font-weight: 700;
}

body.locale-ur {
  font-family: "Noto Nastaliq Urdu", "Segoe UI", Tahoma, sans-serif;
}

body.locale-ur .section-heading h2,
body.locale-ur .welcome-content h2,
body.locale-ur .alf-page-hero__title,
body.locale-ur h1, body.locale-ur h2, body.locale-ur h3, body.locale-ur h4, body.locale-ur h5,
body.locale-ur .classynav ul li a,
body.locale-ur .top-header-meta p,
body.locale-ur .btn,
body.locale-ur .form-label,
body.locale-ur .alert {
  font-family: "Noto Nastaliq Urdu", "Segoe UI", Tahoma, sans-serif;
  line-height: 1.7;
}

html[dir="rtl"] .welcome-content,
html[dir="rtl"] .section-heading,
html[dir="rtl"] .breadcrumb-text,
html[dir="rtl"] .alf-stat-tile,
html[dir="rtl"] .alf-dept-card,
html[dir="rtl"] .footer-widget {
  text-align: right;
}

html[dir="rtl"] .section-heading.text-center,
html[dir="rtl"] .breadcrumb-text.text-center,
html[dir="rtl"] .alf-stat-tile.text-center {
  text-align: center;
}

html[dir="rtl"] .classynav ul li .dropdown {
  text-align: right;
}

html[dir="rtl"] .text-lg-end {
  text-align: left !important;
}

html[dir="rtl"] .me-1 { margin-right: 0 !important; margin-left: .25rem !important; }
html[dir="rtl"] .me-2 { margin-right: 0 !important; margin-left: .5rem !important; }
html[dir="rtl"] .ms-2 { margin-left: 0 !important; margin-right: .5rem !important; }

@media only screen and (max-width: 767px) {
  .top-header-content .alf-top-welcome {
    display: none;
  }

  .top-header-content .alf-top-actions {
    width: 100% !important;
    justify-content: space-between !important;
  }
}

/* ===== Dynamic media frames (crop large / stretch small) ===== */
.alf-footer-bg,
.alf-media-hero,
.alf-media-banner,
.alf-media-card,
.alf-proposed-media {
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover; /* default; JS may switch to 100% 100% for small uploads */
}

.alf-footer-bg {
  min-height: 420px;
  background-color: #1a1f16;
}

.alf-media-card {
  height: 160px;
  width: 100%;
  overflow: hidden;
}

.alf-dept-card .alf-media-card {
  height: 150px;
}

.alf-proposed-media.alf-media-card {
  height: 170px;
}

.alf-media-detail {
  width: 100%;
  height: 360px;
  background: #eef2e6;
}

.alf-media-detail__img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
}

.alf-media-about {
  width: 100%;
  height: 420px;
  background: #eef2e6;
}

.alf-media-about__img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
}

.alf-media-hero.is-stretched,
.alf-media-banner.is-stretched,
.alf-footer-bg.is-stretched,
.alf-media-card.is-stretched,
.alf-proposed-media.is-stretched {
  background-size: 100% 100% !important;
}

.alf-media-detail__img.is-stretched,
.alf-media-about__img.is-stretched {
  object-fit: fill !important;
}

@media (max-width: 767px) {
  .alf-media-detail { height: 220px; }
  .alf-media-about { height: 260px; }
  .alf-footer-bg { min-height: 360px; }
}

/* ===== Scheme Cards & Action Buttons ===== */
.alf-scheme-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  border: 1px solid #e5e9ea !important;
  border-radius: 10px !important;
  background-color: #ffffff;
}

.alf-scheme-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(15, 17, 18, 0.08) !important;
  border-color: #d2dbdc !important;
}

.alf-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.alf-btn-details,
.alf-btn-apply,
.alf-btn-interest {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 6px;
  text-decoration: none !important;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-sizing: border-box;
}

.alf-btn-details {
  color: #374151;
  background-color: #f3f4f6;
  border: 1px solid #e5e7eb;
}

.alf-btn-details:hover,
.alf-btn-details:focus {
  color: #ffffff;
  background-color: #0f1112;
  border-color: #0f1112;
  transform: translateY(-1px);
}

.alf-btn-apply {
  color: #ffffff !important;
  background: linear-gradient(135deg, #77b122 0%, #5e8f17 100%);
  border: 1px solid #5e8f17;
  box-shadow: 0 2px 6px rgba(119, 177, 34, 0.28);
}

.alf-btn-apply:hover,
.alf-btn-apply:focus {
  color: #ffffff !important;
  background: linear-gradient(135deg, #629718 0%, #4b7310 100%);
  border-color: #4b7310;
  box-shadow: 0 5px 14px rgba(119, 177, 34, 0.42);
  transform: translateY(-2px);
}

.alf-btn-interest {
  color: #92400e !important;
  background-color: #fef3c7;
  border: 1px solid #fde68a;
}

.alf-btn-interest:hover,
.alf-btn-interest:focus {
  color: #ffffff !important;
  background-color: #d97706;
  border-color: #b45309;
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.3);
  transform: translateY(-1px);
}

body.locale-ur .alf-btn-details,
body.locale-ur .alf-btn-apply,
body.locale-ur .alf-btn-interest {
  font-family: "Noto Nastaliq Urdu", "Segoe UI", Tahoma, sans-serif;
  font-size: 14px;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.6;
}

@media (max-width: 576px) {
  .alf-card-actions {
    flex-direction: column;
  }
  .alf-btn-details,
  .alf-btn-apply,
  .alf-btn-interest {
    width: 100%;
    flex: 1 1 auto;
  }
}

