/* =============================================================
   Chenar Blakona — style.css (Final Build, 2025)
   Cleaned • Organized • Responsive • RTL/Theme-ready
   ============================================================= */

/* =============================================================
   1. FONT IMPORTS
   ============================================================= */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700&family=Poppins:wght@500;600;700&family=Noto+Naskh+Arabic:wght@400;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@75;100..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Almarai:wght@300;400;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400;1,700&display=swap');


/* Local Urdu fonts */
@font-face {
  font-family: 'Jameel Noori Nastaleeq';
  src: url('../fonts/JameelNooriNastaleeq.woff2') format('woff2'),
       url('../fonts/JameelNooriNastaleeq.woff') format('woff'),
       url('../fonts/JameelNooriNastaleeq.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: 'Jameel Noori Nastaleeq Kasheeda';
  src: url('../fonts/JameelNooriNastaleeqKasheeda.woff2') format('woff2'),
       url('../fonts/JameelNooriNastaleeqKasheeda.woff') format('woff'),
       url('../fonts/JameelNooriNastaleeqKasheeda.ttf') format('truetype');
  font-display: swap;
}

/* =============================================================
   2. ROOT VARIABLES (Color System + Fonts)
   ============================================================= */
:root {
  --navbar-height: 80px;
  --font-sans: 'Open Sans', system-ui, sans-serif;
  --font-en-heading: 'Poppins', sans-serif;
  --font-ps-body: 'Noto Naskh Arabic', serif;
  --font-ps-heading: 'Noto Sans Arabic', serif;
  --font-ps-hero: 'Almarai', serif;
  --font-ur-body: 'Jameel Noori Nastaleeq', serif;
  --font-ur-heading: 'Jameel Noori Nastaleeq Kasheeda', serif;

  /* Light mode palette */
  --bg-surface: #fffaf6;
  --bg-card: #fbf6f2;
  --bg-muted: #f3efe9;
  --text-primary: #1a1a1a;
  --text-secondary: #4b4b4b;
  --text-muted: #615e5b;
  --border-color: #e7e0db;
  --shadow-color: rgba(26,26,26,0.06);
  --primary: #2d7a6f;
  --primary-600: #246357;


  --bs-primary: var(--primary);
  --bs-primary-rgb: 45, 122, 111; /* rgb of #2d7a6f */

  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --transition: 0.3s ease;
}

/* Dark mode overrides */
html.dark {
  --bg-surface: #111212;
  --bg-card: #1a1a1a;
  --bg-muted: #222;
  --text-primary: #f4f4f4;
  --text-secondary: #ccc;
  --text-muted: #615e5b;
  --border-color: #2d2d2d;
  --shadow-color: rgba(0,0,0,0.65);
  --primary: #3fb39e;
  --primary-600: #319884;
}

/* =============================================================
   3. BASE / TYPOGRAPHY
   ============================================================= */
*,
*::before,
*::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-sans);
  scroll-behavior: smooth;
  /* ensure in-page anchors account for fixed navbar */
  scroll-padding-top: var(--navbar-height);
  transition: background var(--transition), color var(--transition);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* --- English --- */
html[lang="en"] body {
  font-family: var(--font-sans);
  line-height: 1.65;
  letter-spacing: 0.01em;
}
html[lang="en"] h1, html[lang="en"] h2, html[lang="en"] h3,
html[lang="en"] h4, html[lang="en"] h5, html[lang="en"] h6 {
  font-family: var(--font-en-heading);
  font-weight: 600;
  line-height: 1.3;
}

/* --- Pashto --- */
html[lang="ps"] body {
  direction: rtl;
  text-align: right;
  font-family: var(--font-ps-body);
  font-size: 1.05rem;
  line-height: 1.6;
}
html[lang="ps"] h1 {
    font-family: var(--font-ps-hero);
    font-weight: 800;
} 

html[lang="ps"] h2, html[lang="ps"] h3 {
  font-family: var(--font-ps-heading);
  font-weight: 800;


}

html[lang="ps"] h3 , html[lang="ps"] h4 , html[lang="ps"] h5, html[lang="ps"] h6 {
  font-family: var(--font-ps-body);
  font-weight: 500;

}

/* --- Urdu --- */
html[lang="ur"] body {
  direction: rtl;
  text-align: right;
  font-family: var(--font-ur-body);
  font-size: 1.1rem;
  line-height: 1.55;
  word-spacing: 0.05em;
}
html[lang="ur"] h1, html[lang="ur"] h2 {
  font-family: var(--font-ur-heading);
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.3;
}
html[lang="ur"] h3, html[lang="ur"] h4, html[lang="ur"] h5, html[lang="ur"] h6 {
  font-family: var(--font-ur-body);
  line-height: 1.4;
}

/* =============================================================
   4. NAVBAR
   ============================================================= */
.navbar {
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,250,246,.95));
  transition: background var(--transition), box-shadow var(--transition);
  padding-top: 6px !important;
  padding-bottom: 6px !important;
  min-height: var(--navbar-height);
}
html.dark .navbar {
  background: linear-gradient(180deg, rgba(17,17,17,.96), rgba(26,26,26,.95));
}
.navbar.scrolled { box-shadow: 0 6px 20px rgba(0,0,0,.08); }

.navbar .nav-link {
  color: var(--text-secondary);
  font-weight: 600;
  padding: .5rem .75rem;
  position: relative;
  transition: color .25s ease;
}
.navbar .nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 2px;
  background: var(--primary);
  transition: width .3s ease, opacity .3s ease;
  opacity: 0;
}
.navbar .nav-link:hover::after,
.navbar .nav-link.active::after {
  width: 100%; opacity: 1;
}
.navbar .nav-link:hover,
.navbar .nav-link.active { color: var(--primary); }

/* RTL nav handling */
.navbar.navbar-rtl .navbar-nav { flex-direction: row-reverse; }

/* Mobile hamburger / language holder (patch for external toggle)
   The HTML expected: <div class="nav-extras"> ... </div>
*/
.nav-extras {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-left: .75rem;
  margin-right: .75rem;
}

/* language pulldown shown inline on mobile when outside collapsed menu */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  padding: .25rem .5rem;
}
.lang-toggle:hover { color: var(--primary); }

/* small pill listing within the nav-extras used for the mobile visible languages */
.lang-pills {
  display: none; /* shown via JS on mobile when required */
  position: absolute;
  top: calc(var(--navbar-height) + 8px);
  right: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  border-radius: .5rem;
  padding: .35rem;
  z-index: 1200;
}

/* each language pill */
.lang-pills a {
  display: block;
  padding: .45rem .8rem;
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 600;
}
.lang-pills a:hover { color: var(--primary); background: rgba(0,0,0,0.02); }

/* =============================================================
   5. HERO SECTION
   ============================================================= */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.hero .hero-bg {
  position: absolute; inset: 0;
  background: url("/assets/hero.jpg") center/cover no-repeat;
  z-index: 0;
}
.hero .overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1;
}
.hero .lead.text-white {
    color: #ffffff !important;
}
.hero-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 3rem 1rem;
}
.glass-card {
  background-color: rgba(255,255,255,0.16);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: var(--radius-xl);
  box-shadow: 0 10px 30px rgba(26,26,26,0.1);
}
html.dark .glass-card {
  background-color: rgba(0,0,0,0.28);
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Fallback if no backdrop-filter support */
@supports not ((backdrop-filter: none) or (-webkit-backdrop-filter: none)) {
  .glass-card { background: var(--bg-card); border: 1px solid var(--border-color); }
}
@media (max-width: 575.98px) {
  .hero {
    min-height: 75vh; /* give a bit more vertical space */
  }
  .hero-inner {
    padding-top: calc(2rem + var(--navbar-height)); /* ensure hero content doesn't hide */
  }
}
.hero .ps-sub    {
    font-family: Amiri !important;
    font-size: 1.5rem !important;


}

/* =============================================================
   6. FEATURE / PRODUCT / WHY CARDS
   ============================================================= */
.feature-card, .product-card, .why-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  transition: transform .2s ease, box-shadow .3s ease;
  box-shadow: 0 6px 18px var(--shadow-color);
}
.feature-card:hover, .product-card:hover, .why-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 24px rgba(0,0,0,.08);
}
.feature-icon {
  width: 54px; height: 54px;
  display:inline-flex; align-items:center; justify-content:center;
  border-radius:50%;
  font-size:1.25rem;
  color:var(--primary);
  background:rgba(255,255,255,0.4);
  margin-bottom:.75rem;
}

/* extra utility if you want shield icon variant larger */
.feature-icon.shield { font-size:1.15rem; }

/* =============================================================
   7. RESPONSIVE PRODUCT & GALLERY IMAGES (Refined Balanced Version)
   ============================================================= */
.product-card img{
  margin-bottom: 1rem !important; /* previously too close */
}
.product-card p {
  text-align: center;
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}
/* Center product card titles */
.product-card h5 {
  text-align: center;
  width: 100%;
}
.product-card .btn {
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}
.feature-card img,
.why-card img,
.card-img-top,
#galleryGrid img {
  width: 100%;
  aspect-ratio: 1 / 1; /* Keep perfect square shape */
  object-fit: cover;
  border-radius: var(--radius-lg);
  display: block;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  max-width: 480px;        /* Prevent image from becoming too large on big screens */
  margin: 0 auto;          /* Center within card */
}

/* Desktop (large screens) */
@media (min-width: 1200px) {
  .product-card img { max-width: 360px; }
}

/* Tablets */
@media (max-width: 991.98px) {
  .product-card img { max-width: 300px; }
}

/* Mobile */
@media (max-width: 575.98px) {
  .product-card img { max-width: 240px; }
}

/* Hover interaction */
#galleryGrid img:hover,
.product-card img:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* =============================================================
   8. SPEC TABLES
   ============================================================= */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border-color);
  border-radius: .5rem;
  overflow: hidden;
  background-color: var(--bg-card);
  color: var(--text-secondary);
}
.spec-table td {
  padding: .75rem .75rem;
  border-top: 1px solid var(--border-color);
}
.spec-table tr:nth-child(odd) td { background-color: var(--bg-muted); }
.spec-table tr:first-child td { border-top: none; }

/* =============================================================
   9. PRODUCT QUALITY CARD
   ============================================================= */
.product-quality-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 900px;
  margin: 0 auto;
}
html.dark .product-quality-card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.1);
  color: #f5f5f5 !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

/* =============================================================
   10. BUTTONS
   ============================================================= */
.btn {
  border-radius: 2rem;
  font-weight: 600;
  padding: .55rem 1.1rem;
}
.btn-primary { background: var(--primary); color: #fff; border: none; }
.btn-primary:hover { background: var(--primary-600); }
.btn-outline-primary { color: var(--primary); border: 1px solid var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: #fff; }

/* =============================================================
   11. MODALS / GALLERY / FOOTER
   ============================================================= */
.modal-content {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}
.modal-header-ltr { flex-direction: row; }
.modal-header-rtl { flex-direction: row-reverse; }

#galleryGrid .card {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.footer {
  background: var(--bg-surface);
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0;
}
.footer .footer-link { color: var(--text-muted); }
.footer .footer-link:hover { color: var(--primary); }



/* =============================================================
   12. RTL HELPERS & ALIGNMENT
   ============================================================= */
[dir="rtl"] .navbar-nav { flex-direction: row-reverse; }
.td-rtl-aware, .phone-rtl-aware { direction: ltr; }
html[lang="ur"] p, html[lang="ps"] p { text-align: right; }

/* Urdu + Pashto navbar link size */
html[lang="ps"] .navbar .nav-link,
html[lang="ur"] .navbar .nav-link {
  font-size: 1.15rem;      /* increase from default ~1rem */
  font-weight: 600;        /* looks better for RTL scripts */
}

/* Right-align footer logo on Pashto & Urdu pages */
html[lang="ps"] #footerLogoWrapper,
html[lang="ur"] #footerLogoWrapper {
    text-align: right !important;
}

html[lang="ps"] #footerLogoWrapper picture,
html[lang="ur"] #footerLogoWrapper picture {
    margin-left: auto !important;
    margin-right: 0 !important;
    display: block !important;
}

/* =============================================================
   13. TEXT, LINKS, & SUBTITLES
   ============================================================= */
.text-muted-2 {
  color: var(--text-muted);
  font-size: 0.96rem;
  line-height: 1.7;
  text-align: justify !important;
  text-justify: inter-word;
}
html.dark .text-muted-2 { color: rgba(230,230,230,0.8); }

.lang-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.25s ease;
  font-size: 0.9rem;
  font-weight: 500;
}
.lang-link:hover { color: var(--primary); }
html.dark .lang-link { color: var(--text-muted); }
html.dark .lang-link:hover { color: var(--primary); }

.section-subtitle.text-primary { color: var(--primary-600) !important; }

/* --- Global Link Colors --- */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.25s ease, text-decoration 0.25s ease;
}
a:hover, a:focus {
  color: var(--primary-600);
}

/* Dark mode variant */
html.dark a {
  color: var(--primary);
}
html.dark a:hover {
  color: var(--primary-600);
}

/* =============================================================
   14. UTILITIES & RESPONSIVE SPACING
   ============================================================= */
:focus { outline: 3px solid rgba(45,122,111,0.18); outline-offset: 2px; }
section { padding: 2rem 0; }
section + section { margin-top: 3rem; }
section h2, section h3 { margin-bottom: 1.5rem; }
@media (max-width: 768px) {
  section { padding: 2rem 0; }
  section + section { margin-top: 2rem; }
}
.ratio iframe { border: 0; }

/* small spacing utility in case bootstrap overrides removed it */
.mb-2 { margin-bottom: .5rem !important; }

/* =============================================================
   15. PASHTO ENHANCEMENTS
   - stronger rule to increase Pashto paragraph size (overrides where needed)
   ============================================================= */
html[lang="ps"] p,
html[lang="ps"] .text-muted-2 {
  font-size: 1.15rem !important;   /* Slight increase */
  line-height: 1.9 !important;     /* Better readability */
  font-family: var(--font-ps-body) !important; /* Correct Pashto Arabic font */
  color: #333 !important;
}

/* =============================================================
   16. RESPONSIVE LOGO (explicit widths requested)
   - Desktop: 250px
   - Tablet: 200px
   - Mobile: 150px
   ============================================================= */
/* wrapper expected: <a class="navbar-brand"><picture id="siteLogoWrapper">...</picture></a>
   style applied to the img fallback inside picture via .site-logo class
*/
.site-logo {
  width: 250px;
  max-width: 100%;
  height: auto;
  display: inline-block;
  transition: width .28s ease, transform .28s ease;
}

/* tablet breakpoint */
@media (max-width: 991.98px) {
  .site-logo { width: 200px; }
}

/* mobile breakpoint */
@media (max-width: 575.98px) {
  .site-logo { width: 120px; }
}

/* footer logo separate */
.footer-logo {
  width: 150px;
  max-width: 100%;
  height: auto;
  transition: width .28s ease;
}
@media (max-width: 991.98px) {
  .footer-logo { width: 120px; }
}
@media (max-width: 575.98px) {
  .footer-logo { width: 100px; }
}


/* ensure logo doesn't overflow when navbar shrinks */
.navbar-brand { display:flex; align-items:center; gap:.5rem; }

/* =============================================================
   17. NAV TARGET / SCROLL FIXES
   - ensures anchors don't get covered by fixed navbar
   ============================================================= */
/* Add safe scroll margin for target sections */
:target {
  scroll-margin-top: calc(var(--navbar-height) + 12px);
}
/* also for specifically targeted sections (hero etc) */
section:target { scroll-margin-top: calc(var(--navbar-height) + 12px); }

/* also a small helper if using IDs on headings */
[id]:not(body):not(html) {
  scroll-margin-top: calc(var(--navbar-height) + 12px);
}

/* =======================================================
   OVERRIDE BOOTSTRAP BLUE WITH SITE PRIMARY GREEN
   ======================================================= */


/* Buttons */
.btn-primary {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
}
.btn-primary:hover {
  background-color: var(--primary-600) !important;
  border-color: var(--primary-600) !important;
}

/* Links */
a {
  color: var(--primary) !important;
}
a:hover {
  color: var(--primary-600) !important;
}

/* Section Titles & Subtitles */
h1, h2, h3, h4, h5, h6,
.section-title,
.section-subtitle {
  color: var(--primary) !important;
}

/* Global icon color override */
.bi,
[class*="bi-"] {
  color: var(--primary) !important;
}

/* WHY CHOOSE US – Filled Green Icons */
.why-card .feature-icon {
  background: var(--primary) !important;
  border: none !important;
  color: #fff !important;
  box-shadow: none !important;
}

.why-card .feature-icon svg path {
  fill: #ffffff !important; /* White icon */
}

/* =============================================================
   RTL FOOTER FIX — Pashto (ps) + Urdu (ur)
   ============================================================= */

/* 1 — Align the entire footer column content to the right */
html[lang="ps"] .footer .col-md-4,
html[lang="ur"] .footer .col-md-4 {
    text-align: right !important;
}

/* 2 — Right-align the logo block */
html[lang="ps"] #footerLogo,
html[lang="ur"] #footerLogo {
    display: block !important;
    margin-left: auto !important;
    margin-right: 0 !important;
}

/* 3 — Right-align social icons */
html[lang="ps"] .footer .mt-3,
html[lang="ur"] .footer .mt-3 {
    text-align: right !important;
}

html[lang="ps"] .footer a.me-2,
html[lang="ur"] .footer a.me-2 {
    margin-left: .5rem !important;   /* flip spacing */
    margin-right: 0 !important;
}

/* 4 — Right-align footer lists (policies + links) */
html[lang="ps"] .footer ul,
html[lang="ur"] .footer ul {
    padding-right: 0 !important;
    text-align: right !important;
}

/* 5 — Right-align footer copyright bar */
html[lang="ps"] .footer .text-center,
html[lang="ur"] .footer .text-center {
    text-align: center !important;  /* still centered (recommended) */
    direction: rtl;
}

/* =============================================================
   END OF FILE
   ============================================================= */
