/* Custom Properties - Divine Professional Palette */
:root {
  --color-emerald: #004d40;
  --color-emerald-light: #00695c;
  --color-gold: #D4AF37;
  --color-gold-hover: #b8972e;
  --color-bg: #F9F9F9;
  --color-surface: #ffffff;
  --color-text-main: #2d3748;
  --color-text-muted: #4a5568;
  
  --font-arabic: 'Amiri', serif;
  --font-body: 'Poppins', sans-serif;
  
  --border-radius: 16px;
  --shadow-soft: 0 10px 25px rgba(0, 77, 64, 0.08);
  --shadow-hover: 0 20px 35px rgba(0, 77, 64, 0.15);
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--color-emerald); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--color-gold); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Solid Emerald Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-emerald);
  border-bottom: 2px solid rgba(212, 175, 55, 0.2);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: var(--transition);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}

.site-branding { display: flex; align-items: center; gap: 15px; }
.site-title { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.5px; margin: 0; line-height: 1; }
.site-title a { color: var(--color-gold); text-decoration: none; }
.site-logo img { max-height: 70px; width: auto; display: block; }

/* Navigation */
.main-navigation {
  flex-grow: 1;
  display: flex;
  justify-content: flex-end;
}
.nav-menu {
  list-style: none;
  display: flex;
  gap: 15px;
  margin: 0;
  padding: 0;
  align-items: center;
}
.nav-menu li { position: relative; }
.nav-menu a {
  color: var(--color-gold);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 5px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-transform: uppercase;
  line-height: 1.3;
  letter-spacing: 0.5px;
  max-width: 100px;
  white-space: normal;
  transition: var(--transition);
}
.nav-menu a:hover { color: #ffffff; text-shadow: 0 0 8px rgba(255,255,255,0.4); }

/* Dropdowns */
.nav-menu ul.sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--color-surface);
  min-width: 200px;
  box-shadow: var(--shadow-soft);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}
.nav-menu li:hover > ul.sub-menu { display: block; animation: fadeIn 0.3s ease; }
.nav-menu ul.sub-menu li a {
  padding: 12px 20px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
}
.nav-menu ul.sub-menu li:last-child a { border-bottom: none; }
.nav-menu ul.sub-menu li a:hover { background: rgba(212, 175, 55, 0.1); }

@keyframes fadeIn { from{opacity:0; transform:translateY(10px);} to{opacity:1; transform:translateY(0);} }

/* Hero Section */
.hero-section {
  background-color: var(--color-emerald);
  background-image: url("data:image/svg+xml,%3Csvg width='150' height='150' viewBox='0 0 150 150' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M75 0 L150 75 L75 150 L0 75 Z' fill='none' stroke='white' stroke-width='1.5' stroke-opacity='0.08'/%3E%3C/svg%3E");
  background-size: 250px;
  color: white;
  padding: 120px 20px;
  text-align: center;
  margin-bottom: 60px;
}
.hero-title { font-size: 3.5rem; font-weight: 700; margin-bottom: 20px; line-height: 1.2; text-shadow: 0 2px 4px rgba(0,0,0,0.3); }
.hero-search-container { max-width: 600px; margin: 30px auto 0; position: relative; }
.hero-search-form { display: flex; box-shadow: 0 8px 25px rgba(0,0,0,0.15); border-radius: 8px; overflow: hidden; background: white; }
.hero-search-field {
  flex-grow: 1;
  padding: 18px 25px;
  border: none;
  font-size: 1.1rem;
  font-family: var(--font-body);
  outline: none;
  color: var(--color-text-main);
}
.hero-search-submit {
  background: #0d4638;
  color: #c9dec9;
  border: none;
  padding: 0 35px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
}
.hero-search-submit:hover { background: #052c22; color: #ffffff; }

/* Quotes Grid */
.page-header { text-align: center; margin-bottom: 40px; }
.page-title { font-size: 2.2rem; color: var(--color-emerald); font-weight: 700; display: block; position: relative; }
.page-title::before, .about-title::before {
    content: '';
    display: block;
    width: 150px;
    height: 35px;
    margin: 0 auto 15px auto;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 30'%3E%3Cpath fill='%23004d40' opacity='0.6' d='M50 0 C60 15 80 15 100 15 C80 15 60 15 50 30 C40 15 20 15 0 15 C20 15 40 15 50 0 Z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
.page-title::after, .about-title::after { display: none; }

.quotes-grid { margin: 0 -15px; visibility: hidden; }
.quotes-grid.masonry-loaded { visibility: visible; }
.grid-sizer, .grid-item { width: calc(50% - 30px); margin: 15px; }

/* Quote Card base */
.quote-card {
  background-color: var(--color-surface);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.06);
  padding: 40px 30px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.4);
  display: flex;
  flex-direction: column;
  z-index: 1;
}

/* Quote Icon */
.quote-card::before {
  content: '“';
  position: absolute;
  top: -5px;
  left: 20px;
  font-family: Georgia, serif;
  font-size: 80px;
  color: var(--color-gold);
  line-height: 1;
  z-index: 0;
}

/* First Card Green Styling */
.quote-card:nth-child(1), .quote-card:nth-of-type(1) {
  background-color: var(--color-emerald);
  background-image: url("data:image/svg+xml,%3Csvg width='150' height='150' viewBox='0 0 150 150' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M75 0 L150 75 L75 150 L0 75 Z' fill='none' stroke='white' stroke-opacity='0.1'/%3E%3C/svg%3E");
  background-position: bottom -50px right -50px;
  background-repeat: no-repeat;
  border-color: var(--color-emerald);
}
.quote-card:nth-child(1) .quote-arabic, 
.quote-card:nth-child(1) .quote-english { color: white; }
.quote-card:nth-child(1) .quote-meta-ref { color: var(--color-gold); background: transparent; }

.quote-card:hover { transform: translateY(-5px); box-shadow: 0 15px 35px rgba(0,0,0,0.1); border-color: rgba(212, 175, 55, 0.6); }

/* Typography inside card */
.quote-content-wrapper { flex-grow: 1; position: relative; z-index: 2; }
.quote-arabic {
  font-family: var(--font-arabic);
  font-size: 2rem;
  line-height: 1.8;
  color: var(--color-emerald);
  text-align: center;
  direction: rtl;
  margin-bottom: 25px;
}
.quote-english {
  font-family: var(--font-body);
  font-size: 1.1rem;
  color: var(--color-text-main);
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.6;
}
.quote-urdu {
  font-family: 'Jameel Noori Nastaleeque', 'Amiri', serif;
  font-size: 1.5rem;
  color: var(--color-text-muted);
  text-align: center;
  direction: rtl;
  line-height: 2.2;
  margin-bottom: 20px;
}
.quote-meta-ref {
  text-align: center;
  display: block;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-gold);
  background: transparent;
  padding: 0;
  margin: 0 auto;
  position: relative; z-index: 2;
}

/* Translation Toggle Wrapper */
.translation-wrapper { display: none; }
.translation-wrapper.active { display: block; animation: fadeIn 0.3s ease; }

/* Interactive Buttons */
.card-actions, .btn-toggle-trans { display: none !important; }
.btn-icon {
  background: var(--color-bg);
  border: 1px solid #e2e8f0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
}
.btn-icon:hover { background: var(--color-emerald); color: white; border-color: var(--color-emerald); }
.btn-icon.gold:hover { background: var(--color-gold); color: white; border-color: var(--color-gold); }
.btn-icon.whatsapp:hover { background: #25D366; color: white; border-color: #25D366; }

.btn-toggle-trans {
  background: white;
  border: 1px solid var(--color-gold);
  color: var(--color-gold);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 15px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
  margin: 0 auto 20px;
  display: block;
}
.btn-toggle-trans:hover { background: var(--color-gold); color: white; }

/* About Section */
.about-section {
  text-align: center;
  margin: 60px 0;
  padding: 60px 40px;
  background-color: #f8f9fa;
  border-radius: var(--border-radius);
  position: relative;
  overflow: hidden;
}
.about-icon { display: none; }
.about-title { font-size: 2.2rem; color: var(--color-emerald); margin-bottom: 25px; font-weight: 700; display: block; position: relative; }
.about-text {
  font-size: 1.15rem;
  color: var(--color-text-main);
  max-width: 800px;
  margin: 0 auto;
  line-height: 30px; /* Specific requirement */
}

/* Consistent Emerald Footer */
.site-footer {
  background: var(--color-emerald);
  color: white;
  padding: 60px 0 20px;
  border-top: 2px solid rgba(212, 175, 55, 0.2);
  position: relative;
}
.site-footer::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 35px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 30'%3E%3Cpath fill='%23004d40' opacity='0.8' d='M50 0 C60 15 80 15 100 15 C80 15 60 15 50 30 C40 15 20 15 0 15 C20 15 40 15 50 0 Z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 10;
}
.footer-container { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-widget h3 { color: var(--color-gold); margin-bottom: 15px; font-size: 1.3rem; }
.footer-widget p { color: rgba(255,255,255,0.8); line-height: 1.8; margin-bottom: 15px; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: rgba(255,255,255,0.8); }
.footer-links a:hover { color: var(--color-gold); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.social-icons { display: flex; gap: 15px; }
.social-icons a {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex; align-items: center; justify-content: center;
  color: white;
  transition: var(--transition);
}
.social-icons a:hover { background: var(--color-gold); transform: translateY(-3px); }

/* Pagination Override */
.pagination { text-align: center; margin: 40px 0; }
.pagination .page-numbers { display: inline-block; padding: 10px 18px; margin: 0 5px; border-radius: 8px; background: white; color: var(--color-text-main); font-weight: 600; box-shadow: var(--shadow-soft); transition: var(--transition); }
.pagination .page-numbers:hover, .pagination .page-numbers.current { background: var(--color-emerald); color: white; }

/* Responsive */
@media (max-width: 991px) {
  .grid-sizer, .grid-item { width: calc(50% - 30px); }
  .footer-container { grid-template-columns: 1fr; text-align: center; }
  .nav-menu { display: none; } /* Mobile toggle implementation needed for robust theme */
}
@media (max-width: 768px) {
  .grid-sizer, .grid-item { width: calc(100% - 30px); }
  .hero-title { font-size: 2.5rem; }
  .footer-bottom { flex-direction: column; gap: 20px; text-align: center; }
}
